diff --git a/FORK.md b/FORK.md index 5dc76fa..072ec62 100644 --- a/FORK.md +++ b/FORK.md @@ -24,7 +24,7 @@ dsh plugin --profile web add -w "github:hansjone/dsh-im-ops" # 重启 dsh web ``` -包名:`dsh-im-ops@4.9.1-ops.2`(cordis id:`dsh-im-ops`)。 +包名:`dsh-im-ops@4.9.1-ops.3`(cordis id:`dsh-im-ops`)。 扫码态一般仍在 `~/.dsh/integrations/…`;换包后若异常,在 IM 设置里重新关联设备。 @@ -38,7 +38,7 @@ dsh plugin --profile web add -w "github:hansjone/dsh-im-ops" 2. **访问控制**仍由本 fork 持久化(`workspaces.json` 的 `accessPolicies`),设置 UI 与上游同构,运维可直接改白名单 / open 模式 -3. **WhatsApp LID**:群参与者常为不透明 `@lid`,白名单只填手机号时会被静默拒绝。`4.9.1-ops.2` 用 Baileys LID→PN 映射扩展 sender 别名,并在 @ 提及匹配时同样解析;若仍被拒绝会回一句白名单提示 +3. **WhatsApp LID**:群参与者常为不透明 `@lid`,白名单只填手机号时会被静默拒绝。`4.9.1-ops.3` 用 Baileys LID→PN 映射扩展 sender 别名,并在 @ 提及匹配时同样解析;若仍被拒绝会回一句白名单提示 4. **主动群通告**继续用既有 delivery(`botId + targetId`),与入站 Session 策略独立 diff --git a/lib/client.js b/lib/client.js index e8291c3..571d94e 100644 --- a/lib/client.js +++ b/lib/client.js @@ -571,7 +571,7 @@ var React23 = __toESM(require("react"), 1); // package.json var package_default = { name: "dsh-im-ops", - version: "4.9.1-ops.2", + version: "4.9.1-ops.3", description: "Ops fork of dsh-im (all channels kept). Based on @xmanrui/dsh-im@4.9.1 \u2014 access/session policies owned here.", keywords: [ "deepseek-harness", diff --git a/lib/index.js b/lib/index.js index 1ceb320..843ae92 100644 --- a/lib/index.js +++ b/lib/index.js @@ -4,28 +4,28 @@ import { fileURLToPath as __dshFileURLToPath } from 'node:url'; const require = __dshCreateRequire(import.meta.url); const __filename = __dshFileURLToPath(import.meta.url); const __dirname = __dshDirname(__filename); -var Ipe=Object.create;var I_=Object.defineProperty;var lpe=Object.getOwnPropertyDescriptor;var ppe=Object.getOwnPropertyNames;var dpe=Object.getPrototypeOf,hpe=Object.prototype.hasOwnProperty;var $e=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var ue=(n,t)=>()=>(n&&(t=n(n=0)),t);var ee=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),Lr=(n,t)=>{for(var o in t)I_(n,o,{get:t[o],enumerable:!0})},Epe=(n,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of ppe(t))!hpe.call(n,e)&&e!==o&&I_(n,e,{get:()=>t[e],enumerable:!(a=lpe(t,e))||a.enumerable});return n};var ze=(n,t,o)=>(o=n!=null?Ipe(dpe(n)):{},Epe(t||!n||!n.__esModule?I_(o,"default",{value:n,enumerable:!0}):o,n));var Mj=ee((inA,bj)=>{var Oj=$e("stream").Stream,Vye=$e("util");bj.exports=Mn;function Mn(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}Vye.inherits(Mn,Oj);Mn.create=function(n,t){var o=new this;t=t||{};for(var a in t)o[a]=t[a];o.source=n;var e=n.emit;return n.emit=function(){return o._handleEmit(arguments),e.apply(n,arguments)},n.on("error",function(){}),o.pauseStream&&n.pause(),o};Object.defineProperty(Mn.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});Mn.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Mn.prototype.resume=function(){this._released||this.release(),this.source.resume()};Mn.prototype.pause=function(){this.source.pause()};Mn.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(n){this.emit.apply(this,n)}.bind(this)),this._bufferedEvents=[]};Mn.prototype.pipe=function(){var n=Oj.prototype.pipe.apply(this,arguments);return this.resume(),n};Mn.prototype._handleEmit=function(n){if(this._released){this.emit.apply(this,n);return}n[0]==="data"&&(this.dataSize+=n[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(n)};Mn.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var n="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(n))}}});var Rj=ee((anA,Nj)=>{var Wye=$e("util"),Tj=$e("stream").Stream,_j=Mj();Nj.exports=wr;function wr(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}Wye.inherits(wr,Tj);wr.create=function(n){var t=new this;n=n||{};for(var o in n)t[o]=n[o];return t};wr.isStreamLike=function(n){return typeof n!="function"&&typeof n!="string"&&typeof n!="boolean"&&typeof n!="number"&&!Buffer.isBuffer(n)};wr.prototype.append=function(n){var t=wr.isStreamLike(n);if(t){if(!(n instanceof _j)){var o=_j.create(n,{maxDataSize:1/0,pauseStream:this.pauseStreams});n.on("data",this._checkDataSize.bind(this)),n=o}this._handleErrors(n),this.pauseStreams&&n.pause()}return this._streams.push(n),this};wr.prototype.pipe=function(n,t){return Tj.prototype.pipe.call(this,n,t),this.resume(),n};wr.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};wr.prototype._realGetNext=function(){var n=this._streams.shift();if(typeof n>"u"){this.end();return}if(typeof n!="function"){this._pipeNext(n);return}var t=n;t(function(o){var a=wr.isStreamLike(o);a&&(o.on("data",this._checkDataSize.bind(this)),this._handleErrors(o)),this._pipeNext(o)}.bind(this))};wr.prototype._pipeNext=function(n){this._currentStream=n;var t=wr.isStreamLike(n);if(t){n.on("end",this._getNext.bind(this)),n.pipe(this,{end:!1});return}var o=n;this.write(o),this._getNext()};wr.prototype._handleErrors=function(n){var t=this;n.on("error",function(o){t._emitError(o)})};wr.prototype.write=function(n){this.emit("data",n)};wr.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};wr.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};wr.prototype.end=function(){this._reset(),this.emit("end")};wr.prototype.destroy=function(){this._reset(),this.emit("close")};wr.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};wr.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var n="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(n))}};wr.prototype._updateDataSize=function(){this.dataSize=0;var n=this;this._streams.forEach(function(t){t.dataSize&&(n.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};wr.prototype._emitError=function(n){this._reset(),this.emit("error",n)}});var kj=ee((onA,Zye)=>{Zye.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var Pj=ee((nnA,vj)=>{vj.exports=kj()});var Lj=ee(Ka=>{"use strict";var Py=Pj(),Xye=$e("path").extname,Gj=/^\s*([^;\s]*)(?:;|\s|$)/,$ye=/^text\//i;Ka.charset=Fj;Ka.charsets={lookup:Fj};Ka.contentType=eme;Ka.extension=Ame;Ka.extensions=Object.create(null);Ka.lookup=tme;Ka.types=Object.create(null);rme(Ka.extensions,Ka.types);function Fj(n){if(!n||typeof n!="string")return!1;var t=Gj.exec(n),o=t&&Py[t[1].toLowerCase()];return o&&o.charset?o.charset:t&&$ye.test(t[1])?"UTF-8":!1}function eme(n){if(!n||typeof n!="string")return!1;var t=n.indexOf("/")===-1?Ka.lookup(n):n;if(!t)return!1;if(t.indexOf("charset")===-1){var o=Ka.charset(t);o&&(t+="; charset="+o.toLowerCase())}return t}function Ame(n){if(!n||typeof n!="string")return!1;var t=Gj.exec(n),o=t&&Ka.extensions[t[1].toLowerCase()];return!o||!o.length?!1:o[0]}function tme(n){if(!n||typeof n!="string")return!1;var t=Xye("x."+n).toLowerCase().substr(1);return t&&Ka.types[t]||!1}function rme(n,t){var o=["nginx","apache",void 0,"iana"];Object.keys(Py).forEach(function(e){var i=Py[e],A=i.extensions;if(!(!A||!A.length)){n[e]=A;for(var r=0;rc||g===c&&t[s].substr(0,12)==="application/"))continue}t[s]=e}}})}});var Hj=ee((gnA,Uj)=>{Uj.exports=ime;function ime(n){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(n):setTimeout(n,0)}});var WT=ee((cnA,xj)=>{var Kj=Hj();xj.exports=ame;function ame(n){var t=!1;return Kj(function(){t=!0}),function(a,e){t?n(a,e):Kj(function(){n(a,e)})}}});var ZT=ee((InA,Yj)=>{Yj.exports=ome;function ome(n){Object.keys(n.jobs).forEach(nme.bind(n)),n.jobs={}}function nme(n){typeof this.jobs[n]=="function"&&this.jobs[n]()}});var XT=ee((lnA,Jj)=>{var jj=WT(),sme=ZT();Jj.exports=gme;function gme(n,t,o,a){var e=o.keyedList?o.keyedList[o.index]:o.index;o.jobs[e]=cme(t,e,n[e],function(i,A){e in o.jobs&&(delete o.jobs[e],i?sme(o):o.results[e]=A,a(i,o.results))})}function cme(n,t,o,a){var e;return n.length==2?e=n(o,jj(a)):e=n(o,t,jj(a)),e}});var $T=ee((pnA,qj)=>{qj.exports=Ime;function Ime(n,t){var o=!Array.isArray(n),a={index:0,keyedList:o||t?Object.keys(n):null,jobs:{},results:o?{}:[],size:o?Object.keys(n).length:n.length};return t&&a.keyedList.sort(o?t:function(e,i){return t(n[e],n[i])}),a}});var e0=ee((dnA,zj)=>{var lme=ZT(),pme=WT();zj.exports=dme;function dme(n){Object.keys(this.jobs).length&&(this.index=this.size,lme(this),pme(n)(null,this.results))}});var Wj=ee((hnA,Vj)=>{var hme=XT(),Eme=$T(),ume=e0();Vj.exports=Cme;function Cme(n,t,o){for(var a=Eme(n);a.index<(a.keyedList||n).length;)hme(n,t,a,function(e,i){if(e){o(e,i);return}if(Object.keys(a.jobs).length===0){o(null,a.results);return}}),a.index++;return ume.bind(a,o)}});var A0=ee((EnA,Gy)=>{var Zj=XT(),Bme=$T(),fme=e0();Gy.exports=Qme;Gy.exports.ascending=Xj;Gy.exports.descending=yme;function Qme(n,t,o,a){var e=Bme(n,o);return Zj(n,t,e,function i(A,r){if(A){a(A,r);return}if(e.index++,e.index<(e.keyedList||n).length){Zj(n,t,e,i);return}a(null,e.results)}),fme.bind(e,a)}function Xj(n,t){return nt?1:0}function yme(n,t){return-1*Xj(n,t)}});var eJ=ee((unA,$j)=>{var mme=A0();$j.exports=Sme;function Sme(n,t,o){return mme(n,t,null,o)}});var tJ=ee((CnA,AJ)=>{AJ.exports={parallel:Wj(),serial:eJ(),serialOrdered:A0()}});var t0=ee((BnA,rJ)=>{"use strict";rJ.exports=Object});var aJ=ee((fnA,iJ)=>{"use strict";iJ.exports=Error});var nJ=ee((QnA,oJ)=>{"use strict";oJ.exports=EvalError});var gJ=ee((ynA,sJ)=>{"use strict";sJ.exports=RangeError});var IJ=ee((mnA,cJ)=>{"use strict";cJ.exports=ReferenceError});var pJ=ee((SnA,lJ)=>{"use strict";lJ.exports=SyntaxError});var wc=ee((wnA,dJ)=>{"use strict";dJ.exports=TypeError});var EJ=ee((DnA,hJ)=>{"use strict";hJ.exports=URIError});var CJ=ee((OnA,uJ)=>{"use strict";uJ.exports=Math.abs});var fJ=ee((bnA,BJ)=>{"use strict";BJ.exports=Math.floor});var yJ=ee((MnA,QJ)=>{"use strict";QJ.exports=Math.max});var SJ=ee((_nA,mJ)=>{"use strict";mJ.exports=Math.min});var DJ=ee((TnA,wJ)=>{"use strict";wJ.exports=Math.pow});var bJ=ee((NnA,OJ)=>{"use strict";OJ.exports=Math.round});var _J=ee((RnA,MJ)=>{"use strict";MJ.exports=Number.isNaN||function(t){return t!==t}});var NJ=ee((knA,TJ)=>{"use strict";var wme=_J();TJ.exports=function(t){return wme(t)||t===0?t:t<0?-1:1}});var kJ=ee((vnA,RJ)=>{"use strict";RJ.exports=Object.getOwnPropertyDescriptor});var r0=ee((PnA,vJ)=>{"use strict";var Fy=kJ();if(Fy)try{Fy([],"length")}catch{Fy=null}vJ.exports=Fy});var i0=ee((GnA,PJ)=>{"use strict";var Ly=Object.defineProperty||!1;if(Ly)try{Ly({},"a",{value:1})}catch{Ly=!1}PJ.exports=Ly});var a0=ee((FnA,GJ)=>{"use strict";GJ.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},o=Symbol("test"),a=Object(o);if(typeof o=="string"||Object.prototype.toString.call(o)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var e=42;t[o]=e;for(var i in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var A=Object.getOwnPropertySymbols(t);if(A.length!==1||A[0]!==o||!Object.prototype.propertyIsEnumerable.call(t,o))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(t,o);if(r.value!==e||r.enumerable!==!0)return!1}return!0}});var UJ=ee((LnA,LJ)=>{"use strict";var FJ=typeof Symbol<"u"&&Symbol,Dme=a0();LJ.exports=function(){return typeof FJ!="function"||typeof Symbol!="function"||typeof FJ("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Dme()}});var o0=ee((UnA,HJ)=>{"use strict";HJ.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var n0=ee((HnA,KJ)=>{"use strict";var Ome=t0();KJ.exports=Ome.getPrototypeOf||null});var jJ=ee((KnA,YJ)=>{"use strict";var bme="Function.prototype.bind called on incompatible ",Mme=Object.prototype.toString,_me=Math.max,Tme="[object Function]",xJ=function(t,o){for(var a=[],e=0;e{"use strict";var kme=jJ();JJ.exports=Function.prototype.bind||kme});var Uy=ee((YnA,qJ)=>{"use strict";qJ.exports=Function.prototype.call});var s0=ee((jnA,zJ)=>{"use strict";zJ.exports=Function.prototype.apply});var WJ=ee((JnA,VJ)=>{"use strict";VJ.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var XJ=ee((qnA,ZJ)=>{"use strict";var vme=_u(),Pme=s0(),Gme=Uy(),Fme=WJ();ZJ.exports=Fme||vme.call(Gme,Pme)});var g0=ee((znA,$J)=>{"use strict";var Lme=_u(),Ume=wc(),Hme=Uy(),Kme=XJ();$J.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new Ume("a function is required");return Kme(Lme,Hme,t)}});var aq=ee((VnA,iq)=>{"use strict";var xme=g0(),eq=r0(),tq;try{tq=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var c0=!!tq&&eq&&eq(Object.prototype,"__proto__"),rq=Object,Aq=rq.getPrototypeOf;iq.exports=c0&&typeof c0.get=="function"?xme([c0.get]):typeof Aq=="function"?function(t){return Aq(t==null?t:rq(t))}:!1});var cq=ee((WnA,gq)=>{"use strict";var oq=o0(),nq=n0(),sq=aq();gq.exports=oq?function(t){return oq(t)}:nq?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return nq(t)}:sq?function(t){return sq(t)}:null});var Hy=ee((ZnA,Iq)=>{"use strict";var Yme=Function.prototype.call,jme=Object.prototype.hasOwnProperty,Jme=_u();Iq.exports=Jme.call(Yme,jme)});var ku=ee((XnA,uq)=>{"use strict";var nt,qme=t0(),zme=aJ(),Vme=nJ(),Wme=gJ(),Zme=IJ(),Qd=pJ(),fd=wc(),Xme=EJ(),$me=CJ(),eSe=fJ(),ASe=yJ(),tSe=SJ(),rSe=DJ(),iSe=bJ(),aSe=NJ(),hq=Function,I0=function(n){try{return hq('"use strict"; return ('+n+").constructor;")()}catch{}},Tu=r0(),oSe=i0(),l0=function(){throw new fd},nSe=Tu?(function(){try{return arguments.callee,l0}catch{try{return Tu(arguments,"callee").get}catch{return l0}}})():l0,Cd=UJ()(),ci=cq(),sSe=n0(),gSe=o0(),Eq=s0(),Nu=Uy(),Bd={},cSe=typeof Uint8Array>"u"||!ci?nt:ci(Uint8Array),tl={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?nt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?nt:ArrayBuffer,"%ArrayIteratorPrototype%":Cd&&ci?ci([][Symbol.iterator]()):nt,"%AsyncFromSyncIteratorPrototype%":nt,"%AsyncFunction%":Bd,"%AsyncGenerator%":Bd,"%AsyncGeneratorFunction%":Bd,"%AsyncIteratorPrototype%":Bd,"%Atomics%":typeof Atomics>"u"?nt:Atomics,"%BigInt%":typeof BigInt>"u"?nt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?nt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?nt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?nt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":zme,"%eval%":eval,"%EvalError%":Vme,"%Float16Array%":typeof Float16Array>"u"?nt:Float16Array,"%Float32Array%":typeof Float32Array>"u"?nt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?nt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?nt:FinalizationRegistry,"%Function%":hq,"%GeneratorFunction%":Bd,"%Int8Array%":typeof Int8Array>"u"?nt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?nt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?nt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Cd&&ci?ci(ci([][Symbol.iterator]())):nt,"%JSON%":typeof JSON=="object"?JSON:nt,"%Map%":typeof Map>"u"?nt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Cd||!ci?nt:ci(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":qme,"%Object.getOwnPropertyDescriptor%":Tu,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?nt:Promise,"%Proxy%":typeof Proxy>"u"?nt:Proxy,"%RangeError%":Wme,"%ReferenceError%":Zme,"%Reflect%":typeof Reflect>"u"?nt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?nt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Cd||!ci?nt:ci(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?nt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Cd&&ci?ci(""[Symbol.iterator]()):nt,"%Symbol%":Cd?Symbol:nt,"%SyntaxError%":Qd,"%ThrowTypeError%":nSe,"%TypedArray%":cSe,"%TypeError%":fd,"%Uint8Array%":typeof Uint8Array>"u"?nt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?nt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?nt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?nt:Uint32Array,"%URIError%":Xme,"%WeakMap%":typeof WeakMap>"u"?nt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?nt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?nt:WeakSet,"%Function.prototype.call%":Nu,"%Function.prototype.apply%":Eq,"%Object.defineProperty%":oSe,"%Object.getPrototypeOf%":sSe,"%Math.abs%":$me,"%Math.floor%":eSe,"%Math.max%":ASe,"%Math.min%":tSe,"%Math.pow%":rSe,"%Math.round%":iSe,"%Math.sign%":aSe,"%Reflect.getPrototypeOf%":gSe};if(ci)try{null.error}catch(n){lq=ci(ci(n)),tl["%Error.prototype%"]=lq}var lq,ISe=function n(t){var o;if(t==="%AsyncFunction%")o=I0("async function () {}");else if(t==="%GeneratorFunction%")o=I0("function* () {}");else if(t==="%AsyncGeneratorFunction%")o=I0("async function* () {}");else if(t==="%AsyncGenerator%"){var a=n("%AsyncGeneratorFunction%");a&&(o=a.prototype)}else if(t==="%AsyncIteratorPrototype%"){var e=n("%AsyncGenerator%");e&&ci&&(o=ci(e.prototype))}return tl[t]=o,o},pq={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ru=_u(),Ky=Hy(),lSe=Ru.call(Nu,Array.prototype.concat),pSe=Ru.call(Eq,Array.prototype.splice),dq=Ru.call(Nu,String.prototype.replace),xy=Ru.call(Nu,String.prototype.slice),dSe=Ru.call(Nu,RegExp.prototype.exec),hSe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ESe=/\\(\\)?/g,uSe=function(t){var o=xy(t,0,1),a=xy(t,-1);if(o==="%"&&a!=="%")throw new Qd("invalid intrinsic syntax, expected closing `%`");if(a==="%"&&o!=="%")throw new Qd("invalid intrinsic syntax, expected opening `%`");var e=[];return dq(t,hSe,function(i,A,r,s){e[e.length]=r?dq(s,ESe,"$1"):A||i}),e},CSe=function(t,o){var a=t,e;if(Ky(pq,a)&&(e=pq[a],a="%"+e[0]+"%"),Ky(tl,a)){var i=tl[a];if(i===Bd&&(i=ISe(a)),typeof i>"u"&&!o)throw new fd("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:e,name:a,value:i}}throw new Qd("intrinsic "+t+" does not exist!")};uq.exports=function(t,o){if(typeof t!="string"||t.length===0)throw new fd("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof o!="boolean")throw new fd('"allowMissing" argument must be a boolean');if(dSe(/^%?[^%]*%?$/,t)===null)throw new Qd("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var a=uSe(t),e=a.length>0?a[0]:"",i=CSe("%"+e+"%",o),A=i.name,r=i.value,s=!1,g=i.alias;g&&(e=g[0],pSe(a,lSe([0,1],g)));for(var c=1,I=!0;c=a.length){var Q=Tu(r,p);I=!!Q,I&&"get"in Q&&!("originalValue"in Q.get)?r=Q.get:r=r[p]}else I=Ky(r,p),r=r[p];I&&!s&&(tl[A]=r)}}return r}});var Bq=ee(($nA,Cq)=>{"use strict";var BSe=a0();Cq.exports=function(){return BSe()&&!!Symbol.toStringTag}});var yq=ee((esA,Qq)=>{"use strict";var fSe=ku(),fq=fSe("%Object.defineProperty%",!0),QSe=Bq()(),ySe=Hy(),mSe=wc(),Yy=QSe?Symbol.toStringTag:null;Qq.exports=function(t,o){var a=arguments.length>2&&!!arguments[2]&&arguments[2].force,e=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof a<"u"&&typeof a!="boolean"||typeof e<"u"&&typeof e!="boolean")throw new mSe("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Yy&&(a||!ySe(t,Yy))&&(fq?fq(t,Yy,{configurable:!e,enumerable:!1,value:o,writable:!1}):t[Yy]=o)}});var Sq=ee((AsA,mq)=>{"use strict";mq.exports=function(n,t){return Object.keys(t).forEach(function(o){n[o]=n[o]||t[o]}),n}});var Oq=ee((tsA,Dq)=>{"use strict";var E0=Rj(),SSe=$e("util"),p0=$e("path"),wSe=$e("http"),DSe=$e("https"),OSe=$e("url").parse,bSe=$e("fs"),MSe=$e("stream").Stream,_Se=$e("crypto"),d0=Lj(),TSe=tJ(),NSe=yq(),Dc=Hy(),h0=Sq();function wq(n){return String(n).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}function Bt(n){if(!(this instanceof Bt))return new Bt(n);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],E0.call(this),n=n||{};for(var t in n)this[t]=n[t]}SSe.inherits(Bt,E0);Bt.LINE_BREAK=`\r -`;Bt.DEFAULT_CONTENT_TYPE="application/octet-stream";Bt.prototype.append=function(n,t,o){o=o||{},typeof o=="string"&&(o={filename:o});var a=E0.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var e=this._multiPartHeader(n,t,o),i=this._multiPartFooter();a(e),a(t),a(i),this._trackLength(e,t,o)};Bt.prototype._trackLength=function(n,t,o){var a=0;o.knownLength!=null?a+=Number(o.knownLength):Buffer.isBuffer(t)?a=t.length:typeof t=="string"&&(a=Buffer.byteLength(t)),this._valueLength+=a,this._overheadLength+=Buffer.byteLength(n)+Bt.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Dc(t,"httpVersion"))&&!(t instanceof MSe))&&(o.knownLength||this._valuesToMeasure.push(t))};Bt.prototype._lengthRetriever=function(n,t){Dc(n,"fd")?n.end!=null&&n.end!=1/0&&n.start!=null?t(null,n.end+1-(n.start?n.start:0)):bSe.stat(n.path,function(o,a){if(o){t(o);return}var e=a.size-(n.start?n.start:0);t(null,e)}):Dc(n,"httpVersion")?t(null,Number(n.headers["content-length"])):Dc(n,"httpModule")?(n.on("response",function(o){n.pause(),t(null,Number(o.headers["content-length"]))}),n.resume()):t("Unknown stream")};Bt.prototype._multiPartHeader=function(n,t,o){if(typeof o.header=="string")return o.header;var a=this._getContentDisposition(t,o),e=this._getContentType(t,o),i="",A={"Content-Disposition":["form-data",'name="'+wq(n)+'"'].concat(a||[]),"Content-Type":[].concat(e||[])};typeof o.header=="object"&&h0(A,o.header);var r;for(var s in A)if(Dc(A,s)){if(r=A[s],r==null)continue;Array.isArray(r)||(r=[r]),r.length&&(i+=s+": "+r.join("; ")+Bt.LINE_BREAK)}return"--"+this.getBoundary()+Bt.LINE_BREAK+i+Bt.LINE_BREAK};Bt.prototype._getContentDisposition=function(n,t){var o;if(typeof t.filepath=="string"?o=p0.normalize(t.filepath).replace(/\\/g,"/"):t.filename||n&&(n.name||n.path)?o=p0.basename(t.filename||n&&(n.name||n.path)):n&&n.readable&&Dc(n,"httpVersion")&&(o=p0.basename(n.client._httpMessage.path||"")),o)return'filename="'+wq(o)+'"'};Bt.prototype._getContentType=function(n,t){var o=t.contentType;return!o&&n&&n.name&&(o=d0.lookup(n.name)),!o&&n&&n.path&&(o=d0.lookup(n.path)),!o&&n&&n.readable&&Dc(n,"httpVersion")&&(o=n.headers["content-type"]),!o&&(t.filepath||t.filename)&&(o=d0.lookup(t.filepath||t.filename)),!o&&n&&typeof n=="object"&&(o=Bt.DEFAULT_CONTENT_TYPE),o};Bt.prototype._multiPartFooter=function(){return function(n){var t=Bt.LINE_BREAK,o=this._streams.length===0;o&&(t+=this._lastBoundary()),n(t)}.bind(this)};Bt.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Bt.LINE_BREAK};Bt.prototype.getHeaders=function(n){var t,o={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in n)Dc(n,t)&&(o[t.toLowerCase()]=n[t]);return o};Bt.prototype.setBoundary=function(n){if(typeof n!="string")throw new TypeError("FormData boundary must be a string");this._boundary=n};Bt.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Bt.prototype.getBuffer=function(){for(var n=new Buffer.alloc(0),t=this.getBoundary(),o=0,a=this._streams.length;o{var Sd=1e3,wd=Sd*60,Dd=wd*60,al=Dd*24,twe=al*7,rwe=al*365.25;Kq.exports=function(n,t){t=t||{};var o=typeof n;if(o==="string"&&n.length>0)return iwe(n);if(o==="number"&&isFinite(n))return t.long?owe(n):awe(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function iwe(n){if(n=String(n),!(n.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(t){var o=parseFloat(t[1]),a=(t[2]||"ms").toLowerCase();switch(a){case"years":case"year":case"yrs":case"yr":case"y":return o*rwe;case"weeks":case"week":case"w":return o*twe;case"days":case"day":case"d":return o*al;case"hours":case"hour":case"hrs":case"hr":case"h":return o*Dd;case"minutes":case"minute":case"mins":case"min":case"m":return o*wd;case"seconds":case"second":case"secs":case"sec":case"s":return o*Sd;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}function awe(n){var t=Math.abs(n);return t>=al?Math.round(n/al)+"d":t>=Dd?Math.round(n/Dd)+"h":t>=wd?Math.round(n/wd)+"m":t>=Sd?Math.round(n/Sd)+"s":n+"ms"}function owe(n){var t=Math.abs(n);return t>=al?zy(n,t,al,"day"):t>=Dd?zy(n,t,Dd,"hour"):t>=wd?zy(n,t,wd,"minute"):t>=Sd?zy(n,t,Sd,"second"):n+" ms"}function zy(n,t,o,a){var e=t>=o*1.5;return Math.round(n/o)+" "+a+(e?"s":"")}});var N0=ee((agA,Yq)=>{function nwe(n){o.debug=o,o.default=o,o.coerce=s,o.disable=A,o.enable=e,o.enabled=r,o.humanize=xq(),o.destroy=g,Object.keys(n).forEach(c=>{o[c]=n[c]}),o.names=[],o.skips=[],o.formatters={};function t(c){let I=0;for(let p=0;p{if(U==="%%")return"%";R++;let q=o.formatters[F];if(typeof q=="function"){let z=y[R];U=q.call(m,z),y.splice(R,1),R--}return U}),o.formatArgs.call(m,y),(m.log||o.log).apply(m,y)}return Q.namespace=c,Q.useColors=o.useColors(),Q.color=o.selectColor(c),Q.extend=a,Q.destroy=o.destroy,Object.defineProperty(Q,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(B!==o.namespaces&&(B=o.namespaces,f=o.enabled(c)),f),set:y=>{p=y}}),typeof o.init=="function"&&o.init(Q),Q}function a(c,I){let p=o(this.namespace+(typeof I>"u"?":":I)+c);return p.log=this.log,p}function e(c){o.save(c),o.namespaces=c,o.names=[],o.skips=[];let I=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of I)p[0]==="-"?o.skips.push(p.slice(1)):o.names.push(p)}function i(c,I){let p=0,B=0,f=-1,Q=0;for(;p"-"+I)].join(",");return o.enable(""),c}function r(c){for(let I of o.skips)if(i(c,I))return!1;for(let I of o.names)if(i(c,I))return!0;return!1}function s(c){return c instanceof Error?c.stack||c.message:c}function g(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}Yq.exports=nwe});var jq=ee((xa,Vy)=>{xa.formatArgs=gwe;xa.save=cwe;xa.load=Iwe;xa.useColors=swe;xa.storage=lwe();xa.destroy=(()=>{let n=!1;return()=>{n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();xa.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function swe(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function gwe(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Vy.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;n.splice(1,0,t,"color: inherit");let o=0,a=0;n[0].replace(/%[a-zA-Z%]/g,e=>{e!=="%%"&&(o++,e==="%c"&&(a=o))}),n.splice(a,0,t)}xa.log=console.debug||console.log||(()=>{});function cwe(n){try{n?xa.storage.setItem("debug",n):xa.storage.removeItem("debug")}catch{}}function Iwe(){let n;try{n=xa.storage.getItem("debug")||xa.storage.getItem("DEBUG")}catch{}return!n&&typeof process<"u"&&"env"in process&&(n=process.env.DEBUG),n}function lwe(){try{return localStorage}catch{}}Vy.exports=N0()(xa);var{formatters:pwe}=Vy.exports;pwe.j=function(n){try{return JSON.stringify(n)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var qq=ee((Ii,Zy)=>{var dwe=$e("tty"),Wy=$e("util");Ii.init=Qwe;Ii.log=Cwe;Ii.formatArgs=Ewe;Ii.save=Bwe;Ii.load=fwe;Ii.useColors=hwe;Ii.destroy=Wy.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Ii.colors=[6,2,3,4,5,1];try{let n=$e("supports-color");n&&(n.stderr||n).level>=2&&(Ii.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Ii.inspectOpts=Object.keys(process.env).filter(n=>/^debug_/i.test(n)).reduce((n,t)=>{let o=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,i)=>i.toUpperCase()),a=process.env[t];return/^(yes|on|true|enabled)$/i.test(a)?a=!0:/^(no|off|false|disabled)$/i.test(a)?a=!1:a==="null"?a=null:a=Number(a),n[o]=a,n},{});function hwe(){return"colors"in Ii.inspectOpts?!!Ii.inspectOpts.colors:dwe.isatty(process.stderr.fd)}function Ewe(n){let{namespace:t,useColors:o}=this;if(o){let a=this.color,e="\x1B[3"+(a<8?a:"8;5;"+a),i=` ${e};1m${t} \x1B[0m`;n[0]=i+n[0].split(` +var Ipe=Object.create;var I_=Object.defineProperty;var lpe=Object.getOwnPropertyDescriptor;var ppe=Object.getOwnPropertyNames;var dpe=Object.getPrototypeOf,hpe=Object.prototype.hasOwnProperty;var $e=(n=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(n,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):n)(function(n){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+n+'" is not supported')});var ue=(n,t)=>()=>(n&&(t=n(n=0)),t);var ee=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),Lr=(n,t)=>{for(var o in t)I_(n,o,{get:t[o],enumerable:!0})},Epe=(n,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of ppe(t))!hpe.call(n,e)&&e!==o&&I_(n,e,{get:()=>t[e],enumerable:!(a=lpe(t,e))||a.enumerable});return n};var ze=(n,t,o)=>(o=n!=null?Ipe(dpe(n)):{},Epe(t||!n||!n.__esModule?I_(o,"default",{value:n,enumerable:!0}):o,n));var Mj=ee((nnA,bj)=>{var Oj=$e("stream").Stream,Vye=$e("util");bj.exports=Mn;function Mn(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}Vye.inherits(Mn,Oj);Mn.create=function(n,t){var o=new this;t=t||{};for(var a in t)o[a]=t[a];o.source=n;var e=n.emit;return n.emit=function(){return o._handleEmit(arguments),e.apply(n,arguments)},n.on("error",function(){}),o.pauseStream&&n.pause(),o};Object.defineProperty(Mn.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});Mn.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};Mn.prototype.resume=function(){this._released||this.release(),this.source.resume()};Mn.prototype.pause=function(){this.source.pause()};Mn.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(n){this.emit.apply(this,n)}.bind(this)),this._bufferedEvents=[]};Mn.prototype.pipe=function(){var n=Oj.prototype.pipe.apply(this,arguments);return this.resume(),n};Mn.prototype._handleEmit=function(n){if(this._released){this.emit.apply(this,n);return}n[0]==="data"&&(this.dataSize+=n[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(n)};Mn.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var n="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(n))}}});var Rj=ee((snA,Nj)=>{var Wye=$e("util"),Tj=$e("stream").Stream,_j=Mj();Nj.exports=wr;function wr(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}Wye.inherits(wr,Tj);wr.create=function(n){var t=new this;n=n||{};for(var o in n)t[o]=n[o];return t};wr.isStreamLike=function(n){return typeof n!="function"&&typeof n!="string"&&typeof n!="boolean"&&typeof n!="number"&&!Buffer.isBuffer(n)};wr.prototype.append=function(n){var t=wr.isStreamLike(n);if(t){if(!(n instanceof _j)){var o=_j.create(n,{maxDataSize:1/0,pauseStream:this.pauseStreams});n.on("data",this._checkDataSize.bind(this)),n=o}this._handleErrors(n),this.pauseStreams&&n.pause()}return this._streams.push(n),this};wr.prototype.pipe=function(n,t){return Tj.prototype.pipe.call(this,n,t),this.resume(),n};wr.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};wr.prototype._realGetNext=function(){var n=this._streams.shift();if(typeof n>"u"){this.end();return}if(typeof n!="function"){this._pipeNext(n);return}var t=n;t(function(o){var a=wr.isStreamLike(o);a&&(o.on("data",this._checkDataSize.bind(this)),this._handleErrors(o)),this._pipeNext(o)}.bind(this))};wr.prototype._pipeNext=function(n){this._currentStream=n;var t=wr.isStreamLike(n);if(t){n.on("end",this._getNext.bind(this)),n.pipe(this,{end:!1});return}var o=n;this.write(o),this._getNext()};wr.prototype._handleErrors=function(n){var t=this;n.on("error",function(o){t._emitError(o)})};wr.prototype.write=function(n){this.emit("data",n)};wr.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};wr.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};wr.prototype.end=function(){this._reset(),this.emit("end")};wr.prototype.destroy=function(){this._reset(),this.emit("close")};wr.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};wr.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var n="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(n))}};wr.prototype._updateDataSize=function(){this.dataSize=0;var n=this;this._streams.forEach(function(t){t.dataSize&&(n.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};wr.prototype._emitError=function(n){this._reset(),this.emit("error",n)}});var kj=ee((gnA,Zye)=>{Zye.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var Pj=ee((cnA,vj)=>{vj.exports=kj()});var Lj=ee(Ka=>{"use strict";var Py=Pj(),Xye=$e("path").extname,Gj=/^\s*([^;\s]*)(?:;|\s|$)/,$ye=/^text\//i;Ka.charset=Fj;Ka.charsets={lookup:Fj};Ka.contentType=eme;Ka.extension=Ame;Ka.extensions=Object.create(null);Ka.lookup=tme;Ka.types=Object.create(null);rme(Ka.extensions,Ka.types);function Fj(n){if(!n||typeof n!="string")return!1;var t=Gj.exec(n),o=t&&Py[t[1].toLowerCase()];return o&&o.charset?o.charset:t&&$ye.test(t[1])?"UTF-8":!1}function eme(n){if(!n||typeof n!="string")return!1;var t=n.indexOf("/")===-1?Ka.lookup(n):n;if(!t)return!1;if(t.indexOf("charset")===-1){var o=Ka.charset(t);o&&(t+="; charset="+o.toLowerCase())}return t}function Ame(n){if(!n||typeof n!="string")return!1;var t=Gj.exec(n),o=t&&Ka.extensions[t[1].toLowerCase()];return!o||!o.length?!1:o[0]}function tme(n){if(!n||typeof n!="string")return!1;var t=Xye("x."+n).toLowerCase().substr(1);return t&&Ka.types[t]||!1}function rme(n,t){var o=["nginx","apache",void 0,"iana"];Object.keys(Py).forEach(function(e){var i=Py[e],A=i.extensions;if(!(!A||!A.length)){n[e]=A;for(var r=0;rc||g===c&&t[s].substr(0,12)==="application/"))continue}t[s]=e}}})}});var Hj=ee((lnA,Uj)=>{Uj.exports=ime;function ime(n){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(n):setTimeout(n,0)}});var WT=ee((pnA,xj)=>{var Kj=Hj();xj.exports=ame;function ame(n){var t=!1;return Kj(function(){t=!0}),function(a,e){t?n(a,e):Kj(function(){n(a,e)})}}});var ZT=ee((dnA,Yj)=>{Yj.exports=ome;function ome(n){Object.keys(n.jobs).forEach(nme.bind(n)),n.jobs={}}function nme(n){typeof this.jobs[n]=="function"&&this.jobs[n]()}});var XT=ee((hnA,Jj)=>{var jj=WT(),sme=ZT();Jj.exports=gme;function gme(n,t,o,a){var e=o.keyedList?o.keyedList[o.index]:o.index;o.jobs[e]=cme(t,e,n[e],function(i,A){e in o.jobs&&(delete o.jobs[e],i?sme(o):o.results[e]=A,a(i,o.results))})}function cme(n,t,o,a){var e;return n.length==2?e=n(o,jj(a)):e=n(o,t,jj(a)),e}});var $T=ee((EnA,qj)=>{qj.exports=Ime;function Ime(n,t){var o=!Array.isArray(n),a={index:0,keyedList:o||t?Object.keys(n):null,jobs:{},results:o?{}:[],size:o?Object.keys(n).length:n.length};return t&&a.keyedList.sort(o?t:function(e,i){return t(n[e],n[i])}),a}});var e0=ee((unA,zj)=>{var lme=ZT(),pme=WT();zj.exports=dme;function dme(n){Object.keys(this.jobs).length&&(this.index=this.size,lme(this),pme(n)(null,this.results))}});var Wj=ee((CnA,Vj)=>{var hme=XT(),Eme=$T(),ume=e0();Vj.exports=Cme;function Cme(n,t,o){for(var a=Eme(n);a.index<(a.keyedList||n).length;)hme(n,t,a,function(e,i){if(e){o(e,i);return}if(Object.keys(a.jobs).length===0){o(null,a.results);return}}),a.index++;return ume.bind(a,o)}});var A0=ee((BnA,Gy)=>{var Zj=XT(),Bme=$T(),fme=e0();Gy.exports=Qme;Gy.exports.ascending=Xj;Gy.exports.descending=yme;function Qme(n,t,o,a){var e=Bme(n,o);return Zj(n,t,e,function i(A,r){if(A){a(A,r);return}if(e.index++,e.index<(e.keyedList||n).length){Zj(n,t,e,i);return}a(null,e.results)}),fme.bind(e,a)}function Xj(n,t){return nt?1:0}function yme(n,t){return-1*Xj(n,t)}});var eJ=ee((fnA,$j)=>{var mme=A0();$j.exports=Sme;function Sme(n,t,o){return mme(n,t,null,o)}});var tJ=ee((QnA,AJ)=>{AJ.exports={parallel:Wj(),serial:eJ(),serialOrdered:A0()}});var t0=ee((ynA,rJ)=>{"use strict";rJ.exports=Object});var aJ=ee((mnA,iJ)=>{"use strict";iJ.exports=Error});var nJ=ee((SnA,oJ)=>{"use strict";oJ.exports=EvalError});var gJ=ee((wnA,sJ)=>{"use strict";sJ.exports=RangeError});var IJ=ee((DnA,cJ)=>{"use strict";cJ.exports=ReferenceError});var pJ=ee((OnA,lJ)=>{"use strict";lJ.exports=SyntaxError});var wc=ee((bnA,dJ)=>{"use strict";dJ.exports=TypeError});var EJ=ee((MnA,hJ)=>{"use strict";hJ.exports=URIError});var CJ=ee((_nA,uJ)=>{"use strict";uJ.exports=Math.abs});var fJ=ee((TnA,BJ)=>{"use strict";BJ.exports=Math.floor});var yJ=ee((NnA,QJ)=>{"use strict";QJ.exports=Math.max});var SJ=ee((RnA,mJ)=>{"use strict";mJ.exports=Math.min});var DJ=ee((knA,wJ)=>{"use strict";wJ.exports=Math.pow});var bJ=ee((vnA,OJ)=>{"use strict";OJ.exports=Math.round});var _J=ee((PnA,MJ)=>{"use strict";MJ.exports=Number.isNaN||function(t){return t!==t}});var NJ=ee((GnA,TJ)=>{"use strict";var wme=_J();TJ.exports=function(t){return wme(t)||t===0?t:t<0?-1:1}});var kJ=ee((FnA,RJ)=>{"use strict";RJ.exports=Object.getOwnPropertyDescriptor});var r0=ee((LnA,vJ)=>{"use strict";var Fy=kJ();if(Fy)try{Fy([],"length")}catch{Fy=null}vJ.exports=Fy});var i0=ee((UnA,PJ)=>{"use strict";var Ly=Object.defineProperty||!1;if(Ly)try{Ly({},"a",{value:1})}catch{Ly=!1}PJ.exports=Ly});var a0=ee((HnA,GJ)=>{"use strict";GJ.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},o=Symbol("test"),a=Object(o);if(typeof o=="string"||Object.prototype.toString.call(o)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var e=42;t[o]=e;for(var i in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var A=Object.getOwnPropertySymbols(t);if(A.length!==1||A[0]!==o||!Object.prototype.propertyIsEnumerable.call(t,o))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var r=Object.getOwnPropertyDescriptor(t,o);if(r.value!==e||r.enumerable!==!0)return!1}return!0}});var UJ=ee((KnA,LJ)=>{"use strict";var FJ=typeof Symbol<"u"&&Symbol,Dme=a0();LJ.exports=function(){return typeof FJ!="function"||typeof Symbol!="function"||typeof FJ("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Dme()}});var o0=ee((xnA,HJ)=>{"use strict";HJ.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var n0=ee((YnA,KJ)=>{"use strict";var Ome=t0();KJ.exports=Ome.getPrototypeOf||null});var jJ=ee((jnA,YJ)=>{"use strict";var bme="Function.prototype.bind called on incompatible ",Mme=Object.prototype.toString,_me=Math.max,Tme="[object Function]",xJ=function(t,o){for(var a=[],e=0;e{"use strict";var kme=jJ();JJ.exports=Function.prototype.bind||kme});var Uy=ee((qnA,qJ)=>{"use strict";qJ.exports=Function.prototype.call});var s0=ee((znA,zJ)=>{"use strict";zJ.exports=Function.prototype.apply});var WJ=ee((VnA,VJ)=>{"use strict";VJ.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var XJ=ee((WnA,ZJ)=>{"use strict";var vme=_u(),Pme=s0(),Gme=Uy(),Fme=WJ();ZJ.exports=Fme||vme.call(Gme,Pme)});var g0=ee((ZnA,$J)=>{"use strict";var Lme=_u(),Ume=wc(),Hme=Uy(),Kme=XJ();$J.exports=function(t){if(t.length<1||typeof t[0]!="function")throw new Ume("a function is required");return Kme(Lme,Hme,t)}});var aq=ee((XnA,iq)=>{"use strict";var xme=g0(),eq=r0(),tq;try{tq=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var c0=!!tq&&eq&&eq(Object.prototype,"__proto__"),rq=Object,Aq=rq.getPrototypeOf;iq.exports=c0&&typeof c0.get=="function"?xme([c0.get]):typeof Aq=="function"?function(t){return Aq(t==null?t:rq(t))}:!1});var cq=ee(($nA,gq)=>{"use strict";var oq=o0(),nq=n0(),sq=aq();gq.exports=oq?function(t){return oq(t)}:nq?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return nq(t)}:sq?function(t){return sq(t)}:null});var Hy=ee((esA,Iq)=>{"use strict";var Yme=Function.prototype.call,jme=Object.prototype.hasOwnProperty,Jme=_u();Iq.exports=Jme.call(Yme,jme)});var ku=ee((AsA,uq)=>{"use strict";var nt,qme=t0(),zme=aJ(),Vme=nJ(),Wme=gJ(),Zme=IJ(),Qd=pJ(),fd=wc(),Xme=EJ(),$me=CJ(),eSe=fJ(),ASe=yJ(),tSe=SJ(),rSe=DJ(),iSe=bJ(),aSe=NJ(),hq=Function,I0=function(n){try{return hq('"use strict"; return ('+n+").constructor;")()}catch{}},Tu=r0(),oSe=i0(),l0=function(){throw new fd},nSe=Tu?(function(){try{return arguments.callee,l0}catch{try{return Tu(arguments,"callee").get}catch{return l0}}})():l0,Cd=UJ()(),ci=cq(),sSe=n0(),gSe=o0(),Eq=s0(),Nu=Uy(),Bd={},cSe=typeof Uint8Array>"u"||!ci?nt:ci(Uint8Array),tl={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?nt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?nt:ArrayBuffer,"%ArrayIteratorPrototype%":Cd&&ci?ci([][Symbol.iterator]()):nt,"%AsyncFromSyncIteratorPrototype%":nt,"%AsyncFunction%":Bd,"%AsyncGenerator%":Bd,"%AsyncGeneratorFunction%":Bd,"%AsyncIteratorPrototype%":Bd,"%Atomics%":typeof Atomics>"u"?nt:Atomics,"%BigInt%":typeof BigInt>"u"?nt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?nt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?nt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?nt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":zme,"%eval%":eval,"%EvalError%":Vme,"%Float16Array%":typeof Float16Array>"u"?nt:Float16Array,"%Float32Array%":typeof Float32Array>"u"?nt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?nt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?nt:FinalizationRegistry,"%Function%":hq,"%GeneratorFunction%":Bd,"%Int8Array%":typeof Int8Array>"u"?nt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?nt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?nt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Cd&&ci?ci(ci([][Symbol.iterator]())):nt,"%JSON%":typeof JSON=="object"?JSON:nt,"%Map%":typeof Map>"u"?nt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Cd||!ci?nt:ci(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":qme,"%Object.getOwnPropertyDescriptor%":Tu,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?nt:Promise,"%Proxy%":typeof Proxy>"u"?nt:Proxy,"%RangeError%":Wme,"%ReferenceError%":Zme,"%Reflect%":typeof Reflect>"u"?nt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?nt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Cd||!ci?nt:ci(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?nt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Cd&&ci?ci(""[Symbol.iterator]()):nt,"%Symbol%":Cd?Symbol:nt,"%SyntaxError%":Qd,"%ThrowTypeError%":nSe,"%TypedArray%":cSe,"%TypeError%":fd,"%Uint8Array%":typeof Uint8Array>"u"?nt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?nt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?nt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?nt:Uint32Array,"%URIError%":Xme,"%WeakMap%":typeof WeakMap>"u"?nt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?nt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?nt:WeakSet,"%Function.prototype.call%":Nu,"%Function.prototype.apply%":Eq,"%Object.defineProperty%":oSe,"%Object.getPrototypeOf%":sSe,"%Math.abs%":$me,"%Math.floor%":eSe,"%Math.max%":ASe,"%Math.min%":tSe,"%Math.pow%":rSe,"%Math.round%":iSe,"%Math.sign%":aSe,"%Reflect.getPrototypeOf%":gSe};if(ci)try{null.error}catch(n){lq=ci(ci(n)),tl["%Error.prototype%"]=lq}var lq,ISe=function n(t){var o;if(t==="%AsyncFunction%")o=I0("async function () {}");else if(t==="%GeneratorFunction%")o=I0("function* () {}");else if(t==="%AsyncGeneratorFunction%")o=I0("async function* () {}");else if(t==="%AsyncGenerator%"){var a=n("%AsyncGeneratorFunction%");a&&(o=a.prototype)}else if(t==="%AsyncIteratorPrototype%"){var e=n("%AsyncGenerator%");e&&ci&&(o=ci(e.prototype))}return tl[t]=o,o},pq={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ru=_u(),Ky=Hy(),lSe=Ru.call(Nu,Array.prototype.concat),pSe=Ru.call(Eq,Array.prototype.splice),dq=Ru.call(Nu,String.prototype.replace),xy=Ru.call(Nu,String.prototype.slice),dSe=Ru.call(Nu,RegExp.prototype.exec),hSe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ESe=/\\(\\)?/g,uSe=function(t){var o=xy(t,0,1),a=xy(t,-1);if(o==="%"&&a!=="%")throw new Qd("invalid intrinsic syntax, expected closing `%`");if(a==="%"&&o!=="%")throw new Qd("invalid intrinsic syntax, expected opening `%`");var e=[];return dq(t,hSe,function(i,A,r,s){e[e.length]=r?dq(s,ESe,"$1"):A||i}),e},CSe=function(t,o){var a=t,e;if(Ky(pq,a)&&(e=pq[a],a="%"+e[0]+"%"),Ky(tl,a)){var i=tl[a];if(i===Bd&&(i=ISe(a)),typeof i>"u"&&!o)throw new fd("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:e,name:a,value:i}}throw new Qd("intrinsic "+t+" does not exist!")};uq.exports=function(t,o){if(typeof t!="string"||t.length===0)throw new fd("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof o!="boolean")throw new fd('"allowMissing" argument must be a boolean');if(dSe(/^%?[^%]*%?$/,t)===null)throw new Qd("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var a=uSe(t),e=a.length>0?a[0]:"",i=CSe("%"+e+"%",o),A=i.name,r=i.value,s=!1,g=i.alias;g&&(e=g[0],pSe(a,lSe([0,1],g)));for(var c=1,I=!0;c=a.length){var Q=Tu(r,p);I=!!Q,I&&"get"in Q&&!("originalValue"in Q.get)?r=Q.get:r=r[p]}else I=Ky(r,p),r=r[p];I&&!s&&(tl[A]=r)}}return r}});var Bq=ee((tsA,Cq)=>{"use strict";var BSe=a0();Cq.exports=function(){return BSe()&&!!Symbol.toStringTag}});var yq=ee((rsA,Qq)=>{"use strict";var fSe=ku(),fq=fSe("%Object.defineProperty%",!0),QSe=Bq()(),ySe=Hy(),mSe=wc(),Yy=QSe?Symbol.toStringTag:null;Qq.exports=function(t,o){var a=arguments.length>2&&!!arguments[2]&&arguments[2].force,e=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof a<"u"&&typeof a!="boolean"||typeof e<"u"&&typeof e!="boolean")throw new mSe("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Yy&&(a||!ySe(t,Yy))&&(fq?fq(t,Yy,{configurable:!e,enumerable:!1,value:o,writable:!1}):t[Yy]=o)}});var Sq=ee((isA,mq)=>{"use strict";mq.exports=function(n,t){return Object.keys(t).forEach(function(o){n[o]=n[o]||t[o]}),n}});var Oq=ee((asA,Dq)=>{"use strict";var E0=Rj(),SSe=$e("util"),p0=$e("path"),wSe=$e("http"),DSe=$e("https"),OSe=$e("url").parse,bSe=$e("fs"),MSe=$e("stream").Stream,_Se=$e("crypto"),d0=Lj(),TSe=tJ(),NSe=yq(),Dc=Hy(),h0=Sq();function wq(n){return String(n).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}function Bt(n){if(!(this instanceof Bt))return new Bt(n);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],E0.call(this),n=n||{};for(var t in n)this[t]=n[t]}SSe.inherits(Bt,E0);Bt.LINE_BREAK=`\r +`;Bt.DEFAULT_CONTENT_TYPE="application/octet-stream";Bt.prototype.append=function(n,t,o){o=o||{},typeof o=="string"&&(o={filename:o});var a=E0.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var e=this._multiPartHeader(n,t,o),i=this._multiPartFooter();a(e),a(t),a(i),this._trackLength(e,t,o)};Bt.prototype._trackLength=function(n,t,o){var a=0;o.knownLength!=null?a+=Number(o.knownLength):Buffer.isBuffer(t)?a=t.length:typeof t=="string"&&(a=Buffer.byteLength(t)),this._valueLength+=a,this._overheadLength+=Buffer.byteLength(n)+Bt.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Dc(t,"httpVersion"))&&!(t instanceof MSe))&&(o.knownLength||this._valuesToMeasure.push(t))};Bt.prototype._lengthRetriever=function(n,t){Dc(n,"fd")?n.end!=null&&n.end!=1/0&&n.start!=null?t(null,n.end+1-(n.start?n.start:0)):bSe.stat(n.path,function(o,a){if(o){t(o);return}var e=a.size-(n.start?n.start:0);t(null,e)}):Dc(n,"httpVersion")?t(null,Number(n.headers["content-length"])):Dc(n,"httpModule")?(n.on("response",function(o){n.pause(),t(null,Number(o.headers["content-length"]))}),n.resume()):t("Unknown stream")};Bt.prototype._multiPartHeader=function(n,t,o){if(typeof o.header=="string")return o.header;var a=this._getContentDisposition(t,o),e=this._getContentType(t,o),i="",A={"Content-Disposition":["form-data",'name="'+wq(n)+'"'].concat(a||[]),"Content-Type":[].concat(e||[])};typeof o.header=="object"&&h0(A,o.header);var r;for(var s in A)if(Dc(A,s)){if(r=A[s],r==null)continue;Array.isArray(r)||(r=[r]),r.length&&(i+=s+": "+r.join("; ")+Bt.LINE_BREAK)}return"--"+this.getBoundary()+Bt.LINE_BREAK+i+Bt.LINE_BREAK};Bt.prototype._getContentDisposition=function(n,t){var o;if(typeof t.filepath=="string"?o=p0.normalize(t.filepath).replace(/\\/g,"/"):t.filename||n&&(n.name||n.path)?o=p0.basename(t.filename||n&&(n.name||n.path)):n&&n.readable&&Dc(n,"httpVersion")&&(o=p0.basename(n.client._httpMessage.path||"")),o)return'filename="'+wq(o)+'"'};Bt.prototype._getContentType=function(n,t){var o=t.contentType;return!o&&n&&n.name&&(o=d0.lookup(n.name)),!o&&n&&n.path&&(o=d0.lookup(n.path)),!o&&n&&n.readable&&Dc(n,"httpVersion")&&(o=n.headers["content-type"]),!o&&(t.filepath||t.filename)&&(o=d0.lookup(t.filepath||t.filename)),!o&&n&&typeof n=="object"&&(o=Bt.DEFAULT_CONTENT_TYPE),o};Bt.prototype._multiPartFooter=function(){return function(n){var t=Bt.LINE_BREAK,o=this._streams.length===0;o&&(t+=this._lastBoundary()),n(t)}.bind(this)};Bt.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Bt.LINE_BREAK};Bt.prototype.getHeaders=function(n){var t,o={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in n)Dc(n,t)&&(o[t.toLowerCase()]=n[t]);return o};Bt.prototype.setBoundary=function(n){if(typeof n!="string")throw new TypeError("FormData boundary must be a string");this._boundary=n};Bt.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Bt.prototype.getBuffer=function(){for(var n=new Buffer.alloc(0),t=this.getBoundary(),o=0,a=this._streams.length;o{var Sd=1e3,wd=Sd*60,Dd=wd*60,al=Dd*24,twe=al*7,rwe=al*365.25;Kq.exports=function(n,t){t=t||{};var o=typeof n;if(o==="string"&&n.length>0)return iwe(n);if(o==="number"&&isFinite(n))return t.long?owe(n):awe(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function iwe(n){if(n=String(n),!(n.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(t){var o=parseFloat(t[1]),a=(t[2]||"ms").toLowerCase();switch(a){case"years":case"year":case"yrs":case"yr":case"y":return o*rwe;case"weeks":case"week":case"w":return o*twe;case"days":case"day":case"d":return o*al;case"hours":case"hour":case"hrs":case"hr":case"h":return o*Dd;case"minutes":case"minute":case"mins":case"min":case"m":return o*wd;case"seconds":case"second":case"secs":case"sec":case"s":return o*Sd;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}function awe(n){var t=Math.abs(n);return t>=al?Math.round(n/al)+"d":t>=Dd?Math.round(n/Dd)+"h":t>=wd?Math.round(n/wd)+"m":t>=Sd?Math.round(n/Sd)+"s":n+"ms"}function owe(n){var t=Math.abs(n);return t>=al?zy(n,t,al,"day"):t>=Dd?zy(n,t,Dd,"hour"):t>=wd?zy(n,t,wd,"minute"):t>=Sd?zy(n,t,Sd,"second"):n+" ms"}function zy(n,t,o,a){var e=t>=o*1.5;return Math.round(n/o)+" "+a+(e?"s":"")}});var N0=ee((sgA,Yq)=>{function nwe(n){o.debug=o,o.default=o,o.coerce=s,o.disable=A,o.enable=e,o.enabled=r,o.humanize=xq(),o.destroy=g,Object.keys(n).forEach(c=>{o[c]=n[c]}),o.names=[],o.skips=[],o.formatters={};function t(c){let I=0;for(let p=0;p{if(U==="%%")return"%";R++;let q=o.formatters[F];if(typeof q=="function"){let z=y[R];U=q.call(m,z),y.splice(R,1),R--}return U}),o.formatArgs.call(m,y),(m.log||o.log).apply(m,y)}return Q.namespace=c,Q.useColors=o.useColors(),Q.color=o.selectColor(c),Q.extend=a,Q.destroy=o.destroy,Object.defineProperty(Q,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(B!==o.namespaces&&(B=o.namespaces,f=o.enabled(c)),f),set:y=>{p=y}}),typeof o.init=="function"&&o.init(Q),Q}function a(c,I){let p=o(this.namespace+(typeof I>"u"?":":I)+c);return p.log=this.log,p}function e(c){o.save(c),o.namespaces=c,o.names=[],o.skips=[];let I=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of I)p[0]==="-"?o.skips.push(p.slice(1)):o.names.push(p)}function i(c,I){let p=0,B=0,f=-1,Q=0;for(;p"-"+I)].join(",");return o.enable(""),c}function r(c){for(let I of o.skips)if(i(c,I))return!1;for(let I of o.names)if(i(c,I))return!0;return!1}function s(c){return c instanceof Error?c.stack||c.message:c}function g(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o.enable(o.load()),o}Yq.exports=nwe});var jq=ee((xa,Vy)=>{xa.formatArgs=gwe;xa.save=cwe;xa.load=Iwe;xa.useColors=swe;xa.storage=lwe();xa.destroy=(()=>{let n=!1;return()=>{n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();xa.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function swe(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let n;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(n=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(n[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function gwe(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+Vy.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;n.splice(1,0,t,"color: inherit");let o=0,a=0;n[0].replace(/%[a-zA-Z%]/g,e=>{e!=="%%"&&(o++,e==="%c"&&(a=o))}),n.splice(a,0,t)}xa.log=console.debug||console.log||(()=>{});function cwe(n){try{n?xa.storage.setItem("debug",n):xa.storage.removeItem("debug")}catch{}}function Iwe(){let n;try{n=xa.storage.getItem("debug")||xa.storage.getItem("DEBUG")}catch{}return!n&&typeof process<"u"&&"env"in process&&(n=process.env.DEBUG),n}function lwe(){try{return localStorage}catch{}}Vy.exports=N0()(xa);var{formatters:pwe}=Vy.exports;pwe.j=function(n){try{return JSON.stringify(n)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var qq=ee((Ii,Zy)=>{var dwe=$e("tty"),Wy=$e("util");Ii.init=Qwe;Ii.log=Cwe;Ii.formatArgs=Ewe;Ii.save=Bwe;Ii.load=fwe;Ii.useColors=hwe;Ii.destroy=Wy.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Ii.colors=[6,2,3,4,5,1];try{let n=$e("supports-color");n&&(n.stderr||n).level>=2&&(Ii.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}Ii.inspectOpts=Object.keys(process.env).filter(n=>/^debug_/i.test(n)).reduce((n,t)=>{let o=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,i)=>i.toUpperCase()),a=process.env[t];return/^(yes|on|true|enabled)$/i.test(a)?a=!0:/^(no|off|false|disabled)$/i.test(a)?a=!1:a==="null"?a=null:a=Number(a),n[o]=a,n},{});function hwe(){return"colors"in Ii.inspectOpts?!!Ii.inspectOpts.colors:dwe.isatty(process.stderr.fd)}function Ewe(n){let{namespace:t,useColors:o}=this;if(o){let a=this.color,e="\x1B[3"+(a<8?a:"8;5;"+a),i=` ${e};1m${t} \x1B[0m`;n[0]=i+n[0].split(` `).join(` `+i),n.push(e+"m+"+Zy.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=uwe()+t+" "+n[0]}function uwe(){return Ii.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Cwe(...n){return process.stderr.write(Wy.formatWithOptions(Ii.inspectOpts,...n)+` `)}function Bwe(n){n?process.env.DEBUG=n:delete process.env.DEBUG}function fwe(){return process.env.DEBUG}function Qwe(n){n.inspectOpts={};let t=Object.keys(Ii.inspectOpts);for(let o=0;ot.trim()).join(" ")};Jq.O=function(n){return this.inspectOpts.colors=this.useColors,Wy.inspect(n,this.inspectOpts)}});var lt=ee((ogA,R0)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?R0.exports=jq():R0.exports=qq()});var zq=ee(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});function ywe(n){return function(t,o){return new Promise((a,e)=>{n.call(this,t,o,(i,A)=>{i?e(i):a(A)})})}}k0.default=ywe});var Zq=ee((P0,Wq)=>{"use strict";var Vq=P0&&P0.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},mwe=$e("events"),Swe=Vq(lt()),wwe=Vq(zq()),Gu=Swe.default("agent-base");function Dwe(n){return!!n&&typeof n.addRequest=="function"}function v0(){let{stack:n}=new Error;return typeof n!="string"?!1:n.split(` +`).map(t=>t.trim()).join(" ")};Jq.O=function(n){return this.inspectOpts.colors=this.useColors,Wy.inspect(n,this.inspectOpts)}});var lt=ee((ggA,R0)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?R0.exports=jq():R0.exports=qq()});var zq=ee(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});function ywe(n){return function(t,o){return new Promise((a,e)=>{n.call(this,t,o,(i,A)=>{i?e(i):a(A)})})}}k0.default=ywe});var Zq=ee((P0,Wq)=>{"use strict";var Vq=P0&&P0.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},mwe=$e("events"),Swe=Vq(lt()),wwe=Vq(zq()),Gu=Swe.default("agent-base");function Dwe(n){return!!n&&typeof n.addRequest=="function"}function v0(){let{stack:n}=new Error;return typeof n!="string"?!1:n.split(` `).some(t=>t.indexOf("(https.js:")!==-1||t.indexOf("node:https:")!==-1)}function Xy(n,t){return new Xy.Agent(n,t)}(function(n){class t extends mwe.EventEmitter{constructor(a,e){super();let i=e;typeof a=="function"?this.callback=a:a&&(i=a),this.timeout=null,i&&typeof i.timeout=="number"&&(this.timeout=i.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:v0()?443:80}set defaultPort(a){this.explicitDefaultPort=a}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:v0()?"https:":"http:"}set protocol(a){this.explicitProtocol=a}callback(a,e,i){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(a,e){let i=Object.assign({},e);typeof i.secureEndpoint!="boolean"&&(i.secureEndpoint=v0()),i.host==null&&(i.host="localhost"),i.port==null&&(i.port=i.secureEndpoint?443:80),i.protocol==null&&(i.protocol=i.secureEndpoint?"https:":"http:"),i.host&&i.path&&delete i.path,delete i.agent,delete i.hostname,delete i._defaultAgent,delete i.defaultPort,delete i.createConnection,a._last=!0,a.shouldKeepAlive=!1;let A=!1,r=null,s=i.timeout||this.timeout,g=B=>{a._hadError||(a.emit("error",B),a._hadError=!0)},c=()=>{r=null,A=!0;let B=new Error(`A "socket" was not created for HTTP request before ${s}ms`);B.code="ETIMEOUT",g(B)},I=B=>{A||(r!==null&&(clearTimeout(r),r=null),g(B))},p=B=>{if(A)return;if(r!=null&&(clearTimeout(r),r=null),Dwe(B)){Gu("Callback returned another Agent instance %o",B.constructor.name),B.addRequest(a,i);return}if(B){B.once("free",()=>{this.freeSocket(B,i)}),a.onSocket(B);return}let f=new Error(`no Duplex stream was returned to agent-base for \`${a.method} ${a.path}\``);g(f)};if(typeof this.callback!="function"){g(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(Gu("Converting legacy callback function to promise"),this.promisifiedCallback=wwe.default(this.callback)):this.promisifiedCallback=this.callback),typeof s=="number"&&s>0&&(r=setTimeout(c,s)),"port"in i&&typeof i.port!="number"&&(i.port=Number(i.port));try{Gu("Resolving socket for %o request: %o",i.protocol,`${a.method} ${a.path}`),Promise.resolve(this.promisifiedCallback(a,i)).then(p,I)}catch(B){Promise.reject(B).catch(I)}}freeSocket(a,e){Gu("Freeing socket %o %o",a.constructor.name,e),a.destroy()}destroy(){Gu("Destroying agent %o",this.constructor.name)}}n.Agent=t,n.prototype=n.Agent.prototype})(Xy||(Xy={}));Wq.exports=Xy});var Xq=ee(Lu=>{"use strict";var Owe=Lu&&Lu.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Lu,"__esModule",{value:!0});var bwe=Owe(lt()),Fu=bwe.default("https-proxy-agent:parse-proxy-response");function Mwe(n){return new Promise((t,o)=>{let a=0,e=[];function i(){let I=n.read();I?c(I):n.once("readable",i)}function A(){n.removeListener("end",s),n.removeListener("error",g),n.removeListener("close",r),n.removeListener("readable",i)}function r(I){Fu("onclose had error %o",I)}function s(){Fu("onend")}function g(I){A(),Fu("onerror %o",I),o(I)}function c(I){e.push(I),a+=I.length;let p=Buffer.concat(e,a);if(p.indexOf(`\r \r `)===-1){Fu("have not received end of HTTP headers yet..."),i();return}let f=p.toString("ascii",0,p.indexOf(`\r `)),Q=+f.split(" ")[1];Fu("got proxy server response: %o",f),t({statusCode:Q,buffered:p})}n.on("error",g),n.on("close",r),n.on("end",s),i()})}Lu.default=Mwe});var A4=ee(ol=>{"use strict";var _we=ol&&ol.__awaiter||function(n,t,o,a){function e(i){return i instanceof o?i:new o(function(A){A(i)})}return new(o||(o=Promise))(function(i,A){function r(c){try{g(a.next(c))}catch(I){A(I)}}function s(c){try{g(a.throw(c))}catch(I){A(I)}}function g(c){c.done?i(c.value):e(c.value).then(r,s)}g((a=a.apply(n,t||[])).next())})},Od=ol&&ol.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ol,"__esModule",{value:!0});var $q=Od($e("net")),e4=Od($e("tls")),Twe=Od($e("url")),Nwe=Od($e("assert")),Rwe=Od(lt()),kwe=Zq(),vwe=Od(Xq()),Uu=Rwe.default("https-proxy-agent:agent"),G0=class extends kwe.Agent{constructor(t){let o;if(typeof t=="string"?o=Twe.default.parse(t):o=t,!o)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Uu("creating new HttpsProxyAgent instance: %o",o),super(o);let a=Object.assign({},o);this.secureProxy=o.secureProxy||Fwe(a.protocol),a.host=a.hostname||a.host,typeof a.port=="string"&&(a.port=parseInt(a.port,10)),!a.port&&a.host&&(a.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in a)&&(a.ALPNProtocols=["http 1.1"]),a.host&&a.path&&(delete a.path,delete a.pathname),this.proxy=a}callback(t,o){return _we(this,void 0,void 0,function*(){let{proxy:a,secureProxy:e}=this,i;e?(Uu("Creating `tls.Socket`: %o",a),i=e4.default.connect(a)):(Uu("Creating `net.Socket`: %o",a),i=$q.default.connect(a));let A=Object.assign({},a.headers),s=`CONNECT ${`${o.host}:${o.port}`} HTTP/1.1\r `;a.auth&&(A["Proxy-Authorization"]=`Basic ${Buffer.from(a.auth).toString("base64")}`);let{host:g,port:c,secureEndpoint:I}=o;Gwe(c,I)||(g+=`:${c}`),A.Host=g,A.Connection="close";for(let y of Object.keys(A))s+=`${y}: ${A[y]}\r `;let p=vwe.default(i);i.write(`${s}\r -`);let{statusCode:B,buffered:f}=yield p;if(B===200){if(t.once("socket",Pwe),o.secureEndpoint){Uu("Upgrading socket connection to TLS");let y=o.servername||o.host;return e4.default.connect(Object.assign(Object.assign({},Lwe(o,"host","hostname","path","port")),{socket:i,servername:y}))}return i}i.destroy();let Q=new $q.default.Socket({writable:!1});return Q.readable=!0,t.once("socket",y=>{Uu("replaying proxy buffer for failed request"),Nwe.default(y.listenerCount("data")>0),y.push(f),y.push(null)}),Q})}};ol.default=G0;function Pwe(n){n.resume()}function Gwe(n,t){return!!(!t&&n===80||t&&n===443)}function Fwe(n){return typeof n=="string"?/^https:?$/i.test(n):!1}function Lwe(n,...t){let o={},a;for(a in n)t.includes(a)||(o[a]=n[a]);return o}});var H0=ee((U0,t4)=>{"use strict";var Uwe=U0&&U0.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},F0=Uwe(A4());function L0(n){return new F0.default(n)}(function(n){n.HttpsProxyAgent=F0.default,n.prototype=F0.default.prototype})(L0||(L0={}));t4.exports=L0});var i4=ee((cgA,r4)=>{var Hu;r4.exports=function(){if(!Hu){try{Hu=lt()("follow-redirects")}catch{}typeof Hu!="function"&&(Hu=function(){})}Hu.apply(null,arguments)}});var g4=ee((IgA,$0)=>{var xu=$e("url"),Ku=xu.URL,Hwe=$e("http"),Kwe=$e("https"),J0=$e("stream").Writable,q0=$e("assert"),a4=i4();(function(){var t=typeof process<"u",o=typeof window<"u"&&typeof document<"u",a=sl(Error.captureStackTrace);!t&&(o||!a)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var z0=!1;try{q0(new Ku(""))}catch(n){z0=n.code==="ERR_INVALID_URL"}var xwe=["Authorization","Proxy-Authorization","Cookie"],Ywe=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],V0=["abort","aborted","connect","error","socket","timeout"],W0=Object.create(null);V0.forEach(function(n){W0[n]=function(t,o,a){this._redirectable.emit(n,t,o,a)}});var x0=Yu("ERR_INVALID_URL","Invalid URL",TypeError),Y0=Yu("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),jwe=Yu("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Y0),Jwe=Yu("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),qwe=Yu("ERR_STREAM_WRITE_AFTER_END","write after end"),zwe=J0.prototype.destroy||n4;function Ya(n,t){J0.call(this),this._sanitizeOptions(n),this._options=n,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var o=this;this._onNativeResponse=function(a){try{o._processResponse(a)}catch(e){o.emit("error",e instanceof Y0?e:new Y0({cause:e}))}},this._headerFilter=new RegExp("^(?:"+xwe.concat(n.sensitiveHeaders).map(eDe).join("|")+")$","i"),this._performRequest()}Ya.prototype=Object.create(J0.prototype);Ya.prototype.abort=function(){X0(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Ya.prototype.destroy=function(n){return X0(this._currentRequest,n),zwe.call(this,n),this};Ya.prototype.write=function(n,t,o){if(this._ending)throw new qwe;if(!nl(n)&&!Xwe(n))throw new TypeError("data should be a string, Buffer or Uint8Array");if(sl(t)&&(o=t,t=null),n.length===0){o&&o();return}this._requestBodyLength+n.length<=this._options.maxBodyLength?(this._requestBodyLength+=n.length,this._requestBodyBuffers.push({data:n,encoding:t}),this._currentRequest.write(n,t,o)):(this.emit("error",new Jwe),this.abort())};Ya.prototype.end=function(n,t,o){if(sl(n)?(o=n,n=t=null):sl(t)&&(o=t,t=null),!n)this._ended=this._ending=!0,this._currentRequest.end(null,null,o);else{var a=this,e=this._currentRequest;this.write(n,t,function(){a._ended=!0,e.end(null,null,o)}),this._ending=!0}};Ya.prototype.setHeader=function(n,t){this._options.headers[n]=t,this._currentRequest.setHeader(n,t)};Ya.prototype.removeHeader=function(n){delete this._options.headers[n],this._currentRequest.removeHeader(n)};Ya.prototype.setTimeout=function(n,t){var o=this;function a(A){A.setTimeout(n),A.removeListener("timeout",A.destroy),A.addListener("timeout",A.destroy)}function e(A){o._timeout&&clearTimeout(o._timeout),o._timeout=setTimeout(function(){o.emit("timeout"),i()},n),a(A)}function i(){o._timeout&&(clearTimeout(o._timeout),o._timeout=null),o.removeListener("abort",i),o.removeListener("error",i),o.removeListener("response",i),o.removeListener("close",i),t&&o.removeListener("timeout",t),o.socket||o._currentRequest.removeListener("socket",e)}return t&&this.on("timeout",t),this.socket?e(this.socket):this._currentRequest.once("socket",e),this.on("socket",a),this.on("abort",i),this.on("error",i),this.on("response",i),this.on("close",i),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(n){Ya.prototype[n]=function(t,o){return this._currentRequest[n](t,o)}});["aborted","connection","socket"].forEach(function(n){Object.defineProperty(Ya.prototype,n,{get:function(){return this._currentRequest[n]}})});Ya.prototype._sanitizeOptions=function(n){if(n.headers||(n.headers={}),Zwe(n.sensitiveHeaders)||(n.sensitiveHeaders=[]),n.host&&(n.hostname||(n.hostname=n.host),delete n.host),!n.pathname&&n.path){var t=n.path.indexOf("?");t<0?n.pathname=n.path:(n.pathname=n.path.substring(0,t),n.search=n.path.substring(t))}};Ya.prototype._performRequest=function(){var n=this._options.protocol,t=this._options.nativeProtocols[n];if(!t)throw new TypeError("Unsupported protocol "+n);if(this._options.agents){var o=n.slice(0,-1);this._options.agent=this._options.agents[o]}var a=this._currentRequest=t.request(this._options,this._onNativeResponse);a._redirectable=this;for(var e of V0)a.on(e,W0[e]);if(this._currentUrl=/^\//.test(this._options.path)?xu.format(this._options):this._options.path,this._isRedirect){var i=0,A=this,r=this._requestBodyBuffers;(function s(g){if(a===A._currentRequest)if(g)A.emit("error",g);else if(i=400){n.responseUrl=this._currentUrl,n.redirects=this._redirects,this.emit("response",n),this._requestBodyBuffers=[];return}if(X0(this._currentRequest),n.destroy(),++this._redirectCount>this._options.maxRedirects)throw new jwe;var a,e=this._options.beforeRedirect;e&&(a=Object.assign({Host:n.req.getHeader("host")},this._options.headers));var i=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],K0(/^content-/i,this._options.headers));var A=K0(/^host$/i,this._options.headers),r=Z0(this._currentUrl),s=A||r.host,g=/^\w+:/.test(o)?this._currentUrl:xu.format(Object.assign(r,{host:s})),c=Vwe(o,g);if(a4("redirecting to",c.href),this._isRedirect=!0,j0(c,this._options),(c.protocol!==r.protocol&&c.protocol!=="https:"||c.host!==s&&!Wwe(c.host,s))&&K0(this._headerFilter,this._options.headers),sl(e)){var I={headers:n.headers,statusCode:t},p={url:g,method:i,headers:a};e(this._options,I,p),this._sanitizeOptions(this._options)}this._performRequest()};function o4(n){var t={maxRedirects:21,maxBodyLength:10485760},o={};return Object.keys(n).forEach(function(a){var e=a+":",i=o[e]=n[a],A=t[a]=Object.create(i);function r(g,c,I){return $we(g)?g=j0(g):nl(g)?g=j0(Z0(g)):(I=c,c=s4(g),g={protocol:e}),sl(c)&&(I=c,c=null),c=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},g,c),c.nativeProtocols=o,!nl(c.host)&&!nl(c.hostname)&&(c.hostname="::1"),q0.equal(c.protocol,e,"protocol mismatch"),a4("options",c),new Ya(c,I)}function s(g,c,I){var p=A.request(g,c,I);return p.end(),p}Object.defineProperties(A,{request:{value:r,configurable:!0,enumerable:!0,writable:!0},get:{value:s,configurable:!0,enumerable:!0,writable:!0}})}),t}function n4(){}function Z0(n){var t;if(z0)t=new Ku(n);else if(t=s4(xu.parse(n)),!nl(t.protocol))throw new x0({input:n});return t}function Vwe(n,t){return z0?new Ku(n,t):Z0(xu.resolve(t,n))}function s4(n){if(/^\[/.test(n.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(n.hostname))throw new x0({input:n.href||n});if(/^\[/.test(n.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(n.host))throw new x0({input:n.href||n});return n}function j0(n,t){var o=t||{};for(var a of Ywe)o[a]=n[a];return o.hostname.startsWith("[")&&(o.hostname=o.hostname.slice(1,-1)),o.port!==""&&(o.port=Number(o.port)),o.path=o.search?o.pathname+o.search:o.pathname,o}function K0(n,t){var o;for(var a in t)n.test(a)&&(o=t[a],delete t[a]);return o===null||typeof o>"u"?void 0:String(o).trim()}function Yu(n,t,o){function a(e){sl(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,e||{}),this.code=n,this.message=this.cause?t+": "+this.cause.message:t}return a.prototype=new(o||Error),Object.defineProperties(a.prototype,{constructor:{value:a,enumerable:!1},name:{value:"Error ["+n+"]",enumerable:!1}}),a}function X0(n,t){for(var o of V0)n.removeListener(o,W0[o]);n.on("error",n4),n.destroy(t)}function Wwe(n,t){q0(nl(n)&&nl(t));var o=n.length-t.length-1;return o>0&&n[o]==="."&&n.endsWith(t)}function Zwe(n){return n instanceof Array}function nl(n){return typeof n=="string"||n instanceof String}function sl(n){return typeof n=="function"}function Xwe(n){return typeof n=="object"&&"length"in n}function $we(n){return Ku&&n instanceof Ku}function eDe(n){return n.replace(/[\]\\/()*+?.$]/g,"\\$&")}$0.exports=o4({http:Hwe,https:Kwe});$0.exports.wrap=o4});var a8=ee((_lA,i8)=>{i8.exports=$e("util").inspect});var AC=ee((TlA,w8)=>{var TN=typeof Map=="function"&&Map.prototype,yN=Object.getOwnPropertyDescriptor&&TN?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,nm=TN&&yN&&typeof yN.get=="function"?yN.get:null,o8=TN&&Map.prototype.forEach,NN=typeof Set=="function"&&Set.prototype,mN=Object.getOwnPropertyDescriptor&&NN?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,sm=NN&&mN&&typeof mN.get=="function"?mN.get:null,n8=NN&&Set.prototype.forEach,pOe=typeof WeakMap=="function"&&WeakMap.prototype,Xu=pOe?WeakMap.prototype.has:null,dOe=typeof WeakSet=="function"&&WeakSet.prototype,$u=dOe?WeakSet.prototype.has:null,hOe=typeof WeakRef=="function"&&WeakRef.prototype,s8=hOe?WeakRef.prototype.deref:null,EOe=Boolean.prototype.valueOf,uOe=Object.prototype.toString,COe=Function.prototype.toString,BOe=String.prototype.match,RN=String.prototype.slice,Mc=String.prototype.replace,fOe=String.prototype.toUpperCase,g8=String.prototype.toLowerCase,C8=RegExp.prototype.test,c8=Array.prototype.concat,fs=Array.prototype.join,QOe=Array.prototype.slice,I8=Math.floor,DN=typeof BigInt=="function"?BigInt.prototype.valueOf:null,SN=Object.getOwnPropertySymbols,ON=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Td=typeof Symbol=="function"&&typeof Symbol.iterator=="object",eC=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Td||!0)?Symbol.toStringTag:null,B8=Object.prototype.propertyIsEnumerable,l8=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function p8(n,t){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||C8.call(/e/,t))return t;var o=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var a=n<0?-I8(-n):I8(n);if(a!==n){var e=String(a),i=RN.call(t,e.length+1);return Mc.call(e,o,"$&_")+"."+Mc.call(Mc.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Mc.call(t,o,"$&_")}var bN=a8(),d8=bN.custom,h8=y8(d8)?d8:null,f8={__proto__:null,double:'"',single:"'"},yOe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};w8.exports=function n(t,o,a,e){var i=o||{};if(wg(i,"quoteStyle")&&!wg(f8,i.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(wg(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var A=wg(i,"customInspect")?i.customInspect:!0;if(typeof A!="boolean"&&A!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(wg(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(wg(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var r=i.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return S8(t,i);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var s=String(t);return r?p8(t,s):s}if(typeof t=="bigint"){var g=String(t)+"n";return r?p8(t,g):g}var c=typeof i.depth>"u"?5:i.depth;if(typeof a>"u"&&(a=0),a>=c&&c>0&&typeof t=="object")return MN(t)?"[Array]":"[Object]";var I=UOe(i,a);if(typeof e>"u")e=[];else if(m8(e,t)>=0)return"[Circular]";function p(H,N,k){if(N&&(e=QOe.call(e),e.push(N)),k){var J={depth:i.depth};return wg(i,"quoteStyle")&&(J.quoteStyle=i.quoteStyle),n(H,J,a+1,e)}return n(H,i,a+1,e)}if(typeof t=="function"&&!E8(t)){var B=TOe(t),f=om(t,p);return"[Function"+(B?": "+B:" (anonymous)")+"]"+(f.length>0?" { "+fs.call(f,", ")+" }":"")}if(y8(t)){var Q=Td?Mc.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):ON.call(t);return typeof t=="object"&&!Td?Zu(Q):Q}if(GOe(t)){for(var y="<"+g8.call(String(t.nodeName)),m=t.attributes||[],T=0;T",y}if(MN(t)){if(t.length===0)return"[]";var _=om(t,p);return I&&!LOe(_)?"["+_N(_,I)+"]":"[ "+fs.call(_,", ")+" ]"}if(wOe(t)){var R=om(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!B8.call(t,"cause")?"{ ["+String(t)+"] "+fs.call(c8.call("[cause]: "+p(t.cause),R),", ")+" }":R.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+fs.call(R,", ")+" }"}if(typeof t=="object"&&A){if(h8&&typeof t[h8]=="function"&&bN)return bN(t,{depth:c-a});if(A!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(NOe(t)){var L=[];return o8&&o8.call(t,function(H,N){L.push(p(N,t,!0)+" => "+p(H,t))}),u8("Map",nm.call(t),L,I)}if(vOe(t)){var U=[];return n8&&n8.call(t,function(H){U.push(p(H,t))}),u8("Set",sm.call(t),U,I)}if(ROe(t))return wN("WeakMap");if(POe(t))return wN("WeakSet");if(kOe(t))return wN("WeakRef");if(OOe(t))return Zu(p(Number(t)));if(MOe(t))return Zu(p(DN.call(t)));if(bOe(t))return Zu(EOe.call(t));if(DOe(t))return Zu(p(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!SOe(t)&&!E8(t)){var F=om(t,p),q=l8?l8(t)===Object.prototype:t instanceof Object||t.constructor===Object,z=t instanceof Object?"":"null prototype",K=!q&&eC&&Object(t)===t&&eC in t?RN.call(_c(t),8,-1):z?"Object":"",G=q||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",V=G+(K||z?"["+fs.call(c8.call([],K||[],z||[]),": ")+"] ":"");return F.length===0?V+"{}":I?V+"{"+_N(F,I)+"}":V+"{ "+fs.call(F,", ")+" }"}return String(t)};function Q8(n,t,o){var a=o.quoteStyle||t,e=f8[a];return e+n+e}function mOe(n){return Mc.call(String(n),/"/g,""")}function cl(n){return!eC||!(typeof n=="object"&&(eC in n||typeof n[eC]<"u"))}function MN(n){return _c(n)==="[object Array]"&&cl(n)}function SOe(n){return _c(n)==="[object Date]"&&cl(n)}function E8(n){return _c(n)==="[object RegExp]"&&cl(n)}function wOe(n){return _c(n)==="[object Error]"&&cl(n)}function DOe(n){return _c(n)==="[object String]"&&cl(n)}function OOe(n){return _c(n)==="[object Number]"&&cl(n)}function bOe(n){return _c(n)==="[object Boolean]"&&cl(n)}function y8(n){if(Td)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!ON)return!1;try{return ON.call(n),!0}catch{}return!1}function MOe(n){if(!n||typeof n!="object"||!DN)return!1;try{return DN.call(n),!0}catch{}return!1}var _Oe=Object.prototype.hasOwnProperty||function(n){return n in this};function wg(n,t){return _Oe.call(n,t)}function _c(n){return uOe.call(n)}function TOe(n){if(n.name)return n.name;var t=BOe.call(COe.call(n),/^function\s*([\w$]+)/);return t?t[1]:null}function m8(n,t){if(n.indexOf)return n.indexOf(t);for(var o=0,a=n.length;ot.maxStringLength){var o=n.length-t.maxStringLength,a="... "+o+" more character"+(o>1?"s":"");return S8(RN.call(n,0,t.maxStringLength),t)+a}var e=yOe[t.quoteStyle||"single"];e.lastIndex=0;var i=Mc.call(Mc.call(n,e,"\\$1"),/[\x00-\x1f]/g,FOe);return Q8(i,"single",t)}function FOe(n){var t=n.charCodeAt(0),o={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return o?"\\"+o:"\\x"+(t<16?"0":"")+fOe.call(t.toString(16))}function Zu(n){return"Object("+n+")"}function wN(n){return n+" { ? }"}function u8(n,t,o,a){var e=a?_N(o,a):fs.call(o,", ");return n+" ("+t+") {"+e+"}"}function LOe(n){for(var t=0;t{Uu("replaying proxy buffer for failed request"),Nwe.default(y.listenerCount("data")>0),y.push(f),y.push(null)}),Q})}};ol.default=G0;function Pwe(n){n.resume()}function Gwe(n,t){return!!(!t&&n===80||t&&n===443)}function Fwe(n){return typeof n=="string"?/^https:?$/i.test(n):!1}function Lwe(n,...t){let o={},a;for(a in n)t.includes(a)||(o[a]=n[a]);return o}});var H0=ee((U0,t4)=>{"use strict";var Uwe=U0&&U0.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},F0=Uwe(A4());function L0(n){return new F0.default(n)}(function(n){n.HttpsProxyAgent=F0.default,n.prototype=F0.default.prototype})(L0||(L0={}));t4.exports=L0});var i4=ee((pgA,r4)=>{var Hu;r4.exports=function(){if(!Hu){try{Hu=lt()("follow-redirects")}catch{}typeof Hu!="function"&&(Hu=function(){})}Hu.apply(null,arguments)}});var g4=ee((dgA,$0)=>{var xu=$e("url"),Ku=xu.URL,Hwe=$e("http"),Kwe=$e("https"),J0=$e("stream").Writable,q0=$e("assert"),a4=i4();(function(){var t=typeof process<"u",o=typeof window<"u"&&typeof document<"u",a=sl(Error.captureStackTrace);!t&&(o||!a)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var z0=!1;try{q0(new Ku(""))}catch(n){z0=n.code==="ERR_INVALID_URL"}var xwe=["Authorization","Proxy-Authorization","Cookie"],Ywe=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],V0=["abort","aborted","connect","error","socket","timeout"],W0=Object.create(null);V0.forEach(function(n){W0[n]=function(t,o,a){this._redirectable.emit(n,t,o,a)}});var x0=Yu("ERR_INVALID_URL","Invalid URL",TypeError),Y0=Yu("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),jwe=Yu("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Y0),Jwe=Yu("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),qwe=Yu("ERR_STREAM_WRITE_AFTER_END","write after end"),zwe=J0.prototype.destroy||n4;function Ya(n,t){J0.call(this),this._sanitizeOptions(n),this._options=n,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var o=this;this._onNativeResponse=function(a){try{o._processResponse(a)}catch(e){o.emit("error",e instanceof Y0?e:new Y0({cause:e}))}},this._headerFilter=new RegExp("^(?:"+xwe.concat(n.sensitiveHeaders).map(eDe).join("|")+")$","i"),this._performRequest()}Ya.prototype=Object.create(J0.prototype);Ya.prototype.abort=function(){X0(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Ya.prototype.destroy=function(n){return X0(this._currentRequest,n),zwe.call(this,n),this};Ya.prototype.write=function(n,t,o){if(this._ending)throw new qwe;if(!nl(n)&&!Xwe(n))throw new TypeError("data should be a string, Buffer or Uint8Array");if(sl(t)&&(o=t,t=null),n.length===0){o&&o();return}this._requestBodyLength+n.length<=this._options.maxBodyLength?(this._requestBodyLength+=n.length,this._requestBodyBuffers.push({data:n,encoding:t}),this._currentRequest.write(n,t,o)):(this.emit("error",new Jwe),this.abort())};Ya.prototype.end=function(n,t,o){if(sl(n)?(o=n,n=t=null):sl(t)&&(o=t,t=null),!n)this._ended=this._ending=!0,this._currentRequest.end(null,null,o);else{var a=this,e=this._currentRequest;this.write(n,t,function(){a._ended=!0,e.end(null,null,o)}),this._ending=!0}};Ya.prototype.setHeader=function(n,t){this._options.headers[n]=t,this._currentRequest.setHeader(n,t)};Ya.prototype.removeHeader=function(n){delete this._options.headers[n],this._currentRequest.removeHeader(n)};Ya.prototype.setTimeout=function(n,t){var o=this;function a(A){A.setTimeout(n),A.removeListener("timeout",A.destroy),A.addListener("timeout",A.destroy)}function e(A){o._timeout&&clearTimeout(o._timeout),o._timeout=setTimeout(function(){o.emit("timeout"),i()},n),a(A)}function i(){o._timeout&&(clearTimeout(o._timeout),o._timeout=null),o.removeListener("abort",i),o.removeListener("error",i),o.removeListener("response",i),o.removeListener("close",i),t&&o.removeListener("timeout",t),o.socket||o._currentRequest.removeListener("socket",e)}return t&&this.on("timeout",t),this.socket?e(this.socket):this._currentRequest.once("socket",e),this.on("socket",a),this.on("abort",i),this.on("error",i),this.on("response",i),this.on("close",i),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(n){Ya.prototype[n]=function(t,o){return this._currentRequest[n](t,o)}});["aborted","connection","socket"].forEach(function(n){Object.defineProperty(Ya.prototype,n,{get:function(){return this._currentRequest[n]}})});Ya.prototype._sanitizeOptions=function(n){if(n.headers||(n.headers={}),Zwe(n.sensitiveHeaders)||(n.sensitiveHeaders=[]),n.host&&(n.hostname||(n.hostname=n.host),delete n.host),!n.pathname&&n.path){var t=n.path.indexOf("?");t<0?n.pathname=n.path:(n.pathname=n.path.substring(0,t),n.search=n.path.substring(t))}};Ya.prototype._performRequest=function(){var n=this._options.protocol,t=this._options.nativeProtocols[n];if(!t)throw new TypeError("Unsupported protocol "+n);if(this._options.agents){var o=n.slice(0,-1);this._options.agent=this._options.agents[o]}var a=this._currentRequest=t.request(this._options,this._onNativeResponse);a._redirectable=this;for(var e of V0)a.on(e,W0[e]);if(this._currentUrl=/^\//.test(this._options.path)?xu.format(this._options):this._options.path,this._isRedirect){var i=0,A=this,r=this._requestBodyBuffers;(function s(g){if(a===A._currentRequest)if(g)A.emit("error",g);else if(i=400){n.responseUrl=this._currentUrl,n.redirects=this._redirects,this.emit("response",n),this._requestBodyBuffers=[];return}if(X0(this._currentRequest),n.destroy(),++this._redirectCount>this._options.maxRedirects)throw new jwe;var a,e=this._options.beforeRedirect;e&&(a=Object.assign({Host:n.req.getHeader("host")},this._options.headers));var i=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],K0(/^content-/i,this._options.headers));var A=K0(/^host$/i,this._options.headers),r=Z0(this._currentUrl),s=A||r.host,g=/^\w+:/.test(o)?this._currentUrl:xu.format(Object.assign(r,{host:s})),c=Vwe(o,g);if(a4("redirecting to",c.href),this._isRedirect=!0,j0(c,this._options),(c.protocol!==r.protocol&&c.protocol!=="https:"||c.host!==s&&!Wwe(c.host,s))&&K0(this._headerFilter,this._options.headers),sl(e)){var I={headers:n.headers,statusCode:t},p={url:g,method:i,headers:a};e(this._options,I,p),this._sanitizeOptions(this._options)}this._performRequest()};function o4(n){var t={maxRedirects:21,maxBodyLength:10485760},o={};return Object.keys(n).forEach(function(a){var e=a+":",i=o[e]=n[a],A=t[a]=Object.create(i);function r(g,c,I){return $we(g)?g=j0(g):nl(g)?g=j0(Z0(g)):(I=c,c=s4(g),g={protocol:e}),sl(c)&&(I=c,c=null),c=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},g,c),c.nativeProtocols=o,!nl(c.host)&&!nl(c.hostname)&&(c.hostname="::1"),q0.equal(c.protocol,e,"protocol mismatch"),a4("options",c),new Ya(c,I)}function s(g,c,I){var p=A.request(g,c,I);return p.end(),p}Object.defineProperties(A,{request:{value:r,configurable:!0,enumerable:!0,writable:!0},get:{value:s,configurable:!0,enumerable:!0,writable:!0}})}),t}function n4(){}function Z0(n){var t;if(z0)t=new Ku(n);else if(t=s4(xu.parse(n)),!nl(t.protocol))throw new x0({input:n});return t}function Vwe(n,t){return z0?new Ku(n,t):Z0(xu.resolve(t,n))}function s4(n){if(/^\[/.test(n.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(n.hostname))throw new x0({input:n.href||n});if(/^\[/.test(n.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(n.host))throw new x0({input:n.href||n});return n}function j0(n,t){var o=t||{};for(var a of Ywe)o[a]=n[a];return o.hostname.startsWith("[")&&(o.hostname=o.hostname.slice(1,-1)),o.port!==""&&(o.port=Number(o.port)),o.path=o.search?o.pathname+o.search:o.pathname,o}function K0(n,t){var o;for(var a in t)n.test(a)&&(o=t[a],delete t[a]);return o===null||typeof o>"u"?void 0:String(o).trim()}function Yu(n,t,o){function a(e){sl(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,e||{}),this.code=n,this.message=this.cause?t+": "+this.cause.message:t}return a.prototype=new(o||Error),Object.defineProperties(a.prototype,{constructor:{value:a,enumerable:!1},name:{value:"Error ["+n+"]",enumerable:!1}}),a}function X0(n,t){for(var o of V0)n.removeListener(o,W0[o]);n.on("error",n4),n.destroy(t)}function Wwe(n,t){q0(nl(n)&&nl(t));var o=n.length-t.length-1;return o>0&&n[o]==="."&&n.endsWith(t)}function Zwe(n){return n instanceof Array}function nl(n){return typeof n=="string"||n instanceof String}function sl(n){return typeof n=="function"}function Xwe(n){return typeof n=="object"&&"length"in n}function $we(n){return Ku&&n instanceof Ku}function eDe(n){return n.replace(/[\]\\/()*+?.$]/g,"\\$&")}$0.exports=o4({http:Hwe,https:Kwe});$0.exports.wrap=o4});var a8=ee((RlA,i8)=>{i8.exports=$e("util").inspect});var AC=ee((klA,w8)=>{var TN=typeof Map=="function"&&Map.prototype,yN=Object.getOwnPropertyDescriptor&&TN?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,nm=TN&&yN&&typeof yN.get=="function"?yN.get:null,o8=TN&&Map.prototype.forEach,NN=typeof Set=="function"&&Set.prototype,mN=Object.getOwnPropertyDescriptor&&NN?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,sm=NN&&mN&&typeof mN.get=="function"?mN.get:null,n8=NN&&Set.prototype.forEach,pOe=typeof WeakMap=="function"&&WeakMap.prototype,Xu=pOe?WeakMap.prototype.has:null,dOe=typeof WeakSet=="function"&&WeakSet.prototype,$u=dOe?WeakSet.prototype.has:null,hOe=typeof WeakRef=="function"&&WeakRef.prototype,s8=hOe?WeakRef.prototype.deref:null,EOe=Boolean.prototype.valueOf,uOe=Object.prototype.toString,COe=Function.prototype.toString,BOe=String.prototype.match,RN=String.prototype.slice,Mc=String.prototype.replace,fOe=String.prototype.toUpperCase,g8=String.prototype.toLowerCase,C8=RegExp.prototype.test,c8=Array.prototype.concat,fs=Array.prototype.join,QOe=Array.prototype.slice,I8=Math.floor,DN=typeof BigInt=="function"?BigInt.prototype.valueOf:null,SN=Object.getOwnPropertySymbols,ON=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Td=typeof Symbol=="function"&&typeof Symbol.iterator=="object",eC=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Td||!0)?Symbol.toStringTag:null,B8=Object.prototype.propertyIsEnumerable,l8=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function p8(n,t){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||C8.call(/e/,t))return t;var o=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var a=n<0?-I8(-n):I8(n);if(a!==n){var e=String(a),i=RN.call(t,e.length+1);return Mc.call(e,o,"$&_")+"."+Mc.call(Mc.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Mc.call(t,o,"$&_")}var bN=a8(),d8=bN.custom,h8=y8(d8)?d8:null,f8={__proto__:null,double:'"',single:"'"},yOe={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};w8.exports=function n(t,o,a,e){var i=o||{};if(wg(i,"quoteStyle")&&!wg(f8,i.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(wg(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var A=wg(i,"customInspect")?i.customInspect:!0;if(typeof A!="boolean"&&A!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(wg(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(wg(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var r=i.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return S8(t,i);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var s=String(t);return r?p8(t,s):s}if(typeof t=="bigint"){var g=String(t)+"n";return r?p8(t,g):g}var c=typeof i.depth>"u"?5:i.depth;if(typeof a>"u"&&(a=0),a>=c&&c>0&&typeof t=="object")return MN(t)?"[Array]":"[Object]";var I=UOe(i,a);if(typeof e>"u")e=[];else if(m8(e,t)>=0)return"[Circular]";function p(H,N,k){if(N&&(e=QOe.call(e),e.push(N)),k){var J={depth:i.depth};return wg(i,"quoteStyle")&&(J.quoteStyle=i.quoteStyle),n(H,J,a+1,e)}return n(H,i,a+1,e)}if(typeof t=="function"&&!E8(t)){var B=TOe(t),f=om(t,p);return"[Function"+(B?": "+B:" (anonymous)")+"]"+(f.length>0?" { "+fs.call(f,", ")+" }":"")}if(y8(t)){var Q=Td?Mc.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):ON.call(t);return typeof t=="object"&&!Td?Zu(Q):Q}if(GOe(t)){for(var y="<"+g8.call(String(t.nodeName)),m=t.attributes||[],T=0;T",y}if(MN(t)){if(t.length===0)return"[]";var _=om(t,p);return I&&!LOe(_)?"["+_N(_,I)+"]":"[ "+fs.call(_,", ")+" ]"}if(wOe(t)){var R=om(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!B8.call(t,"cause")?"{ ["+String(t)+"] "+fs.call(c8.call("[cause]: "+p(t.cause),R),", ")+" }":R.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+fs.call(R,", ")+" }"}if(typeof t=="object"&&A){if(h8&&typeof t[h8]=="function"&&bN)return bN(t,{depth:c-a});if(A!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(NOe(t)){var L=[];return o8&&o8.call(t,function(H,N){L.push(p(N,t,!0)+" => "+p(H,t))}),u8("Map",nm.call(t),L,I)}if(vOe(t)){var U=[];return n8&&n8.call(t,function(H){U.push(p(H,t))}),u8("Set",sm.call(t),U,I)}if(ROe(t))return wN("WeakMap");if(POe(t))return wN("WeakSet");if(kOe(t))return wN("WeakRef");if(OOe(t))return Zu(p(Number(t)));if(MOe(t))return Zu(p(DN.call(t)));if(bOe(t))return Zu(EOe.call(t));if(DOe(t))return Zu(p(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof global<"u"&&t===global)return"{ [object globalThis] }";if(!SOe(t)&&!E8(t)){var F=om(t,p),q=l8?l8(t)===Object.prototype:t instanceof Object||t.constructor===Object,z=t instanceof Object?"":"null prototype",K=!q&&eC&&Object(t)===t&&eC in t?RN.call(_c(t),8,-1):z?"Object":"",G=q||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",V=G+(K||z?"["+fs.call(c8.call([],K||[],z||[]),": ")+"] ":"");return F.length===0?V+"{}":I?V+"{"+_N(F,I)+"}":V+"{ "+fs.call(F,", ")+" }"}return String(t)};function Q8(n,t,o){var a=o.quoteStyle||t,e=f8[a];return e+n+e}function mOe(n){return Mc.call(String(n),/"/g,""")}function cl(n){return!eC||!(typeof n=="object"&&(eC in n||typeof n[eC]<"u"))}function MN(n){return _c(n)==="[object Array]"&&cl(n)}function SOe(n){return _c(n)==="[object Date]"&&cl(n)}function E8(n){return _c(n)==="[object RegExp]"&&cl(n)}function wOe(n){return _c(n)==="[object Error]"&&cl(n)}function DOe(n){return _c(n)==="[object String]"&&cl(n)}function OOe(n){return _c(n)==="[object Number]"&&cl(n)}function bOe(n){return _c(n)==="[object Boolean]"&&cl(n)}function y8(n){if(Td)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!ON)return!1;try{return ON.call(n),!0}catch{}return!1}function MOe(n){if(!n||typeof n!="object"||!DN)return!1;try{return DN.call(n),!0}catch{}return!1}var _Oe=Object.prototype.hasOwnProperty||function(n){return n in this};function wg(n,t){return _Oe.call(n,t)}function _c(n){return uOe.call(n)}function TOe(n){if(n.name)return n.name;var t=BOe.call(COe.call(n),/^function\s*([\w$]+)/);return t?t[1]:null}function m8(n,t){if(n.indexOf)return n.indexOf(t);for(var o=0,a=n.length;ot.maxStringLength){var o=n.length-t.maxStringLength,a="... "+o+" more character"+(o>1?"s":"");return S8(RN.call(n,0,t.maxStringLength),t)+a}var e=yOe[t.quoteStyle||"single"];e.lastIndex=0;var i=Mc.call(Mc.call(n,e,"\\$1"),/[\x00-\x1f]/g,FOe);return Q8(i,"single",t)}function FOe(n){var t=n.charCodeAt(0),o={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return o?"\\"+o:"\\x"+(t<16?"0":"")+fOe.call(t.toString(16))}function Zu(n){return"Object("+n+")"}function wN(n){return n+" { ? }"}function u8(n,t,o,a){var e=a?_N(o,a):fs.call(o,", ");return n+" ("+t+") {"+e+"}"}function LOe(n){for(var t=0;t=0)return!1;return!0}function UOe(n,t){var o;if(n.indent===" ")o=" ";else if(typeof n.indent=="number"&&n.indent>0)o=fs.call(Array(n.indent+1)," ");else return null;return{base:o,prev:fs.call(Array(t+1),o)}}function _N(n,t){if(n.length===0)return"";var o=` `+t.prev+t.base;return o+fs.call(n,","+o)+` -`+t.prev}function om(n,t){var o=MN(n),a=[];if(o){a.length=n.length;for(var e=0;e{"use strict";var HOe=AC(),KOe=wc(),gm=function(n,t,o){for(var a=n,e;(e=a.next)!=null;a=e)if(e.key===t)return a.next=e.next,o||(e.next=n.next,n.next=e),e},xOe=function(n,t){if(n){var o=gm(n,t);return o&&o.value}},YOe=function(n,t,o){var a=gm(n,t);a?a.value=o:n.next={key:t,next:n.next,value:o}},jOe=function(n,t){return n?!!gm(n,t):!1},JOe=function(n,t){if(n)return gm(n,t,!0)};D8.exports=function(){var t,o={assert:function(a){if(!o.has(a))throw new KOe("Side channel does not contain "+HOe(a))},delete:function(a){var e=JOe(t,a);return e&&t&&!t.next&&(t=void 0),!!e},get:function(a){return xOe(t,a)},has:function(a){return jOe(t,a)},set:function(a,e){t||(t={next:void 0}),YOe(t,a,e)}};return o}});var kN=ee((RlA,_8)=>{"use strict";var b8=ku(),M8=g0(),qOe=M8([b8("%String.prototype.indexOf%")]);_8.exports=function(t,o){var a=b8(t,!!o);return typeof a=="function"&&qOe(t,".prototype.")>-1?M8([a]):a}});var vN=ee((klA,N8)=>{"use strict";var zOe=ku(),tC=kN(),VOe=AC(),WOe=wc(),T8=zOe("%Map%",!0),ZOe=tC("Map.prototype.get",!0),XOe=tC("Map.prototype.set",!0),$Oe=tC("Map.prototype.has",!0),ebe=tC("Map.prototype.delete",!0),Abe=tC("Map.prototype.size",!0);N8.exports=!!T8&&function(){var t,o={assert:function(a){if(!o.has(a))throw new WOe("Side channel does not contain "+VOe(a))},delete:function(a){if(t){var e=ebe(t,a);return Abe(t)===0&&(t=void 0),e}return!1},get:function(a){if(t)return ZOe(t,a)},has:function(a){return t?$Oe(t,a):!1},set:function(a,e){t||(t=new T8),XOe(t,a,e)}};return o}});var k8=ee((vlA,R8)=>{"use strict";var tbe=ku(),Im=kN(),rbe=AC(),cm=vN(),ibe=wc(),Nd=tbe("%WeakMap%",!0),abe=Im("WeakMap.prototype.get",!0),obe=Im("WeakMap.prototype.set",!0),nbe=Im("WeakMap.prototype.has",!0),sbe=Im("WeakMap.prototype.delete",!0);R8.exports=Nd?function(){var t,o,a={assert:function(e){if(!a.has(e))throw new ibe("Side channel does not contain "+rbe(e))},delete:function(e){if(Nd&&e&&(typeof e=="object"||typeof e=="function")){if(t)return sbe(t,e)}else if(cm&&o)return o.delete(e);return!1},get:function(e){return Nd&&e&&(typeof e=="object"||typeof e=="function")&&t?abe(t,e):o&&o.get(e)},has:function(e){return Nd&&e&&(typeof e=="object"||typeof e=="function")&&t?nbe(t,e):!!o&&o.has(e)},set:function(e,i){Nd&&e&&(typeof e=="object"||typeof e=="function")?(t||(t=new Nd),obe(t,e,i)):cm&&(o||(o=cm()),o.set(e,i))}};return a}:cm});var PN=ee((PlA,v8)=>{"use strict";var gbe=wc(),cbe=AC(),Ibe=O8(),lbe=vN(),pbe=k8(),dbe=pbe||lbe||Ibe;v8.exports=function(){var t,o={assert:function(a){if(!o.has(a)){var e=a&&Object(a)===a?"the given object key":cbe(a);throw new gbe("Side channel does not contain "+e)}},delete:function(a){return!!t&&t.delete(a)},get:function(a){return t&&t.get(a)},has:function(a){return!!t&&t.has(a)},set:function(a,e){t||(t=dbe()),t.set(a,e)}};return o}});var lm=ee((GlA,P8)=>{"use strict";var hbe=String.prototype.replace,Ebe=/%20/g,GN={RFC1738:"RFC1738",RFC3986:"RFC3986"};P8.exports={default:GN.RFC3986,formatters:{RFC1738:function(n){return hbe.call(n,Ebe,"+")},RFC3986:function(n){return String(n)}},RFC1738:GN.RFC1738,RFC3986:GN.RFC3986}});var HN=ee((FlA,L8)=>{"use strict";var ube=lm(),F8=PN(),G8=i0(),FN=Object.prototype.hasOwnProperty,Il=Array.isArray,dm=F8(),ll=function(t,o){return dm.set(t,o),t},pl=function(t){return dm.has(t)},rC=function(t){return dm.get(t)},LN=function(t,o){dm.set(t,o)},Qs=(function(){for(var n=[],t=0;t<256;++t)n[n.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return n})(),Cbe=function(t){for(;t.length>1;){var o=t.pop(),a=o.obj[o.prop];if(Il(a)){for(var e=[],i=0;i=a.arrayLimit){if(a.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+a.arrayLimit+" element"+(a.arrayLimit===1?"":"s")+" allowed in an array.");return ll(Rd(t.concat(o),a),e)}t[e]=o}else if(t&&typeof t=="object")if(pl(t)){var i=rC(t)+1;t[i]=o,LN(t,i)}else{if(a&&a.strictMerge)return[t,o];(a&&(a.plainObjects||a.allowPrototypes)||!FN.call(Object.prototype,o))&&(t[o]=!0)}else return[t,o];return t}if(!t||typeof t!="object"){if(pl(o)){for(var A=Object.keys(o),r=a&&a.plainObjects?{__proto__:null,0:t}:{0:t},s=0;sa.arrayLimit){if(a.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+a.arrayLimit+" element"+(a.arrayLimit===1?"":"s")+" allowed in an array.");return ll(Rd(c,a),c.length-1)}return c}var I=t;if(Il(t)&&!Il(o)&&(I=Rd(t,a)),Il(t)&&Il(o)){if(o.forEach(function(p,B){if(FN.call(t,B)){var f=t[B];f&&typeof f=="object"&&p&&typeof p=="object"?t[B]=n(f,p,a):t[t.length]=p}else t[B]=p}),a&&typeof a.arrayLimit=="number"&&t.length>a.arrayLimit){if(a.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+a.arrayLimit+" element"+(a.arrayLimit===1?"":"s")+" allowed in an array.");return ll(Rd(t,a),t.length-1)}return t}return Object.keys(o).reduce(function(p,B){var f=o[B];if(FN.call(p,B)?UN(p,B,n(p[B],f,a)):UN(p,B,f),pl(o)&&!pl(p)&&ll(p,rC(o)),pl(p)){var Q=parseInt(B,10);String(Q)===B&&Q>=0&&Q>rC(p)&&LN(p,Q)}return p},I)},fbe=function(t,o){return Object.keys(o).reduce(function(a,e){return UN(a,e,o[e]),a},t)},Qbe=function(n,t,o){var a=n.replace(/\+/g," ");if(o==="iso-8859-1")return a.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(a)}catch{return a}},pm=1024,ybe=function(t,o,a,e,i){if(t.length===0)return t;var A=t;if(typeof t=="symbol"?A=Symbol.prototype.toString.call(t):typeof t!="string"&&(A=String(t)),a==="iso-8859-1")return escape(A).replace(/%u[0-9a-f]{4}/gi,function(f){return"%26%23"+parseInt(f.slice(2),16)+"%3B"});for(var r="",s=0;s=pm?A.slice(s,s+pm):A;if(s+pm=55296&&c<=56319&&(g=g.slice(0,-1),s-=1)}for(var I=[],p=0;p=48&&B<=57||B>=65&&B<=90||B>=97&&B<=122||i===ube.RFC1738&&(B===40||B===41)){I[I.length]=g.charAt(p);continue}if(B<128){I[I.length]=Qs[B];continue}if(B<2048){I[I.length]=Qs[192|B>>6]+Qs[128|B&63];continue}if(B<55296||B>=57344){I[I.length]=Qs[224|B>>12]+Qs[128|B>>6&63]+Qs[128|B&63];continue}p+=1,B=65536+((B&1023)<<10|g.charCodeAt(p)&1023),I[I.length]=Qs[240|B>>18]+Qs[128|B>>12&63]+Qs[128|B>>6&63]+Qs[128|B&63]}r+=I.join("")}return r},mbe=function(t){for(var o=[{obj:{o:t},prop:"o"}],a=F8(),e=0;ea){if(i)throw new RangeError("Array limit exceeded. Only "+a+" element"+(a===1?"":"s")+" allowed in an array.");return ll(Rd(r,{plainObjects:e}),r.length-1)}return r},Obe=function(t,o){if(Il(t)){for(var a=[],e=0;e{"use strict";var H8=PN(),hm=HN(),iC=lm(),bbe=Object.prototype.hasOwnProperty,K8={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,o){return t+"["+o+"]"},repeat:function(t){return t}},ys=Array.isArray,Mbe=Array.prototype.push,x8=function(n,t){Mbe.apply(n,ys(t)?t:[t])},_be=Date.prototype.toISOString,U8=iC.default,xr={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:hm.encode,encodeValuesOnly:!1,filter:void 0,format:U8,formatter:iC.formatters[U8],indices:!1,serializeDate:function(t){return _be.call(t)},skipNulls:!1,strictNullHandling:!1},Tbe=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},KN={},Nbe=function n(t,o,a,e,i,A,r,s,g,c,I,p,B,f,Q,y,m,T){for(var _=t,R=T,L=0,U=!1;(R=R.get(KN))!==void 0&&!U;){var F=R.get(t);if(L+=1,typeof F<"u"){if(F===L)throw new RangeError("Cyclic object value");U=!0}typeof R.get(KN)>"u"&&(L=0)}if(typeof c=="function"?_=c(o,_):_ instanceof Date?_=B(_):a==="comma"&&ys(_)&&(_=hm.maybeMap(_,function(oe){return oe instanceof Date?B(oe):oe})),_===null){if(A)return Q(g&&!y?g(o,xr.encoder,m,"key",f):o);_=""}if(Tbe(_)||hm.isBuffer(_)){if(g){var q=y?o:g(o,xr.encoder,m,"key",f);return[Q(q)+"="+Q(g(_,xr.encoder,m,"value",f))]}return[Q(o)+"="+Q(String(_))]}var z=[];if(typeof _>"u")return z;var K;if(a==="comma"&&ys(_))y&&g&&(_=hm.maybeMap(_,function(oe){return oe==null?oe:g(oe)})),K=[{value:_.length>0?_.join(",")||null:void 0}];else if(ys(c))K=c;else{var G=Object.keys(_);K=I?G.sort(I):G}var V=s?String(o).replace(/\./g,"%2E"):String(o),H=e&&ys(_)&&_.length===1?V+"[]":V;if(i&&ys(_)&&_.length===0)return H+"[]";for(var N=0;N"u"?t.encodeDotInKeys===!0?!0:xr.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:xr.addQueryPrefix,allowDots:r,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:xr.allowEmptyArrays,arrayFormat:A,charset:o,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:xr.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?xr.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:xr.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:xr.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:xr.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:xr.encodeValuesOnly,filter:i,format:a,formatter:e,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:xr.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:xr.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:xr.strictNullHandling}};Y8.exports=function(n,t){var o=n,a=Rbe(t),e,i;typeof a.filter=="function"?(i=a.filter,o=i("",o)):ys(a.filter)&&(i=a.filter,e=i);var A=[];if(typeof o!="object"||o===null)return"";var r=K8[a.arrayFormat],s=r==="comma"&&a.commaRoundTrip;e||(e=Object.keys(o)),a.sort&&e.sort(a.sort);for(var g=H8(),c=0;c"u"||I===null)){var p=o[I];a.skipNulls&&p===null||x8(A,Nbe(p,I,r,s,a.allowEmptyArrays,a.strictNullHandling,a.skipNulls,a.encodeDotInKeys,a.encode?a.encoder:null,a.filter,a.sort,a.allowDots,a.serializeDate,a.format,a.formatter,a.encodeValuesOnly,a.charset,g))}}var B=A.join(a.delimiter),f=a.addQueryPrefix===!0?"?":"";return a.charsetSentinel&&(a.charset==="iso-8859-1"?f+="utf8=%26%2310003%3B"+a.delimiter:f+="utf8=%E2%9C%93"+a.delimiter),B.length>0?f+B:""}});var z8=ee((UlA,q8)=>{"use strict";var ms=HN(),Em=Object.prototype.hasOwnProperty,xN=Array.isArray,dr={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ms.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},kbe=function(n){return n.replace(/&#(\d+);/g,function(t,o){return String.fromCharCode(parseInt(o,10))})},J8=function(n,t,o,a){if(n&&typeof n=="string"&&t.comma&&n.indexOf(",")>-1){if(a&&t.throwOnLimitExceeded)for(var e=0,i=n.indexOf(",");i>-1;){if(e+=1,e>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");i=n.indexOf(",",i+1)}return n.split(",")}if(t.throwOnLimitExceeded&&o>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return n},vbe="utf8=%26%2310003%3B",Pbe="utf8=%E2%9C%93",Gbe=function(t,o){var a={__proto__:null},e=o.ignoreQueryPrefix?t.replace(/^\?/,""):t;e=e.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var i=o.parameterLimit===1/0?void 0:o.parameterLimit,A=e.split(o.delimiter,o.throwOnLimitExceeded&&typeof i<"u"?i+1:i);if(o.throwOnLimitExceeded&&typeof i<"u"&&A.length>i)throw new RangeError("Parameter limit exceeded. Only "+i+" parameter"+(i===1?"":"s")+" allowed.");var r=-1,s,g=o.charset;if(o.charsetSentinel)for(s=0;s-1&&(f=xN(f)?[f]:f),o.comma&&xN(f)&&f.length>o.arrayLimit&&(f=ms.combine([],f,o.arrayLimit,o.plainObjects,o.throwOnLimitExceeded)),B!==null){var Q=Em.call(a,B);Q&&(o.duplicates==="combine"||c.indexOf("[]=")>-1)?a[B]=ms.combine(a[B],f,o.arrayLimit,o.plainObjects,o.throwOnLimitExceeded):(!Q||o.duplicates==="last")&&(a[B]=f)}}return a},Fbe=function(n,t,o,a){var e=0;if(n.length>0&&n[n.length-1]==="[]"){var i=n.slice(0,-1).join("");e=Array.isArray(t)&&t[i]?t[i].length:0}for(var A=a?t:J8(t,o,e),r=n.length-1;r>=0;--r){var s,g=n[r];if(g==="[]"&&o.parseArrays)ms.isOverflow(A)?s=A:s=o.allowEmptyArrays&&(A===""||o.strictNullHandling&&A===null)?[]:ms.combine([],A,o.arrayLimit,o.plainObjects,o.throwOnLimitExceeded);else{s=o.plainObjects?{__proto__:null}:{};var c=g.charAt(0)==="["&&g.charAt(g.length-1)==="]"?g.slice(1,-1):g,I=o.decodeDotInKeys?c.replace(/%2E/g,"."):c,p=parseInt(I,10),B=!isNaN(p)&&g!==I&&String(p)===I&&p>=0&&o.parseArrays;if(!o.parseArrays&&I==="")s={0:A};else if(B&&p=0?a.slice(0,i):a;if(A){if(!o.plainObjects&&Em.call(Object.prototype,A)&&!o.allowPrototypes)return;e[e.length]=A}for(var r=a.length,s=i,g=0;s>=0&&g=0){if(o.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+o.depth+" and strictDepth is true");e[e.length]="["+a.slice(s)+"]"}return e},Ube=function(t,o,a,e){if(t){var i=Lbe(t,a);if(i)return Fbe(i,o,a,e)}},Hbe=function(t){if(!t)return dr;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var o=typeof t.charset>"u"?dr.charset:t.charset,a=typeof t.duplicates>"u"?dr.duplicates:t.duplicates;if(a!=="combine"&&a!=="first"&&a!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var e=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:dr.allowDots:!!t.allowDots;return{allowDots:e,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:dr.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:dr.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:dr.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:dr.arrayLimit,charset:o,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:dr.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:dr.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:dr.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:dr.decoder,delimiter:typeof t.delimiter=="string"||ms.isRegExp(t.delimiter)?t.delimiter:dr.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:dr.depth,duplicates:a,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:dr.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:dr.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:dr.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:dr.strictDepth,strictMerge:typeof t.strictMerge=="boolean"?!!t.strictMerge:dr.strictMerge,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:dr.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}};q8.exports=function(n,t){var o=Hbe(t);if(n===""||n===null||typeof n>"u")return o.plainObjects?{__proto__:null}:{};for(var a=typeof n=="string"?Gbe(n,o):n,e=o.plainObjects?{__proto__:null}:{},i=Object.keys(a),A=0;A{"use strict";var Kbe=j8(),xbe=z8(),Ybe=lm();V8.exports={formats:Ybe,parse:xbe,stringify:Kbe}});var X8=ee((KlA,Z8)=>{function jbe(n){return n}Z8.exports=jbe});var vz=ee((aC,vd)=>{var Jbe=200,qbe="Expected a function",AR="__lodash_hash_undefined__",mm=1,Pd=2,sz=1/0,gz=9007199254740991,um="[object Arguments]",JN="[object Array]",cz="[object Boolean]",Iz="[object Date]",lz="[object Error]",pz="[object Function]",zbe="[object GeneratorFunction]",Cm="[object Map]",dz="[object Number]",kd="[object Object]",$8="[object Promise]",hz="[object RegExp]",Bm="[object Set]",Ez="[object String]",uz="[object Symbol]",qN="[object WeakMap]",Cz="[object ArrayBuffer]",fm="[object DataView]",Vbe="[object Float32Array]",Wbe="[object Float64Array]",Zbe="[object Int8Array]",Xbe="[object Int16Array]",$be="[object Int32Array]",eMe="[object Uint8Array]",AMe="[object Uint8ClampedArray]",tMe="[object Uint16Array]",rMe="[object Uint32Array]",iMe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,aMe=/^\w*$/,oMe=/^\./,nMe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,sMe=/[\\^$.*+?()[\]{}|]/g,gMe=/\\(\\)?/g,cMe=/^\[object .+?Constructor\]$/,IMe=/^(?:0|[1-9]\d*)$/,Jt={};Jt[Vbe]=Jt[Wbe]=Jt[Zbe]=Jt[Xbe]=Jt[$be]=Jt[eMe]=Jt[AMe]=Jt[tMe]=Jt[rMe]=!0;Jt[um]=Jt[JN]=Jt[Cz]=Jt[cz]=Jt[fm]=Jt[Iz]=Jt[lz]=Jt[pz]=Jt[Cm]=Jt[dz]=Jt[kd]=Jt[hz]=Jt[Bm]=Jt[Ez]=Jt[qN]=!1;var Bz=typeof global=="object"&&global&&global.Object===Object&&global,lMe=typeof self=="object"&&self&&self.Object===Object&&self,Rc=Bz||lMe||Function("return this")(),fz=typeof aC=="object"&&aC&&!aC.nodeType&&aC,ez=fz&&typeof vd=="object"&&vd&&!vd.nodeType&&vd,pMe=ez&&ez.exports===fz,Az=pMe&&Bz.process,tz=(function(){try{return Az&&Az.binding("util")}catch{}})(),rz=tz&&tz.isTypedArray;function Qz(n,t){for(var o=-1,a=t.length,e=n.length;++o-1}function KMe(n,t){var o=this.__data__,a=wm(o,n);return a<0?o.push([n,t]):o[a][1]=t,this}Og.prototype.clear=FMe;Og.prototype.delete=LMe;Og.prototype.get=UMe;Og.prototype.has=HMe;Og.prototype.set=KMe;function bg(n){var t=-1,o=n?n.length:0;for(this.clear();++tr))return!1;var g=i.get(n);if(g&&i.get(t))return g==t;var c=-1,I=!0,p=e&mm?new ym:void 0;for(i.set(n,t),i.set(t,n);++c-1&&n%1==0&&n-1&&n%1==0&&n<=gz}function sC(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Mm(n){return!!n&&typeof n=="object"}function nR(n){return typeof n=="symbol"||Mm(n)&&Gd.call(n)==uz}var b_e=rz?uMe(rz):n_e;function M_e(n){return n==null?"":h_e(n)}function __e(n,t,o){var a=n==null?void 0:Sz(n,t);return a===void 0?o:a}function T_e(n,t){return n!=null&&y_e(n,t,r_e)}function eR(n){return aR(n)?mz(n):g_e(n)}function N_e(n){return aR(n)?mz(n,!0):c_e(n)}function R_e(n,t){return n==null?{}:p_e(n,C_e(n),s_e(t))}function k_e(n){return n}function v_e(n){return Om(n)?hMe(bm(n)):d_e(n)}function kz(){return[]}vd.exports=R_e});var cV=ee((gC,Ld)=>{var P_e=200,jz="__lodash_hash_undefined__",G_e=800,F_e=16,Jz=9007199254740991,qz="[object Arguments]",L_e="[object Array]",U_e="[object AsyncFunction]",H_e="[object Boolean]",K_e="[object Date]",x_e="[object Error]",zz="[object Function]",Y_e="[object GeneratorFunction]",j_e="[object Map]",J_e="[object Number]",q_e="[object Null]",Vz="[object Object]",z_e="[object Proxy]",V_e="[object RegExp]",W_e="[object Set]",Z_e="[object String]",X_e="[object Undefined]",$_e="[object WeakMap]",eTe="[object ArrayBuffer]",ATe="[object DataView]",tTe="[object Float32Array]",rTe="[object Float64Array]",iTe="[object Int8Array]",aTe="[object Int16Array]",oTe="[object Int32Array]",nTe="[object Uint8Array]",sTe="[object Uint8ClampedArray]",gTe="[object Uint16Array]",cTe="[object Uint32Array]",ITe=/[\\^$.*+?()[\]{}|]/g,lTe=/^\[object .+?Constructor\]$/,pTe=/^(?:0|[1-9]\d*)$/,qt={};qt[tTe]=qt[rTe]=qt[iTe]=qt[aTe]=qt[oTe]=qt[nTe]=qt[sTe]=qt[gTe]=qt[cTe]=!0;qt[qz]=qt[L_e]=qt[eTe]=qt[H_e]=qt[ATe]=qt[K_e]=qt[x_e]=qt[zz]=qt[j_e]=qt[J_e]=qt[Vz]=qt[V_e]=qt[W_e]=qt[Z_e]=qt[$_e]=!1;var Wz=typeof global=="object"&&global&&global.Object===Object&&global,dTe=typeof self=="object"&&self&&self.Object===Object&&self,lC=Wz||dTe||Function("return this")(),Zz=typeof gC=="object"&&gC&&!gC.nodeType&&gC,cC=Zz&&typeof Ld=="object"&&Ld&&!Ld.nodeType&&Ld,Xz=cC&&cC.exports===Zz,sR=Xz&&Wz.process,Pz=(function(){try{var n=cC&&cC.require&&cC.require("util").types;return n||sR&&sR.binding&&sR.binding("util")}catch{}})(),Gz=Pz&&Pz.isTypedArray;function hTe(n,t,o){switch(o.length){case 0:return n.call(t);case 1:return n.call(t,o[0]);case 2:return n.call(t,o[0],o[1]);case 3:return n.call(t,o[0],o[1],o[2])}return n.apply(t,o)}function ETe(n,t){for(var o=-1,a=Array(n);++o-1}function FTe(n,t){var o=this.__data__,a=km(o,n);return a<0?(++this.size,o.push([n,t])):o[a][1]=t,this}_g.prototype.clear=kTe;_g.prototype.delete=vTe;_g.prototype.get=PTe;_g.prototype.has=GTe;_g.prototype.set=FTe;function Ud(n){var t=-1,o=n==null?0:n.length;for(this.clear();++t1?o[e-1]:void 0,A=e>2?o[2]:void 0;for(i=n.length>3&&typeof i=="function"?(e--,i):void 0,A&&p0e(o[0],o[1],A)&&(i=e<3?void 0:i,e=1),t=Object(t);++a-1&&n%1==0&&n0){if(++t>=G_e)return arguments[0]}else t=0;return n.apply(void 0,arguments)}}function Q0e(n){if(n!=null){try{return Rm.call(n)}catch{}try{return n+""}catch{}}return""}function Gm(n,t){return n===t||n!==n&&t!==t}var lR=Yz((function(){return arguments})())?Yz:function(n){return pC(n)&&Mg.call(n,"callee")&&!STe.call(n,"callee")},pR=Array.isArray;function ER(n){return n!=null&&oV(n.length)&&!uR(n)}function y0e(n){return pC(n)&&ER(n)}var aV=DTe||O0e;function uR(n){if(!Cl(n))return!1;var t=vm(n);return t==zz||t==Y_e||t==U_e||t==z_e}function oV(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Jz}function Cl(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function pC(n){return n!=null&&typeof n=="object"}function m0e(n){if(!pC(n)||vm(n)!=Vz)return!1;var t=eV(n);if(t===null)return!0;var o=Mg.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&Rm.call(o)==yTe}var nV=Gz?uTe(Gz):$Te;function S0e(n){return s0e(n,sV(n))}function sV(n){return ER(n)?VTe(n,!0):e0e(n)}var w0e=g0e(function(n,t,o){tV(n,t,o)});function D0e(n){return function(){return n}}function gV(n){return n}function O0e(){return!1}Ld.exports=w0e});var Tg=ee((xlA,pV)=>{"use strict";var IV=["nodebuffer","arraybuffer","fragments"],lV=typeof Blob<"u";lV&&IV.push("blob");pV.exports={BINARY_TYPES:IV,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:lV,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var dC=ee((YlA,Fm)=>{"use strict";var{EMPTY_BUFFER:b0e}=Tg(),CR=Buffer[Symbol.species];function M0e(n,t){if(n.length===0)return b0e;if(n.length===1)return n[0];let o=Buffer.allocUnsafe(t),a=0;for(let e=0;e{"use strict";var EV=Symbol("kDone"),fR=Symbol("kRun"),QR=class{constructor(t){this[EV]=()=>{this.pending--,this[fR]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[fR]()}[fR](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[EV])}}};uV.exports=QR});var Yd=ee((JlA,yV)=>{"use strict";var hC=$e("zlib"),BV=dC(),T0e=CV(),{kStatusCode:fV}=Tg(),N0e=Buffer[Symbol.species],R0e=Buffer.from([0,0,255,255]),Um=Symbol("permessage-deflate"),Ng=Symbol("total-length"),Kd=Symbol("callback"),kc=Symbol("buffers"),xd=Symbol("error"),Lm,yR=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Lm){let o=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Lm=new T0e(o)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Kd];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let o=this._options,a=t.find(e=>!(o.serverNoContextTakeover===!1&&e.server_no_context_takeover||e.server_max_window_bits&&(o.serverMaxWindowBits===!1||typeof o.serverMaxWindowBits=="number"&&o.serverMaxWindowBits>e.server_max_window_bits)||typeof o.clientMaxWindowBits=="number"&&(typeof e.client_max_window_bits=="number"?o.clientMaxWindowBits>e.client_max_window_bits:!e.client_max_window_bits)));if(!a)throw new Error("None of the extension offers can be accepted");return o.serverNoContextTakeover&&(a.server_no_context_takeover=!0),o.clientNoContextTakeover&&(a.client_no_context_takeover=!0),typeof o.serverMaxWindowBits=="number"&&(a.server_max_window_bits=o.serverMaxWindowBits),typeof o.clientMaxWindowBits=="number"?a.client_max_window_bits=o.clientMaxWindowBits:(a.client_max_window_bits===!0||o.clientMaxWindowBits===!1)&&delete a.client_max_window_bits,a}acceptAsClient(t){let o=t[0];if(this._options.clientNoContextTakeover===!1&&o.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!o.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(o.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&o.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return o}normalizeParams(t){return t.forEach(o=>{Object.keys(o).forEach(a=>{let e=o[a];if(e.length>1)throw new Error(`Parameter "${a}" must have only a single value`);if(e=e[0],a==="client_max_window_bits"){if(e!==!0){let i=+e;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${a}": ${e}`);e=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${a}": ${e}`)}else if(a==="server_max_window_bits"){let i=+e;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${a}": ${e}`);e=i}else if(a==="client_no_context_takeover"||a==="server_no_context_takeover"){if(e!==!0)throw new TypeError(`Invalid value for parameter "${a}": ${e}`)}else throw new Error(`Unknown parameter "${a}"`);o[a]=e})}),t}decompress(t,o,a){Lm.add(e=>{this._decompress(t,o,(i,A)=>{e(),a(i,A)})})}compress(t,o,a){Lm.add(e=>{this._compress(t,o,(i,A)=>{e(),a(i,A)})})}_decompress(t,o,a){let e=this._isServer?"client":"server";if(!this._inflate){let i=`${e}_max_window_bits`,A=typeof this.params[i]!="number"?hC.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=hC.createInflateRaw({...this._options.zlibInflateOptions,windowBits:A}),this._inflate[Um]=this,this._inflate[Ng]=0,this._inflate[kc]=[],this._inflate.on("error",v0e),this._inflate.on("data",QV)}this._inflate[Kd]=a,this._inflate.write(t),o&&this._inflate.write(R0e),this._inflate.flush(()=>{let i=this._inflate[xd];if(i){this._inflate.close(),this._inflate=null,a(i);return}let A=BV.concat(this._inflate[kc],this._inflate[Ng]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Ng]=0,this._inflate[kc]=[],o&&this.params[`${e}_no_context_takeover`]&&this._inflate.reset()),a(null,A)})}_compress(t,o,a){let e=this._isServer?"server":"client";if(!this._deflate){let i=`${e}_max_window_bits`,A=typeof this.params[i]!="number"?hC.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=hC.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:A}),this._deflate[Ng]=0,this._deflate[kc]=[],this._deflate.on("data",k0e)}this._deflate[Kd]=a,this._deflate.write(t),this._deflate.flush(hC.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=BV.concat(this._deflate[kc],this._deflate[Ng]);o&&(i=new N0e(i.buffer,i.byteOffset,i.length-4)),this._deflate[Kd]=null,this._deflate[Ng]=0,this._deflate[kc]=[],o&&this.params[`${e}_no_context_takeover`]&&this._deflate.reset(),a(null,i)})}};yV.exports=yR;function k0e(n){this[kc].push(n),this[Ng]+=n.length}function QV(n){if(this[Ng]+=n.length,this[Um]._maxPayload<1||this[Ng]<=this[Um]._maxPayload){this[kc].push(n);return}this[xd]=new RangeError("Max payload size exceeded"),this[xd].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[xd][fV]=1009,this.removeListener("data",QV),this.reset()}function v0e(n){if(this[Um]._inflate=null,this[xd]){this[Kd](this[xd]);return}n[fV]=1007,this[Kd](n)}});var jd=ee((qlA,Hm)=>{"use strict";var{isUtf8:mV}=$e("buffer"),{hasBlob:P0e}=Tg(),G0e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function F0e(n){return n>=1e3&&n<=1014&&n!==1004&&n!==1005&&n!==1006||n>=3e3&&n<=4999}function mR(n){let t=n.length,o=0;for(;o=t||(n[o+1]&192)!==128||(n[o+2]&192)!==128||n[o]===224&&(n[o+1]&224)===128||n[o]===237&&(n[o+1]&224)===160)return!1;o+=3}else if((n[o]&248)===240){if(o+3>=t||(n[o+1]&192)!==128||(n[o+2]&192)!==128||(n[o+3]&192)!==128||n[o]===240&&(n[o+1]&240)===128||n[o]===244&&n[o+1]>143||n[o]>244)return!1;o+=4}else return!1;return!0}function L0e(n){return P0e&&typeof n=="object"&&typeof n.arrayBuffer=="function"&&typeof n.type=="string"&&typeof n.stream=="function"&&(n[Symbol.toStringTag]==="Blob"||n[Symbol.toStringTag]==="File")}Hm.exports={isBlob:L0e,isValidStatusCode:F0e,isValidUTF8:mR,tokenChars:G0e};if(mV)Hm.exports.isValidUTF8=function(n){return n.length<24?mR(n):mV(n)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let n=$e("utf-8-validate");Hm.exports.isValidUTF8=function(t){return t.length<32?mR(t):n(t)}}catch{}});var bR=ee((zlA,_V)=>{"use strict";var{Writable:U0e}=$e("stream"),SV=Yd(),{BINARY_TYPES:H0e,EMPTY_BUFFER:wV,kStatusCode:K0e,kWebSocket:x0e}=Tg(),{concat:SR,toArrayBuffer:Y0e,unmask:j0e}=dC(),{isValidStatusCode:J0e,isValidUTF8:DV}=jd(),Km=Buffer[Symbol.species],Yo=0,OV=1,bV=2,MV=3,wR=4,DR=5,xm=6,OR=class extends U0e{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||H0e[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[x0e]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Yo}_write(t,o,a){if(this._opcode===8&&this._state==Yo)return a();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){a(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(a)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t=a.length?o.set(this._buffers.shift(),e):(o.set(new Uint8Array(a.buffer,a.byteOffset,t),e),this._buffers[0]=new Km(a.buffer,a.byteOffset+t,a.length-t)),t-=a.length}while(t>0);return o}startLoop(t){this._loop=!0;do switch(this._state){case Yo:this.getInfo(t);break;case OV:this.getPayloadLength16(t);break;case bV:this.getPayloadLength64(t);break;case MV:this.getMask();break;case wR:this.getData(t);break;case DR:case xm:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let o=this.consume(2);if((o[0]&48)!==0){let e=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(e);return}let a=(o[0]&64)===64;if(a&&!this._extensions[SV.extensionName]){let e=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(e);return}if(this._fin=(o[0]&128)===128,this._opcode=o[0]&15,this._payloadLength=o[1]&127,this._opcode===0){if(a){let e=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(e);return}if(!this._fragmented){let e=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(e);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let e=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(e);return}this._compressed=a}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let e=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(e);return}if(a){let e=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(e);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let e=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(e);return}}else{let e=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(e);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(o[1]&128)===128,this._isServer){if(!this._masked){let e=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(e);return}}else if(this._masked){let e=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(e);return}this._payloadLength===126?this._state=OV:this._payloadLength===127?this._state=bV:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let o=this.consume(8),a=o.readUInt32BE(0);if(a>Math.pow(2,21)-1){let e=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(e);return}this._payloadLength=a*Math.pow(2,32)+o.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._masked?this._state=MV:this._state=wR}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=wR}getData(t){let o=wV;if(this._payloadLength){if(this._bufferedBytes7){this.controlMessage(o,t);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let a=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(a);return}if(this._compressed){this._state=DR,this.decompress(o,t);return}o.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(o)),this.dataMessage(t)}decompress(t,o){this._extensions[SV.extensionName].decompress(t,this._fin,(e,i)=>{if(e)return o(e);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let A=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");o(A);return}this._fragments.push(i)}this.dataMessage(o),this._state===Yo&&this.startLoop(o)})}dataMessage(t){if(!this._fin){this._state=Yo;return}let o=this._messageLength,a=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let e;this._binaryType==="nodebuffer"?e=SR(a,o):this._binaryType==="arraybuffer"?e=Y0e(SR(a,o)):this._binaryType==="blob"?e=new Blob(a):e=a,this._allowSynchronousEvents?(this.emit("message",e,!0),this._state=Yo):(this._state=xm,setImmediate(()=>{this.emit("message",e,!0),this._state=Yo,this.startLoop(t)}))}else{let e=SR(a,o);if(!this._skipUTF8Validation&&!DV(e)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(i);return}this._state===DR||this._allowSynchronousEvents?(this.emit("message",e,!1),this._state=Yo):(this._state=xm,setImmediate(()=>{this.emit("message",e,!1),this._state=Yo,this.startLoop(t)}))}}controlMessage(t,o){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,wV),this.end();else{let a=t.readUInt16BE(0);if(!J0e(a)){let i=this.createError(RangeError,`invalid status code ${a}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");o(i);return}let e=new Km(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!DV(e)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");o(i);return}this._loop=!1,this.emit("conclude",a,e),this.end()}this._state=Yo;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Yo):(this._state=xm,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Yo,this.startLoop(o)}))}createError(t,o,a,e,i){this._loop=!1,this._errored=!0;let A=new t(a?`Invalid WebSocket frame: ${o}`:o);return Error.captureStackTrace(A,this.createError),A.code=i,A[K0e]=e,A}};_V.exports=OR});var TR=ee((WlA,RV)=>{"use strict";var{Duplex:VlA}=$e("stream"),{randomFillSync:q0e}=$e("crypto"),{types:{isUint8Array:z0e}}=$e("util"),TV=Yd(),{EMPTY_BUFFER:V0e,kWebSocket:W0e,NOOP:Z0e}=Tg(),{isBlob:Jd,isValidStatusCode:X0e}=jd(),{mask:NV,toBuffer:Bl}=dC(),jo=Symbol("kByteLength"),$0e=Buffer.alloc(4),Ym=8*1024,fl,qd=Ym,Nn=0,eNe=1,ANe=2,MR=class n{constructor(t,o,a){this._extensions=o||{},a&&(this._generateMask=a,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Nn,this.onerror=Z0e,this[W0e]=void 0}static frame(t,o){let a,e=!1,i=2,A=!1;o.mask&&(a=o.maskBuffer||$0e,o.generateMask?o.generateMask(a):(qd===Ym&&(fl===void 0&&(fl=Buffer.alloc(Ym)),q0e(fl,0,Ym),qd=0),a[0]=fl[qd++],a[1]=fl[qd++],a[2]=fl[qd++],a[3]=fl[qd++]),A=(a[0]|a[1]|a[2]|a[3])===0,i=6);let r;typeof t=="string"?(!o.mask||A)&&o[jo]!==void 0?r=o[jo]:(t=Buffer.from(t),r=t.length):(r=t.length,e=o.mask&&o.readOnly&&!A);let s=r;r>=65536?(i+=8,s=127):r>125&&(i+=2,s=126);let g=Buffer.allocUnsafe(e?r+i:i);return g[0]=o.fin?o.opcode|128:o.opcode,o.rsv1&&(g[0]|=64),g[1]=s,s===126?g.writeUInt16BE(r,2):s===127&&(g[2]=g[3]=0,g.writeUIntBE(r,4,6)),o.mask?(g[1]|=128,g[i-4]=a[0],g[i-3]=a[1],g[i-2]=a[2],g[i-1]=a[3],A?[g,t]:e?(NV(t,a,g,i,r),[g]):(NV(t,a,t,0,r),[g,t])):[g,t]}close(t,o,a,e){let i;if(t===void 0)i=V0e;else{if(typeof t!="number"||!X0e(t))throw new TypeError("First argument must be a valid error code number");if(o===void 0||!o.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(t,0);else{let r=Buffer.byteLength(o);if(r>123)throw new RangeError("The message must not be greater than 123 bytes");if(i=Buffer.allocUnsafe(2+r),i.writeUInt16BE(t,0),typeof o=="string")i.write(o,2);else if(z0e(o))i.set(o,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let A={[jo]:i.length,fin:!0,generateMask:this._generateMask,mask:a,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Nn?this.enqueue([this.dispatch,i,!1,A,e]):this.sendFrame(n.frame(i,A),e)}ping(t,o,a){let e,i;if(typeof t=="string"?(e=Buffer.byteLength(t),i=!1):Jd(t)?(e=t.size,i=!1):(t=Bl(t),e=t.length,i=Bl.readOnly),e>125)throw new RangeError("The data size must not be greater than 125 bytes");let A={[jo]:e,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};Jd(t)?this._state!==Nn?this.enqueue([this.getBlobData,t,!1,A,a]):this.getBlobData(t,!1,A,a):this._state!==Nn?this.enqueue([this.dispatch,t,!1,A,a]):this.sendFrame(n.frame(t,A),a)}pong(t,o,a){let e,i;if(typeof t=="string"?(e=Buffer.byteLength(t),i=!1):Jd(t)?(e=t.size,i=!1):(t=Bl(t),e=t.length,i=Bl.readOnly),e>125)throw new RangeError("The data size must not be greater than 125 bytes");let A={[jo]:e,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};Jd(t)?this._state!==Nn?this.enqueue([this.getBlobData,t,!1,A,a]):this.getBlobData(t,!1,A,a):this._state!==Nn?this.enqueue([this.dispatch,t,!1,A,a]):this.sendFrame(n.frame(t,A),a)}send(t,o,a){let e=this._extensions[TV.extensionName],i=o.binary?2:1,A=o.compress,r,s;typeof t=="string"?(r=Buffer.byteLength(t),s=!1):Jd(t)?(r=t.size,s=!1):(t=Bl(t),r=t.length,s=Bl.readOnly),this._firstFragment?(this._firstFragment=!1,A&&e&&e.params[e._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(A=r>=e._threshold),this._compress=A):(A=!1,i=0),o.fin&&(this._firstFragment=!0);let g={[jo]:r,fin:o.fin,generateMask:this._generateMask,mask:o.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:s,rsv1:A};Jd(t)?this._state!==Nn?this.enqueue([this.getBlobData,t,this._compress,g,a]):this.getBlobData(t,this._compress,g,a):this._state!==Nn?this.enqueue([this.dispatch,t,this._compress,g,a]):this.dispatch(t,this._compress,g,a)}getBlobData(t,o,a,e){this._bufferedBytes+=a[jo],this._state=ANe,t.arrayBuffer().then(i=>{if(this._socket.destroyed){let r=new Error("The socket was closed while the blob was being read");process.nextTick(_R,this,r,e);return}this._bufferedBytes-=a[jo];let A=Bl(i);o?this.dispatch(A,o,a,e):(this._state=Nn,this.sendFrame(n.frame(A,a),e),this.dequeue())}).catch(i=>{process.nextTick(tNe,this,i,e)})}dispatch(t,o,a,e){if(!o){this.sendFrame(n.frame(t,a),e);return}let i=this._extensions[TV.extensionName];this._bufferedBytes+=a[jo],this._state=eNe,i.compress(t,a.fin,(A,r)=>{if(this._socket.destroyed){let s=new Error("The socket was closed while data was being compressed");_R(this,s,e);return}this._bufferedBytes-=a[jo],this._state=Nn,a.readOnly=!1,this.sendFrame(n.frame(r,a),e),this.dequeue()})}dequeue(){for(;this._state===Nn&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][jo],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][jo],this._queue.push(t)}sendFrame(t,o){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],o),this._socket.uncork()):this._socket.write(t[0],o)}};RV.exports=MR;function _R(n,t,o){typeof o=="function"&&o(t);for(let a=0;a{"use strict";var{kForOnEventAttribute:EC,kListener:NR}=Tg(),kV=Symbol("kCode"),vV=Symbol("kData"),PV=Symbol("kError"),GV=Symbol("kMessage"),FV=Symbol("kReason"),zd=Symbol("kTarget"),LV=Symbol("kType"),UV=Symbol("kWasClean"),Rg=class{constructor(t){this[zd]=null,this[LV]=t}get target(){return this[zd]}get type(){return this[LV]}};Object.defineProperty(Rg.prototype,"target",{enumerable:!0});Object.defineProperty(Rg.prototype,"type",{enumerable:!0});var Ql=class extends Rg{constructor(t,o={}){super(t),this[kV]=o.code===void 0?0:o.code,this[FV]=o.reason===void 0?"":o.reason,this[UV]=o.wasClean===void 0?!1:o.wasClean}get code(){return this[kV]}get reason(){return this[FV]}get wasClean(){return this[UV]}};Object.defineProperty(Ql.prototype,"code",{enumerable:!0});Object.defineProperty(Ql.prototype,"reason",{enumerable:!0});Object.defineProperty(Ql.prototype,"wasClean",{enumerable:!0});var Vd=class extends Rg{constructor(t,o={}){super(t),this[PV]=o.error===void 0?null:o.error,this[GV]=o.message===void 0?"":o.message}get error(){return this[PV]}get message(){return this[GV]}};Object.defineProperty(Vd.prototype,"error",{enumerable:!0});Object.defineProperty(Vd.prototype,"message",{enumerable:!0});var uC=class extends Rg{constructor(t,o={}){super(t),this[vV]=o.data===void 0?null:o.data}get data(){return this[vV]}};Object.defineProperty(uC.prototype,"data",{enumerable:!0});var rNe={addEventListener(n,t,o={}){for(let e of this.listeners(n))if(!o[EC]&&e[NR]===t&&!e[EC])return;let a;if(n==="message")a=function(i,A){let r=new uC("message",{data:A?i:i.toString()});r[zd]=this,jm(t,this,r)};else if(n==="close")a=function(i,A){let r=new Ql("close",{code:i,reason:A.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[zd]=this,jm(t,this,r)};else if(n==="error")a=function(i){let A=new Vd("error",{error:i,message:i.message});A[zd]=this,jm(t,this,A)};else if(n==="open")a=function(){let i=new Rg("open");i[zd]=this,jm(t,this,i)};else return;a[EC]=!!o[EC],a[NR]=t,o.once?this.once(n,a):this.on(n,a)},removeEventListener(n,t){for(let o of this.listeners(n))if(o[NR]===t&&!o[EC]){this.removeListener(n,o);break}}};HV.exports={CloseEvent:Ql,ErrorEvent:Vd,Event:Rg,EventTarget:rNe,MessageEvent:uC};function jm(n,t,o){typeof n=="object"&&n.handleEvent?n.handleEvent.call(n,o):n.call(t,o)}});var Jm=ee((XlA,xV)=>{"use strict";var{tokenChars:CC}=jd();function ws(n,t,o){n[t]===void 0?n[t]=[o]:n[t].push(o)}function iNe(n){let t=Object.create(null),o=Object.create(null),a=!1,e=!1,i=!1,A,r,s=-1,g=-1,c=-1,I=0;for(;I{let o=n[t];return Array.isArray(o)||(o=[o]),o.map(a=>[t].concat(Object.keys(a).map(e=>{let i=a[e];return Array.isArray(i)||(i=[i]),i.map(A=>A===!0?e:`${e}=${A}`).join("; ")})).join("; ")).join(", ")}).join(", ")}xV.exports={format:aNe,parse:iNe}});var Wm=ee((ApA,AW)=>{"use strict";var oNe=$e("events"),nNe=$e("https"),sNe=$e("http"),JV=$e("net"),gNe=$e("tls"),{randomBytes:cNe,createHash:INe}=$e("crypto"),{Duplex:$lA,Readable:epA}=$e("stream"),{URL:RR}=$e("url"),vc=Yd(),lNe=bR(),pNe=TR(),{isBlob:dNe}=jd(),{BINARY_TYPES:YV,CLOSE_TIMEOUT:hNe,EMPTY_BUFFER:qm,GUID:ENe,kForOnEventAttribute:kR,kListener:uNe,kStatusCode:CNe,kWebSocket:li,NOOP:qV}=Tg(),{EventTarget:{addEventListener:BNe,removeEventListener:fNe}}=KV(),{format:QNe,parse:yNe}=Jm(),{toBuffer:mNe}=dC(),zV=Symbol("kAborted"),vR=[8,13],kg=["CONNECTING","OPEN","CLOSING","CLOSED"],SNe=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,rr=class n extends oNe{constructor(t,o,a){super(),this._binaryType=YV[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=qm,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=n.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,o===void 0?o=[]:Array.isArray(o)||(typeof o=="object"&&o!==null?(a=o,o=[]):o=[o]),VV(this,t,o,a)):(this._autoPong=a.autoPong,this._closeTimeout=a.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){YV.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,o,a){let e=new lNe({allowSynchronousEvents:a.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:a.maxBufferedChunks,maxFragments:a.maxFragments,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation}),i=new pNe(t,this._extensions,a.generateMask);this._receiver=e,this._sender=i,this._socket=t,e[li]=this,i[li]=this,t[li]=this,e.on("conclude",ONe),e.on("drain",bNe),e.on("error",MNe),e.on("message",_Ne),e.on("ping",TNe),e.on("pong",NNe),i.onerror=RNe,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),o.length>0&&t.unshift(o),t.on("close",XV),t.on("data",Vm),t.on("end",$V),t.on("error",eW),this._readyState=n.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[vc.extensionName]&&this._extensions[vc.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,o){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){lo(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===n.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=n.CLOSING,this._sender.close(t,o,!this._isServer,a=>{a||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),ZV(this)}}pause(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,o,a){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(a=t,t=o=void 0):typeof o=="function"&&(a=o,o=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){PR(this,t,a);return}o===void 0&&(o=!this._isServer),this._sender.ping(t||qm,o,a)}pong(t,o,a){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(a=t,t=o=void 0):typeof o=="function"&&(a=o,o=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){PR(this,t,a);return}o===void 0&&(o=!this._isServer),this._sender.pong(t||qm,o,a)}resume(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,o,a){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof o=="function"&&(a=o,o={}),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){PR(this,t,a);return}let e={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...o};this._extensions[vc.extensionName]||(e.compress=!1),this._sender.send(t||qm,e,a)}terminate(){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){lo(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=n.CLOSING,this._socket.destroy())}}};Object.defineProperty(rr,"CONNECTING",{enumerable:!0,value:kg.indexOf("CONNECTING")});Object.defineProperty(rr.prototype,"CONNECTING",{enumerable:!0,value:kg.indexOf("CONNECTING")});Object.defineProperty(rr,"OPEN",{enumerable:!0,value:kg.indexOf("OPEN")});Object.defineProperty(rr.prototype,"OPEN",{enumerable:!0,value:kg.indexOf("OPEN")});Object.defineProperty(rr,"CLOSING",{enumerable:!0,value:kg.indexOf("CLOSING")});Object.defineProperty(rr.prototype,"CLOSING",{enumerable:!0,value:kg.indexOf("CLOSING")});Object.defineProperty(rr,"CLOSED",{enumerable:!0,value:kg.indexOf("CLOSED")});Object.defineProperty(rr.prototype,"CLOSED",{enumerable:!0,value:kg.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(n=>{Object.defineProperty(rr.prototype,n,{enumerable:!0})});["open","error","close","message"].forEach(n=>{Object.defineProperty(rr.prototype,`on${n}`,{enumerable:!0,get(){for(let t of this.listeners(n))if(t[kR])return t[uNe];return null},set(t){for(let o of this.listeners(n))if(o[kR]){this.removeListener(n,o);break}typeof t=="function"&&this.addEventListener(n,t,{[kR]:!0})}})});rr.prototype.addEventListener=BNe;rr.prototype.removeEventListener=fNe;AW.exports=rr;function VV(n,t,o,a){let e={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:hNe,protocolVersion:vR[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...a,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(n._autoPong=e.autoPong,n._closeTimeout=e.closeTimeout,!vR.includes(e.protocolVersion))throw new RangeError(`Unsupported protocol version: ${e.protocolVersion} (supported versions: ${vR.join(", ")})`);let i;if(t instanceof RR)i=t;else try{i=new RR(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),n._url=i.href;let A=i.protocol==="wss:",r=i.protocol==="ws+unix:",s;if(i.protocol!=="ws:"&&!A&&!r?s=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:r&&!i.pathname?s="The URL's pathname is empty":i.hash&&(s="The URL contains a fragment identifier"),s){let Q=new SyntaxError(s);if(n._redirects===0)throw Q;zm(n,Q);return}let g=A?443:80,c=cNe(16).toString("base64"),I=A?nNe.request:sNe.request,p=new Set,B;if(e.createConnection=e.createConnection||(A?DNe:wNe),e.defaultPort=e.defaultPort||g,e.port=i.port||g,e.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,e.headers={...e.headers,"Sec-WebSocket-Version":e.protocolVersion,"Sec-WebSocket-Key":c,Connection:"Upgrade",Upgrade:"websocket"},e.path=i.pathname+i.search,e.timeout=e.handshakeTimeout,e.perMessageDeflate&&(B=new vc({...e.perMessageDeflate,isServer:!1,maxPayload:e.maxPayload}),e.headers["Sec-WebSocket-Extensions"]=QNe({[vc.extensionName]:B.offer()})),o.length){for(let Q of o){if(typeof Q!="string"||!SNe.test(Q)||p.has(Q))throw new SyntaxError("An invalid or duplicated subprotocol was specified");p.add(Q)}e.headers["Sec-WebSocket-Protocol"]=o.join(",")}if(e.origin&&(e.protocolVersion<13?e.headers["Sec-WebSocket-Origin"]=e.origin:e.headers.Origin=e.origin),(i.username||i.password)&&(e.auth=`${i.username}:${i.password}`),r){let Q=e.path.split(":");e.socketPath=Q[0],e.path=Q[1]}let f;if(e.followRedirects){if(n._redirects===0){n._originalIpc=r,n._originalSecure=A,n._originalHostOrSocketPath=r?e.socketPath:i.host;let Q=a&&a.headers;if(a={...a,headers:{}},Q)for(let[y,m]of Object.entries(Q))a.headers[y.toLowerCase()]=m}else if(n.listenerCount("redirect")===0){let Q=r?n._originalIpc?e.socketPath===n._originalHostOrSocketPath:!1:n._originalIpc?!1:i.host===n._originalHostOrSocketPath;(!Q||n._originalSecure&&!A)&&(delete e.headers.authorization,delete e.headers.cookie,Q||delete e.headers.host,e.auth=void 0)}e.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(e.auth).toString("base64")),f=n._req=I(e),n._redirects&&n.emit("redirect",n.url,f)}else f=n._req=I(e);e.timeout&&f.on("timeout",()=>{lo(n,f,"Opening handshake has timed out")}),f.on("error",Q=>{f===null||f[zV]||(f=n._req=null,zm(n,Q))}),f.on("response",Q=>{let y=Q.headers.location,m=Q.statusCode;if(y&&e.followRedirects&&m>=300&&m<400){if(++n._redirects>e.maxRedirects){lo(n,f,"Maximum redirects exceeded");return}f.abort();let T;try{T=new RR(y,t)}catch{let R=new SyntaxError(`Invalid URL: ${y}`);zm(n,R);return}VV(n,T,o,a)}else n.emit("unexpected-response",f,Q)||lo(n,f,`Unexpected server response: ${Q.statusCode}`)}),f.on("upgrade",(Q,y,m)=>{if(n.emit("upgrade",Q),n.readyState!==rr.CONNECTING)return;f=n._req=null;let T=Q.headers.upgrade;if(T===void 0||T.toLowerCase()!=="websocket"){lo(n,y,"Invalid Upgrade header");return}let _=INe("sha1").update(c+ENe).digest("base64");if(Q.headers["sec-websocket-accept"]!==_){lo(n,y,"Invalid Sec-WebSocket-Accept header");return}let R=Q.headers["sec-websocket-protocol"],L;if(R!==void 0?p.size?p.has(R)||(L="Server sent an invalid subprotocol"):L="Server sent a subprotocol but none was requested":p.size&&(L="Server sent no subprotocol"),L){lo(n,y,L);return}R&&(n._protocol=R);let U=Q.headers["sec-websocket-extensions"];if(U!==void 0){if(!B){lo(n,y,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let F;try{F=yNe(U)}catch{lo(n,y,"Invalid Sec-WebSocket-Extensions header");return}let q=Object.keys(F);if(q.length!==1||q[0]!==vc.extensionName){lo(n,y,"Server indicated an extension that was not requested");return}try{B.accept(F[vc.extensionName])}catch{lo(n,y,"Invalid Sec-WebSocket-Extensions header");return}n._extensions[vc.extensionName]=B}n.setSocket(y,m,{allowSynchronousEvents:e.allowSynchronousEvents,generateMask:e.generateMask,maxBufferedChunks:e.maxBufferedChunks,maxFragments:e.maxFragments,maxPayload:e.maxPayload,skipUTF8Validation:e.skipUTF8Validation})}),e.finishRequest?e.finishRequest(f,n):f.end()}function zm(n,t){n._readyState=rr.CLOSING,n._errorEmitted=!0,n.emit("error",t),n.emitClose()}function wNe(n){return n.path=n.socketPath,JV.connect(n)}function DNe(n){return n.path=void 0,!n.servername&&n.servername!==""&&(n.servername=JV.isIP(n.host)?"":n.host),gNe.connect(n)}function lo(n,t,o){n._readyState=rr.CLOSING;let a=new Error(o);Error.captureStackTrace(a,lo),t.setHeader?(t[zV]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(zm,n,a)):(t.destroy(a),t.once("error",n.emit.bind(n,"error")),t.once("close",n.emitClose.bind(n)))}function PR(n,t,o){if(t){let a=dNe(t)?t.size:mNe(t).length;n._socket?n._sender._bufferedBytes+=a:n._bufferedAmount+=a}if(o){let a=new Error(`WebSocket is not open: readyState ${n.readyState} (${kg[n.readyState]})`);process.nextTick(o,a)}}function ONe(n,t){let o=this[li];o._closeFrameReceived=!0,o._closeMessage=t,o._closeCode=n,o._socket[li]!==void 0&&(o._socket.removeListener("data",Vm),process.nextTick(WV,o._socket),n===1005?o.close():o.close(n,t))}function bNe(){let n=this[li];n.isPaused||n._socket.resume()}function MNe(n){let t=this[li];t._socket[li]!==void 0&&(t._socket.removeListener("data",Vm),process.nextTick(WV,t._socket),t.close(n[CNe])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",n))}function jV(){this[li].emitClose()}function _Ne(n,t){this[li].emit("message",n,t)}function TNe(n){let t=this[li];t._autoPong&&t.pong(n,!this._isServer,qV),t.emit("ping",n)}function NNe(n){this[li].emit("pong",n)}function WV(n){n.resume()}function RNe(n){let t=this[li];t.readyState!==rr.CLOSED&&(t.readyState===rr.OPEN&&(t._readyState=rr.CLOSING,ZV(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",n)))}function ZV(n){n._closeTimer=setTimeout(n._socket.destroy.bind(n._socket),n._closeTimeout)}function XV(){let n=this[li];if(this.removeListener("close",XV),this.removeListener("data",Vm),this.removeListener("end",$V),n._readyState=rr.CLOSING,!this._readableState.endEmitted&&!n._closeFrameReceived&&!n._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);n._receiver.write(t)}n._receiver.end(),this[li]=void 0,clearTimeout(n._closeTimer),n._receiver._writableState.finished||n._receiver._writableState.errorEmitted?n.emitClose():(n._receiver.on("error",jV),n._receiver.on("finish",jV))}function Vm(n){this[li]._receiver.write(n)||this.pause()}function $V(){let n=this[li];n._readyState=rr.CLOSING,n._receiver.end(),this.end()}function eW(){let n=this[li];this.removeListener("error",eW),this.on("error",qV),n&&(n._readyState=rr.CLOSING,this.destroy())}});var aW=ee((rpA,iW)=>{"use strict";var tpA=Wm(),{Duplex:kNe}=$e("stream");function tW(n){n.emit("close")}function vNe(){!this.destroyed&&this._writableState.finished&&this.destroy()}function rW(n){this.removeListener("error",rW),this.destroy(),this.listenerCount("error")===0&&this.emit("error",n)}function PNe(n,t){let o=!0,a=new kNe({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return n.on("message",function(i,A){let r=!A&&a._readableState.objectMode?i.toString():i;a.push(r)||n.pause()}),n.once("error",function(i){a.destroyed||(o=!1,a.destroy(i))}),n.once("close",function(){a.destroyed||a.push(null)}),a._destroy=function(e,i){if(n.readyState===n.CLOSED){i(e),process.nextTick(tW,a);return}let A=!1;n.once("error",function(s){A=!0,i(s)}),n.once("close",function(){A||i(e),process.nextTick(tW,a)}),o&&n.terminate()},a._final=function(e){if(n.readyState===n.CONNECTING){n.once("open",function(){a._final(e)});return}n._socket!==null&&(n._socket._writableState.finished?(e(),a._readableState.endEmitted&&a.destroy()):(n._socket.once("finish",function(){e()}),n.close()))},a._read=function(){n.isPaused&&n.resume()},a._write=function(e,i,A){if(n.readyState===n.CONNECTING){n.once("open",function(){a._write(e,i,A)});return}n.send(e,A)},a.on("end",vNe),a.on("error",rW),a}iW.exports=PNe});var GR=ee((ipA,oW)=>{"use strict";var{tokenChars:GNe}=jd();function FNe(n){let t=new Set,o=-1,a=-1,e=0;for(e;e{"use strict";var LNe=$e("events"),Zm=$e("http"),{Duplex:apA}=$e("stream"),{createHash:UNe}=$e("crypto"),nW=Jm(),yl=Yd(),HNe=GR(),KNe=Wm(),{CLOSE_TIMEOUT:xNe,GUID:YNe,kWebSocket:jNe}=Tg(),JNe=/^[+/0-9A-Za-z]{22}==$/,sW=0,gW=1,IW=2,FR=class extends LNe{constructor(t,o){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:xNe,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:KNe,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Zm.createServer((a,e)=>{let i=Zm.STATUS_CODES[426];e.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),e.end(i)}),this._server.listen(t.port,t.host,t.backlog,o)):t.server&&(this._server=t.server),this._server){let a=this.emit.bind(this,"connection");this._removeListeners=qNe(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(e,i,A)=>{this.handleUpgrade(e,i,A,a)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=sW}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===IW){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(BC,this);return}if(t&&this.once("close",t),this._state!==gW)if(this._state=gW,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(BC,this):process.nextTick(BC,this);else{let o=this._server;this._removeListeners(),this._removeListeners=this._server=null,o.close(()=>{BC(this)})}}shouldHandle(t){if(this.options.path){let o=t.url.indexOf("?");if((o!==-1?t.url.slice(0,o):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,o,a,e){o.on("error",cW);let i=t.headers["sec-websocket-key"],A=t.headers.upgrade,r=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ml(this,t,o,405,"Invalid HTTP method");return}if(A===void 0||A.toLowerCase()!=="websocket"){ml(this,t,o,400,"Invalid Upgrade header");return}if(i===void 0||!JNe.test(i)){ml(this,t,o,400,"Missing or invalid Sec-WebSocket-Key header");return}if(r!==13&&r!==8){ml(this,t,o,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){fC(o,400);return}let s=t.headers["sec-websocket-protocol"],g=new Set;if(s!==void 0)try{g=HNe.parse(s)}catch{ml(this,t,o,400,"Invalid Sec-WebSocket-Protocol header");return}let c=t.headers["sec-websocket-extensions"],I={};if(this.options.perMessageDeflate&&c!==void 0){let p=new yl({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let B=nW.parse(c);B[yl.extensionName]&&(p.accept(B[yl.extensionName]),I[yl.extensionName]=p)}catch{ml(this,t,o,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let p={origin:t.headers[`${r===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(p,(B,f,Q,y)=>{if(!B)return fC(o,f||401,Q,y);this.completeUpgrade(I,i,g,t,o,a,e)});return}if(!this.options.verifyClient(p))return fC(o,401)}this.completeUpgrade(I,i,g,t,o,a,e)}completeUpgrade(t,o,a,e,i,A,r){if(!i.readable||!i.writable)return i.destroy();if(i[jNe])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>sW)return fC(i,503);let g=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${UNe("sha1").update(o+YNe).digest("base64")}`],c=new this.options.WebSocket(null,void 0,this.options);if(a.size){let I=this.options.handleProtocols?this.options.handleProtocols(a,e):a.values().next().value;I&&(g.push(`Sec-WebSocket-Protocol: ${I}`),c._protocol=I)}if(t[yl.extensionName]){let I=t[yl.extensionName].params,p=nW.format({[yl.extensionName]:[I]});g.push(`Sec-WebSocket-Extensions: ${p}`),c._extensions=t}this.emit("headers",g,e),i.write(g.concat(`\r +`+t.prev}function om(n,t){var o=MN(n),a=[];if(o){a.length=n.length;for(var e=0;e{"use strict";var HOe=AC(),KOe=wc(),gm=function(n,t,o){for(var a=n,e;(e=a.next)!=null;a=e)if(e.key===t)return a.next=e.next,o||(e.next=n.next,n.next=e),e},xOe=function(n,t){if(n){var o=gm(n,t);return o&&o.value}},YOe=function(n,t,o){var a=gm(n,t);a?a.value=o:n.next={key:t,next:n.next,value:o}},jOe=function(n,t){return n?!!gm(n,t):!1},JOe=function(n,t){if(n)return gm(n,t,!0)};D8.exports=function(){var t,o={assert:function(a){if(!o.has(a))throw new KOe("Side channel does not contain "+HOe(a))},delete:function(a){var e=JOe(t,a);return e&&t&&!t.next&&(t=void 0),!!e},get:function(a){return xOe(t,a)},has:function(a){return jOe(t,a)},set:function(a,e){t||(t={next:void 0}),YOe(t,a,e)}};return o}});var kN=ee((PlA,_8)=>{"use strict";var b8=ku(),M8=g0(),qOe=M8([b8("%String.prototype.indexOf%")]);_8.exports=function(t,o){var a=b8(t,!!o);return typeof a=="function"&&qOe(t,".prototype.")>-1?M8([a]):a}});var vN=ee((GlA,N8)=>{"use strict";var zOe=ku(),tC=kN(),VOe=AC(),WOe=wc(),T8=zOe("%Map%",!0),ZOe=tC("Map.prototype.get",!0),XOe=tC("Map.prototype.set",!0),$Oe=tC("Map.prototype.has",!0),ebe=tC("Map.prototype.delete",!0),Abe=tC("Map.prototype.size",!0);N8.exports=!!T8&&function(){var t,o={assert:function(a){if(!o.has(a))throw new WOe("Side channel does not contain "+VOe(a))},delete:function(a){if(t){var e=ebe(t,a);return Abe(t)===0&&(t=void 0),e}return!1},get:function(a){if(t)return ZOe(t,a)},has:function(a){return t?$Oe(t,a):!1},set:function(a,e){t||(t=new T8),XOe(t,a,e)}};return o}});var k8=ee((FlA,R8)=>{"use strict";var tbe=ku(),Im=kN(),rbe=AC(),cm=vN(),ibe=wc(),Nd=tbe("%WeakMap%",!0),abe=Im("WeakMap.prototype.get",!0),obe=Im("WeakMap.prototype.set",!0),nbe=Im("WeakMap.prototype.has",!0),sbe=Im("WeakMap.prototype.delete",!0);R8.exports=Nd?function(){var t,o,a={assert:function(e){if(!a.has(e))throw new ibe("Side channel does not contain "+rbe(e))},delete:function(e){if(Nd&&e&&(typeof e=="object"||typeof e=="function")){if(t)return sbe(t,e)}else if(cm&&o)return o.delete(e);return!1},get:function(e){return Nd&&e&&(typeof e=="object"||typeof e=="function")&&t?abe(t,e):o&&o.get(e)},has:function(e){return Nd&&e&&(typeof e=="object"||typeof e=="function")&&t?nbe(t,e):!!o&&o.has(e)},set:function(e,i){Nd&&e&&(typeof e=="object"||typeof e=="function")?(t||(t=new Nd),obe(t,e,i)):cm&&(o||(o=cm()),o.set(e,i))}};return a}:cm});var PN=ee((LlA,v8)=>{"use strict";var gbe=wc(),cbe=AC(),Ibe=O8(),lbe=vN(),pbe=k8(),dbe=pbe||lbe||Ibe;v8.exports=function(){var t,o={assert:function(a){if(!o.has(a)){var e=a&&Object(a)===a?"the given object key":cbe(a);throw new gbe("Side channel does not contain "+e)}},delete:function(a){return!!t&&t.delete(a)},get:function(a){return t&&t.get(a)},has:function(a){return!!t&&t.has(a)},set:function(a,e){t||(t=dbe()),t.set(a,e)}};return o}});var lm=ee((UlA,P8)=>{"use strict";var hbe=String.prototype.replace,Ebe=/%20/g,GN={RFC1738:"RFC1738",RFC3986:"RFC3986"};P8.exports={default:GN.RFC3986,formatters:{RFC1738:function(n){return hbe.call(n,Ebe,"+")},RFC3986:function(n){return String(n)}},RFC1738:GN.RFC1738,RFC3986:GN.RFC3986}});var HN=ee((HlA,L8)=>{"use strict";var ube=lm(),F8=PN(),G8=i0(),FN=Object.prototype.hasOwnProperty,Il=Array.isArray,dm=F8(),ll=function(t,o){return dm.set(t,o),t},pl=function(t){return dm.has(t)},rC=function(t){return dm.get(t)},LN=function(t,o){dm.set(t,o)},Qs=(function(){for(var n=[],t=0;t<256;++t)n[n.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return n})(),Cbe=function(t){for(;t.length>1;){var o=t.pop(),a=o.obj[o.prop];if(Il(a)){for(var e=[],i=0;i=a.arrayLimit){if(a.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+a.arrayLimit+" element"+(a.arrayLimit===1?"":"s")+" allowed in an array.");return ll(Rd(t.concat(o),a),e)}t[e]=o}else if(t&&typeof t=="object")if(pl(t)){var i=rC(t)+1;t[i]=o,LN(t,i)}else{if(a&&a.strictMerge)return[t,o];(a&&(a.plainObjects||a.allowPrototypes)||!FN.call(Object.prototype,o))&&(t[o]=!0)}else return[t,o];return t}if(!t||typeof t!="object"){if(pl(o)){for(var A=Object.keys(o),r=a&&a.plainObjects?{__proto__:null,0:t}:{0:t},s=0;sa.arrayLimit){if(a.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+a.arrayLimit+" element"+(a.arrayLimit===1?"":"s")+" allowed in an array.");return ll(Rd(c,a),c.length-1)}return c}var I=t;if(Il(t)&&!Il(o)&&(I=Rd(t,a)),Il(t)&&Il(o)){if(o.forEach(function(p,B){if(FN.call(t,B)){var f=t[B];f&&typeof f=="object"&&p&&typeof p=="object"?t[B]=n(f,p,a):t[t.length]=p}else t[B]=p}),a&&typeof a.arrayLimit=="number"&&t.length>a.arrayLimit){if(a.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+a.arrayLimit+" element"+(a.arrayLimit===1?"":"s")+" allowed in an array.");return ll(Rd(t,a),t.length-1)}return t}return Object.keys(o).reduce(function(p,B){var f=o[B];if(FN.call(p,B)?UN(p,B,n(p[B],f,a)):UN(p,B,f),pl(o)&&!pl(p)&&ll(p,rC(o)),pl(p)){var Q=parseInt(B,10);String(Q)===B&&Q>=0&&Q>rC(p)&&LN(p,Q)}return p},I)},fbe=function(t,o){return Object.keys(o).reduce(function(a,e){return UN(a,e,o[e]),a},t)},Qbe=function(n,t,o){var a=n.replace(/\+/g," ");if(o==="iso-8859-1")return a.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(a)}catch{return a}},pm=1024,ybe=function(t,o,a,e,i){if(t.length===0)return t;var A=t;if(typeof t=="symbol"?A=Symbol.prototype.toString.call(t):typeof t!="string"&&(A=String(t)),a==="iso-8859-1")return escape(A).replace(/%u[0-9a-f]{4}/gi,function(f){return"%26%23"+parseInt(f.slice(2),16)+"%3B"});for(var r="",s=0;s=pm?A.slice(s,s+pm):A;if(s+pm=55296&&c<=56319&&(g=g.slice(0,-1),s-=1)}for(var I=[],p=0;p=48&&B<=57||B>=65&&B<=90||B>=97&&B<=122||i===ube.RFC1738&&(B===40||B===41)){I[I.length]=g.charAt(p);continue}if(B<128){I[I.length]=Qs[B];continue}if(B<2048){I[I.length]=Qs[192|B>>6]+Qs[128|B&63];continue}if(B<55296||B>=57344){I[I.length]=Qs[224|B>>12]+Qs[128|B>>6&63]+Qs[128|B&63];continue}p+=1,B=65536+((B&1023)<<10|g.charCodeAt(p)&1023),I[I.length]=Qs[240|B>>18]+Qs[128|B>>12&63]+Qs[128|B>>6&63]+Qs[128|B&63]}r+=I.join("")}return r},mbe=function(t){for(var o=[{obj:{o:t},prop:"o"}],a=F8(),e=0;ea){if(i)throw new RangeError("Array limit exceeded. Only "+a+" element"+(a===1?"":"s")+" allowed in an array.");return ll(Rd(r,{plainObjects:e}),r.length-1)}return r},Obe=function(t,o){if(Il(t)){for(var a=[],e=0;e{"use strict";var H8=PN(),hm=HN(),iC=lm(),bbe=Object.prototype.hasOwnProperty,K8={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,o){return t+"["+o+"]"},repeat:function(t){return t}},ys=Array.isArray,Mbe=Array.prototype.push,x8=function(n,t){Mbe.apply(n,ys(t)?t:[t])},_be=Date.prototype.toISOString,U8=iC.default,xr={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:hm.encode,encodeValuesOnly:!1,filter:void 0,format:U8,formatter:iC.formatters[U8],indices:!1,serializeDate:function(t){return _be.call(t)},skipNulls:!1,strictNullHandling:!1},Tbe=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},KN={},Nbe=function n(t,o,a,e,i,A,r,s,g,c,I,p,B,f,Q,y,m,T){for(var _=t,R=T,L=0,U=!1;(R=R.get(KN))!==void 0&&!U;){var F=R.get(t);if(L+=1,typeof F<"u"){if(F===L)throw new RangeError("Cyclic object value");U=!0}typeof R.get(KN)>"u"&&(L=0)}if(typeof c=="function"?_=c(o,_):_ instanceof Date?_=B(_):a==="comma"&&ys(_)&&(_=hm.maybeMap(_,function(oe){return oe instanceof Date?B(oe):oe})),_===null){if(A)return Q(g&&!y?g(o,xr.encoder,m,"key",f):o);_=""}if(Tbe(_)||hm.isBuffer(_)){if(g){var q=y?o:g(o,xr.encoder,m,"key",f);return[Q(q)+"="+Q(g(_,xr.encoder,m,"value",f))]}return[Q(o)+"="+Q(String(_))]}var z=[];if(typeof _>"u")return z;var K;if(a==="comma"&&ys(_))y&&g&&(_=hm.maybeMap(_,function(oe){return oe==null?oe:g(oe)})),K=[{value:_.length>0?_.join(",")||null:void 0}];else if(ys(c))K=c;else{var G=Object.keys(_);K=I?G.sort(I):G}var V=s?String(o).replace(/\./g,"%2E"):String(o),H=e&&ys(_)&&_.length===1?V+"[]":V;if(i&&ys(_)&&_.length===0)return H+"[]";for(var N=0;N"u"?t.encodeDotInKeys===!0?!0:xr.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:xr.addQueryPrefix,allowDots:r,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:xr.allowEmptyArrays,arrayFormat:A,charset:o,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:xr.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?xr.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:xr.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:xr.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:xr.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:xr.encodeValuesOnly,filter:i,format:a,formatter:e,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:xr.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:xr.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:xr.strictNullHandling}};Y8.exports=function(n,t){var o=n,a=Rbe(t),e,i;typeof a.filter=="function"?(i=a.filter,o=i("",o)):ys(a.filter)&&(i=a.filter,e=i);var A=[];if(typeof o!="object"||o===null)return"";var r=K8[a.arrayFormat],s=r==="comma"&&a.commaRoundTrip;e||(e=Object.keys(o)),a.sort&&e.sort(a.sort);for(var g=H8(),c=0;c"u"||I===null)){var p=o[I];a.skipNulls&&p===null||x8(A,Nbe(p,I,r,s,a.allowEmptyArrays,a.strictNullHandling,a.skipNulls,a.encodeDotInKeys,a.encode?a.encoder:null,a.filter,a.sort,a.allowDots,a.serializeDate,a.format,a.formatter,a.encodeValuesOnly,a.charset,g))}}var B=A.join(a.delimiter),f=a.addQueryPrefix===!0?"?":"";return a.charsetSentinel&&(a.charset==="iso-8859-1"?f+="utf8=%26%2310003%3B"+a.delimiter:f+="utf8=%E2%9C%93"+a.delimiter),B.length>0?f+B:""}});var z8=ee((xlA,q8)=>{"use strict";var ms=HN(),Em=Object.prototype.hasOwnProperty,xN=Array.isArray,dr={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ms.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},kbe=function(n){return n.replace(/&#(\d+);/g,function(t,o){return String.fromCharCode(parseInt(o,10))})},J8=function(n,t,o,a){if(n&&typeof n=="string"&&t.comma&&n.indexOf(",")>-1){if(a&&t.throwOnLimitExceeded)for(var e=0,i=n.indexOf(",");i>-1;){if(e+=1,e>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");i=n.indexOf(",",i+1)}return n.split(",")}if(t.throwOnLimitExceeded&&o>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return n},vbe="utf8=%26%2310003%3B",Pbe="utf8=%E2%9C%93",Gbe=function(t,o){var a={__proto__:null},e=o.ignoreQueryPrefix?t.replace(/^\?/,""):t;e=e.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var i=o.parameterLimit===1/0?void 0:o.parameterLimit,A=e.split(o.delimiter,o.throwOnLimitExceeded&&typeof i<"u"?i+1:i);if(o.throwOnLimitExceeded&&typeof i<"u"&&A.length>i)throw new RangeError("Parameter limit exceeded. Only "+i+" parameter"+(i===1?"":"s")+" allowed.");var r=-1,s,g=o.charset;if(o.charsetSentinel)for(s=0;s-1&&(f=xN(f)?[f]:f),o.comma&&xN(f)&&f.length>o.arrayLimit&&(f=ms.combine([],f,o.arrayLimit,o.plainObjects,o.throwOnLimitExceeded)),B!==null){var Q=Em.call(a,B);Q&&(o.duplicates==="combine"||c.indexOf("[]=")>-1)?a[B]=ms.combine(a[B],f,o.arrayLimit,o.plainObjects,o.throwOnLimitExceeded):(!Q||o.duplicates==="last")&&(a[B]=f)}}return a},Fbe=function(n,t,o,a){var e=0;if(n.length>0&&n[n.length-1]==="[]"){var i=n.slice(0,-1).join("");e=Array.isArray(t)&&t[i]?t[i].length:0}for(var A=a?t:J8(t,o,e),r=n.length-1;r>=0;--r){var s,g=n[r];if(g==="[]"&&o.parseArrays)ms.isOverflow(A)?s=A:s=o.allowEmptyArrays&&(A===""||o.strictNullHandling&&A===null)?[]:ms.combine([],A,o.arrayLimit,o.plainObjects,o.throwOnLimitExceeded);else{s=o.plainObjects?{__proto__:null}:{};var c=g.charAt(0)==="["&&g.charAt(g.length-1)==="]"?g.slice(1,-1):g,I=o.decodeDotInKeys?c.replace(/%2E/g,"."):c,p=parseInt(I,10),B=!isNaN(p)&&g!==I&&String(p)===I&&p>=0&&o.parseArrays;if(!o.parseArrays&&I==="")s={0:A};else if(B&&p=0?a.slice(0,i):a;if(A){if(!o.plainObjects&&Em.call(Object.prototype,A)&&!o.allowPrototypes)return;e[e.length]=A}for(var r=a.length,s=i,g=0;s>=0&&g=0){if(o.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+o.depth+" and strictDepth is true");e[e.length]="["+a.slice(s)+"]"}return e},Ube=function(t,o,a,e){if(t){var i=Lbe(t,a);if(i)return Fbe(i,o,a,e)}},Hbe=function(t){if(!t)return dr;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var o=typeof t.charset>"u"?dr.charset:t.charset,a=typeof t.duplicates>"u"?dr.duplicates:t.duplicates;if(a!=="combine"&&a!=="first"&&a!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var e=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:dr.allowDots:!!t.allowDots;return{allowDots:e,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:dr.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:dr.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:dr.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:dr.arrayLimit,charset:o,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:dr.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:dr.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:dr.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:dr.decoder,delimiter:typeof t.delimiter=="string"||ms.isRegExp(t.delimiter)?t.delimiter:dr.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:dr.depth,duplicates:a,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:dr.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:dr.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:dr.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:dr.strictDepth,strictMerge:typeof t.strictMerge=="boolean"?!!t.strictMerge:dr.strictMerge,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:dr.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}};q8.exports=function(n,t){var o=Hbe(t);if(n===""||n===null||typeof n>"u")return o.plainObjects?{__proto__:null}:{};for(var a=typeof n=="string"?Gbe(n,o):n,e=o.plainObjects?{__proto__:null}:{},i=Object.keys(a),A=0;A{"use strict";var Kbe=j8(),xbe=z8(),Ybe=lm();V8.exports={formats:Ybe,parse:xbe,stringify:Kbe}});var X8=ee((jlA,Z8)=>{function jbe(n){return n}Z8.exports=jbe});var vz=ee((aC,vd)=>{var Jbe=200,qbe="Expected a function",AR="__lodash_hash_undefined__",mm=1,Pd=2,sz=1/0,gz=9007199254740991,um="[object Arguments]",JN="[object Array]",cz="[object Boolean]",Iz="[object Date]",lz="[object Error]",pz="[object Function]",zbe="[object GeneratorFunction]",Cm="[object Map]",dz="[object Number]",kd="[object Object]",$8="[object Promise]",hz="[object RegExp]",Bm="[object Set]",Ez="[object String]",uz="[object Symbol]",qN="[object WeakMap]",Cz="[object ArrayBuffer]",fm="[object DataView]",Vbe="[object Float32Array]",Wbe="[object Float64Array]",Zbe="[object Int8Array]",Xbe="[object Int16Array]",$be="[object Int32Array]",eMe="[object Uint8Array]",AMe="[object Uint8ClampedArray]",tMe="[object Uint16Array]",rMe="[object Uint32Array]",iMe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,aMe=/^\w*$/,oMe=/^\./,nMe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,sMe=/[\\^$.*+?()[\]{}|]/g,gMe=/\\(\\)?/g,cMe=/^\[object .+?Constructor\]$/,IMe=/^(?:0|[1-9]\d*)$/,Jt={};Jt[Vbe]=Jt[Wbe]=Jt[Zbe]=Jt[Xbe]=Jt[$be]=Jt[eMe]=Jt[AMe]=Jt[tMe]=Jt[rMe]=!0;Jt[um]=Jt[JN]=Jt[Cz]=Jt[cz]=Jt[fm]=Jt[Iz]=Jt[lz]=Jt[pz]=Jt[Cm]=Jt[dz]=Jt[kd]=Jt[hz]=Jt[Bm]=Jt[Ez]=Jt[qN]=!1;var Bz=typeof global=="object"&&global&&global.Object===Object&&global,lMe=typeof self=="object"&&self&&self.Object===Object&&self,Rc=Bz||lMe||Function("return this")(),fz=typeof aC=="object"&&aC&&!aC.nodeType&&aC,ez=fz&&typeof vd=="object"&&vd&&!vd.nodeType&&vd,pMe=ez&&ez.exports===fz,Az=pMe&&Bz.process,tz=(function(){try{return Az&&Az.binding("util")}catch{}})(),rz=tz&&tz.isTypedArray;function Qz(n,t){for(var o=-1,a=t.length,e=n.length;++o-1}function KMe(n,t){var o=this.__data__,a=wm(o,n);return a<0?o.push([n,t]):o[a][1]=t,this}Og.prototype.clear=FMe;Og.prototype.delete=LMe;Og.prototype.get=UMe;Og.prototype.has=HMe;Og.prototype.set=KMe;function bg(n){var t=-1,o=n?n.length:0;for(this.clear();++tr))return!1;var g=i.get(n);if(g&&i.get(t))return g==t;var c=-1,I=!0,p=e&mm?new ym:void 0;for(i.set(n,t),i.set(t,n);++c-1&&n%1==0&&n-1&&n%1==0&&n<=gz}function sC(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Mm(n){return!!n&&typeof n=="object"}function nR(n){return typeof n=="symbol"||Mm(n)&&Gd.call(n)==uz}var b_e=rz?uMe(rz):n_e;function M_e(n){return n==null?"":h_e(n)}function __e(n,t,o){var a=n==null?void 0:Sz(n,t);return a===void 0?o:a}function T_e(n,t){return n!=null&&y_e(n,t,r_e)}function eR(n){return aR(n)?mz(n):g_e(n)}function N_e(n){return aR(n)?mz(n,!0):c_e(n)}function R_e(n,t){return n==null?{}:p_e(n,C_e(n),s_e(t))}function k_e(n){return n}function v_e(n){return Om(n)?hMe(bm(n)):d_e(n)}function kz(){return[]}vd.exports=R_e});var cV=ee((gC,Ld)=>{var P_e=200,jz="__lodash_hash_undefined__",G_e=800,F_e=16,Jz=9007199254740991,qz="[object Arguments]",L_e="[object Array]",U_e="[object AsyncFunction]",H_e="[object Boolean]",K_e="[object Date]",x_e="[object Error]",zz="[object Function]",Y_e="[object GeneratorFunction]",j_e="[object Map]",J_e="[object Number]",q_e="[object Null]",Vz="[object Object]",z_e="[object Proxy]",V_e="[object RegExp]",W_e="[object Set]",Z_e="[object String]",X_e="[object Undefined]",$_e="[object WeakMap]",eTe="[object ArrayBuffer]",ATe="[object DataView]",tTe="[object Float32Array]",rTe="[object Float64Array]",iTe="[object Int8Array]",aTe="[object Int16Array]",oTe="[object Int32Array]",nTe="[object Uint8Array]",sTe="[object Uint8ClampedArray]",gTe="[object Uint16Array]",cTe="[object Uint32Array]",ITe=/[\\^$.*+?()[\]{}|]/g,lTe=/^\[object .+?Constructor\]$/,pTe=/^(?:0|[1-9]\d*)$/,qt={};qt[tTe]=qt[rTe]=qt[iTe]=qt[aTe]=qt[oTe]=qt[nTe]=qt[sTe]=qt[gTe]=qt[cTe]=!0;qt[qz]=qt[L_e]=qt[eTe]=qt[H_e]=qt[ATe]=qt[K_e]=qt[x_e]=qt[zz]=qt[j_e]=qt[J_e]=qt[Vz]=qt[V_e]=qt[W_e]=qt[Z_e]=qt[$_e]=!1;var Wz=typeof global=="object"&&global&&global.Object===Object&&global,dTe=typeof self=="object"&&self&&self.Object===Object&&self,lC=Wz||dTe||Function("return this")(),Zz=typeof gC=="object"&&gC&&!gC.nodeType&&gC,cC=Zz&&typeof Ld=="object"&&Ld&&!Ld.nodeType&&Ld,Xz=cC&&cC.exports===Zz,sR=Xz&&Wz.process,Pz=(function(){try{var n=cC&&cC.require&&cC.require("util").types;return n||sR&&sR.binding&&sR.binding("util")}catch{}})(),Gz=Pz&&Pz.isTypedArray;function hTe(n,t,o){switch(o.length){case 0:return n.call(t);case 1:return n.call(t,o[0]);case 2:return n.call(t,o[0],o[1]);case 3:return n.call(t,o[0],o[1],o[2])}return n.apply(t,o)}function ETe(n,t){for(var o=-1,a=Array(n);++o-1}function FTe(n,t){var o=this.__data__,a=km(o,n);return a<0?(++this.size,o.push([n,t])):o[a][1]=t,this}_g.prototype.clear=kTe;_g.prototype.delete=vTe;_g.prototype.get=PTe;_g.prototype.has=GTe;_g.prototype.set=FTe;function Ud(n){var t=-1,o=n==null?0:n.length;for(this.clear();++t1?o[e-1]:void 0,A=e>2?o[2]:void 0;for(i=n.length>3&&typeof i=="function"?(e--,i):void 0,A&&p0e(o[0],o[1],A)&&(i=e<3?void 0:i,e=1),t=Object(t);++a-1&&n%1==0&&n0){if(++t>=G_e)return arguments[0]}else t=0;return n.apply(void 0,arguments)}}function Q0e(n){if(n!=null){try{return Rm.call(n)}catch{}try{return n+""}catch{}}return""}function Gm(n,t){return n===t||n!==n&&t!==t}var lR=Yz((function(){return arguments})())?Yz:function(n){return pC(n)&&Mg.call(n,"callee")&&!STe.call(n,"callee")},pR=Array.isArray;function ER(n){return n!=null&&oV(n.length)&&!uR(n)}function y0e(n){return pC(n)&&ER(n)}var aV=DTe||O0e;function uR(n){if(!Cl(n))return!1;var t=vm(n);return t==zz||t==Y_e||t==U_e||t==z_e}function oV(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Jz}function Cl(n){var t=typeof n;return n!=null&&(t=="object"||t=="function")}function pC(n){return n!=null&&typeof n=="object"}function m0e(n){if(!pC(n)||vm(n)!=Vz)return!1;var t=eV(n);if(t===null)return!0;var o=Mg.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&Rm.call(o)==yTe}var nV=Gz?uTe(Gz):$Te;function S0e(n){return s0e(n,sV(n))}function sV(n){return ER(n)?VTe(n,!0):e0e(n)}var w0e=g0e(function(n,t,o){tV(n,t,o)});function D0e(n){return function(){return n}}function gV(n){return n}function O0e(){return!1}Ld.exports=w0e});var Tg=ee((JlA,pV)=>{"use strict";var IV=["nodebuffer","arraybuffer","fragments"],lV=typeof Blob<"u";lV&&IV.push("blob");pV.exports={BINARY_TYPES:IV,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:lV,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var dC=ee((qlA,Fm)=>{"use strict";var{EMPTY_BUFFER:b0e}=Tg(),CR=Buffer[Symbol.species];function M0e(n,t){if(n.length===0)return b0e;if(n.length===1)return n[0];let o=Buffer.allocUnsafe(t),a=0;for(let e=0;e{"use strict";var EV=Symbol("kDone"),fR=Symbol("kRun"),QR=class{constructor(t){this[EV]=()=>{this.pending--,this[fR]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[fR]()}[fR](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[EV])}}};uV.exports=QR});var Yd=ee((VlA,yV)=>{"use strict";var hC=$e("zlib"),BV=dC(),T0e=CV(),{kStatusCode:fV}=Tg(),N0e=Buffer[Symbol.species],R0e=Buffer.from([0,0,255,255]),Um=Symbol("permessage-deflate"),Ng=Symbol("total-length"),Kd=Symbol("callback"),kc=Symbol("buffers"),xd=Symbol("error"),Lm,yR=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Lm){let o=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Lm=new T0e(o)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Kd];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let o=this._options,a=t.find(e=>!(o.serverNoContextTakeover===!1&&e.server_no_context_takeover||e.server_max_window_bits&&(o.serverMaxWindowBits===!1||typeof o.serverMaxWindowBits=="number"&&o.serverMaxWindowBits>e.server_max_window_bits)||typeof o.clientMaxWindowBits=="number"&&(typeof e.client_max_window_bits=="number"?o.clientMaxWindowBits>e.client_max_window_bits:!e.client_max_window_bits)));if(!a)throw new Error("None of the extension offers can be accepted");return o.serverNoContextTakeover&&(a.server_no_context_takeover=!0),o.clientNoContextTakeover&&(a.client_no_context_takeover=!0),typeof o.serverMaxWindowBits=="number"&&(a.server_max_window_bits=o.serverMaxWindowBits),typeof o.clientMaxWindowBits=="number"?a.client_max_window_bits=o.clientMaxWindowBits:(a.client_max_window_bits===!0||o.clientMaxWindowBits===!1)&&delete a.client_max_window_bits,a}acceptAsClient(t){let o=t[0];if(this._options.clientNoContextTakeover===!1&&o.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!o.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(o.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&o.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return o}normalizeParams(t){return t.forEach(o=>{Object.keys(o).forEach(a=>{let e=o[a];if(e.length>1)throw new Error(`Parameter "${a}" must have only a single value`);if(e=e[0],a==="client_max_window_bits"){if(e!==!0){let i=+e;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${a}": ${e}`);e=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${a}": ${e}`)}else if(a==="server_max_window_bits"){let i=+e;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${a}": ${e}`);e=i}else if(a==="client_no_context_takeover"||a==="server_no_context_takeover"){if(e!==!0)throw new TypeError(`Invalid value for parameter "${a}": ${e}`)}else throw new Error(`Unknown parameter "${a}"`);o[a]=e})}),t}decompress(t,o,a){Lm.add(e=>{this._decompress(t,o,(i,A)=>{e(),a(i,A)})})}compress(t,o,a){Lm.add(e=>{this._compress(t,o,(i,A)=>{e(),a(i,A)})})}_decompress(t,o,a){let e=this._isServer?"client":"server";if(!this._inflate){let i=`${e}_max_window_bits`,A=typeof this.params[i]!="number"?hC.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=hC.createInflateRaw({...this._options.zlibInflateOptions,windowBits:A}),this._inflate[Um]=this,this._inflate[Ng]=0,this._inflate[kc]=[],this._inflate.on("error",v0e),this._inflate.on("data",QV)}this._inflate[Kd]=a,this._inflate.write(t),o&&this._inflate.write(R0e),this._inflate.flush(()=>{let i=this._inflate[xd];if(i){this._inflate.close(),this._inflate=null,a(i);return}let A=BV.concat(this._inflate[kc],this._inflate[Ng]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Ng]=0,this._inflate[kc]=[],o&&this.params[`${e}_no_context_takeover`]&&this._inflate.reset()),a(null,A)})}_compress(t,o,a){let e=this._isServer?"server":"client";if(!this._deflate){let i=`${e}_max_window_bits`,A=typeof this.params[i]!="number"?hC.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=hC.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:A}),this._deflate[Ng]=0,this._deflate[kc]=[],this._deflate.on("data",k0e)}this._deflate[Kd]=a,this._deflate.write(t),this._deflate.flush(hC.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=BV.concat(this._deflate[kc],this._deflate[Ng]);o&&(i=new N0e(i.buffer,i.byteOffset,i.length-4)),this._deflate[Kd]=null,this._deflate[Ng]=0,this._deflate[kc]=[],o&&this.params[`${e}_no_context_takeover`]&&this._deflate.reset(),a(null,i)})}};yV.exports=yR;function k0e(n){this[kc].push(n),this[Ng]+=n.length}function QV(n){if(this[Ng]+=n.length,this[Um]._maxPayload<1||this[Ng]<=this[Um]._maxPayload){this[kc].push(n);return}this[xd]=new RangeError("Max payload size exceeded"),this[xd].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[xd][fV]=1009,this.removeListener("data",QV),this.reset()}function v0e(n){if(this[Um]._inflate=null,this[xd]){this[Kd](this[xd]);return}n[fV]=1007,this[Kd](n)}});var jd=ee((WlA,Hm)=>{"use strict";var{isUtf8:mV}=$e("buffer"),{hasBlob:P0e}=Tg(),G0e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function F0e(n){return n>=1e3&&n<=1014&&n!==1004&&n!==1005&&n!==1006||n>=3e3&&n<=4999}function mR(n){let t=n.length,o=0;for(;o=t||(n[o+1]&192)!==128||(n[o+2]&192)!==128||n[o]===224&&(n[o+1]&224)===128||n[o]===237&&(n[o+1]&224)===160)return!1;o+=3}else if((n[o]&248)===240){if(o+3>=t||(n[o+1]&192)!==128||(n[o+2]&192)!==128||(n[o+3]&192)!==128||n[o]===240&&(n[o+1]&240)===128||n[o]===244&&n[o+1]>143||n[o]>244)return!1;o+=4}else return!1;return!0}function L0e(n){return P0e&&typeof n=="object"&&typeof n.arrayBuffer=="function"&&typeof n.type=="string"&&typeof n.stream=="function"&&(n[Symbol.toStringTag]==="Blob"||n[Symbol.toStringTag]==="File")}Hm.exports={isBlob:L0e,isValidStatusCode:F0e,isValidUTF8:mR,tokenChars:G0e};if(mV)Hm.exports.isValidUTF8=function(n){return n.length<24?mR(n):mV(n)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let n=$e("utf-8-validate");Hm.exports.isValidUTF8=function(t){return t.length<32?mR(t):n(t)}}catch{}});var bR=ee((ZlA,_V)=>{"use strict";var{Writable:U0e}=$e("stream"),SV=Yd(),{BINARY_TYPES:H0e,EMPTY_BUFFER:wV,kStatusCode:K0e,kWebSocket:x0e}=Tg(),{concat:SR,toArrayBuffer:Y0e,unmask:j0e}=dC(),{isValidStatusCode:J0e,isValidUTF8:DV}=jd(),Km=Buffer[Symbol.species],Yo=0,OV=1,bV=2,MV=3,wR=4,DR=5,xm=6,OR=class extends U0e{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||H0e[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[x0e]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Yo}_write(t,o,a){if(this._opcode===8&&this._state==Yo)return a();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){a(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(a)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t=a.length?o.set(this._buffers.shift(),e):(o.set(new Uint8Array(a.buffer,a.byteOffset,t),e),this._buffers[0]=new Km(a.buffer,a.byteOffset+t,a.length-t)),t-=a.length}while(t>0);return o}startLoop(t){this._loop=!0;do switch(this._state){case Yo:this.getInfo(t);break;case OV:this.getPayloadLength16(t);break;case bV:this.getPayloadLength64(t);break;case MV:this.getMask();break;case wR:this.getData(t);break;case DR:case xm:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let o=this.consume(2);if((o[0]&48)!==0){let e=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(e);return}let a=(o[0]&64)===64;if(a&&!this._extensions[SV.extensionName]){let e=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(e);return}if(this._fin=(o[0]&128)===128,this._opcode=o[0]&15,this._payloadLength=o[1]&127,this._opcode===0){if(a){let e=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(e);return}if(!this._fragmented){let e=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(e);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let e=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(e);return}this._compressed=a}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let e=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(e);return}if(a){let e=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(e);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let e=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(e);return}}else{let e=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(e);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(o[1]&128)===128,this._isServer){if(!this._masked){let e=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(e);return}}else if(this._masked){let e=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(e);return}this._payloadLength===126?this._state=OV:this._payloadLength===127?this._state=bV:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let o=this.consume(8),a=o.readUInt32BE(0);if(a>Math.pow(2,21)-1){let e=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(e);return}this._payloadLength=a*Math.pow(2,32)+o.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._masked?this._state=MV:this._state=wR}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=wR}getData(t){let o=wV;if(this._payloadLength){if(this._bufferedBytes7){this.controlMessage(o,t);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let a=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(a);return}if(this._compressed){this._state=DR,this.decompress(o,t);return}o.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(o)),this.dataMessage(t)}decompress(t,o){this._extensions[SV.extensionName].decompress(t,this._fin,(e,i)=>{if(e)return o(e);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let A=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");o(A);return}this._fragments.push(i)}this.dataMessage(o),this._state===Yo&&this.startLoop(o)})}dataMessage(t){if(!this._fin){this._state=Yo;return}let o=this._messageLength,a=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let e;this._binaryType==="nodebuffer"?e=SR(a,o):this._binaryType==="arraybuffer"?e=Y0e(SR(a,o)):this._binaryType==="blob"?e=new Blob(a):e=a,this._allowSynchronousEvents?(this.emit("message",e,!0),this._state=Yo):(this._state=xm,setImmediate(()=>{this.emit("message",e,!0),this._state=Yo,this.startLoop(t)}))}else{let e=SR(a,o);if(!this._skipUTF8Validation&&!DV(e)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(i);return}this._state===DR||this._allowSynchronousEvents?(this.emit("message",e,!1),this._state=Yo):(this._state=xm,setImmediate(()=>{this.emit("message",e,!1),this._state=Yo,this.startLoop(t)}))}}controlMessage(t,o){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,wV),this.end();else{let a=t.readUInt16BE(0);if(!J0e(a)){let i=this.createError(RangeError,`invalid status code ${a}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");o(i);return}let e=new Km(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!DV(e)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");o(i);return}this._loop=!1,this.emit("conclude",a,e),this.end()}this._state=Yo;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Yo):(this._state=xm,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Yo,this.startLoop(o)}))}createError(t,o,a,e,i){this._loop=!1,this._errored=!0;let A=new t(a?`Invalid WebSocket frame: ${o}`:o);return Error.captureStackTrace(A,this.createError),A.code=i,A[K0e]=e,A}};_V.exports=OR});var TR=ee(($lA,RV)=>{"use strict";var{Duplex:XlA}=$e("stream"),{randomFillSync:q0e}=$e("crypto"),{types:{isUint8Array:z0e}}=$e("util"),TV=Yd(),{EMPTY_BUFFER:V0e,kWebSocket:W0e,NOOP:Z0e}=Tg(),{isBlob:Jd,isValidStatusCode:X0e}=jd(),{mask:NV,toBuffer:Bl}=dC(),jo=Symbol("kByteLength"),$0e=Buffer.alloc(4),Ym=8*1024,fl,qd=Ym,Nn=0,eNe=1,ANe=2,MR=class n{constructor(t,o,a){this._extensions=o||{},a&&(this._generateMask=a,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Nn,this.onerror=Z0e,this[W0e]=void 0}static frame(t,o){let a,e=!1,i=2,A=!1;o.mask&&(a=o.maskBuffer||$0e,o.generateMask?o.generateMask(a):(qd===Ym&&(fl===void 0&&(fl=Buffer.alloc(Ym)),q0e(fl,0,Ym),qd=0),a[0]=fl[qd++],a[1]=fl[qd++],a[2]=fl[qd++],a[3]=fl[qd++]),A=(a[0]|a[1]|a[2]|a[3])===0,i=6);let r;typeof t=="string"?(!o.mask||A)&&o[jo]!==void 0?r=o[jo]:(t=Buffer.from(t),r=t.length):(r=t.length,e=o.mask&&o.readOnly&&!A);let s=r;r>=65536?(i+=8,s=127):r>125&&(i+=2,s=126);let g=Buffer.allocUnsafe(e?r+i:i);return g[0]=o.fin?o.opcode|128:o.opcode,o.rsv1&&(g[0]|=64),g[1]=s,s===126?g.writeUInt16BE(r,2):s===127&&(g[2]=g[3]=0,g.writeUIntBE(r,4,6)),o.mask?(g[1]|=128,g[i-4]=a[0],g[i-3]=a[1],g[i-2]=a[2],g[i-1]=a[3],A?[g,t]:e?(NV(t,a,g,i,r),[g]):(NV(t,a,t,0,r),[g,t])):[g,t]}close(t,o,a,e){let i;if(t===void 0)i=V0e;else{if(typeof t!="number"||!X0e(t))throw new TypeError("First argument must be a valid error code number");if(o===void 0||!o.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(t,0);else{let r=Buffer.byteLength(o);if(r>123)throw new RangeError("The message must not be greater than 123 bytes");if(i=Buffer.allocUnsafe(2+r),i.writeUInt16BE(t,0),typeof o=="string")i.write(o,2);else if(z0e(o))i.set(o,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let A={[jo]:i.length,fin:!0,generateMask:this._generateMask,mask:a,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Nn?this.enqueue([this.dispatch,i,!1,A,e]):this.sendFrame(n.frame(i,A),e)}ping(t,o,a){let e,i;if(typeof t=="string"?(e=Buffer.byteLength(t),i=!1):Jd(t)?(e=t.size,i=!1):(t=Bl(t),e=t.length,i=Bl.readOnly),e>125)throw new RangeError("The data size must not be greater than 125 bytes");let A={[jo]:e,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};Jd(t)?this._state!==Nn?this.enqueue([this.getBlobData,t,!1,A,a]):this.getBlobData(t,!1,A,a):this._state!==Nn?this.enqueue([this.dispatch,t,!1,A,a]):this.sendFrame(n.frame(t,A),a)}pong(t,o,a){let e,i;if(typeof t=="string"?(e=Buffer.byteLength(t),i=!1):Jd(t)?(e=t.size,i=!1):(t=Bl(t),e=t.length,i=Bl.readOnly),e>125)throw new RangeError("The data size must not be greater than 125 bytes");let A={[jo]:e,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};Jd(t)?this._state!==Nn?this.enqueue([this.getBlobData,t,!1,A,a]):this.getBlobData(t,!1,A,a):this._state!==Nn?this.enqueue([this.dispatch,t,!1,A,a]):this.sendFrame(n.frame(t,A),a)}send(t,o,a){let e=this._extensions[TV.extensionName],i=o.binary?2:1,A=o.compress,r,s;typeof t=="string"?(r=Buffer.byteLength(t),s=!1):Jd(t)?(r=t.size,s=!1):(t=Bl(t),r=t.length,s=Bl.readOnly),this._firstFragment?(this._firstFragment=!1,A&&e&&e.params[e._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(A=r>=e._threshold),this._compress=A):(A=!1,i=0),o.fin&&(this._firstFragment=!0);let g={[jo]:r,fin:o.fin,generateMask:this._generateMask,mask:o.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:s,rsv1:A};Jd(t)?this._state!==Nn?this.enqueue([this.getBlobData,t,this._compress,g,a]):this.getBlobData(t,this._compress,g,a):this._state!==Nn?this.enqueue([this.dispatch,t,this._compress,g,a]):this.dispatch(t,this._compress,g,a)}getBlobData(t,o,a,e){this._bufferedBytes+=a[jo],this._state=ANe,t.arrayBuffer().then(i=>{if(this._socket.destroyed){let r=new Error("The socket was closed while the blob was being read");process.nextTick(_R,this,r,e);return}this._bufferedBytes-=a[jo];let A=Bl(i);o?this.dispatch(A,o,a,e):(this._state=Nn,this.sendFrame(n.frame(A,a),e),this.dequeue())}).catch(i=>{process.nextTick(tNe,this,i,e)})}dispatch(t,o,a,e){if(!o){this.sendFrame(n.frame(t,a),e);return}let i=this._extensions[TV.extensionName];this._bufferedBytes+=a[jo],this._state=eNe,i.compress(t,a.fin,(A,r)=>{if(this._socket.destroyed){let s=new Error("The socket was closed while data was being compressed");_R(this,s,e);return}this._bufferedBytes-=a[jo],this._state=Nn,a.readOnly=!1,this.sendFrame(n.frame(r,a),e),this.dequeue()})}dequeue(){for(;this._state===Nn&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][jo],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][jo],this._queue.push(t)}sendFrame(t,o){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],o),this._socket.uncork()):this._socket.write(t[0],o)}};RV.exports=MR;function _R(n,t,o){typeof o=="function"&&o(t);for(let a=0;a{"use strict";var{kForOnEventAttribute:EC,kListener:NR}=Tg(),kV=Symbol("kCode"),vV=Symbol("kData"),PV=Symbol("kError"),GV=Symbol("kMessage"),FV=Symbol("kReason"),zd=Symbol("kTarget"),LV=Symbol("kType"),UV=Symbol("kWasClean"),Rg=class{constructor(t){this[zd]=null,this[LV]=t}get target(){return this[zd]}get type(){return this[LV]}};Object.defineProperty(Rg.prototype,"target",{enumerable:!0});Object.defineProperty(Rg.prototype,"type",{enumerable:!0});var Ql=class extends Rg{constructor(t,o={}){super(t),this[kV]=o.code===void 0?0:o.code,this[FV]=o.reason===void 0?"":o.reason,this[UV]=o.wasClean===void 0?!1:o.wasClean}get code(){return this[kV]}get reason(){return this[FV]}get wasClean(){return this[UV]}};Object.defineProperty(Ql.prototype,"code",{enumerable:!0});Object.defineProperty(Ql.prototype,"reason",{enumerable:!0});Object.defineProperty(Ql.prototype,"wasClean",{enumerable:!0});var Vd=class extends Rg{constructor(t,o={}){super(t),this[PV]=o.error===void 0?null:o.error,this[GV]=o.message===void 0?"":o.message}get error(){return this[PV]}get message(){return this[GV]}};Object.defineProperty(Vd.prototype,"error",{enumerable:!0});Object.defineProperty(Vd.prototype,"message",{enumerable:!0});var uC=class extends Rg{constructor(t,o={}){super(t),this[vV]=o.data===void 0?null:o.data}get data(){return this[vV]}};Object.defineProperty(uC.prototype,"data",{enumerable:!0});var rNe={addEventListener(n,t,o={}){for(let e of this.listeners(n))if(!o[EC]&&e[NR]===t&&!e[EC])return;let a;if(n==="message")a=function(i,A){let r=new uC("message",{data:A?i:i.toString()});r[zd]=this,jm(t,this,r)};else if(n==="close")a=function(i,A){let r=new Ql("close",{code:i,reason:A.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[zd]=this,jm(t,this,r)};else if(n==="error")a=function(i){let A=new Vd("error",{error:i,message:i.message});A[zd]=this,jm(t,this,A)};else if(n==="open")a=function(){let i=new Rg("open");i[zd]=this,jm(t,this,i)};else return;a[EC]=!!o[EC],a[NR]=t,o.once?this.once(n,a):this.on(n,a)},removeEventListener(n,t){for(let o of this.listeners(n))if(o[NR]===t&&!o[EC]){this.removeListener(n,o);break}}};HV.exports={CloseEvent:Ql,ErrorEvent:Vd,Event:Rg,EventTarget:rNe,MessageEvent:uC};function jm(n,t,o){typeof n=="object"&&n.handleEvent?n.handleEvent.call(n,o):n.call(t,o)}});var Jm=ee((ApA,xV)=>{"use strict";var{tokenChars:CC}=jd();function ws(n,t,o){n[t]===void 0?n[t]=[o]:n[t].push(o)}function iNe(n){let t=Object.create(null),o=Object.create(null),a=!1,e=!1,i=!1,A,r,s=-1,g=-1,c=-1,I=0;for(;I{let o=n[t];return Array.isArray(o)||(o=[o]),o.map(a=>[t].concat(Object.keys(a).map(e=>{let i=a[e];return Array.isArray(i)||(i=[i]),i.map(A=>A===!0?e:`${e}=${A}`).join("; ")})).join("; ")).join(", ")}).join(", ")}xV.exports={format:aNe,parse:iNe}});var Wm=ee((ipA,AW)=>{"use strict";var oNe=$e("events"),nNe=$e("https"),sNe=$e("http"),JV=$e("net"),gNe=$e("tls"),{randomBytes:cNe,createHash:INe}=$e("crypto"),{Duplex:tpA,Readable:rpA}=$e("stream"),{URL:RR}=$e("url"),vc=Yd(),lNe=bR(),pNe=TR(),{isBlob:dNe}=jd(),{BINARY_TYPES:YV,CLOSE_TIMEOUT:hNe,EMPTY_BUFFER:qm,GUID:ENe,kForOnEventAttribute:kR,kListener:uNe,kStatusCode:CNe,kWebSocket:li,NOOP:qV}=Tg(),{EventTarget:{addEventListener:BNe,removeEventListener:fNe}}=KV(),{format:QNe,parse:yNe}=Jm(),{toBuffer:mNe}=dC(),zV=Symbol("kAborted"),vR=[8,13],kg=["CONNECTING","OPEN","CLOSING","CLOSED"],SNe=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,rr=class n extends oNe{constructor(t,o,a){super(),this._binaryType=YV[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=qm,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=n.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,o===void 0?o=[]:Array.isArray(o)||(typeof o=="object"&&o!==null?(a=o,o=[]):o=[o]),VV(this,t,o,a)):(this._autoPong=a.autoPong,this._closeTimeout=a.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){YV.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,o,a){let e=new lNe({allowSynchronousEvents:a.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:a.maxBufferedChunks,maxFragments:a.maxFragments,maxPayload:a.maxPayload,skipUTF8Validation:a.skipUTF8Validation}),i=new pNe(t,this._extensions,a.generateMask);this._receiver=e,this._sender=i,this._socket=t,e[li]=this,i[li]=this,t[li]=this,e.on("conclude",ONe),e.on("drain",bNe),e.on("error",MNe),e.on("message",_Ne),e.on("ping",TNe),e.on("pong",NNe),i.onerror=RNe,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),o.length>0&&t.unshift(o),t.on("close",XV),t.on("data",Vm),t.on("end",$V),t.on("error",eW),this._readyState=n.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[vc.extensionName]&&this._extensions[vc.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=n.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,o){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){lo(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===n.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=n.CLOSING,this._sender.close(t,o,!this._isServer,a=>{a||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),ZV(this)}}pause(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,o,a){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(a=t,t=o=void 0):typeof o=="function"&&(a=o,o=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){PR(this,t,a);return}o===void 0&&(o=!this._isServer),this._sender.ping(t||qm,o,a)}pong(t,o,a){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(a=t,t=o=void 0):typeof o=="function"&&(a=o,o=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){PR(this,t,a);return}o===void 0&&(o=!this._isServer),this._sender.pong(t||qm,o,a)}resume(){this.readyState===n.CONNECTING||this.readyState===n.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,o,a){if(this.readyState===n.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof o=="function"&&(a=o,o={}),typeof t=="number"&&(t=t.toString()),this.readyState!==n.OPEN){PR(this,t,a);return}let e={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...o};this._extensions[vc.extensionName]||(e.compress=!1),this._sender.send(t||qm,e,a)}terminate(){if(this.readyState!==n.CLOSED){if(this.readyState===n.CONNECTING){lo(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=n.CLOSING,this._socket.destroy())}}};Object.defineProperty(rr,"CONNECTING",{enumerable:!0,value:kg.indexOf("CONNECTING")});Object.defineProperty(rr.prototype,"CONNECTING",{enumerable:!0,value:kg.indexOf("CONNECTING")});Object.defineProperty(rr,"OPEN",{enumerable:!0,value:kg.indexOf("OPEN")});Object.defineProperty(rr.prototype,"OPEN",{enumerable:!0,value:kg.indexOf("OPEN")});Object.defineProperty(rr,"CLOSING",{enumerable:!0,value:kg.indexOf("CLOSING")});Object.defineProperty(rr.prototype,"CLOSING",{enumerable:!0,value:kg.indexOf("CLOSING")});Object.defineProperty(rr,"CLOSED",{enumerable:!0,value:kg.indexOf("CLOSED")});Object.defineProperty(rr.prototype,"CLOSED",{enumerable:!0,value:kg.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(n=>{Object.defineProperty(rr.prototype,n,{enumerable:!0})});["open","error","close","message"].forEach(n=>{Object.defineProperty(rr.prototype,`on${n}`,{enumerable:!0,get(){for(let t of this.listeners(n))if(t[kR])return t[uNe];return null},set(t){for(let o of this.listeners(n))if(o[kR]){this.removeListener(n,o);break}typeof t=="function"&&this.addEventListener(n,t,{[kR]:!0})}})});rr.prototype.addEventListener=BNe;rr.prototype.removeEventListener=fNe;AW.exports=rr;function VV(n,t,o,a){let e={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:hNe,protocolVersion:vR[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...a,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(n._autoPong=e.autoPong,n._closeTimeout=e.closeTimeout,!vR.includes(e.protocolVersion))throw new RangeError(`Unsupported protocol version: ${e.protocolVersion} (supported versions: ${vR.join(", ")})`);let i;if(t instanceof RR)i=t;else try{i=new RR(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),n._url=i.href;let A=i.protocol==="wss:",r=i.protocol==="ws+unix:",s;if(i.protocol!=="ws:"&&!A&&!r?s=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:r&&!i.pathname?s="The URL's pathname is empty":i.hash&&(s="The URL contains a fragment identifier"),s){let Q=new SyntaxError(s);if(n._redirects===0)throw Q;zm(n,Q);return}let g=A?443:80,c=cNe(16).toString("base64"),I=A?nNe.request:sNe.request,p=new Set,B;if(e.createConnection=e.createConnection||(A?DNe:wNe),e.defaultPort=e.defaultPort||g,e.port=i.port||g,e.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,e.headers={...e.headers,"Sec-WebSocket-Version":e.protocolVersion,"Sec-WebSocket-Key":c,Connection:"Upgrade",Upgrade:"websocket"},e.path=i.pathname+i.search,e.timeout=e.handshakeTimeout,e.perMessageDeflate&&(B=new vc({...e.perMessageDeflate,isServer:!1,maxPayload:e.maxPayload}),e.headers["Sec-WebSocket-Extensions"]=QNe({[vc.extensionName]:B.offer()})),o.length){for(let Q of o){if(typeof Q!="string"||!SNe.test(Q)||p.has(Q))throw new SyntaxError("An invalid or duplicated subprotocol was specified");p.add(Q)}e.headers["Sec-WebSocket-Protocol"]=o.join(",")}if(e.origin&&(e.protocolVersion<13?e.headers["Sec-WebSocket-Origin"]=e.origin:e.headers.Origin=e.origin),(i.username||i.password)&&(e.auth=`${i.username}:${i.password}`),r){let Q=e.path.split(":");e.socketPath=Q[0],e.path=Q[1]}let f;if(e.followRedirects){if(n._redirects===0){n._originalIpc=r,n._originalSecure=A,n._originalHostOrSocketPath=r?e.socketPath:i.host;let Q=a&&a.headers;if(a={...a,headers:{}},Q)for(let[y,m]of Object.entries(Q))a.headers[y.toLowerCase()]=m}else if(n.listenerCount("redirect")===0){let Q=r?n._originalIpc?e.socketPath===n._originalHostOrSocketPath:!1:n._originalIpc?!1:i.host===n._originalHostOrSocketPath;(!Q||n._originalSecure&&!A)&&(delete e.headers.authorization,delete e.headers.cookie,Q||delete e.headers.host,e.auth=void 0)}e.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(e.auth).toString("base64")),f=n._req=I(e),n._redirects&&n.emit("redirect",n.url,f)}else f=n._req=I(e);e.timeout&&f.on("timeout",()=>{lo(n,f,"Opening handshake has timed out")}),f.on("error",Q=>{f===null||f[zV]||(f=n._req=null,zm(n,Q))}),f.on("response",Q=>{let y=Q.headers.location,m=Q.statusCode;if(y&&e.followRedirects&&m>=300&&m<400){if(++n._redirects>e.maxRedirects){lo(n,f,"Maximum redirects exceeded");return}f.abort();let T;try{T=new RR(y,t)}catch{let R=new SyntaxError(`Invalid URL: ${y}`);zm(n,R);return}VV(n,T,o,a)}else n.emit("unexpected-response",f,Q)||lo(n,f,`Unexpected server response: ${Q.statusCode}`)}),f.on("upgrade",(Q,y,m)=>{if(n.emit("upgrade",Q),n.readyState!==rr.CONNECTING)return;f=n._req=null;let T=Q.headers.upgrade;if(T===void 0||T.toLowerCase()!=="websocket"){lo(n,y,"Invalid Upgrade header");return}let _=INe("sha1").update(c+ENe).digest("base64");if(Q.headers["sec-websocket-accept"]!==_){lo(n,y,"Invalid Sec-WebSocket-Accept header");return}let R=Q.headers["sec-websocket-protocol"],L;if(R!==void 0?p.size?p.has(R)||(L="Server sent an invalid subprotocol"):L="Server sent a subprotocol but none was requested":p.size&&(L="Server sent no subprotocol"),L){lo(n,y,L);return}R&&(n._protocol=R);let U=Q.headers["sec-websocket-extensions"];if(U!==void 0){if(!B){lo(n,y,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let F;try{F=yNe(U)}catch{lo(n,y,"Invalid Sec-WebSocket-Extensions header");return}let q=Object.keys(F);if(q.length!==1||q[0]!==vc.extensionName){lo(n,y,"Server indicated an extension that was not requested");return}try{B.accept(F[vc.extensionName])}catch{lo(n,y,"Invalid Sec-WebSocket-Extensions header");return}n._extensions[vc.extensionName]=B}n.setSocket(y,m,{allowSynchronousEvents:e.allowSynchronousEvents,generateMask:e.generateMask,maxBufferedChunks:e.maxBufferedChunks,maxFragments:e.maxFragments,maxPayload:e.maxPayload,skipUTF8Validation:e.skipUTF8Validation})}),e.finishRequest?e.finishRequest(f,n):f.end()}function zm(n,t){n._readyState=rr.CLOSING,n._errorEmitted=!0,n.emit("error",t),n.emitClose()}function wNe(n){return n.path=n.socketPath,JV.connect(n)}function DNe(n){return n.path=void 0,!n.servername&&n.servername!==""&&(n.servername=JV.isIP(n.host)?"":n.host),gNe.connect(n)}function lo(n,t,o){n._readyState=rr.CLOSING;let a=new Error(o);Error.captureStackTrace(a,lo),t.setHeader?(t[zV]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(zm,n,a)):(t.destroy(a),t.once("error",n.emit.bind(n,"error")),t.once("close",n.emitClose.bind(n)))}function PR(n,t,o){if(t){let a=dNe(t)?t.size:mNe(t).length;n._socket?n._sender._bufferedBytes+=a:n._bufferedAmount+=a}if(o){let a=new Error(`WebSocket is not open: readyState ${n.readyState} (${kg[n.readyState]})`);process.nextTick(o,a)}}function ONe(n,t){let o=this[li];o._closeFrameReceived=!0,o._closeMessage=t,o._closeCode=n,o._socket[li]!==void 0&&(o._socket.removeListener("data",Vm),process.nextTick(WV,o._socket),n===1005?o.close():o.close(n,t))}function bNe(){let n=this[li];n.isPaused||n._socket.resume()}function MNe(n){let t=this[li];t._socket[li]!==void 0&&(t._socket.removeListener("data",Vm),process.nextTick(WV,t._socket),t.close(n[CNe])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",n))}function jV(){this[li].emitClose()}function _Ne(n,t){this[li].emit("message",n,t)}function TNe(n){let t=this[li];t._autoPong&&t.pong(n,!this._isServer,qV),t.emit("ping",n)}function NNe(n){this[li].emit("pong",n)}function WV(n){n.resume()}function RNe(n){let t=this[li];t.readyState!==rr.CLOSED&&(t.readyState===rr.OPEN&&(t._readyState=rr.CLOSING,ZV(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",n)))}function ZV(n){n._closeTimer=setTimeout(n._socket.destroy.bind(n._socket),n._closeTimeout)}function XV(){let n=this[li];if(this.removeListener("close",XV),this.removeListener("data",Vm),this.removeListener("end",$V),n._readyState=rr.CLOSING,!this._readableState.endEmitted&&!n._closeFrameReceived&&!n._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);n._receiver.write(t)}n._receiver.end(),this[li]=void 0,clearTimeout(n._closeTimer),n._receiver._writableState.finished||n._receiver._writableState.errorEmitted?n.emitClose():(n._receiver.on("error",jV),n._receiver.on("finish",jV))}function Vm(n){this[li]._receiver.write(n)||this.pause()}function $V(){let n=this[li];n._readyState=rr.CLOSING,n._receiver.end(),this.end()}function eW(){let n=this[li];this.removeListener("error",eW),this.on("error",qV),n&&(n._readyState=rr.CLOSING,this.destroy())}});var aW=ee((opA,iW)=>{"use strict";var apA=Wm(),{Duplex:kNe}=$e("stream");function tW(n){n.emit("close")}function vNe(){!this.destroyed&&this._writableState.finished&&this.destroy()}function rW(n){this.removeListener("error",rW),this.destroy(),this.listenerCount("error")===0&&this.emit("error",n)}function PNe(n,t){let o=!0,a=new kNe({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return n.on("message",function(i,A){let r=!A&&a._readableState.objectMode?i.toString():i;a.push(r)||n.pause()}),n.once("error",function(i){a.destroyed||(o=!1,a.destroy(i))}),n.once("close",function(){a.destroyed||a.push(null)}),a._destroy=function(e,i){if(n.readyState===n.CLOSED){i(e),process.nextTick(tW,a);return}let A=!1;n.once("error",function(s){A=!0,i(s)}),n.once("close",function(){A||i(e),process.nextTick(tW,a)}),o&&n.terminate()},a._final=function(e){if(n.readyState===n.CONNECTING){n.once("open",function(){a._final(e)});return}n._socket!==null&&(n._socket._writableState.finished?(e(),a._readableState.endEmitted&&a.destroy()):(n._socket.once("finish",function(){e()}),n.close()))},a._read=function(){n.isPaused&&n.resume()},a._write=function(e,i,A){if(n.readyState===n.CONNECTING){n.once("open",function(){a._write(e,i,A)});return}n.send(e,A)},a.on("end",vNe),a.on("error",rW),a}iW.exports=PNe});var GR=ee((npA,oW)=>{"use strict";var{tokenChars:GNe}=jd();function FNe(n){let t=new Set,o=-1,a=-1,e=0;for(e;e{"use strict";var LNe=$e("events"),Zm=$e("http"),{Duplex:spA}=$e("stream"),{createHash:UNe}=$e("crypto"),nW=Jm(),yl=Yd(),HNe=GR(),KNe=Wm(),{CLOSE_TIMEOUT:xNe,GUID:YNe,kWebSocket:jNe}=Tg(),JNe=/^[+/0-9A-Za-z]{22}==$/,sW=0,gW=1,IW=2,FR=class extends LNe{constructor(t,o){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:xNe,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:KNe,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Zm.createServer((a,e)=>{let i=Zm.STATUS_CODES[426];e.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),e.end(i)}),this._server.listen(t.port,t.host,t.backlog,o)):t.server&&(this._server=t.server),this._server){let a=this.emit.bind(this,"connection");this._removeListeners=qNe(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(e,i,A)=>{this.handleUpgrade(e,i,A,a)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=sW}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===IW){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(BC,this);return}if(t&&this.once("close",t),this._state!==gW)if(this._state=gW,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(BC,this):process.nextTick(BC,this);else{let o=this._server;this._removeListeners(),this._removeListeners=this._server=null,o.close(()=>{BC(this)})}}shouldHandle(t){if(this.options.path){let o=t.url.indexOf("?");if((o!==-1?t.url.slice(0,o):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,o,a,e){o.on("error",cW);let i=t.headers["sec-websocket-key"],A=t.headers.upgrade,r=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ml(this,t,o,405,"Invalid HTTP method");return}if(A===void 0||A.toLowerCase()!=="websocket"){ml(this,t,o,400,"Invalid Upgrade header");return}if(i===void 0||!JNe.test(i)){ml(this,t,o,400,"Missing or invalid Sec-WebSocket-Key header");return}if(r!==13&&r!==8){ml(this,t,o,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){fC(o,400);return}let s=t.headers["sec-websocket-protocol"],g=new Set;if(s!==void 0)try{g=HNe.parse(s)}catch{ml(this,t,o,400,"Invalid Sec-WebSocket-Protocol header");return}let c=t.headers["sec-websocket-extensions"],I={};if(this.options.perMessageDeflate&&c!==void 0){let p=new yl({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let B=nW.parse(c);B[yl.extensionName]&&(p.accept(B[yl.extensionName]),I[yl.extensionName]=p)}catch{ml(this,t,o,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let p={origin:t.headers[`${r===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(p,(B,f,Q,y)=>{if(!B)return fC(o,f||401,Q,y);this.completeUpgrade(I,i,g,t,o,a,e)});return}if(!this.options.verifyClient(p))return fC(o,401)}this.completeUpgrade(I,i,g,t,o,a,e)}completeUpgrade(t,o,a,e,i,A,r){if(!i.readable||!i.writable)return i.destroy();if(i[jNe])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>sW)return fC(i,503);let g=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${UNe("sha1").update(o+YNe).digest("base64")}`],c=new this.options.WebSocket(null,void 0,this.options);if(a.size){let I=this.options.handleProtocols?this.options.handleProtocols(a,e):a.values().next().value;I&&(g.push(`Sec-WebSocket-Protocol: ${I}`),c._protocol=I)}if(t[yl.extensionName]){let I=t[yl.extensionName].params,p=nW.format({[yl.extensionName]:[I]});g.push(`Sec-WebSocket-Extensions: ${p}`),c._extensions=t}this.emit("headers",g,e),i.write(g.concat(`\r `).join(`\r `)),i.removeListener("error",cW),c.setSocket(i,A,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(c),c.on("close",()=>{this.clients.delete(c),this._shouldEmitClose&&!this.clients.size&&process.nextTick(BC,this)})),r(c,e)}};lW.exports=FR;function qNe(n,t){for(let o of Object.keys(t))n.on(o,t[o]);return function(){for(let a of Object.keys(t))n.removeListener(a,t[a])}}function BC(n){n._state=IW,n.emit("close")}function cW(){this.destroy()}function fC(n,t,o,a){o=o||Zm.STATUS_CODES[t],a={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(o),...a},n.once("finish",n.destroy),n.end(`HTTP/1.1 ${t} ${Zm.STATUS_CODES[t]}\r `+Object.keys(a).map(e=>`${e}: ${a[e]}`).join(`\r `)+`\r \r -`+o)}function ml(n,t,o,a,e,i){if(n.listenerCount("wsClientError")){let A=new Error(e);Error.captureStackTrace(A,ml),n.emit("wsClientError",A,o,t)}else fC(o,a,e,i)}});var EW=ee((spA,hW)=>{"use strict";hW.exports=ARe;function ARe(n,t){for(var o=new Array(arguments.length-1),a=0,e=2,i=!0;e{"use strict";var Xm=BW;Xm.length=function(t){var o=t.length;if(!o)return 0;for(var a=0;--o%4>1&&t.charAt(o)==="=";)++a;return Math.ceil(t.length*3)/4-a};var Wd=new Array(64),CW=new Array(123);for(Rn=0;Rn<64;)CW[Wd[Rn]=Rn<26?Rn+65:Rn<52?Rn+71:Rn<62?Rn-4:Rn-59|43]=Rn++;var Rn;Xm.encode=function(t,o,a){for(var e=null,i=[],A=0,r=0,s;o>2],s=(g&3)<<4,r=1;break;case 1:i[A++]=Wd[s|g>>4],s=(g&15)<<2,r=2;break;case 2:i[A++]=Wd[s|g>>6],i[A++]=Wd[g&63],r=0;break}A>8191&&((e||(e=[])).push(String.fromCharCode.apply(String,i)),A=0)}return r&&(i[A++]=Wd[s],i[A++]=61,r===1&&(i[A++]=61)),e?(A&&e.push(String.fromCharCode.apply(String,i.slice(0,A))),e.join("")):String.fromCharCode.apply(String,i.slice(0,A))};var uW="invalid encoding";Xm.decode=function(t,o,a){for(var e=a,i=0,A,r=0;r1)break;if((s=CW[s])===void 0)throw Error(uW);switch(i){case 0:A=s,i=1;break;case 1:o[a++]=A<<2|(s&48)>>4,A=s,i=2;break;case 2:o[a++]=(A&15)<<4|(s&60)>>2,A=s,i=3;break;case 3:o[a++]=(A&3)<<6|s,i=0;break}}if(i===1)throw Error(uW);return a-e};Xm.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}});var yW=ee((cpA,QW)=>{"use strict";QW.exports=$m;function $m(){this._listeners=Object.create(null)}$m.prototype.on=function(t,o,a){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:o,ctx:a||this}),this};$m.prototype.off=function(t,o){if(t===void 0)this._listeners=Object.create(null);else if(o===void 0)this._listeners[t]=[];else{var a=this._listeners[t];if(!a)return this;for(var e=0;e{"use strict";bW.exports=mW(mW);function mW(n){return typeof Float32Array<"u"?(function(){var t=new Float32Array([-0]),o=new Uint8Array(t.buffer),a=o[3]===128;function e(s,g,c){t[0]=s,g[c]=o[0],g[c+1]=o[1],g[c+2]=o[2],g[c+3]=o[3]}function i(s,g,c){t[0]=s,g[c]=o[3],g[c+1]=o[2],g[c+2]=o[1],g[c+3]=o[0]}n.writeFloatLE=a?e:i,n.writeFloatBE=a?i:e;function A(s,g){return o[0]=s[g],o[1]=s[g+1],o[2]=s[g+2],o[3]=s[g+3],t[0]}function r(s,g){return o[3]=s[g],o[2]=s[g+1],o[1]=s[g+2],o[0]=s[g+3],t[0]}n.readFloatLE=a?A:r,n.readFloatBE=a?r:A})():(function(){function t(a,e,i,A){var r=e<0?1:0;if(r&&(e=-e),e===0)a(1/e>0?0:2147483648,i,A);else if(isNaN(e))a(2143289344,i,A);else if(e>34028234663852886e22)a((r<<31|2139095040)>>>0,i,A);else if(e<11754943508222875e-54)a((r<<31|Math.round(e/1401298464324817e-60))>>>0,i,A);else{var s=Math.floor(Math.log(e)/Math.LN2),g=Math.round(e*Math.pow(2,-s)*8388608)&8388607;a((r<<31|s+127<<23|g)>>>0,i,A)}}n.writeFloatLE=t.bind(null,SW),n.writeFloatBE=t.bind(null,wW);function o(a,e,i){var A=a(e,i),r=(A>>31)*2+1,s=A>>>23&255,g=A&8388607;return s===255?g?NaN:r*(1/0):s===0?r*1401298464324817e-60*g:r*Math.pow(2,s-150)*(g+8388608)}n.readFloatLE=o.bind(null,DW),n.readFloatBE=o.bind(null,OW)})(),typeof Float64Array<"u"?(function(){var t=new Float64Array([-0]),o=new Uint8Array(t.buffer),a=o[7]===128;function e(s,g,c){t[0]=s,g[c]=o[0],g[c+1]=o[1],g[c+2]=o[2],g[c+3]=o[3],g[c+4]=o[4],g[c+5]=o[5],g[c+6]=o[6],g[c+7]=o[7]}function i(s,g,c){t[0]=s,g[c]=o[7],g[c+1]=o[6],g[c+2]=o[5],g[c+3]=o[4],g[c+4]=o[3],g[c+5]=o[2],g[c+6]=o[1],g[c+7]=o[0]}n.writeDoubleLE=a?e:i,n.writeDoubleBE=a?i:e;function A(s,g){return o[0]=s[g],o[1]=s[g+1],o[2]=s[g+2],o[3]=s[g+3],o[4]=s[g+4],o[5]=s[g+5],o[6]=s[g+6],o[7]=s[g+7],t[0]}function r(s,g){return o[7]=s[g],o[6]=s[g+1],o[5]=s[g+2],o[4]=s[g+3],o[3]=s[g+4],o[2]=s[g+5],o[1]=s[g+6],o[0]=s[g+7],t[0]}n.readDoubleLE=a?A:r,n.readDoubleBE=a?r:A})():(function(){function t(a,e,i,A,r,s){var g=A<0?1:0;if(g&&(A=-A),A===0)a(0,r,s+e),a(1/A>0?0:2147483648,r,s+i);else if(isNaN(A))a(0,r,s+e),a(2146959360,r,s+i);else if(A>17976931348623157e292)a(0,r,s+e),a((g<<31|2146435072)>>>0,r,s+i);else{var c;if(A<22250738585072014e-324)c=A/5e-324,a(c>>>0,r,s+e),a((g<<31|c/4294967296)>>>0,r,s+i);else{var I=Math.floor(Math.log(A)/Math.LN2);I===1024&&(I=1023),c=A*Math.pow(2,-I),a(c*4503599627370496>>>0,r,s+e),a((g<<31|I+1023<<20|c*1048576&1048575)>>>0,r,s+i)}}}n.writeDoubleLE=t.bind(null,SW,0,4),n.writeDoubleBE=t.bind(null,wW,4,0);function o(a,e,i,A,r){var s=a(A,r+e),g=a(A,r+i),c=(g>>31)*2+1,I=g>>>20&2047,p=4294967296*(g&1048575)+s;return I===2047?p?NaN:c*(1/0):I===0?c*5e-324*p:c*Math.pow(2,I-1075)*(p+4503599627370496)}n.readDoubleLE=o.bind(null,DW,0,4),n.readDoubleBE=o.bind(null,OW,4,0)})(),n}function SW(n,t,o){t[o]=n&255,t[o+1]=n>>>8&255,t[o+2]=n>>>16&255,t[o+3]=n>>>24}function wW(n,t,o){t[o]=n>>>24,t[o+1]=n>>>16&255,t[o+2]=n>>>8&255,t[o+3]=n&255}function DW(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0}function OW(n,t){return(n[t]<<24|n[t+1]<<16|n[t+2]<<8|n[t+3])>>>0}});var TW=ee(_W=>{"use strict";var UR=_W,LR=65533;UR.length=function(t){for(var o=0,a=0,e=0;e=192&&r<224?(g=(r&31)<<6|t[o++]&63,i[A++]=g>=128?g:LR):r>=224&&r<240?(c=(r&15)<<12|(t[o++]&63)<<6|t[o++]&63,i[A++]=c>=2048?c:LR):r>=240&&(s=(r&7)<<18|(t[o++]&63)<<12|(t[o++]&63)<<6|t[o++]&63,s<65536||s>1114111?i[A++]=LR:(s-=65536,i[A++]=55296+(s>>10),i[A++]=56320+(s&1023))),A>8191&&((e||(e=[])).push(String.fromCharCode.apply(String,i.slice(0,A))),A=0);return e?(A&&e.push(String.fromCharCode.apply(String,i.slice(0,A))),e.join("")):String.fromCharCode.apply(String,i.slice(0,A))};UR.write=function(t,o,a){for(var e=a,i,A,r=0;r>6|192,o[a++]=i&63|128):(i&64512)===55296&&((A=t.charCodeAt(r+1))&64512)===56320?(i=65536+((i&1023)<<10)+(A&1023),++r,o[a++]=i>>18|240,o[a++]=i>>12&63|128,o[a++]=i>>6&63|128,o[a++]=i&63|128):(o[a++]=i>>12|224,o[a++]=i>>6&63|128,o[a++]=i&63|128);return a-e}});var RW=ee((ppA,NW)=>{"use strict";NW.exports=tRe;function tRe(n,t,o){var a=o||8192,e=a>>>1,i=null,A=a;return function(s){if(s<1||s>e)return n(s);A+s>a&&(i=n(a),A=0);var g=t.call(i,A,A+=s);return A&7&&(A=(A|7)+1),g}}});var vW=ee((dpA,kW)=>{"use strict";kW.exports=pi;var QC=Gc();function pi(n,t){this.lo=n>>>0,this.hi=t>>>0}var Sl=pi.zero=new pi(0,0);Sl.toNumber=function(){return 0};Sl.zzEncode=Sl.zzDecode=function(){return this};Sl.length=function(){return 1};var rRe=pi.zeroHash="\0\0\0\0\0\0\0\0";pi.fromNumber=function(t){if(t===0)return Sl;var o=t<0;o&&(t=-t);var a=t>>>0,e=(t-a)/4294967296>>>0;return o&&(e=~e>>>0,a=~a>>>0,++a>4294967295&&(a=0,++e>4294967295&&(e=0))),new pi(a,e)};pi.from=function(t){if(typeof t=="number")return pi.fromNumber(t);if(QC.isString(t))if(QC.Long)t=QC.Long.fromString(t);else return pi.fromNumber(parseInt(t,10));return t.low||t.high?new pi(t.low>>>0,t.high>>>0):Sl};pi.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var o=~this.lo+1>>>0,a=~this.hi>>>0;return o||(a=a+1>>>0),-(o+a*4294967296)}return this.lo+this.hi*4294967296};pi.prototype.toLong=function(t){return QC.Long?new QC.Long(this.lo|0,this.hi|0,!!t):{low:this.lo|0,high:this.hi|0,unsigned:!!t}};var Pc=String.prototype.charCodeAt;pi.fromHash=function(t){return t===rRe?Sl:new pi((Pc.call(t,0)|Pc.call(t,1)<<8|Pc.call(t,2)<<16|Pc.call(t,3)<<24)>>>0,(Pc.call(t,4)|Pc.call(t,5)<<8|Pc.call(t,6)<<16|Pc.call(t,7)<<24)>>>0)};pi.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};pi.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this};pi.prototype.zzDecode=function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this};pi.prototype.length=function(){var t=this.lo,o=(this.lo>>>28|this.hi<<4)>>>0,a=this.hi>>>24;return a===0?o===0?t<16384?t<128?1:2:t<2097152?3:4:o<16384?o<128?5:6:o<2097152?7:8:a<128?9:10}});var PW=ee((yC,HR)=>{(function(n,t){function o(a){return a.default||a}typeof define=="function"&&define.amd?define([],function(){var a={};return t(a),o(a)}):typeof yC=="object"?(t(yC),typeof HR=="object"&&(HR.exports=o(yC))):(function(){var a={};t(a),n.Long=o(a)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:yC,function(n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function o(H,N,k){this.low=H|0,this.high=N|0,this.unsigned=!!k}o.prototype.__isLong__,Object.defineProperty(o.prototype,"__isLong__",{value:!0});function a(H){return(H&&H.__isLong__)===!0}function e(H){var N=Math.clz32(H&-H);return H?31-N:N}o.isLong=a;var i={},A={};function r(H,N){var k,J,X;return N?(H>>>=0,(X=0<=H&&H<256)&&(J=A[H],J)?J:(k=g(H,0,!0),X&&(A[H]=k),k)):(H|=0,(X=-128<=H&&H<128)&&(J=i[H],J)?J:(k=g(H,H<0?-1:0,!1),X&&(i[H]=k),k))}o.fromInt=r;function s(H,N){if(isNaN(H))return N?R:_;if(N){if(H<0)return R;if(H>=y)return z}else{if(H<=-m)return K;if(H+1>=m)return q}return H<0?s(-H,N).neg():g(H%Q|0,H/Q|0,N)}o.fromNumber=s;function g(H,N,k){return new o(H,N,k)}o.fromBits=g;var c=Math.pow;function I(H,N,k){if(H.length===0)throw Error("empty string");if(typeof N=="number"?(k=N,N=!1):N=!!N,H==="NaN"||H==="Infinity"||H==="+Infinity"||H==="-Infinity")return N?R:_;if(k=k||10,k<2||360)throw Error("interior hyphen");if(J===0)return I(H.substring(1),N,k).neg();for(var X=s(c(k,8)),ie=_,De=0;De>>0:this.low},G.toNumber=function(){return this.unsigned?(this.high>>>0)*Q+(this.low>>>0):this.high*Q+(this.low>>>0)},G.toString=function(N){if(N=N||10,N<2||36>>0,Re=Be.toString(N);if(De=Se,De.isZero())return Re+oe;for(;Re.length<6;)Re="0"+Re;oe=""+Re+oe}},G.getHighBits=function(){return this.high},G.getHighBitsUnsigned=function(){return this.high>>>0},G.getLowBits=function(){return this.low},G.getLowBitsUnsigned=function(){return this.low>>>0},G.getNumBitsAbs=function(){if(this.isNegative())return this.eq(K)?64:this.neg().getNumBitsAbs();for(var N=this.high!=0?this.high:this.low,k=31;k>0&&(N&1<>21;return N?this.unsigned?!1:N===-1&&!(this.low===0&&this.high===-2097152):!0},G.isZero=function(){return this.high===0&&this.low===0},G.eqz=G.isZero,G.isNegative=function(){return!this.unsigned&&this.high<0},G.isPositive=function(){return this.unsigned||this.high>=0},G.isOdd=function(){return(this.low&1)===1},G.isEven=function(){return(this.low&1)===0},G.equals=function(N){return a(N)||(N=p(N)),this.unsigned!==N.unsigned&&this.high>>>31===1&&N.high>>>31===1?!1:this.high===N.high&&this.low===N.low},G.eq=G.equals,G.notEquals=function(N){return!this.eq(N)},G.neq=G.notEquals,G.ne=G.notEquals,G.lessThan=function(N){return this.comp(N)<0},G.lt=G.lessThan,G.lessThanOrEqual=function(N){return this.comp(N)<=0},G.lte=G.lessThanOrEqual,G.le=G.lessThanOrEqual,G.greaterThan=function(N){return this.comp(N)>0},G.gt=G.greaterThan,G.greaterThanOrEqual=function(N){return this.comp(N)>=0},G.gte=G.greaterThanOrEqual,G.ge=G.greaterThanOrEqual,G.compare=function(N){if(a(N)||(N=p(N)),this.eq(N))return 0;var k=this.isNegative(),J=N.isNegative();return k&&!J?-1:!k&&J?1:this.unsigned?N.high>>>0>this.high>>>0||N.high===this.high&&N.low>>>0>this.low>>>0?-1:1:this.sub(N).isNegative()?-1:1},G.comp=G.compare,G.negate=function(){return!this.unsigned&&this.eq(K)?K:this.not().add(L)},G.neg=G.negate,G.add=function(N){a(N)||(N=p(N));var k=this.high>>>16,J=this.high&65535,X=this.low>>>16,ie=this.low&65535,De=N.high>>>16,oe=N.high&65535,Se=N.low>>>16,Be=N.low&65535,Re=0,Ne=0,Je=0,ve=0;return ve+=ie+Be,Je+=ve>>>16,ve&=65535,Je+=X+Se,Ne+=Je>>>16,Je&=65535,Ne+=J+oe,Re+=Ne>>>16,Ne&=65535,Re+=k+De,Re&=65535,g(Je<<16|ve,Re<<16|Ne,this.unsigned)},G.subtract=function(N){return a(N)||(N=p(N)),this.add(N.neg())},G.sub=G.subtract,G.multiply=function(N){if(this.isZero())return this;if(a(N)||(N=p(N)),t){var k=t.mul(this.low,this.high,N.low,N.high);return g(k,t.get_high(),this.unsigned)}if(N.isZero())return this.unsigned?R:_;if(this.eq(K))return N.isOdd()?K:_;if(N.eq(K))return this.isOdd()?K:_;if(this.isNegative())return N.isNegative()?this.neg().mul(N.neg()):this.neg().mul(N).neg();if(N.isNegative())return this.mul(N.neg()).neg();if(this.lt(T)&&N.lt(T))return s(this.toNumber()*N.toNumber(),this.unsigned);var J=this.high>>>16,X=this.high&65535,ie=this.low>>>16,De=this.low&65535,oe=N.high>>>16,Se=N.high&65535,Be=N.low>>>16,Re=N.low&65535,Ne=0,Je=0,ve=0,tA=0;return tA+=De*Re,ve+=tA>>>16,tA&=65535,ve+=ie*Re,Je+=ve>>>16,ve&=65535,ve+=De*Be,Je+=ve>>>16,ve&=65535,Je+=X*Re,Ne+=Je>>>16,Je&=65535,Je+=ie*Be,Ne+=Je>>>16,Je&=65535,Je+=De*Se,Ne+=Je>>>16,Je&=65535,Ne+=J*Re+X*Be+ie*Se+De*oe,Ne&=65535,g(ve<<16|tA,Ne<<16|Je,this.unsigned)},G.mul=G.multiply,G.divide=function(N){if(a(N)||(N=p(N)),N.isZero())throw Error("division by zero");if(t){if(!this.unsigned&&this.high===-2147483648&&N.low===-1&&N.high===-1)return this;var k=(this.unsigned?t.div_u:t.div_s)(this.low,this.high,N.low,N.high);return g(k,t.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?R:_;var J,X,ie;if(this.unsigned){if(N.unsigned||(N=N.toUnsigned()),N.gt(this))return R;if(N.gt(this.shru(1)))return U;ie=R}else{if(this.eq(K)){if(N.eq(L)||N.eq(F))return K;if(N.eq(K))return L;var De=this.shr(1);return J=De.div(N).shl(1),J.eq(_)?N.isNegative()?L:F:(X=this.sub(N.mul(J)),ie=J.add(X.div(N)),ie)}else if(N.eq(K))return this.unsigned?R:_;if(this.isNegative())return N.isNegative()?this.neg().div(N.neg()):this.neg().div(N).neg();if(N.isNegative())return this.div(N.neg()).neg();ie=_}for(X=this;X.gte(N);){J=Math.max(1,Math.floor(X.toNumber()/N.toNumber()));for(var oe=Math.ceil(Math.log(J)/Math.LN2),Se=oe<=48?1:c(2,oe-48),Be=s(J),Re=Be.mul(N);Re.isNegative()||Re.gt(X);)J-=Se,Be=s(J,this.unsigned),Re=Be.mul(N);Be.isZero()&&(Be=L),ie=ie.add(Be),X=X.sub(Re)}return ie},G.div=G.divide,G.modulo=function(N){if(a(N)||(N=p(N)),t){var k=(this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,N.low,N.high);return g(k,t.get_high(),this.unsigned)}return this.sub(this.div(N).mul(N))},G.mod=G.modulo,G.rem=G.modulo,G.not=function(){return g(~this.low,~this.high,this.unsigned)},G.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},G.clz=G.countLeadingZeros,G.countTrailingZeros=function(){return this.low?e(this.low):e(this.high)+32},G.ctz=G.countTrailingZeros,G.and=function(N){return a(N)||(N=p(N)),g(this.low&N.low,this.high&N.high,this.unsigned)},G.or=function(N){return a(N)||(N=p(N)),g(this.low|N.low,this.high|N.high,this.unsigned)},G.xor=function(N){return a(N)||(N=p(N)),g(this.low^N.low,this.high^N.high,this.unsigned)},G.shiftLeft=function(N){return a(N)&&(N=N.toInt()),(N&=63)===0?this:N<32?g(this.low<>>32-N,this.unsigned):g(0,this.low<>>N|this.high<<32-N,this.high>>N,this.unsigned):g(this.high>>N-32,this.high>=0?0:-1,this.unsigned)},G.shr=G.shiftRight,G.shiftRightUnsigned=function(N){return a(N)&&(N=N.toInt()),(N&=63)===0?this:N<32?g(this.low>>>N|this.high<<32-N,this.high>>>N,this.unsigned):N===32?g(this.high,0,this.unsigned):g(this.high>>>N-32,0,this.unsigned)},G.shru=G.shiftRightUnsigned,G.shr_u=G.shiftRightUnsigned,G.rotateLeft=function(N){var k;return a(N)&&(N=N.toInt()),(N&=63)===0?this:N===32?g(this.high,this.low,this.unsigned):N<32?(k=32-N,g(this.low<>>k,this.high<>>k,this.unsigned)):(N-=32,k=32-N,g(this.high<>>k,this.low<>>k,this.unsigned))},G.rotl=G.rotateLeft,G.rotateRight=function(N){var k;return a(N)&&(N=N.toInt()),(N&=63)===0?this:N===32?g(this.high,this.low,this.unsigned):N<32?(k=32-N,g(this.high<>>N,this.low<>>N,this.unsigned)):(N-=32,k=32-N,g(this.low<>>N,this.high<>>N,this.unsigned))},G.rotr=G.rotateRight,G.toSigned=function(){return this.unsigned?g(this.low,this.high,!1):this},G.toUnsigned=function(){return this.unsigned?this:g(this.low,this.high,!0)},G.toBytes=function(N){return N?this.toBytesLE():this.toBytesBE()},G.toBytesLE=function(){var N=this.high,k=this.low;return[k&255,k>>>8&255,k>>>16&255,k>>>24,N&255,N>>>8&255,N>>>16&255,N>>>24]},G.toBytesBE=function(){var N=this.high,k=this.low;return[N>>>24,N>>>16&255,N>>>8&255,N&255,k>>>24,k>>>16&255,k>>>8&255,k&255]},o.fromBytes=function(N,k,J){return J?o.fromBytesLE(N,k):o.fromBytesBE(N,k)},o.fromBytesLE=function(N,k){return new o(N[0]|N[1]<<8|N[2]<<16|N[3]<<24,N[4]|N[5]<<8|N[6]<<16|N[7]<<24,k)},o.fromBytesBE=function(N,k){return new o(N[4]<<24|N[5]<<16|N[6]<<8|N[7],N[0]<<24|N[1]<<16|N[2]<<8|N[3],k)},typeof BigInt=="function"&&(o.fromBigInt=function(N,k){var J=Number(BigInt.asIntN(32,N)),X=Number(BigInt.asIntN(32,N>>BigInt(32)));return g(J,X,k)},o.fromValue=function(N,k){return typeof N=="bigint"?o.fromBigInt(N,k):p(N,k)},G.toBigInt=function(){var N=BigInt(this.low>>>0),k=BigInt(this.unsigned?this.high>>>0:this.high);return k<{"use strict";var fA=KR;fA.asPromise=EW();fA.base64=fW();fA.EventEmitter=yW();fA.float=MW();fA.utf8=TW();fA.pool=RW();fA.LongBits=vW();function GW(n){return n==="__proto__"||n==="prototype"||n==="constructor"}fA.isUnsafeProperty=GW;fA.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);fA.global=fA.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||KR;fA.emptyArray=Object.freeze?Object.freeze([]):[];fA.emptyObject=Object.freeze?Object.freeze({}):{};fA.isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};fA.isString=function(t){return typeof t=="string"||t instanceof String};fA.isObject=function(t){return t&&typeof t=="object"};fA.isset=fA.isSet=function(t,o){var a=t[o];return a!=null&&Object.hasOwnProperty.call(t,o)?typeof a!="object"||(Array.isArray(a)?a.length:Object.keys(a).length)>0:!1};fA.Buffer=(function(){try{var n=fA.global.Buffer;return n.prototype.utf8Write?n:null}catch{return null}})();fA._Buffer_from=null;fA._Buffer_allocUnsafe=null;fA.newBuffer=function(t){return typeof t=="number"?fA.Buffer?fA._Buffer_allocUnsafe(t):new fA.Array(t):fA.Buffer?fA._Buffer_from(t):typeof Uint8Array>"u"?t:new Uint8Array(t)};fA.Array=typeof Uint8Array<"u"?Uint8Array:Array;fA.Long=fA.global.dcodeIO&&fA.global.dcodeIO.Long||fA.global.Long||(function(){try{var n=PW();return n&&n.isLong?n:null}catch{return null}})();fA.key2Re=/^true|false|0|1$/;fA.key32Re=/^-?(?:0|[1-9][0-9]*)$/;fA.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;fA.longToHash=function(t){return t?fA.LongBits.from(t).toHash():fA.LongBits.zeroHash};fA.longFromHash=function(t,o){var a=fA.LongBits.fromHash(t);return fA.Long?fA.Long.fromBits(a.lo,a.hi,o):a.toNumber(!!o)};function FW(n){var t=typeof arguments[arguments.length-1]=="boolean",o=t?arguments.length-1:arguments.length;t=t&&arguments[arguments.length-1];for(var a=1;a-1;--i)if(o[e[i]]===1&&this[e[i]]!==void 0&&this[e[i]]!==null)return e[i]}};fA.oneOfSetter=function(t){return function(o){for(var a=0;a{"use strict";xW.exports=yt;var qo=Gc(),xR,eS=qo.LongBits,UW=qo.base64,HW=qo.utf8;function mC(n,t,o){this.fn=n,this.len=t,this.next=void 0,this.val=o}function jR(){}function iRe(n){this.head=n.head,this.tail=n.tail,this.len=n.len,this.next=n.states}function yt(){this.len=0,this.head=new mC(jR,0,0),this.tail=this.head,this.states=null}var KW=function(){return qo.Buffer?function(){return(yt.create=function(){return new xR})()}:function(){return new yt}};yt.create=KW();yt.alloc=function(t){return new qo.Array(t)};qo.Array!==Array&&(yt.alloc=qo.pool(yt.alloc,qo.Array.prototype.subarray));yt.prototype._push=function(t,o,a){return this.tail=this.tail.next=new mC(t,o,a),this.len+=o,this};function JR(n,t,o){t[o]=n&255}function aRe(n,t,o){for(;n>127;)t[o++]=n&127|128,n>>>=7;t[o]=n}function qR(n,t){this.len=n,this.next=void 0,this.val=t}qR.prototype=Object.create(mC.prototype);qR.prototype.fn=aRe;yt.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new qR((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this};yt.prototype.int32=function(t){return(t|=0)<0?this._push(zR,10,eS.fromNumber(t)):this.uint32(t)};yt.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)};function zR(n,t,o){for(var a=n.lo,e=n.hi;e;)t[o++]=a&127|128,a=(a>>>7|e<<25)>>>0,e>>>=7;for(;a>127;)t[o++]=a&127|128,a=a>>>7;t[o++]=a}yt.prototype.uint64=function(t){var o=eS.from(t);return this._push(zR,o.length(),o)};yt.prototype.int64=yt.prototype.uint64;yt.prototype.sint64=function(t){var o=eS.from(t).zzEncode();return this._push(zR,o.length(),o)};yt.prototype.bool=function(t){return this._push(JR,1,t?1:0)};function YR(n,t,o){t[o]=n&255,t[o+1]=n>>>8&255,t[o+2]=n>>>16&255,t[o+3]=n>>>24}yt.prototype.fixed32=function(t){return this._push(YR,4,t>>>0)};yt.prototype.sfixed32=yt.prototype.fixed32;yt.prototype.fixed64=function(t){var o=eS.from(t);return this._push(YR,4,o.lo)._push(YR,4,o.hi)};yt.prototype.sfixed64=yt.prototype.fixed64;yt.prototype.float=function(t){return this._push(qo.float.writeFloatLE,4,t)};yt.prototype.double=function(t){return this._push(qo.float.writeDoubleLE,8,t)};var oRe=qo.Array.prototype.set?function(t,o,a){o.set(t,a)}:function(t,o,a){for(var e=0;e>>0;if(!o)return this._push(JR,1,0);if(qo.isString(t)){var a=yt.alloc(o=UW.length(t));UW.decode(t,a,0),t=a}return this.uint32(o)._push(oRe,o,t)};yt.prototype.string=function(t){var o=HW.length(t);return o?this.uint32(o)._push(HW.write,o,t):this._push(JR,1,0)};yt.prototype.fork=function(){return this.states=new iRe(this),this.head=this.tail=new mC(jR,0,0),this.len=0,this};yt.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new mC(jR,0,0),this.len=0),this};yt.prototype.ldelim=function(){var t=this.head,o=this.tail,a=this.len;return this.reset().uint32(a),a&&(this.tail.next=t.next,this.tail=o,this.len+=a),this};yt.prototype.finish=function(){for(var t=this.head.next,o=this.constructor.alloc(this.len),a=0;t;)t.fn(t.val,o,a),a+=t.len,t=t.next;return o};yt._configure=function(n){xR=n,yt.create=KW(),xR._configure()}});var JW=ee((upA,jW)=>{"use strict";jW.exports=Ds;var YW=VR();(Ds.prototype=Object.create(YW.prototype)).constructor=Ds;var Fc=Gc();function Ds(){YW.call(this)}Ds._configure=function(){Ds.alloc=Fc._Buffer_allocUnsafe,Ds.writeBytesBuffer=Fc.Buffer&&Fc.Buffer.prototype instanceof Uint8Array&&Fc.Buffer.prototype.set.name==="set"?function(t,o,a){o.set(t,a)}:function(t,o,a){if(t.copy)t.copy(o,a,0,t.length);else for(var e=0;e>>0;return this.uint32(o),o&&this._push(Ds.writeBytesBuffer,o,t),this};function nRe(n,t,o){n.length<40?Fc.utf8.write(n,t,o):t.utf8Write?t.utf8Write(n,o):t.write(n,o)}Ds.prototype.string=function(t){var o=Fc.Buffer.byteLength(t);return this.uint32(o),o&&this._push(nRe,o,t),this};Ds._configure()});var XR=ee((CpA,ZW)=>{"use strict";ZW.exports=hr;var zo=Gc(),ZR,VW=zo.LongBits,sRe=zo.utf8;function kn(n,t){return RangeError("index out of range: "+n.pos+" + "+(t||1)+" > "+n.len)}function hr(n){this.buf=n,this.pos=0,this.len=n.length}var qW=typeof Uint8Array<"u"?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new hr(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new hr(t);throw Error("illegal buffer")},WW=function(){return zo.Buffer?function(o){return(hr.create=function(e){return zo.Buffer.isBuffer(e)?new ZR(e):qW(e)})(o)}:qW};hr.create=WW();hr.prototype._slice=zo.Array.prototype.subarray||zo.Array.prototype.slice;hr.prototype.uint32=(function(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,kn(this,10);return t}})();hr.prototype.int32=function(){return this.uint32()|0};hr.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(t&1)|0};function WR(){var n=new VW(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(n.lo=(n.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n;if(n.lo=(n.lo|(this.buf[this.pos]&127)<<28)>>>0,n.hi=(n.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return n;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw kn(this);if(n.lo=(n.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}return n.lo=(n.lo|(this.buf[this.pos++]&127)<>>0,n}if(this.len-this.pos>4){for(;t<5;++t)if(n.hi=(n.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}else for(;t<5;++t){if(this.pos>=this.len)throw kn(this);if(n.hi=(n.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}throw Error("invalid varint encoding")}hr.prototype.bool=function(){return this.uint32()!==0};function AS(n,t){return(n[t-4]|n[t-3]<<8|n[t-2]<<16|n[t-1]<<24)>>>0}hr.prototype.fixed32=function(){if(this.pos+4>this.len)throw kn(this,4);return AS(this.buf,this.pos+=4)};hr.prototype.sfixed32=function(){if(this.pos+4>this.len)throw kn(this,4);return AS(this.buf,this.pos+=4)|0};function zW(){if(this.pos+8>this.len)throw kn(this,8);return new VW(AS(this.buf,this.pos+=4),AS(this.buf,this.pos+=4))}hr.prototype.float=function(){if(this.pos+4>this.len)throw kn(this,4);var t=zo.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t};hr.prototype.double=function(){if(this.pos+8>this.len)throw kn(this,4);var t=zo.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t};hr.prototype.bytes=function(){var t=this.uint32(),o=this.pos,a=this.pos+t;if(a>this.len)throw kn(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(o,a);if(o===a){var e=zo.Buffer;return e?e.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,o,a)};hr.prototype.string=function(){var t=this.bytes();return sRe.read(t,0,t.length)};hr.prototype.skip=function(t){if(typeof t=="number"){if(this.pos+t>this.len)throw kn(this,t);this.pos+=t}else do if(this.pos>=this.len)throw kn(this);while(this.buf[this.pos++]&128);return this};hr.recursionLimit=zo.recursionLimit;hr.prototype.skipType=function(n,t){if(t===void 0&&(t=0),t>hr.recursionLimit)throw Error("maximum nesting depth exceeded");switch(n){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(n=this.uint32()&7)!==4;)this.skipType(n,t+1);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+n+" at offset "+this.pos)}return this};hr._configure=function(n){ZR=n,hr.create=WW(),ZR._configure();var t=zo.Long?"toLong":"toNumber";zo.merge(hr.prototype,{int64:function(){return WR.call(this)[t](!1)},uint64:function(){return WR.call(this)[t](!0)},sint64:function(){return WR.call(this).zzDecode()[t](!1)},fixed64:function(){return zW.call(this)[t](!0)},sfixed64:function(){return zW.call(this)[t](!1)}})}});var A6=ee((BpA,e6)=>{"use strict";e6.exports=wl;var $W=XR();(wl.prototype=Object.create($W.prototype)).constructor=wl;var XW=Gc();function wl(n){$W.call(this,n)}wl._configure=function(){XW.Buffer&&(wl.prototype._slice=XW.Buffer.prototype.slice)};wl.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))};wl._configure()});var r6=ee((fpA,t6)=>{"use strict";t6.exports=SC;var $R=Gc();(SC.prototype=Object.create($R.EventEmitter.prototype)).constructor=SC;function SC(n,t,o){if(typeof n!="function")throw TypeError("rpcImpl must be a function");$R.EventEmitter.call(this),this.rpcImpl=n,this.requestDelimited=!!t,this.responseDelimited=!!o}SC.prototype.rpcCall=function n(t,o,a,e,i){if(!e)throw TypeError("request must be specified");var A=this;if(!i)return $R.asPromise(n,A,t,o,a,e);if(!A.rpcImpl){setTimeout(function(){i(Error("already ended"))},0);return}try{return A.rpcImpl(t,o[A.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(s,g){if(s)return A.emit("error",s,t),i(s);if(g===null){A.end(!0);return}if(!(g instanceof a))try{g=a[A.responseDelimited?"decodeDelimited":"decode"](g)}catch(c){return A.emit("error",c,t),i(c)}return A.emit("data",g,t),i(null,g)})}catch(r){A.emit("error",r,t),setTimeout(function(){i(r)},0);return}};SC.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var a6=ee(i6=>{"use strict";var gRe=i6;gRe.Service=r6()});var n6=ee((ypA,o6)=>{"use strict";o6.exports=Object.create(null)});var c6=ee(g6=>{"use strict";var ja=g6;ja.build="minimal";ja.Writer=VR();ja.BufferWriter=JW();ja.Reader=XR();ja.BufferReader=A6();ja.util=Gc();ja.rpc=a6();ja.roots=n6();ja.configure=s6;function s6(){ja.util._configure(),ja.Writer._configure(ja.BufferWriter),ja.Reader._configure(ja.BufferReader)}s6()});var tS=ee((SpA,I6)=>{"use strict";I6.exports=c6()});var dZ=ee(st=>{"use strict";var XC=Symbol.for("react.element"),NGe=Symbol.for("react.portal"),RGe=Symbol.for("react.fragment"),kGe=Symbol.for("react.strict_mode"),vGe=Symbol.for("react.profiler"),PGe=Symbol.for("react.provider"),GGe=Symbol.for("react.context"),FGe=Symbol.for("react.forward_ref"),LGe=Symbol.for("react.suspense"),UGe=Symbol.for("react.memo"),HGe=Symbol.for("react.lazy"),rZ=Symbol.iterator;function KGe(n){return n===null||typeof n!="object"?null:(n=rZ&&n[rZ]||n["@@iterator"],typeof n=="function"?n:null)}var oZ={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nZ=Object.assign,sZ={};function sh(n,t,o){this.props=n,this.context=t,this.refs=sZ,this.updater=o||oZ}sh.prototype.isReactComponent={};sh.prototype.setState=function(n,t){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,t,"setState")};sh.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function gZ(){}gZ.prototype=sh.prototype;function cG(n,t,o){this.props=n,this.context=t,this.refs=sZ,this.updater=o||oZ}var IG=cG.prototype=new gZ;IG.constructor=cG;nZ(IG,sh.prototype);IG.isPureReactComponent=!0;var iZ=Array.isArray,cZ=Object.prototype.hasOwnProperty,lG={current:null},IZ={key:!0,ref:!0,__self:!0,__source:!0};function lZ(n,t,o){var a,e={},i=null,A=null;if(t!=null)for(a in t.ref!==void 0&&(A=t.ref),t.key!==void 0&&(i=""+t.key),t)cZ.call(t,a)&&!IZ.hasOwnProperty(a)&&(e[a]=t[a]);var r=arguments.length-2;if(r===1)e.children=o;else if(1{"use strict";process.env.NODE_ENV!=="production"&&(function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n="18.3.1",t=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),A=Symbol.for("react.provider"),r=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),f=Symbol.iterator,Q="@@iterator";function y(x){if(x===null||typeof x!="object")return null;var te=f&&x[f]||x[Q];return typeof te=="function"?te:null}var m={current:null},T={transition:null},_={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},R={current:null},L={},U=null;function F(x){U=x}L.setExtraStackFrame=function(x){U=x},L.getCurrentStack=null,L.getStackAddendum=function(){var x="";U&&(x+=U);var te=L.getCurrentStack;return te&&(x+=te()||""),x};var q=!1,z=!1,K=!1,G=!1,V=!1,H={ReactCurrentDispatcher:m,ReactCurrentBatchConfig:T,ReactCurrentOwner:R};H.ReactDebugCurrentFrame=L,H.ReactCurrentActQueue=_;function N(x){{for(var te=arguments.length,de=new Array(te>1?te-1:0),me=1;me1?te-1:0),me=1;me1){for(var er=Array(Lt),Ar=0;Ar1){for(var Ir=Array(Ar),Nr=0;Nr is not supported and will be removed in a future major release. Did you mean to render instead?")),te.Provider},set:function(CA){te.Provider=CA}},_currentValue:{get:function(){return te._currentValue},set:function(CA){te._currentValue=CA}},_currentValue2:{get:function(){return te._currentValue2},set:function(CA){te._currentValue2=CA}},_threadCount:{get:function(){return te._threadCount},set:function(CA){te._threadCount=CA}},Consumer:{get:function(){return de||(de=!0,k("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),te.Consumer}},displayName:{get:function(){return te.displayName},set:function(CA){Ve||(N("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",CA),Ve=!0)}}}),te.Consumer=TA}return te._currentRenderer=null,te._currentRenderer2=null,te}var he=-1,ye=0,qe=1,IA=2;function yA(x){if(x._status===he){var te=x._result,de=te();if(de.then(function(TA){if(x._status===ye||x._status===he){var CA=x;CA._status=qe,CA._result=TA}},function(TA){if(x._status===ye||x._status===he){var CA=x;CA._status=IA,CA._result=TA}}),x._status===he){var me=x;me._status=ye,me._result=de}}if(x._status===qe){var Ve=x._result;return Ve===void 0&&k(`lazy: Expected the result of a dynamic import() call. Instead received: %s +`+o)}function ml(n,t,o,a,e,i){if(n.listenerCount("wsClientError")){let A=new Error(e);Error.captureStackTrace(A,ml),n.emit("wsClientError",A,o,t)}else fC(o,a,e,i)}});var EW=ee((IpA,hW)=>{"use strict";hW.exports=ARe;function ARe(n,t){for(var o=new Array(arguments.length-1),a=0,e=2,i=!0;e{"use strict";var Xm=BW;Xm.length=function(t){var o=t.length;if(!o)return 0;for(var a=0;--o%4>1&&t.charAt(o)==="=";)++a;return Math.ceil(t.length*3)/4-a};var Wd=new Array(64),CW=new Array(123);for(Rn=0;Rn<64;)CW[Wd[Rn]=Rn<26?Rn+65:Rn<52?Rn+71:Rn<62?Rn-4:Rn-59|43]=Rn++;var Rn;Xm.encode=function(t,o,a){for(var e=null,i=[],A=0,r=0,s;o>2],s=(g&3)<<4,r=1;break;case 1:i[A++]=Wd[s|g>>4],s=(g&15)<<2,r=2;break;case 2:i[A++]=Wd[s|g>>6],i[A++]=Wd[g&63],r=0;break}A>8191&&((e||(e=[])).push(String.fromCharCode.apply(String,i)),A=0)}return r&&(i[A++]=Wd[s],i[A++]=61,r===1&&(i[A++]=61)),e?(A&&e.push(String.fromCharCode.apply(String,i.slice(0,A))),e.join("")):String.fromCharCode.apply(String,i.slice(0,A))};var uW="invalid encoding";Xm.decode=function(t,o,a){for(var e=a,i=0,A,r=0;r1)break;if((s=CW[s])===void 0)throw Error(uW);switch(i){case 0:A=s,i=1;break;case 1:o[a++]=A<<2|(s&48)>>4,A=s,i=2;break;case 2:o[a++]=(A&15)<<4|(s&60)>>2,A=s,i=3;break;case 3:o[a++]=(A&3)<<6|s,i=0;break}}if(i===1)throw Error(uW);return a-e};Xm.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}});var yW=ee((ppA,QW)=>{"use strict";QW.exports=$m;function $m(){this._listeners=Object.create(null)}$m.prototype.on=function(t,o,a){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:o,ctx:a||this}),this};$m.prototype.off=function(t,o){if(t===void 0)this._listeners=Object.create(null);else if(o===void 0)this._listeners[t]=[];else{var a=this._listeners[t];if(!a)return this;for(var e=0;e{"use strict";bW.exports=mW(mW);function mW(n){return typeof Float32Array<"u"?(function(){var t=new Float32Array([-0]),o=new Uint8Array(t.buffer),a=o[3]===128;function e(s,g,c){t[0]=s,g[c]=o[0],g[c+1]=o[1],g[c+2]=o[2],g[c+3]=o[3]}function i(s,g,c){t[0]=s,g[c]=o[3],g[c+1]=o[2],g[c+2]=o[1],g[c+3]=o[0]}n.writeFloatLE=a?e:i,n.writeFloatBE=a?i:e;function A(s,g){return o[0]=s[g],o[1]=s[g+1],o[2]=s[g+2],o[3]=s[g+3],t[0]}function r(s,g){return o[3]=s[g],o[2]=s[g+1],o[1]=s[g+2],o[0]=s[g+3],t[0]}n.readFloatLE=a?A:r,n.readFloatBE=a?r:A})():(function(){function t(a,e,i,A){var r=e<0?1:0;if(r&&(e=-e),e===0)a(1/e>0?0:2147483648,i,A);else if(isNaN(e))a(2143289344,i,A);else if(e>34028234663852886e22)a((r<<31|2139095040)>>>0,i,A);else if(e<11754943508222875e-54)a((r<<31|Math.round(e/1401298464324817e-60))>>>0,i,A);else{var s=Math.floor(Math.log(e)/Math.LN2),g=Math.round(e*Math.pow(2,-s)*8388608)&8388607;a((r<<31|s+127<<23|g)>>>0,i,A)}}n.writeFloatLE=t.bind(null,SW),n.writeFloatBE=t.bind(null,wW);function o(a,e,i){var A=a(e,i),r=(A>>31)*2+1,s=A>>>23&255,g=A&8388607;return s===255?g?NaN:r*(1/0):s===0?r*1401298464324817e-60*g:r*Math.pow(2,s-150)*(g+8388608)}n.readFloatLE=o.bind(null,DW),n.readFloatBE=o.bind(null,OW)})(),typeof Float64Array<"u"?(function(){var t=new Float64Array([-0]),o=new Uint8Array(t.buffer),a=o[7]===128;function e(s,g,c){t[0]=s,g[c]=o[0],g[c+1]=o[1],g[c+2]=o[2],g[c+3]=o[3],g[c+4]=o[4],g[c+5]=o[5],g[c+6]=o[6],g[c+7]=o[7]}function i(s,g,c){t[0]=s,g[c]=o[7],g[c+1]=o[6],g[c+2]=o[5],g[c+3]=o[4],g[c+4]=o[3],g[c+5]=o[2],g[c+6]=o[1],g[c+7]=o[0]}n.writeDoubleLE=a?e:i,n.writeDoubleBE=a?i:e;function A(s,g){return o[0]=s[g],o[1]=s[g+1],o[2]=s[g+2],o[3]=s[g+3],o[4]=s[g+4],o[5]=s[g+5],o[6]=s[g+6],o[7]=s[g+7],t[0]}function r(s,g){return o[7]=s[g],o[6]=s[g+1],o[5]=s[g+2],o[4]=s[g+3],o[3]=s[g+4],o[2]=s[g+5],o[1]=s[g+6],o[0]=s[g+7],t[0]}n.readDoubleLE=a?A:r,n.readDoubleBE=a?r:A})():(function(){function t(a,e,i,A,r,s){var g=A<0?1:0;if(g&&(A=-A),A===0)a(0,r,s+e),a(1/A>0?0:2147483648,r,s+i);else if(isNaN(A))a(0,r,s+e),a(2146959360,r,s+i);else if(A>17976931348623157e292)a(0,r,s+e),a((g<<31|2146435072)>>>0,r,s+i);else{var c;if(A<22250738585072014e-324)c=A/5e-324,a(c>>>0,r,s+e),a((g<<31|c/4294967296)>>>0,r,s+i);else{var I=Math.floor(Math.log(A)/Math.LN2);I===1024&&(I=1023),c=A*Math.pow(2,-I),a(c*4503599627370496>>>0,r,s+e),a((g<<31|I+1023<<20|c*1048576&1048575)>>>0,r,s+i)}}}n.writeDoubleLE=t.bind(null,SW,0,4),n.writeDoubleBE=t.bind(null,wW,4,0);function o(a,e,i,A,r){var s=a(A,r+e),g=a(A,r+i),c=(g>>31)*2+1,I=g>>>20&2047,p=4294967296*(g&1048575)+s;return I===2047?p?NaN:c*(1/0):I===0?c*5e-324*p:c*Math.pow(2,I-1075)*(p+4503599627370496)}n.readDoubleLE=o.bind(null,DW,0,4),n.readDoubleBE=o.bind(null,OW,4,0)})(),n}function SW(n,t,o){t[o]=n&255,t[o+1]=n>>>8&255,t[o+2]=n>>>16&255,t[o+3]=n>>>24}function wW(n,t,o){t[o]=n>>>24,t[o+1]=n>>>16&255,t[o+2]=n>>>8&255,t[o+3]=n&255}function DW(n,t){return(n[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24)>>>0}function OW(n,t){return(n[t]<<24|n[t+1]<<16|n[t+2]<<8|n[t+3])>>>0}});var TW=ee(_W=>{"use strict";var UR=_W,LR=65533;UR.length=function(t){for(var o=0,a=0,e=0;e=192&&r<224?(g=(r&31)<<6|t[o++]&63,i[A++]=g>=128?g:LR):r>=224&&r<240?(c=(r&15)<<12|(t[o++]&63)<<6|t[o++]&63,i[A++]=c>=2048?c:LR):r>=240&&(s=(r&7)<<18|(t[o++]&63)<<12|(t[o++]&63)<<6|t[o++]&63,s<65536||s>1114111?i[A++]=LR:(s-=65536,i[A++]=55296+(s>>10),i[A++]=56320+(s&1023))),A>8191&&((e||(e=[])).push(String.fromCharCode.apply(String,i.slice(0,A))),A=0);return e?(A&&e.push(String.fromCharCode.apply(String,i.slice(0,A))),e.join("")):String.fromCharCode.apply(String,i.slice(0,A))};UR.write=function(t,o,a){for(var e=a,i,A,r=0;r>6|192,o[a++]=i&63|128):(i&64512)===55296&&((A=t.charCodeAt(r+1))&64512)===56320?(i=65536+((i&1023)<<10)+(A&1023),++r,o[a++]=i>>18|240,o[a++]=i>>12&63|128,o[a++]=i>>6&63|128,o[a++]=i&63|128):(o[a++]=i>>12|224,o[a++]=i>>6&63|128,o[a++]=i&63|128);return a-e}});var RW=ee((EpA,NW)=>{"use strict";NW.exports=tRe;function tRe(n,t,o){var a=o||8192,e=a>>>1,i=null,A=a;return function(s){if(s<1||s>e)return n(s);A+s>a&&(i=n(a),A=0);var g=t.call(i,A,A+=s);return A&7&&(A=(A|7)+1),g}}});var vW=ee((upA,kW)=>{"use strict";kW.exports=pi;var QC=Gc();function pi(n,t){this.lo=n>>>0,this.hi=t>>>0}var Sl=pi.zero=new pi(0,0);Sl.toNumber=function(){return 0};Sl.zzEncode=Sl.zzDecode=function(){return this};Sl.length=function(){return 1};var rRe=pi.zeroHash="\0\0\0\0\0\0\0\0";pi.fromNumber=function(t){if(t===0)return Sl;var o=t<0;o&&(t=-t);var a=t>>>0,e=(t-a)/4294967296>>>0;return o&&(e=~e>>>0,a=~a>>>0,++a>4294967295&&(a=0,++e>4294967295&&(e=0))),new pi(a,e)};pi.from=function(t){if(typeof t=="number")return pi.fromNumber(t);if(QC.isString(t))if(QC.Long)t=QC.Long.fromString(t);else return pi.fromNumber(parseInt(t,10));return t.low||t.high?new pi(t.low>>>0,t.high>>>0):Sl};pi.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var o=~this.lo+1>>>0,a=~this.hi>>>0;return o||(a=a+1>>>0),-(o+a*4294967296)}return this.lo+this.hi*4294967296};pi.prototype.toLong=function(t){return QC.Long?new QC.Long(this.lo|0,this.hi|0,!!t):{low:this.lo|0,high:this.hi|0,unsigned:!!t}};var Pc=String.prototype.charCodeAt;pi.fromHash=function(t){return t===rRe?Sl:new pi((Pc.call(t,0)|Pc.call(t,1)<<8|Pc.call(t,2)<<16|Pc.call(t,3)<<24)>>>0,(Pc.call(t,4)|Pc.call(t,5)<<8|Pc.call(t,6)<<16|Pc.call(t,7)<<24)>>>0)};pi.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};pi.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this};pi.prototype.zzDecode=function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this};pi.prototype.length=function(){var t=this.lo,o=(this.lo>>>28|this.hi<<4)>>>0,a=this.hi>>>24;return a===0?o===0?t<16384?t<128?1:2:t<2097152?3:4:o<16384?o<128?5:6:o<2097152?7:8:a<128?9:10}});var PW=ee((yC,HR)=>{(function(n,t){function o(a){return a.default||a}typeof define=="function"&&define.amd?define([],function(){var a={};return t(a),o(a)}):typeof yC=="object"?(t(yC),typeof HR=="object"&&(HR.exports=o(yC))):(function(){var a={};t(a),n.Long=o(a)})()})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:yC,function(n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function o(H,N,k){this.low=H|0,this.high=N|0,this.unsigned=!!k}o.prototype.__isLong__,Object.defineProperty(o.prototype,"__isLong__",{value:!0});function a(H){return(H&&H.__isLong__)===!0}function e(H){var N=Math.clz32(H&-H);return H?31-N:N}o.isLong=a;var i={},A={};function r(H,N){var k,J,X;return N?(H>>>=0,(X=0<=H&&H<256)&&(J=A[H],J)?J:(k=g(H,0,!0),X&&(A[H]=k),k)):(H|=0,(X=-128<=H&&H<128)&&(J=i[H],J)?J:(k=g(H,H<0?-1:0,!1),X&&(i[H]=k),k))}o.fromInt=r;function s(H,N){if(isNaN(H))return N?R:_;if(N){if(H<0)return R;if(H>=y)return z}else{if(H<=-m)return K;if(H+1>=m)return q}return H<0?s(-H,N).neg():g(H%Q|0,H/Q|0,N)}o.fromNumber=s;function g(H,N,k){return new o(H,N,k)}o.fromBits=g;var c=Math.pow;function I(H,N,k){if(H.length===0)throw Error("empty string");if(typeof N=="number"?(k=N,N=!1):N=!!N,H==="NaN"||H==="Infinity"||H==="+Infinity"||H==="-Infinity")return N?R:_;if(k=k||10,k<2||360)throw Error("interior hyphen");if(J===0)return I(H.substring(1),N,k).neg();for(var X=s(c(k,8)),ie=_,De=0;De>>0:this.low},G.toNumber=function(){return this.unsigned?(this.high>>>0)*Q+(this.low>>>0):this.high*Q+(this.low>>>0)},G.toString=function(N){if(N=N||10,N<2||36>>0,Re=Be.toString(N);if(De=Se,De.isZero())return Re+oe;for(;Re.length<6;)Re="0"+Re;oe=""+Re+oe}},G.getHighBits=function(){return this.high},G.getHighBitsUnsigned=function(){return this.high>>>0},G.getLowBits=function(){return this.low},G.getLowBitsUnsigned=function(){return this.low>>>0},G.getNumBitsAbs=function(){if(this.isNegative())return this.eq(K)?64:this.neg().getNumBitsAbs();for(var N=this.high!=0?this.high:this.low,k=31;k>0&&(N&1<>21;return N?this.unsigned?!1:N===-1&&!(this.low===0&&this.high===-2097152):!0},G.isZero=function(){return this.high===0&&this.low===0},G.eqz=G.isZero,G.isNegative=function(){return!this.unsigned&&this.high<0},G.isPositive=function(){return this.unsigned||this.high>=0},G.isOdd=function(){return(this.low&1)===1},G.isEven=function(){return(this.low&1)===0},G.equals=function(N){return a(N)||(N=p(N)),this.unsigned!==N.unsigned&&this.high>>>31===1&&N.high>>>31===1?!1:this.high===N.high&&this.low===N.low},G.eq=G.equals,G.notEquals=function(N){return!this.eq(N)},G.neq=G.notEquals,G.ne=G.notEquals,G.lessThan=function(N){return this.comp(N)<0},G.lt=G.lessThan,G.lessThanOrEqual=function(N){return this.comp(N)<=0},G.lte=G.lessThanOrEqual,G.le=G.lessThanOrEqual,G.greaterThan=function(N){return this.comp(N)>0},G.gt=G.greaterThan,G.greaterThanOrEqual=function(N){return this.comp(N)>=0},G.gte=G.greaterThanOrEqual,G.ge=G.greaterThanOrEqual,G.compare=function(N){if(a(N)||(N=p(N)),this.eq(N))return 0;var k=this.isNegative(),J=N.isNegative();return k&&!J?-1:!k&&J?1:this.unsigned?N.high>>>0>this.high>>>0||N.high===this.high&&N.low>>>0>this.low>>>0?-1:1:this.sub(N).isNegative()?-1:1},G.comp=G.compare,G.negate=function(){return!this.unsigned&&this.eq(K)?K:this.not().add(L)},G.neg=G.negate,G.add=function(N){a(N)||(N=p(N));var k=this.high>>>16,J=this.high&65535,X=this.low>>>16,ie=this.low&65535,De=N.high>>>16,oe=N.high&65535,Se=N.low>>>16,Be=N.low&65535,Re=0,Ne=0,Je=0,ve=0;return ve+=ie+Be,Je+=ve>>>16,ve&=65535,Je+=X+Se,Ne+=Je>>>16,Je&=65535,Ne+=J+oe,Re+=Ne>>>16,Ne&=65535,Re+=k+De,Re&=65535,g(Je<<16|ve,Re<<16|Ne,this.unsigned)},G.subtract=function(N){return a(N)||(N=p(N)),this.add(N.neg())},G.sub=G.subtract,G.multiply=function(N){if(this.isZero())return this;if(a(N)||(N=p(N)),t){var k=t.mul(this.low,this.high,N.low,N.high);return g(k,t.get_high(),this.unsigned)}if(N.isZero())return this.unsigned?R:_;if(this.eq(K))return N.isOdd()?K:_;if(N.eq(K))return this.isOdd()?K:_;if(this.isNegative())return N.isNegative()?this.neg().mul(N.neg()):this.neg().mul(N).neg();if(N.isNegative())return this.mul(N.neg()).neg();if(this.lt(T)&&N.lt(T))return s(this.toNumber()*N.toNumber(),this.unsigned);var J=this.high>>>16,X=this.high&65535,ie=this.low>>>16,De=this.low&65535,oe=N.high>>>16,Se=N.high&65535,Be=N.low>>>16,Re=N.low&65535,Ne=0,Je=0,ve=0,tA=0;return tA+=De*Re,ve+=tA>>>16,tA&=65535,ve+=ie*Re,Je+=ve>>>16,ve&=65535,ve+=De*Be,Je+=ve>>>16,ve&=65535,Je+=X*Re,Ne+=Je>>>16,Je&=65535,Je+=ie*Be,Ne+=Je>>>16,Je&=65535,Je+=De*Se,Ne+=Je>>>16,Je&=65535,Ne+=J*Re+X*Be+ie*Se+De*oe,Ne&=65535,g(ve<<16|tA,Ne<<16|Je,this.unsigned)},G.mul=G.multiply,G.divide=function(N){if(a(N)||(N=p(N)),N.isZero())throw Error("division by zero");if(t){if(!this.unsigned&&this.high===-2147483648&&N.low===-1&&N.high===-1)return this;var k=(this.unsigned?t.div_u:t.div_s)(this.low,this.high,N.low,N.high);return g(k,t.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?R:_;var J,X,ie;if(this.unsigned){if(N.unsigned||(N=N.toUnsigned()),N.gt(this))return R;if(N.gt(this.shru(1)))return U;ie=R}else{if(this.eq(K)){if(N.eq(L)||N.eq(F))return K;if(N.eq(K))return L;var De=this.shr(1);return J=De.div(N).shl(1),J.eq(_)?N.isNegative()?L:F:(X=this.sub(N.mul(J)),ie=J.add(X.div(N)),ie)}else if(N.eq(K))return this.unsigned?R:_;if(this.isNegative())return N.isNegative()?this.neg().div(N.neg()):this.neg().div(N).neg();if(N.isNegative())return this.div(N.neg()).neg();ie=_}for(X=this;X.gte(N);){J=Math.max(1,Math.floor(X.toNumber()/N.toNumber()));for(var oe=Math.ceil(Math.log(J)/Math.LN2),Se=oe<=48?1:c(2,oe-48),Be=s(J),Re=Be.mul(N);Re.isNegative()||Re.gt(X);)J-=Se,Be=s(J,this.unsigned),Re=Be.mul(N);Be.isZero()&&(Be=L),ie=ie.add(Be),X=X.sub(Re)}return ie},G.div=G.divide,G.modulo=function(N){if(a(N)||(N=p(N)),t){var k=(this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,N.low,N.high);return g(k,t.get_high(),this.unsigned)}return this.sub(this.div(N).mul(N))},G.mod=G.modulo,G.rem=G.modulo,G.not=function(){return g(~this.low,~this.high,this.unsigned)},G.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},G.clz=G.countLeadingZeros,G.countTrailingZeros=function(){return this.low?e(this.low):e(this.high)+32},G.ctz=G.countTrailingZeros,G.and=function(N){return a(N)||(N=p(N)),g(this.low&N.low,this.high&N.high,this.unsigned)},G.or=function(N){return a(N)||(N=p(N)),g(this.low|N.low,this.high|N.high,this.unsigned)},G.xor=function(N){return a(N)||(N=p(N)),g(this.low^N.low,this.high^N.high,this.unsigned)},G.shiftLeft=function(N){return a(N)&&(N=N.toInt()),(N&=63)===0?this:N<32?g(this.low<>>32-N,this.unsigned):g(0,this.low<>>N|this.high<<32-N,this.high>>N,this.unsigned):g(this.high>>N-32,this.high>=0?0:-1,this.unsigned)},G.shr=G.shiftRight,G.shiftRightUnsigned=function(N){return a(N)&&(N=N.toInt()),(N&=63)===0?this:N<32?g(this.low>>>N|this.high<<32-N,this.high>>>N,this.unsigned):N===32?g(this.high,0,this.unsigned):g(this.high>>>N-32,0,this.unsigned)},G.shru=G.shiftRightUnsigned,G.shr_u=G.shiftRightUnsigned,G.rotateLeft=function(N){var k;return a(N)&&(N=N.toInt()),(N&=63)===0?this:N===32?g(this.high,this.low,this.unsigned):N<32?(k=32-N,g(this.low<>>k,this.high<>>k,this.unsigned)):(N-=32,k=32-N,g(this.high<>>k,this.low<>>k,this.unsigned))},G.rotl=G.rotateLeft,G.rotateRight=function(N){var k;return a(N)&&(N=N.toInt()),(N&=63)===0?this:N===32?g(this.high,this.low,this.unsigned):N<32?(k=32-N,g(this.high<>>N,this.low<>>N,this.unsigned)):(N-=32,k=32-N,g(this.low<>>N,this.high<>>N,this.unsigned))},G.rotr=G.rotateRight,G.toSigned=function(){return this.unsigned?g(this.low,this.high,!1):this},G.toUnsigned=function(){return this.unsigned?this:g(this.low,this.high,!0)},G.toBytes=function(N){return N?this.toBytesLE():this.toBytesBE()},G.toBytesLE=function(){var N=this.high,k=this.low;return[k&255,k>>>8&255,k>>>16&255,k>>>24,N&255,N>>>8&255,N>>>16&255,N>>>24]},G.toBytesBE=function(){var N=this.high,k=this.low;return[N>>>24,N>>>16&255,N>>>8&255,N&255,k>>>24,k>>>16&255,k>>>8&255,k&255]},o.fromBytes=function(N,k,J){return J?o.fromBytesLE(N,k):o.fromBytesBE(N,k)},o.fromBytesLE=function(N,k){return new o(N[0]|N[1]<<8|N[2]<<16|N[3]<<24,N[4]|N[5]<<8|N[6]<<16|N[7]<<24,k)},o.fromBytesBE=function(N,k){return new o(N[4]<<24|N[5]<<16|N[6]<<8|N[7],N[0]<<24|N[1]<<16|N[2]<<8|N[3],k)},typeof BigInt=="function"&&(o.fromBigInt=function(N,k){var J=Number(BigInt.asIntN(32,N)),X=Number(BigInt.asIntN(32,N>>BigInt(32)));return g(J,X,k)},o.fromValue=function(N,k){return typeof N=="bigint"?o.fromBigInt(N,k):p(N,k)},G.toBigInt=function(){var N=BigInt(this.low>>>0),k=BigInt(this.unsigned?this.high>>>0:this.high);return k<{"use strict";var fA=KR;fA.asPromise=EW();fA.base64=fW();fA.EventEmitter=yW();fA.float=MW();fA.utf8=TW();fA.pool=RW();fA.LongBits=vW();function GW(n){return n==="__proto__"||n==="prototype"||n==="constructor"}fA.isUnsafeProperty=GW;fA.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);fA.global=fA.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||KR;fA.emptyArray=Object.freeze?Object.freeze([]):[];fA.emptyObject=Object.freeze?Object.freeze({}):{};fA.isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};fA.isString=function(t){return typeof t=="string"||t instanceof String};fA.isObject=function(t){return t&&typeof t=="object"};fA.isset=fA.isSet=function(t,o){var a=t[o];return a!=null&&Object.hasOwnProperty.call(t,o)?typeof a!="object"||(Array.isArray(a)?a.length:Object.keys(a).length)>0:!1};fA.Buffer=(function(){try{var n=fA.global.Buffer;return n.prototype.utf8Write?n:null}catch{return null}})();fA._Buffer_from=null;fA._Buffer_allocUnsafe=null;fA.newBuffer=function(t){return typeof t=="number"?fA.Buffer?fA._Buffer_allocUnsafe(t):new fA.Array(t):fA.Buffer?fA._Buffer_from(t):typeof Uint8Array>"u"?t:new Uint8Array(t)};fA.Array=typeof Uint8Array<"u"?Uint8Array:Array;fA.Long=fA.global.dcodeIO&&fA.global.dcodeIO.Long||fA.global.Long||(function(){try{var n=PW();return n&&n.isLong?n:null}catch{return null}})();fA.key2Re=/^true|false|0|1$/;fA.key32Re=/^-?(?:0|[1-9][0-9]*)$/;fA.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;fA.longToHash=function(t){return t?fA.LongBits.from(t).toHash():fA.LongBits.zeroHash};fA.longFromHash=function(t,o){var a=fA.LongBits.fromHash(t);return fA.Long?fA.Long.fromBits(a.lo,a.hi,o):a.toNumber(!!o)};function FW(n){var t=typeof arguments[arguments.length-1]=="boolean",o=t?arguments.length-1:arguments.length;t=t&&arguments[arguments.length-1];for(var a=1;a-1;--i)if(o[e[i]]===1&&this[e[i]]!==void 0&&this[e[i]]!==null)return e[i]}};fA.oneOfSetter=function(t){return function(o){for(var a=0;a{"use strict";xW.exports=mt;var qo=Gc(),xR,eS=qo.LongBits,UW=qo.base64,HW=qo.utf8;function mC(n,t,o){this.fn=n,this.len=t,this.next=void 0,this.val=o}function jR(){}function iRe(n){this.head=n.head,this.tail=n.tail,this.len=n.len,this.next=n.states}function mt(){this.len=0,this.head=new mC(jR,0,0),this.tail=this.head,this.states=null}var KW=function(){return qo.Buffer?function(){return(mt.create=function(){return new xR})()}:function(){return new mt}};mt.create=KW();mt.alloc=function(t){return new qo.Array(t)};qo.Array!==Array&&(mt.alloc=qo.pool(mt.alloc,qo.Array.prototype.subarray));mt.prototype._push=function(t,o,a){return this.tail=this.tail.next=new mC(t,o,a),this.len+=o,this};function JR(n,t,o){t[o]=n&255}function aRe(n,t,o){for(;n>127;)t[o++]=n&127|128,n>>>=7;t[o]=n}function qR(n,t){this.len=n,this.next=void 0,this.val=t}qR.prototype=Object.create(mC.prototype);qR.prototype.fn=aRe;mt.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new qR((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this};mt.prototype.int32=function(t){return(t|=0)<0?this._push(zR,10,eS.fromNumber(t)):this.uint32(t)};mt.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)};function zR(n,t,o){for(var a=n.lo,e=n.hi;e;)t[o++]=a&127|128,a=(a>>>7|e<<25)>>>0,e>>>=7;for(;a>127;)t[o++]=a&127|128,a=a>>>7;t[o++]=a}mt.prototype.uint64=function(t){var o=eS.from(t);return this._push(zR,o.length(),o)};mt.prototype.int64=mt.prototype.uint64;mt.prototype.sint64=function(t){var o=eS.from(t).zzEncode();return this._push(zR,o.length(),o)};mt.prototype.bool=function(t){return this._push(JR,1,t?1:0)};function YR(n,t,o){t[o]=n&255,t[o+1]=n>>>8&255,t[o+2]=n>>>16&255,t[o+3]=n>>>24}mt.prototype.fixed32=function(t){return this._push(YR,4,t>>>0)};mt.prototype.sfixed32=mt.prototype.fixed32;mt.prototype.fixed64=function(t){var o=eS.from(t);return this._push(YR,4,o.lo)._push(YR,4,o.hi)};mt.prototype.sfixed64=mt.prototype.fixed64;mt.prototype.float=function(t){return this._push(qo.float.writeFloatLE,4,t)};mt.prototype.double=function(t){return this._push(qo.float.writeDoubleLE,8,t)};var oRe=qo.Array.prototype.set?function(t,o,a){o.set(t,a)}:function(t,o,a){for(var e=0;e>>0;if(!o)return this._push(JR,1,0);if(qo.isString(t)){var a=mt.alloc(o=UW.length(t));UW.decode(t,a,0),t=a}return this.uint32(o)._push(oRe,o,t)};mt.prototype.string=function(t){var o=HW.length(t);return o?this.uint32(o)._push(HW.write,o,t):this._push(JR,1,0)};mt.prototype.fork=function(){return this.states=new iRe(this),this.head=this.tail=new mC(jR,0,0),this.len=0,this};mt.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new mC(jR,0,0),this.len=0),this};mt.prototype.ldelim=function(){var t=this.head,o=this.tail,a=this.len;return this.reset().uint32(a),a&&(this.tail.next=t.next,this.tail=o,this.len+=a),this};mt.prototype.finish=function(){for(var t=this.head.next,o=this.constructor.alloc(this.len),a=0;t;)t.fn(t.val,o,a),a+=t.len,t=t.next;return o};mt._configure=function(n){xR=n,mt.create=KW(),xR._configure()}});var JW=ee((fpA,jW)=>{"use strict";jW.exports=Ds;var YW=VR();(Ds.prototype=Object.create(YW.prototype)).constructor=Ds;var Fc=Gc();function Ds(){YW.call(this)}Ds._configure=function(){Ds.alloc=Fc._Buffer_allocUnsafe,Ds.writeBytesBuffer=Fc.Buffer&&Fc.Buffer.prototype instanceof Uint8Array&&Fc.Buffer.prototype.set.name==="set"?function(t,o,a){o.set(t,a)}:function(t,o,a){if(t.copy)t.copy(o,a,0,t.length);else for(var e=0;e>>0;return this.uint32(o),o&&this._push(Ds.writeBytesBuffer,o,t),this};function nRe(n,t,o){n.length<40?Fc.utf8.write(n,t,o):t.utf8Write?t.utf8Write(n,o):t.write(n,o)}Ds.prototype.string=function(t){var o=Fc.Buffer.byteLength(t);return this.uint32(o),o&&this._push(nRe,o,t),this};Ds._configure()});var XR=ee((QpA,ZW)=>{"use strict";ZW.exports=hr;var zo=Gc(),ZR,VW=zo.LongBits,sRe=zo.utf8;function kn(n,t){return RangeError("index out of range: "+n.pos+" + "+(t||1)+" > "+n.len)}function hr(n){this.buf=n,this.pos=0,this.len=n.length}var qW=typeof Uint8Array<"u"?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new hr(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new hr(t);throw Error("illegal buffer")},WW=function(){return zo.Buffer?function(o){return(hr.create=function(e){return zo.Buffer.isBuffer(e)?new ZR(e):qW(e)})(o)}:qW};hr.create=WW();hr.prototype._slice=zo.Array.prototype.subarray||zo.Array.prototype.slice;hr.prototype.uint32=(function(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,kn(this,10);return t}})();hr.prototype.int32=function(){return this.uint32()|0};hr.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(t&1)|0};function WR(){var n=new VW(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(n.lo=(n.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n;if(n.lo=(n.lo|(this.buf[this.pos]&127)<<28)>>>0,n.hi=(n.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return n;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw kn(this);if(n.lo=(n.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}return n.lo=(n.lo|(this.buf[this.pos++]&127)<>>0,n}if(this.len-this.pos>4){for(;t<5;++t)if(n.hi=(n.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}else for(;t<5;++t){if(this.pos>=this.len)throw kn(this);if(n.hi=(n.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return n}throw Error("invalid varint encoding")}hr.prototype.bool=function(){return this.uint32()!==0};function AS(n,t){return(n[t-4]|n[t-3]<<8|n[t-2]<<16|n[t-1]<<24)>>>0}hr.prototype.fixed32=function(){if(this.pos+4>this.len)throw kn(this,4);return AS(this.buf,this.pos+=4)};hr.prototype.sfixed32=function(){if(this.pos+4>this.len)throw kn(this,4);return AS(this.buf,this.pos+=4)|0};function zW(){if(this.pos+8>this.len)throw kn(this,8);return new VW(AS(this.buf,this.pos+=4),AS(this.buf,this.pos+=4))}hr.prototype.float=function(){if(this.pos+4>this.len)throw kn(this,4);var t=zo.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t};hr.prototype.double=function(){if(this.pos+8>this.len)throw kn(this,4);var t=zo.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t};hr.prototype.bytes=function(){var t=this.uint32(),o=this.pos,a=this.pos+t;if(a>this.len)throw kn(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(o,a);if(o===a){var e=zo.Buffer;return e?e.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,o,a)};hr.prototype.string=function(){var t=this.bytes();return sRe.read(t,0,t.length)};hr.prototype.skip=function(t){if(typeof t=="number"){if(this.pos+t>this.len)throw kn(this,t);this.pos+=t}else do if(this.pos>=this.len)throw kn(this);while(this.buf[this.pos++]&128);return this};hr.recursionLimit=zo.recursionLimit;hr.prototype.skipType=function(n,t){if(t===void 0&&(t=0),t>hr.recursionLimit)throw Error("maximum nesting depth exceeded");switch(n){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(n=this.uint32()&7)!==4;)this.skipType(n,t+1);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+n+" at offset "+this.pos)}return this};hr._configure=function(n){ZR=n,hr.create=WW(),ZR._configure();var t=zo.Long?"toLong":"toNumber";zo.merge(hr.prototype,{int64:function(){return WR.call(this)[t](!1)},uint64:function(){return WR.call(this)[t](!0)},sint64:function(){return WR.call(this).zzDecode()[t](!1)},fixed64:function(){return zW.call(this)[t](!0)},sfixed64:function(){return zW.call(this)[t](!1)}})}});var A6=ee((ypA,e6)=>{"use strict";e6.exports=wl;var $W=XR();(wl.prototype=Object.create($W.prototype)).constructor=wl;var XW=Gc();function wl(n){$W.call(this,n)}wl._configure=function(){XW.Buffer&&(wl.prototype._slice=XW.Buffer.prototype.slice)};wl.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))};wl._configure()});var r6=ee((mpA,t6)=>{"use strict";t6.exports=SC;var $R=Gc();(SC.prototype=Object.create($R.EventEmitter.prototype)).constructor=SC;function SC(n,t,o){if(typeof n!="function")throw TypeError("rpcImpl must be a function");$R.EventEmitter.call(this),this.rpcImpl=n,this.requestDelimited=!!t,this.responseDelimited=!!o}SC.prototype.rpcCall=function n(t,o,a,e,i){if(!e)throw TypeError("request must be specified");var A=this;if(!i)return $R.asPromise(n,A,t,o,a,e);if(!A.rpcImpl){setTimeout(function(){i(Error("already ended"))},0);return}try{return A.rpcImpl(t,o[A.requestDelimited?"encodeDelimited":"encode"](e).finish(),function(s,g){if(s)return A.emit("error",s,t),i(s);if(g===null){A.end(!0);return}if(!(g instanceof a))try{g=a[A.responseDelimited?"decodeDelimited":"decode"](g)}catch(c){return A.emit("error",c,t),i(c)}return A.emit("data",g,t),i(null,g)})}catch(r){A.emit("error",r,t),setTimeout(function(){i(r)},0);return}};SC.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var a6=ee(i6=>{"use strict";var gRe=i6;gRe.Service=r6()});var n6=ee((wpA,o6)=>{"use strict";o6.exports=Object.create(null)});var c6=ee(g6=>{"use strict";var ja=g6;ja.build="minimal";ja.Writer=VR();ja.BufferWriter=JW();ja.Reader=XR();ja.BufferReader=A6();ja.util=Gc();ja.rpc=a6();ja.roots=n6();ja.configure=s6;function s6(){ja.util._configure(),ja.Writer._configure(ja.BufferWriter),ja.Reader._configure(ja.BufferReader)}s6()});var tS=ee((OpA,I6)=>{"use strict";I6.exports=c6()});var dZ=ee(st=>{"use strict";var XC=Symbol.for("react.element"),NGe=Symbol.for("react.portal"),RGe=Symbol.for("react.fragment"),kGe=Symbol.for("react.strict_mode"),vGe=Symbol.for("react.profiler"),PGe=Symbol.for("react.provider"),GGe=Symbol.for("react.context"),FGe=Symbol.for("react.forward_ref"),LGe=Symbol.for("react.suspense"),UGe=Symbol.for("react.memo"),HGe=Symbol.for("react.lazy"),rZ=Symbol.iterator;function KGe(n){return n===null||typeof n!="object"?null:(n=rZ&&n[rZ]||n["@@iterator"],typeof n=="function"?n:null)}var oZ={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nZ=Object.assign,sZ={};function sh(n,t,o){this.props=n,this.context=t,this.refs=sZ,this.updater=o||oZ}sh.prototype.isReactComponent={};sh.prototype.setState=function(n,t){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,t,"setState")};sh.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function gZ(){}gZ.prototype=sh.prototype;function cG(n,t,o){this.props=n,this.context=t,this.refs=sZ,this.updater=o||oZ}var IG=cG.prototype=new gZ;IG.constructor=cG;nZ(IG,sh.prototype);IG.isPureReactComponent=!0;var iZ=Array.isArray,cZ=Object.prototype.hasOwnProperty,lG={current:null},IZ={key:!0,ref:!0,__self:!0,__source:!0};function lZ(n,t,o){var a,e={},i=null,A=null;if(t!=null)for(a in t.ref!==void 0&&(A=t.ref),t.key!==void 0&&(i=""+t.key),t)cZ.call(t,a)&&!IZ.hasOwnProperty(a)&&(e[a]=t[a]);var r=arguments.length-2;if(r===1)e.children=o;else if(1{"use strict";process.env.NODE_ENV!=="production"&&(function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var n="18.3.1",t=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),A=Symbol.for("react.provider"),r=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),f=Symbol.iterator,Q="@@iterator";function y(x){if(x===null||typeof x!="object")return null;var te=f&&x[f]||x[Q];return typeof te=="function"?te:null}var m={current:null},T={transition:null},_={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},R={current:null},L={},U=null;function F(x){U=x}L.setExtraStackFrame=function(x){U=x},L.getCurrentStack=null,L.getStackAddendum=function(){var x="";U&&(x+=U);var te=L.getCurrentStack;return te&&(x+=te()||""),x};var q=!1,z=!1,K=!1,G=!1,V=!1,H={ReactCurrentDispatcher:m,ReactCurrentBatchConfig:T,ReactCurrentOwner:R};H.ReactDebugCurrentFrame=L,H.ReactCurrentActQueue=_;function N(x){{for(var te=arguments.length,de=new Array(te>1?te-1:0),me=1;me1?te-1:0),me=1;me1){for(var er=Array(Lt),Ar=0;Ar1){for(var Ir=Array(Ar),Nr=0;Nr is not supported and will be removed in a future major release. Did you mean to render instead?")),te.Provider},set:function(CA){te.Provider=CA}},_currentValue:{get:function(){return te._currentValue},set:function(CA){te._currentValue=CA}},_currentValue2:{get:function(){return te._currentValue2},set:function(CA){te._currentValue2=CA}},_threadCount:{get:function(){return te._threadCount},set:function(CA){te._threadCount=CA}},Consumer:{get:function(){return de||(de=!0,k("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),te.Consumer}},displayName:{get:function(){return te.displayName},set:function(CA){Ve||(N("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",CA),Ve=!0)}}}),te.Consumer=TA}return te._currentRenderer=null,te._currentRenderer2=null,te}var he=-1,ye=0,qe=1,IA=2;function yA(x){if(x._status===he){var te=x._result,de=te();if(de.then(function(TA){if(x._status===ye||x._status===he){var CA=x;CA._status=qe,CA._result=TA}},function(TA){if(x._status===ye||x._status===he){var CA=x;CA._status=IA,CA._result=TA}}),x._status===he){var me=x;me._status=ye,me._result=de}}if(x._status===qe){var Ve=x._result;return Ve===void 0&&k(`lazy: Expected the result of a dynamic import() call. Instead received: %s Your code should look like: const MyComponent = lazy(() => import('./MyComponent')) @@ -47,15 +47,15 @@ Check the render method of \``+x+"`."}return""}function Wle(x){if(x!==void 0){va Check your code at `+te+":"+de+"."}return""}function Zle(x){return x!=null?Wle(x.__source):""}var ux={};function Xle(x){var te=Ex();if(!te){var de=typeof x=="string"?x:x.displayName||x.name;de&&(te=` -Check the top-level render call using <`+de+">.")}return te}function Cx(x,te){if(!(!x._store||x._store.validated||x.key!=null)){x._store.validated=!0;var de=Xle(te);if(!ux[de]){ux[de]=!0;var me="";x&&x._owner&&x._owner!==R.current&&(me=" It was passed a child from "+Ce(x._owner.type)+"."),Np(x),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',de,me),Np(null)}}}function Bx(x,te){if(typeof x=="object"){if(je(x))for(var de=0;de",Ve=" Did you accidentally export a JSX literal instead of a component?"):CA=typeof x,k("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",CA,Ve)}var xA=Qe.apply(this,arguments);if(xA==null)return xA;if(me)for(var Et=2;Et10&&N("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),me._updatedFibers.clear()}}}var mx=!1,bQ=null;function rpe(x){if(bQ===null)try{var te=("require"+Math.random()).slice(0,7),de=ew&&ew[te];bQ=de.call(ew,"timers").setImmediate}catch{bQ=function(Ve){mx===!1&&(mx=!0,typeof MessageChannel>"u"&&k("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var TA=new MessageChannel;TA.port1.onmessage=Ve,TA.port2.postMessage(void 0)}}return bQ(x)}var Rp=0,Sx=!1;function wx(x){{var te=Rp;Rp++,_.current===null&&(_.current=[]);var de=_.isBatchingLegacy,me;try{if(_.isBatchingLegacy=!0,me=x(),!de&&_.didScheduleLegacyUpdate){var Ve=_.current;Ve!==null&&(_.didScheduleLegacyUpdate=!1,g_(Ve))}}catch(Ir){throw MQ(te),Ir}finally{_.isBatchingLegacy=de}if(me!==null&&typeof me=="object"&&typeof me.then=="function"){var TA=me,CA=!1,xA={then:function(Ir,Nr){CA=!0,TA.then(function(wi){MQ(te),Rp===0?n_(wi,Ir,Nr):Ir(wi)},function(wi){MQ(te),Nr(wi)})}};return!Sx&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){CA||(Sx=!0,k("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),xA}else{var Et=me;if(MQ(te),Rp===0){var Lt=_.current;Lt!==null&&(g_(Lt),_.current=null);var er={then:function(Ir,Nr){_.current===null?(_.current=[],n_(Et,Ir,Nr)):Ir(Et)}};return er}else{var Ar={then:function(Ir,Nr){Ir(Et)}};return Ar}}}}function MQ(x){x!==Rp-1&&k("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Rp=x}function n_(x,te,de){{var me=_.current;if(me!==null)try{g_(me),rpe(function(){me.length===0?(_.current=null,te(x)):n_(x,te,de)})}catch(Ve){de(Ve)}else te(x)}}var s_=!1;function g_(x){if(!s_){s_=!0;var te=0;try{for(;te{"use strict";process.env.NODE_ENV==="production"?dG.exports=dZ():dG.exports=hZ()});var Kl=ee((wmA,DX)=>{"use strict";var lD=$e("crypto"),uKe=$e("assert");function $o(n){if(!(n instanceof Buffer))throw TypeError(`Expected Buffer instead of: ${n.constructor.name}`);return n}function CKe(n,t,o){$o(n),$o(t),$o(o);let a=lD.createCipheriv("aes-256-cbc",n,o);return Buffer.concat([a.update(t),a.final()])}function BKe(n,t,o){$o(n),$o(t),$o(o);let a=lD.createDecipheriv("aes-256-cbc",n,o);return Buffer.concat([a.update(t),a.final()])}function Qh(n,t){$o(n),$o(t);let o=lD.createHmac("sha256",n);return o.update(t),Buffer.from(o.digest())}function fKe(n){$o(n);let t=lD.createHash("sha512");return t.update(n),t.digest()}function QKe(n,t,o,a){if($o(n),$o(t),$o(o),t.byteLength!=32)throw new Error("Got salt of incorrect length");a=a||3,uKe(a>=1&&a<=3);let e=Qh(t,n),i=new Uint8Array(o.byteLength+1+32);i.set(o,32),i[i.length-1]=1;let A=[Qh(e,Buffer.from(i.slice(32)))];return a>1&&(i.set(A[A.length-1]),i[i.length-1]=2,A.push(Qh(e,Buffer.from(i)))),a>2&&(i.set(A[A.length-1]),i[i.length-1]=3,A.push(Qh(e,Buffer.from(i)))),A}function yKe(n,t,o,a){let e=Qh(t,n).slice(0,a);if(o.length!==a||e.length!==a)throw new Error("Bad MAC length");if(!o.equals(e))throw new Error("Bad MAC")}DX.exports={deriveSecrets:QKe,decrypt:BKe,encrypt:CKe,hash:fKe,calculateMAC:Qh,verifyMAC:yKe}});var UX=ee(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});var DmA=new Uint8Array(16),kX=new Uint8Array(32);kX[0]=9;function dA(n){var t,o=new Float64Array(16);if(n)for(t=0;t>24&255,n[t+1]=o>>16&255,n[t+2]=o>>8&255,n[t+3]=o&255,n[t+4]=a>>24&255,n[t+5]=a>>16&255,n[t+6]=a>>8&255,n[t+7]=a&255}function OKe(n,t,o,a,e){var i,A=0;for(i=0;i>>8)-1}function vX(n,t,o,a){return OKe(n,t,o,a,32)}function Wc(n,t){var o;for(o=0;o<16;o++)n[o]=t[o]|0}function JF(n){var t,o,a=1;for(t=0;t<16;t++)o=n[t]+a+65535,a=Math.floor(o/65536),n[t]=o-a*65536;n[0]+=a-1+37*(a-1)}function yh(n,t,o){for(var a,e=~(o-1),i=0;i<16;i++)a=e&(n[i]^t[i]),n[i]^=a,t[i]^=a}function Sh(n,t){var o,a,e,i=dA(),A=dA();for(o=0;o<16;o++)A[o]=t[o];for(JF(A),JF(A),JF(A),a=0;a<2;a++){for(i[0]=A[0]-65517,o=1;o<15;o++)i[o]=A[o]-65535-(i[o-1]>>16&1),i[o-1]&=65535;i[15]=A[15]-32767-(i[14]>>16&1),e=i[15]>>16&1,i[14]&=65535,yh(A,i,1-e)}for(o=0;o<16;o++)n[2*o]=A[o]&255,n[2*o+1]=A[o]>>8}function _X(n,t){var o=new Uint8Array(32),a=new Uint8Array(32);return Sh(o,n),Sh(a,t),vX(o,0,a,0)}function PX(n){var t=new Uint8Array(32);return Sh(t,n),t[0]&1}function ZF(n,t){var o;for(o=0;o<16;o++)n[o]=t[2*o]+(t[2*o+1]<<8);n[15]&=32767}function Kn(n,t,o){for(var a=0;a<16;a++)n[a]=t[a]+o[a]}function Yn(n,t,o){for(var a=0;a<16;a++)n[a]=t[a]-o[a]}function dt(n,t,o){var a,e,i=0,A=0,r=0,s=0,g=0,c=0,I=0,p=0,B=0,f=0,Q=0,y=0,m=0,T=0,_=0,R=0,L=0,U=0,F=0,q=0,z=0,K=0,G=0,V=0,H=0,N=0,k=0,J=0,X=0,ie=0,De=0,oe=o[0],Se=o[1],Be=o[2],Re=o[3],Ne=o[4],Je=o[5],ve=o[6],tA=o[7],fe=o[8],Ie=o[9],Xe=o[10],je=o[11],be=o[12],uA=o[13],EA=o[14],aA=o[15];a=t[0],i+=a*oe,A+=a*Se,r+=a*Be,s+=a*Re,g+=a*Ne,c+=a*Je,I+=a*ve,p+=a*tA,B+=a*fe,f+=a*Ie,Q+=a*Xe,y+=a*je,m+=a*be,T+=a*uA,_+=a*EA,R+=a*aA,a=t[1],A+=a*oe,r+=a*Se,s+=a*Be,g+=a*Re,c+=a*Ne,I+=a*Je,p+=a*ve,B+=a*tA,f+=a*fe,Q+=a*Ie,y+=a*Xe,m+=a*je,T+=a*be,_+=a*uA,R+=a*EA,L+=a*aA,a=t[2],r+=a*oe,s+=a*Se,g+=a*Be,c+=a*Re,I+=a*Ne,p+=a*Je,B+=a*ve,f+=a*tA,Q+=a*fe,y+=a*Ie,m+=a*Xe,T+=a*je,_+=a*be,R+=a*uA,L+=a*EA,U+=a*aA,a=t[3],s+=a*oe,g+=a*Se,c+=a*Be,I+=a*Re,p+=a*Ne,B+=a*Je,f+=a*ve,Q+=a*tA,y+=a*fe,m+=a*Ie,T+=a*Xe,_+=a*je,R+=a*be,L+=a*uA,U+=a*EA,F+=a*aA,a=t[4],g+=a*oe,c+=a*Se,I+=a*Be,p+=a*Re,B+=a*Ne,f+=a*Je,Q+=a*ve,y+=a*tA,m+=a*fe,T+=a*Ie,_+=a*Xe,R+=a*je,L+=a*be,U+=a*uA,F+=a*EA,q+=a*aA,a=t[5],c+=a*oe,I+=a*Se,p+=a*Be,B+=a*Re,f+=a*Ne,Q+=a*Je,y+=a*ve,m+=a*tA,T+=a*fe,_+=a*Ie,R+=a*Xe,L+=a*je,U+=a*be,F+=a*uA,q+=a*EA,z+=a*aA,a=t[6],I+=a*oe,p+=a*Se,B+=a*Be,f+=a*Re,Q+=a*Ne,y+=a*Je,m+=a*ve,T+=a*tA,_+=a*fe,R+=a*Ie,L+=a*Xe,U+=a*je,F+=a*be,q+=a*uA,z+=a*EA,K+=a*aA,a=t[7],p+=a*oe,B+=a*Se,f+=a*Be,Q+=a*Re,y+=a*Ne,m+=a*Je,T+=a*ve,_+=a*tA,R+=a*fe,L+=a*Ie,U+=a*Xe,F+=a*je,q+=a*be,z+=a*uA,K+=a*EA,G+=a*aA,a=t[8],B+=a*oe,f+=a*Se,Q+=a*Be,y+=a*Re,m+=a*Ne,T+=a*Je,_+=a*ve,R+=a*tA,L+=a*fe,U+=a*Ie,F+=a*Xe,q+=a*je,z+=a*be,K+=a*uA,G+=a*EA,V+=a*aA,a=t[9],f+=a*oe,Q+=a*Se,y+=a*Be,m+=a*Re,T+=a*Ne,_+=a*Je,R+=a*ve,L+=a*tA,U+=a*fe,F+=a*Ie,q+=a*Xe,z+=a*je,K+=a*be,G+=a*uA,V+=a*EA,H+=a*aA,a=t[10],Q+=a*oe,y+=a*Se,m+=a*Be,T+=a*Re,_+=a*Ne,R+=a*Je,L+=a*ve,U+=a*tA,F+=a*fe,q+=a*Ie,z+=a*Xe,K+=a*je,G+=a*be,V+=a*uA,H+=a*EA,N+=a*aA,a=t[11],y+=a*oe,m+=a*Se,T+=a*Be,_+=a*Re,R+=a*Ne,L+=a*Je,U+=a*ve,F+=a*tA,q+=a*fe,z+=a*Ie,K+=a*Xe,G+=a*je,V+=a*be,H+=a*uA,N+=a*EA,k+=a*aA,a=t[12],m+=a*oe,T+=a*Se,_+=a*Be,R+=a*Re,L+=a*Ne,U+=a*Je,F+=a*ve,q+=a*tA,z+=a*fe,K+=a*Ie,G+=a*Xe,V+=a*je,H+=a*be,N+=a*uA,k+=a*EA,J+=a*aA,a=t[13],T+=a*oe,_+=a*Se,R+=a*Be,L+=a*Re,U+=a*Ne,F+=a*Je,q+=a*ve,z+=a*tA,K+=a*fe,G+=a*Ie,V+=a*Xe,H+=a*je,N+=a*be,k+=a*uA,J+=a*EA,X+=a*aA,a=t[14],_+=a*oe,R+=a*Se,L+=a*Be,U+=a*Re,F+=a*Ne,q+=a*Je,z+=a*ve,K+=a*tA,G+=a*fe,V+=a*Ie,H+=a*Xe,N+=a*je,k+=a*be,J+=a*uA,X+=a*EA,ie+=a*aA,a=t[15],R+=a*oe,L+=a*Se,U+=a*Be,F+=a*Re,q+=a*Ne,z+=a*Je,K+=a*ve,G+=a*tA,V+=a*fe,H+=a*Ie,N+=a*Xe,k+=a*je,J+=a*be,X+=a*uA,ie+=a*EA,De+=a*aA,i+=38*L,A+=38*U,r+=38*F,s+=38*q,g+=38*z,c+=38*K,I+=38*G,p+=38*V,B+=38*H,f+=38*N,Q+=38*k,y+=38*J,m+=38*X,T+=38*ie,_+=38*De,e=1,a=i+e+65535,e=Math.floor(a/65536),i=a-e*65536,a=A+e+65535,e=Math.floor(a/65536),A=a-e*65536,a=r+e+65535,e=Math.floor(a/65536),r=a-e*65536,a=s+e+65535,e=Math.floor(a/65536),s=a-e*65536,a=g+e+65535,e=Math.floor(a/65536),g=a-e*65536,a=c+e+65535,e=Math.floor(a/65536),c=a-e*65536,a=I+e+65535,e=Math.floor(a/65536),I=a-e*65536,a=p+e+65535,e=Math.floor(a/65536),p=a-e*65536,a=B+e+65535,e=Math.floor(a/65536),B=a-e*65536,a=f+e+65535,e=Math.floor(a/65536),f=a-e*65536,a=Q+e+65535,e=Math.floor(a/65536),Q=a-e*65536,a=y+e+65535,e=Math.floor(a/65536),y=a-e*65536,a=m+e+65535,e=Math.floor(a/65536),m=a-e*65536,a=T+e+65535,e=Math.floor(a/65536),T=a-e*65536,a=_+e+65535,e=Math.floor(a/65536),_=a-e*65536,a=R+e+65535,e=Math.floor(a/65536),R=a-e*65536,i+=e-1+37*(e-1),e=1,a=i+e+65535,e=Math.floor(a/65536),i=a-e*65536,a=A+e+65535,e=Math.floor(a/65536),A=a-e*65536,a=r+e+65535,e=Math.floor(a/65536),r=a-e*65536,a=s+e+65535,e=Math.floor(a/65536),s=a-e*65536,a=g+e+65535,e=Math.floor(a/65536),g=a-e*65536,a=c+e+65535,e=Math.floor(a/65536),c=a-e*65536,a=I+e+65535,e=Math.floor(a/65536),I=a-e*65536,a=p+e+65535,e=Math.floor(a/65536),p=a-e*65536,a=B+e+65535,e=Math.floor(a/65536),B=a-e*65536,a=f+e+65535,e=Math.floor(a/65536),f=a-e*65536,a=Q+e+65535,e=Math.floor(a/65536),Q=a-e*65536,a=y+e+65535,e=Math.floor(a/65536),y=a-e*65536,a=m+e+65535,e=Math.floor(a/65536),m=a-e*65536,a=T+e+65535,e=Math.floor(a/65536),T=a-e*65536,a=_+e+65535,e=Math.floor(a/65536),_=a-e*65536,a=R+e+65535,e=Math.floor(a/65536),R=a-e*65536,i+=e-1+37*(e-1),n[0]=i,n[1]=A,n[2]=r,n[3]=s,n[4]=g,n[5]=c,n[6]=I,n[7]=p,n[8]=B,n[9]=f,n[10]=Q,n[11]=y,n[12]=m,n[13]=T,n[14]=_,n[15]=R}function xn(n,t){dt(n,t,t)}function XF(n,t){var o=dA(),a;for(a=0;a<16;a++)o[a]=t[a];for(a=253;a>=0;a--)xn(o,o),a!==2&&a!==4&&dt(o,o,t);for(a=0;a<16;a++)n[a]=o[a]}function bKe(n,t){var o=dA(),a;for(a=0;a<16;a++)o[a]=t[a];for(a=250;a>=0;a--)xn(o,o),a!==1&&dt(o,o,t);for(a=0;a<16;a++)n[a]=o[a]}function GX(n,t,o){var a=new Uint8Array(32),e=new Float64Array(80),i,A,r=dA(),s=dA(),g=dA(),c=dA(),I=dA(),p=dA();for(A=0;A<31;A++)a[A]=t[A];for(a[31]=t[31]&127|64,a[0]&=248,ZF(e,o),A=0;A<16;A++)s[A]=e[A],c[A]=r[A]=g[A]=0;for(r[0]=c[0]=1,A=254;A>=0;--A)i=a[A>>>3]>>>(A&7)&1,yh(r,s,i),yh(g,c,i),Kn(I,r,g),Yn(r,r,g),Kn(g,s,c),Yn(s,s,c),xn(c,I),xn(p,r),dt(r,g,r),dt(g,s,I),Kn(I,r,g),Yn(r,r,g),xn(s,r),Yn(g,c,p),dt(r,g,mKe),Kn(r,r,c),dt(g,g,r),dt(r,c,p),dt(c,s,e),xn(s,I),yh(r,s,i),yh(g,c,i);for(A=0;A<16;A++)e[A+16]=r[A],e[A+32]=g[A],e[A+48]=s[A],e[A+64]=c[A];var B=e.subarray(32),f=e.subarray(16);return XF(B,B),dt(f,f,B),Sh(n,f),0}function MKe(n,t){return GX(n,t,kX)}var TX=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function NX(n,t,o,a){for(var e=new Int32Array(16),i=new Int32Array(16),A,r,s,g,c,I,p,B,f,Q,y,m,T,_,R,L,U,F,q,z,K,G,V,H,N,k,J=n[0],X=n[1],ie=n[2],De=n[3],oe=n[4],Se=n[5],Be=n[6],Re=n[7],Ne=t[0],Je=t[1],ve=t[2],tA=t[3],fe=t[4],Ie=t[5],Xe=t[6],je=t[7],be=0;a>=128;){for(q=0;q<16;q++)z=8*q+be,e[q]=o[z+0]<<24|o[z+1]<<16|o[z+2]<<8|o[z+3],i[q]=o[z+4]<<24|o[z+5]<<16|o[z+6]<<8|o[z+7];for(q=0;q<80;q++)if(A=J,r=X,s=ie,g=De,c=oe,I=Se,p=Be,B=Re,f=Ne,Q=Je,y=ve,m=tA,T=fe,_=Ie,R=Xe,L=je,K=Re,G=je,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=(oe>>>14|fe<<18)^(oe>>>18|fe<<14)^(fe>>>9|oe<<23),G=(fe>>>14|oe<<18)^(fe>>>18|oe<<14)^(oe>>>9|fe<<23),V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,K=oe&Se^~oe&Be,G=fe&Ie^~fe&Xe,V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,K=TX[q*2],G=TX[q*2+1],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,K=e[q%16],G=i[q%16],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,U=N&65535|k<<16,F=V&65535|H<<16,K=U,G=F,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=(J>>>28|Ne<<4)^(Ne>>>2|J<<30)^(Ne>>>7|J<<25),G=(Ne>>>28|J<<4)^(J>>>2|Ne<<30)^(J>>>7|Ne<<25),V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,K=J&X^J&ie^X&ie,G=Ne&Je^Ne&ve^Je&ve,V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,B=N&65535|k<<16,L=V&65535|H<<16,K=g,G=m,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=U,G=F,V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,g=N&65535|k<<16,m=V&65535|H<<16,X=A,ie=r,De=s,oe=g,Se=c,Be=I,Re=p,J=B,Je=f,ve=Q,tA=y,fe=m,Ie=T,Xe=_,je=R,Ne=L,q%16===15)for(z=0;z<16;z++)K=e[z],G=i[z],V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=e[(z+9)%16],G=i[(z+9)%16],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,U=e[(z+1)%16],F=i[(z+1)%16],K=(U>>>1|F<<31)^(U>>>8|F<<24)^U>>>7,G=(F>>>1|U<<31)^(F>>>8|U<<24)^(F>>>7|U<<25),V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,U=e[(z+14)%16],F=i[(z+14)%16],K=(U>>>19|F<<13)^(F>>>29|U<<3)^U>>>6,G=(F>>>19|U<<13)^(U>>>29|F<<3)^(F>>>6|U<<26),V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,e[z]=N&65535|k<<16,i[z]=V&65535|H<<16;K=J,G=Ne,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[0],G=t[0],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[0]=J=N&65535|k<<16,t[0]=Ne=V&65535|H<<16,K=X,G=Je,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[1],G=t[1],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[1]=X=N&65535|k<<16,t[1]=Je=V&65535|H<<16,K=ie,G=ve,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[2],G=t[2],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[2]=ie=N&65535|k<<16,t[2]=ve=V&65535|H<<16,K=De,G=tA,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[3],G=t[3],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[3]=De=N&65535|k<<16,t[3]=tA=V&65535|H<<16,K=oe,G=fe,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[4],G=t[4],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[4]=oe=N&65535|k<<16,t[4]=fe=V&65535|H<<16,K=Se,G=Ie,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[5],G=t[5],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[5]=Se=N&65535|k<<16,t[5]=Ie=V&65535|H<<16,K=Be,G=Xe,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[6],G=t[6],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[6]=Be=N&65535|k<<16,t[6]=Xe=V&65535|H<<16,K=Re,G=je,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[7],G=t[7],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[7]=Re=N&65535|k<<16,t[7]=je=V&65535|H<<16,be+=128,a-=128}return a}function NB(n,t,o){var a=new Int32Array(8),e=new Int32Array(8),i=new Uint8Array(256),A,r=o;for(a[0]=1779033703,a[1]=3144134277,a[2]=1013904242,a[3]=2773480762,a[4]=1359893119,a[5]=2600822924,a[6]=528734635,a[7]=1541459225,e[0]=4089235720,e[1]=2227873595,e[2]=4271175723,e[3]=1595750129,e[4]=2917565137,e[5]=725511199,e[6]=4215389547,e[7]=327033209,NX(a,e,t,o),o%=128,A=0;A=0;--e)a=o[e/8|0]>>(e&7)&1,RX(n,t,a),VF(t,n),VF(n,n),RX(n,t,a)}function dD(n,t){var o=[dA(),dA(),dA(),dA()];Wc(o[0],OX),Wc(o[1],bX),Wc(o[2],mh),dt(o[3],OX,bX),FX(n,o,t)}var qF=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function $F(n,t){var o,a,e,i;for(a=63;a>=32;--a){for(o=0,e=a-32,i=a-12;e>8,t[e]-=o*256;t[e]+=o,t[a]=0}for(o=0,e=0;e<32;e++)t[e]+=o-(t[31]>>4)*qF[e],o=t[e]>>8,t[e]&=255;for(e=0;e<32;e++)t[e]-=o*qF[e];for(a=0;a<32;a++)t[a+1]+=t[a]>>8,n[a]=t[a]&255}function RB(n){var t=new Float64Array(64),o;for(o=0;o<64;o++)t[o]=n[o];for(o=0;o<64;o++)n[o]=0;$F(n,t)}function _Ke(n,t,o,a){var e=new Uint8Array(64),i=new Uint8Array(64),A,r,s=new Float64Array(64),g=[dA(),dA(),dA(),dA()];for(A=0;A>7&&Yn(n[0],zF,n[0]),dt(n[3],n[0],n[1]),0)}function RKe(n,t,o,a){var e,i,A=new Uint8Array(32),r=new Uint8Array(64),s=[dA(),dA(),dA(),dA()],g=[dA(),dA(),dA(),dA()];if(i=-1,o<64||NKe(g,a))return-1;for(e=0;e=0}xg.verify=LKe;function UKe(n){if(Zc(n),n.length!==32)throw new Error("wrong seed length");for(var t=new Uint8Array(32),o=new Uint8Array(32),a=0;a<32;a++)t[a]=n[a];return MKe(o,t),t[0]&=248,t[31]&=127,t[31]|=64,o[31]&=127,{public:o,private:t}}xg.generateKeyPair=UKe;xg.default={}});var Xc=ee(Dh=>{"use strict";var kB=UX(),wh=$e("crypto"),eL=Buffer.from([48,42,48,5,6,3,43,101,110,3,33,0]),AL=Buffer.from([48,46,2,1,0,48,5,6,3,43,101,110,4,34,4,32]),HKe=Buffer.from([5]),tL=function(n){return Buffer.concat([HKe,n])};function HX(n){if(n===void 0)throw new Error("Undefined private key");if(!(n instanceof Buffer))throw new Error(`Invalid private key type: ${n.constructor.name}`);if(n.byteLength!=32)throw new Error(`Incorrect private key length: ${n.byteLength}`)}function KX(n){if(!(n instanceof Buffer))throw new Error(`Invalid public key type: ${n.constructor.name}`);if(n===void 0||(n.byteLength!=33||n[0]!=5)&&n.byteLength!=32)throw new Error("Invalid public key");return n.byteLength==33?n.slice(1):(console.error("WARNING: Expected pubkey of length 33, please report the ST and client that generated the pubkey"),n)}function KKe(n){let t=new Uint8Array(n);return t[0]|=6,t[31]|=128,t[31]&=-65,t}Dh.getPublicFromPrivateKey=function(n){let t=KKe(n),o=kB.generateKeyPair(t);return tL(Buffer.from(o.public))};Dh.generateKeyPair=function(){try{let{publicKey:n,privateKey:t}=wh.generateKeyPairSync("x25519",{publicKeyEncoding:{format:"der",type:"spki"},privateKeyEncoding:{format:"der",type:"pkcs8"}}),o=n.slice(eL.length,eL.length+32),a=t.slice(AL.length,AL.length+32);return{pubKey:tL(o),privKey:a}}catch{let t=kB.generateKeyPair(wh.randomBytes(32));return{privKey:Buffer.from(t.private),pubKey:tL(Buffer.from(t.public))}}};Dh.calculateAgreement=function(n,t){if(n=KX(n),HX(t),!n||n.byteLength!=32)throw new Error("Invalid public key");if(typeof wh.diffieHellman=="function"){let o=wh.createPrivateKey({key:Buffer.concat([AL,t]),format:"der",type:"pkcs8"}),a=wh.createPublicKey({key:Buffer.concat([eL,n]),format:"der",type:"spki"});return wh.diffieHellman({privateKey:o,publicKey:a})}else{let o=kB.sharedKey(t,n);return Buffer.from(o)}};Dh.calculateSignature=function(n,t){if(HX(n),!t)throw new Error("Invalid message");return Buffer.from(kB.sign(n,t))};Dh.verifySignature=function(n,t,o,a){if(n=KX(n),!n||n.byteLength!=32)throw new Error("Invalid public key");if(!t)throw new Error("Invalid message");if(!o||o.byteLength!=64)throw new Error("Invalid signature");return a?!0:kB.verify(n,t,o)}});var YX=ee(vB=>{var hD=Xc(),xKe=$e("crypto");function xX(n){return typeof n=="number"&&n%1===0&&n>=0}vB.generateIdentityKeyPair=hD.generateKeyPair;vB.generateRegistrationId=function(){var n=Uint16Array.from(xKe.randomBytes(2))[0];return n&16383};vB.generateSignedPreKey=function(n,t){if(!(n.privKey instanceof Buffer)||n.privKey.byteLength!=32||!(n.pubKey instanceof Buffer)||n.pubKey.byteLength!=33)throw new TypeError("Invalid argument for identityKeyPair");if(!xX(t))throw new TypeError("Invalid argument for signedKeyId: "+t);let o=hD.generateKeyPair(),a=hD.calculateSignature(n.privKey,o.pubKey);return{keyId:t,keyPair:o,signature:a}};vB.generatePreKey=function(n){if(!xX(n))throw new TypeError("Invalid argument for keyId: "+n);let t=hD.generateKeyPair();return{keyId:n,keyPair:t}}});var iL=ee((_mA,jX)=>{var rL=class n{static from(t){if(typeof t!="string"||!t.match(/.*\.\d+/))throw new Error("Invalid address encoding");let o=t.split(".");return new this(o[0],parseInt(o[1]))}constructor(t,o){if(typeof t!="string")throw new TypeError("id required for addr");if(t.indexOf(".")!==-1)throw new TypeError("encoded addr detected");if(this.id=t,typeof o!="number")throw new TypeError("number required for deviceId");this.deviceId=o}toString(){return`${this.id}.${this.deviceId}`}is(t){return t instanceof n?t.id===this.id&&t.deviceId===this.deviceId:!1}};jX.exports=rL});var aL=ee((TmA,JX)=>{var YKe={OURS:1,THEIRS:2};JX.exports=YKe});var oL=ee((NmA,qX)=>{var jKe={SENDING:1,RECEIVING:2};qX.exports=jKe});var BD=ee((RmA,VX)=>{var JKe=aL(),qKe=40,zX="v1";function uD(n){if(!Buffer.isBuffer(n))throw new TypeError("Buffer required")}var CD=class{constructor(){this._chains={}}toString(){return``}inspect(){return this.toString()}addChain(t,o){uD(t);let a=t.toString("base64");if(this._chains.hasOwnProperty(a))throw new Error("Overwrite attempt");this._chains[a]=o}getChain(t){return uD(t),this._chains[t.toString("base64")]}deleteChain(t){uD(t);let o=t.toString("base64");if(!this._chains.hasOwnProperty(o))throw new ReferenceError("Not Found");delete this._chains[o]}*chains(){for(let[t,o]of Object.entries(this._chains))yield[Buffer.from(t,"base64"),o]}serialize(){let t={registrationId:this.registrationId,currentRatchet:{ephemeralKeyPair:{pubKey:this.currentRatchet.ephemeralKeyPair.pubKey.toString("base64"),privKey:this.currentRatchet.ephemeralKeyPair.privKey.toString("base64")},lastRemoteEphemeralKey:this.currentRatchet.lastRemoteEphemeralKey.toString("base64"),previousCounter:this.currentRatchet.previousCounter,rootKey:this.currentRatchet.rootKey.toString("base64")},indexInfo:{baseKey:this.indexInfo.baseKey.toString("base64"),baseKeyType:this.indexInfo.baseKeyType,closed:this.indexInfo.closed,used:this.indexInfo.used,created:this.indexInfo.created,remoteIdentityKey:this.indexInfo.remoteIdentityKey.toString("base64")},_chains:this._serialize_chains(this._chains)};return this.pendingPreKey&&(t.pendingPreKey=Object.assign({},this.pendingPreKey),t.pendingPreKey.baseKey=this.pendingPreKey.baseKey.toString("base64")),t}static deserialize(t){let o=new this;return o.registrationId=t.registrationId,o.currentRatchet={ephemeralKeyPair:{pubKey:Buffer.from(t.currentRatchet.ephemeralKeyPair.pubKey,"base64"),privKey:Buffer.from(t.currentRatchet.ephemeralKeyPair.privKey,"base64")},lastRemoteEphemeralKey:Buffer.from(t.currentRatchet.lastRemoteEphemeralKey,"base64"),previousCounter:t.currentRatchet.previousCounter,rootKey:Buffer.from(t.currentRatchet.rootKey,"base64")},o.indexInfo={baseKey:Buffer.from(t.indexInfo.baseKey,"base64"),baseKeyType:t.indexInfo.baseKeyType,closed:t.indexInfo.closed,used:t.indexInfo.used,created:t.indexInfo.created,remoteIdentityKey:Buffer.from(t.indexInfo.remoteIdentityKey,"base64")},o._chains=this._deserialize_chains(t._chains),t.pendingPreKey&&(o.pendingPreKey=Object.assign({},t.pendingPreKey),o.pendingPreKey.baseKey=Buffer.from(t.pendingPreKey.baseKey,"base64")),o}_serialize_chains(t){let o={};for(let a of Object.keys(t)){let e=t[a],i={};for(let[A,r]of Object.entries(e.messageKeys))i[A]=r.toString("base64");o[a]={chainKey:{counter:e.chainKey.counter,key:e.chainKey.key&&e.chainKey.key.toString("base64")},chainType:e.chainType,messageKeys:i}}return o}static _deserialize_chains(t){let o={};for(let a of Object.keys(t)){let e=t[a],i={};for(let[A,r]of Object.entries(e.messageKeys))i[A]=Buffer.from(r,"base64");o[a]={chainKey:{counter:e.chainKey.counter,key:e.chainKey.key&&Buffer.from(e.chainKey.key,"base64")},chainType:e.chainType,messageKeys:i}}return o}},ED=[{version:"v1",migrate:function(t){let o=t._sessions;if(t.registrationId)for(let a in o)o[a].registrationId||(o[a].registrationId=t.registrationId);else for(let a in o)o[a].indexInfo.closed===-1&&console.error("V1 session storage migration error: registrationId",t.registrationId,"for open session version",t.version)}}],nL=class{static createEntry(){return new CD}static migrate(t){let o=t.version===void 0;for(let a=0;a{let a=t.indexInfo.used||0,e=o.indexInfo.used||0;return a===e?0:aqKe;){let t,o;for(let[a,e]of Object.entries(this.sessions))e.indexInfo.closed!==-1&&(!o||e.indexInfo.closed{ks.SignalError=class extends Error{};ks.UntrustedIdentityKeyError=class extends ks.SignalError{constructor(t,o){super(),this.name="UntrustedIdentityKeyError",this.addr=t,this.identityKey=o}};ks.SessionError=class extends ks.SignalError{constructor(t){super(t),this.name="SessionError"}};ks.MessageCounterError=class extends ks.SessionError{constructor(t){super(t),this.name="MessageCounterError"}};ks.PreKeyError=class extends ks.SessionError{constructor(t){super(t),this.name="PreKeyError"}}});var sL=ee((UmA,ZX)=>{"use strict";var QD=new Map,WX=1e4;async function zKe(n,t){let o=0;for(;;){let a=Math.min(n.length,WX);for(let e=o;e=WX?(n.splice(0,a),o=0):o=a;else break}t()}ZX.exports=function(n,t){t.name||(Object.defineProperty(t,"name",{writable:!0}),typeof n=="string"?t.name=n:console.warn("Unhandled bucket type (for naming):",typeof n,n));let o;QD.has(n)||(QD.set(n,[]),o=!0);let a=QD.get(n),e=new Promise((i,A)=>a.push({awaitable:t,resolve:i,reject:A}));return o&&zKe(a,()=>QD.delete(n)),e}});var cL=ee((HmA,A7)=>{"use strict";var XX=aL(),VKe=oL(),$X=BD(),e7=Kl(),$c=Xc(),yD=fD(),WKe=sL(),gL=class{constructor(t,o){this.addr=o,this.storage=t}async initOutgoing(t){let o=this.addr.toString();return await WKe(o,async()=>{if(!await this.storage.isTrustedIdentity(this.addr.id,t.identityKey))throw new yD.UntrustedIdentityKeyError(this.addr.id,t.identityKey);$c.verifySignature(t.identityKey,t.signedPreKey.publicKey,t.signedPreKey.signature,!0);let a=$c.generateKeyPair(),e=t.preKey&&t.preKey.publicKey,i=await this.initSession(!0,a,void 0,t.identityKey,e,t.signedPreKey.publicKey,t.registrationId);i.pendingPreKey={signedKeyId:t.signedPreKey.keyId,baseKey:a.pubKey},t.preKey&&(i.pendingPreKey.preKeyId=t.preKey.keyId);let A=await this.storage.loadSession(o);if(!A)A=new $X;else{let r=A.getOpenSession();r&&A.closeSession(r)}A.setSession(i),await this.storage.storeSession(o,A)})}async initIncoming(t,o){let a=this.addr.toString();if(!await this.storage.isTrustedIdentity(a,o.identityKey))throw new yD.UntrustedIdentityKeyError(this.addr.id,o.identityKey);if(t.getSession(o.baseKey))return;let e=await this.storage.loadPreKey(o.preKeyId);if(o.preKeyId&&!e)throw new yD.PreKeyError("Invalid PreKey ID");let i=await this.storage.loadSignedPreKey(o.signedPreKeyId);if(!i)throw new yD.PreKeyError("Missing SignedPreKey");let A=t.getOpenSession();return A&&(console.warn("Closing open session in favor of incoming prekey bundle"),t.closeSession(A)),t.setSession(await this.initSession(!1,e,i,o.identityKey,o.baseKey,void 0,o.registrationId)),o.preKeyId}async initSession(t,o,a,e,i,A,r){if(t){if(a)throw new Error("Invalid call to initSession");a=o}else{if(A)throw new Error("Invalid call to initSession");A=i}let s;!o||!i?s=new Uint8Array(128):s=new Uint8Array(160);for(var g=0;g<32;g++)s[g]=255;let c=await this.storage.getOurIdentity(),I=$c.calculateAgreement(A,c.privKey),p=$c.calculateAgreement(e,a.privKey),B=$c.calculateAgreement(A,a.privKey);if(t?(s.set(new Uint8Array(I),32),s.set(new Uint8Array(p),64)):(s.set(new Uint8Array(I),64),s.set(new Uint8Array(p),32)),s.set(new Uint8Array(B),96),o&&i){let y=$c.calculateAgreement(i,o.privKey);s.set(new Uint8Array(y),128)}let f=e7.deriveSecrets(Buffer.from(s),Buffer.alloc(32),Buffer.from("WhisperText")),Q=$X.createEntry();return Q.registrationId=r,Q.currentRatchet={rootKey:f[0],ephemeralKeyPair:t?$c.generateKeyPair():a,lastRemoteEphemeralKey:A,previousCounter:0},Q.indexInfo={created:Date.now(),used:Date.now(),remoteIdentityKey:e,baseKey:t?o.pubKey:i,baseKeyType:t?XX.OURS:XX.THEIRS,closed:-1},t&&this.calculateSendingRatchet(Q,A),Q}calculateSendingRatchet(t,o){let a=t.currentRatchet,e=$c.calculateAgreement(o,a.ephemeralKeyPair.privKey),i=e7.deriveSecrets(e,a.rootKey,Buffer.from("WhisperRatchet"));t.addChain(a.ephemeralKeyPair.pubKey,{messageKeys:{},chainKey:{counter:-1,key:i[1]},chainType:VKe.SENDING}),a.rootKey=i[0]}};A7.exports=gL});var r7=ee((KmA,t7)=>{"use strict";var eI=tS(),en=eI.Reader,IL=eI.Writer,nA=eI.util,jn=eI.roots.default||(eI.roots.default={});jn.textsecure=(function(){var n={};return n.WhisperMessage=(function(){function t(o){if(o)for(var a=Object.keys(o),e=0;e>>3){case 1:A.ephemeralKey=a.bytes();break;case 2:A.counter=a.uint32();break;case 3:A.previousCounter=a.uint32();break;case 4:A.ciphertext=a.bytes();break;default:a.skipType(r&7);break}}return A},t.decodeDelimited=function(a){return a instanceof en||(a=new en(a)),this.decode(a,a.uint32())},t.verify=function(a){return typeof a!="object"||a===null?"object expected":a.ephemeralKey!=null&&a.hasOwnProperty("ephemeralKey")&&!(a.ephemeralKey&&typeof a.ephemeralKey.length=="number"||nA.isString(a.ephemeralKey))?"ephemeralKey: buffer expected":a.counter!=null&&a.hasOwnProperty("counter")&&!nA.isInteger(a.counter)?"counter: integer expected":a.previousCounter!=null&&a.hasOwnProperty("previousCounter")&&!nA.isInteger(a.previousCounter)?"previousCounter: integer expected":a.ciphertext!=null&&a.hasOwnProperty("ciphertext")&&!(a.ciphertext&&typeof a.ciphertext.length=="number"||nA.isString(a.ciphertext))?"ciphertext: buffer expected":null},t.fromObject=function(a){if(a instanceof jn.textsecure.WhisperMessage)return a;var e=new jn.textsecure.WhisperMessage;return a.ephemeralKey!=null&&(typeof a.ephemeralKey=="string"?nA.base64.decode(a.ephemeralKey,e.ephemeralKey=nA.newBuffer(nA.base64.length(a.ephemeralKey)),0):a.ephemeralKey.length&&(e.ephemeralKey=a.ephemeralKey)),a.counter!=null&&(e.counter=a.counter>>>0),a.previousCounter!=null&&(e.previousCounter=a.previousCounter>>>0),a.ciphertext!=null&&(typeof a.ciphertext=="string"?nA.base64.decode(a.ciphertext,e.ciphertext=nA.newBuffer(nA.base64.length(a.ciphertext)),0):a.ciphertext.length&&(e.ciphertext=a.ciphertext)),e},t.toObject=function(a,e){e||(e={});var i={};return e.defaults&&(e.bytes===String?i.ephemeralKey="":(i.ephemeralKey=[],e.bytes!==Array&&(i.ephemeralKey=nA.newBuffer(i.ephemeralKey))),i.counter=0,i.previousCounter=0,e.bytes===String?i.ciphertext="":(i.ciphertext=[],e.bytes!==Array&&(i.ciphertext=nA.newBuffer(i.ciphertext)))),a.ephemeralKey!=null&&a.hasOwnProperty("ephemeralKey")&&(i.ephemeralKey=e.bytes===String?nA.base64.encode(a.ephemeralKey,0,a.ephemeralKey.length):e.bytes===Array?Array.prototype.slice.call(a.ephemeralKey):a.ephemeralKey),a.counter!=null&&a.hasOwnProperty("counter")&&(i.counter=a.counter),a.previousCounter!=null&&a.hasOwnProperty("previousCounter")&&(i.previousCounter=a.previousCounter),a.ciphertext!=null&&a.hasOwnProperty("ciphertext")&&(i.ciphertext=e.bytes===String?nA.base64.encode(a.ciphertext,0,a.ciphertext.length):e.bytes===Array?Array.prototype.slice.call(a.ciphertext):a.ciphertext),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,eI.util.toJSONOptions)},t})(),n.PreKeyWhisperMessage=(function(){function t(o){if(o)for(var a=Object.keys(o),e=0;e>>3){case 5:A.registrationId=a.uint32();break;case 1:A.preKeyId=a.uint32();break;case 6:A.signedPreKeyId=a.uint32();break;case 2:A.baseKey=a.bytes();break;case 3:A.identityKey=a.bytes();break;case 4:A.message=a.bytes();break;default:a.skipType(r&7);break}}return A},t.decodeDelimited=function(a){return a instanceof en||(a=new en(a)),this.decode(a,a.uint32())},t.verify=function(a){return typeof a!="object"||a===null?"object expected":a.registrationId!=null&&a.hasOwnProperty("registrationId")&&!nA.isInteger(a.registrationId)?"registrationId: integer expected":a.preKeyId!=null&&a.hasOwnProperty("preKeyId")&&!nA.isInteger(a.preKeyId)?"preKeyId: integer expected":a.signedPreKeyId!=null&&a.hasOwnProperty("signedPreKeyId")&&!nA.isInteger(a.signedPreKeyId)?"signedPreKeyId: integer expected":a.baseKey!=null&&a.hasOwnProperty("baseKey")&&!(a.baseKey&&typeof a.baseKey.length=="number"||nA.isString(a.baseKey))?"baseKey: buffer expected":a.identityKey!=null&&a.hasOwnProperty("identityKey")&&!(a.identityKey&&typeof a.identityKey.length=="number"||nA.isString(a.identityKey))?"identityKey: buffer expected":a.message!=null&&a.hasOwnProperty("message")&&!(a.message&&typeof a.message.length=="number"||nA.isString(a.message))?"message: buffer expected":null},t.fromObject=function(a){if(a instanceof jn.textsecure.PreKeyWhisperMessage)return a;var e=new jn.textsecure.PreKeyWhisperMessage;return a.registrationId!=null&&(e.registrationId=a.registrationId>>>0),a.preKeyId!=null&&(e.preKeyId=a.preKeyId>>>0),a.signedPreKeyId!=null&&(e.signedPreKeyId=a.signedPreKeyId>>>0),a.baseKey!=null&&(typeof a.baseKey=="string"?nA.base64.decode(a.baseKey,e.baseKey=nA.newBuffer(nA.base64.length(a.baseKey)),0):a.baseKey.length&&(e.baseKey=a.baseKey)),a.identityKey!=null&&(typeof a.identityKey=="string"?nA.base64.decode(a.identityKey,e.identityKey=nA.newBuffer(nA.base64.length(a.identityKey)),0):a.identityKey.length&&(e.identityKey=a.identityKey)),a.message!=null&&(typeof a.message=="string"?nA.base64.decode(a.message,e.message=nA.newBuffer(nA.base64.length(a.message)),0):a.message.length&&(e.message=a.message)),e},t.toObject=function(a,e){e||(e={});var i={};return e.defaults&&(i.preKeyId=0,e.bytes===String?i.baseKey="":(i.baseKey=[],e.bytes!==Array&&(i.baseKey=nA.newBuffer(i.baseKey))),e.bytes===String?i.identityKey="":(i.identityKey=[],e.bytes!==Array&&(i.identityKey=nA.newBuffer(i.identityKey))),e.bytes===String?i.message="":(i.message=[],e.bytes!==Array&&(i.message=nA.newBuffer(i.message))),i.registrationId=0,i.signedPreKeyId=0),a.preKeyId!=null&&a.hasOwnProperty("preKeyId")&&(i.preKeyId=a.preKeyId),a.baseKey!=null&&a.hasOwnProperty("baseKey")&&(i.baseKey=e.bytes===String?nA.base64.encode(a.baseKey,0,a.baseKey.length):e.bytes===Array?Array.prototype.slice.call(a.baseKey):a.baseKey),a.identityKey!=null&&a.hasOwnProperty("identityKey")&&(i.identityKey=e.bytes===String?nA.base64.encode(a.identityKey,0,a.identityKey.length):e.bytes===Array?Array.prototype.slice.call(a.identityKey):a.identityKey),a.message!=null&&a.hasOwnProperty("message")&&(i.message=e.bytes===String?nA.base64.encode(a.message,0,a.message.length):e.bytes===Array?Array.prototype.slice.call(a.message):a.message),a.registrationId!=null&&a.hasOwnProperty("registrationId")&&(i.registrationId=a.registrationId),a.signedPreKeyId!=null&&a.hasOwnProperty("signedPreKeyId")&&(i.signedPreKeyId=a.signedPreKeyId),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,eI.util.toJSONOptions)},t})(),n.KeyExchangeMessage=(function(){function t(o){if(o)for(var a=Object.keys(o),e=0;e>>3){case 1:A.id=a.uint32();break;case 2:A.baseKey=a.bytes();break;case 3:A.ephemeralKey=a.bytes();break;case 4:A.identityKey=a.bytes();break;case 5:A.baseKeySignature=a.bytes();break;default:a.skipType(r&7);break}}return A},t.decodeDelimited=function(a){return a instanceof en||(a=new en(a)),this.decode(a,a.uint32())},t.verify=function(a){return typeof a!="object"||a===null?"object expected":a.id!=null&&a.hasOwnProperty("id")&&!nA.isInteger(a.id)?"id: integer expected":a.baseKey!=null&&a.hasOwnProperty("baseKey")&&!(a.baseKey&&typeof a.baseKey.length=="number"||nA.isString(a.baseKey))?"baseKey: buffer expected":a.ephemeralKey!=null&&a.hasOwnProperty("ephemeralKey")&&!(a.ephemeralKey&&typeof a.ephemeralKey.length=="number"||nA.isString(a.ephemeralKey))?"ephemeralKey: buffer expected":a.identityKey!=null&&a.hasOwnProperty("identityKey")&&!(a.identityKey&&typeof a.identityKey.length=="number"||nA.isString(a.identityKey))?"identityKey: buffer expected":a.baseKeySignature!=null&&a.hasOwnProperty("baseKeySignature")&&!(a.baseKeySignature&&typeof a.baseKeySignature.length=="number"||nA.isString(a.baseKeySignature))?"baseKeySignature: buffer expected":null},t.fromObject=function(a){if(a instanceof jn.textsecure.KeyExchangeMessage)return a;var e=new jn.textsecure.KeyExchangeMessage;return a.id!=null&&(e.id=a.id>>>0),a.baseKey!=null&&(typeof a.baseKey=="string"?nA.base64.decode(a.baseKey,e.baseKey=nA.newBuffer(nA.base64.length(a.baseKey)),0):a.baseKey.length&&(e.baseKey=a.baseKey)),a.ephemeralKey!=null&&(typeof a.ephemeralKey=="string"?nA.base64.decode(a.ephemeralKey,e.ephemeralKey=nA.newBuffer(nA.base64.length(a.ephemeralKey)),0):a.ephemeralKey.length&&(e.ephemeralKey=a.ephemeralKey)),a.identityKey!=null&&(typeof a.identityKey=="string"?nA.base64.decode(a.identityKey,e.identityKey=nA.newBuffer(nA.base64.length(a.identityKey)),0):a.identityKey.length&&(e.identityKey=a.identityKey)),a.baseKeySignature!=null&&(typeof a.baseKeySignature=="string"?nA.base64.decode(a.baseKeySignature,e.baseKeySignature=nA.newBuffer(nA.base64.length(a.baseKeySignature)),0):a.baseKeySignature.length&&(e.baseKeySignature=a.baseKeySignature)),e},t.toObject=function(a,e){e||(e={});var i={};return e.defaults&&(i.id=0,e.bytes===String?i.baseKey="":(i.baseKey=[],e.bytes!==Array&&(i.baseKey=nA.newBuffer(i.baseKey))),e.bytes===String?i.ephemeralKey="":(i.ephemeralKey=[],e.bytes!==Array&&(i.ephemeralKey=nA.newBuffer(i.ephemeralKey))),e.bytes===String?i.identityKey="":(i.identityKey=[],e.bytes!==Array&&(i.identityKey=nA.newBuffer(i.identityKey))),e.bytes===String?i.baseKeySignature="":(i.baseKeySignature=[],e.bytes!==Array&&(i.baseKeySignature=nA.newBuffer(i.baseKeySignature)))),a.id!=null&&a.hasOwnProperty("id")&&(i.id=a.id),a.baseKey!=null&&a.hasOwnProperty("baseKey")&&(i.baseKey=e.bytes===String?nA.base64.encode(a.baseKey,0,a.baseKey.length):e.bytes===Array?Array.prototype.slice.call(a.baseKey):a.baseKey),a.ephemeralKey!=null&&a.hasOwnProperty("ephemeralKey")&&(i.ephemeralKey=e.bytes===String?nA.base64.encode(a.ephemeralKey,0,a.ephemeralKey.length):e.bytes===Array?Array.prototype.slice.call(a.ephemeralKey):a.ephemeralKey),a.identityKey!=null&&a.hasOwnProperty("identityKey")&&(i.identityKey=e.bytes===String?nA.base64.encode(a.identityKey,0,a.identityKey.length):e.bytes===Array?Array.prototype.slice.call(a.identityKey):a.identityKey),a.baseKeySignature!=null&&a.hasOwnProperty("baseKeySignature")&&(i.baseKeySignature=e.bytes===String?nA.base64.encode(a.baseKeySignature,0,a.baseKeySignature.length):e.bytes===Array?Array.prototype.slice.call(a.baseKeySignature):a.baseKeySignature),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,eI.util.toJSONOptions)},t})(),n})();t7.exports=jn});var lL=ee((xmA,i7)=>{"use strict";var{textsecure:{WhisperMessage:ZKe,PreKeyWhisperMessage:XKe}}=r7();i7.exports={WhisperMessage:ZKe,PreKeyWhisperMessage:XKe}});var s7=ee((YmA,n7)=>{var mD=oL(),$Ke=iL(),exe=cL(),a7=BD(),Yg=Kl(),o7=Xc(),vs=fD(),Oh=lL(),Axe=sL(),AI=3;function SD(n){if(!(n instanceof Buffer))throw TypeError(`Expected Buffer instead of: ${n.constructor.name}`);return n}var pL=class{constructor(t,o){if(!(o instanceof $Ke))throw new TypeError("protocolAddress must be a ProtocolAddress");this.addr=o,this.storage=t}_encodeTupleByte(t,o){if(t>15||o>15)throw TypeError("Numbers must be 4 bits or less");return t<<4|o}_decodeTupleByte(t){return[t>>4,t&15]}toString(){return``}async getRecord(){let t=await this.storage.loadSession(this.addr.toString());if(t&&!(t instanceof a7))throw new TypeError("SessionRecord type expected from loadSession");return t}async storeRecord(t){t.removeOldSessions(),await this.storage.storeSession(this.addr.toString(),t)}async queueJob(t){return await Axe(this.addr.toString(),t)}async encrypt(t){SD(t);let o=await this.storage.getOurIdentity();return await this.queueJob(async()=>{let a=await this.getRecord();if(!a)throw new vs.SessionError("No sessions");let e=a.getOpenSession();if(!e)throw new vs.SessionError("No open session");let i=e.indexInfo.remoteIdentityKey;if(!await this.storage.isTrustedIdentity(this.addr.id,i))throw new vs.UntrustedIdentityKeyError(this.addr.id,i);let A=e.getChain(e.currentRatchet.ephemeralKeyPair.pubKey);if(A.chainType===mD.RECEIVING)throw new Error("Tried to encrypt on a receiving chain");this.fillMessageKeys(A,A.chainKey.counter+1);let r=Yg.deriveSecrets(A.messageKeys[A.chainKey.counter],Buffer.alloc(32),Buffer.from("WhisperMessageKeys"));delete A.messageKeys[A.chainKey.counter];let s=Oh.WhisperMessage.create();s.ephemeralKey=e.currentRatchet.ephemeralKeyPair.pubKey,s.counter=A.chainKey.counter,s.previousCounter=e.currentRatchet.previousCounter,s.ciphertext=Yg.encrypt(r[0],t,r[2].slice(0,16));let g=Oh.WhisperMessage.encode(s).finish(),c=Buffer.alloc(g.byteLength+66+1);c.set(o.pubKey),c.set(e.indexInfo.remoteIdentityKey,33),c[66]=this._encodeTupleByte(AI,AI),c.set(g,67);let I=Yg.calculateMAC(r[1],c),p=Buffer.alloc(g.byteLength+9);p[0]=this._encodeTupleByte(AI,AI),p.set(g,1),p.set(I.slice(0,8),g.byteLength+1),await this.storeRecord(a);let B,f;if(e.pendingPreKey){B=3;let Q=Oh.PreKeyWhisperMessage.create({identityKey:o.pubKey,registrationId:await this.storage.getOurRegistrationId(),baseKey:e.pendingPreKey.baseKey,signedPreKeyId:e.pendingPreKey.signedKeyId,message:p});e.pendingPreKey.preKeyId&&(Q.preKeyId=e.pendingPreKey.preKeyId),f=Buffer.concat([Buffer.from([this._encodeTupleByte(AI,AI)]),Buffer.from(Oh.PreKeyWhisperMessage.encode(Q).finish())])}else B=1,f=p;return{type:B,body:f,registrationId:e.registrationId}})}async decryptWithSessions(t,o){if(!o.length)throw new vs.SessionError("No sessions available");let a=[];for(let e of o){let i;try{return i=await this.doDecryptWhisperMessage(t,e),e.indexInfo.used=Date.now(),{session:e,plaintext:i}}catch(A){a.push(A)}}console.error("Failed to decrypt message with any known session...");for(let e of a)console.error("Session error:"+e,e.stack);throw new vs.SessionError("No matching sessions found for message")}async decryptWhisperMessage(t){return SD(t),await this.queueJob(async()=>{let o=await this.getRecord();if(!o)throw new vs.SessionError("No session record");let a=await this.decryptWithSessions(t,o.getSessions()),e=a.session.indexInfo.remoteIdentityKey;if(!await this.storage.isTrustedIdentity(this.addr.id,e))throw new vs.UntrustedIdentityKeyError(this.addr.id,e);return o.isClosed(a.session)&&console.warn("Decrypted message with closed session."),await this.storeRecord(o),a.plaintext})}async decryptPreKeyWhisperMessage(t){SD(t);let o=this._decodeTupleByte(t[0]);if(o[1]>3||o[0]<3)throw new Error("Incompatible version number on PreKeyWhisperMessage");return await this.queueJob(async()=>{let a=await this.getRecord(),e=Oh.PreKeyWhisperMessage.decode(t.slice(1));if(!a){if(e.registrationId==null)throw new Error("No registrationId");a=new a7}let A=await new exe(this.storage,this.addr).initIncoming(a,e),r=a.getSession(e.baseKey),s=await this.doDecryptWhisperMessage(e.message,r);return await this.storeRecord(a),A&&await this.storage.removePreKey(A),s})}async doDecryptWhisperMessage(t,o){if(SD(t),!o)throw new TypeError("session required");let a=this._decodeTupleByte(t[0]);if(a[1]>3||a[0]<3)throw new Error("Incompatible version number on WhisperMessage");let e=t.slice(1,-8),i=Oh.WhisperMessage.decode(e);this.maybeStepRatchet(o,i.ephemeralKey,i.previousCounter);let A=o.getChain(i.ephemeralKey);if(A.chainType===mD.SENDING)throw new Error("Tried to decrypt on a sending chain");if(this.fillMessageKeys(A,i.counter),!A.messageKeys.hasOwnProperty(i.counter))throw new vs.MessageCounterError("Key used already or never filled");let r=A.messageKeys[i.counter];delete A.messageKeys[i.counter];let s=Yg.deriveSecrets(r,Buffer.alloc(32),Buffer.from("WhisperMessageKeys")),g=await this.storage.getOurIdentity(),c=Buffer.alloc(e.byteLength+66+1);c.set(o.indexInfo.remoteIdentityKey),c.set(g.pubKey,33),c[66]=this._encodeTupleByte(AI,AI),c.set(e,67),Yg.verifyMAC(c,s[1],t.slice(-8),8);let I=Yg.decrypt(s[0],i.ciphertext,s[2].slice(0,16));return delete o.pendingPreKey,I}fillMessageKeys(t,o){if(t.chainKey.counter>=o)return;if(o-t.chainKey.counter>2e3)throw new vs.SessionError("Over 2000 messages into the future!");if(t.chainKey.key===void 0)throw new vs.SessionError("Chain closed");let a=t.chainKey.key;return t.messageKeys[t.chainKey.counter+1]=Yg.calculateMAC(a,Buffer.from([1])),t.chainKey.key=Yg.calculateMAC(a,Buffer.from([2])),t.chainKey.counter+=1,this.fillMessageKeys(t,o)}maybeStepRatchet(t,o,a){if(t.getChain(o))return;let e=t.currentRatchet,i=t.getChain(e.lastRemoteEphemeralKey);i&&(this.fillMessageKeys(i,a),delete i.chainKey.key),this.calculateRatchet(t,o,!1);let A=t.getChain(e.ephemeralKeyPair.pubKey);A&&(e.previousCounter=A.chainKey.counter,t.deleteChain(e.ephemeralKeyPair.pubKey)),e.ephemeralKeyPair=o7.generateKeyPair(),this.calculateRatchet(t,o,!0),e.lastRemoteEphemeralKey=o}calculateRatchet(t,o,a){let e=t.currentRatchet,i=o7.calculateAgreement(o,e.ephemeralKeyPair.privKey),A=Yg.deriveSecrets(i,e.rootKey,Buffer.from("WhisperRatchet"),2),r=a?e.ephemeralKeyPair.pubKey:o;t.addChain(r,{messageKeys:{},chainKey:{counter:-1,key:A[1]},chainType:a?mD.SENDING:mD.RECEIVING}),e.rootKey=A[0]}async hasOpenSession(){return await this.queueJob(async()=>{let t=await this.getRecord();return t?t.haveOpenSession():!1})}async closeOpenSession(){return await this.queueJob(async()=>{let t=await this.getRecord();if(t){let o=t.getOpenSession();o&&(t.closeSession(o),await this.storeRecord(t))}})}};n7.exports=pL});var g7=ee(jg=>{"use strict";jg.crypto=Kl();jg.curve=Xc();jg.keyhelper=YX();jg.ProtocolAddress=iL();jg.SessionBuilder=cL();jg.SessionCipher=s7();jg.SessionRecord=BD();Object.assign(jg,fD())});var hL=ee((VmA,d7)=>{"use strict";d7.exports=function(...n){try{return JSON.stringify(...n)}catch(t){return"[Cannot display object: "+t.message+"]"}}});var EL=ee((h7,E7)=>{"use strict";var sxe=hL();E7.exports=class extends Error{constructor(n){let t=n.filter(o=>o!=="").map(o=>typeof o=="string"?o:o instanceof Error?o.message:sxe(o));super(t.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,h7.assert)}}});var xl=ee((ZmA,u7)=>{"use strict";var gxe=EL();u7.exports=function(n,...t){if(!n)throw t.length===1&&t[0]instanceof Error?t[0]:new gxe(t)}});var FB=ee((XmA,B7)=>{"use strict";var uL=xl(),C7={};B7.exports=function(n,t,o){if(t===!1||t===null||t===void 0)return n;o=o||{},typeof o=="string"&&(o={separator:o});let a=Array.isArray(t);uL(!a||!o.separator,"Separator option is not valid for array-based chain");let e=a?t:t.split(o.separator||"."),i=n;for(let A=0;A{"use strict";var f7={};Ba=Q7.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};f7.typeMap=new Map([["[object Error]",Ba.error],["[object Map]",Ba.map],["[object Promise]",Ba.promise],["[object Set]",Ba.set],["[object WeakMap]",Ba.weakMap],["[object WeakSet]",Ba.weakSet]]);Ba.getInternalProto=function(n){if(Array.isArray(n))return Ba.array;if(Buffer&&n instanceof Buffer)return Ba.buffer;if(n instanceof Date)return Ba.date;if(n instanceof RegExp)return Ba.regex;if(n instanceof Error)return Ba.error;let t=Object.prototype.toString.call(n);return f7.typeMap.get(t)||Ba.generic}});var DD=ee(y7=>{"use strict";y7.keys=function(n,t={}){return t.symbols!==!1?Reflect.ownKeys(n):Object.getOwnPropertyNames(n)}});var OD=ee((eSA,m7)=>{"use strict";var cxe=FB(),Co=CL(),Ixe=DD(),qg={needsProtoHack:new Set([Co.set,Co.map,Co.weakSet,Co.weakMap])};m7.exports=qg.clone=function(n,t={},o=null){if(typeof n!="object"||n===null)return n;let a=qg.clone,e=o;if(t.shallow){if(t.shallow!==!0)return qg.cloneWithShallow(n,t);a=s=>s}else if(e){let s=e.get(n);if(s)return s}else e=new Map;let i=Co.getInternalProto(n);if(i===Co.buffer)return Buffer&&Buffer.from(n);if(i===Co.date)return new Date(n.getTime());if(i===Co.regex)return new RegExp(n);let A=qg.base(n,i,t);if(A===n)return n;if(e&&e.set(n,A),i===Co.set)for(let s of n)A.add(a(s,t,e));else if(i===Co.map)for(let[s,g]of n)A.set(s,a(g,t,e));let r=Ixe.keys(n,t);for(let s of r){if(s==="__proto__")continue;if(i===Co.array&&s==="length"){A.length=n.length;continue}let g=Object.getOwnPropertyDescriptor(n,s);g?g.get||g.set?Object.defineProperty(A,s,g):g.enumerable?A[s]=a(n[s],t,e):Object.defineProperty(A,s,{enumerable:!1,writable:!0,configurable:!0,value:a(n[s],t,e)}):Object.defineProperty(A,s,{enumerable:!0,writable:!0,configurable:!0,value:a(n[s],t,e)})}return A};qg.cloneWithShallow=function(n,t){let o=t.shallow;t=Object.assign({},t),t.shallow=!1;let a=new Map;for(let e of o){let i=cxe(n,e);(typeof i=="object"||typeof i=="function")&&a.set(i,i)}return qg.clone(n,t,a)};qg.base=function(n,t,o){if(o.prototype===!1)return qg.needsProtoHack.has(t)?new t.constructor:t===Co.array?[]:{};let a=Object.getPrototypeOf(n);if(a&&a.isImmutable)return n;if(t===Co.array){let e=[];return a!==t&&Object.setPrototypeOf(e,a),e}if(qg.needsProtoHack.has(t)){let e=new a.constructor;return a!==t&&Object.setPrototypeOf(e,a),e}return Object.create(a)}});var fL=ee((ASA,D7)=>{"use strict";var BL=xl(),S7=OD(),lxe=DD(),w7={};D7.exports=w7.merge=function(n,t,o){if(BL(n&&typeof n=="object","Invalid target value: must be an object"),BL(t==null||typeof t=="object","Invalid source value: must be null, undefined, or an object"),!t)return n;if(o=Object.assign({nullOverride:!0,mergeArrays:!0},o),Array.isArray(t)){BL(Array.isArray(n),"Cannot merge array onto an object"),o.mergeArrays||(n.length=0);for(let e=0;e{"use strict";var bD=xl(),b7=OD(),M7=fL(),O7=FB(),MD={};_7.exports=function(n,t,o={}){if(bD(n&&typeof n=="object","Invalid defaults value: must be an object"),bD(!t||t===!0||typeof t=="object","Invalid source value: must be true, falsy or an object"),bD(typeof o=="object","Invalid options: must be an object"),!t)return null;if(o.shallow)return MD.applyToDefaultsWithShallow(n,t,o);let a=b7(n);if(t===!0)return a;let e=o.nullOverride!==void 0?o.nullOverride:!1;return M7(a,t,{nullOverride:e,mergeArrays:!1})};MD.applyToDefaultsWithShallow=function(n,t,o){let a=o.shallow;bD(Array.isArray(a),"Invalid keys");let e=new Map,i=t===!0?null:new Set;for(let s of a){s=Array.isArray(s)?s:s.split(".");let g=O7(n,s);g&&typeof g=="object"?e.set(g,i&&O7(t,s)||g):i&&i.add(s)}let A=b7(n,{},e);if(!i)return A;for(let s of i)MD.reachCopy(A,t,s);let r=o.nullOverride!==void 0?o.nullOverride:!1;return M7(A,t,{nullOverride:r,mergeArrays:!1})};MD.reachCopy=function(n,t,o){for(let i of o){if(!(i in t))return;let A=t[i];if(typeof A!="object"||A===null)return;t=A}let a=t,e=n;for(let i=0;i{"use strict";var QL={};N7.exports=QL.Bench=class{constructor(){this.ts=0,this.reset()}reset(){this.ts=QL.Bench.now()}elapsed(){return QL.Bench.now()-this.ts}static now(){let n=process.hrtime();return n[0]*1e3+n[1]/1e6}}});var yL=ee((aSA,k7)=>{"use strict";k7.exports=function(){}});var P7=ee((oSA,v7)=>{"use strict";var pxe=yL();v7.exports=function(){return new Promise(pxe)}});var mL=ee((nSA,G7)=>{"use strict";var Ps=CL(),sa={mismatched:null};G7.exports=function(n,t,o){return o=Object.assign({prototype:!0},o),!!sa.isDeepEqual(n,t,o,[])};sa.isDeepEqual=function(n,t,o,a){if(n===t)return n!==0||1/n===1/t;let e=typeof n;if(e!==typeof t||n===null||t===null)return!1;if(e==="function"){if(!o.deepFunction||n.toString()!==t.toString())return!1}else if(e!=="object")return n!==n&&t!==t;let i=sa.getSharedType(n,t,!!o.prototype);switch(i){case Ps.buffer:return Buffer&&Buffer.prototype.equals.call(n,t);case Ps.promise:return n===t;case Ps.regex:return n.toString()===t.toString();case sa.mismatched:return!1}for(let A=a.length-1;A>=0;--A)if(a[A].isSame(n,t))return!0;a.push(new sa.SeenEntry(n,t));try{return!!sa.isDeepEqualObj(i,n,t,o,a)}finally{a.pop()}};sa.getSharedType=function(n,t,o){if(o)return Object.getPrototypeOf(n)!==Object.getPrototypeOf(t)?sa.mismatched:Ps.getInternalProto(n);let a=Ps.getInternalProto(n);return a!==Ps.getInternalProto(t)?sa.mismatched:a};sa.valueOf=function(n){let t=n.valueOf;if(t===void 0)return n;try{return t.call(n)}catch(o){return o}};sa.hasOwnEnumerableProperty=function(n,t){return Object.prototype.propertyIsEnumerable.call(n,t)};sa.isSetSimpleEqual=function(n,t){for(let o of Set.prototype.values.call(n))if(!Set.prototype.has.call(t,o))return!1;return!0};sa.isDeepEqualObj=function(n,t,o,a,e){let{isDeepEqual:i,valueOf:A,hasOwnEnumerableProperty:r}=sa,{keys:s,getOwnPropertySymbols:g}=Object;if(n===Ps.array)if(a.part){for(let f of t)for(let Q of o)if(i(f,Q,a,e))return!0}else{if(t.length!==o.length)return!1;for(let f=0;f{"use strict";F7.exports=function(n){return n.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var U7=ee((cSA,L7)=>{"use strict";var _D=xl(),dxe=mL(),hxe=SL(),Exe=DD(),Bo={};L7.exports=function(n,t,o={}){return typeof t!="object"&&(t=[t]),_D(!Array.isArray(t)||t.length,"Values array cannot be empty"),typeof n=="string"?Bo.string(n,t,o):Array.isArray(n)?Bo.array(n,t,o):(_D(typeof n=="object","Reference must be string or an object"),Bo.object(n,t,o))};Bo.array=function(n,t,o){if(Array.isArray(t)||(t=[t]),!n.length||o.only&&o.once&&n.length!==t.length)return!1;let a,e=new Map;for(let A of t)if(!o.deep||!A||typeof A!="object"){let r=e.get(A);r?++r.allowed:e.set(A,{allowed:1,hits:0})}else{a=a||Bo.compare(o);let r=!1;for(let[s,g]of e.entries())if(a(s,A)){++g.allowed,r=!0;break}r||e.set(A,{allowed:1,hits:0})}let i=0;for(let A of n){let r;if(!o.deep||!A||typeof A!="object")r=e.get(A);else{a=a||Bo.compare(o);for(let[s,g]of e.entries())if(a(s,A)){r=g;break}}if(r&&(++r.hits,++i,o.once&&r.hits>r.allowed))return!1}if(o.only&&i!==n.length)return!1;for(let A of e.values())if(A.hits!==A.allowed&&A.hitst.propertyIsEnumerable(s)),i=[...Object.keys(t),...e],A=Bo.compare(o),r=new Set(i);for(let s of a){if(!r.has(s)){if(o.only)return!1;continue}if(!A(t[s],n[s]))return!1;r.delete(s)}return r.size?o.part?r.sizes!=="");let a=new Map,e=[];for(let s of t)if(_D(typeof s=="string","Cannot compare string reference to non-string value"),s){let g=a.get(s);g?++g.allowed:(a.set(s,{allowed:1,hits:0}),e.push(hxe(s)))}else if(o.once||o.only)return!1;if(!e.length)return!0;let i=new RegExp(`(${e.join("|")})`,"g"),A=n.replace(i,(s,g)=>(++a.get(g).hits,""));if(o.only&&A)return!1;let r=!1;for(let s of a.values())if(s.hits&&(r=!0),s.hits!==s.allowed&&(s.hitsdxe(e,i,a)};Bo.shallow=function(n,t){return n===t}});var K7=ee((ISA,H7)=>{"use strict";var uxe=xl();H7.exports=function(n){return uxe(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(n),"Bad attribute value ("+n+")"),n.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}});var Y7=ee((lSA,x7)=>{"use strict";var rI={};x7.exports=function(n){if(!n)return"";let t="";for(let o=0;o=256?"&#"+n+";":`&#x${n.toString(16).padStart(2,"0")};`)};rI.isSafe=function(n){return rI.safeCharCodes.has(n)};rI.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]);rI.safeCharCodes=(function(){let n=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||t===32||t===46||t===44||t===45||t===58||t===95)&&n.add(t);return n})()});var J7=ee((pSA,j7)=>{"use strict";var TD={};j7.exports=function(n){return n?n.replace(/[<>&\u2028\u2029]/g,TD.escape):""};TD.escape=function(n){return TD.replacements.get(n)};TD.replacements=new Map([["<","\\u003c"],[">","\\u003e"],["&","\\u0026"],["\u2028","\\u2028"],["\u2029","\\u2029"]])});var V7=ee((dSA,z7)=>{"use strict";var q7={};z7.exports=q7.flatten=function(n,t){let o=t||[];for(let a of n)Array.isArray(a)?q7.flatten(a,o):o.push(a);return o}});var X7=ee((hSA,Z7)=>{"use strict";var W7={};Z7.exports=function(n,t,o={}){if(!n||!t)return o.first?null:[];let a=[],e=Array.isArray(n)?new Set(n):n,i=new Set;for(let A of t)if(W7.has(e,A)&&!i.has(A)){if(o.first)return A;a.push(A),i.add(A)}return o.first?null:a};W7.has=function(n,t){return typeof n.has=="function"?n.has(t):n[t]!==void 0}});var e$=ee((ESA,$7)=>{"use strict";$7.exports=function(n){return!!n&&typeof n.then=="function"}});var r$=ee((uSA,t$)=>{"use strict";var A$={wrapped:Symbol("wrapped")};t$.exports=function(n){if(n[A$.wrapped])return n;let t=!1,o=function(...a){t||(t=!0,n(...a))};return o[A$.wrapped]=!0,o}});var a$=ee((CSA,i$)=>{"use strict";var Cxe=FB();i$.exports=function(n,t,o){return t.replace(/{([^{}]+)}/g,(a,e)=>{let i=Cxe(n,e,o);return i??""})}});var n$=ee((BSA,o$)=>{"use strict";var Bxe={maxTimer:2147483647};o$.exports=function(n,t,o){if(typeof n=="bigint"&&(n=Number(n)),n>=Number.MAX_SAFE_INTEGER&&(n=1/0),typeof n!="number"&&n!==void 0)throw new TypeError("Timeout must be a number or bigint");return new Promise(a=>{let e=o?o.setTimeout:setTimeout,i=()=>{let A=Math.min(n,Bxe.maxTimer);n-=A,e(()=>n>0?i():a(t),A)};n!==1/0&&i()})}});var s$=ee(Er=>{"use strict";Er.applyToDefaults=T7();Er.assert=xl();Er.Bench=R7();Er.block=P7();Er.clone=OD();Er.contain=U7();Er.deepEqual=mL();Er.Error=EL();Er.escapeHeaderAttribute=K7();Er.escapeHtml=Y7();Er.escapeJson=J7();Er.escapeRegex=SL();Er.flatten=V7();Er.ignore=yL();Er.intersect=X7();Er.isPromise=e$();Er.merge=fL();Er.once=r$();Er.reach=FB();Er.reachTemplate=a$();Er.stringify=hL();Er.wait=n$()});var Jr=ee(Pe=>{"use strict";var Yl=s$(),Wa={codes:new Map([[100,"Continue"],[101,"Switching Protocols"],[102,"Processing"],[200,"OK"],[201,"Created"],[202,"Accepted"],[203,"Non-Authoritative Information"],[204,"No Content"],[205,"Reset Content"],[206,"Partial Content"],[207,"Multi-Status"],[300,"Multiple Choices"],[301,"Moved Permanently"],[302,"Moved Temporarily"],[303,"See Other"],[304,"Not Modified"],[305,"Use Proxy"],[307,"Temporary Redirect"],[400,"Bad Request"],[401,"Unauthorized"],[402,"Payment Required"],[403,"Forbidden"],[404,"Not Found"],[405,"Method Not Allowed"],[406,"Not Acceptable"],[407,"Proxy Authentication Required"],[408,"Request Time-out"],[409,"Conflict"],[410,"Gone"],[411,"Length Required"],[412,"Precondition Failed"],[413,"Request Entity Too Large"],[414,"Request-URI Too Large"],[415,"Unsupported Media Type"],[416,"Requested Range Not Satisfiable"],[417,"Expectation Failed"],[418,"I'm a teapot"],[422,"Unprocessable Entity"],[423,"Locked"],[424,"Failed Dependency"],[425,"Too Early"],[426,"Upgrade Required"],[428,"Precondition Required"],[429,"Too Many Requests"],[431,"Request Header Fields Too Large"],[451,"Unavailable For Legal Reasons"],[500,"Internal Server Error"],[501,"Not Implemented"],[502,"Bad Gateway"],[503,"Service Unavailable"],[504,"Gateway Time-out"],[505,"HTTP Version Not Supported"],[506,"Variant Also Negotiates"],[507,"Insufficient Storage"],[509,"Bandwidth Limit Exceeded"],[510,"Not Extended"],[511,"Network Authentication Required"]])};Pe.Boom=class extends Error{constructor(n,t={}){if(n instanceof Error)return Pe.boomify(Yl.clone(n),t);let{statusCode:o=500,data:a=null,ctor:e=Pe.Boom}=t,i=new Error(n||void 0);Error.captureStackTrace(i,e),i.data=a;let A=Wa.initialize(i,o);return Object.defineProperty(A,"typeof",{value:e}),t.decorate&&Object.assign(A,t.decorate),A}static[Symbol.hasInstance](n){return this===Pe.Boom?Pe.isBoom(n):this.prototype.isPrototypeOf(n)}};Pe.isBoom=function(n,t){return n instanceof Error&&!!n.isBoom&&(!t||n.output.statusCode===t)};Pe.boomify=function(n,t){return Yl.assert(n instanceof Error,"Cannot wrap non-Error object"),t=t||{},t.data!==void 0&&(n.data=t.data),t.decorate&&Object.assign(n,t.decorate),n.isBoom?t.override===!1||!t.statusCode&&!t.message?n:Wa.initialize(n,t.statusCode||n.output.statusCode,t.message):Wa.initialize(n,t.statusCode||500,t.message)};Pe.badRequest=function(n,t){return new Pe.Boom(n,{statusCode:400,data:t,ctor:Pe.badRequest})};Pe.unauthorized=function(n,t,o){let a=new Pe.Boom(n,{statusCode:401,ctor:Pe.unauthorized});if(!t)return a;if(typeof t!="string")return a.output.headers["WWW-Authenticate"]=t.join(", "),a;let e=`${t}`;return(o||n)&&(a.output.payload.attributes={}),o&&(typeof o=="string"?(e+=" "+Yl.escapeHeaderAttribute(o),a.output.payload.attributes=o):e+=" "+Object.keys(o).map(i=>{let A=o[i];return A==null&&(A=""),a.output.payload.attributes[i]=A,`${i}="${Yl.escapeHeaderAttribute(A.toString())}"`}).join(", ")),n?(o&&(e+=","),e+=` error="${Yl.escapeHeaderAttribute(n)}"`,a.output.payload.attributes.error=n):a.isMissing=!0,a.output.headers["WWW-Authenticate"]=e,a};Pe.paymentRequired=function(n,t){return new Pe.Boom(n,{statusCode:402,data:t,ctor:Pe.paymentRequired})};Pe.forbidden=function(n,t){return new Pe.Boom(n,{statusCode:403,data:t,ctor:Pe.forbidden})};Pe.notFound=function(n,t){return new Pe.Boom(n,{statusCode:404,data:t,ctor:Pe.notFound})};Pe.methodNotAllowed=function(n,t,o){let a=new Pe.Boom(n,{statusCode:405,data:t,ctor:Pe.methodNotAllowed});return typeof o=="string"&&(o=[o]),Array.isArray(o)&&(a.output.headers.Allow=o.join(", ")),a};Pe.notAcceptable=function(n,t){return new Pe.Boom(n,{statusCode:406,data:t,ctor:Pe.notAcceptable})};Pe.proxyAuthRequired=function(n,t){return new Pe.Boom(n,{statusCode:407,data:t,ctor:Pe.proxyAuthRequired})};Pe.clientTimeout=function(n,t){return new Pe.Boom(n,{statusCode:408,data:t,ctor:Pe.clientTimeout})};Pe.conflict=function(n,t){return new Pe.Boom(n,{statusCode:409,data:t,ctor:Pe.conflict})};Pe.resourceGone=function(n,t){return new Pe.Boom(n,{statusCode:410,data:t,ctor:Pe.resourceGone})};Pe.lengthRequired=function(n,t){return new Pe.Boom(n,{statusCode:411,data:t,ctor:Pe.lengthRequired})};Pe.preconditionFailed=function(n,t){return new Pe.Boom(n,{statusCode:412,data:t,ctor:Pe.preconditionFailed})};Pe.entityTooLarge=function(n,t){return new Pe.Boom(n,{statusCode:413,data:t,ctor:Pe.entityTooLarge})};Pe.uriTooLong=function(n,t){return new Pe.Boom(n,{statusCode:414,data:t,ctor:Pe.uriTooLong})};Pe.unsupportedMediaType=function(n,t){return new Pe.Boom(n,{statusCode:415,data:t,ctor:Pe.unsupportedMediaType})};Pe.rangeNotSatisfiable=function(n,t){return new Pe.Boom(n,{statusCode:416,data:t,ctor:Pe.rangeNotSatisfiable})};Pe.expectationFailed=function(n,t){return new Pe.Boom(n,{statusCode:417,data:t,ctor:Pe.expectationFailed})};Pe.teapot=function(n,t){return new Pe.Boom(n,{statusCode:418,data:t,ctor:Pe.teapot})};Pe.badData=function(n,t){return new Pe.Boom(n,{statusCode:422,data:t,ctor:Pe.badData})};Pe.locked=function(n,t){return new Pe.Boom(n,{statusCode:423,data:t,ctor:Pe.locked})};Pe.failedDependency=function(n,t){return new Pe.Boom(n,{statusCode:424,data:t,ctor:Pe.failedDependency})};Pe.tooEarly=function(n,t){return new Pe.Boom(n,{statusCode:425,data:t,ctor:Pe.tooEarly})};Pe.preconditionRequired=function(n,t){return new Pe.Boom(n,{statusCode:428,data:t,ctor:Pe.preconditionRequired})};Pe.tooManyRequests=function(n,t){return new Pe.Boom(n,{statusCode:429,data:t,ctor:Pe.tooManyRequests})};Pe.illegal=function(n,t){return new Pe.Boom(n,{statusCode:451,data:t,ctor:Pe.illegal})};Pe.internal=function(n,t,o=500){return Wa.serverError(n,t,o,Pe.internal)};Pe.notImplemented=function(n,t){return Wa.serverError(n,t,501,Pe.notImplemented)};Pe.badGateway=function(n,t){return Wa.serverError(n,t,502,Pe.badGateway)};Pe.serverUnavailable=function(n,t){return Wa.serverError(n,t,503,Pe.serverUnavailable)};Pe.gatewayTimeout=function(n,t){return Wa.serverError(n,t,504,Pe.gatewayTimeout)};Pe.badImplementation=function(n,t){let o=Wa.serverError(n,t,500,Pe.badImplementation);return o.isDeveloperError=!0,o};Wa.initialize=function(n,t,o){let a=parseInt(t,10);if(Yl.assert(!isNaN(a)&&a>=400,"First argument must be a number (400+):",t),n.isBoom=!0,n.isServer=a>=500,n.hasOwnProperty("data")||(n.data=null),n.output={statusCode:a,payload:{},headers:{}},Object.defineProperty(n,"reformat",{value:Wa.reformat,configurable:!0}),!o&&!n.message&&(n.reformat(),o=n.output.payload.error),o){let e=Object.getOwnPropertyDescriptor(n,"message")||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),"message");Yl.assert(!e||e.configurable&&!e.get,"The error is not compatible with boom"),n.message=o+(n.message?": "+n.message:""),n.output.payload.message=n.message}return n.reformat(),n};Wa.reformat=function(n=!1){this.output.payload.statusCode=this.output.statusCode,this.output.payload.error=Wa.codes.get(this.output.statusCode)||"Unknown",this.output.statusCode===500&&n!==!0?this.output.payload.message="An internal server error occurred":this.message&&(this.output.payload.message=this.message)};Wa.serverError=function(n,t,o,a){return t instanceof Error&&!t.isBoom?Pe.boomify(t,{statusCode:o,message:n}):new Pe.Boom(n,{statusCode:o,data:t,ctor:a})}});var Iee,$xe,eYe,AYe,tYe,rYe,iYe,aYe,oYe,nYe,sYe,gYe,cYe,IYe,lYe,O,Fs=ue(()=>{Iee=n=>typeof n<"u"&&n!==null,$xe=n=>typeof n=="object",eYe=n=>Object.prototype.toString.call(n)==="[object Object]",AYe=n=>typeof n=="function",tYe=n=>typeof n=="boolean",rYe=n=>n instanceof Buffer,iYe=n=>{if(Iee(n))switch(n.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},aYe=n=>n instanceof ArrayBuffer,oYe=n=>typeof n=="string"&&n.length>0,nYe=n=>typeof n=="number"&&Number.isFinite(n),sYe=n=>Number.isInteger(n),gYe=(n,t,o)=>n>=t&&n<=o,cYe=(n,t)=>t.includes(n),IYe=(n,t,o)=>new Error(`Expected ${t} for ${n} but received ${o} of type ${typeof o}`),lYe=(n,t)=>(t.message=n.message,t),O={defined:Iee,object:$xe,plainObject:eYe,fn:AYe,bool:tYe,buffer:rYe,typedArray:iYe,arrayBuffer:aYe,string:oYe,number:nYe,integer:sYe,inRange:gYe,inArray:cYe,invalidParameterError:IYe,nativeError:lYe}});var dee=ee((_wA,pee)=>{"use strict";var lee=()=>process.platform==="linux",qD=null,pYe=()=>{if(!qD)if(lee()&&process.report){let n=process.report.excludeNetwork;process.report.excludeNetwork=!0,qD=process.report.getReport(),process.report.excludeNetwork=n}else qD={};return qD};pee.exports={isLinux:lee,getReport:pYe}});var Eee=ee((TwA,hee)=>{"use strict";var Fh=$e("fs"),dYe="/usr/bin/ldd",hYe="/proc/self/exe",zD=2048,EYe=n=>{let t=Fh.openSync(n,"r"),o=Buffer.alloc(zD),a=Fh.readSync(t,o,0,zD,0);return Fh.close(t,()=>{}),o.subarray(0,a)},uYe=n=>new Promise((t,o)=>{Fh.open(n,"r",(a,e)=>{if(a)o(a);else{let i=Buffer.alloc(zD);Fh.read(e,i,0,zD,0,(A,r)=>{t(i.subarray(0,r)),Fh.close(e,()=>{})})}})});hee.exports={LDD_PATH:dYe,SELF_PATH:hYe,readFileSync:EYe,readFile:uYe}});var Cee=ee((NwA,uee)=>{"use strict";var CYe=n=>{if(n.length<64||n.readUInt32BE(0)!==2135247942||n.readUInt8(4)!==2||n.readUInt8(5)!==1)return null;let t=n.readUInt32LE(32),o=n.readUInt16LE(54),a=n.readUInt16LE(56);for(let e=0;e{"use strict";var fee=$e("child_process"),{isLinux:Lh,getReport:Qee}=dee(),{LDD_PATH:VD,SELF_PATH:yee,readFile:FL,readFileSync:LL}=Eee(),{interpreterPath:mee}=Cee(),Ls,Us,Hs,See="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",cI="",wee=()=>cI||new Promise(n=>{fee.exec(See,(t,o)=>{cI=t?" ":o,n(cI)})}),Dee=()=>{if(!cI)try{cI=fee.execSync(See,{encoding:"utf8"})}catch{cI=" "}return cI},Xg="glibc",Oee=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,Wl="musl",BYe=n=>n.includes("libc.musl-")||n.includes("ld-musl-"),bee=()=>{let n=Qee();return n.header&&n.header.glibcVersionRuntime?Xg:Array.isArray(n.sharedObjects)&&n.sharedObjects.some(BYe)?Wl:null},Mee=n=>{let[t,o]=n.split(/[\r\n]+/);return t&&t.includes(Xg)?Xg:o&&o.includes(Wl)?Wl:null},_ee=n=>{if(n){if(n.includes("/ld-musl-"))return Wl;if(n.includes("/ld-linux-"))return Xg}return null},Tee=n=>(n=n.toString(),n.includes("musl")?Wl:n.includes("GNU C Library")?Xg:null),fYe=async()=>{if(Us!==void 0)return Us;Us=null;try{let n=await FL(VD);Us=Tee(n)}catch{}return Us},QYe=()=>{if(Us!==void 0)return Us;Us=null;try{let n=LL(VD);Us=Tee(n)}catch{}return Us},yYe=async()=>{if(Ls!==void 0)return Ls;Ls=null;try{let n=await FL(yee),t=mee(n);Ls=_ee(t)}catch{}return Ls},mYe=()=>{if(Ls!==void 0)return Ls;Ls=null;try{let n=LL(yee),t=mee(n);Ls=_ee(t)}catch{}return Ls},Nee=async()=>{let n=null;if(Lh()&&(n=await yYe(),!n&&(n=await fYe(),n||(n=bee()),!n))){let t=await wee();n=Mee(t)}return n},Ree=()=>{let n=null;if(Lh()&&(n=mYe(),!n&&(n=QYe(),n||(n=bee()),!n))){let t=Dee();n=Mee(t)}return n},SYe=async()=>Lh()&&await Nee()!==Xg,wYe=()=>Lh()&&Ree()!==Xg,DYe=async()=>{if(Hs!==void 0)return Hs;Hs=null;try{let t=(await FL(VD)).match(Oee);t&&(Hs=t[1])}catch{}return Hs},OYe=()=>{if(Hs!==void 0)return Hs;Hs=null;try{let t=LL(VD).match(Oee);t&&(Hs=t[1])}catch{}return Hs},kee=()=>{let n=Qee();return n.header&&n.header.glibcVersionRuntime?n.header.glibcVersionRuntime:null},Bee=n=>n.trim().split(/\s+/)[1],vee=n=>{let[t,o,a]=n.split(/[\r\n]+/);return t&&t.includes(Xg)?Bee(t):o&&a&&o.includes(Wl)?Bee(a):null},bYe=async()=>{let n=null;if(Lh()&&(n=await DYe(),n||(n=kee()),!n)){let t=await wee();n=vee(t)}return n},MYe=()=>{let n=null;if(Lh()&&(n=OYe(),n||(n=kee()),!n)){let t=Dee();n=vee(t)}return n};Pee.exports={GLIBC:Xg,MUSL:Wl,family:Nee,familySync:Ree,isNonGlibcLinux:SYe,isNonGlibcLinuxSync:wYe,version:bYe,versionSync:MYe}});var Uh=ee((kwA,Gee)=>{"use strict";var _Ye="2.0.0",TYe=Number.MAX_SAFE_INTEGER||9007199254740991,NYe=16,RYe=250,kYe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Gee.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:NYe,MAX_SAFE_BUILD_LENGTH:RYe,MAX_SAFE_INTEGER:TYe,RELEASE_TYPES:kYe,SEMVER_SPEC_VERSION:_Ye,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var XB=ee((vwA,Fee)=>{"use strict";var vYe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{};Fee.exports=vYe});var Hh=ee((Ks,Lee)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:UL,MAX_SAFE_BUILD_LENGTH:PYe,MAX_LENGTH:GYe}=Uh(),FYe=XB();Ks=Lee.exports={};var LYe=Ks.re=[],UYe=Ks.safeRe=[],gA=Ks.src=[],HYe=Ks.safeSrc=[],cA=Ks.t={},KYe=0,HL="[a-zA-Z0-9-]",xYe=[["\\s",1],["\\d",GYe],[HL,PYe]],YYe=n=>{for(let[t,o]of xYe)n=n.split(`${t}*`).join(`${t}{0,${o}}`).split(`${t}+`).join(`${t}{1,${o}}`);return n},JA=(n,t,o)=>{let a=YYe(t),e=KYe++;FYe(n,e,t),cA[n]=e,gA[e]=t,HYe[e]=a,LYe[e]=new RegExp(t,o?"g":void 0),UYe[e]=new RegExp(a,o?"g":void 0)};JA("NUMERICIDENTIFIER","0|[1-9]\\d*");JA("NUMERICIDENTIFIERLOOSE","\\d+");JA("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${HL}*`);JA("MAINVERSION",`(${gA[cA.NUMERICIDENTIFIER]})\\.(${gA[cA.NUMERICIDENTIFIER]})\\.(${gA[cA.NUMERICIDENTIFIER]})`);JA("MAINVERSIONLOOSE",`(${gA[cA.NUMERICIDENTIFIERLOOSE]})\\.(${gA[cA.NUMERICIDENTIFIERLOOSE]})\\.(${gA[cA.NUMERICIDENTIFIERLOOSE]})`);JA("PRERELEASEIDENTIFIER",`(?:${gA[cA.NONNUMERICIDENTIFIER]}|${gA[cA.NUMERICIDENTIFIER]})`);JA("PRERELEASEIDENTIFIERLOOSE",`(?:${gA[cA.NONNUMERICIDENTIFIER]}|${gA[cA.NUMERICIDENTIFIERLOOSE]})`);JA("PRERELEASE",`(?:-(${gA[cA.PRERELEASEIDENTIFIER]}(?:\\.${gA[cA.PRERELEASEIDENTIFIER]})*))`);JA("PRERELEASELOOSE",`(?:-?(${gA[cA.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${gA[cA.PRERELEASEIDENTIFIERLOOSE]})*))`);JA("BUILDIDENTIFIER",`${HL}+`);JA("BUILD",`(?:\\+(${gA[cA.BUILDIDENTIFIER]}(?:\\.${gA[cA.BUILDIDENTIFIER]})*))`);JA("FULLPLAIN",`v?${gA[cA.MAINVERSION]}${gA[cA.PRERELEASE]}?${gA[cA.BUILD]}?`);JA("FULL",`^${gA[cA.FULLPLAIN]}$`);JA("LOOSEPLAIN",`[v=\\s]*${gA[cA.MAINVERSIONLOOSE]}${gA[cA.PRERELEASELOOSE]}?${gA[cA.BUILD]}?`);JA("LOOSE",`^${gA[cA.LOOSEPLAIN]}$`);JA("GTLT","((?:<|>)?=?)");JA("XRANGEIDENTIFIERLOOSE",`${gA[cA.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);JA("XRANGEIDENTIFIER",`${gA[cA.NUMERICIDENTIFIER]}|x|X|\\*`);JA("XRANGEPLAIN",`[v=\\s]*(${gA[cA.XRANGEIDENTIFIER]})(?:\\.(${gA[cA.XRANGEIDENTIFIER]})(?:\\.(${gA[cA.XRANGEIDENTIFIER]})(?:${gA[cA.PRERELEASE]})?${gA[cA.BUILD]}?)?)?`);JA("XRANGEPLAINLOOSE",`[v=\\s]*(${gA[cA.XRANGEIDENTIFIERLOOSE]})(?:\\.(${gA[cA.XRANGEIDENTIFIERLOOSE]})(?:\\.(${gA[cA.XRANGEIDENTIFIERLOOSE]})(?:${gA[cA.PRERELEASELOOSE]})?${gA[cA.BUILD]}?)?)?`);JA("XRANGE",`^${gA[cA.GTLT]}\\s*${gA[cA.XRANGEPLAIN]}$`);JA("XRANGELOOSE",`^${gA[cA.GTLT]}\\s*${gA[cA.XRANGEPLAINLOOSE]}$`);JA("COERCEPLAIN",`(^|[^\\d])(\\d{1,${UL}})(?:\\.(\\d{1,${UL}}))?(?:\\.(\\d{1,${UL}}))?`);JA("COERCE",`${gA[cA.COERCEPLAIN]}(?:$|[^\\d])`);JA("COERCEFULL",gA[cA.COERCEPLAIN]+`(?:${gA[cA.PRERELEASE]})?(?:${gA[cA.BUILD]})?(?:$|[^\\d])`);JA("COERCERTL",gA[cA.COERCE],!0);JA("COERCERTLFULL",gA[cA.COERCEFULL],!0);JA("LONETILDE","(?:~>?)");JA("TILDETRIM",`(\\s*)${gA[cA.LONETILDE]}\\s+`,!0);Ks.tildeTrimReplace="$1~";JA("TILDE",`^${gA[cA.LONETILDE]}${gA[cA.XRANGEPLAIN]}$`);JA("TILDELOOSE",`^${gA[cA.LONETILDE]}${gA[cA.XRANGEPLAINLOOSE]}$`);JA("LONECARET","(?:\\^)");JA("CARETTRIM",`(\\s*)${gA[cA.LONECARET]}\\s+`,!0);Ks.caretTrimReplace="$1^";JA("CARET",`^${gA[cA.LONECARET]}${gA[cA.XRANGEPLAIN]}$`);JA("CARETLOOSE",`^${gA[cA.LONECARET]}${gA[cA.XRANGEPLAINLOOSE]}$`);JA("COMPARATORLOOSE",`^${gA[cA.GTLT]}\\s*(${gA[cA.LOOSEPLAIN]})$|^$`);JA("COMPARATOR",`^${gA[cA.GTLT]}\\s*(${gA[cA.FULLPLAIN]})$|^$`);JA("COMPARATORTRIM",`(\\s*)${gA[cA.GTLT]}\\s*(${gA[cA.LOOSEPLAIN]}|${gA[cA.XRANGEPLAIN]})`,!0);Ks.comparatorTrimReplace="$1$2$3";JA("HYPHENRANGE",`^\\s*(${gA[cA.XRANGEPLAIN]})\\s+-\\s+(${gA[cA.XRANGEPLAIN]})\\s*$`);JA("HYPHENRANGELOOSE",`^\\s*(${gA[cA.XRANGEPLAINLOOSE]})\\s+-\\s+(${gA[cA.XRANGEPLAINLOOSE]})\\s*$`);JA("STAR","(<|>)?=?\\s*\\*");JA("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");JA("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ZD=ee((PwA,Uee)=>{"use strict";var jYe=Object.freeze({loose:!0}),JYe=Object.freeze({}),qYe=n=>n?typeof n!="object"?jYe:n:JYe;Uee.exports=qYe});var KL=ee((GwA,xee)=>{"use strict";var Hee=/^[0-9]+$/,Kee=(n,t)=>{if(typeof n=="number"&&typeof t=="number")return n===t?0:nKee(t,n);xee.exports={compareIdentifiers:Kee,rcompareIdentifiers:zYe}});var Pi=ee((FwA,jee)=>{"use strict";var XD=XB(),{MAX_LENGTH:Yee,MAX_SAFE_INTEGER:$D}=Uh(),{safeRe:eO,t:AO}=Hh(),VYe=ZD(),{compareIdentifiers:xL}=KL(),WYe=(n,t)=>{let o=t.split(".");if(o.length>n.length)return!1;for(let a=0;aYee)throw new TypeError(`version is longer than ${Yee} characters`);XD("SemVer",t,o),this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease;let a=t.trim().match(o.loose?eO[AO.LOOSE]:eO[AO.FULL]);if(!a)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>$D||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$D||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$D||this.patch<0)throw new TypeError("Invalid patch version");a[4]?this.prerelease=a[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let i=+e;if(i>=0&&i<$D)return i}return e}):this.prerelease=[],this.build=a[5]?a[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(XD("SemVer.compare",this.version,this.options,t),!(t instanceof n)){if(typeof t=="string"&&t===this.version)return 0;t=new n(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof n||(t=new n(t,this.options)),this.majort.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof n||(t=new n(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let o=0;do{let a=this.prerelease[o],e=t.prerelease[o];if(XD("prerelease compare",o,a,e),a===void 0&&e===void 0)return 0;if(e===void 0)return 1;if(a===void 0)return-1;if(a===e)continue;return xL(a,e)}while(++o)}compareBuild(t){t instanceof n||(t=new n(t,this.options));let o=0;do{let a=this.build[o],e=t.build[o];if(XD("build compare",o,a,e),a===void 0&&e===void 0)return 0;if(e===void 0)return 1;if(a===void 0)return-1;if(a===e)continue;return xL(a,e)}while(++o)}inc(t,o,a){if(t.startsWith("pre")){if(!o&&a===!1)throw new Error("invalid increment argument: identifier is empty");if(o){let e=`-${o}`.match(this.options.loose?eO[AO.PRERELEASELOOSE]:eO[AO.PRERELEASE]);if(!e||e[1]!==o)throw new Error(`invalid identifier: ${o}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",o,a);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",o,a);break;case"prepatch":this.prerelease.length=0,this.inc("patch",o,a),this.inc("pre",o,a);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",o,a),this.inc("pre",o,a);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let e=Number(a)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(o===this.prerelease.join(".")&&a===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(o){let i=[o,e];if(a===!1&&(i=[o]),WYe(this.prerelease,o)){let A=this.prerelease[o.split(".").length];isNaN(A)&&(this.prerelease=i)}else this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};jee.exports=YL});var II=ee((LwA,qee)=>{"use strict";var Jee=Pi(),ZYe=(n,t,o=!1)=>{if(n instanceof Jee)return n;try{return new Jee(n,t)}catch(a){if(!o)return null;throw a}};qee.exports=ZYe});var Vee=ee((UwA,zee)=>{"use strict";var XYe=II(),$Ye=(n,t)=>{let o=XYe(n,t);return o?o.version:null};zee.exports=$Ye});var Zee=ee((HwA,Wee)=>{"use strict";var e1e=II(),A1e=(n,t)=>{let o=e1e(n.trim().replace(/^[=v]+/,""),t);return o?o.version:null};Wee.exports=A1e});var eAe=ee((KwA,$ee)=>{"use strict";var Xee=Pi(),t1e=(n,t,o,a,e)=>{typeof o=="string"&&(e=a,a=o,o=void 0);try{return new Xee(n instanceof Xee?n.version:n,o).inc(t,a,e).version}catch{return null}};$ee.exports=t1e});var rAe=ee((xwA,tAe)=>{"use strict";var AAe=II(),r1e=(n,t)=>{let o=AAe(n,null,!0),a=AAe(t,null,!0),e=o.compare(a);if(e===0)return null;let i=e>0,A=i?o:a,r=i?a:o,s=!!A.prerelease.length;if(!!r.prerelease.length&&!s){if(!r.patch&&!r.minor)return"major";if(r.compareMain(A)===0)return r.minor&&!r.patch?"minor":"patch"}let c=s?"pre":"";return o.major!==a.major?c+"major":o.minor!==a.minor?c+"minor":o.patch!==a.patch?c+"patch":"prerelease"};tAe.exports=r1e});var aAe=ee((YwA,iAe)=>{"use strict";var i1e=Pi(),a1e=(n,t)=>new i1e(n,t).major;iAe.exports=a1e});var nAe=ee((jwA,oAe)=>{"use strict";var o1e=Pi(),n1e=(n,t)=>new o1e(n,t).minor;oAe.exports=n1e});var gAe=ee((JwA,sAe)=>{"use strict";var s1e=Pi(),g1e=(n,t)=>new s1e(n,t).patch;sAe.exports=g1e});var IAe=ee((qwA,cAe)=>{"use strict";var c1e=II(),I1e=(n,t)=>{let o=c1e(n,t);return o&&o.prerelease.length?o.prerelease:null};cAe.exports=I1e});var tn=ee((zwA,pAe)=>{"use strict";var lAe=Pi(),l1e=(n,t,o)=>new lAe(n,o).compare(new lAe(t,o));pAe.exports=l1e});var hAe=ee((VwA,dAe)=>{"use strict";var p1e=tn(),d1e=(n,t,o)=>p1e(t,n,o);dAe.exports=d1e});var uAe=ee((WwA,EAe)=>{"use strict";var h1e=tn(),E1e=(n,t)=>h1e(n,t,!0);EAe.exports=E1e});var tO=ee((ZwA,BAe)=>{"use strict";var CAe=Pi(),u1e=(n,t,o)=>{let a=new CAe(n,o),e=new CAe(t,o);return a.compare(e)||a.compareBuild(e)};BAe.exports=u1e});var QAe=ee((XwA,fAe)=>{"use strict";var C1e=tO(),B1e=(n,t)=>n.sort((o,a)=>C1e(o,a,t));fAe.exports=B1e});var mAe=ee(($wA,yAe)=>{"use strict";var f1e=tO(),Q1e=(n,t)=>n.sort((o,a)=>f1e(a,o,t));yAe.exports=Q1e});var $B=ee((eDA,SAe)=>{"use strict";var y1e=tn(),m1e=(n,t,o)=>y1e(n,t,o)>0;SAe.exports=m1e});var rO=ee((ADA,wAe)=>{"use strict";var S1e=tn(),w1e=(n,t,o)=>S1e(n,t,o)<0;wAe.exports=w1e});var jL=ee((tDA,DAe)=>{"use strict";var D1e=tn(),O1e=(n,t,o)=>D1e(n,t,o)===0;DAe.exports=O1e});var JL=ee((rDA,OAe)=>{"use strict";var b1e=tn(),M1e=(n,t,o)=>b1e(n,t,o)!==0;OAe.exports=M1e});var iO=ee((iDA,bAe)=>{"use strict";var _1e=tn(),T1e=(n,t,o)=>_1e(n,t,o)>=0;bAe.exports=T1e});var aO=ee((aDA,MAe)=>{"use strict";var N1e=tn(),R1e=(n,t,o)=>N1e(n,t,o)<=0;MAe.exports=R1e});var qL=ee((oDA,_Ae)=>{"use strict";var k1e=jL(),v1e=JL(),P1e=$B(),G1e=iO(),F1e=rO(),L1e=aO(),U1e=(n,t,o,a)=>{switch(t){case"===":return typeof n=="object"&&(n=n.version),typeof o=="object"&&(o=o.version),n===o;case"!==":return typeof n=="object"&&(n=n.version),typeof o=="object"&&(o=o.version),n!==o;case"":case"=":case"==":return k1e(n,o,a);case"!=":return v1e(n,o,a);case">":return P1e(n,o,a);case">=":return G1e(n,o,a);case"<":return F1e(n,o,a);case"<=":return L1e(n,o,a);default:throw new TypeError(`Invalid operator: ${t}`)}};_Ae.exports=U1e});var NAe=ee((nDA,TAe)=>{"use strict";var H1e=Pi(),K1e=II(),{safeRe:oO,t:nO}=Hh(),x1e=(n,t)=>{if(n instanceof H1e)return n;if(typeof n=="number"&&(n=String(n)),typeof n!="string")return null;t=t||{};let o=null;if(!t.rtl)o=n.match(t.includePrerelease?oO[nO.COERCEFULL]:oO[nO.COERCE]);else{let s=t.includePrerelease?oO[nO.COERCERTLFULL]:oO[nO.COERCERTL],g;for(;(g=s.exec(n))&&(!o||o.index+o[0].length!==n.length);)(!o||g.index+g[0].length!==o.index+o[0].length)&&(o=g),s.lastIndex=g.index+g[1].length+g[2].length;s.lastIndex=-1}if(o===null)return null;let a=o[2],e=o[3]||"0",i=o[4]||"0",A=t.includePrerelease&&o[5]?`-${o[5]}`:"",r=t.includePrerelease&&o[6]?`+${o[6]}`:"";return K1e(`${a}.${e}.${i}${A}${r}`,t)};TAe.exports=x1e});var kAe=ee((sDA,RAe)=>{"use strict";var Y1e=II(),j1e=Uh(),J1e=Pi(),q1e=(n,t,o)=>{if(!j1e.RELEASE_TYPES.includes(t))return null;let a=z1e(n,o);return a&&V1e(a,t)},z1e=(n,t)=>{let o=n instanceof J1e?n.version:n;return Y1e(o,t)},V1e=(n,t)=>{if(W1e(t))return n.version;switch(n.prerelease=[],t){case"major":n.minor=0,n.patch=0;break;case"minor":n.patch=0;break}return n.format()},W1e=n=>n.startsWith("pre");RAe.exports=q1e});var PAe=ee((gDA,vAe)=>{"use strict";var zL=class{constructor(){this.max=1e3,this.map=new Map}get(t){let o=this.map.get(t);if(o!==void 0)return this.map.delete(t),this.map.set(t,o),o}delete(t){return this.map.delete(t)}set(t,o){if(!this.delete(t)&&o!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(t,o)}return this}};vAe.exports=zL});var rn=ee((cDA,UAe)=>{"use strict";var Z1e=/\s+/g,VL=class n{constructor(t,o){if(o=$1e(o),t instanceof n)return t.loose===!!o.loose&&t.includePrerelease===!!o.includePrerelease?t:new n(t.raw,o);if(t instanceof WL)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=t.trim().replace(Z1e," "),this.set=this.raw.split("||").map(a=>this.parseRange(a.trim())).filter(a=>a.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let a=this.set[0];if(this.set=this.set.filter(e=>!FAe(e[0])),this.set.length===0)this.set=[a];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&s3e(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let o=this.set[t];for(let a=0;a0&&(this.formatted+=" "),this.formatted+=o[a].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(n3e,"");let a=((this.options.includePrerelease&&a3e)|(this.options.loose&&o3e))+":"+t,e=GAe.get(a);if(e)return e;let i=this.options.loose,A=i?fa[Gi.HYPHENRANGELOOSE]:fa[Gi.HYPHENRANGE];t=t.replace(A,B3e(this.options.includePrerelease)),Xt("hyphen replace",t),t=t.replace(fa[Gi.COMPARATORTRIM],t3e),Xt("comparator trim",t),t=t.replace(fa[Gi.TILDETRIM],r3e),Xt("tilde trim",t),t=t.replace(fa[Gi.CARETTRIM],i3e),Xt("caret trim",t);let r=t.split(" ").map(I=>g3e(I,this.options)).join(" ").split(/\s+/).map(I=>C3e(I,this.options));i&&(r=r.filter(I=>(Xt("loose invalid filter",I,this.options),!!I.match(fa[Gi.COMPARATORLOOSE])))),Xt("range list",r);let s=new Map,g=r.map(I=>new WL(I,this.options));for(let I of g){if(FAe(I))return[I];s.set(I.value,I)}s.size>1&&s.has("")&&s.delete("");let c=[...s.values()];return GAe.set(a,c),c}intersects(t,o){if(!(t instanceof n))throw new TypeError("a Range is required");return this.set.some(a=>LAe(a,o)&&t.set.some(e=>LAe(e,o)&&a.every(i=>e.every(A=>i.intersects(A,o)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new e3e(t,this.options)}catch{return!1}for(let o=0;on.value==="<0.0.0-0",s3e=n=>n.value==="",LAe=(n,t)=>{let o=!0,a=n.slice(),e=a.pop();for(;o&&a.length;)o=a.every(i=>e.intersects(i,t)),e=a.pop();return o},g3e=(n,t)=>(n=n.replace(fa[Gi.BUILD],""),Xt("comp",n,t),n=p3e(n,t),Xt("caret",n),n=I3e(n,t),Xt("tildes",n),n=h3e(n,t),Xt("xrange",n),n=u3e(n,t),Xt("stars",n),n),Wr=n=>!n||n.toLowerCase()==="x"||n==="*",c3e=(n,t,o)=>Wr(n)&&!Wr(t)||Wr(t)&&o&&!Wr(o),I3e=(n,t)=>n.trim().split(/\s+/).map(o=>l3e(o,t)).join(" "),l3e=(n,t)=>{let o=t.loose?fa[Gi.TILDELOOSE]:fa[Gi.TILDE],a=t.includePrerelease?"-0":"";return n.replace(o,(e,i,A,r,s)=>{Xt("tilde",n,e,i,A,r,s);let g;return Wr(i)?g="":Wr(A)?g=`>=${i}.0.0${a} <${+i+1}.0.0-0`:Wr(r)?g=`>=${i}.${A}.0${a} <${i}.${+A+1}.0-0`:s?(Xt("replaceTilde pr",s),g=`>=${i}.${A}.${r}-${s} <${i}.${+A+1}.0-0`):g=`>=${i}.${A}.${r} <${i}.${+A+1}.0-0`,Xt("tilde return",g),g})},p3e=(n,t)=>n.trim().split(/\s+/).map(o=>d3e(o,t)).join(" "),d3e=(n,t)=>{Xt("caret",n,t);let o=t.loose?fa[Gi.CARETLOOSE]:fa[Gi.CARET],a=t.includePrerelease?"-0":"";return n.replace(o,(e,i,A,r,s)=>{Xt("caret",n,e,i,A,r,s);let g;return Wr(i)?g="":Wr(A)?g=`>=${i}.0.0${a} <${+i+1}.0.0-0`:Wr(r)?i==="0"?g=`>=${i}.${A}.0${a} <${i}.${+A+1}.0-0`:g=`>=${i}.${A}.0${a} <${+i+1}.0.0-0`:s?(Xt("replaceCaret pr",s),i==="0"?A==="0"?g=`>=${i}.${A}.${r}-${s} <${i}.${A}.${+r+1}-0`:g=`>=${i}.${A}.${r}-${s} <${i}.${+A+1}.0-0`:g=`>=${i}.${A}.${r}-${s} <${+i+1}.0.0-0`):(Xt("no pr"),i==="0"?A==="0"?g=`>=${i}.${A}.${r} <${i}.${A}.${+r+1}-0`:g=`>=${i}.${A}.${r} <${i}.${+A+1}.0-0`:g=`>=${i}.${A}.${r} <${+i+1}.0.0-0`),Xt("caret return",g),g})},h3e=(n,t)=>(Xt("replaceXRanges",n,t),n.split(/\s+/).map(o=>E3e(o,t)).join(" ")),E3e=(n,t)=>{n=n.trim();let o=t.loose?fa[Gi.XRANGELOOSE]:fa[Gi.XRANGE];return n.replace(o,(a,e,i,A,r,s)=>{if(Xt("xRange",n,a,e,i,A,r,s),c3e(i,A,r))return n;let g=Wr(i),c=g||Wr(A),I=c||Wr(r),p=I;return e==="="&&p&&(e=""),s=t.includePrerelease?"-0":"",g?e===">"||e==="<"?a="<0.0.0-0":a="*":e&&p?(c&&(A=0),r=0,e===">"?(e=">=",c?(i=+i+1,A=0,r=0):(A=+A+1,r=0)):e==="<="&&(e="<",c?i=+i+1:A=+A+1),e==="<"&&(s="-0"),a=`${e+i}.${A}.${r}${s}`):c?a=`>=${i}.0.0${s} <${+i+1}.0.0-0`:I&&(a=`>=${i}.${A}.0${s} <${i}.${+A+1}.0-0`),Xt("xRange return",a),a})},u3e=(n,t)=>(Xt("replaceStars",n,t),n.trim().replace(fa[Gi.STAR],"")),C3e=(n,t)=>(Xt("replaceGTE0",n,t),n.trim().replace(fa[t.includePrerelease?Gi.GTE0PRE:Gi.GTE0],"")),B3e=n=>(t,o,a,e,i,A,r,s,g,c,I,p)=>(Wr(a)?o="":Wr(e)?o=`>=${a}.0.0${n?"-0":""}`:Wr(i)?o=`>=${a}.${e}.0${n?"-0":""}`:A?o=`>=${o}`:o=`>=${o}${n?"-0":""}`,Wr(g)?s="":Wr(c)?s=`<${+g+1}.0.0-0`:Wr(I)?s=`<${g}.${+c+1}.0-0`:p?s=`<=${g}.${c}.${I}-${p}`:n?s=`<${g}.${c}.${+I+1}-0`:s=`<=${s}`,`${o} ${s}`.trim()),f3e=(n,t,o)=>{for(let a=0;a0){let e=n[a].semver;if(e.major===t.major&&e.minor===t.minor&&e.patch===t.patch)return!0}return!1}return!0}});var ef=ee((IDA,JAe)=>{"use strict";var Af=Symbol("SemVer ANY"),$L=class n{static get ANY(){return Af}constructor(t,o){if(o=HAe(o),t instanceof n){if(t.loose===!!o.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),XL("comparator",t,o),this.options=o,this.loose=!!o.loose,this.parse(t),this.semver===Af?this.value="":this.value=this.operator+this.semver.version,XL("comp",this)}parse(t){let o=this.options.loose?KAe[xAe.COMPARATORLOOSE]:KAe[xAe.COMPARATOR],a=t.match(o);if(!a)throw new TypeError(`Invalid comparator: ${t}`);this.operator=a[1]!==void 0?a[1]:"",this.operator==="="&&(this.operator=""),a[2]?this.semver=new YAe(a[2],this.options.loose):this.semver=Af}toString(){return this.value}test(t){if(XL("Comparator.test",t,this.options.loose),this.semver===Af||t===Af)return!0;if(typeof t=="string")try{t=new YAe(t,this.options)}catch{return!1}return ZL(t,this.operator,this.semver,this.options)}intersects(t,o){if(!(t instanceof n))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new jAe(t.value,o).test(this.value):t.operator===""?t.value===""?!0:new jAe(this.value,o).test(t.semver):(o=HAe(o),o.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!o.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||ZL(this.semver,"<",t.semver,o)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||ZL(this.semver,">",t.semver,o)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};JAe.exports=$L;var HAe=ZD(),{safeRe:KAe,t:xAe}=Hh(),ZL=qL(),XL=XB(),YAe=Pi(),jAe=rn()});var tf=ee((lDA,qAe)=>{"use strict";var Q3e=rn(),y3e=(n,t,o)=>{try{t=new Q3e(t,o)}catch{return!1}return t.test(n)};qAe.exports=y3e});var VAe=ee((pDA,zAe)=>{"use strict";var m3e=rn(),S3e=(n,t)=>new m3e(n,t).set.map(o=>o.map(a=>a.value).join(" ").trim().split(" "));zAe.exports=S3e});var ZAe=ee((dDA,WAe)=>{"use strict";var w3e=Pi(),D3e=rn(),O3e=(n,t,o)=>{let a=null,e=null,i=null;try{i=new D3e(t,o)}catch{return null}return n.forEach(A=>{i.test(A)&&(!a||e.compare(A)===-1)&&(a=A,e=new w3e(a,o))}),a};WAe.exports=O3e});var $Ae=ee((hDA,XAe)=>{"use strict";var b3e=Pi(),M3e=rn(),_3e=(n,t,o)=>{let a=null,e=null,i=null;try{i=new M3e(t,o)}catch{return null}return n.forEach(A=>{i.test(A)&&(!a||e.compare(A)===1)&&(a=A,e=new b3e(a,o))}),a};XAe.exports=_3e});var tte=ee((EDA,Ate)=>{"use strict";var e2=Pi(),T3e=rn(),ete=$B(),N3e=(n,t)=>{n=new T3e(n,t);let o=new e2("0.0.0");if(n.test(o)||(o=new e2("0.0.0-0"),n.test(o)))return o;o=null;for(let a=0;a{let r=new e2(A.semver.version);switch(A.operator){case">":r.prerelease.length===0?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":(!i||ete(r,i))&&(i=r);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${A.operator}`)}}),i&&(!o||ete(o,i))&&(o=i)}return o&&n.test(o)?o:null};Ate.exports=N3e});var ite=ee((uDA,rte)=>{"use strict";var R3e=rn(),k3e=(n,t)=>{try{return new R3e(n,t).range||"*"}catch{return null}};rte.exports=k3e});var sO=ee((CDA,ste)=>{"use strict";var v3e=Pi(),nte=ef(),{ANY:P3e}=nte,G3e=rn(),F3e=tf(),ate=$B(),ote=rO(),L3e=aO(),U3e=iO(),H3e=(n,t,o,a)=>{n=new v3e(n,a),t=new G3e(t,a);let e,i,A,r,s;switch(o){case">":e=ate,i=L3e,A=ote,r=">",s=">=";break;case"<":e=ote,i=U3e,A=ate,r="<",s="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(F3e(n,t,a))return!1;for(let g=0;g{B.semver===P3e&&(B=new nte(">=0.0.0")),I=I||B,p=p||B,e(B.semver,I.semver,a)?I=B:A(B.semver,p.semver,a)&&(p=B)}),I.operator===r||I.operator===s||(!p.operator||p.operator===r)&&i(n,p.semver))return!1;if(p.operator===s&&A(n,p.semver))return!1}return!0};ste.exports=H3e});var cte=ee((BDA,gte)=>{"use strict";var K3e=sO(),x3e=(n,t,o)=>K3e(n,t,">",o);gte.exports=x3e});var lte=ee((fDA,Ite)=>{"use strict";var Y3e=sO(),j3e=(n,t,o)=>Y3e(n,t,"<",o);Ite.exports=j3e});var hte=ee((QDA,dte)=>{"use strict";var pte=rn(),J3e=(n,t,o)=>(n=new pte(n,o),t=new pte(t,o),n.intersects(t,o));dte.exports=J3e});var ute=ee((yDA,Ete)=>{"use strict";var q3e=tf(),z3e=tn();Ete.exports=(n,t,o)=>{let a=[],e=null,i=null,A=n.sort((c,I)=>z3e(c,I,o));for(let c of A)q3e(c,t,o)?(i=c,e||(e=c)):(i&&a.push([e,i]),i=null,e=null);e&&a.push([e,null]);let r=[];for(let[c,I]of a)c===I?r.push(c):!I&&c===A[0]?r.push("*"):I?c===A[0]?r.push(`<=${I}`):r.push(`${c} - ${I}`):r.push(`>=${c}`);let s=r.join(" || "),g=typeof t.raw=="string"?t.raw:String(t);return s.length{"use strict";var Cte=rn(),r2=ef(),{ANY:A2}=r2,t2=tf(),i2=tn(),V3e=(n,t,o={})=>{if(n===t)return!0;n=new Cte(n,o),t=new Cte(t,o);let a=!1;e:for(let e of n.set){for(let i of t.set){let A=Z3e(e,i,o);if(a=a||A!==null,A)continue e}if(a)return!1}return!0},W3e=[new r2(">=0.0.0-0")],Bte=[new r2(">=0.0.0")],Z3e=(n,t,o)=>{if(n===t)return!0;if(n.length===1&&n[0].semver===A2){if(t.length===1&&t[0].semver===A2)return!0;o.includePrerelease?n=W3e:n=Bte}if(t.length===1&&t[0].semver===A2){if(o.includePrerelease)return!0;t=Bte}let a=new Set,e,i;for(let B of n)B.operator===">"||B.operator===">="?e=fte(e,B,o):B.operator==="<"||B.operator==="<="?i=Qte(i,B,o):a.add(B.semver);if(a.size>1)return null;let A;if(e&&i){if(A=i2(e.semver,i.semver,o),A>0)return null;if(A===0&&(e.operator!==">="||i.operator!=="<="))return null}for(let B of a){if(e&&!t2(B,String(e),o)||i&&!t2(B,String(i),o))return null;for(let f of t)if(!t2(B,String(f),o))return!1;return!0}let r,s,g,c,I=i&&!o.includePrerelease&&i.semver.prerelease.length?i.semver:!1,p=e&&!o.includePrerelease&&e.semver.prerelease.length?e.semver:!1;I&&I.prerelease.length===1&&i.operator==="<"&&I.prerelease[0]===0&&(I=!1);for(let B of t){if(c=c||B.operator===">"||B.operator===">=",g=g||B.operator==="<"||B.operator==="<=",e){if(p&&B.semver.prerelease&&B.semver.prerelease.length&&B.semver.major===p.major&&B.semver.minor===p.minor&&B.semver.patch===p.patch&&(p=!1),B.operator===">"||B.operator===">="){if(r=fte(e,B,o),r===B&&r!==e)return!1}else if(e.operator===">="&&!B.test(e.semver))return!1}if(i){if(I&&B.semver.prerelease&&B.semver.prerelease.length&&B.semver.major===I.major&&B.semver.minor===I.minor&&B.semver.patch===I.patch&&(I=!1),B.operator==="<"||B.operator==="<="){if(s=Qte(i,B,o),s===B&&s!==i)return!1}else if(i.operator==="<="&&!B.test(i.semver))return!1}if(!B.operator&&(i||e)&&A!==0)return!1}return!(e&&g&&!i&&A!==0||i&&c&&!e&&A!==0||p||I)},fte=(n,t,o)=>{if(!n)return t;let a=i2(n.semver,t.semver,o);return a>0?n:a<0||t.operator===">"&&n.operator===">="?t:n},Qte=(n,t,o)=>{if(!n)return t;let a=i2(n.semver,t.semver,o);return a<0?n:a>0||t.operator==="<"&&n.operator==="<="?t:n};yte.exports=V3e});var gO=ee((SDA,Dte)=>{"use strict";var a2=Hh(),Ste=Uh(),X3e=Pi(),wte=KL(),$3e=II(),eje=Vee(),Aje=Zee(),tje=eAe(),rje=rAe(),ije=aAe(),aje=nAe(),oje=gAe(),nje=IAe(),sje=tn(),gje=hAe(),cje=uAe(),Ije=tO(),lje=QAe(),pje=mAe(),dje=$B(),hje=rO(),Eje=jL(),uje=JL(),Cje=iO(),Bje=aO(),fje=qL(),Qje=NAe(),yje=kAe(),mje=ef(),Sje=rn(),wje=tf(),Dje=VAe(),Oje=ZAe(),bje=$Ae(),Mje=tte(),_je=ite(),Tje=sO(),Nje=cte(),Rje=lte(),kje=hte(),vje=ute(),Pje=mte();Dte.exports={parse:$3e,valid:eje,clean:Aje,inc:tje,diff:rje,major:ije,minor:aje,patch:oje,prerelease:nje,compare:sje,rcompare:gje,compareLoose:cje,compareBuild:Ije,sort:lje,rsort:pje,gt:dje,lt:hje,eq:Eje,neq:uje,gte:Cje,lte:Bje,cmp:fje,coerce:Qje,truncate:yje,Comparator:mje,Range:Sje,satisfies:wje,toComparators:Dje,maxSatisfying:Oje,minSatisfying:bje,minVersion:Mje,validRange:_je,outside:Tje,gtr:Nje,ltr:Rje,intersects:kje,simplifyRange:vje,subset:Pje,SemVer:X3e,re:a2.re,src:a2.src,tokens:a2.t,SEMVER_SPEC_VERSION:Ste.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ste.RELEASE_TYPES,compareIdentifiers:wte.compareIdentifiers,rcompareIdentifiers:wte.rcompareIdentifiers}});var $g,cO=ue(()=>{$g={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.3",author:"Lovell Fuller ",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert ","Jonathan Ong ","Chanon Sajjamanochai ","Juliano Julio ","Daniel Gasienica ","Julian Walker ","Amit Pitaru ","Brandon Aaron ","Andreas Lind ","Maurus Cuelenaere ","Linus Unneb\xE4ck ","Victor Mateevitsi ","Alaric Holloway ","Bernhard K. Weisshuhn ","Chris Riley ","David Carley ","John Tobin ","Kenton Gray ","Felix B\xFCnemann ","Samy Al Zahrani ","Chintan Thakkar ","F. Orlando Galashan ","Kleis Auke Wolthuizen ","Matt Hirsch ","Matthias Thoemmes ","Patrick Paskaris ","J\xE9r\xE9my Lal ","Rahul Nanwani ","Alice Monday ","Kristo Jorgenson ","YvesBos ","Guy Maliar ","Nicolas Coden ","Matt Parrish ","Marcel Bretschneider ","Matthew McEachen ","Jarda Kot\u011B\u0161ovec ","Kenric D'Souza ","Oleh Aleinyk ","Marcel Bretschneider ","Andrea Bianco ","Rik Heywood ","Thomas Parisot ","Nathan Graves ","Tom Lokhorst ","Espen Hovlandsdal ","Sylvain Dumont ","Alun Davies ","Aidan Hoolachan ","Axel Eirola ","Freezy ","Daiz ","Julian Aubourg ","Keith Belovay ","Michael B. Klein ","Jordan Prudhomme ","Ilya Ovdin ","Andargor ","Paul Neave ","Brendan Kennedy ","Brychan Bennett-Odlum ","Edward Silverton ","Roman Malieiev ","Tomas Szabo ","Robert O'Rourke ","Guillermo Alfonso Varela Chouci\xF1o ","Christian Flintrup ","Manan Jadhav ","Leon Radley ","alza54 ","Jacob Smith ","Michael Nutt ","Brad Parham ","Taneli Vatanen ","Joris Dugu\xE9 ","Chris Banks ","Ompal Singh ","Brodan ","Ankur Parihar ","Brahim Ait elhaj ","Mart Jansink ","Lachlan Newman ","Dennis Beatty ","Ingvar Stepanyan ","Don Denton ","Dmytro Tiapukhin ","Florian Lefebvre "],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.3","@img/sharp-darwin-x64":"0.35.3","@img/sharp-freebsd-wasm32":"0.35.3","@img/sharp-libvips-darwin-arm64":"1.3.2","@img/sharp-libvips-darwin-x64":"1.3.2","@img/sharp-libvips-linux-arm":"1.3.2","@img/sharp-libvips-linux-arm64":"1.3.2","@img/sharp-libvips-linux-ppc64":"1.3.2","@img/sharp-libvips-linux-riscv64":"1.3.2","@img/sharp-libvips-linux-s390x":"1.3.2","@img/sharp-libvips-linux-x64":"1.3.2","@img/sharp-libvips-linuxmusl-arm64":"1.3.2","@img/sharp-libvips-linuxmusl-x64":"1.3.2","@img/sharp-linux-arm":"0.35.3","@img/sharp-linux-arm64":"0.35.3","@img/sharp-linux-ppc64":"0.35.3","@img/sharp-linux-riscv64":"0.35.3","@img/sharp-linux-s390x":"0.35.3","@img/sharp-linux-x64":"0.35.3","@img/sharp-linuxmusl-arm64":"0.35.3","@img/sharp-linuxmusl-x64":"0.35.3","@img/sharp-webcontainers-wasm32":"0.35.3","@img/sharp-win32-arm64":"0.35.3","@img/sharp-win32-ia32":"0.35.3","@img/sharp-win32-x64":"0.35.3"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.1","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.1","@img/sharp-libvips-dev":"1.3.2","@img/sharp-libvips-dev-wasm32":"1.3.2","@img/sharp-libvips-win32-arm64":"1.3.2","@img/sharp-libvips-win32-ia32":"1.3.2","@img/sharp-libvips-win32-x64":"1.3.2","@types/node":"*",emnapi:"^1.11.1","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.9.0","node-gyp":"^12.4.0",publint:"^0.3.21","tar-fs":"^3.1.3",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.3"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as rf}from"node:child_process";import{createHash as Fje}from"node:crypto";var af,n2,Lje,bte,Uje,s2,Hje,Mte,Kje,Kh,xje,Yje,jje,Jje,_te,qje,Ote,zje,Vje,Tte,Wje,Zje,Nte,o2,Xje,IO,g2=ue(()=>{af=ze(gO(),1),n2=ze(WD(),1);cO();Lje=process.env.npm_package_config_libvips||$g.config.libvips,bte=af.default.coerce(Lje).version,Uje=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],s2={encoding:"utf8",shell:!0},Hje=n=>{n instanceof Error?console.error(`sharp: Installation error: ${n.message}`):console.log(`sharp: ${n}`)},Mte=()=>n2.default.isNonGlibcLinuxSync()?n2.default.familySync():"",Kje=()=>`${process.platform}${Mte()}-${process.arch}`,Kh=()=>{if(_te())return"wasm32";let{npm_config_arch:n,npm_config_platform:t,npm_config_libc:o}=process.env,a=typeof o=="string"?o:Mte();return`${t||process.platform}${a}-${n||process.arch}`},xje=()=>{try{return $e(`@img/sharp-libvips-dev-${Kh()}/include`)}catch{try{return $e("@img/sharp-libvips-dev/include")}catch{}}return""},Yje=()=>{try{return $e("@img/sharp-libvips-dev/cplusplus")}catch{}return""},jje=()=>{try{return $e(`@img/sharp-libvips-dev-${Kh()}/lib`)}catch{try{return $e(`@img/sharp-libvips-${Kh()}/lib`)}catch{}}return""},Jje=()=>{if(process.release?.name==="node"&&process.versions&&!af.default.satisfies(process.versions.node,$g.engines.node))return{found:process.versions.node,expected:$g.engines.node}},_te=()=>{let{CC:n}=process.env;return!!n?.endsWith("/emcc")},qje=()=>process.platform==="darwin"&&process.arch==="x64"?(rf("sysctl sysctl.proc_translated",s2).stdout||"").trim()==="sysctl.proc_translated: 1":!1,Ote=n=>Fje("sha512").update(n).digest("hex"),zje=()=>{try{let n=Ote(`imgsharp-libvips-${Kh()}`),t=af.default.coerce($g.optionalDependencies[`@img/sharp-libvips-${Kh()}`],{includePrerelease:!0}).version;return Ote(`${n}npm:${t}`).slice(0,10)}catch{}return""},Vje=()=>rf(`node-gyp rebuild --directory=src ${_te()?"--nodedir=emscripten":""}`,{...s2,stdio:"inherit"}).status,Tte=()=>process.platform!=="win32"?(rf("pkg-config --modversion vips-cpp",{...s2,env:{...process.env,PKG_CONFIG_PATH:Nte()}}).stdout||"").trim():"",Wje=()=>{try{let n=(rf("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(n)return`${n}/lib/pkgconfig`}catch{}},Zje=()=>{try{let n=(rf("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(n)return n}catch{}},Nte=()=>process.platform!=="win32"?[Wje(),Zje(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":"):"",o2=(n,t,o)=>(o&&o(`Detected ${t}, skipping search for globally-installed libvips`),n),Xje=n=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return o2(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",n);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return o2(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",n);if(qje())return o2(!1,"Rosetta",n);let t=Tte();return!!t&&af.default.gte(t,bte)},IO={minimumLibvipsVersion:bte,prebuiltPlatforms:Uje,buildPlatformArch:Kh,buildSharpLibvipsIncludeDir:xje,buildSharpLibvipsCPlusPlusDir:Yje,buildSharpLibvipsLibDir:jje,isUnsupportedNodeRuntime:Jje,runtimePlatformArch:Kje,log:Hje,yarnLocator:zje,spawnRebuild:Vje,globalLibvipsVersion:Tte,pkgConfigPath:Nte,useGlobalLibvips:Xje}});import{createRequire as $je}from"node:module";var lO,Zr,kte,eJe,Rte,AJe,tJe,ec,Kt,lI,Ot,of=ue(()=>{lO=ze(WD(),1);g2();cO();Zr=$je(import.meta.url),{version:kte}=$g,{runtimePlatformArch:eJe,isUnsupportedNodeRuntime:Rte,prebuiltPlatforms:AJe,minimumLibvipsVersion:tJe}=IO,ec=eJe(),lI=[];try{Kt=Zr(`../src/build/Release/sharp-${ec}-${kte}.node`)}catch(n){lI.push(n)}if(!Kt)try{Kt=Zr(`../src/build/Release/sharp-wasm32-${kte}.node`)}catch(n){lI.push(n)}if(!Kt)try{switch(ec){case"darwin-arm64":Kt=Zr("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":Kt=Zr("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":Kt=Zr("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":Kt=Zr("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":Kt=Zr("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":Kt=Zr("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":Kt=Zr("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":Kt=Zr("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":Kt=Zr("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":Kt=Zr("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":Kt=Zr("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":Kt=Zr("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":Kt=Zr("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":Kt=Zr("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":Kt=Zr("@img/sharp-webcontainers-wasm32/sharp.node");break}if(Kt&&["linux-x64","linuxmusl-x64"].includes(ec)&&!Kt._isUsingX64V2()){let n=new Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");n.code="Unsupported CPU",lI.push(n),Kt=null}Kt&&process.versions.electron&&ec.startsWith("linux")&&process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(n){lI.push(n)}if(!Kt)try{Kt=Zr("@img/sharp-wasm32/sharp.node")}catch(n){lI.push(n)}if(!Kt){let[n,t,o]=["linux","darwin","win32"].map(i=>ec.startsWith(i)),a=[`Could not load the "sharp" module using the ${ec} runtime`];lI.forEach(i=>{i.code.endsWith("MODULE_NOT_FOUND")||a.push(`${i.code}: ${i.message}`)});let e=lI.map(i=>i.message).join(" ");if(a.push("Possible solutions:"),Rte()){let{found:i,expected:A}=Rte();a.push("- Please upgrade Node.js:",` Found ${i}`,` Requires ${A}`)}else if(AJe.includes(ec)){let[i,A]=ec.split("-"),r=i.endsWith("musl")?" --libc=musl":"";a.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${i.replace("musl","")}${r} --cpu=${A} sharp`)}else a.push(`- Manually install libvips >= ${tJe}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(n&&/(symbol not found|CXXABI_)/i.test(e))try{let{config:i}=Zr(`@img/sharp-libvips-${ec}/package`),A=`${(0,lO.familySync)()} ${(0,lO.versionSync)()}`,r=`${i.musl?"musl":"glibc"} ${i.musl||i.glibc}`;a.push("- Update your OS:",` Found ${A}`,` Requires ${r}`)}catch{}throw n&&/\/snap\/core[0-9]{2}/.test(e)&&a.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),t&&/Incompatible library version/.test(e)&&a.push("- Update Homebrew:"," brew update && brew upgrade vips"),lI.some(i=>i.code==="ERR_DLOPEN_DISABLED")&&a.push("- Run Node.js without using the --no-addons flag"),o&&/The specified procedure could not be found/.test(e)&&a.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp"),a.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(a.join(` -`))}Ot=Kt});import rJe from"node:util";import c2 from"node:stream";function oJe(){let n=this.constructor.call(),{debuglog:t,queueListener:o,...a}=this.options;return n.options=structuredClone(a),n.options.debuglog=t,n.options.queueListener=o,this._isStreamInput()&&this.on("finish",()=>{this._flattenBufferIn(),n.options.input.buffer=this.options.input.buffer,n.emit("finish")}),n}var iJe,aJe,Zl,xs,vte=ue(()=>{Fs();of();iJe=rJe.debuglog("sharp"),aJe=n=>{Zl.queue.emit("change",n)},Zl=function(n,t){if(arguments.length===1&&!O.defined(n))throw new Error("Invalid input");return this instanceof Zl?(c2.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:o=>{this.emit("warning",o),iJe(o)},queueListener:aJe},this.options.input=this._createInputDescriptor(n,t,{allowStream:!0}),this):new Zl(n,t)};Object.setPrototypeOf(Zl.prototype,c2.Duplex.prototype);Object.setPrototypeOf(Zl,c2.Duplex);Object.assign(Zl.prototype,{clone:oJe});xs=Zl});function Pte(n){let t=sJe.filter(o=>O.defined(n[o])).map(o=>[o,n[o]]);return t.length?Object.fromEntries(t):void 0}function gJe(n,t,o){let a={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(O.string(n))a.file=n;else if(O.buffer(n)){if(n.length===0)throw Error("Input Buffer is empty");a.buffer=n}else if(O.arrayBuffer(n)){if(n.byteLength===0)throw Error("Input bit Array is empty");a.buffer=Buffer.from(n,0,n.byteLength)}else if(O.typedArray(n)){if(n.length===0)throw Error("Input Bit Array is empty");a.buffer=Buffer.from(n.buffer,n.byteOffset,n.byteLength)}else if(O.plainObject(n)&&!O.defined(t))t=n,Pte(t)&&(a.buffer=[]);else if(!O.defined(n)&&!O.defined(t)&&O.object(o)&&o.allowStream)a.buffer=[];else if(Array.isArray(n))if(n.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=n.map(e=>this._createInputDescriptor(e));else throw new Error("Recursive join is unsupported");else throw new Error("Expected at least two images to join");else throw new Error(`Unsupported input '${n}' of type ${typeof n}${O.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(O.object(t)){if(O.defined(t.failOn))if(O.string(t.failOn)&&O.inArray(t.failOn,["none","truncated","error","warning"]))a.failOn=t.failOn;else throw O.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(O.defined(t.autoOrient))if(O.bool(t.autoOrient))a.autoOrient=t.autoOrient;else throw O.invalidParameterError("autoOrient","boolean",t.autoOrient);if(O.defined(t.density))if(O.number(t.density)&&O.inRange(t.density,1,1e5))a.density=t.density;else throw O.invalidParameterError("density","number between 1 and 100000",t.density);if(O.defined(t.ignoreIcc))if(O.bool(t.ignoreIcc))a.ignoreIcc=t.ignoreIcc;else throw O.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(O.defined(t.limitInputPixels))if(O.bool(t.limitInputPixels))a.limitInputPixels=t.limitInputPixels?16383**2:0;else if(O.integer(t.limitInputPixels)&&O.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))a.limitInputPixels=t.limitInputPixels;else throw O.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(O.defined(t.limitInputChannels))if(O.bool(t.limitInputChannels))a.limitInputChannels=t.limitInputChannels?5:0;else if(O.integer(t.limitInputChannels)&&O.inRange(t.limitInputChannels,0,Number.MAX_SAFE_INTEGER))a.limitInputChannels=t.limitInputChannels;else throw O.invalidParameterError("limitInputChannels","positive integer",t.limitInputChannels);if(O.defined(t.unlimited))if(O.bool(t.unlimited))a.unlimited=t.unlimited;else throw O.invalidParameterError("unlimited","boolean",t.unlimited);if(O.defined(t.sequentialRead))if(O.bool(t.sequentialRead))a.sequentialRead=t.sequentialRead;else throw O.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(O.defined(t.raw)){if(O.object(t.raw)&&O.integer(t.raw.width)&&O.inRange(t.raw.width,1,1e8)&&O.integer(t.raw.height)&&O.inRange(t.raw.height,1,1e8)&&O.integer(t.raw.channels)&&O.inRange(t.raw.channels,1,4))switch(a.rawWidth=t.raw.width,a.rawHeight=t.raw.height,a.rawChannels=t.raw.channels,n.constructor){case Uint8Array:case Uint8ClampedArray:a.rawDepth="uchar";break;case Int8Array:a.rawDepth="char";break;case Uint16Array:a.rawDepth="ushort";break;case Int16Array:a.rawDepth="short";break;case Uint32Array:a.rawDepth="uint";break;case Int32Array:a.rawDepth="int";break;case Float32Array:a.rawDepth="float";break;case Float64Array:a.rawDepth="double";break;default:a.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(a.rawPremultiplied=!1,O.defined(t.raw.premultiplied))if(O.bool(t.raw.premultiplied))a.rawPremultiplied=t.raw.premultiplied;else throw O.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(a.rawPageHeight=0,O.defined(t.raw.pageHeight))if(O.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw new Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);a.rawPageHeight=t.raw.pageHeight}else throw O.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(O.defined(t.animated))if(O.bool(t.animated))a.pages=t.animated?-1:1;else throw O.invalidParameterError("animated","boolean",t.animated);if(O.defined(t.pages))if(O.integer(t.pages)&&O.inRange(t.pages,-1,1e5))a.pages=t.pages;else throw O.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(O.defined(t.page))if(O.integer(t.page)&&O.inRange(t.page,0,1e5))a.page=t.page;else throw O.invalidParameterError("page","integer between 0 and 100000",t.page);if(O.object(t.openSlide)&&O.defined(t.openSlide.level))if(O.integer(t.openSlide.level)&&O.inRange(t.openSlide.level,0,256))a.openSlideLevel=t.openSlide.level;else throw O.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(O.defined(t.level))if(O.integer(t.level)&&O.inRange(t.level,0,256))a.openSlideLevel=t.level;else throw O.invalidParameterError("level","integer between 0 and 256",t.level);if(O.object(t.tiff)&&O.defined(t.tiff.subifd))if(O.integer(t.tiff.subifd)&&O.inRange(t.tiff.subifd,-1,1e5))a.tiffSubifd=t.tiff.subifd;else throw O.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(O.defined(t.subifd))if(O.integer(t.subifd)&&O.inRange(t.subifd,-1,1e5))a.tiffSubifd=t.subifd;else throw O.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(O.object(t.svg)){if(O.defined(t.svg.stylesheet))if(O.string(t.svg.stylesheet))a.svgStylesheet=t.svg.stylesheet;else throw O.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(O.defined(t.svg.highBitdepth))if(O.bool(t.svg.highBitdepth))a.svgHighBitdepth=t.svg.highBitdepth;else throw O.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(O.object(t.pdf)&&O.defined(t.pdf.background)?a.pdfBackground=this._getBackgroundColourOption(t.pdf.background):O.defined(t.pdfBackground)&&(a.pdfBackground=this._getBackgroundColourOption(t.pdfBackground)),O.object(t.jp2)&&O.defined(t.jp2.oneshot))if(O.bool(t.jp2.oneshot))a.jp2Oneshot=t.jp2.oneshot;else throw O.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(O.defined(t.create))if(O.object(t.create)&&O.integer(t.create.width)&&O.inRange(t.create.width,1,1e8)&&O.integer(t.create.height)&&O.inRange(t.create.height,1,1e8)&&O.integer(t.create.channels)){if(a.createWidth=t.create.width,a.createHeight=t.create.height,a.createChannels=t.create.channels,a.createPageHeight=0,O.defined(t.create.pageHeight))if(O.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw new Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);a.createPageHeight=t.create.pageHeight}else throw O.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(O.defined(t.create.noise)){if(!O.object(t.create.noise))throw new Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw new Error("Only gaussian noise is supported at the moment");if(a.createNoiseType=t.create.noise.type,!O.inRange(t.create.channels,1,4))throw O.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(a.createNoiseMean=128,O.defined(t.create.noise.mean))if(O.number(t.create.noise.mean)&&O.inRange(t.create.noise.mean,0,1e4))a.createNoiseMean=t.create.noise.mean;else throw O.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(a.createNoiseSigma=30,O.defined(t.create.noise.sigma))if(O.number(t.create.noise.sigma)&&O.inRange(t.create.noise.sigma,0,1e4))a.createNoiseSigma=t.create.noise.sigma;else throw O.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(O.defined(t.create.background)){if(!O.inRange(t.create.channels,3,4))throw O.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);a.createBackground=this._getBackgroundColourOption(t.create.background)}else throw new Error("Expected valid noise or background to create a new input image");delete a.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(O.defined(t.text))if(O.object(t.text)&&O.string(t.text.text)){if(a.textValue=t.text.text,O.defined(t.text.height)&&O.defined(t.text.dpi))throw new Error("Expected only one of dpi or height");if(O.defined(t.text.font))if(O.string(t.text.font))a.textFont=t.text.font;else throw O.invalidParameterError("text.font","string",t.text.font);if(O.defined(t.text.fontfile))if(O.string(t.text.fontfile))a.textFontfile=t.text.fontfile;else throw O.invalidParameterError("text.fontfile","string",t.text.fontfile);if(O.defined(t.text.width))if(O.integer(t.text.width)&&O.inRange(t.text.width,1,1e6))a.textWidth=t.text.width;else throw O.invalidParameterError("text.width","integer between 1 and 1000000",t.text.width);if(O.defined(t.text.height))if(O.integer(t.text.height)&&O.inRange(t.text.height,1,1e6))a.textHeight=t.text.height;else throw O.invalidParameterError("text.height","integer between 1 and 1000000",t.text.height);if(O.defined(t.text.align))if(O.string(t.text.align)&&O.string(this.constructor.align[t.text.align]))a.textAlign=this.constructor.align[t.text.align];else throw O.invalidParameterError("text.align","valid alignment",t.text.align);if(O.defined(t.text.justify))if(O.bool(t.text.justify))a.textJustify=t.text.justify;else throw O.invalidParameterError("text.justify","boolean",t.text.justify);if(O.defined(t.text.dpi))if(O.integer(t.text.dpi)&&O.inRange(t.text.dpi,1,1e6))a.textDpi=t.text.dpi;else throw O.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(O.defined(t.text.rgba))if(O.bool(t.text.rgba))a.textRgba=t.text.rgba;else throw O.invalidParameterError("text.rgba","bool",t.text.rgba);if(O.defined(t.text.spacing))if(O.integer(t.text.spacing)&&O.inRange(t.text.spacing,-1e6,1e6))a.textSpacing=t.text.spacing;else throw O.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(O.defined(t.text.wrap))if(O.string(t.text.wrap)&&O.inArray(t.text.wrap,["word","char","word-char","none"]))a.textWrap=t.text.wrap;else throw O.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete a.buffer}else throw new Error("Expected a valid string to create an image with text.");if(O.defined(t.join))if(O.defined(this.options.join)){if(O.defined(t.join.animated))if(O.bool(t.join.animated))a.joinAnimated=t.join.animated;else throw O.invalidParameterError("join.animated","boolean",t.join.animated);if(O.defined(t.join.across))if(O.integer(t.join.across)&&O.inRange(t.join.across,1,1e6))a.joinAcross=t.join.across;else throw O.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(O.defined(t.join.shim))if(O.integer(t.join.shim)&&O.inRange(t.join.shim,0,1e6))a.joinShim=t.join.shim;else throw O.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(O.defined(t.join.background)&&(a.joinBackground=this._getBackgroundColourOption(t.join.background)),O.defined(t.join.halign))if(O.string(t.join.halign)&&O.string(this.constructor.align[t.join.halign]))a.joinHalign=this.constructor.align[t.join.halign];else throw O.invalidParameterError("join.halign","valid alignment",t.join.halign);if(O.defined(t.join.valign))if(O.string(t.join.valign)&&O.string(this.constructor.align[t.join.valign]))a.joinValign=this.constructor.align[t.join.valign];else throw O.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw new Error("Expected input to be an array of images to join")}else if(O.defined(t))throw new Error(`Invalid input options ${t}`);return a}function cJe(n,t,o){Array.isArray(this.options.input.buffer)?O.buffer(n)?(this.options.input.buffer.length===0&&this.on("finish",()=>{this.streamInFinished=!0}),this.options.input.buffer.push(n),o()):o(new Error("Non-Buffer data on Writable Stream")):o(new Error("Unexpected data on Writable Stream"))}function IJe(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function lJe(){return Array.isArray(this.options.input.buffer)}function pJe(n){let t=Error();return O.fn(n)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),Ot.metadata(this.options,(o,a)=>{o?n(O.nativeError(o,t)):n(null,a)})}):Ot.metadata(this.options,(o,a)=>{o?n(O.nativeError(o,t)):n(null,a)}),this):this._isStreamInput()?new Promise((o,a)=>{let e=()=>{this._flattenBufferIn(),Ot.metadata(this.options,(i,A)=>{i?a(O.nativeError(i,t)):o(A)})};this.writableFinished?e():this.once("finish",e)}):new Promise((o,a)=>{Ot.metadata(this.options,(e,i)=>{e?a(O.nativeError(e,t)):o(i)})})}function dJe(n){let t=Error();return O.fn(n)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),Ot.stats(this.options,(o,a)=>{o?n(O.nativeError(o,t)):n(null,a)})}):Ot.stats(this.options,(o,a)=>{o?n(O.nativeError(o,t)):n(null,a)}),this):this._isStreamInput()?new Promise((o,a)=>{this.on("finish",function(){this._flattenBufferIn(),Ot.stats(this.options,(e,i)=>{e?a(O.nativeError(e,t)):o(i)})})}):new Promise((o,a)=>{Ot.stats(this.options,(e,i)=>{e?a(O.nativeError(e,t)):o(i)})})}var nJe,sJe,Gte,Fte=ue(()=>{Fs();of();nJe={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},sJe=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"];Gte=n=>{Object.assign(n.prototype,{_inputOptionsFromObject:Pte,_createInputDescriptor:gJe,_write:cJe,_flattenBufferIn:IJe,_isStreamInput:lJe,metadata:pJe,stats:dJe}),n.align=nJe}});function l2(n){return n.angle%360!==0||n.rotationAngle!==0}function pO(n){return n.width!==-1||n.height!==-1}function uJe(n,t,o){if(pO(this.options)&&this.options.debuglog("ignoring previous resize options"),this.options.widthPost!==-1&&this.options.debuglog("operation order will be: extract, resize, extract"),O.defined(n))if(O.object(n)&&!O.defined(o))o=n;else if(O.integer(n)&&n>0)this.options.width=n;else throw O.invalidParameterError("width","positive integer",n);else this.options.width=-1;if(O.defined(t))if(O.integer(t)&&t>0)this.options.height=t;else throw O.invalidParameterError("height","positive integer",t);else this.options.height=-1;if(O.object(o)){if(O.defined(o.width))if(O.integer(o.width)&&o.width>0)this.options.width=o.width;else throw O.invalidParameterError("width","positive integer",o.width);if(O.defined(o.height))if(O.integer(o.height)&&o.height>0)this.options.height=o.height;else throw O.invalidParameterError("height","positive integer",o.height);if(O.defined(o.fit)){let a=EJe[o.fit];if(O.string(a))this.options.canvas=a;else throw O.invalidParameterError("fit","valid fit",o.fit)}if(O.defined(o.position)){let a=O.integer(o.position)?o.position:Kte[o.position]||Hte[o.position]||Ute[o.position];if(O.integer(a)&&(O.inRange(a,0,8)||O.inRange(a,16,17)))this.options.position=a;else throw O.invalidParameterError("position","valid position/gravity/strategy",o.position)}if(this._setBackgroundColourOption("resizeBackground",o.background),O.defined(o.kernel))if(O.string(I2[o.kernel]))this.options.kernel=I2[o.kernel];else throw O.invalidParameterError("kernel","valid kernel name",o.kernel);O.defined(o.withoutEnlargement)&&this._setBooleanOption("withoutEnlargement",o.withoutEnlargement),O.defined(o.withoutReduction)&&this._setBooleanOption("withoutReduction",o.withoutReduction),O.defined(o.fastShrinkOnLoad)&&this._setBooleanOption("fastShrinkOnLoad",o.fastShrinkOnLoad)}return l2(this.options)&&pO(this.options)&&(this.options.rotateBefore=!0),this}function CJe(n){if(O.integer(n))if(O.inRange(n,1,1e4))this.options.extendTop=n,this.options.extendBottom=n,this.options.extendLeft=n,this.options.extendRight=n;else throw O.invalidParameterError("extend","integer between 1 and 10000",n);else if(O.object(n)){if(O.defined(n.top))if(O.integer(n.top)&&O.inRange(n.top,0,1e4))this.options.extendTop=n.top;else throw O.invalidParameterError("top","integer between 0 and 10000",n.top);if(O.defined(n.bottom))if(O.integer(n.bottom)&&O.inRange(n.bottom,0,1e4))this.options.extendBottom=n.bottom;else throw O.invalidParameterError("bottom","integer between 0 and 10000",n.bottom);if(O.defined(n.left))if(O.integer(n.left)&&O.inRange(n.left,0,1e4))this.options.extendLeft=n.left;else throw O.invalidParameterError("left","integer between 0 and 10000",n.left);if(O.defined(n.right))if(O.integer(n.right)&&O.inRange(n.right,0,1e4))this.options.extendRight=n.right;else throw O.invalidParameterError("right","integer between 0 and 10000",n.right);if(this._setBackgroundColourOption("extendBackground",n.background),O.defined(n.extendWith))if(O.string(Lte[n.extendWith]))this.options.extendWith=Lte[n.extendWith];else throw O.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",n.extendWith)}else throw O.invalidParameterError("extend","integer or object",n);return this}function BJe(n){let t=pO(this.options)||this.options.widthPre!==-1?"Post":"Pre";return this.options[`width${t}`]!==-1&&this.options.debuglog("ignoring previous extract options"),["left","top","width","height"].forEach(function(o){let a=n[o];if(O.integer(a)&&O.inRange(a,0,1e8))this.options[o+(o==="left"||o==="top"?"Offset":"")+t]=a;else throw O.invalidParameterError(o,"integer between 0 and 100000000",a)},this),l2(this.options)&&!pO(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBefore=!0),this.options.input.autoOrient&&(this.options.orientBefore=!0),this}function fJe(n){if(this.options.trimThreshold=10,O.defined(n))if(O.object(n)){if(O.defined(n.background)&&this._setBackgroundColourOption("trimBackground",n.background),O.defined(n.threshold))if(O.number(n.threshold)&&n.threshold>=0)this.options.trimThreshold=n.threshold;else throw O.invalidParameterError("threshold","positive number",n.threshold);if(O.defined(n.lineArt)&&this._setBooleanOption("trimLineArt",n.lineArt),O.defined(n.margin))if(O.integer(n.margin)&&O.inRange(n.margin,0,1e7))this.options.trimMargin=n.margin;else throw O.invalidParameterError("margin","integer between 0 and 10000000",n.margin)}else throw O.invalidParameterError("trim","object",n);return l2(this.options)&&(this.options.rotateBefore=!0),this}var Ute,Hte,Lte,Kte,I2,hJe,EJe,xte,Yte=ue(()=>{Fs();Ute={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},Hte={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},Lte={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},Kte={entropy:16,attention:17},I2={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},hJe={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},EJe={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};xte=n=>{Object.assign(n.prototype,{resize:uJe,extend:CJe,extract:BJe,trim:fJe}),n.gravity=Ute,n.strategy=Kte,n.kernel=I2,n.fit=hJe,n.position=Hte}});function QJe(n){if(!Array.isArray(n))throw O.invalidParameterError("images to composite","array",n);return this.options.composite=n.map(t=>{if(!O.object(t))throw O.invalidParameterError("image to composite","object",t);let o=this._inputOptionsFromObject(t),a={input:this._createInputDescriptor(t.input,o,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(O.defined(t.blend))if(O.string(p2[t.blend]))a.blend=p2[t.blend];else throw O.invalidParameterError("blend","valid blend name",t.blend);if(O.defined(t.tile))if(O.bool(t.tile))a.tile=t.tile;else throw O.invalidParameterError("tile","boolean",t.tile);if(O.defined(t.left))if(O.integer(t.left))a.left=t.left;else throw O.invalidParameterError("left","integer",t.left);if(O.defined(t.top))if(O.integer(t.top))a.top=t.top;else throw O.invalidParameterError("top","integer",t.top);if(O.defined(t.top)!==O.defined(t.left))throw new Error("Expected both left and top to be set");if(a.hasOffset=O.integer(t.top)&&O.integer(t.left),O.defined(t.gravity))if(O.integer(t.gravity)&&O.inRange(t.gravity,0,8))a.gravity=t.gravity;else if(O.string(t.gravity)&&O.integer(this.constructor.gravity[t.gravity]))a.gravity=this.constructor.gravity[t.gravity];else throw O.invalidParameterError("gravity","valid gravity",t.gravity);if(O.defined(t.premultiplied))if(O.bool(t.premultiplied))a.premultiplied=t.premultiplied;else throw O.invalidParameterError("premultiplied","boolean",t.premultiplied);return a}),this}var p2,jte,Jte=ue(()=>{Fs();p2={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};jte=n=>{n.prototype.composite=QJe,n.blend=p2}});function yJe(n,t){if(!O.defined(n))return this.autoOrient();if((this.options.angle||this.options.rotationAngle)&&(this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0),O.integer(n)&&!(n%90))this.options.angle=n;else if(O.number(n))this.options.rotationAngle=n,O.object(t)&&t.background&&this._setBackgroundColourOption("rotationBackground",t.background);else throw O.invalidParameterError("angle","numeric",n);return this}function mJe(){return this.options.input.autoOrient=!0,this}function SJe(n){return this.options.flip=O.bool(n)?n:!0,this}function wJe(n){return this.options.flop=O.bool(n)?n:!0,this}function DJe(n,t){let a=Array.isArray(n)&&(n.length===4&&n.every(O.number)||n.length===2&&n.every(e=>Array.isArray(e)&&e.length===2))?n.flat():[];if(a.length===4&&a.every(O.number))this.options.affineMatrix=a;else throw O.invalidParameterError("matrix","1x4 or 2x2 array",n);if(O.defined(t))if(O.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),O.defined(t.idx))if(O.number(t.idx))this.options.affineIdx=t.idx;else throw O.invalidParameterError("options.idx","number",t.idx);if(O.defined(t.idy))if(O.number(t.idy))this.options.affineIdy=t.idy;else throw O.invalidParameterError("options.idy","number",t.idy);if(O.defined(t.odx))if(O.number(t.odx))this.options.affineOdx=t.odx;else throw O.invalidParameterError("options.odx","number",t.odx);if(O.defined(t.ody))if(O.number(t.ody))this.options.affineOdy=t.ody;else throw O.invalidParameterError("options.ody","number",t.ody);if(O.defined(t.interpolator))if(O.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw O.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw O.invalidParameterError("options","object",t);return this}function OJe(n){if(O.plainObject(n)){if(O.number(n.sigma)&&O.inRange(n.sigma,1e-6,10))this.options.sharpenSigma=n.sigma;else throw O.invalidParameterError("options.sigma","number between 0.000001 and 10",n.sigma);if(O.defined(n.m1))if(O.number(n.m1)&&O.inRange(n.m1,0,1e6))this.options.sharpenM1=n.m1;else throw O.invalidParameterError("options.m1","number between 0 and 1000000",n.m1);if(O.defined(n.m2))if(O.number(n.m2)&&O.inRange(n.m2,0,1e6))this.options.sharpenM2=n.m2;else throw O.invalidParameterError("options.m2","number between 0 and 1000000",n.m2);if(O.defined(n.x1))if(O.number(n.x1)&&O.inRange(n.x1,0,1e6))this.options.sharpenX1=n.x1;else throw O.invalidParameterError("options.x1","number between 0 and 1000000",n.x1);if(O.defined(n.y2))if(O.number(n.y2)&&O.inRange(n.y2,0,1e6))this.options.sharpenY2=n.y2;else throw O.invalidParameterError("options.y2","number between 0 and 1000000",n.y2);if(O.defined(n.y3))if(O.number(n.y3)&&O.inRange(n.y3,0,1e6))this.options.sharpenY3=n.y3;else throw O.invalidParameterError("options.y3","number between 0 and 1000000",n.y3)}else this.options.sharpenSigma=-1;return this}function bJe(n){if(!O.defined(n))this.options.medianSize=3;else if(O.integer(n)&&O.inRange(n,1,1e3))this.options.medianSize=n;else throw O.invalidParameterError("size","integer between 1 and 1000",n);return this}function MJe(n){let t;if(O.number(n))t=n;else if(O.plainObject(n)){if(!O.number(n.sigma))throw O.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=n.sigma,"precision"in n)if(O.string(qte[n.precision]))this.options.precision=qte[n.precision];else throw O.invalidParameterError("precision","one of: integer, float, approximate",n.precision);if("minAmplitude"in n)if(O.number(n.minAmplitude)&&O.inRange(n.minAmplitude,.001,1))this.options.minAmpl=n.minAmplitude;else throw O.invalidParameterError("minAmplitude","number between 0.001 and 1",n.minAmplitude)}if(!O.defined(n))this.options.blurSigma=-1;else if(O.bool(n))this.options.blurSigma=n?-1:0;else if(O.number(t)&&O.inRange(t,.3,1e3))this.options.blurSigma=t;else throw O.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function _Je(n){if(!O.defined(n))this.options.dilateWidth=1;else if(O.integer(n)&&O.inRange(n,1,65536))this.options.dilateWidth=n;else throw O.invalidParameterError("width","integer between 1 and 65536",n);return this}function TJe(n){if(!O.defined(n))this.options.erodeWidth=1;else if(O.integer(n)&&O.inRange(n,1,65536))this.options.erodeWidth=n;else throw O.invalidParameterError("width","integer between 1 and 65536",n);return this}function NJe(n){return this.options.flatten=O.bool(n)?n:!0,O.object(n)&&this._setBackgroundColourOption("flattenBackground",n.background),this}function RJe(){return this.options.unflatten=!0,this}function kJe(n,t){if(!O.defined(n))this.options.gamma=2.2;else if(O.number(n)&&O.inRange(n,1,3))this.options.gamma=n;else throw O.invalidParameterError("gamma","number between 1.0 and 3.0",n);if(!O.defined(t))this.options.gammaOut=this.options.gamma;else if(O.number(t)&&O.inRange(t,1,3))this.options.gammaOut=t;else throw O.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function vJe(n){if(this.options.negate=O.bool(n)?n:!0,O.plainObject(n)&&"alpha"in n)if(O.bool(n.alpha))this.options.negateAlpha=n.alpha;else throw O.invalidParameterError("alpha","should be boolean value",n.alpha);return this}function PJe(n){if(O.plainObject(n)){if(O.defined(n.lower))if(O.number(n.lower)&&O.inRange(n.lower,0,99))this.options.normaliseLower=n.lower;else throw O.invalidParameterError("lower","number between 0 and 99",n.lower);if(O.defined(n.upper))if(O.number(n.upper)&&O.inRange(n.upper,1,100))this.options.normaliseUpper=n.upper;else throw O.invalidParameterError("upper","number between 1 and 100",n.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw O.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function GJe(n){return this.normalise(n)}function FJe(n){if(O.plainObject(n)){if(O.integer(n.width)&&O.inRange(n.width,1,65536))this.options.claheWidth=n.width;else throw O.invalidParameterError("width","integer between 1 and 65536",n.width);if(O.integer(n.height)&&O.inRange(n.height,1,65536))this.options.claheHeight=n.height;else throw O.invalidParameterError("height","integer between 1 and 65536",n.height);if(O.defined(n.maxSlope))if(O.integer(n.maxSlope)&&O.inRange(n.maxSlope,0,100))this.options.claheMaxSlope=n.maxSlope;else throw O.invalidParameterError("maxSlope","integer between 0 and 100",n.maxSlope)}else throw O.invalidParameterError("options","plain object",n);return this}function LJe(n){if(!O.object(n)||!Array.isArray(n.kernel)||!O.integer(n.width)||!O.integer(n.height)||!O.inRange(n.width,3,1001)||!O.inRange(n.height,3,1001)||n.height*n.width!==n.kernel.length||!n.kernel.every(O.number))throw new Error("Invalid convolution kernel");return O.integer(n.scale)||(n.scale=n.kernel.reduce((t,o)=>t+o,0)),n.scale<1&&(n.scale=1),O.integer(n.offset)||(n.offset=0),this.options.convKernel=n,this}function UJe(n,t){if(!O.defined(n))this.options.threshold=128;else if(O.bool(n))this.options.threshold=n?128:0;else if(O.integer(n)&&O.inRange(n,0,255))this.options.threshold=n;else throw O.invalidParameterError("threshold","integer between 0 and 255",n);return!O.object(t)||t.greyscale===!0||t.grayscale===!0?this.options.thresholdGrayscale=!0:this.options.thresholdGrayscale=!1,this}function HJe(n,t,o){if(this.options.boolean=this._createInputDescriptor(n,o),O.string(t)&&O.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw O.invalidParameterError("operator","one of: and, or, eor",t);return this}function KJe(n,t){if(!O.defined(n)&&O.number(t)?n=1:O.number(n)&&!O.defined(t)&&(t=0),!O.defined(n))this.options.linearA=[];else if(O.number(n))this.options.linearA=[n];else if(Array.isArray(n)&&n.length&&n.every(O.number))this.options.linearA=n;else throw O.invalidParameterError("a","number or array of numbers",n);if(!O.defined(t))this.options.linearB=[];else if(O.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&t.length&&t.every(O.number))this.options.linearB=t;else throw O.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw new Error("Expected a and b to be arrays of the same length");return this}function xJe(n){if(!Array.isArray(n))throw O.invalidParameterError("inputMatrix","array",n);let t=n.length;if(t!==3&&t!==4)throw O.invalidParameterError("inputMatrix","3x3 or 4x4 array",t);if(!n.every(a=>Array.isArray(a)&&a.length===t))throw O.invalidParameterError("inputMatrix",`array of ${t} arrays of length ${t}`,n);let o=n.flat();if(!o.every(O.number))throw O.invalidParameterError("inputMatrix","array of numbers",o);return this.options.recombMatrix=o,this}function YJe(n){if(!O.plainObject(n))throw O.invalidParameterError("options","plain object",n);if("brightness"in n)if(O.number(n.brightness)&&n.brightness>=0)this.options.brightness=n.brightness;else throw O.invalidParameterError("brightness","number above zero",n.brightness);if("saturation"in n)if(O.number(n.saturation)&&n.saturation>=0)this.options.saturation=n.saturation;else throw O.invalidParameterError("saturation","number above zero",n.saturation);if("hue"in n)if(O.integer(n.hue))this.options.hue=n.hue%360;else throw O.invalidParameterError("hue","number",n.hue);if("lightness"in n)if(O.number(n.lightness))this.options.lightness=n.lightness;else throw O.invalidParameterError("lightness","number",n.lightness);return this}var qte,zte,Vte=ue(()=>{Fs();qte={integer:"integer",float:"float",approximate:"approximate"};zte=n=>{Object.assign(n.prototype,{autoOrient:mJe,rotate:yJe,flip:SJe,flop:wJe,affine:DJe,sharpen:OJe,erode:TJe,dilate:_Je,median:bJe,blur:MJe,flatten:NJe,unflatten:RJe,gamma:kJe,negate:vJe,normalise:PJe,normalize:GJe,clahe:FJe,convolve:LJe,threshold:UJe,boolean:HJe,linear:KJe,recomb:xJe,modulate:YJe})}});var Are=ee((VDA,ere)=>{var C2=Object.defineProperty,jJe=Object.getOwnPropertyDescriptor,JJe=Object.getOwnPropertyNames,qJe=Object.prototype.hasOwnProperty,zJe=(n,t)=>{for(var o in t)C2(n,o,{get:t[o],enumerable:!0})},VJe=(n,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of JJe(t))!qJe.call(n,e)&&e!==o&&C2(n,e,{get:()=>t[e],enumerable:!(a=jJe(t,e))||a.enumerable});return n},WJe=n=>VJe(C2({},"__esModule",{value:!0}),n),Wte={};zJe(Wte,{default:()=>cqe});ere.exports=WJe(Wte);var d2={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let n in d2)Object.freeze(d2[n]);var Ys=Object.freeze(d2),Zte=Object.create(null);for(let n in Ys)Object.hasOwn(Ys,n)&&(Zte[Ys[n]]=n);var Xa={to:{},get:{}};Xa.get=function(n){let t=n.slice(0,3).toLowerCase(),o,a;switch(t){case"hsl":{o=Xa.get.hsl(n),a="hsl";break}case"hwb":{o=Xa.get.hwb(n),a="hwb";break}default:{o=Xa.get.rgb(n),a="rgb";break}}return o?{model:a,value:o}:null};Xa.get.rgb=function(n){if(!n)return null;let t=/^#([a-f\d]{3,4})$/i,o=/^#([a-f\d]{6})([a-f\d]{2})?$/i,a=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,e=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,i=/^(\w+)$/,A=[0,0,0,1],r,s,g;if(r=n.match(o)){for(g=r[2],r=r[1],s=0;s<3;s++){let c=s*2;A[s]=Number.parseInt(r.slice(c,c+2),16)}g&&(A[3]=Number.parseInt(g,16)/255)}else if(r=n.match(t)){for(r=r[1],g=r[3],s=0;s<3;s++)A[s]=Number.parseInt(r[s]+r[s],16);g&&(A[3]=Number.parseInt(g+g,16)/255)}else if(r=n.match(a)){for(s=0;s<3;s++)A[s]=Number.parseFloat(r[s+1]);r[4]&&(A[3]=r[5]?Number.parseFloat(r[4])*.01:Number.parseFloat(r[4]))}else if(r=n.match(e)){for(s=0;s<3;s++)A[s]=Math.round(Number.parseFloat(r[s+1])*2.55);r[4]&&(A[3]=r[5]?Number.parseFloat(r[4])*.01:Number.parseFloat(r[4]))}else return(r=n.toLowerCase().match(i))?r[1]==="transparent"?[0,0,0,0]:Object.hasOwn(Ys,r[1])?(A=Ys[r[1]].slice(),A[3]=1,A):null:null;for(s=0;s<3;s++)A[s]=pI(A[s],0,255);return A[3]=pI(A[3],0,1),A};Xa.get.hsl=function(n){if(!n)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,o=n.match(t);if(o){let a=Number.parseFloat(o[4]),e=(Number.parseFloat(o[1])%360+360)%360,i=pI(Number.parseFloat(o[2]),0,100),A=pI(Number.parseFloat(o[3]),0,100),r=pI(Number.isNaN(a)?1:a,0,1);return[e,i,A,r]}return null};Xa.get.hwb=function(n){if(!n)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,o=n.match(t);if(o){let a=Number.parseFloat(o[4]),e=(Number.parseFloat(o[1])%360+360)%360,i=pI(Number.parseFloat(o[2]),0,100),A=pI(Number.parseFloat(o[3]),0,100),r=pI(Number.isNaN(a)?1:a,0,1);return[e,i,A,r]}return null};Xa.to.hex=function(...n){return"#"+dO(n[0])+dO(n[1])+dO(n[2])+(n[3]<1?dO(Math.round(n[3]*255)):"")};Xa.to.rgb=function(...n){return n.length<4||n[3]===1?"rgb("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+")":"rgba("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+", "+n[3]+")"};Xa.to.rgb.percent=function(...n){let t=Math.round(n[0]/255*100),o=Math.round(n[1]/255*100),a=Math.round(n[2]/255*100);return n.length<4||n[3]===1?"rgb("+t+"%, "+o+"%, "+a+"%)":"rgba("+t+"%, "+o+"%, "+a+"%, "+n[3]+")"};Xa.to.hsl=function(...n){return n.length<4||n[3]===1?"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)":"hsla("+n[0]+", "+n[1]+"%, "+n[2]+"%, "+n[3]+")"};Xa.to.hwb=function(...n){let t="";return n.length>=4&&n[3]!==1&&(t=", "+n[3]),"hwb("+n[0]+", "+n[1]+"%, "+n[2]+"%"+t+")"};Xa.to.keyword=function(...n){return Zte[n.slice(0,3)]};function pI(n,t,o){return Math.min(Math.max(t,n),o)}function dO(n){let t=Math.round(n).toString(16).toUpperCase();return t.length<2?"0"+t:t}var xh=Xa,Xte={};for(let n of Object.keys(Ys))Xte[Ys[n]]=n;var sA={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},Xl=sA,Ac=(6/29)**3;function jh(n){let t=n>.0031308?1.055*n**.4166666666666667-.055:n*12.92;return Math.min(Math.max(0,t),1)}function Jh(n){return n>.04045?((n+.055)/1.055)**2.4:n/12.92}for(let n of Object.keys(sA)){if(!("channels"in sA[n]))throw new Error("missing channels property: "+n);if(!("labels"in sA[n]))throw new Error("missing channel labels property: "+n);if(sA[n].labels.length!==sA[n].channels)throw new Error("channel and label counts mismatch: "+n);let{channels:t,labels:o}=sA[n];delete sA[n].channels,delete sA[n].labels,Object.defineProperty(sA[n],"channels",{value:t}),Object.defineProperty(sA[n],"labels",{value:o})}sA.rgb.hsl=function(n){let t=n[0]/255,o=n[1]/255,a=n[2]/255,e=Math.min(t,o,a),i=Math.max(t,o,a),A=i-e,r,s;switch(i){case e:{r=0;break}case t:{r=(o-a)/A;break}case o:{r=2+(a-t)/A;break}case a:{r=4+(t-o)/A;break}}r=Math.min(r*60,360),r<0&&(r+=360);let g=(e+i)/2;return i===e?s=0:g<=.5?s=A/(i+e):s=A/(2-i-e),[r,s*100,g*100]};sA.rgb.hsv=function(n){let t,o,a,e,i,A=n[0]/255,r=n[1]/255,s=n[2]/255,g=Math.max(A,r,s),c=g-Math.min(A,r,s),I=function(p){return(g-p)/6/c+1/2};if(c===0)e=0,i=0;else{switch(i=c/g,t=I(A),o=I(r),a=I(s),g){case A:{e=a-o;break}case r:{e=1/3+t-a;break}case s:{e=2/3+o-t;break}}e<0?e+=1:e>1&&(e-=1)}return[e*360,i*100,g*100]};sA.rgb.hwb=function(n){let t=n[0],o=n[1],a=n[2],e=sA.rgb.hsl(n)[0],i=1/255*Math.min(t,Math.min(o,a));return a=1-1/255*Math.max(t,Math.max(o,a)),[e,i*100,a*100]};sA.rgb.oklab=function(n){let t=Jh(n[0]/255),o=Jh(n[1]/255),a=Jh(n[2]/255),e=Math.cbrt(.4122214708*t+.5363325363*o+.0514459929*a),i=Math.cbrt(.2119034982*t+.6806995451*o+.1073969566*a),A=Math.cbrt(.0883024619*t+.2817188376*o+.6299787005*a),r=.2104542553*e+.793617785*i-.0040720468*A,s=1.9779984951*e-2.428592205*i+.4505937099*A,g=.0259040371*e+.7827717662*i-.808675766*A;return[r*100,s*100,g*100]};sA.rgb.cmyk=function(n){let t=n[0]/255,o=n[1]/255,a=n[2]/255,e=Math.min(1-t,1-o,1-a),i=(1-t-e)/(1-e)||0,A=(1-o-e)/(1-e)||0,r=(1-a-e)/(1-e)||0;return[i*100,A*100,r*100,e*100]};function ZJe(n,t){return(n[0]-t[0])**2+(n[1]-t[1])**2+(n[2]-t[2])**2}sA.rgb.keyword=function(n){let t=Xte[n];if(t)return t;let o=Number.POSITIVE_INFINITY,a;for(let e of Object.keys(Ys)){let i=Ys[e],A=ZJe(n,i);AAc?o**(1/3):7.787*o+16/116,a=a>Ac?a**(1/3):7.787*a+16/116,e=e>Ac?e**(1/3):7.787*e+16/116;let i=116*a-16,A=500*(o-a),r=200*(a-e);return[i,A,r]};sA.hsl.rgb=function(n){let t=n[0]/360,o=n[1]/100,a=n[2]/100,e,i;if(o===0)return i=a*255,[i,i,i];let A=a<.5?a*(1+o):a+o-a*o,r=2*a-A,s=[0,0,0];for(let g=0;g<3;g++)e=t+1/3*-(g-1),e<0&&e++,e>1&&e--,6*e<1?i=r+(A-r)*6*e:2*e<1?i=A:3*e<2?i=r+(A-r)*(2/3-e)*6:i=r,s[g]=i*255;return s};sA.hsl.hsv=function(n){let t=n[0],o=n[1]/100,a=n[2]/100,e=o,i=Math.max(a,.01);a*=2,o*=a<=1?a:2-a,e*=i<=1?i:2-i;let A=(a+o)/2,r=a===0?2*e/(i+e):2*o/(a+o);return[t,r*100,A*100]};sA.hsv.rgb=function(n){let t=n[0]/60,o=n[1]/100,a=n[2]/100,e=Math.floor(t)%6,i=t-Math.floor(t),A=255*a*(1-o),r=255*a*(1-o*i),s=255*a*(1-o*(1-i));switch(a*=255,e){case 0:return[a,s,A];case 1:return[r,a,A];case 2:return[A,a,s];case 3:return[A,r,a];case 4:return[s,A,a];case 5:return[a,A,r]}};sA.hsv.hsl=function(n){let t=n[0],o=n[1]/100,a=n[2]/100,e=Math.max(a,.01),i,A;A=(2-o)*a;let r=(2-o)*e;return i=o*e,i/=r<=1?r:2-r,i=i||0,A/=2,[t,i*100,A*100]};sA.hwb.rgb=function(n){let t=n[0]/360,o=n[1]/100,a=n[2]/100,e=o+a,i;e>1&&(o/=e,a/=e);let A=Math.floor(6*t),r=1-a;i=6*t-A,(A&1)!==0&&(i=1-i);let s=o+i*(r-o),g,c,I;switch(A){default:case 6:case 0:{g=r,c=s,I=o;break}case 1:{g=s,c=r,I=o;break}case 2:{g=o,c=r,I=s;break}case 3:{g=o,c=s,I=r;break}case 4:{g=s,c=o,I=r;break}case 5:{g=r,c=o,I=s;break}}return[g*255,c*255,I*255]};sA.cmyk.rgb=function(n){let t=n[0]/100,o=n[1]/100,a=n[2]/100,e=n[3]/100,i=1-Math.min(1,t*(1-e)+e),A=1-Math.min(1,o*(1-e)+e),r=1-Math.min(1,a*(1-e)+e);return[i*255,A*255,r*255]};sA.xyz.rgb=function(n){let t=n[0]/100,o=n[1]/100,a=n[2]/100,e,i,A;return e=t*3.2404542+o*-1.5371385+a*-.4985314,i=t*-.969266+o*1.8760108+a*.041556,A=t*.0556434+o*-.2040259+a*1.0572252,e=jh(e),i=jh(i),A=jh(A),[e*255,i*255,A*255]};sA.xyz.lab=function(n){let t=n[0],o=n[1],a=n[2];t/=95.047,o/=100,a/=108.883,t=t>Ac?t**(1/3):7.787*t+16/116,o=o>Ac?o**(1/3):7.787*o+16/116,a=a>Ac?a**(1/3):7.787*a+16/116;let e=116*o-16,i=500*(t-o),A=200*(o-a);return[e,i,A]};sA.xyz.oklab=function(n){let t=n[0]/100,o=n[1]/100,a=n[2]/100,e=Math.cbrt(.8189330101*t+.3618667424*o-.1288597137*a),i=Math.cbrt(.0329845436*t+.9293118715*o+.0361456387*a),A=Math.cbrt(.0482003018*t+.2643662691*o+.633851707*a),r=.2104542553*e+.793617785*i-.0040720468*A,s=1.9779984951*e-2.428592205*i+.4505937099*A,g=.0259040371*e+.7827717662*i-.808675766*A;return[r*100,s*100,g*100]};sA.oklab.oklch=function(n){return sA.lab.lch(n)};sA.oklab.xyz=function(n){let t=n[0]/100,o=n[1]/100,a=n[2]/100,e=(.999999998*t+.396337792*o+.215803758*a)**3,i=(1.000000008*t-.105561342*o-.063854175*a)**3,A=(1.000000055*t-.089484182*o-1.291485538*a)**3,r=1.227013851*e-.55779998*i+.281256149*A,s=-.040580178*e+1.11225687*i-.071676679*A,g=-.076381285*e-.421481978*i+1.58616322*A;return[r*100,s*100,g*100]};sA.oklab.rgb=function(n){let t=n[0]/100,o=n[1]/100,a=n[2]/100,e=(t+.3963377774*o+.2158037573*a)**3,i=(t-.1055613458*o-.0638541728*a)**3,A=(t-.0894841775*o-1.291485548*a)**3,r=jh(4.0767416621*e-3.3077115913*i+.2309699292*A),s=jh(-1.2684380046*e+2.6097574011*i-.3413193965*A),g=jh(-.0041960863*e-.7034186147*i+1.707614701*A);return[r*255,s*255,g*255]};sA.oklch.oklab=function(n){return sA.lch.lab(n)};sA.lab.xyz=function(n){let t=n[0],o=n[1],a=n[2],e,i,A;i=(t+16)/116,e=o/500+i,A=i-a/200;let r=i**3,s=e**3,g=A**3;return i=r>Ac?r:(i-16/116)/7.787,e=s>Ac?s:(e-16/116)/7.787,A=g>Ac?g:(A-16/116)/7.787,e*=95.047,i*=100,A*=108.883,[e,i,A]};sA.lab.lch=function(n){let t=n[0],o=n[1],a=n[2],e;e=Math.atan2(a,o)*360/2/Math.PI,e<0&&(e+=360);let A=Math.sqrt(o*o+a*a);return[t,A,e]};sA.lch.lab=function(n){let t=n[0],o=n[1],e=n[2]/360*2*Math.PI,i=o*Math.cos(e),A=o*Math.sin(e);return[t,i,A]};sA.rgb.ansi16=function(n,t=null){let[o,a,e]=n,i=t===null?sA.rgb.hsv(n)[2]:t;if(i=Math.round(i/50),i===0)return 30;let A=30+(Math.round(e/255)<<2|Math.round(a/255)<<1|Math.round(o/255));return i===2&&(A+=60),A};sA.hsv.ansi16=function(n){return sA.rgb.ansi16(sA.hsv.rgb(n),n[2])};sA.rgb.ansi256=function(n){let t=n[0],o=n[1],a=n[2];return t>>4===o>>4&&o>>4===a>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(o/255*5)+Math.round(a/255*5)};sA.ansi16.rgb=function(n){n=n[0];let t=n%10;if(t===0||t===7)return n>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let o=(Math.trunc(n>50)+1)*.5,a=(t&1)*o*255,e=(t>>1&1)*o*255,i=(t>>2&1)*o*255;return[a,e,i]};sA.ansi256.rgb=function(n){if(n=n[0],n>=232){let i=(n-232)*10+8;return[i,i,i]}n-=16;let t,o=Math.floor(n/36)/5*255,a=Math.floor((t=n%36)/6)/5*255,e=t%6/5*255;return[o,a,e]};sA.rgb.hex=function(n){let o=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".slice(o.length)+o};sA.hex.rgb=function(n){let t=n.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let o=t[0];t[0].length===3&&(o=[...o].map(r=>r+r).join(""));let a=Number.parseInt(o,16),e=a>>16&255,i=a>>8&255,A=a&255;return[e,i,A]};sA.rgb.hcg=function(n){let t=n[0]/255,o=n[1]/255,a=n[2]/255,e=Math.max(Math.max(t,o),a),i=Math.min(Math.min(t,o),a),A=e-i,r,s=A<1?i/(1-A):0;return A<=0?r=0:e===t?r=(o-a)/A%6:e===o?r=2+(a-t)/A:r=4+(t-o)/A,r/=6,r%=1,[r*360,A*100,s*100]};sA.hsl.hcg=function(n){let t=n[1]/100,o=n[2]/100,a=o<.5?2*t*o:2*t*(1-o),e=0;return a<1&&(e=(o-.5*a)/(1-a)),[n[0],a*100,e*100]};sA.hsv.hcg=function(n){let t=n[1]/100,o=n[2]/100,a=t*o,e=0;return a<1&&(e=(o-a)/(1-a)),[n[0],a*100,e*100]};sA.hcg.rgb=function(n){let t=n[0]/360,o=n[1]/100,a=n[2]/100;if(o===0)return[a*255,a*255,a*255];let e=[0,0,0],i=t%1*6,A=i%1,r=1-A,s=0;switch(Math.floor(i)){case 0:{e[0]=1,e[1]=A,e[2]=0;break}case 1:{e[0]=r,e[1]=1,e[2]=0;break}case 2:{e[0]=0,e[1]=1,e[2]=A;break}case 3:{e[0]=0,e[1]=r,e[2]=1;break}case 4:{e[0]=A,e[1]=0,e[2]=1;break}default:e[0]=1,e[1]=0,e[2]=r}return s=(1-o)*a,[(o*e[0]+s)*255,(o*e[1]+s)*255,(o*e[2]+s)*255]};sA.hcg.hsv=function(n){let t=n[1]/100,o=n[2]/100,a=t+o*(1-t),e=0;return a>0&&(e=t/a),[n[0],e*100,a*100]};sA.hcg.hsl=function(n){let t=n[1]/100,a=n[2]/100*(1-t)+.5*t,e=0;return a>0&&a<.5?e=t/(2*a):a>=.5&&a<1&&(e=t/(2*(1-a))),[n[0],e*100,a*100]};sA.hcg.hwb=function(n){let t=n[1]/100,o=n[2]/100,a=t+o*(1-t);return[n[0],(a-t)*100,(1-a)*100]};sA.hwb.hcg=function(n){let t=n[1]/100,a=1-n[2]/100,e=a-t,i=0;return e<1&&(i=(a-e)/(1-e)),[n[0],e*100,i*100]};sA.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};sA.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};sA.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};sA.gray.hsl=function(n){return[0,0,n[0]]};sA.gray.hsv=sA.gray.hsl;sA.gray.hwb=function(n){return[0,100,n[0]]};sA.gray.cmyk=function(n){return[0,0,0,n[0]]};sA.gray.lab=function(n){return[n[0],0,0]};sA.gray.hex=function(n){let t=Math.round(n[0]/100*255)&255,a=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(a.length)+a};sA.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]};function XJe(){let n={},t=Object.keys(Xl);for(let{length:o}=t,a=0;a0;){let a=o.pop(),e=Object.keys(Xl[a]);for(let{length:i}=e,A=0;A1&&(o=a),n(o))};return"conversion"in n&&(t.conversion=n.conversion),t}function oqe(n){let t=function(...o){let a=o[0];if(a==null)return a;a.length>1&&(o=a);let e=n(o);if(typeof e=="object")for(let{length:i}=e,A=0;A0){this.model=t||"rgb",a=fo[this.model].channels;let e=Array.prototype.slice.call(n,0,a);this.color=u2(e,a),this.valpha=typeof n[a]=="number"?n[a]:1}else if(typeof n=="number")this.model="rgb",this.color=[n>>16&255,n>>8&255,n&255],this.valpha=1;else{this.valpha=1;let e=Object.keys(n);"alpha"in n&&(e.splice(e.indexOf("alpha"),1),this.valpha=typeof n.alpha=="number"?n.alpha:0);let i=e.sort().join("");if(!(i in h2))throw new Error("Unable to parse color from object: "+JSON.stringify(n));this.model=h2[i];let{labels:A}=fo[this.model],r=[];for(o=0;o(n%360+360)%360),saturationl:Mr("hsl",1,Xr(100)),lightness:Mr("hsl",2,Xr(100)),saturationv:Mr("hsv",1,Xr(100)),value:Mr("hsv",2,Xr(100)),chroma:Mr("hcg",1,Xr(100)),gray:Mr("hcg",2,Xr(100)),white:Mr("hwb",1,Xr(100)),wblack:Mr("hwb",2,Xr(100)),cyan:Mr("cmyk",0,Xr(100)),magenta:Mr("cmyk",1,Xr(100)),yellow:Mr("cmyk",2,Xr(100)),black:Mr("cmyk",3,Xr(100)),x:Mr("xyz",0,Xr(95.047)),y:Mr("xyz",1,Xr(100)),z:Mr("xyz",2,Xr(108.833)),l:Mr("lab",0,Xr(100)),a:Mr("lab",1),b:Mr("lab",2),keyword(n){return n!==void 0?new Bi(n):fo[this.model].keyword(this.color)},hex(n){return n!==void 0?new Bi(n):xh.to.hex(...this.rgb().round().color)},hexa(n){if(n!==void 0)return new Bi(n);let t=this.rgb().round().color,o=Math.round(this.valpha*255).toString(16).toUpperCase();return o.length===1&&(o="0"+o),xh.to.hex(...t)+o},rgbNumber(){let n=this.rgb().color;return(n[0]&255)<<16|(n[1]&255)<<8|n[2]&255},luminosity(){let n=this.rgb().color,t=[];for(let[o,a]of n.entries()){let e=a/255;t[o]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(n){let t=this.luminosity(),o=n.luminosity();return t>o?(t+.05)/(o+.05):(o+.05)/(t+.05)},level(n){let t=this.contrast(n);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){let n=this.rgb().color;return(n[0]*2126+n[1]*7152+n[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let n=this.rgb();for(let t=0;t<3;t++)n.color[t]=255-n.color[t];return n},lighten(n){let t=this.hsl();return t.color[2]+=t.color[2]*n,t},darken(n){let t=this.hsl();return t.color[2]-=t.color[2]*n,t},saturate(n){let t=this.hsl();return t.color[1]+=t.color[1]*n,t},desaturate(n){let t=this.hsl();return t.color[1]-=t.color[1]*n,t},whiten(n){let t=this.hwb();return t.color[1]+=t.color[1]*n,t},blacken(n){let t=this.hwb();return t.color[2]+=t.color[2]*n,t},grayscale(){let n=this.rgb().color,t=n[0]*.3+n[1]*.59+n[2]*.11;return Bi.rgb(t,t,t)},fade(n){return this.alpha(this.valpha-this.valpha*n)},opaquer(n){return this.alpha(this.valpha+this.valpha*n)},rotate(n){let t=this.hsl(),o=t.color[0];return o=(o+n)%360,o=o<0?360+o:o,t.color[0]=o,t},mix(n,t){if(!n||!n.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof n);let o=n.rgb(),a=this.rgb(),e=t===void 0?.5:t,i=2*e-1,A=o.alpha()-a.alpha(),r=((i*A===-1?i:(i+A)/(1+i*A))+1)/2,s=1-r;return Bi.rgb(r*o.red()+s*a.red(),r*o.green()+s*a.green(),r*o.blue()+s*a.blue(),o.alpha()*e+a.alpha()*(1-e))}};for(let n of Object.keys(fo)){if($te.includes(n))continue;let{channels:t}=fo[n];Bi.prototype[n]=function(...o){return this.model===n?new Bi(this):o.length>0?new Bi(o,n):new Bi([...gqe(fo[this.model][n].raw(this.color)),this.valpha],n)},Bi[n]=function(...o){let a=o[0];return typeof a=="number"&&(a=u2(o,t)),new Bi(a,n)}}function nqe(n,t){return Number(n.toFixed(t))}function sqe(n){return function(t){return nqe(t,n)}}function Mr(n,t,o){n=Array.isArray(n)?n:[n];for(let a of n)(E2[a]||=[])[t]=o;return n=n[0],function(a){let e;return a!==void 0?(o&&(a=o(a)),e=this[n](),e.color[t]=a,e):(e=this[n]().color[t],o&&(e=o(e)),e)}}function Xr(n){return function(t){return Math.max(0,Math.min(n,t))}}function gqe(n){return Array.isArray(n)?n:[n]}function u2(n,t){for(let o=0;o{tre.exports=Are().default});function Iqe(n){return this._setBackgroundColourOption("tint",n),this}function lqe(n){return this.options.greyscale=O.bool(n)?n:!0,this}function pqe(n){return this.greyscale(n)}function dqe(n){if(!O.string(n))throw O.invalidParameterError("colourspace","string",n);return this.options.colourspacePipeline=n,this}function hqe(n){return this.pipelineColourspace(n)}function Eqe(n){if(!O.string(n))throw O.invalidParameterError("colourspace","string",n);return this.options.colourspace=n,this}function uqe(n){return this.toColourspace(n)}function ore(n){if(O.object(n)||O.string(n)&&n.length>=3&&n.length<=200){let t=(0,are.default)(n),o=t.red(),a=t.green(),e=t.blue(),i=Math.round(t.alpha()*255);for(let[A,r]of[["red",o],["green",a],["blue",e],["alpha",i]])if(!O.number(r))throw O.invalidParameterError(`background.${A}`,"number",r);return[o,a,e,i]}else throw O.invalidParameterError("background","object or string",n)}function Cqe(n,t){O.defined(t)&&(this.options[n]=ore(t))}var are,ire,nre,sre=ue(()=>{are=ze(rre(),1);Fs();ire={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};nre=n=>{Object.assign(n.prototype,{tint:Iqe,greyscale:lqe,grayscale:pqe,pipelineColourspace:dqe,pipelineColorspace:hqe,toColourspace:Eqe,toColorspace:uqe,_getBackgroundColourOption:ore,_setBackgroundColourOption:Cqe}),n.colourspace=ire,n.colorspace=ire}});function fqe(){return this.options.removeAlpha=!0,this}function Qqe(n){if(O.defined(n))if(O.number(n)&&O.inRange(n,0,1))this.options.ensureAlpha=n;else throw O.invalidParameterError("alpha","number between 0 and 1",n);else this.options.ensureAlpha=1;return this}function yqe(n){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(n)&&(n=t[n]),O.integer(n)&&O.inRange(n,0,4))this.options.extractChannel=n;else throw O.invalidParameterError("channel","integer or one of: red, green, blue, alpha",n);return this}function mqe(n,t){return Array.isArray(n)?n.forEach(function(o){this.options.joinChannelIn.push(this._createInputDescriptor(o,t))},this):this.options.joinChannelIn.push(this._createInputDescriptor(n,t)),this}function Sqe(n){if(O.string(n)&&O.inArray(n,["and","or","eor"]))this.options.bandBoolOp=n;else throw O.invalidParameterError("boolOp","one of: and, or, eor",n);return this}var Bqe,gre,cre=ue(()=>{Fs();Bqe={and:"and",or:"or",eor:"eor"};gre=n=>{Object.assign(n.prototype,{removeAlpha:fqe,ensureAlpha:Qqe,extractChannel:yqe,joinChannel:mqe,bandbool:Sqe}),n.bool=Bqe}});import B2 from"node:path";function Dqe(n,t){let o;if(O.string(n)?O.string(this.options.input.file)&&B2.resolve(this.options.input.file)===B2.resolve(n)?o=new Error("Cannot use same file for input and output"):wqe.test(B2.extname(n))&&!this.constructor.format.jp2.output.file&&(o=lre()):o=new Error("Missing output file path"),o)if(O.fn(t))t(o);else return Promise.reject(o);else{this.options.fileOut=n;let a=Error();return this._pipeline(t,a)}return this}function Oqe(n,t){O.object(n)?this._setBooleanOption("resolveWithObject",n.resolveWithObject):this.options.resolveWithObject&&(this.options.resolveWithObject=!1),this.options.fileOut="";let o=Error();return this._pipeline(O.fn(n)?n:t,o)}function bqe(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let n=Error();return this._pipeline(null,n)}function Mqe(n){if(O.number(n)&&n>0)this.options.withMetadataDensity=n;else throw O.invalidParameterError("density","positive number",n);return this.keepExif()}function _qe(){return this.options.keepMetadata|=1,this}function Tqe(n){if(O.object(n))for(let[t,o]of Object.entries(n))if(O.object(o))for(let[a,e]of Object.entries(o))if(O.string(e))this.options.withExif[`exif-${t.toLowerCase()}-${a}`]=e;else throw O.invalidParameterError(`${t}.${a}`,"string",e);else throw O.invalidParameterError(t,"object",o);else throw O.invalidParameterError("exif","object",n);return this.options.withExifMerge=!1,this.keepExif()}function Nqe(n){return this.withExif(n),this.options.withExifMerge=!0,this}function Rqe(){return this.options.keepMetadata|=8,this}function kqe(n,t){if(O.string(n))this.options.withIccProfile=n;else throw O.invalidParameterError("icc","string",n);if(this.keepIccProfile(),O.object(t)&&O.defined(t.attach))if(O.bool(t.attach))t.attach||(this.options.keepMetadata&=-9);else throw O.invalidParameterError("attach","boolean",t.attach);return this}function vqe(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function Pqe(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function Gqe(){return this.options.keepMetadata|=2,this}function Fqe(n){if(O.string(n)&&n.length>0)this.options.withXmp=n,this.options.keepMetadata|=2;else throw O.invalidParameterError("xmp","non-empty string",n);return this}function Lqe(){return this.options.keepMetadata|=31,this}function Uqe(n){if(this.keepMetadata(),this.withIccProfile("srgb"),O.object(n)){if(O.defined(n.orientation))if(O.integer(n.orientation)&&O.inRange(n.orientation,1,8))this.options.withMetadataOrientation=n.orientation;else throw O.invalidParameterError("orientation","integer between 1 and 8",n.orientation);if(O.defined(n.density))if(O.number(n.density)&&n.density>0)this.options.withMetadataDensity=n.density;else throw O.invalidParameterError("density","positive number",n.density);O.defined(n.icc)&&this.withIccProfile(n.icc),O.defined(n.exif)&&this.withExifMerge(n.exif)}return this}function Hqe(n,t){let o=Ire.get((O.object(n)&&O.string(n.id)?n.id:n).toLowerCase());if(!o)throw O.invalidParameterError("format",`one of: ${[...Ire.keys()].join(", ")}`,n);return this[o](t)}function Kqe(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.jpegQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.progressive)&&this._setBooleanOption("jpegProgressive",n.progressive),O.defined(n.chromaSubsampling))if(O.string(n.chromaSubsampling)&&O.inArray(n.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=n.chromaSubsampling;else throw O.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",n.chromaSubsampling);let t=O.bool(n.optimizeCoding)?n.optimizeCoding:n.optimiseCoding;if(O.defined(t)&&this._setBooleanOption("jpegOptimiseCoding",t),O.defined(n.mozjpeg))if(O.bool(n.mozjpeg))n.mozjpeg&&(this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3);else throw O.invalidParameterError("mozjpeg","boolean",n.mozjpeg);let o=O.bool(n.trellisQuantization)?n.trellisQuantization:n.trellisQuantisation;O.defined(o)&&this._setBooleanOption("jpegTrellisQuantisation",o),O.defined(n.overshootDeringing)&&this._setBooleanOption("jpegOvershootDeringing",n.overshootDeringing);let a=O.bool(n.optimizeScans)?n.optimizeScans:n.optimiseScans;O.defined(a)&&(this._setBooleanOption("jpegOptimiseScans",a),a&&(this.options.jpegProgressive=!0));let e=O.number(n.quantizationTable)?n.quantizationTable:n.quantisationTable;if(O.defined(e))if(O.integer(e)&&O.inRange(e,0,8))this.options.jpegQuantisationTable=e;else throw O.invalidParameterError("quantisationTable","integer between 0 and 8",e)}return this._updateFormatOut("jpeg",n)}function xqe(n){if(O.object(n)){if(O.defined(n.progressive)&&this._setBooleanOption("pngProgressive",n.progressive),O.defined(n.compressionLevel))if(O.integer(n.compressionLevel)&&O.inRange(n.compressionLevel,0,9))this.options.pngCompressionLevel=n.compressionLevel;else throw O.invalidParameterError("compressionLevel","integer between 0 and 9",n.compressionLevel);O.defined(n.adaptiveFiltering)&&this._setBooleanOption("pngAdaptiveFiltering",n.adaptiveFiltering);let t=n.colours||n.colors;if(O.defined(t))if(O.integer(t)&&O.inRange(t,2,256))this.options.pngBitdepth=pre(t);else throw O.invalidParameterError("colours","integer between 2 and 256",t);if(O.defined(n.palette)?this._setBooleanOption("pngPalette",n.palette):[n.quality,n.effort,n.colours,n.colors,n.dither].some(O.defined)&&this._setBooleanOption("pngPalette",!0),this.options.pngPalette){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,0,100))this.options.pngQuality=n.quality;else throw O.invalidParameterError("quality","integer between 0 and 100",n.quality);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,1,10))this.options.pngEffort=n.effort;else throw O.invalidParameterError("effort","integer between 1 and 10",n.effort);if(O.defined(n.dither))if(O.number(n.dither)&&O.inRange(n.dither,0,1))this.options.pngDither=n.dither;else throw O.invalidParameterError("dither","number between 0.0 and 1.0",n.dither)}}return this._updateFormatOut("png",n)}function Yqe(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.webpQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.alphaQuality))if(O.integer(n.alphaQuality)&&O.inRange(n.alphaQuality,0,100))this.options.webpAlphaQuality=n.alphaQuality;else throw O.invalidParameterError("alphaQuality","integer between 0 and 100",n.alphaQuality);if(O.defined(n.lossless)&&this._setBooleanOption("webpLossless",n.lossless),O.defined(n.nearLossless)&&this._setBooleanOption("webpNearLossless",n.nearLossless),O.defined(n.smartSubsample)&&this._setBooleanOption("webpSmartSubsample",n.smartSubsample),O.defined(n.smartDeblock)&&this._setBooleanOption("webpSmartDeblock",n.smartDeblock),O.defined(n.preset))if(O.string(n.preset)&&O.inArray(n.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=n.preset;else throw O.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",n.preset);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,0,6))this.options.webpEffort=n.effort;else throw O.invalidParameterError("effort","integer between 0 and 6",n.effort);O.defined(n.minSize)&&this._setBooleanOption("webpMinSize",n.minSize),O.defined(n.mixed)&&this._setBooleanOption("webpMixed",n.mixed),O.defined(n.exact)&&this._setBooleanOption("webpExact",n.exact)}return f2(n,this.options),this._updateFormatOut("webp",n)}function jqe(n){if(O.object(n)){O.defined(n.reuse)&&this._setBooleanOption("gifReuse",n.reuse),O.defined(n.progressive)&&this._setBooleanOption("gifProgressive",n.progressive);let t=n.colours||n.colors;if(O.defined(t))if(O.integer(t)&&O.inRange(t,2,256))this.options.gifBitdepth=pre(t);else throw O.invalidParameterError("colours","integer between 2 and 256",t);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,1,10))this.options.gifEffort=n.effort;else throw O.invalidParameterError("effort","integer between 1 and 10",n.effort);if(O.defined(n.dither))if(O.number(n.dither)&&O.inRange(n.dither,0,1))this.options.gifDither=n.dither;else throw O.invalidParameterError("dither","number between 0.0 and 1.0",n.dither);if(O.defined(n.interFrameMaxError))if(O.number(n.interFrameMaxError)&&O.inRange(n.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=n.interFrameMaxError;else throw O.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",n.interFrameMaxError);if(O.defined(n.interPaletteMaxError))if(O.number(n.interPaletteMaxError)&&O.inRange(n.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=n.interPaletteMaxError;else throw O.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",n.interPaletteMaxError);if(O.defined(n.keepDuplicateFrames))if(O.bool(n.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",n.keepDuplicateFrames);else throw O.invalidParameterError("keepDuplicateFrames","boolean",n.keepDuplicateFrames)}return f2(n,this.options),this._updateFormatOut("gif",n)}function Jqe(n){if(!this.constructor.format.jp2.output.buffer)throw lre();if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.jp2Quality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.lossless))if(O.bool(n.lossless))this.options.jp2Lossless=n.lossless;else throw O.invalidParameterError("lossless","boolean",n.lossless);if(O.defined(n.tileWidth))if(O.integer(n.tileWidth)&&O.inRange(n.tileWidth,1,32768))this.options.jp2TileWidth=n.tileWidth;else throw O.invalidParameterError("tileWidth","integer between 1 and 32768",n.tileWidth);if(O.defined(n.tileHeight))if(O.integer(n.tileHeight)&&O.inRange(n.tileHeight,1,32768))this.options.jp2TileHeight=n.tileHeight;else throw O.invalidParameterError("tileHeight","integer between 1 and 32768",n.tileHeight);if(O.defined(n.chromaSubsampling))if(O.string(n.chromaSubsampling)&&O.inArray(n.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=n.chromaSubsampling;else throw O.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",n.chromaSubsampling)}return this._updateFormatOut("jp2",n)}function f2(n,t){if(O.object(n)&&O.defined(n.loop))if(O.integer(n.loop)&&O.inRange(n.loop,0,65535))t.loop=n.loop;else throw O.invalidParameterError("loop","integer between 0 and 65535",n.loop);if(O.object(n)&&O.defined(n.delay))if(O.integer(n.delay)&&O.inRange(n.delay,0,65535))t.delay=[n.delay];else if(Array.isArray(n.delay)&&n.delay.every(O.integer)&&n.delay.every(o=>O.inRange(o,0,65535)))t.delay=n.delay;else throw O.invalidParameterError("delay","integer or an array of integers between 0 and 65535",n.delay)}function qqe(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.tiffQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.bitdepth))if(O.integer(n.bitdepth)&&O.inArray(n.bitdepth,[1,2,4]))this.options.tiffBitdepth=n.bitdepth;else throw O.invalidParameterError("bitdepth","1, 2 or 4",n.bitdepth);if(O.defined(n.tile)&&this._setBooleanOption("tiffTile",n.tile),O.defined(n.tileWidth))if(O.integer(n.tileWidth)&&O.inRange(n.tileWidth,1,32768))this.options.tiffTileWidth=n.tileWidth;else throw O.invalidParameterError("tileWidth","integer between 1 and 32768",n.tileWidth);if(O.defined(n.tileHeight))if(O.integer(n.tileHeight)&&O.inRange(n.tileHeight,1,32768))this.options.tiffTileHeight=n.tileHeight;else throw O.invalidParameterError("tileHeight","integer between 1 and 32768",n.tileHeight);if(O.defined(n.miniswhite)&&this._setBooleanOption("tiffMiniswhite",n.miniswhite),O.defined(n.pyramid)&&this._setBooleanOption("tiffPyramid",n.pyramid),O.defined(n.xres))if(O.number(n.xres)&&O.inRange(n.xres,.001,1e6))this.options.tiffXres=n.xres;else throw O.invalidParameterError("xres","number between 0.001 and 1000000",n.xres);if(O.defined(n.yres))if(O.number(n.yres)&&O.inRange(n.yres,.001,1e6))this.options.tiffYres=n.yres;else throw O.invalidParameterError("yres","number between 0.001 and 1000000",n.yres);if(O.defined(n.compression))if(O.string(n.compression)&&O.inArray(n.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=n.compression;else throw O.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",n.compression);if(O.defined(n.bigtiff)&&this._setBooleanOption("tiffBigtiff",n.bigtiff),O.defined(n.predictor))if(O.string(n.predictor)&&O.inArray(n.predictor,["none","horizontal","float"]))this.options.tiffPredictor=n.predictor;else throw O.invalidParameterError("predictor","one of: none, horizontal, float",n.predictor);if(O.defined(n.resolutionUnit))if(O.string(n.resolutionUnit)&&O.inArray(n.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=n.resolutionUnit;else throw O.invalidParameterError("resolutionUnit","one of: inch, cm",n.resolutionUnit)}return this._updateFormatOut("tiff",n)}function zqe(n){return this.heif({...n,compression:"av1"})}function Vqe(n){if(O.object(n)){if(O.string(n.compression)&&O.inArray(n.compression,["av1","hevc"]))this.options.heifCompression=n.compression;else throw O.invalidParameterError("compression","one of: av1, hevc",n.compression);if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.heifQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.lossless))if(O.bool(n.lossless))this.options.heifLossless=n.lossless;else throw O.invalidParameterError("lossless","boolean",n.lossless);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,0,9))this.options.heifEffort=n.effort;else throw O.invalidParameterError("effort","integer between 0 and 9",n.effort);if(O.defined(n.chromaSubsampling))if(O.string(n.chromaSubsampling)&&O.inArray(n.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=n.chromaSubsampling;else throw O.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",n.chromaSubsampling);if(O.defined(n.bitdepth))if(O.integer(n.bitdepth)&&O.inArray(n.bitdepth,[8,10,12]))this.options.heifBitdepth=n.bitdepth;else throw O.invalidParameterError("bitdepth","8, 10 or 12",n.bitdepth);if(O.defined(n.tune))if(O.string(n.tune)&&O.inArray(n.tune,["auto","iq","psnr","ssim"]))this.options.heifLossless&&n.tune==="iq"?this.options.heifTune="ssim":this.options.heifTune=n.tune;else throw O.invalidParameterError("tune","one of: auto, iq, psnr, ssim",n.tune)}else throw O.invalidParameterError("options","Object",n);return this._updateFormatOut("heif",n)}function Wqe(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.jxlDistance=n.quality>=30?.1+(100-n.quality)*.09:53/3e3*n.quality*n.quality-23/20*n.quality+25;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);else if(O.defined(n.distance))if(O.number(n.distance)&&O.inRange(n.distance,0,15))this.options.jxlDistance=n.distance;else throw O.invalidParameterError("distance","number between 0.0 and 15.0",n.distance);if(O.defined(n.decodingTier))if(O.integer(n.decodingTier)&&O.inRange(n.decodingTier,0,4))this.options.jxlDecodingTier=n.decodingTier;else throw O.invalidParameterError("decodingTier","integer between 0 and 4",n.decodingTier);if(O.defined(n.lossless))if(O.bool(n.lossless))this.options.jxlLossless=n.lossless;else throw O.invalidParameterError("lossless","boolean",n.lossless);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,1,9))this.options.jxlEffort=n.effort;else throw O.invalidParameterError("effort","integer between 1 and 9",n.effort)}return f2(n,this.options),this._updateFormatOut("jxl",n)}function Zqe(n){if(O.object(n)&&O.defined(n.depth))if(O.string(n.depth)&&O.inArray(n.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=n.depth;else throw O.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",n.depth);return this._updateFormatOut("raw")}function Xqe(n){if(O.object(n)){if(O.defined(n.size))if(O.integer(n.size)&&O.inRange(n.size,1,8192))this.options.tileSize=n.size;else throw O.invalidParameterError("size","integer between 1 and 8192",n.size);if(O.defined(n.overlap))if(O.integer(n.overlap)&&O.inRange(n.overlap,0,8192)){if(n.overlap>this.options.tileSize)throw O.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,n.overlap);this.options.tileOverlap=n.overlap}else throw O.invalidParameterError("overlap","integer between 0 and 8192",n.overlap);if(O.defined(n.container))if(O.string(n.container)&&O.inArray(n.container,["fs","zip"]))this.options.tileContainer=n.container;else throw O.invalidParameterError("container","one of: fs, zip",n.container);if(O.defined(n.layout))if(O.string(n.layout)&&O.inArray(n.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=n.layout;else throw O.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",n.layout);if(O.defined(n.angle))if(O.integer(n.angle)&&!(n.angle%90))this.options.tileAngle=n.angle;else throw O.invalidParameterError("angle","positive/negative multiple of 90",n.angle);if(this._setBackgroundColourOption("tileBackground",n.background),O.defined(n.depth))if(O.string(n.depth)&&O.inArray(n.depth,["onepixel","onetile","one"]))this.options.tileDepth=n.depth;else throw O.invalidParameterError("depth","one of: onepixel, onetile, one",n.depth);if(O.defined(n.skipBlanks))if(O.integer(n.skipBlanks)&&O.inRange(n.skipBlanks,-1,65535))this.options.tileSkipBlanks=n.skipBlanks;else throw O.invalidParameterError("skipBlanks","integer between -1 and 255/65535",n.skipBlanks);else O.defined(n.layout)&&n.layout==="google"&&(this.options.tileSkipBlanks=5);let t=O.bool(n.center)?n.center:n.centre;if(O.defined(t)&&this._setBooleanOption("tileCentre",t),O.defined(n.id))if(O.string(n.id))this.options.tileId=n.id;else throw O.invalidParameterError("id","string",n.id);if(O.defined(n.basename))if(O.string(n.basename))this.options.tileBasename=n.basename;else throw O.invalidParameterError("basename","string",n.basename)}if(O.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw O.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function $qe(n){if(!O.plainObject(n))throw O.invalidParameterError("options","object",n);if(O.integer(n.seconds)&&O.inRange(n.seconds,0,3600))this.options.timeoutSeconds=n.seconds;else throw O.invalidParameterError("seconds","integer between 0 and 3600",n.seconds);return this}function e4e(n,t){return O.object(t)&&t.force===!1||(this.options.formatOut=n),this}function A4e(n,t){if(O.bool(t))this.options[n]=t;else throw O.invalidParameterError(n,"boolean",t)}function t4e(){if(!this.options.streamOut){this.options.streamOut=!0;let n=Error();this._pipeline(void 0,n)}}function r4e(n,t){return typeof n=="function"?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),Ot.pipeline(this.options,(o,a,e)=>{o?n(O.nativeError(o,t)):n(null,a,e)})}):Ot.pipeline(this.options,(o,a,e)=>{o?n(O.nativeError(o,t)):n(null,a,e)}),this):this.options.streamOut?(this._isStreamInput()?(this.once("finish",()=>{this._flattenBufferIn(),Ot.pipeline(this.options,(o,a,e)=>{o?this.emit("error",O.nativeError(o,t)):(this.emit("info",e),this.push(a)),this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished&&this.emit("finish")):Ot.pipeline(this.options,(o,a,e)=>{o?this.emit("error",O.nativeError(o,t)):(this.emit("info",e),this.push(a)),this.push(null),this.on("end",()=>this.emit("close"))}),this):this._isStreamInput()?new Promise((o,a)=>{this.once("finish",()=>{this._flattenBufferIn(),Ot.pipeline(this.options,(e,i,A)=>{e?a(O.nativeError(e,t)):this.options.resolveWithObject?o({data:i,info:A}):o(i)})})}):new Promise((o,a)=>{Ot.pipeline(this.options,(e,i,A)=>{e?a(O.nativeError(e,t)):this.options.resolveWithObject?o({data:i,info:A}):o(i)})})}var Ire,wqe,lre,pre,dre,hre=ue(()=>{Fs();of();Ire=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),wqe=/\.(jp[2x]|j2[kc])$/i,lre=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),pre=n=>1<<31-Math.clz32(Math.ceil(Math.log2(n)));dre=n=>{Object.assign(n.prototype,{toFile:Dqe,toBuffer:Oqe,toUint8Array:bqe,withDensity:Mqe,keepExif:_qe,withExif:Tqe,withExifMerge:Nqe,keepIccProfile:Rqe,withIccProfile:kqe,keepGainMap:vqe,withGainMap:Pqe,keepXmp:Gqe,withXmp:Fqe,keepMetadata:Lqe,withMetadata:Uqe,toFormat:Hqe,jpeg:Kqe,jp2:Jqe,png:xqe,webp:Yqe,tiff:qqe,avif:zqe,heif:Vqe,jxl:Wqe,gif:jqe,raw:Zqe,tile:Xqe,timeout:$qe,_updateFormatOut:e4e,_setBooleanOption:A4e,_read:t4e,_pipeline:r4e})}});import i4e from"node:events";import{createRequire as a4e}from"node:module";import{availableParallelism as o4e}from"node:os";function ure(n){if(O.bool(n))return n?Ot.cache(50,20,100):Ot.cache(0,0,0);if(O.object(n)){for(let t of["memory","files","items"]){let o=n[t];if(O.defined(o)&&!(O.integer(o)&&o>=0))throw O.invalidParameterError(t,"a positive integer",o)}return Ot.cache(n.memory,n.files,n.items)}else return Ot.cache()}function s4e(n){return Ot.concurrency(O.integer(n)?n:null)}function c4e(){return Ot.counters()}function I4e(n){return Ot.simd(O.bool(n)?n:null)}function l4e(n){if(O.object(n))if(Array.isArray(n.operation)&&n.operation.every(O.string))Ot.block(n.operation,!0);else throw O.invalidParameterError("operation","Array",n.operation);else throw O.invalidParameterError("options","object",n)}function p4e(n){if(O.object(n))if(Array.isArray(n.operation)&&n.operation.every(O.string))Ot.block(n.operation,!1);else throw O.invalidParameterError("operation","Array",n.operation);else throw O.invalidParameterError("options","object",n)}var nf,Q2,Ere,y2,dI,n4e,qh,g4e,Cre,Bre=ue(()=>{nf=ze(WD(),1);Fs();g2();of();cO();Q2=a4e(import.meta.url),Ere=IO.runtimePlatformArch(),y2=Ot.libvipsVersion(),dI=Ot.format();dI.heif.output.alias=["avif","heic"];dI.jpeg.output.alias=["jpe","jpg"];dI.tiff.output.alias=["tif"];dI.jp2.output.alias=["j2c","j2k","jp2","jpx"];n4e={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},qh={vips:y2.semver};if(!y2.isGlobal)if(y2.isWasm)try{qh=Q2("@img/sharp-wasm32/versions")}catch{}else try{qh=Q2(`@img/sharp-${Ere}/versions`)}catch{try{qh=Q2(`@img/sharp-libvips-${Ere}/versions`)}catch{}}qh.sharp=$g.version;qh.heif&&dI.heif&&(dI.heif.input.fileSuffix=[".avif"],dI.heif.output.alias=["avif"]);ure(!0);!process.env.MALLOC_ARENA_MAX&&nf.default.familySync()===nf.default.GLIBC&&!Ot._isUsingJemalloc()?Ot.concurrency(1):nf.default.familySync()===nf.default.MUSL&&Ot.concurrency()===1024&&Ot.concurrency(o4e());g4e=new i4e.EventEmitter;Cre=n=>{n.cache=ure,n.concurrency=s4e,n.counters=c4e,n.simd=I4e,n.format=dI,n.interpolators=n4e,n.versions=qh,n.queue=g4e,n.block=l4e,n.unblock=p4e}});var fre={};Lr(fre,{default:()=>d4e});var d4e,Qre=ue(()=>{vte();Fte();Yte();Jte();Vte();sre();cre();hre();Bre();Gte(xs);xte(xs);jte(xs);zte(xs);nre(xs);gre(xs);dre(xs);Cre(xs);d4e=xs});var h4e,kA,hI,sf=ue(()=>{h4e="End-Of-Stream",kA=class extends Error{constructor(){super(h4e),this.name="EndOfStreamError"}},hI=class extends Error{constructor(t="The operation was aborted"){super(t),this.name="AbortError"}}});var hO,yre=ue(()=>{hO=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise((t,o)=>{this.reject=o,this.resolve=t})}}});var EI,EO=ue(()=>{sf();EI=class{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(t,o=!1){let a=await this.read(t,o);return this.peekQueue.push(t.subarray(0,a)),a}async read(t,o=!1){if(t.length===0)return 0;let a=this.readFromPeekBuffer(t);if(this.endOfStream||(a+=await this.readRemainderFromStream(t.subarray(a),o)),a===0&&!o)throw new kA;return a}readFromPeekBuffer(t){let o=t.length,a=0;for(;this.peekQueue.length>0&&o>0;){let e=this.peekQueue.pop();if(!e)throw new Error("peekData should be defined");let i=Math.min(e.length,o);t.set(e.subarray(0,i),a),a+=i,o-=i,i{sf();yre();EO();gf=class extends EI{constructor(t){if(super(),this.s=t,this.deferred=null,!t.read||!t.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",()=>{this.endOfStream=!0,this.deferred&&this.deferred.resolve(0)}),this.s.once("error",o=>this.reject(o)),this.s.once("close",()=>this.abort())}async readFromStream(t,o){if(t.length===0)return 0;let a=this.s.read(t.length);if(a)return t.set(a),a.length;let e={buffer:t,mayBeLess:o,deferred:new hO};return this.deferred=e.deferred,this.s.once("readable",()=>{this.readDeferred(e)}),e.deferred.promise}readDeferred(t){let o=this.s.read(t.buffer.length);o?(t.buffer.set(o),t.deferred.resolve(o.length),this.deferred=null):this.s.once("readable",()=>{this.readDeferred(t)})}reject(t){this.interrupted=!0,this.deferred&&(this.deferred.reject(t),this.deferred=null)}async abort(){this.reject(new hI)}async close(){return this.abort()}}});var uO,Sre=ue(()=>{EO();uO=class extends EI{constructor(t){super(),this.reader=t}async abort(){return this.close()}async close(){this.reader.releaseLock()}}});var cf,m2=ue(()=>{Sre();cf=class extends uO{async readFromStream(t,o){if(t.length===0)return 0;let a=await this.reader.read(new Uint8Array(t.length),{min:o?void 0:t.length});return a.done&&(this.endOfStream=a.done),a.value?(t.set(a.value),a.value.length):0}}});var zh,S2=ue(()=>{sf();EO();zh=class extends EI{constructor(t){super(),this.reader=t,this.buffer=null}writeChunk(t,o){let a=Math.min(o.length,t.length);return t.set(o.subarray(0,a)),a{m2();S2()});var uI=ue(()=>{sf();mre();m2();S2();wre()});var Zn,Vh=ue(()=>{uI();Zn=class{constructor(t){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=t?.onClose,t?.abortSignal&&t.abortSignal.addEventListener("abort",()=>{this.abort()})}async readToken(t,o=this.position){let a=new Uint8Array(t.len);if(await this.readBuffer(a,{position:o})o)return this.position+=o,o}return this.position+=t,t}async close(){await this.abort(),await this.onClose?.()}normalizeOptions(t,o){if(!this.supportsRandomAccess()&&o&&o.position!==void 0&&o.position{Vh();uI();E4e=256e3,If=class extends Zn{constructor(t,o){super(o),this.streamReader=t,this.fileInfo=o?.fileInfo??{}}async readBuffer(t,o){let a=this.normalizeOptions(t,o),e=a.position-this.position;if(e>0)return await this.ignore(e),this.readBuffer(t,o);if(e<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(a.length===0)return 0;let i=await this.streamReader.read(t.subarray(0,a.length),a.mayBeLess);if(this.position+=i,(!o||!o.mayBeLess)&&i0){let A=new Uint8Array(a.length+i);return e=await this.peekBuffer(A,{mayBeLess:a.mayBeLess}),t.set(A.subarray(i)),e-i}if(i<0)throw new Error("Cannot peek from a negative offset in a stream")}if(a.length>0){try{e=await this.streamReader.peek(t.subarray(0,a.length),a.mayBeLess)}catch(i){if(o?.mayBeLess&&i instanceof kA)return 0;throw i}if(!a.mayBeLess&&e{uI();Vh();CO=class extends Zn{constructor(t,o){super(o),this.uint8Array=t,this.fileInfo={...o?.fileInfo??{},size:t.length}}async readBuffer(t,o){o?.position&&(this.position=o.position);let a=await this.peekBuffer(t,o);return this.position+=a,a}async peekBuffer(t,o){let a=this.normalizeOptions(t,o),e=Math.min(this.uint8Array.length-a.position,a.length);if(!a.mayBeLess&&e{uI();Vh();BO=class extends Zn{constructor(t,o){super(o),this.blob=t,this.fileInfo={...o?.fileInfo??{},size:t.size,mimeType:t.type}}async readBuffer(t,o){o?.position&&(this.position=o.position);let a=await this.peekBuffer(t,o);return this.position+=a,a}async peekBuffer(t,o){let a=this.normalizeOptions(t,o),e=Math.min(this.blob.size-a.position,a.length);if(!a.mayBeLess&&e{if(await o.close(),e)return e()},new If(o,a)}function fO(n,t){let o=w2(n),a=t??{},e=a.onClose;return a.onClose=async()=>{if(await o.close(),e)return e()},new If(o,a)}function Qo(n,t){return new CO(n,t)}function QO(n,t){return new BO(n,t)}var yO=ue(()=>{uI();Dre();Ore();bre();uI();Vh()});import{open as C4e}from"node:fs/promises";var Wh,D2=ue(()=>{Vh();uI();Wh=class n extends Zn{static async fromFile(t){let o=await C4e(t,"r"),a=await o.stat();return new n(o,{fileInfo:{path:t,size:a.size}})}constructor(t,o){super(o),this.fileHandle=t,this.fileInfo=o.fileInfo}async readBuffer(t,o){let a=this.normalizeOptions(t,o);if(this.position=a.position,a.length===0)return 0;let e=await this.fileHandle.read(t,0,a.length,a.position);if(this.position+=e.bytesRead,e.bytesRead{yO();D2();D2();yO();_re=Wh.fromFile});var Tre=ee(b2=>{b2.read=function(n,t,o,a,e){var i,A,r=e*8-a-1,s=(1<>1,c=-7,I=o?e-1:0,p=o?-1:1,B=n[t+I];for(I+=p,i=B&(1<<-c)-1,B>>=-c,c+=r;c>0;i=i*256+n[t+I],I+=p,c-=8);for(A=i&(1<<-c)-1,i>>=-c,c+=a;c>0;A=A*256+n[t+I],I+=p,c-=8);if(i===0)i=1-g;else{if(i===s)return A?NaN:(B?-1:1)*(1/0);A=A+Math.pow(2,a),i=i-g}return(B?-1:1)*A*Math.pow(2,i-a)};b2.write=function(n,t,o,a,e,i){var A,r,s,g=i*8-e-1,c=(1<>1,p=e===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=a?0:i-1,f=a?1:-1,Q=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(r=isNaN(t)?1:0,A=c):(A=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-A))<1&&(A--,s*=2),A+I>=1?t+=p/s:t+=p*Math.pow(2,1-I),t*s>=2&&(A++,s/=2),A+I>=c?(r=0,A=c):A+I>=1?(r=(t*s-1)*Math.pow(2,e),A=A+I):(r=t*Math.pow(2,I-1)*Math.pow(2,e),A=0));e>=8;n[o+B]=r&255,B+=f,r/=256,e-=8);for(A=A<0;n[o+B]=A&255,B+=f,A/=256,g-=8);n[o+B-f]|=Q*128}});function f4e(){if(!(typeof globalThis.TextDecoder>"u"))return mO??(mO=new globalThis.TextDecoder("utf-8"))}function Q4e(){if(!(typeof globalThis.TextEncoder>"u"))return SO??(SO=new globalThis.TextEncoder)}function Tr(n,t="utf-8"){switch(t.toLowerCase()){case"utf-8":case"utf8":{let o=f4e();return o?o.decode(n):m4e(n)}case"utf-16le":return S4e(n);case"us-ascii":case"ascii":return w4e(n);case"latin1":case"iso-8859-1":return D4e(n);case"windows-1252":return O4e(n);default:throw new RangeError(`Encoding '${t}' not supported`)}}function Rre(n="",t="utf-8"){switch(t.toLowerCase()){case"utf-8":case"utf8":{let o=Q4e();return o?o.encode(n):b4e(n)}case"utf-16le":return M4e(n);case"us-ascii":case"ascii":return _4e(n);case"latin1":case"iso-8859-1":return T4e(n);case"windows-1252":return N4e(n);default:throw new RangeError(`Encoding '${t}' not supported`)}}function _2(n,t){t.length!==0&&(n.push(String.fromCharCode.apply(null,t)),t.length=0)}function Pr(n,t,o){t.push(o),t.length>=Zh&&_2(n,t)}function y4e(n,t,o){if(o<=65535){Pr(n,t,o);return}o-=65536,Pr(n,t,55296+(o>>10)),Pr(n,t,56320+(o&1023))}function m4e(n){let t=[],o=[],a=0;for(n.length>=3&&n[0]===239&&n[1]===187&&n[2]===191&&(a=3);a244){Pr(t,o,Fi),a++;continue}if(e<=223){if(a+1>=n.length){Pr(t,o,Fi),a++;continue}let c=n[a+1];if((c&192)!==128){Pr(t,o,Fi),a++;continue}let I=(e&31)<<6|c&63;Pr(t,o,I),a+=2;continue}if(e<=239){if(a+2>=n.length){Pr(t,o,Fi),a++;continue}let c=n[a+1],I=n[a+2];if(!((c&192)===128&&(I&192)===128&&!(e===224&&c<160)&&!(e===237&&c>=160))){Pr(t,o,Fi),a++;continue}let B=(e&15)<<12|(c&63)<<6|I&63;Pr(t,o,B),a+=3;continue}if(a+3>=n.length){Pr(t,o,Fi),a++;continue}let i=n[a+1],A=n[a+2],r=n[a+3];if(!((i&192)===128&&(A&192)===128&&(r&192)===128&&!(e===240&&i<144)&&!(e===244&&i>143))){Pr(t,o,Fi),a++;continue}let g=(e&7)<<18|(i&63)<<12|(A&63)<<6|r&63;y4e(t,o,g),a+=4}return _2(t,o),t.join("")}function S4e(n){let t=[],o=[],a=n.length,e=0;for(;e+1=55296&&i<=56319){if(e+1=56320&&A<=57343?(Pr(t,o,i),Pr(t,o,A),e+=2):Pr(t,o,Fi)}else Pr(t,o,Fi);continue}if(i>=56320&&i<=57343){Pr(t,o,Fi);continue}Pr(t,o,i)}return e=128&&e<=159?Nre[e]:void 0;o+=i??String.fromCharCode(e),o.length>=Zh&&(t.push(o),o="")}return o&&t.push(o),t.join("")}function b4e(n){let t=[];for(let o=0;o=55296&&a<=56319)if(o+1=56320&&e<=57343?(a=65536+(a-55296<<10)+(e-56320),o++):a=Fi}else a=Fi;else a>=56320&&a<=57343&&(a=Fi);a<128?t.push(a):a<2048?t.push(192|a>>6,128|a&63):a<65536?t.push(224|a>>12,128|a>>6&63,128|a&63):t.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|a&63)}return new Uint8Array(t)}function M4e(n){let t=[];for(let a=0;a=55296&&e<=56319){if(a+1=56320&&i<=57343?(t.push(e,i),a++):t.push(Fi)}else t.push(Fi);continue}if(e>=56320&&e<=57343){t.push(Fi);continue}t.push(e)}let o=new Uint8Array(t.length*2);for(let a=0;a>>8}return o}function _4e(n){let t=new Uint8Array(n.length);for(let o=0;o=0&&e<=127||e>=160&&e<=255){t[o]=e;continue}t[o]=63}return t}var Nre,M2,mO,SO,Zh,Fi,js=ue(()=>{Nre={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},M2={};for(let[n,t]of Object.entries(Nre))M2[t]=Number.parseInt(n,10);Zh=32*1024,Fi=65533});var VA={};Lr(VA,{AnsiStringType:()=>N2,Float16_BE:()=>v4e,Float16_LE:()=>P4e,Float32_BE:()=>k2,Float32_LE:()=>G4e,Float64_BE:()=>DO,Float64_LE:()=>F4e,Float80_BE:()=>L4e,Float80_LE:()=>U4e,INT16_BE:()=>on,INT16_LE:()=>R4e,INT24_BE:()=>wO,INT24_LE:()=>k4e,INT32_BE:()=>Qa,INT32_LE:()=>ur,INT64_BE:()=>R2,INT64_LE:()=>df,INT8:()=>qs,IgnoreType:()=>T2,StringType:()=>We,UINT16_BE:()=>LA,UINT16_LE:()=>SA,UINT24_BE:()=>Gr,UINT24_LE:()=>pf,UINT32_BE:()=>xe,UINT32_LE:()=>Le,UINT64_BE:()=>zs,UINT64_LE:()=>Fr,UINT8:()=>QA,Uint8ArrayType:()=>Mt});function zA(n){return new DataView(n.buffer,n.byteOffset)}var Js,QA,SA,LA,pf,Gr,Le,xe,qs,on,R4e,k4e,wO,Qa,ur,Fr,df,zs,R2,v4e,P4e,k2,G4e,DO,F4e,L4e,U4e,T2,Mt,We,N2,DA=ue(()=>{Js=ze(Tre(),1);js();QA={len:1,get(n,t){return zA(n).getUint8(t)},put(n,t,o){return zA(n).setUint8(t,o),t+1}},SA={len:2,get(n,t){return zA(n).getUint16(t,!0)},put(n,t,o){return zA(n).setUint16(t,o,!0),t+2}},LA={len:2,get(n,t){return zA(n).getUint16(t)},put(n,t,o){return zA(n).setUint16(t,o),t+2}},pf={len:3,get(n,t){let o=zA(n);return o.getUint8(t)+(o.getUint16(t+1,!0)<<8)},put(n,t,o){let a=zA(n);return a.setUint8(t,o&255),a.setUint16(t+1,o>>8,!0),t+3}},Gr={len:3,get(n,t){let o=zA(n);return(o.getUint16(t)<<8)+o.getUint8(t+2)},put(n,t,o){let a=zA(n);return a.setUint16(t,o>>8),a.setUint8(t+2,o&255),t+3}},Le={len:4,get(n,t){return zA(n).getUint32(t,!0)},put(n,t,o){return zA(n).setUint32(t,o,!0),t+4}},xe={len:4,get(n,t){return zA(n).getUint32(t)},put(n,t,o){return zA(n).setUint32(t,o),t+4}},qs={len:1,get(n,t){return zA(n).getInt8(t)},put(n,t,o){return zA(n).setInt8(t,o),t+1}},on={len:2,get(n,t){return zA(n).getInt16(t)},put(n,t,o){return zA(n).setInt16(t,o),t+2}},R4e={len:2,get(n,t){return zA(n).getInt16(t,!0)},put(n,t,o){return zA(n).setInt16(t,o,!0),t+2}},k4e={len:3,get(n,t){let o=pf.get(n,t);return o>8388607?o-16777216:o},put(n,t,o){let a=zA(n);return a.setUint8(t,o&255),a.setUint16(t+1,o>>8,!0),t+3}},wO={len:3,get(n,t){let o=Gr.get(n,t);return o>8388607?o-16777216:o},put(n,t,o){let a=zA(n);return a.setUint16(t,o>>8),a.setUint8(t+2,o&255),t+3}},Qa={len:4,get(n,t){return zA(n).getInt32(t)},put(n,t,o){return zA(n).setInt32(t,o),t+4}},ur={len:4,get(n,t){return zA(n).getInt32(t,!0)},put(n,t,o){return zA(n).setInt32(t,o,!0),t+4}},Fr={len:8,get(n,t){return zA(n).getBigUint64(t,!0)},put(n,t,o){return zA(n).setBigUint64(t,o,!0),t+8}},df={len:8,get(n,t){return zA(n).getBigInt64(t,!0)},put(n,t,o){return zA(n).setBigInt64(t,o,!0),t+8}},zs={len:8,get(n,t){return zA(n).getBigUint64(t)},put(n,t,o){return zA(n).setBigUint64(t,o),t+8}},R2={len:8,get(n,t){return zA(n).getBigInt64(t)},put(n,t,o){return zA(n).setBigInt64(t,o),t+8}},v4e={len:2,get(n,t){return Js.read(n,t,!1,10,this.len)},put(n,t,o){return Js.write(n,o,t,!1,10,this.len),t+this.len}},P4e={len:2,get(n,t){return Js.read(n,t,!0,10,this.len)},put(n,t,o){return Js.write(n,o,t,!0,10,this.len),t+this.len}},k2={len:4,get(n,t){return zA(n).getFloat32(t)},put(n,t,o){return zA(n).setFloat32(t,o),t+4}},G4e={len:4,get(n,t){return zA(n).getFloat32(t,!0)},put(n,t,o){return zA(n).setFloat32(t,o,!0),t+4}},DO={len:8,get(n,t){return zA(n).getFloat64(t)},put(n,t,o){return zA(n).setFloat64(t,o),t+8}},F4e={len:8,get(n,t){return zA(n).getFloat64(t,!0)},put(n,t,o){return zA(n).setFloat64(t,o,!0),t+8}},L4e={len:10,get(n,t){return Js.read(n,t,!1,63,this.len)},put(n,t,o){return Js.write(n,o,t,!1,63,this.len),t+this.len}},U4e={len:10,get(n,t){return Js.read(n,t,!0,63,this.len)},put(n,t,o){return Js.write(n,o,t,!0,63,this.len),t+this.len}},T2=class{constructor(t){this.len=t}get(t,o){}},Mt=class{constructor(t){this.len=t}get(t,o){return t.subarray(o,o+this.len)}},We=class{constructor(t,o){this.len=t,this.encoding=o}get(t,o=0){let a=t.subarray(o,o+this.len);return Tr(a,this.encoding)}},N2=class extends We{constructor(t){super(t,"windows-1252")}}});var $l,v2,kre,vre,Pre,Gre=ue(()=>{DA();$l={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},v2={get(n){return{signature:Le.get(n,0),compressedSize:Le.get(n,8),uncompressedSize:Le.get(n,12)}},len:16},kre={get(n){let t=SA.get(n,6);return{signature:Le.get(n,0),minVersion:SA.get(n,4),dataDescriptor:!!(t&8),compressedMethod:SA.get(n,8),compressedSize:Le.get(n,18),uncompressedSize:Le.get(n,22),filenameLength:SA.get(n,26),extraFieldLength:SA.get(n,28),filename:null}},len:30},vre={get(n){return{signature:Le.get(n,0),nrOfThisDisk:SA.get(n,4),nrOfThisDiskWithTheStart:SA.get(n,6),nrOfEntriesOnThisDisk:SA.get(n,8),nrOfEntriesOfSize:SA.get(n,10),sizeOfCd:Le.get(n,12),offsetOfStartOfCd:Le.get(n,16),zipFileCommentLength:SA.get(n,20)}},len:22},Pre={get(n){let t=SA.get(n,8);return{signature:Le.get(n,0),minVersion:SA.get(n,6),dataDescriptor:!!(t&8),compressedMethod:SA.get(n,10),compressedSize:Le.get(n,20),uncompressedSize:Le.get(n,24),filenameLength:SA.get(n,28),extraFieldLength:SA.get(n,30),fileCommentLength:SA.get(n,32),relativeOffsetOfLocalHeader:Le.get(n,42),filename:null}},len:46}});function Lre(n){let t=new Uint8Array(Le.len);return Le.put(t,0,n),t}function K4e(n,t){let o=n.length,a=t.length;if(a>o)return-1;for(let e=0;e<=o-a;e++){let i=!0;for(let A=0;Ae+i.length,0),o=new Uint8Array(t),a=0;for(let e of n)o.set(e,a),a+=e.length;return o}var Fre,Vs,P2,H4e,OO,ep,Ure=ue(()=>{DA();Fre=ze(lt(),1);Gre();Vs=(0,Fre.default)("tokenizer:inflate"),P2=256*1024,H4e=Lre($l.DataDescriptor),OO=Lre($l.EndOfCentralDirectory),ep=class n{constructor(t){this.tokenizer=t,this.syncBuffer=new Uint8Array(P2)}async isZip(){return await this.peekSignature()===$l.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(Le)}async findEndOfCentralDirectoryLocator(){let t=this.tokenizer,o=Math.min(16*1024,t.fileInfo.size),a=this.syncBuffer.subarray(0,o);await this.tokenizer.readBuffer(a,{position:t.fileInfo.size-o});for(let e=a.length-4;e>=0;e--)if(a[e]===OO[0]&&a[e+1]===OO[1]&&a[e+2]===OO[2]&&a[e+3]===OO[3])return t.fileInfo.size-o+e;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){Vs("Cannot reading central-directory without random-read support");return}Vs("Reading central-directory...");let t=this.tokenizer.position,o=await this.findEndOfCentralDirectoryLocator();if(o>0){Vs("Central-directory 32-bit signature found");let a=await this.tokenizer.readToken(vre,o),e=[];this.tokenizer.setPosition(a.offsetOfStartOfCd);for(let i=0;i=0?g:s;if(i.handler){let I=new Uint8Array(c);await this.tokenizer.readBuffer(I),r.push(I)}else await this.tokenizer.ignore(c)}Vs(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),i.handler&&await this.inflate(e,x4e(r),i.handler)}else i.handler?(Vs(`Reading compressed-file-data: ${e.compressedSize} bytes`),A=new Uint8Array(e.compressedSize),await this.tokenizer.readBuffer(A),await this.inflate(e,A,i.handler)):(Vs(`Ignoring compressed-file-data: ${e.compressedSize} bytes`),await this.tokenizer.ignore(e.compressedSize));if(Vs(`Reading data-descriptor at pos=${this.tokenizer.position}`),e.dataDescriptor&&(await this.tokenizer.readToken(v2)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-v2.len}`)}while(!a)}async iterateOverCentralDirectory(t,o){for(let a of t){let e=o(a);if(e.handler){this.tokenizer.setPosition(a.relativeOffsetOfLocalHeader);let i=await this.readLocalFileHeader();if(i){await this.tokenizer.ignore(i.extraFieldLength);let A=new Uint8Array(a.compressedSize);await this.tokenizer.readBuffer(A),await this.inflate(i,A,e.handler)}}if(e.stop)break}}async inflate(t,o,a){if(t.compressedMethod===0)return a(o);if(t.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${t.compressedMethod}`);Vs(`Decompress filename=${t.filename}, compressed-size=${o.length}`);let e=await n.decompressDeflateRaw(o);return a(e)}static async decompressDeflateRaw(t){let o=new ReadableStream({start(i){i.enqueue(t),i.close()}}),a=new DecompressionStream("deflate-raw"),e=o.pipeThrough(a);try{let A=await new Response(e).arrayBuffer();return new Uint8Array(A)}catch(i){let A=i instanceof Error?`Failed to deflate ZIP entry: ${i.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(A)}}async readLocalFileHeader(){let t=await this.tokenizer.peekToken(Le);if(t===$l.LocalFileHeader){let o=await this.tokenizer.readToken(kre);return o.filename=await this.tokenizer.readToken(new We(o.filenameLength,"utf-8")),o}if(t===$l.CentralFileHeader)return!1;throw t===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}}});var hf,Hre=ue(()=>{hf=class{constructor(t){this.tokenizer=t}inflate(){let t=this.tokenizer;return new ReadableStream({async pull(o){let a=new Uint8Array(1024),e=await t.readBuffer(a,{mayBeLess:!0});if(e===0){o.close();return}o.enqueue(a.subarray(0,e))}}).pipeThrough(new DecompressionStream("gzip"))}}});var Kre=ue(()=>{Ure();Hre()});function J4e(n,t,o){return n?n.constructor===t?!0:Y4e.call(n)===o:!1}function q4e(n){return J4e(n,Uint8Array,j4e)}function z4e(n){if(!q4e(n))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof n}\``)}function bO(n){z4e(n);let t="";for(let o=0;o{Y4e=Object.prototype.toString,j4e="[object Uint8Array]";_bA={utf8:new globalThis.TextDecoder("utf8")},TbA=new globalThis.TextEncoder,V4e=Array.from({length:256},(n,t)=>t.toString(16).padStart(2,"0"))});function xre(n,t){if(t==="utf-16le"){let o=[];for(let a=0;a>8&255)}return o}if(t==="utf-16be"){let o=[];for(let a=0;a>8&255,e&255)}return o}return[...n].map(o=>o.charCodeAt(0))}function Yre(n,t=0){let o=Number.parseInt(new We(6).get(n,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(o))return!1;let a=256;for(let e=t;e{DA();jre={get:(n,t)=>n[t+3]&127|n[t+2]<<7|n[t+1]<<14|n[t]<<21,len:4}});var qre,zre,Vre=ue(()=>{qre=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],zre=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"]});function g8e(n){let t=n?.streamReader;if(t?.constructor?.name!=="WebStreamByobReader")return n;let{reader:o}=t,a=async()=>{await o.cancel(),o.releaseLock()};return t.close=a,t.abort=async()=>{t.interrupted=!0,await a()},n}function U2(n,t,o){if(!Number.isFinite(n)||n<0||n>t)throw new tc(`${o} has invalid size ${n} (maximum ${t} bytes)`);return n}async function CI(n,t,{maximumLength:o=nn,reason:a="skip"}={}){let e=U2(t,o,a);await n.ignore(e)}async function F2(n,t,o,{maximumLength:a=t.length,reason:e="read"}={}){let i=o?.length??t.length,A=U2(i,a,e);return n.readBuffer(t,{...o,length:A})}async function c8e(n,{maximumLength:t=Zs}={}){let e=new ReadableStream({start(g){g.enqueue(n),g.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),i=[],A=0;try{for(;;){let{done:g,value:c}=await e.read();if(g)break;if(A+=c.length,A>t)throw await e.cancel(),new Error(`ZIP entry decompressed data exceeds ${t} bytes`);i.push(c)}}finally{e.releaseLock()}let r=new Uint8Array(A),s=0;for(let g of i)r.set(g,s),s+=g.length;return r}function l8e(n,t){if(n.length=0?0:r===e?Math.min(I8e,r-1):0,c=s>=0?s:r-g;if(c===0)break;if(A+=c,A>o)throw new Error(`ZIP entry compressed data exceeds ${o} bytes`);if(t){let I=new Uint8Array(c);await n.tokenizer.readBuffer(I),i.push(I)}else await n.tokenizer.ignore(c);if(s>=0)break}if(ya(n.tokenizer)||(n.knownSizeDescriptorScannedBytes+=A),!!t)return d8e(i,A)}function E8e(n,t){return ya(n.tokenizer)?Math.max(0,nn-(n.tokenizer.position-t)):Math.max(0,Zs-n.knownSizeDescriptorScannedBytes)}async function u8e(n,t,{shouldBuffer:o,maximumDescriptorLength:a=Zs}={}){if(t.dataDescriptor&&t.compressedSize===0)return h8e(n,{shouldBuffer:o,maximumLength:a});if(!o){await CI(n.tokenizer,t.compressedSize,{maximumLength:ya(n.tokenizer)?Zs:n.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let e=m8e(n.tokenizer);if(!Number.isFinite(t.compressedSize)||t.compressedSize<0||t.compressedSize>e)throw new Error(`ZIP entry compressed data exceeds ${e} bytes`);let i=new Uint8Array(t.compressedSize);return await n.tokenizer.readBuffer(i),i}function C8e(n,t){let o=n.getReader(),a=0,e=!1,i=!1,A=async r=>{e||i||(i=!0,await o.cancel(r))};return new ReadableStream({async pull(r){if(a>=t){r.close(),await A();return}let{done:s,value:g}=await o.read();if(s||!g){e=!0,r.close();return}let c=t-a;if(g.length>c){r.enqueue(g.subarray(0,c)),a+=c,r.close(),await A();return}r.enqueue(g),a+=g.length},async cancel(r){await A(r)}})}async function ff(n,t){return new L2(t).fromBuffer(n)}function aie(n){switch(n=n.toLowerCase(),n){case"application/epub+zip":return{ext:"epub",mime:n};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:n};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:n};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:n};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:n};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:n};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:n};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:n};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:n};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:n};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:n};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:n};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:n};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:n};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:n};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:n};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function Ws(n,t,o){o={offset:0,...o};for(let[a,e]of t.entries())if(o.mask){if(e!==(o.mask[a]&n[a+o.offset]))return!1}else if(e!==n[a+o.offset])return!1;return!0}function B8e(n){return Number.isFinite(n)?Math.max(1,Math.trunc(n)):Cf}function f8e(n,t,o){return o===void 0?n.read(t):(o.throwIfAborted(),new Promise((a,e)=>{let i=()=>{o.removeEventListener("abort",A)},A=()=>{let r=o.reason;i(),(async()=>{try{await n.cancel(r)}catch{}})(),e(r)};o.addEventListener("abort",A,{once:!0}),(async()=>{try{let r=await n.read(t);i(),a(r)}catch(r){i(),e(r)}})()}))}function Q8e(n){return Number.isFinite(n)?Math.max(0,Math.min(W4e,Math.trunc(n))):0}function y8e(n){return Number.isFinite(n)?Math.max(0,n):Number.MAX_SAFE_INTEGER}function ya(n){let t=n.fileInfo.size;return!Number.isFinite(t)||t===Number.MAX_SAFE_INTEGER}function Bf(n,t,o){return ya(n)&&n.position-t>o}function m8e(n){let t=n.fileInfo.size,o=Number.isFinite(t)?Math.max(0,t-n.position):Number.MAX_SAFE_INTEGER;return Math.min(o,Z4e)}function S8e(n){if(n instanceof kA||n instanceof tc)return!0;if(!(n instanceof Error))return!1;if(o8e.has(n.message)||s8e.has(n.code))return!0;for(let t of n8e)if(n.message.startsWith(t))return!0;return!1}function oie(n,t=Zs){let o=[n.compressedSize,n.uncompressedSize];for(let a of o)if(!Number.isFinite(a)||a<0||a>t)return!1;return!0}function w8e(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function D8e(n,t){t.startsWith("word/")&&(n.hasWordDirectory=!0),t.startsWith("ppt/")&&(n.hasPresentationDirectory=!0),t.startsWith("xl/")&&(n.hasSpreadsheetDirectory=!0),t.startsWith("3D/")&&t.endsWith(".model")&&(n.hasThreeDimensionalModelEntry=!0)}function nie(n){if(!(!n.hasContentTypesEntry||n.hasUnparseableContentTypes||n.isParsingContentTypes||n.hasParsedContentTypesEntry)){if(n.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(n.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(n.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(n.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}}function O8e(n){let t=n.indexOf('.main+xml"');if(t===-1){let e="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return n.includes(`ContentType="${e}"`)?e:void 0}let o=n.slice(0,t),a=o.lastIndexOf('"');return o.slice(a+1)}var Cf,W4e,Zs,Wre,Z4e,nn,_O,Zre,X4e,$4e,Xre,G2,$re,eie,e8e,A8e,t8e,r8e,i8e,Aie,tie,rie,a8e,iie,o8e,n8e,s8e,tc,sie,MO,I8e,L2,b8e,M8e,gie=ue(()=>{DA();yO();Kre();uf();Jre();Vre();Cf=4100,W4e=Cf-2,Zs=1024*1024,Wre=1024,Z4e=2**31-1,nn=16*1024*1024,_O=Zs,Zre=Zs,X4e=nn,$4e=1,Xre=100,G2=nn,$re=64,eie=_O,e8e=256,A8e=512,t8e=nn,r8e=512,i8e=512,Aie=256,tie=_O,rie=_O,a8e=_O,iie=nn,o8e=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),n8e=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],s8e=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),tc=class extends Error{};sie=134695760,MO=16,I8e=MO-1;ep.prototype.inflate=async function(n,t,o){if(n.compressedMethod===0)return o(t);if(n.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${n.compressedMethod}`);let a=await c8e(t,{maximumLength:Zs});return o(a)};ep.prototype.unzip=async function(n){let t=!1,o=0,a=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(Bf(this.tokenizer,a,nn))throw new tc(`ZIP stream probing exceeds ${nn} bytes`);let e=await this.readLocalFileHeader();if(!e)break;if(o++,o>Wre)throw new Error(`ZIP entry count exceeds ${Wre}`);let i=n(e);t=!!i.stop,await this.tokenizer.ignore(e.extraFieldLength);let A=await u8e(this,e,{shouldBuffer:!!i.handler,maximumDescriptorLength:Math.min(Zs,E8e(this,a))});if(i.handler&&await this.inflate(e,A,i.handler),e.dataDescriptor){let r=new Uint8Array(MO);if(await this.tokenizer.readBuffer(r),Le.get(r,0)!==sie)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-r.length}`)}if(Bf(this.tokenizer,a,nn))throw new tc(`ZIP stream probing exceeds ${nn} bytes`)}while(!t)};L2=class n{constructor(t){let o=Q8e(t?.mpegOffsetTolerance);this.options={...t,mpegOffsetTolerance:o},this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(t){return g8e(fO(t,this.getTokenizerOptions()))}async parseTokenizer(t,o=0){this.detectionReentryCount=o;let a=t.position;for(let e of this.detectors){let i;try{i=await e.detect(t)}catch(A){if(A instanceof kA||A instanceof tc)return;throw A}if(i)return i;if(a!==t.position)return}}async fromTokenizer(t){try{return await this.parseTokenizer(t)}finally{await t.close()}}async fromBuffer(t){if(!(t instanceof Uint8Array||t instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``);let o=t instanceof Uint8Array?t:new Uint8Array(t);if(o?.length>1)return this.fromTokenizer(Qo(o,this.getTokenizerOptions()))}async fromBlob(t){this.options.signal?.throwIfAborted();let o=QO(t,this.getTokenizerOptions());return this.fromTokenizer(o)}async fromStream(t){this.options.signal?.throwIfAborted();let o=this.createTokenizerFromWebStream(t);return this.fromTokenizer(o)}async toDetectionStream(t,o){let a=B8e(o?.sampleSize??Cf),e,i,A=t.getReader({mode:"byob"});try{let{value:g,done:c}=await f8e(A,new Uint8Array(a),this.options.signal);if(i=g,!c&&g)try{e=await this.fromBuffer(g.subarray(0,a))}catch(I){if(!(I instanceof kA))throw I;e=void 0}i=g}finally{A.releaseLock()}let r=new TransformStream({async start(g){g.enqueue(i)},transform(g,c){c.enqueue(g)}}),s=t.pipeThrough(r);return s.fileType=e,s}async detectGzip(t){if(this.gzipProbeDepth>=$4e)return{ext:"gz",mime:"application/gzip"};let o=new hf(t),a=C8e(o.inflate(),X4e),e=ya(t),i,A,r,s;if(e){let g=new AbortController;i=setTimeout(()=>{g.abort(new DOMException(`Operation timed out after ${Xre} ms`,"TimeoutError"))},Xre),A=this.options.signal===void 0?g.signal:AbortSignal.any([this.options.signal,g.signal]),r=new n({...this.options,signal:A}),r.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{s=await(r??this).fromStream(a)}catch(g){if(g?.name==="AbortError"&&A?.reason?.name!=="TimeoutError")throw g}finally{clearTimeout(i),e||this.gzipProbeDepth--}return s?.ext==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(t,o){return Ws(this.buffer,t,o)}checkString(t,o){return this.check(xre(t,o?.encoding),o)}detectConfident=async t=>{if(this.buffer=new Uint8Array(Cf),t.fileInfo.size===void 0&&(t.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=t,ya(t)&&(await t.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(t);if(await t.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await t.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.detectionReentryCount>=Aie?void 0:(this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(t));if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return this.detectGzip(t);if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await CI(t,6,{maximumLength:6,reason:"ID3 header prefix"});let o=await t.readToken(jre),a=ya(t);if(!Number.isFinite(o)||o<0||a&&(o>G2||t.position+o>G2))return;if(t.position+o>t.fileInfo.size)return a?void 0:{ext:"mp3",mime:"audio/mpeg"};try{await CI(t,o,{maximumLength:a?G2:t.fileInfo.size,reason:"ID3 payload"})}catch(e){if(e instanceof kA)return;throw e}return this.detectionReentryCount>=Aie?void 0:(this.detectionReentryCount++,this.parseTokenizer(t,this.detectionReentryCount))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let o,a=w8e();try{await new ep(t).unzip(e=>{D8e(a,e.filename);let i=e.filename==="[Content_Types].xml",A=nie(a);if(!i&&A)return o=A,{stop:!0};switch(e.filename){case"META-INF/mozilla.rsa":return o={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return o={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return oie(e,Zre)?{async handler(r){let s=new TextDecoder("utf-8").decode(r).trim();o=aie(s)},stop:!0}:{};case"[Content_Types].xml":return a.hasContentTypesEntry=!0,oie(e,Zre)?(a.isParsingContentTypes=!0,{async handler(r){let s=new TextDecoder("utf-8").decode(r),g=O8e(s);g&&(o=aie(g)),a.hasParsedContentTypesEntry=!0,a.isParsingContentTypes=!1},stop:!0}):(a.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(e.filename)?(o={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(e){if(!S8e(e))throw e;a.isParsingContentTypes&&(a.isParsingContentTypes=!1,a.hasUnparseableContentTypes=!0)}return o??nie(a)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await t.ignore(28);let o=new Uint8Array(8);return await t.readBuffer(o),Ws(o,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:Ws(o,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:Ws(o,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:Ws(o,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:Ws(o,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:Ws(o,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let o=await this.readTiffHeader(!1);if(o)return o}if(this.check([77,77])){let o=await this.readTiffHeader(!0);if(o)return o}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function o(){let s=await t.peekNumber(QA),g=128,c=0;for(;(s&g)===0&&g!==0;)++c,g>>=1;let I=new Uint8Array(c+1);return await F2(t,I,void 0,{maximumLength:I.length,reason:"EBML field"}),I}async function a(){let s=await o(),g=await o();g[0]^=128>>g.length-1;let c=Math.min(6,g.length),I=new DataView(s.buffer),p=new DataView(g.buffer,g.length-c,c);return{id:Ef(I),len:Ef(p)}}async function e(s){let g=0;for(;s>0;){if(g++,g>e8e||Bf(t,A,nn))return;let c=t.position,I=await a();if(I.id===17026){if(I.len>$re)return;let p=U2(I.len,$re,"EBML DocType");return(await t.readToken(new We(p))).replaceAll(/\00.*$/g,"")}if(ya(t)&&(!Number.isFinite(I.len)||I.len<0||I.len>eie)||(await CI(t,I.len,{maximumLength:ya(t)?eie:t.fileInfo.size,reason:"EBML payload"}),--s,t.position<=c))return}}let i=await a(),A=t.position;switch(await e(i.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let o=xe.get(this.buffer,4),a=LA.get(this.buffer,6);if(o>0&&o<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(a>30)return{ext:"class",mime:"application/java-vm"}}if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("=1e3&&o<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!"))return await t.ignore(8),await t.readToken(new We(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[` +Check the top-level render call using <`+de+">.")}return te}function Cx(x,te){if(!(!x._store||x._store.validated||x.key!=null)){x._store.validated=!0;var de=Xle(te);if(!ux[de]){ux[de]=!0;var me="";x&&x._owner&&x._owner!==R.current&&(me=" It was passed a child from "+Ce(x._owner.type)+"."),Np(x),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',de,me),Np(null)}}}function Bx(x,te){if(typeof x=="object"){if(je(x))for(var de=0;de",Ve=" Did you accidentally export a JSX literal instead of a component?"):CA=typeof x,k("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",CA,Ve)}var xA=Qe.apply(this,arguments);if(xA==null)return xA;if(me)for(var Et=2;Et10&&N("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),me._updatedFibers.clear()}}}var mx=!1,bQ=null;function rpe(x){if(bQ===null)try{var te=("require"+Math.random()).slice(0,7),de=ew&&ew[te];bQ=de.call(ew,"timers").setImmediate}catch{bQ=function(Ve){mx===!1&&(mx=!0,typeof MessageChannel>"u"&&k("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var TA=new MessageChannel;TA.port1.onmessage=Ve,TA.port2.postMessage(void 0)}}return bQ(x)}var Rp=0,Sx=!1;function wx(x){{var te=Rp;Rp++,_.current===null&&(_.current=[]);var de=_.isBatchingLegacy,me;try{if(_.isBatchingLegacy=!0,me=x(),!de&&_.didScheduleLegacyUpdate){var Ve=_.current;Ve!==null&&(_.didScheduleLegacyUpdate=!1,g_(Ve))}}catch(Ir){throw MQ(te),Ir}finally{_.isBatchingLegacy=de}if(me!==null&&typeof me=="object"&&typeof me.then=="function"){var TA=me,CA=!1,xA={then:function(Ir,Nr){CA=!0,TA.then(function(wi){MQ(te),Rp===0?n_(wi,Ir,Nr):Ir(wi)},function(wi){MQ(te),Nr(wi)})}};return!Sx&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){CA||(Sx=!0,k("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),xA}else{var Et=me;if(MQ(te),Rp===0){var Lt=_.current;Lt!==null&&(g_(Lt),_.current=null);var er={then:function(Ir,Nr){_.current===null?(_.current=[],n_(Et,Ir,Nr)):Ir(Et)}};return er}else{var Ar={then:function(Ir,Nr){Ir(Et)}};return Ar}}}}function MQ(x){x!==Rp-1&&k("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Rp=x}function n_(x,te,de){{var me=_.current;if(me!==null)try{g_(me),rpe(function(){me.length===0?(_.current=null,te(x)):n_(x,te,de)})}catch(Ve){de(Ve)}else te(x)}}var s_=!1;function g_(x){if(!s_){s_=!0;var te=0;try{for(;te{"use strict";process.env.NODE_ENV==="production"?dG.exports=dZ():dG.exports=hZ()});var Kl=ee((bmA,DX)=>{"use strict";var lD=$e("crypto"),uKe=$e("assert");function $o(n){if(!(n instanceof Buffer))throw TypeError(`Expected Buffer instead of: ${n.constructor.name}`);return n}function CKe(n,t,o){$o(n),$o(t),$o(o);let a=lD.createCipheriv("aes-256-cbc",n,o);return Buffer.concat([a.update(t),a.final()])}function BKe(n,t,o){$o(n),$o(t),$o(o);let a=lD.createDecipheriv("aes-256-cbc",n,o);return Buffer.concat([a.update(t),a.final()])}function Qh(n,t){$o(n),$o(t);let o=lD.createHmac("sha256",n);return o.update(t),Buffer.from(o.digest())}function fKe(n){$o(n);let t=lD.createHash("sha512");return t.update(n),t.digest()}function QKe(n,t,o,a){if($o(n),$o(t),$o(o),t.byteLength!=32)throw new Error("Got salt of incorrect length");a=a||3,uKe(a>=1&&a<=3);let e=Qh(t,n),i=new Uint8Array(o.byteLength+1+32);i.set(o,32),i[i.length-1]=1;let A=[Qh(e,Buffer.from(i.slice(32)))];return a>1&&(i.set(A[A.length-1]),i[i.length-1]=2,A.push(Qh(e,Buffer.from(i)))),a>2&&(i.set(A[A.length-1]),i[i.length-1]=3,A.push(Qh(e,Buffer.from(i)))),A}function yKe(n,t,o,a){let e=Qh(t,n).slice(0,a);if(o.length!==a||e.length!==a)throw new Error("Bad MAC length");if(!o.equals(e))throw new Error("Bad MAC")}DX.exports={deriveSecrets:QKe,decrypt:BKe,encrypt:CKe,hash:fKe,calculateMAC:Qh,verifyMAC:yKe}});var UX=ee(xg=>{"use strict";Object.defineProperty(xg,"__esModule",{value:!0});var MmA=new Uint8Array(16),kX=new Uint8Array(32);kX[0]=9;function hA(n){var t,o=new Float64Array(16);if(n)for(t=0;t>24&255,n[t+1]=o>>16&255,n[t+2]=o>>8&255,n[t+3]=o&255,n[t+4]=a>>24&255,n[t+5]=a>>16&255,n[t+6]=a>>8&255,n[t+7]=a&255}function OKe(n,t,o,a,e){var i,A=0;for(i=0;i>>8)-1}function vX(n,t,o,a){return OKe(n,t,o,a,32)}function Wc(n,t){var o;for(o=0;o<16;o++)n[o]=t[o]|0}function JF(n){var t,o,a=1;for(t=0;t<16;t++)o=n[t]+a+65535,a=Math.floor(o/65536),n[t]=o-a*65536;n[0]+=a-1+37*(a-1)}function yh(n,t,o){for(var a,e=~(o-1),i=0;i<16;i++)a=e&(n[i]^t[i]),n[i]^=a,t[i]^=a}function Sh(n,t){var o,a,e,i=hA(),A=hA();for(o=0;o<16;o++)A[o]=t[o];for(JF(A),JF(A),JF(A),a=0;a<2;a++){for(i[0]=A[0]-65517,o=1;o<15;o++)i[o]=A[o]-65535-(i[o-1]>>16&1),i[o-1]&=65535;i[15]=A[15]-32767-(i[14]>>16&1),e=i[15]>>16&1,i[14]&=65535,yh(A,i,1-e)}for(o=0;o<16;o++)n[2*o]=A[o]&255,n[2*o+1]=A[o]>>8}function _X(n,t){var o=new Uint8Array(32),a=new Uint8Array(32);return Sh(o,n),Sh(a,t),vX(o,0,a,0)}function PX(n){var t=new Uint8Array(32);return Sh(t,n),t[0]&1}function ZF(n,t){var o;for(o=0;o<16;o++)n[o]=t[2*o]+(t[2*o+1]<<8);n[15]&=32767}function Kn(n,t,o){for(var a=0;a<16;a++)n[a]=t[a]+o[a]}function Yn(n,t,o){for(var a=0;a<16;a++)n[a]=t[a]-o[a]}function dt(n,t,o){var a,e,i=0,A=0,r=0,s=0,g=0,c=0,I=0,p=0,B=0,f=0,Q=0,y=0,m=0,T=0,_=0,R=0,L=0,U=0,F=0,q=0,z=0,K=0,G=0,V=0,H=0,N=0,k=0,J=0,X=0,ie=0,De=0,oe=o[0],Se=o[1],Be=o[2],Re=o[3],Ne=o[4],Je=o[5],ve=o[6],tA=o[7],fe=o[8],Ie=o[9],Xe=o[10],je=o[11],be=o[12],uA=o[13],EA=o[14],aA=o[15];a=t[0],i+=a*oe,A+=a*Se,r+=a*Be,s+=a*Re,g+=a*Ne,c+=a*Je,I+=a*ve,p+=a*tA,B+=a*fe,f+=a*Ie,Q+=a*Xe,y+=a*je,m+=a*be,T+=a*uA,_+=a*EA,R+=a*aA,a=t[1],A+=a*oe,r+=a*Se,s+=a*Be,g+=a*Re,c+=a*Ne,I+=a*Je,p+=a*ve,B+=a*tA,f+=a*fe,Q+=a*Ie,y+=a*Xe,m+=a*je,T+=a*be,_+=a*uA,R+=a*EA,L+=a*aA,a=t[2],r+=a*oe,s+=a*Se,g+=a*Be,c+=a*Re,I+=a*Ne,p+=a*Je,B+=a*ve,f+=a*tA,Q+=a*fe,y+=a*Ie,m+=a*Xe,T+=a*je,_+=a*be,R+=a*uA,L+=a*EA,U+=a*aA,a=t[3],s+=a*oe,g+=a*Se,c+=a*Be,I+=a*Re,p+=a*Ne,B+=a*Je,f+=a*ve,Q+=a*tA,y+=a*fe,m+=a*Ie,T+=a*Xe,_+=a*je,R+=a*be,L+=a*uA,U+=a*EA,F+=a*aA,a=t[4],g+=a*oe,c+=a*Se,I+=a*Be,p+=a*Re,B+=a*Ne,f+=a*Je,Q+=a*ve,y+=a*tA,m+=a*fe,T+=a*Ie,_+=a*Xe,R+=a*je,L+=a*be,U+=a*uA,F+=a*EA,q+=a*aA,a=t[5],c+=a*oe,I+=a*Se,p+=a*Be,B+=a*Re,f+=a*Ne,Q+=a*Je,y+=a*ve,m+=a*tA,T+=a*fe,_+=a*Ie,R+=a*Xe,L+=a*je,U+=a*be,F+=a*uA,q+=a*EA,z+=a*aA,a=t[6],I+=a*oe,p+=a*Se,B+=a*Be,f+=a*Re,Q+=a*Ne,y+=a*Je,m+=a*ve,T+=a*tA,_+=a*fe,R+=a*Ie,L+=a*Xe,U+=a*je,F+=a*be,q+=a*uA,z+=a*EA,K+=a*aA,a=t[7],p+=a*oe,B+=a*Se,f+=a*Be,Q+=a*Re,y+=a*Ne,m+=a*Je,T+=a*ve,_+=a*tA,R+=a*fe,L+=a*Ie,U+=a*Xe,F+=a*je,q+=a*be,z+=a*uA,K+=a*EA,G+=a*aA,a=t[8],B+=a*oe,f+=a*Se,Q+=a*Be,y+=a*Re,m+=a*Ne,T+=a*Je,_+=a*ve,R+=a*tA,L+=a*fe,U+=a*Ie,F+=a*Xe,q+=a*je,z+=a*be,K+=a*uA,G+=a*EA,V+=a*aA,a=t[9],f+=a*oe,Q+=a*Se,y+=a*Be,m+=a*Re,T+=a*Ne,_+=a*Je,R+=a*ve,L+=a*tA,U+=a*fe,F+=a*Ie,q+=a*Xe,z+=a*je,K+=a*be,G+=a*uA,V+=a*EA,H+=a*aA,a=t[10],Q+=a*oe,y+=a*Se,m+=a*Be,T+=a*Re,_+=a*Ne,R+=a*Je,L+=a*ve,U+=a*tA,F+=a*fe,q+=a*Ie,z+=a*Xe,K+=a*je,G+=a*be,V+=a*uA,H+=a*EA,N+=a*aA,a=t[11],y+=a*oe,m+=a*Se,T+=a*Be,_+=a*Re,R+=a*Ne,L+=a*Je,U+=a*ve,F+=a*tA,q+=a*fe,z+=a*Ie,K+=a*Xe,G+=a*je,V+=a*be,H+=a*uA,N+=a*EA,k+=a*aA,a=t[12],m+=a*oe,T+=a*Se,_+=a*Be,R+=a*Re,L+=a*Ne,U+=a*Je,F+=a*ve,q+=a*tA,z+=a*fe,K+=a*Ie,G+=a*Xe,V+=a*je,H+=a*be,N+=a*uA,k+=a*EA,J+=a*aA,a=t[13],T+=a*oe,_+=a*Se,R+=a*Be,L+=a*Re,U+=a*Ne,F+=a*Je,q+=a*ve,z+=a*tA,K+=a*fe,G+=a*Ie,V+=a*Xe,H+=a*je,N+=a*be,k+=a*uA,J+=a*EA,X+=a*aA,a=t[14],_+=a*oe,R+=a*Se,L+=a*Be,U+=a*Re,F+=a*Ne,q+=a*Je,z+=a*ve,K+=a*tA,G+=a*fe,V+=a*Ie,H+=a*Xe,N+=a*je,k+=a*be,J+=a*uA,X+=a*EA,ie+=a*aA,a=t[15],R+=a*oe,L+=a*Se,U+=a*Be,F+=a*Re,q+=a*Ne,z+=a*Je,K+=a*ve,G+=a*tA,V+=a*fe,H+=a*Ie,N+=a*Xe,k+=a*je,J+=a*be,X+=a*uA,ie+=a*EA,De+=a*aA,i+=38*L,A+=38*U,r+=38*F,s+=38*q,g+=38*z,c+=38*K,I+=38*G,p+=38*V,B+=38*H,f+=38*N,Q+=38*k,y+=38*J,m+=38*X,T+=38*ie,_+=38*De,e=1,a=i+e+65535,e=Math.floor(a/65536),i=a-e*65536,a=A+e+65535,e=Math.floor(a/65536),A=a-e*65536,a=r+e+65535,e=Math.floor(a/65536),r=a-e*65536,a=s+e+65535,e=Math.floor(a/65536),s=a-e*65536,a=g+e+65535,e=Math.floor(a/65536),g=a-e*65536,a=c+e+65535,e=Math.floor(a/65536),c=a-e*65536,a=I+e+65535,e=Math.floor(a/65536),I=a-e*65536,a=p+e+65535,e=Math.floor(a/65536),p=a-e*65536,a=B+e+65535,e=Math.floor(a/65536),B=a-e*65536,a=f+e+65535,e=Math.floor(a/65536),f=a-e*65536,a=Q+e+65535,e=Math.floor(a/65536),Q=a-e*65536,a=y+e+65535,e=Math.floor(a/65536),y=a-e*65536,a=m+e+65535,e=Math.floor(a/65536),m=a-e*65536,a=T+e+65535,e=Math.floor(a/65536),T=a-e*65536,a=_+e+65535,e=Math.floor(a/65536),_=a-e*65536,a=R+e+65535,e=Math.floor(a/65536),R=a-e*65536,i+=e-1+37*(e-1),e=1,a=i+e+65535,e=Math.floor(a/65536),i=a-e*65536,a=A+e+65535,e=Math.floor(a/65536),A=a-e*65536,a=r+e+65535,e=Math.floor(a/65536),r=a-e*65536,a=s+e+65535,e=Math.floor(a/65536),s=a-e*65536,a=g+e+65535,e=Math.floor(a/65536),g=a-e*65536,a=c+e+65535,e=Math.floor(a/65536),c=a-e*65536,a=I+e+65535,e=Math.floor(a/65536),I=a-e*65536,a=p+e+65535,e=Math.floor(a/65536),p=a-e*65536,a=B+e+65535,e=Math.floor(a/65536),B=a-e*65536,a=f+e+65535,e=Math.floor(a/65536),f=a-e*65536,a=Q+e+65535,e=Math.floor(a/65536),Q=a-e*65536,a=y+e+65535,e=Math.floor(a/65536),y=a-e*65536,a=m+e+65535,e=Math.floor(a/65536),m=a-e*65536,a=T+e+65535,e=Math.floor(a/65536),T=a-e*65536,a=_+e+65535,e=Math.floor(a/65536),_=a-e*65536,a=R+e+65535,e=Math.floor(a/65536),R=a-e*65536,i+=e-1+37*(e-1),n[0]=i,n[1]=A,n[2]=r,n[3]=s,n[4]=g,n[5]=c,n[6]=I,n[7]=p,n[8]=B,n[9]=f,n[10]=Q,n[11]=y,n[12]=m,n[13]=T,n[14]=_,n[15]=R}function xn(n,t){dt(n,t,t)}function XF(n,t){var o=hA(),a;for(a=0;a<16;a++)o[a]=t[a];for(a=253;a>=0;a--)xn(o,o),a!==2&&a!==4&&dt(o,o,t);for(a=0;a<16;a++)n[a]=o[a]}function bKe(n,t){var o=hA(),a;for(a=0;a<16;a++)o[a]=t[a];for(a=250;a>=0;a--)xn(o,o),a!==1&&dt(o,o,t);for(a=0;a<16;a++)n[a]=o[a]}function GX(n,t,o){var a=new Uint8Array(32),e=new Float64Array(80),i,A,r=hA(),s=hA(),g=hA(),c=hA(),I=hA(),p=hA();for(A=0;A<31;A++)a[A]=t[A];for(a[31]=t[31]&127|64,a[0]&=248,ZF(e,o),A=0;A<16;A++)s[A]=e[A],c[A]=r[A]=g[A]=0;for(r[0]=c[0]=1,A=254;A>=0;--A)i=a[A>>>3]>>>(A&7)&1,yh(r,s,i),yh(g,c,i),Kn(I,r,g),Yn(r,r,g),Kn(g,s,c),Yn(s,s,c),xn(c,I),xn(p,r),dt(r,g,r),dt(g,s,I),Kn(I,r,g),Yn(r,r,g),xn(s,r),Yn(g,c,p),dt(r,g,mKe),Kn(r,r,c),dt(g,g,r),dt(r,c,p),dt(c,s,e),xn(s,I),yh(r,s,i),yh(g,c,i);for(A=0;A<16;A++)e[A+16]=r[A],e[A+32]=g[A],e[A+48]=s[A],e[A+64]=c[A];var B=e.subarray(32),f=e.subarray(16);return XF(B,B),dt(f,f,B),Sh(n,f),0}function MKe(n,t){return GX(n,t,kX)}var TX=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function NX(n,t,o,a){for(var e=new Int32Array(16),i=new Int32Array(16),A,r,s,g,c,I,p,B,f,Q,y,m,T,_,R,L,U,F,q,z,K,G,V,H,N,k,J=n[0],X=n[1],ie=n[2],De=n[3],oe=n[4],Se=n[5],Be=n[6],Re=n[7],Ne=t[0],Je=t[1],ve=t[2],tA=t[3],fe=t[4],Ie=t[5],Xe=t[6],je=t[7],be=0;a>=128;){for(q=0;q<16;q++)z=8*q+be,e[q]=o[z+0]<<24|o[z+1]<<16|o[z+2]<<8|o[z+3],i[q]=o[z+4]<<24|o[z+5]<<16|o[z+6]<<8|o[z+7];for(q=0;q<80;q++)if(A=J,r=X,s=ie,g=De,c=oe,I=Se,p=Be,B=Re,f=Ne,Q=Je,y=ve,m=tA,T=fe,_=Ie,R=Xe,L=je,K=Re,G=je,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=(oe>>>14|fe<<18)^(oe>>>18|fe<<14)^(fe>>>9|oe<<23),G=(fe>>>14|oe<<18)^(fe>>>18|oe<<14)^(oe>>>9|fe<<23),V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,K=oe&Se^~oe&Be,G=fe&Ie^~fe&Xe,V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,K=TX[q*2],G=TX[q*2+1],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,K=e[q%16],G=i[q%16],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,U=N&65535|k<<16,F=V&65535|H<<16,K=U,G=F,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=(J>>>28|Ne<<4)^(Ne>>>2|J<<30)^(Ne>>>7|J<<25),G=(Ne>>>28|J<<4)^(J>>>2|Ne<<30)^(J>>>7|Ne<<25),V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,K=J&X^J&ie^X&ie,G=Ne&Je^Ne&ve^Je&ve,V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,B=N&65535|k<<16,L=V&65535|H<<16,K=g,G=m,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=U,G=F,V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,g=N&65535|k<<16,m=V&65535|H<<16,X=A,ie=r,De=s,oe=g,Se=c,Be=I,Re=p,J=B,Je=f,ve=Q,tA=y,fe=m,Ie=T,Xe=_,je=R,Ne=L,q%16===15)for(z=0;z<16;z++)K=e[z],G=i[z],V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=e[(z+9)%16],G=i[(z+9)%16],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,U=e[(z+1)%16],F=i[(z+1)%16],K=(U>>>1|F<<31)^(U>>>8|F<<24)^U>>>7,G=(F>>>1|U<<31)^(F>>>8|U<<24)^(F>>>7|U<<25),V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,U=e[(z+14)%16],F=i[(z+14)%16],K=(U>>>19|F<<13)^(F>>>29|U<<3)^U>>>6,G=(F>>>19|U<<13)^(U>>>29|F<<3)^(F>>>6|U<<26),V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,e[z]=N&65535|k<<16,i[z]=V&65535|H<<16;K=J,G=Ne,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[0],G=t[0],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[0]=J=N&65535|k<<16,t[0]=Ne=V&65535|H<<16,K=X,G=Je,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[1],G=t[1],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[1]=X=N&65535|k<<16,t[1]=Je=V&65535|H<<16,K=ie,G=ve,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[2],G=t[2],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[2]=ie=N&65535|k<<16,t[2]=ve=V&65535|H<<16,K=De,G=tA,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[3],G=t[3],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[3]=De=N&65535|k<<16,t[3]=tA=V&65535|H<<16,K=oe,G=fe,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[4],G=t[4],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[4]=oe=N&65535|k<<16,t[4]=fe=V&65535|H<<16,K=Se,G=Ie,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[5],G=t[5],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[5]=Se=N&65535|k<<16,t[5]=Ie=V&65535|H<<16,K=Be,G=Xe,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[6],G=t[6],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[6]=Be=N&65535|k<<16,t[6]=Xe=V&65535|H<<16,K=Re,G=je,V=G&65535,H=G>>>16,N=K&65535,k=K>>>16,K=n[7],G=t[7],V+=G&65535,H+=G>>>16,N+=K&65535,k+=K>>>16,H+=V>>>16,N+=H>>>16,k+=N>>>16,n[7]=Re=N&65535|k<<16,t[7]=je=V&65535|H<<16,be+=128,a-=128}return a}function NB(n,t,o){var a=new Int32Array(8),e=new Int32Array(8),i=new Uint8Array(256),A,r=o;for(a[0]=1779033703,a[1]=3144134277,a[2]=1013904242,a[3]=2773480762,a[4]=1359893119,a[5]=2600822924,a[6]=528734635,a[7]=1541459225,e[0]=4089235720,e[1]=2227873595,e[2]=4271175723,e[3]=1595750129,e[4]=2917565137,e[5]=725511199,e[6]=4215389547,e[7]=327033209,NX(a,e,t,o),o%=128,A=0;A=0;--e)a=o[e/8|0]>>(e&7)&1,RX(n,t,a),VF(t,n),VF(n,n),RX(n,t,a)}function dD(n,t){var o=[hA(),hA(),hA(),hA()];Wc(o[0],OX),Wc(o[1],bX),Wc(o[2],mh),dt(o[3],OX,bX),FX(n,o,t)}var qF=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function $F(n,t){var o,a,e,i;for(a=63;a>=32;--a){for(o=0,e=a-32,i=a-12;e>8,t[e]-=o*256;t[e]+=o,t[a]=0}for(o=0,e=0;e<32;e++)t[e]+=o-(t[31]>>4)*qF[e],o=t[e]>>8,t[e]&=255;for(e=0;e<32;e++)t[e]-=o*qF[e];for(a=0;a<32;a++)t[a+1]+=t[a]>>8,n[a]=t[a]&255}function RB(n){var t=new Float64Array(64),o;for(o=0;o<64;o++)t[o]=n[o];for(o=0;o<64;o++)n[o]=0;$F(n,t)}function _Ke(n,t,o,a){var e=new Uint8Array(64),i=new Uint8Array(64),A,r,s=new Float64Array(64),g=[hA(),hA(),hA(),hA()];for(A=0;A>7&&Yn(n[0],zF,n[0]),dt(n[3],n[0],n[1]),0)}function RKe(n,t,o,a){var e,i,A=new Uint8Array(32),r=new Uint8Array(64),s=[hA(),hA(),hA(),hA()],g=[hA(),hA(),hA(),hA()];if(i=-1,o<64||NKe(g,a))return-1;for(e=0;e=0}xg.verify=LKe;function UKe(n){if(Zc(n),n.length!==32)throw new Error("wrong seed length");for(var t=new Uint8Array(32),o=new Uint8Array(32),a=0;a<32;a++)t[a]=n[a];return MKe(o,t),t[0]&=248,t[31]&=127,t[31]|=64,o[31]&=127,{public:o,private:t}}xg.generateKeyPair=UKe;xg.default={}});var Xc=ee(Dh=>{"use strict";var kB=UX(),wh=$e("crypto"),eL=Buffer.from([48,42,48,5,6,3,43,101,110,3,33,0]),AL=Buffer.from([48,46,2,1,0,48,5,6,3,43,101,110,4,34,4,32]),HKe=Buffer.from([5]),tL=function(n){return Buffer.concat([HKe,n])};function HX(n){if(n===void 0)throw new Error("Undefined private key");if(!(n instanceof Buffer))throw new Error(`Invalid private key type: ${n.constructor.name}`);if(n.byteLength!=32)throw new Error(`Incorrect private key length: ${n.byteLength}`)}function KX(n){if(!(n instanceof Buffer))throw new Error(`Invalid public key type: ${n.constructor.name}`);if(n===void 0||(n.byteLength!=33||n[0]!=5)&&n.byteLength!=32)throw new Error("Invalid public key");return n.byteLength==33?n.slice(1):(console.error("WARNING: Expected pubkey of length 33, please report the ST and client that generated the pubkey"),n)}function KKe(n){let t=new Uint8Array(n);return t[0]|=6,t[31]|=128,t[31]&=-65,t}Dh.getPublicFromPrivateKey=function(n){let t=KKe(n),o=kB.generateKeyPair(t);return tL(Buffer.from(o.public))};Dh.generateKeyPair=function(){try{let{publicKey:n,privateKey:t}=wh.generateKeyPairSync("x25519",{publicKeyEncoding:{format:"der",type:"spki"},privateKeyEncoding:{format:"der",type:"pkcs8"}}),o=n.slice(eL.length,eL.length+32),a=t.slice(AL.length,AL.length+32);return{pubKey:tL(o),privKey:a}}catch{let t=kB.generateKeyPair(wh.randomBytes(32));return{privKey:Buffer.from(t.private),pubKey:tL(Buffer.from(t.public))}}};Dh.calculateAgreement=function(n,t){if(n=KX(n),HX(t),!n||n.byteLength!=32)throw new Error("Invalid public key");if(typeof wh.diffieHellman=="function"){let o=wh.createPrivateKey({key:Buffer.concat([AL,t]),format:"der",type:"pkcs8"}),a=wh.createPublicKey({key:Buffer.concat([eL,n]),format:"der",type:"spki"});return wh.diffieHellman({privateKey:o,publicKey:a})}else{let o=kB.sharedKey(t,n);return Buffer.from(o)}};Dh.calculateSignature=function(n,t){if(HX(n),!t)throw new Error("Invalid message");return Buffer.from(kB.sign(n,t))};Dh.verifySignature=function(n,t,o,a){if(n=KX(n),!n||n.byteLength!=32)throw new Error("Invalid public key");if(!t)throw new Error("Invalid message");if(!o||o.byteLength!=64)throw new Error("Invalid signature");return a?!0:kB.verify(n,t,o)}});var YX=ee(vB=>{var hD=Xc(),xKe=$e("crypto");function xX(n){return typeof n=="number"&&n%1===0&&n>=0}vB.generateIdentityKeyPair=hD.generateKeyPair;vB.generateRegistrationId=function(){var n=Uint16Array.from(xKe.randomBytes(2))[0];return n&16383};vB.generateSignedPreKey=function(n,t){if(!(n.privKey instanceof Buffer)||n.privKey.byteLength!=32||!(n.pubKey instanceof Buffer)||n.pubKey.byteLength!=33)throw new TypeError("Invalid argument for identityKeyPair");if(!xX(t))throw new TypeError("Invalid argument for signedKeyId: "+t);let o=hD.generateKeyPair(),a=hD.calculateSignature(n.privKey,o.pubKey);return{keyId:t,keyPair:o,signature:a}};vB.generatePreKey=function(n){if(!xX(n))throw new TypeError("Invalid argument for keyId: "+n);let t=hD.generateKeyPair();return{keyId:n,keyPair:t}}});var iL=ee((RmA,jX)=>{var rL=class n{static from(t){if(typeof t!="string"||!t.match(/.*\.\d+/))throw new Error("Invalid address encoding");let o=t.split(".");return new this(o[0],parseInt(o[1]))}constructor(t,o){if(typeof t!="string")throw new TypeError("id required for addr");if(t.indexOf(".")!==-1)throw new TypeError("encoded addr detected");if(this.id=t,typeof o!="number")throw new TypeError("number required for deviceId");this.deviceId=o}toString(){return`${this.id}.${this.deviceId}`}is(t){return t instanceof n?t.id===this.id&&t.deviceId===this.deviceId:!1}};jX.exports=rL});var aL=ee((kmA,JX)=>{var YKe={OURS:1,THEIRS:2};JX.exports=YKe});var oL=ee((vmA,qX)=>{var jKe={SENDING:1,RECEIVING:2};qX.exports=jKe});var BD=ee((PmA,VX)=>{var JKe=aL(),qKe=40,zX="v1";function uD(n){if(!Buffer.isBuffer(n))throw new TypeError("Buffer required")}var CD=class{constructor(){this._chains={}}toString(){return``}inspect(){return this.toString()}addChain(t,o){uD(t);let a=t.toString("base64");if(this._chains.hasOwnProperty(a))throw new Error("Overwrite attempt");this._chains[a]=o}getChain(t){return uD(t),this._chains[t.toString("base64")]}deleteChain(t){uD(t);let o=t.toString("base64");if(!this._chains.hasOwnProperty(o))throw new ReferenceError("Not Found");delete this._chains[o]}*chains(){for(let[t,o]of Object.entries(this._chains))yield[Buffer.from(t,"base64"),o]}serialize(){let t={registrationId:this.registrationId,currentRatchet:{ephemeralKeyPair:{pubKey:this.currentRatchet.ephemeralKeyPair.pubKey.toString("base64"),privKey:this.currentRatchet.ephemeralKeyPair.privKey.toString("base64")},lastRemoteEphemeralKey:this.currentRatchet.lastRemoteEphemeralKey.toString("base64"),previousCounter:this.currentRatchet.previousCounter,rootKey:this.currentRatchet.rootKey.toString("base64")},indexInfo:{baseKey:this.indexInfo.baseKey.toString("base64"),baseKeyType:this.indexInfo.baseKeyType,closed:this.indexInfo.closed,used:this.indexInfo.used,created:this.indexInfo.created,remoteIdentityKey:this.indexInfo.remoteIdentityKey.toString("base64")},_chains:this._serialize_chains(this._chains)};return this.pendingPreKey&&(t.pendingPreKey=Object.assign({},this.pendingPreKey),t.pendingPreKey.baseKey=this.pendingPreKey.baseKey.toString("base64")),t}static deserialize(t){let o=new this;return o.registrationId=t.registrationId,o.currentRatchet={ephemeralKeyPair:{pubKey:Buffer.from(t.currentRatchet.ephemeralKeyPair.pubKey,"base64"),privKey:Buffer.from(t.currentRatchet.ephemeralKeyPair.privKey,"base64")},lastRemoteEphemeralKey:Buffer.from(t.currentRatchet.lastRemoteEphemeralKey,"base64"),previousCounter:t.currentRatchet.previousCounter,rootKey:Buffer.from(t.currentRatchet.rootKey,"base64")},o.indexInfo={baseKey:Buffer.from(t.indexInfo.baseKey,"base64"),baseKeyType:t.indexInfo.baseKeyType,closed:t.indexInfo.closed,used:t.indexInfo.used,created:t.indexInfo.created,remoteIdentityKey:Buffer.from(t.indexInfo.remoteIdentityKey,"base64")},o._chains=this._deserialize_chains(t._chains),t.pendingPreKey&&(o.pendingPreKey=Object.assign({},t.pendingPreKey),o.pendingPreKey.baseKey=Buffer.from(t.pendingPreKey.baseKey,"base64")),o}_serialize_chains(t){let o={};for(let a of Object.keys(t)){let e=t[a],i={};for(let[A,r]of Object.entries(e.messageKeys))i[A]=r.toString("base64");o[a]={chainKey:{counter:e.chainKey.counter,key:e.chainKey.key&&e.chainKey.key.toString("base64")},chainType:e.chainType,messageKeys:i}}return o}static _deserialize_chains(t){let o={};for(let a of Object.keys(t)){let e=t[a],i={};for(let[A,r]of Object.entries(e.messageKeys))i[A]=Buffer.from(r,"base64");o[a]={chainKey:{counter:e.chainKey.counter,key:e.chainKey.key&&Buffer.from(e.chainKey.key,"base64")},chainType:e.chainType,messageKeys:i}}return o}},ED=[{version:"v1",migrate:function(t){let o=t._sessions;if(t.registrationId)for(let a in o)o[a].registrationId||(o[a].registrationId=t.registrationId);else for(let a in o)o[a].indexInfo.closed===-1&&console.error("V1 session storage migration error: registrationId",t.registrationId,"for open session version",t.version)}}],nL=class{static createEntry(){return new CD}static migrate(t){let o=t.version===void 0;for(let a=0;a{let a=t.indexInfo.used||0,e=o.indexInfo.used||0;return a===e?0:aqKe;){let t,o;for(let[a,e]of Object.entries(this.sessions))e.indexInfo.closed!==-1&&(!o||e.indexInfo.closed{ks.SignalError=class extends Error{};ks.UntrustedIdentityKeyError=class extends ks.SignalError{constructor(t,o){super(),this.name="UntrustedIdentityKeyError",this.addr=t,this.identityKey=o}};ks.SessionError=class extends ks.SignalError{constructor(t){super(t),this.name="SessionError"}};ks.MessageCounterError=class extends ks.SessionError{constructor(t){super(t),this.name="MessageCounterError"}};ks.PreKeyError=class extends ks.SessionError{constructor(t){super(t),this.name="PreKeyError"}}});var sL=ee((xmA,ZX)=>{"use strict";var QD=new Map,WX=1e4;async function zKe(n,t){let o=0;for(;;){let a=Math.min(n.length,WX);for(let e=o;e=WX?(n.splice(0,a),o=0):o=a;else break}t()}ZX.exports=function(n,t){t.name||(Object.defineProperty(t,"name",{writable:!0}),typeof n=="string"?t.name=n:console.warn("Unhandled bucket type (for naming):",typeof n,n));let o;QD.has(n)||(QD.set(n,[]),o=!0);let a=QD.get(n),e=new Promise((i,A)=>a.push({awaitable:t,resolve:i,reject:A}));return o&&zKe(a,()=>QD.delete(n)),e}});var cL=ee((YmA,A7)=>{"use strict";var XX=aL(),VKe=oL(),$X=BD(),e7=Kl(),$c=Xc(),yD=fD(),WKe=sL(),gL=class{constructor(t,o){this.addr=o,this.storage=t}async initOutgoing(t){let o=this.addr.toString();return await WKe(o,async()=>{if(!await this.storage.isTrustedIdentity(this.addr.id,t.identityKey))throw new yD.UntrustedIdentityKeyError(this.addr.id,t.identityKey);$c.verifySignature(t.identityKey,t.signedPreKey.publicKey,t.signedPreKey.signature,!0);let a=$c.generateKeyPair(),e=t.preKey&&t.preKey.publicKey,i=await this.initSession(!0,a,void 0,t.identityKey,e,t.signedPreKey.publicKey,t.registrationId);i.pendingPreKey={signedKeyId:t.signedPreKey.keyId,baseKey:a.pubKey},t.preKey&&(i.pendingPreKey.preKeyId=t.preKey.keyId);let A=await this.storage.loadSession(o);if(!A)A=new $X;else{let r=A.getOpenSession();r&&A.closeSession(r)}A.setSession(i),await this.storage.storeSession(o,A)})}async initIncoming(t,o){let a=this.addr.toString();if(!await this.storage.isTrustedIdentity(a,o.identityKey))throw new yD.UntrustedIdentityKeyError(this.addr.id,o.identityKey);if(t.getSession(o.baseKey))return;let e=await this.storage.loadPreKey(o.preKeyId);if(o.preKeyId&&!e)throw new yD.PreKeyError("Invalid PreKey ID");let i=await this.storage.loadSignedPreKey(o.signedPreKeyId);if(!i)throw new yD.PreKeyError("Missing SignedPreKey");let A=t.getOpenSession();return A&&(console.warn("Closing open session in favor of incoming prekey bundle"),t.closeSession(A)),t.setSession(await this.initSession(!1,e,i,o.identityKey,o.baseKey,void 0,o.registrationId)),o.preKeyId}async initSession(t,o,a,e,i,A,r){if(t){if(a)throw new Error("Invalid call to initSession");a=o}else{if(A)throw new Error("Invalid call to initSession");A=i}let s;!o||!i?s=new Uint8Array(128):s=new Uint8Array(160);for(var g=0;g<32;g++)s[g]=255;let c=await this.storage.getOurIdentity(),I=$c.calculateAgreement(A,c.privKey),p=$c.calculateAgreement(e,a.privKey),B=$c.calculateAgreement(A,a.privKey);if(t?(s.set(new Uint8Array(I),32),s.set(new Uint8Array(p),64)):(s.set(new Uint8Array(I),64),s.set(new Uint8Array(p),32)),s.set(new Uint8Array(B),96),o&&i){let y=$c.calculateAgreement(i,o.privKey);s.set(new Uint8Array(y),128)}let f=e7.deriveSecrets(Buffer.from(s),Buffer.alloc(32),Buffer.from("WhisperText")),Q=$X.createEntry();return Q.registrationId=r,Q.currentRatchet={rootKey:f[0],ephemeralKeyPair:t?$c.generateKeyPair():a,lastRemoteEphemeralKey:A,previousCounter:0},Q.indexInfo={created:Date.now(),used:Date.now(),remoteIdentityKey:e,baseKey:t?o.pubKey:i,baseKeyType:t?XX.OURS:XX.THEIRS,closed:-1},t&&this.calculateSendingRatchet(Q,A),Q}calculateSendingRatchet(t,o){let a=t.currentRatchet,e=$c.calculateAgreement(o,a.ephemeralKeyPair.privKey),i=e7.deriveSecrets(e,a.rootKey,Buffer.from("WhisperRatchet"));t.addChain(a.ephemeralKeyPair.pubKey,{messageKeys:{},chainKey:{counter:-1,key:i[1]},chainType:VKe.SENDING}),a.rootKey=i[0]}};A7.exports=gL});var r7=ee((jmA,t7)=>{"use strict";var eI=tS(),en=eI.Reader,IL=eI.Writer,nA=eI.util,jn=eI.roots.default||(eI.roots.default={});jn.textsecure=(function(){var n={};return n.WhisperMessage=(function(){function t(o){if(o)for(var a=Object.keys(o),e=0;e>>3){case 1:A.ephemeralKey=a.bytes();break;case 2:A.counter=a.uint32();break;case 3:A.previousCounter=a.uint32();break;case 4:A.ciphertext=a.bytes();break;default:a.skipType(r&7);break}}return A},t.decodeDelimited=function(a){return a instanceof en||(a=new en(a)),this.decode(a,a.uint32())},t.verify=function(a){return typeof a!="object"||a===null?"object expected":a.ephemeralKey!=null&&a.hasOwnProperty("ephemeralKey")&&!(a.ephemeralKey&&typeof a.ephemeralKey.length=="number"||nA.isString(a.ephemeralKey))?"ephemeralKey: buffer expected":a.counter!=null&&a.hasOwnProperty("counter")&&!nA.isInteger(a.counter)?"counter: integer expected":a.previousCounter!=null&&a.hasOwnProperty("previousCounter")&&!nA.isInteger(a.previousCounter)?"previousCounter: integer expected":a.ciphertext!=null&&a.hasOwnProperty("ciphertext")&&!(a.ciphertext&&typeof a.ciphertext.length=="number"||nA.isString(a.ciphertext))?"ciphertext: buffer expected":null},t.fromObject=function(a){if(a instanceof jn.textsecure.WhisperMessage)return a;var e=new jn.textsecure.WhisperMessage;return a.ephemeralKey!=null&&(typeof a.ephemeralKey=="string"?nA.base64.decode(a.ephemeralKey,e.ephemeralKey=nA.newBuffer(nA.base64.length(a.ephemeralKey)),0):a.ephemeralKey.length&&(e.ephemeralKey=a.ephemeralKey)),a.counter!=null&&(e.counter=a.counter>>>0),a.previousCounter!=null&&(e.previousCounter=a.previousCounter>>>0),a.ciphertext!=null&&(typeof a.ciphertext=="string"?nA.base64.decode(a.ciphertext,e.ciphertext=nA.newBuffer(nA.base64.length(a.ciphertext)),0):a.ciphertext.length&&(e.ciphertext=a.ciphertext)),e},t.toObject=function(a,e){e||(e={});var i={};return e.defaults&&(e.bytes===String?i.ephemeralKey="":(i.ephemeralKey=[],e.bytes!==Array&&(i.ephemeralKey=nA.newBuffer(i.ephemeralKey))),i.counter=0,i.previousCounter=0,e.bytes===String?i.ciphertext="":(i.ciphertext=[],e.bytes!==Array&&(i.ciphertext=nA.newBuffer(i.ciphertext)))),a.ephemeralKey!=null&&a.hasOwnProperty("ephemeralKey")&&(i.ephemeralKey=e.bytes===String?nA.base64.encode(a.ephemeralKey,0,a.ephemeralKey.length):e.bytes===Array?Array.prototype.slice.call(a.ephemeralKey):a.ephemeralKey),a.counter!=null&&a.hasOwnProperty("counter")&&(i.counter=a.counter),a.previousCounter!=null&&a.hasOwnProperty("previousCounter")&&(i.previousCounter=a.previousCounter),a.ciphertext!=null&&a.hasOwnProperty("ciphertext")&&(i.ciphertext=e.bytes===String?nA.base64.encode(a.ciphertext,0,a.ciphertext.length):e.bytes===Array?Array.prototype.slice.call(a.ciphertext):a.ciphertext),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,eI.util.toJSONOptions)},t})(),n.PreKeyWhisperMessage=(function(){function t(o){if(o)for(var a=Object.keys(o),e=0;e>>3){case 5:A.registrationId=a.uint32();break;case 1:A.preKeyId=a.uint32();break;case 6:A.signedPreKeyId=a.uint32();break;case 2:A.baseKey=a.bytes();break;case 3:A.identityKey=a.bytes();break;case 4:A.message=a.bytes();break;default:a.skipType(r&7);break}}return A},t.decodeDelimited=function(a){return a instanceof en||(a=new en(a)),this.decode(a,a.uint32())},t.verify=function(a){return typeof a!="object"||a===null?"object expected":a.registrationId!=null&&a.hasOwnProperty("registrationId")&&!nA.isInteger(a.registrationId)?"registrationId: integer expected":a.preKeyId!=null&&a.hasOwnProperty("preKeyId")&&!nA.isInteger(a.preKeyId)?"preKeyId: integer expected":a.signedPreKeyId!=null&&a.hasOwnProperty("signedPreKeyId")&&!nA.isInteger(a.signedPreKeyId)?"signedPreKeyId: integer expected":a.baseKey!=null&&a.hasOwnProperty("baseKey")&&!(a.baseKey&&typeof a.baseKey.length=="number"||nA.isString(a.baseKey))?"baseKey: buffer expected":a.identityKey!=null&&a.hasOwnProperty("identityKey")&&!(a.identityKey&&typeof a.identityKey.length=="number"||nA.isString(a.identityKey))?"identityKey: buffer expected":a.message!=null&&a.hasOwnProperty("message")&&!(a.message&&typeof a.message.length=="number"||nA.isString(a.message))?"message: buffer expected":null},t.fromObject=function(a){if(a instanceof jn.textsecure.PreKeyWhisperMessage)return a;var e=new jn.textsecure.PreKeyWhisperMessage;return a.registrationId!=null&&(e.registrationId=a.registrationId>>>0),a.preKeyId!=null&&(e.preKeyId=a.preKeyId>>>0),a.signedPreKeyId!=null&&(e.signedPreKeyId=a.signedPreKeyId>>>0),a.baseKey!=null&&(typeof a.baseKey=="string"?nA.base64.decode(a.baseKey,e.baseKey=nA.newBuffer(nA.base64.length(a.baseKey)),0):a.baseKey.length&&(e.baseKey=a.baseKey)),a.identityKey!=null&&(typeof a.identityKey=="string"?nA.base64.decode(a.identityKey,e.identityKey=nA.newBuffer(nA.base64.length(a.identityKey)),0):a.identityKey.length&&(e.identityKey=a.identityKey)),a.message!=null&&(typeof a.message=="string"?nA.base64.decode(a.message,e.message=nA.newBuffer(nA.base64.length(a.message)),0):a.message.length&&(e.message=a.message)),e},t.toObject=function(a,e){e||(e={});var i={};return e.defaults&&(i.preKeyId=0,e.bytes===String?i.baseKey="":(i.baseKey=[],e.bytes!==Array&&(i.baseKey=nA.newBuffer(i.baseKey))),e.bytes===String?i.identityKey="":(i.identityKey=[],e.bytes!==Array&&(i.identityKey=nA.newBuffer(i.identityKey))),e.bytes===String?i.message="":(i.message=[],e.bytes!==Array&&(i.message=nA.newBuffer(i.message))),i.registrationId=0,i.signedPreKeyId=0),a.preKeyId!=null&&a.hasOwnProperty("preKeyId")&&(i.preKeyId=a.preKeyId),a.baseKey!=null&&a.hasOwnProperty("baseKey")&&(i.baseKey=e.bytes===String?nA.base64.encode(a.baseKey,0,a.baseKey.length):e.bytes===Array?Array.prototype.slice.call(a.baseKey):a.baseKey),a.identityKey!=null&&a.hasOwnProperty("identityKey")&&(i.identityKey=e.bytes===String?nA.base64.encode(a.identityKey,0,a.identityKey.length):e.bytes===Array?Array.prototype.slice.call(a.identityKey):a.identityKey),a.message!=null&&a.hasOwnProperty("message")&&(i.message=e.bytes===String?nA.base64.encode(a.message,0,a.message.length):e.bytes===Array?Array.prototype.slice.call(a.message):a.message),a.registrationId!=null&&a.hasOwnProperty("registrationId")&&(i.registrationId=a.registrationId),a.signedPreKeyId!=null&&a.hasOwnProperty("signedPreKeyId")&&(i.signedPreKeyId=a.signedPreKeyId),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,eI.util.toJSONOptions)},t})(),n.KeyExchangeMessage=(function(){function t(o){if(o)for(var a=Object.keys(o),e=0;e>>3){case 1:A.id=a.uint32();break;case 2:A.baseKey=a.bytes();break;case 3:A.ephemeralKey=a.bytes();break;case 4:A.identityKey=a.bytes();break;case 5:A.baseKeySignature=a.bytes();break;default:a.skipType(r&7);break}}return A},t.decodeDelimited=function(a){return a instanceof en||(a=new en(a)),this.decode(a,a.uint32())},t.verify=function(a){return typeof a!="object"||a===null?"object expected":a.id!=null&&a.hasOwnProperty("id")&&!nA.isInteger(a.id)?"id: integer expected":a.baseKey!=null&&a.hasOwnProperty("baseKey")&&!(a.baseKey&&typeof a.baseKey.length=="number"||nA.isString(a.baseKey))?"baseKey: buffer expected":a.ephemeralKey!=null&&a.hasOwnProperty("ephemeralKey")&&!(a.ephemeralKey&&typeof a.ephemeralKey.length=="number"||nA.isString(a.ephemeralKey))?"ephemeralKey: buffer expected":a.identityKey!=null&&a.hasOwnProperty("identityKey")&&!(a.identityKey&&typeof a.identityKey.length=="number"||nA.isString(a.identityKey))?"identityKey: buffer expected":a.baseKeySignature!=null&&a.hasOwnProperty("baseKeySignature")&&!(a.baseKeySignature&&typeof a.baseKeySignature.length=="number"||nA.isString(a.baseKeySignature))?"baseKeySignature: buffer expected":null},t.fromObject=function(a){if(a instanceof jn.textsecure.KeyExchangeMessage)return a;var e=new jn.textsecure.KeyExchangeMessage;return a.id!=null&&(e.id=a.id>>>0),a.baseKey!=null&&(typeof a.baseKey=="string"?nA.base64.decode(a.baseKey,e.baseKey=nA.newBuffer(nA.base64.length(a.baseKey)),0):a.baseKey.length&&(e.baseKey=a.baseKey)),a.ephemeralKey!=null&&(typeof a.ephemeralKey=="string"?nA.base64.decode(a.ephemeralKey,e.ephemeralKey=nA.newBuffer(nA.base64.length(a.ephemeralKey)),0):a.ephemeralKey.length&&(e.ephemeralKey=a.ephemeralKey)),a.identityKey!=null&&(typeof a.identityKey=="string"?nA.base64.decode(a.identityKey,e.identityKey=nA.newBuffer(nA.base64.length(a.identityKey)),0):a.identityKey.length&&(e.identityKey=a.identityKey)),a.baseKeySignature!=null&&(typeof a.baseKeySignature=="string"?nA.base64.decode(a.baseKeySignature,e.baseKeySignature=nA.newBuffer(nA.base64.length(a.baseKeySignature)),0):a.baseKeySignature.length&&(e.baseKeySignature=a.baseKeySignature)),e},t.toObject=function(a,e){e||(e={});var i={};return e.defaults&&(i.id=0,e.bytes===String?i.baseKey="":(i.baseKey=[],e.bytes!==Array&&(i.baseKey=nA.newBuffer(i.baseKey))),e.bytes===String?i.ephemeralKey="":(i.ephemeralKey=[],e.bytes!==Array&&(i.ephemeralKey=nA.newBuffer(i.ephemeralKey))),e.bytes===String?i.identityKey="":(i.identityKey=[],e.bytes!==Array&&(i.identityKey=nA.newBuffer(i.identityKey))),e.bytes===String?i.baseKeySignature="":(i.baseKeySignature=[],e.bytes!==Array&&(i.baseKeySignature=nA.newBuffer(i.baseKeySignature)))),a.id!=null&&a.hasOwnProperty("id")&&(i.id=a.id),a.baseKey!=null&&a.hasOwnProperty("baseKey")&&(i.baseKey=e.bytes===String?nA.base64.encode(a.baseKey,0,a.baseKey.length):e.bytes===Array?Array.prototype.slice.call(a.baseKey):a.baseKey),a.ephemeralKey!=null&&a.hasOwnProperty("ephemeralKey")&&(i.ephemeralKey=e.bytes===String?nA.base64.encode(a.ephemeralKey,0,a.ephemeralKey.length):e.bytes===Array?Array.prototype.slice.call(a.ephemeralKey):a.ephemeralKey),a.identityKey!=null&&a.hasOwnProperty("identityKey")&&(i.identityKey=e.bytes===String?nA.base64.encode(a.identityKey,0,a.identityKey.length):e.bytes===Array?Array.prototype.slice.call(a.identityKey):a.identityKey),a.baseKeySignature!=null&&a.hasOwnProperty("baseKeySignature")&&(i.baseKeySignature=e.bytes===String?nA.base64.encode(a.baseKeySignature,0,a.baseKeySignature.length):e.bytes===Array?Array.prototype.slice.call(a.baseKeySignature):a.baseKeySignature),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,eI.util.toJSONOptions)},t})(),n})();t7.exports=jn});var lL=ee((JmA,i7)=>{"use strict";var{textsecure:{WhisperMessage:ZKe,PreKeyWhisperMessage:XKe}}=r7();i7.exports={WhisperMessage:ZKe,PreKeyWhisperMessage:XKe}});var s7=ee((qmA,n7)=>{var mD=oL(),$Ke=iL(),exe=cL(),a7=BD(),Yg=Kl(),o7=Xc(),vs=fD(),Oh=lL(),Axe=sL(),AI=3;function SD(n){if(!(n instanceof Buffer))throw TypeError(`Expected Buffer instead of: ${n.constructor.name}`);return n}var pL=class{constructor(t,o){if(!(o instanceof $Ke))throw new TypeError("protocolAddress must be a ProtocolAddress");this.addr=o,this.storage=t}_encodeTupleByte(t,o){if(t>15||o>15)throw TypeError("Numbers must be 4 bits or less");return t<<4|o}_decodeTupleByte(t){return[t>>4,t&15]}toString(){return``}async getRecord(){let t=await this.storage.loadSession(this.addr.toString());if(t&&!(t instanceof a7))throw new TypeError("SessionRecord type expected from loadSession");return t}async storeRecord(t){t.removeOldSessions(),await this.storage.storeSession(this.addr.toString(),t)}async queueJob(t){return await Axe(this.addr.toString(),t)}async encrypt(t){SD(t);let o=await this.storage.getOurIdentity();return await this.queueJob(async()=>{let a=await this.getRecord();if(!a)throw new vs.SessionError("No sessions");let e=a.getOpenSession();if(!e)throw new vs.SessionError("No open session");let i=e.indexInfo.remoteIdentityKey;if(!await this.storage.isTrustedIdentity(this.addr.id,i))throw new vs.UntrustedIdentityKeyError(this.addr.id,i);let A=e.getChain(e.currentRatchet.ephemeralKeyPair.pubKey);if(A.chainType===mD.RECEIVING)throw new Error("Tried to encrypt on a receiving chain");this.fillMessageKeys(A,A.chainKey.counter+1);let r=Yg.deriveSecrets(A.messageKeys[A.chainKey.counter],Buffer.alloc(32),Buffer.from("WhisperMessageKeys"));delete A.messageKeys[A.chainKey.counter];let s=Oh.WhisperMessage.create();s.ephemeralKey=e.currentRatchet.ephemeralKeyPair.pubKey,s.counter=A.chainKey.counter,s.previousCounter=e.currentRatchet.previousCounter,s.ciphertext=Yg.encrypt(r[0],t,r[2].slice(0,16));let g=Oh.WhisperMessage.encode(s).finish(),c=Buffer.alloc(g.byteLength+66+1);c.set(o.pubKey),c.set(e.indexInfo.remoteIdentityKey,33),c[66]=this._encodeTupleByte(AI,AI),c.set(g,67);let I=Yg.calculateMAC(r[1],c),p=Buffer.alloc(g.byteLength+9);p[0]=this._encodeTupleByte(AI,AI),p.set(g,1),p.set(I.slice(0,8),g.byteLength+1),await this.storeRecord(a);let B,f;if(e.pendingPreKey){B=3;let Q=Oh.PreKeyWhisperMessage.create({identityKey:o.pubKey,registrationId:await this.storage.getOurRegistrationId(),baseKey:e.pendingPreKey.baseKey,signedPreKeyId:e.pendingPreKey.signedKeyId,message:p});e.pendingPreKey.preKeyId&&(Q.preKeyId=e.pendingPreKey.preKeyId),f=Buffer.concat([Buffer.from([this._encodeTupleByte(AI,AI)]),Buffer.from(Oh.PreKeyWhisperMessage.encode(Q).finish())])}else B=1,f=p;return{type:B,body:f,registrationId:e.registrationId}})}async decryptWithSessions(t,o){if(!o.length)throw new vs.SessionError("No sessions available");let a=[];for(let e of o){let i;try{return i=await this.doDecryptWhisperMessage(t,e),e.indexInfo.used=Date.now(),{session:e,plaintext:i}}catch(A){a.push(A)}}console.error("Failed to decrypt message with any known session...");for(let e of a)console.error("Session error:"+e,e.stack);throw new vs.SessionError("No matching sessions found for message")}async decryptWhisperMessage(t){return SD(t),await this.queueJob(async()=>{let o=await this.getRecord();if(!o)throw new vs.SessionError("No session record");let a=await this.decryptWithSessions(t,o.getSessions()),e=a.session.indexInfo.remoteIdentityKey;if(!await this.storage.isTrustedIdentity(this.addr.id,e))throw new vs.UntrustedIdentityKeyError(this.addr.id,e);return o.isClosed(a.session)&&console.warn("Decrypted message with closed session."),await this.storeRecord(o),a.plaintext})}async decryptPreKeyWhisperMessage(t){SD(t);let o=this._decodeTupleByte(t[0]);if(o[1]>3||o[0]<3)throw new Error("Incompatible version number on PreKeyWhisperMessage");return await this.queueJob(async()=>{let a=await this.getRecord(),e=Oh.PreKeyWhisperMessage.decode(t.slice(1));if(!a){if(e.registrationId==null)throw new Error("No registrationId");a=new a7}let A=await new exe(this.storage,this.addr).initIncoming(a,e),r=a.getSession(e.baseKey),s=await this.doDecryptWhisperMessage(e.message,r);return await this.storeRecord(a),A&&await this.storage.removePreKey(A),s})}async doDecryptWhisperMessage(t,o){if(SD(t),!o)throw new TypeError("session required");let a=this._decodeTupleByte(t[0]);if(a[1]>3||a[0]<3)throw new Error("Incompatible version number on WhisperMessage");let e=t.slice(1,-8),i=Oh.WhisperMessage.decode(e);this.maybeStepRatchet(o,i.ephemeralKey,i.previousCounter);let A=o.getChain(i.ephemeralKey);if(A.chainType===mD.SENDING)throw new Error("Tried to decrypt on a sending chain");if(this.fillMessageKeys(A,i.counter),!A.messageKeys.hasOwnProperty(i.counter))throw new vs.MessageCounterError("Key used already or never filled");let r=A.messageKeys[i.counter];delete A.messageKeys[i.counter];let s=Yg.deriveSecrets(r,Buffer.alloc(32),Buffer.from("WhisperMessageKeys")),g=await this.storage.getOurIdentity(),c=Buffer.alloc(e.byteLength+66+1);c.set(o.indexInfo.remoteIdentityKey),c.set(g.pubKey,33),c[66]=this._encodeTupleByte(AI,AI),c.set(e,67),Yg.verifyMAC(c,s[1],t.slice(-8),8);let I=Yg.decrypt(s[0],i.ciphertext,s[2].slice(0,16));return delete o.pendingPreKey,I}fillMessageKeys(t,o){if(t.chainKey.counter>=o)return;if(o-t.chainKey.counter>2e3)throw new vs.SessionError("Over 2000 messages into the future!");if(t.chainKey.key===void 0)throw new vs.SessionError("Chain closed");let a=t.chainKey.key;return t.messageKeys[t.chainKey.counter+1]=Yg.calculateMAC(a,Buffer.from([1])),t.chainKey.key=Yg.calculateMAC(a,Buffer.from([2])),t.chainKey.counter+=1,this.fillMessageKeys(t,o)}maybeStepRatchet(t,o,a){if(t.getChain(o))return;let e=t.currentRatchet,i=t.getChain(e.lastRemoteEphemeralKey);i&&(this.fillMessageKeys(i,a),delete i.chainKey.key),this.calculateRatchet(t,o,!1);let A=t.getChain(e.ephemeralKeyPair.pubKey);A&&(e.previousCounter=A.chainKey.counter,t.deleteChain(e.ephemeralKeyPair.pubKey)),e.ephemeralKeyPair=o7.generateKeyPair(),this.calculateRatchet(t,o,!0),e.lastRemoteEphemeralKey=o}calculateRatchet(t,o,a){let e=t.currentRatchet,i=o7.calculateAgreement(o,e.ephemeralKeyPair.privKey),A=Yg.deriveSecrets(i,e.rootKey,Buffer.from("WhisperRatchet"),2),r=a?e.ephemeralKeyPair.pubKey:o;t.addChain(r,{messageKeys:{},chainKey:{counter:-1,key:A[1]},chainType:a?mD.SENDING:mD.RECEIVING}),e.rootKey=A[0]}async hasOpenSession(){return await this.queueJob(async()=>{let t=await this.getRecord();return t?t.haveOpenSession():!1})}async closeOpenSession(){return await this.queueJob(async()=>{let t=await this.getRecord();if(t){let o=t.getOpenSession();o&&(t.closeSession(o),await this.storeRecord(t))}})}};n7.exports=pL});var g7=ee(jg=>{"use strict";jg.crypto=Kl();jg.curve=Xc();jg.keyhelper=YX();jg.ProtocolAddress=iL();jg.SessionBuilder=cL();jg.SessionCipher=s7();jg.SessionRecord=BD();Object.assign(jg,fD())});var hL=ee((XmA,d7)=>{"use strict";d7.exports=function(...n){try{return JSON.stringify(...n)}catch(t){return"[Cannot display object: "+t.message+"]"}}});var EL=ee((h7,E7)=>{"use strict";var sxe=hL();E7.exports=class extends Error{constructor(n){let t=n.filter(o=>o!=="").map(o=>typeof o=="string"?o:o instanceof Error?o.message:sxe(o));super(t.join(" ")||"Unknown error"),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,h7.assert)}}});var xl=ee((eSA,u7)=>{"use strict";var gxe=EL();u7.exports=function(n,...t){if(!n)throw t.length===1&&t[0]instanceof Error?t[0]:new gxe(t)}});var FB=ee((ASA,B7)=>{"use strict";var uL=xl(),C7={};B7.exports=function(n,t,o){if(t===!1||t===null||t===void 0)return n;o=o||{},typeof o=="string"&&(o={separator:o});let a=Array.isArray(t);uL(!a||!o.separator,"Separator option is not valid for array-based chain");let e=a?t:t.split(o.separator||"."),i=n;for(let A=0;A{"use strict";var f7={};Ba=Q7.exports={array:Array.prototype,buffer:Buffer&&Buffer.prototype,date:Date.prototype,error:Error.prototype,generic:Object.prototype,map:Map.prototype,promise:Promise.prototype,regex:RegExp.prototype,set:Set.prototype,weakMap:WeakMap.prototype,weakSet:WeakSet.prototype};f7.typeMap=new Map([["[object Error]",Ba.error],["[object Map]",Ba.map],["[object Promise]",Ba.promise],["[object Set]",Ba.set],["[object WeakMap]",Ba.weakMap],["[object WeakSet]",Ba.weakSet]]);Ba.getInternalProto=function(n){if(Array.isArray(n))return Ba.array;if(Buffer&&n instanceof Buffer)return Ba.buffer;if(n instanceof Date)return Ba.date;if(n instanceof RegExp)return Ba.regex;if(n instanceof Error)return Ba.error;let t=Object.prototype.toString.call(n);return f7.typeMap.get(t)||Ba.generic}});var DD=ee(y7=>{"use strict";y7.keys=function(n,t={}){return t.symbols!==!1?Reflect.ownKeys(n):Object.getOwnPropertyNames(n)}});var OD=ee((rSA,m7)=>{"use strict";var cxe=FB(),Co=CL(),Ixe=DD(),qg={needsProtoHack:new Set([Co.set,Co.map,Co.weakSet,Co.weakMap])};m7.exports=qg.clone=function(n,t={},o=null){if(typeof n!="object"||n===null)return n;let a=qg.clone,e=o;if(t.shallow){if(t.shallow!==!0)return qg.cloneWithShallow(n,t);a=s=>s}else if(e){let s=e.get(n);if(s)return s}else e=new Map;let i=Co.getInternalProto(n);if(i===Co.buffer)return Buffer&&Buffer.from(n);if(i===Co.date)return new Date(n.getTime());if(i===Co.regex)return new RegExp(n);let A=qg.base(n,i,t);if(A===n)return n;if(e&&e.set(n,A),i===Co.set)for(let s of n)A.add(a(s,t,e));else if(i===Co.map)for(let[s,g]of n)A.set(s,a(g,t,e));let r=Ixe.keys(n,t);for(let s of r){if(s==="__proto__")continue;if(i===Co.array&&s==="length"){A.length=n.length;continue}let g=Object.getOwnPropertyDescriptor(n,s);g?g.get||g.set?Object.defineProperty(A,s,g):g.enumerable?A[s]=a(n[s],t,e):Object.defineProperty(A,s,{enumerable:!1,writable:!0,configurable:!0,value:a(n[s],t,e)}):Object.defineProperty(A,s,{enumerable:!0,writable:!0,configurable:!0,value:a(n[s],t,e)})}return A};qg.cloneWithShallow=function(n,t){let o=t.shallow;t=Object.assign({},t),t.shallow=!1;let a=new Map;for(let e of o){let i=cxe(n,e);(typeof i=="object"||typeof i=="function")&&a.set(i,i)}return qg.clone(n,t,a)};qg.base=function(n,t,o){if(o.prototype===!1)return qg.needsProtoHack.has(t)?new t.constructor:t===Co.array?[]:{};let a=Object.getPrototypeOf(n);if(a&&a.isImmutable)return n;if(t===Co.array){let e=[];return a!==t&&Object.setPrototypeOf(e,a),e}if(qg.needsProtoHack.has(t)){let e=new a.constructor;return a!==t&&Object.setPrototypeOf(e,a),e}return Object.create(a)}});var fL=ee((iSA,D7)=>{"use strict";var BL=xl(),S7=OD(),lxe=DD(),w7={};D7.exports=w7.merge=function(n,t,o){if(BL(n&&typeof n=="object","Invalid target value: must be an object"),BL(t==null||typeof t=="object","Invalid source value: must be null, undefined, or an object"),!t)return n;if(o=Object.assign({nullOverride:!0,mergeArrays:!0},o),Array.isArray(t)){BL(Array.isArray(n),"Cannot merge array onto an object"),o.mergeArrays||(n.length=0);for(let e=0;e{"use strict";var bD=xl(),b7=OD(),M7=fL(),O7=FB(),MD={};_7.exports=function(n,t,o={}){if(bD(n&&typeof n=="object","Invalid defaults value: must be an object"),bD(!t||t===!0||typeof t=="object","Invalid source value: must be true, falsy or an object"),bD(typeof o=="object","Invalid options: must be an object"),!t)return null;if(o.shallow)return MD.applyToDefaultsWithShallow(n,t,o);let a=b7(n);if(t===!0)return a;let e=o.nullOverride!==void 0?o.nullOverride:!1;return M7(a,t,{nullOverride:e,mergeArrays:!1})};MD.applyToDefaultsWithShallow=function(n,t,o){let a=o.shallow;bD(Array.isArray(a),"Invalid keys");let e=new Map,i=t===!0?null:new Set;for(let s of a){s=Array.isArray(s)?s:s.split(".");let g=O7(n,s);g&&typeof g=="object"?e.set(g,i&&O7(t,s)||g):i&&i.add(s)}let A=b7(n,{},e);if(!i)return A;for(let s of i)MD.reachCopy(A,t,s);let r=o.nullOverride!==void 0?o.nullOverride:!1;return M7(A,t,{nullOverride:r,mergeArrays:!1})};MD.reachCopy=function(n,t,o){for(let i of o){if(!(i in t))return;let A=t[i];if(typeof A!="object"||A===null)return;t=A}let a=t,e=n;for(let i=0;i{"use strict";var QL={};N7.exports=QL.Bench=class{constructor(){this.ts=0,this.reset()}reset(){this.ts=QL.Bench.now()}elapsed(){return QL.Bench.now()-this.ts}static now(){let n=process.hrtime();return n[0]*1e3+n[1]/1e6}}});var yL=ee((sSA,k7)=>{"use strict";k7.exports=function(){}});var P7=ee((gSA,v7)=>{"use strict";var pxe=yL();v7.exports=function(){return new Promise(pxe)}});var mL=ee((cSA,G7)=>{"use strict";var Ps=CL(),sa={mismatched:null};G7.exports=function(n,t,o){return o=Object.assign({prototype:!0},o),!!sa.isDeepEqual(n,t,o,[])};sa.isDeepEqual=function(n,t,o,a){if(n===t)return n!==0||1/n===1/t;let e=typeof n;if(e!==typeof t||n===null||t===null)return!1;if(e==="function"){if(!o.deepFunction||n.toString()!==t.toString())return!1}else if(e!=="object")return n!==n&&t!==t;let i=sa.getSharedType(n,t,!!o.prototype);switch(i){case Ps.buffer:return Buffer&&Buffer.prototype.equals.call(n,t);case Ps.promise:return n===t;case Ps.regex:return n.toString()===t.toString();case sa.mismatched:return!1}for(let A=a.length-1;A>=0;--A)if(a[A].isSame(n,t))return!0;a.push(new sa.SeenEntry(n,t));try{return!!sa.isDeepEqualObj(i,n,t,o,a)}finally{a.pop()}};sa.getSharedType=function(n,t,o){if(o)return Object.getPrototypeOf(n)!==Object.getPrototypeOf(t)?sa.mismatched:Ps.getInternalProto(n);let a=Ps.getInternalProto(n);return a!==Ps.getInternalProto(t)?sa.mismatched:a};sa.valueOf=function(n){let t=n.valueOf;if(t===void 0)return n;try{return t.call(n)}catch(o){return o}};sa.hasOwnEnumerableProperty=function(n,t){return Object.prototype.propertyIsEnumerable.call(n,t)};sa.isSetSimpleEqual=function(n,t){for(let o of Set.prototype.values.call(n))if(!Set.prototype.has.call(t,o))return!1;return!0};sa.isDeepEqualObj=function(n,t,o,a,e){let{isDeepEqual:i,valueOf:A,hasOwnEnumerableProperty:r}=sa,{keys:s,getOwnPropertySymbols:g}=Object;if(n===Ps.array)if(a.part){for(let f of t)for(let Q of o)if(i(f,Q,a,e))return!0}else{if(t.length!==o.length)return!1;for(let f=0;f{"use strict";F7.exports=function(n){return n.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}});var U7=ee((pSA,L7)=>{"use strict";var _D=xl(),dxe=mL(),hxe=SL(),Exe=DD(),Bo={};L7.exports=function(n,t,o={}){return typeof t!="object"&&(t=[t]),_D(!Array.isArray(t)||t.length,"Values array cannot be empty"),typeof n=="string"?Bo.string(n,t,o):Array.isArray(n)?Bo.array(n,t,o):(_D(typeof n=="object","Reference must be string or an object"),Bo.object(n,t,o))};Bo.array=function(n,t,o){if(Array.isArray(t)||(t=[t]),!n.length||o.only&&o.once&&n.length!==t.length)return!1;let a,e=new Map;for(let A of t)if(!o.deep||!A||typeof A!="object"){let r=e.get(A);r?++r.allowed:e.set(A,{allowed:1,hits:0})}else{a=a||Bo.compare(o);let r=!1;for(let[s,g]of e.entries())if(a(s,A)){++g.allowed,r=!0;break}r||e.set(A,{allowed:1,hits:0})}let i=0;for(let A of n){let r;if(!o.deep||!A||typeof A!="object")r=e.get(A);else{a=a||Bo.compare(o);for(let[s,g]of e.entries())if(a(s,A)){r=g;break}}if(r&&(++r.hits,++i,o.once&&r.hits>r.allowed))return!1}if(o.only&&i!==n.length)return!1;for(let A of e.values())if(A.hits!==A.allowed&&A.hitst.propertyIsEnumerable(s)),i=[...Object.keys(t),...e],A=Bo.compare(o),r=new Set(i);for(let s of a){if(!r.has(s)){if(o.only)return!1;continue}if(!A(t[s],n[s]))return!1;r.delete(s)}return r.size?o.part?r.sizes!=="");let a=new Map,e=[];for(let s of t)if(_D(typeof s=="string","Cannot compare string reference to non-string value"),s){let g=a.get(s);g?++g.allowed:(a.set(s,{allowed:1,hits:0}),e.push(hxe(s)))}else if(o.once||o.only)return!1;if(!e.length)return!0;let i=new RegExp(`(${e.join("|")})`,"g"),A=n.replace(i,(s,g)=>(++a.get(g).hits,""));if(o.only&&A)return!1;let r=!1;for(let s of a.values())if(s.hits&&(r=!0),s.hits!==s.allowed&&(s.hitsdxe(e,i,a)};Bo.shallow=function(n,t){return n===t}});var K7=ee((dSA,H7)=>{"use strict";var uxe=xl();H7.exports=function(n){return uxe(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/.test(n),"Bad attribute value ("+n+")"),n.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')}});var Y7=ee((hSA,x7)=>{"use strict";var rI={};x7.exports=function(n){if(!n)return"";let t="";for(let o=0;o=256?"&#"+n+";":`&#x${n.toString(16).padStart(2,"0")};`)};rI.isSafe=function(n){return rI.safeCharCodes.has(n)};rI.namedHtml=new Map([[38,"&"],[60,"<"],[62,">"],[34,"""],[160," "],[162,"¢"],[163,"£"],[164,"¤"],[169,"©"],[174,"®"]]);rI.safeCharCodes=(function(){let n=new Set;for(let t=32;t<123;++t)(t>=97||t>=65&&t<=90||t>=48&&t<=57||t===32||t===46||t===44||t===45||t===58||t===95)&&n.add(t);return n})()});var J7=ee((ESA,j7)=>{"use strict";var TD={};j7.exports=function(n){return n?n.replace(/[<>&\u2028\u2029]/g,TD.escape):""};TD.escape=function(n){return TD.replacements.get(n)};TD.replacements=new Map([["<","\\u003c"],[">","\\u003e"],["&","\\u0026"],["\u2028","\\u2028"],["\u2029","\\u2029"]])});var V7=ee((uSA,z7)=>{"use strict";var q7={};z7.exports=q7.flatten=function(n,t){let o=t||[];for(let a of n)Array.isArray(a)?q7.flatten(a,o):o.push(a);return o}});var X7=ee((CSA,Z7)=>{"use strict";var W7={};Z7.exports=function(n,t,o={}){if(!n||!t)return o.first?null:[];let a=[],e=Array.isArray(n)?new Set(n):n,i=new Set;for(let A of t)if(W7.has(e,A)&&!i.has(A)){if(o.first)return A;a.push(A),i.add(A)}return o.first?null:a};W7.has=function(n,t){return typeof n.has=="function"?n.has(t):n[t]!==void 0}});var e$=ee((BSA,$7)=>{"use strict";$7.exports=function(n){return!!n&&typeof n.then=="function"}});var r$=ee((fSA,t$)=>{"use strict";var A$={wrapped:Symbol("wrapped")};t$.exports=function(n){if(n[A$.wrapped])return n;let t=!1,o=function(...a){t||(t=!0,n(...a))};return o[A$.wrapped]=!0,o}});var a$=ee((QSA,i$)=>{"use strict";var Cxe=FB();i$.exports=function(n,t,o){return t.replace(/{([^{}]+)}/g,(a,e)=>{let i=Cxe(n,e,o);return i??""})}});var n$=ee((ySA,o$)=>{"use strict";var Bxe={maxTimer:2147483647};o$.exports=function(n,t,o){if(typeof n=="bigint"&&(n=Number(n)),n>=Number.MAX_SAFE_INTEGER&&(n=1/0),typeof n!="number"&&n!==void 0)throw new TypeError("Timeout must be a number or bigint");return new Promise(a=>{let e=o?o.setTimeout:setTimeout,i=()=>{let A=Math.min(n,Bxe.maxTimer);n-=A,e(()=>n>0?i():a(t),A)};n!==1/0&&i()})}});var s$=ee(Er=>{"use strict";Er.applyToDefaults=T7();Er.assert=xl();Er.Bench=R7();Er.block=P7();Er.clone=OD();Er.contain=U7();Er.deepEqual=mL();Er.Error=EL();Er.escapeHeaderAttribute=K7();Er.escapeHtml=Y7();Er.escapeJson=J7();Er.escapeRegex=SL();Er.flatten=V7();Er.ignore=yL();Er.intersect=X7();Er.isPromise=e$();Er.merge=fL();Er.once=r$();Er.reach=FB();Er.reachTemplate=a$();Er.stringify=hL();Er.wait=n$()});var Jr=ee(Pe=>{"use strict";var Yl=s$(),Wa={codes:new Map([[100,"Continue"],[101,"Switching Protocols"],[102,"Processing"],[200,"OK"],[201,"Created"],[202,"Accepted"],[203,"Non-Authoritative Information"],[204,"No Content"],[205,"Reset Content"],[206,"Partial Content"],[207,"Multi-Status"],[300,"Multiple Choices"],[301,"Moved Permanently"],[302,"Moved Temporarily"],[303,"See Other"],[304,"Not Modified"],[305,"Use Proxy"],[307,"Temporary Redirect"],[400,"Bad Request"],[401,"Unauthorized"],[402,"Payment Required"],[403,"Forbidden"],[404,"Not Found"],[405,"Method Not Allowed"],[406,"Not Acceptable"],[407,"Proxy Authentication Required"],[408,"Request Time-out"],[409,"Conflict"],[410,"Gone"],[411,"Length Required"],[412,"Precondition Failed"],[413,"Request Entity Too Large"],[414,"Request-URI Too Large"],[415,"Unsupported Media Type"],[416,"Requested Range Not Satisfiable"],[417,"Expectation Failed"],[418,"I'm a teapot"],[422,"Unprocessable Entity"],[423,"Locked"],[424,"Failed Dependency"],[425,"Too Early"],[426,"Upgrade Required"],[428,"Precondition Required"],[429,"Too Many Requests"],[431,"Request Header Fields Too Large"],[451,"Unavailable For Legal Reasons"],[500,"Internal Server Error"],[501,"Not Implemented"],[502,"Bad Gateway"],[503,"Service Unavailable"],[504,"Gateway Time-out"],[505,"HTTP Version Not Supported"],[506,"Variant Also Negotiates"],[507,"Insufficient Storage"],[509,"Bandwidth Limit Exceeded"],[510,"Not Extended"],[511,"Network Authentication Required"]])};Pe.Boom=class extends Error{constructor(n,t={}){if(n instanceof Error)return Pe.boomify(Yl.clone(n),t);let{statusCode:o=500,data:a=null,ctor:e=Pe.Boom}=t,i=new Error(n||void 0);Error.captureStackTrace(i,e),i.data=a;let A=Wa.initialize(i,o);return Object.defineProperty(A,"typeof",{value:e}),t.decorate&&Object.assign(A,t.decorate),A}static[Symbol.hasInstance](n){return this===Pe.Boom?Pe.isBoom(n):this.prototype.isPrototypeOf(n)}};Pe.isBoom=function(n,t){return n instanceof Error&&!!n.isBoom&&(!t||n.output.statusCode===t)};Pe.boomify=function(n,t){return Yl.assert(n instanceof Error,"Cannot wrap non-Error object"),t=t||{},t.data!==void 0&&(n.data=t.data),t.decorate&&Object.assign(n,t.decorate),n.isBoom?t.override===!1||!t.statusCode&&!t.message?n:Wa.initialize(n,t.statusCode||n.output.statusCode,t.message):Wa.initialize(n,t.statusCode||500,t.message)};Pe.badRequest=function(n,t){return new Pe.Boom(n,{statusCode:400,data:t,ctor:Pe.badRequest})};Pe.unauthorized=function(n,t,o){let a=new Pe.Boom(n,{statusCode:401,ctor:Pe.unauthorized});if(!t)return a;if(typeof t!="string")return a.output.headers["WWW-Authenticate"]=t.join(", "),a;let e=`${t}`;return(o||n)&&(a.output.payload.attributes={}),o&&(typeof o=="string"?(e+=" "+Yl.escapeHeaderAttribute(o),a.output.payload.attributes=o):e+=" "+Object.keys(o).map(i=>{let A=o[i];return A==null&&(A=""),a.output.payload.attributes[i]=A,`${i}="${Yl.escapeHeaderAttribute(A.toString())}"`}).join(", ")),n?(o&&(e+=","),e+=` error="${Yl.escapeHeaderAttribute(n)}"`,a.output.payload.attributes.error=n):a.isMissing=!0,a.output.headers["WWW-Authenticate"]=e,a};Pe.paymentRequired=function(n,t){return new Pe.Boom(n,{statusCode:402,data:t,ctor:Pe.paymentRequired})};Pe.forbidden=function(n,t){return new Pe.Boom(n,{statusCode:403,data:t,ctor:Pe.forbidden})};Pe.notFound=function(n,t){return new Pe.Boom(n,{statusCode:404,data:t,ctor:Pe.notFound})};Pe.methodNotAllowed=function(n,t,o){let a=new Pe.Boom(n,{statusCode:405,data:t,ctor:Pe.methodNotAllowed});return typeof o=="string"&&(o=[o]),Array.isArray(o)&&(a.output.headers.Allow=o.join(", ")),a};Pe.notAcceptable=function(n,t){return new Pe.Boom(n,{statusCode:406,data:t,ctor:Pe.notAcceptable})};Pe.proxyAuthRequired=function(n,t){return new Pe.Boom(n,{statusCode:407,data:t,ctor:Pe.proxyAuthRequired})};Pe.clientTimeout=function(n,t){return new Pe.Boom(n,{statusCode:408,data:t,ctor:Pe.clientTimeout})};Pe.conflict=function(n,t){return new Pe.Boom(n,{statusCode:409,data:t,ctor:Pe.conflict})};Pe.resourceGone=function(n,t){return new Pe.Boom(n,{statusCode:410,data:t,ctor:Pe.resourceGone})};Pe.lengthRequired=function(n,t){return new Pe.Boom(n,{statusCode:411,data:t,ctor:Pe.lengthRequired})};Pe.preconditionFailed=function(n,t){return new Pe.Boom(n,{statusCode:412,data:t,ctor:Pe.preconditionFailed})};Pe.entityTooLarge=function(n,t){return new Pe.Boom(n,{statusCode:413,data:t,ctor:Pe.entityTooLarge})};Pe.uriTooLong=function(n,t){return new Pe.Boom(n,{statusCode:414,data:t,ctor:Pe.uriTooLong})};Pe.unsupportedMediaType=function(n,t){return new Pe.Boom(n,{statusCode:415,data:t,ctor:Pe.unsupportedMediaType})};Pe.rangeNotSatisfiable=function(n,t){return new Pe.Boom(n,{statusCode:416,data:t,ctor:Pe.rangeNotSatisfiable})};Pe.expectationFailed=function(n,t){return new Pe.Boom(n,{statusCode:417,data:t,ctor:Pe.expectationFailed})};Pe.teapot=function(n,t){return new Pe.Boom(n,{statusCode:418,data:t,ctor:Pe.teapot})};Pe.badData=function(n,t){return new Pe.Boom(n,{statusCode:422,data:t,ctor:Pe.badData})};Pe.locked=function(n,t){return new Pe.Boom(n,{statusCode:423,data:t,ctor:Pe.locked})};Pe.failedDependency=function(n,t){return new Pe.Boom(n,{statusCode:424,data:t,ctor:Pe.failedDependency})};Pe.tooEarly=function(n,t){return new Pe.Boom(n,{statusCode:425,data:t,ctor:Pe.tooEarly})};Pe.preconditionRequired=function(n,t){return new Pe.Boom(n,{statusCode:428,data:t,ctor:Pe.preconditionRequired})};Pe.tooManyRequests=function(n,t){return new Pe.Boom(n,{statusCode:429,data:t,ctor:Pe.tooManyRequests})};Pe.illegal=function(n,t){return new Pe.Boom(n,{statusCode:451,data:t,ctor:Pe.illegal})};Pe.internal=function(n,t,o=500){return Wa.serverError(n,t,o,Pe.internal)};Pe.notImplemented=function(n,t){return Wa.serverError(n,t,501,Pe.notImplemented)};Pe.badGateway=function(n,t){return Wa.serverError(n,t,502,Pe.badGateway)};Pe.serverUnavailable=function(n,t){return Wa.serverError(n,t,503,Pe.serverUnavailable)};Pe.gatewayTimeout=function(n,t){return Wa.serverError(n,t,504,Pe.gatewayTimeout)};Pe.badImplementation=function(n,t){let o=Wa.serverError(n,t,500,Pe.badImplementation);return o.isDeveloperError=!0,o};Wa.initialize=function(n,t,o){let a=parseInt(t,10);if(Yl.assert(!isNaN(a)&&a>=400,"First argument must be a number (400+):",t),n.isBoom=!0,n.isServer=a>=500,n.hasOwnProperty("data")||(n.data=null),n.output={statusCode:a,payload:{},headers:{}},Object.defineProperty(n,"reformat",{value:Wa.reformat,configurable:!0}),!o&&!n.message&&(n.reformat(),o=n.output.payload.error),o){let e=Object.getOwnPropertyDescriptor(n,"message")||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),"message");Yl.assert(!e||e.configurable&&!e.get,"The error is not compatible with boom"),n.message=o+(n.message?": "+n.message:""),n.output.payload.message=n.message}return n.reformat(),n};Wa.reformat=function(n=!1){this.output.payload.statusCode=this.output.statusCode,this.output.payload.error=Wa.codes.get(this.output.statusCode)||"Unknown",this.output.statusCode===500&&n!==!0?this.output.payload.message="An internal server error occurred":this.message&&(this.output.payload.message=this.message)};Wa.serverError=function(n,t,o,a){return t instanceof Error&&!t.isBoom?Pe.boomify(t,{statusCode:o,message:n}):new Pe.Boom(n,{statusCode:o,data:t,ctor:a})}});var Iee,$xe,eYe,AYe,tYe,rYe,iYe,aYe,oYe,nYe,sYe,gYe,cYe,IYe,lYe,O,Fs=ue(()=>{Iee=n=>typeof n<"u"&&n!==null,$xe=n=>typeof n=="object",eYe=n=>Object.prototype.toString.call(n)==="[object Object]",AYe=n=>typeof n=="function",tYe=n=>typeof n=="boolean",rYe=n=>n instanceof Buffer,iYe=n=>{if(Iee(n))switch(n.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},aYe=n=>n instanceof ArrayBuffer,oYe=n=>typeof n=="string"&&n.length>0,nYe=n=>typeof n=="number"&&Number.isFinite(n),sYe=n=>Number.isInteger(n),gYe=(n,t,o)=>n>=t&&n<=o,cYe=(n,t)=>t.includes(n),IYe=(n,t,o)=>new Error(`Expected ${t} for ${n} but received ${o} of type ${typeof o}`),lYe=(n,t)=>(t.message=n.message,t),O={defined:Iee,object:$xe,plainObject:eYe,fn:AYe,bool:tYe,buffer:rYe,typedArray:iYe,arrayBuffer:aYe,string:oYe,number:nYe,integer:sYe,inRange:gYe,inArray:cYe,invalidParameterError:IYe,nativeError:lYe}});var dee=ee((RwA,pee)=>{"use strict";var lee=()=>process.platform==="linux",qD=null,pYe=()=>{if(!qD)if(lee()&&process.report){let n=process.report.excludeNetwork;process.report.excludeNetwork=!0,qD=process.report.getReport(),process.report.excludeNetwork=n}else qD={};return qD};pee.exports={isLinux:lee,getReport:pYe}});var Eee=ee((kwA,hee)=>{"use strict";var Fh=$e("fs"),dYe="/usr/bin/ldd",hYe="/proc/self/exe",zD=2048,EYe=n=>{let t=Fh.openSync(n,"r"),o=Buffer.alloc(zD),a=Fh.readSync(t,o,0,zD,0);return Fh.close(t,()=>{}),o.subarray(0,a)},uYe=n=>new Promise((t,o)=>{Fh.open(n,"r",(a,e)=>{if(a)o(a);else{let i=Buffer.alloc(zD);Fh.read(e,i,0,zD,0,(A,r)=>{t(i.subarray(0,r)),Fh.close(e,()=>{})})}})});hee.exports={LDD_PATH:dYe,SELF_PATH:hYe,readFileSync:EYe,readFile:uYe}});var Cee=ee((vwA,uee)=>{"use strict";var CYe=n=>{if(n.length<64||n.readUInt32BE(0)!==2135247942||n.readUInt8(4)!==2||n.readUInt8(5)!==1)return null;let t=n.readUInt32LE(32),o=n.readUInt16LE(54),a=n.readUInt16LE(56);for(let e=0;e{"use strict";var fee=$e("child_process"),{isLinux:Lh,getReport:Qee}=dee(),{LDD_PATH:VD,SELF_PATH:yee,readFile:FL,readFileSync:LL}=Eee(),{interpreterPath:mee}=Cee(),Ls,Us,Hs,See="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",cI="",wee=()=>cI||new Promise(n=>{fee.exec(See,(t,o)=>{cI=t?" ":o,n(cI)})}),Dee=()=>{if(!cI)try{cI=fee.execSync(See,{encoding:"utf8"})}catch{cI=" "}return cI},Xg="glibc",Oee=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,Wl="musl",BYe=n=>n.includes("libc.musl-")||n.includes("ld-musl-"),bee=()=>{let n=Qee();return n.header&&n.header.glibcVersionRuntime?Xg:Array.isArray(n.sharedObjects)&&n.sharedObjects.some(BYe)?Wl:null},Mee=n=>{let[t,o]=n.split(/[\r\n]+/);return t&&t.includes(Xg)?Xg:o&&o.includes(Wl)?Wl:null},_ee=n=>{if(n){if(n.includes("/ld-musl-"))return Wl;if(n.includes("/ld-linux-"))return Xg}return null},Tee=n=>(n=n.toString(),n.includes("musl")?Wl:n.includes("GNU C Library")?Xg:null),fYe=async()=>{if(Us!==void 0)return Us;Us=null;try{let n=await FL(VD);Us=Tee(n)}catch{}return Us},QYe=()=>{if(Us!==void 0)return Us;Us=null;try{let n=LL(VD);Us=Tee(n)}catch{}return Us},yYe=async()=>{if(Ls!==void 0)return Ls;Ls=null;try{let n=await FL(yee),t=mee(n);Ls=_ee(t)}catch{}return Ls},mYe=()=>{if(Ls!==void 0)return Ls;Ls=null;try{let n=LL(yee),t=mee(n);Ls=_ee(t)}catch{}return Ls},Nee=async()=>{let n=null;if(Lh()&&(n=await yYe(),!n&&(n=await fYe(),n||(n=bee()),!n))){let t=await wee();n=Mee(t)}return n},Ree=()=>{let n=null;if(Lh()&&(n=mYe(),!n&&(n=QYe(),n||(n=bee()),!n))){let t=Dee();n=Mee(t)}return n},SYe=async()=>Lh()&&await Nee()!==Xg,wYe=()=>Lh()&&Ree()!==Xg,DYe=async()=>{if(Hs!==void 0)return Hs;Hs=null;try{let t=(await FL(VD)).match(Oee);t&&(Hs=t[1])}catch{}return Hs},OYe=()=>{if(Hs!==void 0)return Hs;Hs=null;try{let t=LL(VD).match(Oee);t&&(Hs=t[1])}catch{}return Hs},kee=()=>{let n=Qee();return n.header&&n.header.glibcVersionRuntime?n.header.glibcVersionRuntime:null},Bee=n=>n.trim().split(/\s+/)[1],vee=n=>{let[t,o,a]=n.split(/[\r\n]+/);return t&&t.includes(Xg)?Bee(t):o&&a&&o.includes(Wl)?Bee(a):null},bYe=async()=>{let n=null;if(Lh()&&(n=await DYe(),n||(n=kee()),!n)){let t=await wee();n=vee(t)}return n},MYe=()=>{let n=null;if(Lh()&&(n=OYe(),n||(n=kee()),!n)){let t=Dee();n=vee(t)}return n};Pee.exports={GLIBC:Xg,MUSL:Wl,family:Nee,familySync:Ree,isNonGlibcLinux:SYe,isNonGlibcLinuxSync:wYe,version:bYe,versionSync:MYe}});var Uh=ee((GwA,Gee)=>{"use strict";var _Ye="2.0.0",TYe=Number.MAX_SAFE_INTEGER||9007199254740991,NYe=16,RYe=250,kYe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Gee.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:NYe,MAX_SAFE_BUILD_LENGTH:RYe,MAX_SAFE_INTEGER:TYe,RELEASE_TYPES:kYe,SEMVER_SPEC_VERSION:_Ye,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var XB=ee((FwA,Fee)=>{"use strict";var vYe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{};Fee.exports=vYe});var Hh=ee((Ks,Lee)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:UL,MAX_SAFE_BUILD_LENGTH:PYe,MAX_LENGTH:GYe}=Uh(),FYe=XB();Ks=Lee.exports={};var LYe=Ks.re=[],UYe=Ks.safeRe=[],gA=Ks.src=[],HYe=Ks.safeSrc=[],cA=Ks.t={},KYe=0,HL="[a-zA-Z0-9-]",xYe=[["\\s",1],["\\d",GYe],[HL,PYe]],YYe=n=>{for(let[t,o]of xYe)n=n.split(`${t}*`).join(`${t}{0,${o}}`).split(`${t}+`).join(`${t}{1,${o}}`);return n},JA=(n,t,o)=>{let a=YYe(t),e=KYe++;FYe(n,e,t),cA[n]=e,gA[e]=t,HYe[e]=a,LYe[e]=new RegExp(t,o?"g":void 0),UYe[e]=new RegExp(a,o?"g":void 0)};JA("NUMERICIDENTIFIER","0|[1-9]\\d*");JA("NUMERICIDENTIFIERLOOSE","\\d+");JA("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${HL}*`);JA("MAINVERSION",`(${gA[cA.NUMERICIDENTIFIER]})\\.(${gA[cA.NUMERICIDENTIFIER]})\\.(${gA[cA.NUMERICIDENTIFIER]})`);JA("MAINVERSIONLOOSE",`(${gA[cA.NUMERICIDENTIFIERLOOSE]})\\.(${gA[cA.NUMERICIDENTIFIERLOOSE]})\\.(${gA[cA.NUMERICIDENTIFIERLOOSE]})`);JA("PRERELEASEIDENTIFIER",`(?:${gA[cA.NONNUMERICIDENTIFIER]}|${gA[cA.NUMERICIDENTIFIER]})`);JA("PRERELEASEIDENTIFIERLOOSE",`(?:${gA[cA.NONNUMERICIDENTIFIER]}|${gA[cA.NUMERICIDENTIFIERLOOSE]})`);JA("PRERELEASE",`(?:-(${gA[cA.PRERELEASEIDENTIFIER]}(?:\\.${gA[cA.PRERELEASEIDENTIFIER]})*))`);JA("PRERELEASELOOSE",`(?:-?(${gA[cA.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${gA[cA.PRERELEASEIDENTIFIERLOOSE]})*))`);JA("BUILDIDENTIFIER",`${HL}+`);JA("BUILD",`(?:\\+(${gA[cA.BUILDIDENTIFIER]}(?:\\.${gA[cA.BUILDIDENTIFIER]})*))`);JA("FULLPLAIN",`v?${gA[cA.MAINVERSION]}${gA[cA.PRERELEASE]}?${gA[cA.BUILD]}?`);JA("FULL",`^${gA[cA.FULLPLAIN]}$`);JA("LOOSEPLAIN",`[v=\\s]*${gA[cA.MAINVERSIONLOOSE]}${gA[cA.PRERELEASELOOSE]}?${gA[cA.BUILD]}?`);JA("LOOSE",`^${gA[cA.LOOSEPLAIN]}$`);JA("GTLT","((?:<|>)?=?)");JA("XRANGEIDENTIFIERLOOSE",`${gA[cA.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);JA("XRANGEIDENTIFIER",`${gA[cA.NUMERICIDENTIFIER]}|x|X|\\*`);JA("XRANGEPLAIN",`[v=\\s]*(${gA[cA.XRANGEIDENTIFIER]})(?:\\.(${gA[cA.XRANGEIDENTIFIER]})(?:\\.(${gA[cA.XRANGEIDENTIFIER]})(?:${gA[cA.PRERELEASE]})?${gA[cA.BUILD]}?)?)?`);JA("XRANGEPLAINLOOSE",`[v=\\s]*(${gA[cA.XRANGEIDENTIFIERLOOSE]})(?:\\.(${gA[cA.XRANGEIDENTIFIERLOOSE]})(?:\\.(${gA[cA.XRANGEIDENTIFIERLOOSE]})(?:${gA[cA.PRERELEASELOOSE]})?${gA[cA.BUILD]}?)?)?`);JA("XRANGE",`^${gA[cA.GTLT]}\\s*${gA[cA.XRANGEPLAIN]}$`);JA("XRANGELOOSE",`^${gA[cA.GTLT]}\\s*${gA[cA.XRANGEPLAINLOOSE]}$`);JA("COERCEPLAIN",`(^|[^\\d])(\\d{1,${UL}})(?:\\.(\\d{1,${UL}}))?(?:\\.(\\d{1,${UL}}))?`);JA("COERCE",`${gA[cA.COERCEPLAIN]}(?:$|[^\\d])`);JA("COERCEFULL",gA[cA.COERCEPLAIN]+`(?:${gA[cA.PRERELEASE]})?(?:${gA[cA.BUILD]})?(?:$|[^\\d])`);JA("COERCERTL",gA[cA.COERCE],!0);JA("COERCERTLFULL",gA[cA.COERCEFULL],!0);JA("LONETILDE","(?:~>?)");JA("TILDETRIM",`(\\s*)${gA[cA.LONETILDE]}\\s+`,!0);Ks.tildeTrimReplace="$1~";JA("TILDE",`^${gA[cA.LONETILDE]}${gA[cA.XRANGEPLAIN]}$`);JA("TILDELOOSE",`^${gA[cA.LONETILDE]}${gA[cA.XRANGEPLAINLOOSE]}$`);JA("LONECARET","(?:\\^)");JA("CARETTRIM",`(\\s*)${gA[cA.LONECARET]}\\s+`,!0);Ks.caretTrimReplace="$1^";JA("CARET",`^${gA[cA.LONECARET]}${gA[cA.XRANGEPLAIN]}$`);JA("CARETLOOSE",`^${gA[cA.LONECARET]}${gA[cA.XRANGEPLAINLOOSE]}$`);JA("COMPARATORLOOSE",`^${gA[cA.GTLT]}\\s*(${gA[cA.LOOSEPLAIN]})$|^$`);JA("COMPARATOR",`^${gA[cA.GTLT]}\\s*(${gA[cA.FULLPLAIN]})$|^$`);JA("COMPARATORTRIM",`(\\s*)${gA[cA.GTLT]}\\s*(${gA[cA.LOOSEPLAIN]}|${gA[cA.XRANGEPLAIN]})`,!0);Ks.comparatorTrimReplace="$1$2$3";JA("HYPHENRANGE",`^\\s*(${gA[cA.XRANGEPLAIN]})\\s+-\\s+(${gA[cA.XRANGEPLAIN]})\\s*$`);JA("HYPHENRANGELOOSE",`^\\s*(${gA[cA.XRANGEPLAINLOOSE]})\\s+-\\s+(${gA[cA.XRANGEPLAINLOOSE]})\\s*$`);JA("STAR","(<|>)?=?\\s*\\*");JA("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");JA("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var ZD=ee((LwA,Uee)=>{"use strict";var jYe=Object.freeze({loose:!0}),JYe=Object.freeze({}),qYe=n=>n?typeof n!="object"?jYe:n:JYe;Uee.exports=qYe});var KL=ee((UwA,xee)=>{"use strict";var Hee=/^[0-9]+$/,Kee=(n,t)=>{if(typeof n=="number"&&typeof t=="number")return n===t?0:nKee(t,n);xee.exports={compareIdentifiers:Kee,rcompareIdentifiers:zYe}});var Pi=ee((HwA,jee)=>{"use strict";var XD=XB(),{MAX_LENGTH:Yee,MAX_SAFE_INTEGER:$D}=Uh(),{safeRe:eO,t:AO}=Hh(),VYe=ZD(),{compareIdentifiers:xL}=KL(),WYe=(n,t)=>{let o=t.split(".");if(o.length>n.length)return!1;for(let a=0;aYee)throw new TypeError(`version is longer than ${Yee} characters`);XD("SemVer",t,o),this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease;let a=t.trim().match(o.loose?eO[AO.LOOSE]:eO[AO.FULL]);if(!a)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>$D||this.major<0)throw new TypeError("Invalid major version");if(this.minor>$D||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>$D||this.patch<0)throw new TypeError("Invalid patch version");a[4]?this.prerelease=a[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let i=+e;if(i>=0&&i<$D)return i}return e}):this.prerelease=[],this.build=a[5]?a[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(XD("SemVer.compare",this.version,this.options,t),!(t instanceof n)){if(typeof t=="string"&&t===this.version)return 0;t=new n(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof n||(t=new n(t,this.options)),this.majort.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof n||(t=new n(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let o=0;do{let a=this.prerelease[o],e=t.prerelease[o];if(XD("prerelease compare",o,a,e),a===void 0&&e===void 0)return 0;if(e===void 0)return 1;if(a===void 0)return-1;if(a===e)continue;return xL(a,e)}while(++o)}compareBuild(t){t instanceof n||(t=new n(t,this.options));let o=0;do{let a=this.build[o],e=t.build[o];if(XD("build compare",o,a,e),a===void 0&&e===void 0)return 0;if(e===void 0)return 1;if(a===void 0)return-1;if(a===e)continue;return xL(a,e)}while(++o)}inc(t,o,a){if(t.startsWith("pre")){if(!o&&a===!1)throw new Error("invalid increment argument: identifier is empty");if(o){let e=`-${o}`.match(this.options.loose?eO[AO.PRERELEASELOOSE]:eO[AO.PRERELEASE]);if(!e||e[1]!==o)throw new Error(`invalid identifier: ${o}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",o,a);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",o,a);break;case"prepatch":this.prerelease.length=0,this.inc("patch",o,a),this.inc("pre",o,a);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",o,a),this.inc("pre",o,a);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let e=Number(a)?1:0;if(this.prerelease.length===0)this.prerelease=[e];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(o===this.prerelease.join(".")&&a===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(o){let i=[o,e];if(a===!1&&(i=[o]),WYe(this.prerelease,o)){let A=this.prerelease[o.split(".").length];isNaN(A)&&(this.prerelease=i)}else this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};jee.exports=YL});var II=ee((KwA,qee)=>{"use strict";var Jee=Pi(),ZYe=(n,t,o=!1)=>{if(n instanceof Jee)return n;try{return new Jee(n,t)}catch(a){if(!o)return null;throw a}};qee.exports=ZYe});var Vee=ee((xwA,zee)=>{"use strict";var XYe=II(),$Ye=(n,t)=>{let o=XYe(n,t);return o?o.version:null};zee.exports=$Ye});var Zee=ee((YwA,Wee)=>{"use strict";var e1e=II(),A1e=(n,t)=>{let o=e1e(n.trim().replace(/^[=v]+/,""),t);return o?o.version:null};Wee.exports=A1e});var eAe=ee((jwA,$ee)=>{"use strict";var Xee=Pi(),t1e=(n,t,o,a,e)=>{typeof o=="string"&&(e=a,a=o,o=void 0);try{return new Xee(n instanceof Xee?n.version:n,o).inc(t,a,e).version}catch{return null}};$ee.exports=t1e});var rAe=ee((JwA,tAe)=>{"use strict";var AAe=II(),r1e=(n,t)=>{let o=AAe(n,null,!0),a=AAe(t,null,!0),e=o.compare(a);if(e===0)return null;let i=e>0,A=i?o:a,r=i?a:o,s=!!A.prerelease.length;if(!!r.prerelease.length&&!s){if(!r.patch&&!r.minor)return"major";if(r.compareMain(A)===0)return r.minor&&!r.patch?"minor":"patch"}let c=s?"pre":"";return o.major!==a.major?c+"major":o.minor!==a.minor?c+"minor":o.patch!==a.patch?c+"patch":"prerelease"};tAe.exports=r1e});var aAe=ee((qwA,iAe)=>{"use strict";var i1e=Pi(),a1e=(n,t)=>new i1e(n,t).major;iAe.exports=a1e});var nAe=ee((zwA,oAe)=>{"use strict";var o1e=Pi(),n1e=(n,t)=>new o1e(n,t).minor;oAe.exports=n1e});var gAe=ee((VwA,sAe)=>{"use strict";var s1e=Pi(),g1e=(n,t)=>new s1e(n,t).patch;sAe.exports=g1e});var IAe=ee((WwA,cAe)=>{"use strict";var c1e=II(),I1e=(n,t)=>{let o=c1e(n,t);return o&&o.prerelease.length?o.prerelease:null};cAe.exports=I1e});var tn=ee((ZwA,pAe)=>{"use strict";var lAe=Pi(),l1e=(n,t,o)=>new lAe(n,o).compare(new lAe(t,o));pAe.exports=l1e});var hAe=ee((XwA,dAe)=>{"use strict";var p1e=tn(),d1e=(n,t,o)=>p1e(t,n,o);dAe.exports=d1e});var uAe=ee(($wA,EAe)=>{"use strict";var h1e=tn(),E1e=(n,t)=>h1e(n,t,!0);EAe.exports=E1e});var tO=ee((eDA,BAe)=>{"use strict";var CAe=Pi(),u1e=(n,t,o)=>{let a=new CAe(n,o),e=new CAe(t,o);return a.compare(e)||a.compareBuild(e)};BAe.exports=u1e});var QAe=ee((ADA,fAe)=>{"use strict";var C1e=tO(),B1e=(n,t)=>n.sort((o,a)=>C1e(o,a,t));fAe.exports=B1e});var mAe=ee((tDA,yAe)=>{"use strict";var f1e=tO(),Q1e=(n,t)=>n.sort((o,a)=>f1e(a,o,t));yAe.exports=Q1e});var $B=ee((rDA,SAe)=>{"use strict";var y1e=tn(),m1e=(n,t,o)=>y1e(n,t,o)>0;SAe.exports=m1e});var rO=ee((iDA,wAe)=>{"use strict";var S1e=tn(),w1e=(n,t,o)=>S1e(n,t,o)<0;wAe.exports=w1e});var jL=ee((aDA,DAe)=>{"use strict";var D1e=tn(),O1e=(n,t,o)=>D1e(n,t,o)===0;DAe.exports=O1e});var JL=ee((oDA,OAe)=>{"use strict";var b1e=tn(),M1e=(n,t,o)=>b1e(n,t,o)!==0;OAe.exports=M1e});var iO=ee((nDA,bAe)=>{"use strict";var _1e=tn(),T1e=(n,t,o)=>_1e(n,t,o)>=0;bAe.exports=T1e});var aO=ee((sDA,MAe)=>{"use strict";var N1e=tn(),R1e=(n,t,o)=>N1e(n,t,o)<=0;MAe.exports=R1e});var qL=ee((gDA,_Ae)=>{"use strict";var k1e=jL(),v1e=JL(),P1e=$B(),G1e=iO(),F1e=rO(),L1e=aO(),U1e=(n,t,o,a)=>{switch(t){case"===":return typeof n=="object"&&(n=n.version),typeof o=="object"&&(o=o.version),n===o;case"!==":return typeof n=="object"&&(n=n.version),typeof o=="object"&&(o=o.version),n!==o;case"":case"=":case"==":return k1e(n,o,a);case"!=":return v1e(n,o,a);case">":return P1e(n,o,a);case">=":return G1e(n,o,a);case"<":return F1e(n,o,a);case"<=":return L1e(n,o,a);default:throw new TypeError(`Invalid operator: ${t}`)}};_Ae.exports=U1e});var NAe=ee((cDA,TAe)=>{"use strict";var H1e=Pi(),K1e=II(),{safeRe:oO,t:nO}=Hh(),x1e=(n,t)=>{if(n instanceof H1e)return n;if(typeof n=="number"&&(n=String(n)),typeof n!="string")return null;t=t||{};let o=null;if(!t.rtl)o=n.match(t.includePrerelease?oO[nO.COERCEFULL]:oO[nO.COERCE]);else{let s=t.includePrerelease?oO[nO.COERCERTLFULL]:oO[nO.COERCERTL],g;for(;(g=s.exec(n))&&(!o||o.index+o[0].length!==n.length);)(!o||g.index+g[0].length!==o.index+o[0].length)&&(o=g),s.lastIndex=g.index+g[1].length+g[2].length;s.lastIndex=-1}if(o===null)return null;let a=o[2],e=o[3]||"0",i=o[4]||"0",A=t.includePrerelease&&o[5]?`-${o[5]}`:"",r=t.includePrerelease&&o[6]?`+${o[6]}`:"";return K1e(`${a}.${e}.${i}${A}${r}`,t)};TAe.exports=x1e});var kAe=ee((IDA,RAe)=>{"use strict";var Y1e=II(),j1e=Uh(),J1e=Pi(),q1e=(n,t,o)=>{if(!j1e.RELEASE_TYPES.includes(t))return null;let a=z1e(n,o);return a&&V1e(a,t)},z1e=(n,t)=>{let o=n instanceof J1e?n.version:n;return Y1e(o,t)},V1e=(n,t)=>{if(W1e(t))return n.version;switch(n.prerelease=[],t){case"major":n.minor=0,n.patch=0;break;case"minor":n.patch=0;break}return n.format()},W1e=n=>n.startsWith("pre");RAe.exports=q1e});var PAe=ee((lDA,vAe)=>{"use strict";var zL=class{constructor(){this.max=1e3,this.map=new Map}get(t){let o=this.map.get(t);if(o!==void 0)return this.map.delete(t),this.map.set(t,o),o}delete(t){return this.map.delete(t)}set(t,o){if(!this.delete(t)&&o!==void 0){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(t,o)}return this}};vAe.exports=zL});var rn=ee((pDA,UAe)=>{"use strict";var Z1e=/\s+/g,VL=class n{constructor(t,o){if(o=$1e(o),t instanceof n)return t.loose===!!o.loose&&t.includePrerelease===!!o.includePrerelease?t:new n(t.raw,o);if(t instanceof WL)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=t.trim().replace(Z1e," "),this.set=this.raw.split("||").map(a=>this.parseRange(a.trim())).filter(a=>a.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let a=this.set[0];if(this.set=this.set.filter(e=>!FAe(e[0])),this.set.length===0)this.set=[a];else if(this.set.length>1){for(let e of this.set)if(e.length===1&&s3e(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t0&&(this.formatted+="||");let o=this.set[t];for(let a=0;a0&&(this.formatted+=" "),this.formatted+=o[a].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(n3e,"");let a=((this.options.includePrerelease&&a3e)|(this.options.loose&&o3e))+":"+t,e=GAe.get(a);if(e)return e;let i=this.options.loose,A=i?fa[Gi.HYPHENRANGELOOSE]:fa[Gi.HYPHENRANGE];t=t.replace(A,B3e(this.options.includePrerelease)),Xt("hyphen replace",t),t=t.replace(fa[Gi.COMPARATORTRIM],t3e),Xt("comparator trim",t),t=t.replace(fa[Gi.TILDETRIM],r3e),Xt("tilde trim",t),t=t.replace(fa[Gi.CARETTRIM],i3e),Xt("caret trim",t);let r=t.split(" ").map(I=>g3e(I,this.options)).join(" ").split(/\s+/).map(I=>C3e(I,this.options));i&&(r=r.filter(I=>(Xt("loose invalid filter",I,this.options),!!I.match(fa[Gi.COMPARATORLOOSE])))),Xt("range list",r);let s=new Map,g=r.map(I=>new WL(I,this.options));for(let I of g){if(FAe(I))return[I];s.set(I.value,I)}s.size>1&&s.has("")&&s.delete("");let c=[...s.values()];return GAe.set(a,c),c}intersects(t,o){if(!(t instanceof n))throw new TypeError("a Range is required");return this.set.some(a=>LAe(a,o)&&t.set.some(e=>LAe(e,o)&&a.every(i=>e.every(A=>i.intersects(A,o)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new e3e(t,this.options)}catch{return!1}for(let o=0;on.value==="<0.0.0-0",s3e=n=>n.value==="",LAe=(n,t)=>{let o=!0,a=n.slice(),e=a.pop();for(;o&&a.length;)o=a.every(i=>e.intersects(i,t)),e=a.pop();return o},g3e=(n,t)=>(n=n.replace(fa[Gi.BUILD],""),Xt("comp",n,t),n=p3e(n,t),Xt("caret",n),n=I3e(n,t),Xt("tildes",n),n=h3e(n,t),Xt("xrange",n),n=u3e(n,t),Xt("stars",n),n),Wr=n=>!n||n.toLowerCase()==="x"||n==="*",c3e=(n,t,o)=>Wr(n)&&!Wr(t)||Wr(t)&&o&&!Wr(o),I3e=(n,t)=>n.trim().split(/\s+/).map(o=>l3e(o,t)).join(" "),l3e=(n,t)=>{let o=t.loose?fa[Gi.TILDELOOSE]:fa[Gi.TILDE],a=t.includePrerelease?"-0":"";return n.replace(o,(e,i,A,r,s)=>{Xt("tilde",n,e,i,A,r,s);let g;return Wr(i)?g="":Wr(A)?g=`>=${i}.0.0${a} <${+i+1}.0.0-0`:Wr(r)?g=`>=${i}.${A}.0${a} <${i}.${+A+1}.0-0`:s?(Xt("replaceTilde pr",s),g=`>=${i}.${A}.${r}-${s} <${i}.${+A+1}.0-0`):g=`>=${i}.${A}.${r} <${i}.${+A+1}.0-0`,Xt("tilde return",g),g})},p3e=(n,t)=>n.trim().split(/\s+/).map(o=>d3e(o,t)).join(" "),d3e=(n,t)=>{Xt("caret",n,t);let o=t.loose?fa[Gi.CARETLOOSE]:fa[Gi.CARET],a=t.includePrerelease?"-0":"";return n.replace(o,(e,i,A,r,s)=>{Xt("caret",n,e,i,A,r,s);let g;return Wr(i)?g="":Wr(A)?g=`>=${i}.0.0${a} <${+i+1}.0.0-0`:Wr(r)?i==="0"?g=`>=${i}.${A}.0${a} <${i}.${+A+1}.0-0`:g=`>=${i}.${A}.0${a} <${+i+1}.0.0-0`:s?(Xt("replaceCaret pr",s),i==="0"?A==="0"?g=`>=${i}.${A}.${r}-${s} <${i}.${A}.${+r+1}-0`:g=`>=${i}.${A}.${r}-${s} <${i}.${+A+1}.0-0`:g=`>=${i}.${A}.${r}-${s} <${+i+1}.0.0-0`):(Xt("no pr"),i==="0"?A==="0"?g=`>=${i}.${A}.${r} <${i}.${A}.${+r+1}-0`:g=`>=${i}.${A}.${r} <${i}.${+A+1}.0-0`:g=`>=${i}.${A}.${r} <${+i+1}.0.0-0`),Xt("caret return",g),g})},h3e=(n,t)=>(Xt("replaceXRanges",n,t),n.split(/\s+/).map(o=>E3e(o,t)).join(" ")),E3e=(n,t)=>{n=n.trim();let o=t.loose?fa[Gi.XRANGELOOSE]:fa[Gi.XRANGE];return n.replace(o,(a,e,i,A,r,s)=>{if(Xt("xRange",n,a,e,i,A,r,s),c3e(i,A,r))return n;let g=Wr(i),c=g||Wr(A),I=c||Wr(r),p=I;return e==="="&&p&&(e=""),s=t.includePrerelease?"-0":"",g?e===">"||e==="<"?a="<0.0.0-0":a="*":e&&p?(c&&(A=0),r=0,e===">"?(e=">=",c?(i=+i+1,A=0,r=0):(A=+A+1,r=0)):e==="<="&&(e="<",c?i=+i+1:A=+A+1),e==="<"&&(s="-0"),a=`${e+i}.${A}.${r}${s}`):c?a=`>=${i}.0.0${s} <${+i+1}.0.0-0`:I&&(a=`>=${i}.${A}.0${s} <${i}.${+A+1}.0-0`),Xt("xRange return",a),a})},u3e=(n,t)=>(Xt("replaceStars",n,t),n.trim().replace(fa[Gi.STAR],"")),C3e=(n,t)=>(Xt("replaceGTE0",n,t),n.trim().replace(fa[t.includePrerelease?Gi.GTE0PRE:Gi.GTE0],"")),B3e=n=>(t,o,a,e,i,A,r,s,g,c,I,p)=>(Wr(a)?o="":Wr(e)?o=`>=${a}.0.0${n?"-0":""}`:Wr(i)?o=`>=${a}.${e}.0${n?"-0":""}`:A?o=`>=${o}`:o=`>=${o}${n?"-0":""}`,Wr(g)?s="":Wr(c)?s=`<${+g+1}.0.0-0`:Wr(I)?s=`<${g}.${+c+1}.0-0`:p?s=`<=${g}.${c}.${I}-${p}`:n?s=`<${g}.${c}.${+I+1}-0`:s=`<=${s}`,`${o} ${s}`.trim()),f3e=(n,t,o)=>{for(let a=0;a0){let e=n[a].semver;if(e.major===t.major&&e.minor===t.minor&&e.patch===t.patch)return!0}return!1}return!0}});var ef=ee((dDA,JAe)=>{"use strict";var Af=Symbol("SemVer ANY"),$L=class n{static get ANY(){return Af}constructor(t,o){if(o=HAe(o),t instanceof n){if(t.loose===!!o.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),XL("comparator",t,o),this.options=o,this.loose=!!o.loose,this.parse(t),this.semver===Af?this.value="":this.value=this.operator+this.semver.version,XL("comp",this)}parse(t){let o=this.options.loose?KAe[xAe.COMPARATORLOOSE]:KAe[xAe.COMPARATOR],a=t.match(o);if(!a)throw new TypeError(`Invalid comparator: ${t}`);this.operator=a[1]!==void 0?a[1]:"",this.operator==="="&&(this.operator=""),a[2]?this.semver=new YAe(a[2],this.options.loose):this.semver=Af}toString(){return this.value}test(t){if(XL("Comparator.test",t,this.options.loose),this.semver===Af||t===Af)return!0;if(typeof t=="string")try{t=new YAe(t,this.options)}catch{return!1}return ZL(t,this.operator,this.semver,this.options)}intersects(t,o){if(!(t instanceof n))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new jAe(t.value,o).test(this.value):t.operator===""?t.value===""?!0:new jAe(this.value,o).test(t.semver):(o=HAe(o),o.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!o.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||ZL(this.semver,"<",t.semver,o)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||ZL(this.semver,">",t.semver,o)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};JAe.exports=$L;var HAe=ZD(),{safeRe:KAe,t:xAe}=Hh(),ZL=qL(),XL=XB(),YAe=Pi(),jAe=rn()});var tf=ee((hDA,qAe)=>{"use strict";var Q3e=rn(),y3e=(n,t,o)=>{try{t=new Q3e(t,o)}catch{return!1}return t.test(n)};qAe.exports=y3e});var VAe=ee((EDA,zAe)=>{"use strict";var m3e=rn(),S3e=(n,t)=>new m3e(n,t).set.map(o=>o.map(a=>a.value).join(" ").trim().split(" "));zAe.exports=S3e});var ZAe=ee((uDA,WAe)=>{"use strict";var w3e=Pi(),D3e=rn(),O3e=(n,t,o)=>{let a=null,e=null,i=null;try{i=new D3e(t,o)}catch{return null}return n.forEach(A=>{i.test(A)&&(!a||e.compare(A)===-1)&&(a=A,e=new w3e(a,o))}),a};WAe.exports=O3e});var $Ae=ee((CDA,XAe)=>{"use strict";var b3e=Pi(),M3e=rn(),_3e=(n,t,o)=>{let a=null,e=null,i=null;try{i=new M3e(t,o)}catch{return null}return n.forEach(A=>{i.test(A)&&(!a||e.compare(A)===1)&&(a=A,e=new b3e(a,o))}),a};XAe.exports=_3e});var tte=ee((BDA,Ate)=>{"use strict";var e2=Pi(),T3e=rn(),ete=$B(),N3e=(n,t)=>{n=new T3e(n,t);let o=new e2("0.0.0");if(n.test(o)||(o=new e2("0.0.0-0"),n.test(o)))return o;o=null;for(let a=0;a{let r=new e2(A.semver.version);switch(A.operator){case">":r.prerelease.length===0?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":(!i||ete(r,i))&&(i=r);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${A.operator}`)}}),i&&(!o||ete(o,i))&&(o=i)}return o&&n.test(o)?o:null};Ate.exports=N3e});var ite=ee((fDA,rte)=>{"use strict";var R3e=rn(),k3e=(n,t)=>{try{return new R3e(n,t).range||"*"}catch{return null}};rte.exports=k3e});var sO=ee((QDA,ste)=>{"use strict";var v3e=Pi(),nte=ef(),{ANY:P3e}=nte,G3e=rn(),F3e=tf(),ate=$B(),ote=rO(),L3e=aO(),U3e=iO(),H3e=(n,t,o,a)=>{n=new v3e(n,a),t=new G3e(t,a);let e,i,A,r,s;switch(o){case">":e=ate,i=L3e,A=ote,r=">",s=">=";break;case"<":e=ote,i=U3e,A=ate,r="<",s="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(F3e(n,t,a))return!1;for(let g=0;g{B.semver===P3e&&(B=new nte(">=0.0.0")),I=I||B,p=p||B,e(B.semver,I.semver,a)?I=B:A(B.semver,p.semver,a)&&(p=B)}),I.operator===r||I.operator===s||(!p.operator||p.operator===r)&&i(n,p.semver))return!1;if(p.operator===s&&A(n,p.semver))return!1}return!0};ste.exports=H3e});var cte=ee((yDA,gte)=>{"use strict";var K3e=sO(),x3e=(n,t,o)=>K3e(n,t,">",o);gte.exports=x3e});var lte=ee((mDA,Ite)=>{"use strict";var Y3e=sO(),j3e=(n,t,o)=>Y3e(n,t,"<",o);Ite.exports=j3e});var hte=ee((SDA,dte)=>{"use strict";var pte=rn(),J3e=(n,t,o)=>(n=new pte(n,o),t=new pte(t,o),n.intersects(t,o));dte.exports=J3e});var ute=ee((wDA,Ete)=>{"use strict";var q3e=tf(),z3e=tn();Ete.exports=(n,t,o)=>{let a=[],e=null,i=null,A=n.sort((c,I)=>z3e(c,I,o));for(let c of A)q3e(c,t,o)?(i=c,e||(e=c)):(i&&a.push([e,i]),i=null,e=null);e&&a.push([e,null]);let r=[];for(let[c,I]of a)c===I?r.push(c):!I&&c===A[0]?r.push("*"):I?c===A[0]?r.push(`<=${I}`):r.push(`${c} - ${I}`):r.push(`>=${c}`);let s=r.join(" || "),g=typeof t.raw=="string"?t.raw:String(t);return s.length{"use strict";var Cte=rn(),r2=ef(),{ANY:A2}=r2,t2=tf(),i2=tn(),V3e=(n,t,o={})=>{if(n===t)return!0;n=new Cte(n,o),t=new Cte(t,o);let a=!1;e:for(let e of n.set){for(let i of t.set){let A=Z3e(e,i,o);if(a=a||A!==null,A)continue e}if(a)return!1}return!0},W3e=[new r2(">=0.0.0-0")],Bte=[new r2(">=0.0.0")],Z3e=(n,t,o)=>{if(n===t)return!0;if(n.length===1&&n[0].semver===A2){if(t.length===1&&t[0].semver===A2)return!0;o.includePrerelease?n=W3e:n=Bte}if(t.length===1&&t[0].semver===A2){if(o.includePrerelease)return!0;t=Bte}let a=new Set,e,i;for(let B of n)B.operator===">"||B.operator===">="?e=fte(e,B,o):B.operator==="<"||B.operator==="<="?i=Qte(i,B,o):a.add(B.semver);if(a.size>1)return null;let A;if(e&&i){if(A=i2(e.semver,i.semver,o),A>0)return null;if(A===0&&(e.operator!==">="||i.operator!=="<="))return null}for(let B of a){if(e&&!t2(B,String(e),o)||i&&!t2(B,String(i),o))return null;for(let f of t)if(!t2(B,String(f),o))return!1;return!0}let r,s,g,c,I=i&&!o.includePrerelease&&i.semver.prerelease.length?i.semver:!1,p=e&&!o.includePrerelease&&e.semver.prerelease.length?e.semver:!1;I&&I.prerelease.length===1&&i.operator==="<"&&I.prerelease[0]===0&&(I=!1);for(let B of t){if(c=c||B.operator===">"||B.operator===">=",g=g||B.operator==="<"||B.operator==="<=",e){if(p&&B.semver.prerelease&&B.semver.prerelease.length&&B.semver.major===p.major&&B.semver.minor===p.minor&&B.semver.patch===p.patch&&(p=!1),B.operator===">"||B.operator===">="){if(r=fte(e,B,o),r===B&&r!==e)return!1}else if(e.operator===">="&&!B.test(e.semver))return!1}if(i){if(I&&B.semver.prerelease&&B.semver.prerelease.length&&B.semver.major===I.major&&B.semver.minor===I.minor&&B.semver.patch===I.patch&&(I=!1),B.operator==="<"||B.operator==="<="){if(s=Qte(i,B,o),s===B&&s!==i)return!1}else if(i.operator==="<="&&!B.test(i.semver))return!1}if(!B.operator&&(i||e)&&A!==0)return!1}return!(e&&g&&!i&&A!==0||i&&c&&!e&&A!==0||p||I)},fte=(n,t,o)=>{if(!n)return t;let a=i2(n.semver,t.semver,o);return a>0?n:a<0||t.operator===">"&&n.operator===">="?t:n},Qte=(n,t,o)=>{if(!n)return t;let a=i2(n.semver,t.semver,o);return a<0?n:a>0||t.operator==="<"&&n.operator==="<="?t:n};yte.exports=V3e});var gO=ee((ODA,Dte)=>{"use strict";var a2=Hh(),Ste=Uh(),X3e=Pi(),wte=KL(),$3e=II(),eje=Vee(),Aje=Zee(),tje=eAe(),rje=rAe(),ije=aAe(),aje=nAe(),oje=gAe(),nje=IAe(),sje=tn(),gje=hAe(),cje=uAe(),Ije=tO(),lje=QAe(),pje=mAe(),dje=$B(),hje=rO(),Eje=jL(),uje=JL(),Cje=iO(),Bje=aO(),fje=qL(),Qje=NAe(),yje=kAe(),mje=ef(),Sje=rn(),wje=tf(),Dje=VAe(),Oje=ZAe(),bje=$Ae(),Mje=tte(),_je=ite(),Tje=sO(),Nje=cte(),Rje=lte(),kje=hte(),vje=ute(),Pje=mte();Dte.exports={parse:$3e,valid:eje,clean:Aje,inc:tje,diff:rje,major:ije,minor:aje,patch:oje,prerelease:nje,compare:sje,rcompare:gje,compareLoose:cje,compareBuild:Ije,sort:lje,rsort:pje,gt:dje,lt:hje,eq:Eje,neq:uje,gte:Cje,lte:Bje,cmp:fje,coerce:Qje,truncate:yje,Comparator:mje,Range:Sje,satisfies:wje,toComparators:Dje,maxSatisfying:Oje,minSatisfying:bje,minVersion:Mje,validRange:_je,outside:Tje,gtr:Nje,ltr:Rje,intersects:kje,simplifyRange:vje,subset:Pje,SemVer:X3e,re:a2.re,src:a2.src,tokens:a2.t,SEMVER_SPEC_VERSION:Ste.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ste.RELEASE_TYPES,compareIdentifiers:wte.compareIdentifiers,rcompareIdentifiers:wte.rcompareIdentifiers}});var $g,cO=ue(()=>{$g={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.35.3",author:"Lovell Fuller ",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert ","Jonathan Ong ","Chanon Sajjamanochai ","Juliano Julio ","Daniel Gasienica ","Julian Walker ","Amit Pitaru ","Brandon Aaron ","Andreas Lind ","Maurus Cuelenaere ","Linus Unneb\xE4ck ","Victor Mateevitsi ","Alaric Holloway ","Bernhard K. Weisshuhn ","Chris Riley ","David Carley ","John Tobin ","Kenton Gray ","Felix B\xFCnemann ","Samy Al Zahrani ","Chintan Thakkar ","F. Orlando Galashan ","Kleis Auke Wolthuizen ","Matt Hirsch ","Matthias Thoemmes ","Patrick Paskaris ","J\xE9r\xE9my Lal ","Rahul Nanwani ","Alice Monday ","Kristo Jorgenson ","YvesBos ","Guy Maliar ","Nicolas Coden ","Matt Parrish ","Marcel Bretschneider ","Matthew McEachen ","Jarda Kot\u011B\u0161ovec ","Kenric D'Souza ","Oleh Aleinyk ","Marcel Bretschneider ","Andrea Bianco ","Rik Heywood ","Thomas Parisot ","Nathan Graves ","Tom Lokhorst ","Espen Hovlandsdal ","Sylvain Dumont ","Alun Davies ","Aidan Hoolachan ","Axel Eirola ","Freezy ","Daiz ","Julian Aubourg ","Keith Belovay ","Michael B. Klein ","Jordan Prudhomme ","Ilya Ovdin ","Andargor ","Paul Neave ","Brendan Kennedy ","Brychan Bennett-Odlum ","Edward Silverton ","Roman Malieiev ","Tomas Szabo ","Robert O'Rourke ","Guillermo Alfonso Varela Chouci\xF1o ","Christian Flintrup ","Manan Jadhav ","Leon Radley ","alza54 ","Jacob Smith ","Michael Nutt ","Brad Parham ","Taneli Vatanen ","Joris Dugu\xE9 ","Chris Banks ","Ompal Singh ","Brodan ","Ankur Parihar ","Brahim Ait elhaj ","Mart Jansink ","Lachlan Newman ","Dennis Beatty ","Ingvar Stepanyan ","Don Denton ","Dmytro Tiapukhin ","Florian Lefebvre "],scripts:{build:"node install/build.js","build:dist":"node scripts/build.mjs",clean:"rm -rf src/build/ test/fixtures/output.*",test:"npm run lint && npm run test-unit",lint:"npm run lint-cpp && npm run lint-js && npm run lint-types && npm run lint-publish","lint-cpp":"cpplint --quiet src/*.h src/*.cc","lint-js":"biome lint","lint-publish":"publint --strict","lint-types":"tsd --files ./test/types/sharp.test-d.{cts,mts}","test-leak":"./test/leak/leak.sh","test-unit":"node --experimental-test-coverage test/unit.mjs","package-from-local-build":"node npm/from-local-build.js","package-wasm-wrappers":"node npm/wasm-wrappers.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",files:["dist","install","lib/index.d.ts","src/*.{cc,h,gyp}"],main:"./dist/index.cjs",module:"./dist/index.mjs",types:"./dist/index.d.mts",exports:{".":{import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"},require:{types:"./dist/index.d.cts",default:"./dist/index.cjs"}}},sideEffects:!0,repository:{type:"git",url:"git+https://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.1.0","detect-libc":"^2.1.2",semver:"^7.8.5"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.35.3","@img/sharp-darwin-x64":"0.35.3","@img/sharp-freebsd-wasm32":"0.35.3","@img/sharp-libvips-darwin-arm64":"1.3.2","@img/sharp-libvips-darwin-x64":"1.3.2","@img/sharp-libvips-linux-arm":"1.3.2","@img/sharp-libvips-linux-arm64":"1.3.2","@img/sharp-libvips-linux-ppc64":"1.3.2","@img/sharp-libvips-linux-riscv64":"1.3.2","@img/sharp-libvips-linux-s390x":"1.3.2","@img/sharp-libvips-linux-x64":"1.3.2","@img/sharp-libvips-linuxmusl-arm64":"1.3.2","@img/sharp-libvips-linuxmusl-x64":"1.3.2","@img/sharp-linux-arm":"0.35.3","@img/sharp-linux-arm64":"0.35.3","@img/sharp-linux-ppc64":"0.35.3","@img/sharp-linux-riscv64":"0.35.3","@img/sharp-linux-s390x":"0.35.3","@img/sharp-linux-x64":"0.35.3","@img/sharp-linuxmusl-arm64":"0.35.3","@img/sharp-linuxmusl-x64":"0.35.3","@img/sharp-webcontainers-wasm32":"0.35.3","@img/sharp-win32-arm64":"0.35.3","@img/sharp-win32-ia32":"0.35.3","@img/sharp-win32-x64":"0.35.3"},peerDependenciesMeta:{"@types/node":{optional:!0}},devDependencies:{"@biomejs/biome":"^2.5.1","@cpplint/cli":"^0.1.0","@emnapi/runtime":"^1.11.1","@img/sharp-libvips-dev":"1.3.2","@img/sharp-libvips-dev-wasm32":"1.3.2","@img/sharp-libvips-win32-arm64":"1.3.2","@img/sharp-libvips-win32-ia32":"1.3.2","@img/sharp-libvips-win32-x64":"1.3.2","@types/node":"*",emnapi:"^1.11.1","exif-reader":"^2.0.3","extract-zip":"^2.0.1",icc:"^4.0.0","node-addon-api":"^8.9.0","node-gyp":"^12.4.0",publint:"^0.3.21","tar-fs":"^3.1.3",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:">=20.9.0"},config:{libvips:">=8.18.3"},funding:{url:"https://opencollective.com/libvips"}}});import{spawnSync as rf}from"node:child_process";import{createHash as Fje}from"node:crypto";var af,n2,Lje,bte,Uje,s2,Hje,Mte,Kje,Kh,xje,Yje,jje,Jje,_te,qje,Ote,zje,Vje,Tte,Wje,Zje,Nte,o2,Xje,IO,g2=ue(()=>{af=ze(gO(),1),n2=ze(WD(),1);cO();Lje=process.env.npm_package_config_libvips||$g.config.libvips,bte=af.default.coerce(Lje).version,Uje=["darwin-arm64","darwin-x64","freebsd-arm64","freebsd-x64","linux-arm","linux-arm64","linux-ppc64","linux-riscv64","linux-s390x","linux-wasm32","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],s2={encoding:"utf8",shell:!0},Hje=n=>{n instanceof Error?console.error(`sharp: Installation error: ${n.message}`):console.log(`sharp: ${n}`)},Mte=()=>n2.default.isNonGlibcLinuxSync()?n2.default.familySync():"",Kje=()=>`${process.platform}${Mte()}-${process.arch}`,Kh=()=>{if(_te())return"wasm32";let{npm_config_arch:n,npm_config_platform:t,npm_config_libc:o}=process.env,a=typeof o=="string"?o:Mte();return`${t||process.platform}${a}-${n||process.arch}`},xje=()=>{try{return $e(`@img/sharp-libvips-dev-${Kh()}/include`)}catch{try{return $e("@img/sharp-libvips-dev/include")}catch{}}return""},Yje=()=>{try{return $e("@img/sharp-libvips-dev/cplusplus")}catch{}return""},jje=()=>{try{return $e(`@img/sharp-libvips-dev-${Kh()}/lib`)}catch{try{return $e(`@img/sharp-libvips-${Kh()}/lib`)}catch{}}return""},Jje=()=>{if(process.release?.name==="node"&&process.versions&&!af.default.satisfies(process.versions.node,$g.engines.node))return{found:process.versions.node,expected:$g.engines.node}},_te=()=>{let{CC:n}=process.env;return!!n?.endsWith("/emcc")},qje=()=>process.platform==="darwin"&&process.arch==="x64"?(rf("sysctl sysctl.proc_translated",s2).stdout||"").trim()==="sysctl.proc_translated: 1":!1,Ote=n=>Fje("sha512").update(n).digest("hex"),zje=()=>{try{let n=Ote(`imgsharp-libvips-${Kh()}`),t=af.default.coerce($g.optionalDependencies[`@img/sharp-libvips-${Kh()}`],{includePrerelease:!0}).version;return Ote(`${n}npm:${t}`).slice(0,10)}catch{}return""},Vje=()=>rf(`node-gyp rebuild --directory=src ${_te()?"--nodedir=emscripten":""}`,{...s2,stdio:"inherit"}).status,Tte=()=>process.platform!=="win32"?(rf("pkg-config --modversion vips-cpp",{...s2,env:{...process.env,PKG_CONFIG_PATH:Nte()}}).stdout||"").trim():"",Wje=()=>{try{let n=(rf("brew",["--prefix"],{encoding:"utf8"}).stdout||"").trim();if(n)return`${n}/lib/pkgconfig`}catch{}},Zje=()=>{try{let n=(rf("pkg-config",["--variable","pc_path","pkg-config"],{encoding:"utf8"}).stdout||"").trim();if(n)return n}catch{}},Nte=()=>process.platform!=="win32"?[Wje(),Zje(),process.env.PKG_CONFIG_PATH].filter(Boolean).join(":"):"",o2=(n,t,o)=>(o&&o(`Detected ${t}, skipping search for globally-installed libvips`),n),Xje=n=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return o2(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",n);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return o2(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",n);if(qje())return o2(!1,"Rosetta",n);let t=Tte();return!!t&&af.default.gte(t,bte)},IO={minimumLibvipsVersion:bte,prebuiltPlatforms:Uje,buildPlatformArch:Kh,buildSharpLibvipsIncludeDir:xje,buildSharpLibvipsCPlusPlusDir:Yje,buildSharpLibvipsLibDir:jje,isUnsupportedNodeRuntime:Jje,runtimePlatformArch:Kje,log:Hje,yarnLocator:zje,spawnRebuild:Vje,globalLibvipsVersion:Tte,pkgConfigPath:Nte,useGlobalLibvips:Xje}});import{createRequire as $je}from"node:module";var lO,Zr,kte,eJe,Rte,AJe,tJe,ec,Kt,lI,Ot,of=ue(()=>{lO=ze(WD(),1);g2();cO();Zr=$je(import.meta.url),{version:kte}=$g,{runtimePlatformArch:eJe,isUnsupportedNodeRuntime:Rte,prebuiltPlatforms:AJe,minimumLibvipsVersion:tJe}=IO,ec=eJe(),lI=[];try{Kt=Zr(`../src/build/Release/sharp-${ec}-${kte}.node`)}catch(n){lI.push(n)}if(!Kt)try{Kt=Zr(`../src/build/Release/sharp-wasm32-${kte}.node`)}catch(n){lI.push(n)}if(!Kt)try{switch(ec){case"darwin-arm64":Kt=Zr("@img/sharp-darwin-arm64/sharp.node");break;case"darwin-x64":Kt=Zr("@img/sharp-darwin-x64/sharp.node");break;case"linux-arm":Kt=Zr("@img/sharp-linux-arm/sharp.node");break;case"linux-arm64":Kt=Zr("@img/sharp-linux-arm64/sharp.node");break;case"linux-ppc64":Kt=Zr("@img/sharp-linux-ppc64/sharp.node");break;case"linux-riscv64":Kt=Zr("@img/sharp-linux-riscv64/sharp.node");break;case"linux-s390x":Kt=Zr("@img/sharp-linux-s390x/sharp.node");break;case"linux-x64":Kt=Zr("@img/sharp-linux-x64/sharp.node");break;case"linuxmusl-arm64":Kt=Zr("@img/sharp-linuxmusl-arm64/sharp.node");break;case"linuxmusl-x64":Kt=Zr("@img/sharp-linuxmusl-x64/sharp.node");break;case"win32-arm64":Kt=Zr("@img/sharp-win32-arm64/sharp.node");break;case"win32-ia32":Kt=Zr("@img/sharp-win32-ia32/sharp.node");break;case"win32-x64":Kt=Zr("@img/sharp-win32-x64/sharp.node");break;case"freebsd-arm64":case"freebsd-x64":Kt=Zr("@img/sharp-freebsd-wasm32/sharp.node");break;case"linux-wasm32":Kt=Zr("@img/sharp-webcontainers-wasm32/sharp.node");break}if(Kt&&["linux-x64","linuxmusl-x64"].includes(ec)&&!Kt._isUsingX64V2()){let n=new Error("Prebuilt binaries for Linux x64 require v2 microarchitecture");n.code="Unsupported CPU",lI.push(n),Kt=null}Kt&&process.versions.electron&&ec.startsWith("linux")&&process.emitWarning("Binaries provided by Electron for use on Linux may be incompatible with sharp - see https://sharp.pixelplumbing.com/install#electron-and-linux",{code:"SharpElectronLinux"})}catch(n){lI.push(n)}if(!Kt)try{Kt=Zr("@img/sharp-wasm32/sharp.node")}catch(n){lI.push(n)}if(!Kt){let[n,t,o]=["linux","darwin","win32"].map(i=>ec.startsWith(i)),a=[`Could not load the "sharp" module using the ${ec} runtime`];lI.forEach(i=>{i.code.endsWith("MODULE_NOT_FOUND")||a.push(`${i.code}: ${i.message}`)});let e=lI.map(i=>i.message).join(" ");if(a.push("Possible solutions:"),Rte()){let{found:i,expected:A}=Rte();a.push("- Please upgrade Node.js:",` Found ${i}`,` Requires ${A}`)}else if(AJe.includes(ec)){let[i,A]=ec.split("-"),r=i.endsWith("musl")?" --libc=musl":"";a.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${i.replace("musl","")}${r} --cpu=${A} sharp`)}else a.push(`- Manually install libvips >= ${tJe}`," See https://sharp.pixelplumbing.com/install#building-from-source","- Add WebAssembly-based dependencies:"," npm install sharp @img/sharp-wasm32");if(n&&/(symbol not found|CXXABI_)/i.test(e))try{let{config:i}=Zr(`@img/sharp-libvips-${ec}/package`),A=`${(0,lO.familySync)()} ${(0,lO.versionSync)()}`,r=`${i.musl?"musl":"glibc"} ${i.musl||i.glibc}`;a.push("- Update your OS:",` Found ${A}`,` Requires ${r}`)}catch{}throw n&&/\/snap\/core[0-9]{2}/.test(e)&&a.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),t&&/Incompatible library version/.test(e)&&a.push("- Update Homebrew:"," brew update && brew upgrade vips"),lI.some(i=>i.code==="ERR_DLOPEN_DISABLED")&&a.push("- Run Node.js without using the --no-addons flag"),o&&/The specified procedure could not be found/.test(e)&&a.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp"),a.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(a.join(` +`))}Ot=Kt});import rJe from"node:util";import c2 from"node:stream";function oJe(){let n=this.constructor.call(),{debuglog:t,queueListener:o,...a}=this.options;return n.options=structuredClone(a),n.options.debuglog=t,n.options.queueListener=o,this._isStreamInput()&&this.on("finish",()=>{this._flattenBufferIn(),n.options.input.buffer=this.options.input.buffer,n.emit("finish")}),n}var iJe,aJe,Zl,xs,vte=ue(()=>{Fs();of();iJe=rJe.debuglog("sharp"),aJe=n=>{Zl.queue.emit("change",n)},Zl=function(n,t){if(arguments.length===1&&!O.defined(n))throw new Error("Invalid input");return this instanceof Zl?(c2.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,trimMargin:0,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,typedArrayOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",keepGainMap:!1,withGainMap:!1,resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,webpExact:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffBigtiff:!1,tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:0,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,heifTune:"auto",jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:o=>{this.emit("warning",o),iJe(o)},queueListener:aJe},this.options.input=this._createInputDescriptor(n,t,{allowStream:!0}),this):new Zl(n,t)};Object.setPrototypeOf(Zl.prototype,c2.Duplex.prototype);Object.setPrototypeOf(Zl,c2.Duplex);Object.assign(Zl.prototype,{clone:oJe});xs=Zl});function Pte(n){let t=sJe.filter(o=>O.defined(n[o])).map(o=>[o,n[o]]);return t.length?Object.fromEntries(t):void 0}function gJe(n,t,o){let a={autoOrient:!1,failOn:"warning",limitInputPixels:268402689,limitInputChannels:5,ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(O.string(n))a.file=n;else if(O.buffer(n)){if(n.length===0)throw Error("Input Buffer is empty");a.buffer=n}else if(O.arrayBuffer(n)){if(n.byteLength===0)throw Error("Input bit Array is empty");a.buffer=Buffer.from(n,0,n.byteLength)}else if(O.typedArray(n)){if(n.length===0)throw Error("Input Bit Array is empty");a.buffer=Buffer.from(n.buffer,n.byteOffset,n.byteLength)}else if(O.plainObject(n)&&!O.defined(t))t=n,Pte(t)&&(a.buffer=[]);else if(!O.defined(n)&&!O.defined(t)&&O.object(o)&&o.allowStream)a.buffer=[];else if(Array.isArray(n))if(n.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=n.map(e=>this._createInputDescriptor(e));else throw new Error("Recursive join is unsupported");else throw new Error("Expected at least two images to join");else throw new Error(`Unsupported input '${n}' of type ${typeof n}${O.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(O.object(t)){if(O.defined(t.failOn))if(O.string(t.failOn)&&O.inArray(t.failOn,["none","truncated","error","warning"]))a.failOn=t.failOn;else throw O.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(O.defined(t.autoOrient))if(O.bool(t.autoOrient))a.autoOrient=t.autoOrient;else throw O.invalidParameterError("autoOrient","boolean",t.autoOrient);if(O.defined(t.density))if(O.number(t.density)&&O.inRange(t.density,1,1e5))a.density=t.density;else throw O.invalidParameterError("density","number between 1 and 100000",t.density);if(O.defined(t.ignoreIcc))if(O.bool(t.ignoreIcc))a.ignoreIcc=t.ignoreIcc;else throw O.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(O.defined(t.limitInputPixels))if(O.bool(t.limitInputPixels))a.limitInputPixels=t.limitInputPixels?16383**2:0;else if(O.integer(t.limitInputPixels)&&O.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))a.limitInputPixels=t.limitInputPixels;else throw O.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(O.defined(t.limitInputChannels))if(O.bool(t.limitInputChannels))a.limitInputChannels=t.limitInputChannels?5:0;else if(O.integer(t.limitInputChannels)&&O.inRange(t.limitInputChannels,0,Number.MAX_SAFE_INTEGER))a.limitInputChannels=t.limitInputChannels;else throw O.invalidParameterError("limitInputChannels","positive integer",t.limitInputChannels);if(O.defined(t.unlimited))if(O.bool(t.unlimited))a.unlimited=t.unlimited;else throw O.invalidParameterError("unlimited","boolean",t.unlimited);if(O.defined(t.sequentialRead))if(O.bool(t.sequentialRead))a.sequentialRead=t.sequentialRead;else throw O.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(O.defined(t.raw)){if(O.object(t.raw)&&O.integer(t.raw.width)&&O.inRange(t.raw.width,1,1e8)&&O.integer(t.raw.height)&&O.inRange(t.raw.height,1,1e8)&&O.integer(t.raw.channels)&&O.inRange(t.raw.channels,1,4))switch(a.rawWidth=t.raw.width,a.rawHeight=t.raw.height,a.rawChannels=t.raw.channels,n.constructor){case Uint8Array:case Uint8ClampedArray:a.rawDepth="uchar";break;case Int8Array:a.rawDepth="char";break;case Uint16Array:a.rawDepth="ushort";break;case Int16Array:a.rawDepth="short";break;case Uint32Array:a.rawDepth="uint";break;case Int32Array:a.rawDepth="int";break;case Float32Array:a.rawDepth="float";break;case Float64Array:a.rawDepth="double";break;default:a.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(a.rawPremultiplied=!1,O.defined(t.raw.premultiplied))if(O.bool(t.raw.premultiplied))a.rawPremultiplied=t.raw.premultiplied;else throw O.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(a.rawPageHeight=0,O.defined(t.raw.pageHeight))if(O.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw new Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);a.rawPageHeight=t.raw.pageHeight}else throw O.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(O.defined(t.animated))if(O.bool(t.animated))a.pages=t.animated?-1:1;else throw O.invalidParameterError("animated","boolean",t.animated);if(O.defined(t.pages))if(O.integer(t.pages)&&O.inRange(t.pages,-1,1e5))a.pages=t.pages;else throw O.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(O.defined(t.page))if(O.integer(t.page)&&O.inRange(t.page,0,1e5))a.page=t.page;else throw O.invalidParameterError("page","integer between 0 and 100000",t.page);if(O.object(t.openSlide)&&O.defined(t.openSlide.level))if(O.integer(t.openSlide.level)&&O.inRange(t.openSlide.level,0,256))a.openSlideLevel=t.openSlide.level;else throw O.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(O.defined(t.level))if(O.integer(t.level)&&O.inRange(t.level,0,256))a.openSlideLevel=t.level;else throw O.invalidParameterError("level","integer between 0 and 256",t.level);if(O.object(t.tiff)&&O.defined(t.tiff.subifd))if(O.integer(t.tiff.subifd)&&O.inRange(t.tiff.subifd,-1,1e5))a.tiffSubifd=t.tiff.subifd;else throw O.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(O.defined(t.subifd))if(O.integer(t.subifd)&&O.inRange(t.subifd,-1,1e5))a.tiffSubifd=t.subifd;else throw O.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(O.object(t.svg)){if(O.defined(t.svg.stylesheet))if(O.string(t.svg.stylesheet))a.svgStylesheet=t.svg.stylesheet;else throw O.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(O.defined(t.svg.highBitdepth))if(O.bool(t.svg.highBitdepth))a.svgHighBitdepth=t.svg.highBitdepth;else throw O.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(O.object(t.pdf)&&O.defined(t.pdf.background)?a.pdfBackground=this._getBackgroundColourOption(t.pdf.background):O.defined(t.pdfBackground)&&(a.pdfBackground=this._getBackgroundColourOption(t.pdfBackground)),O.object(t.jp2)&&O.defined(t.jp2.oneshot))if(O.bool(t.jp2.oneshot))a.jp2Oneshot=t.jp2.oneshot;else throw O.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(O.defined(t.create))if(O.object(t.create)&&O.integer(t.create.width)&&O.inRange(t.create.width,1,1e8)&&O.integer(t.create.height)&&O.inRange(t.create.height,1,1e8)&&O.integer(t.create.channels)){if(a.createWidth=t.create.width,a.createHeight=t.create.height,a.createChannels=t.create.channels,a.createPageHeight=0,O.defined(t.create.pageHeight))if(O.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw new Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);a.createPageHeight=t.create.pageHeight}else throw O.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(O.defined(t.create.noise)){if(!O.object(t.create.noise))throw new Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw new Error("Only gaussian noise is supported at the moment");if(a.createNoiseType=t.create.noise.type,!O.inRange(t.create.channels,1,4))throw O.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(a.createNoiseMean=128,O.defined(t.create.noise.mean))if(O.number(t.create.noise.mean)&&O.inRange(t.create.noise.mean,0,1e4))a.createNoiseMean=t.create.noise.mean;else throw O.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(a.createNoiseSigma=30,O.defined(t.create.noise.sigma))if(O.number(t.create.noise.sigma)&&O.inRange(t.create.noise.sigma,0,1e4))a.createNoiseSigma=t.create.noise.sigma;else throw O.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(O.defined(t.create.background)){if(!O.inRange(t.create.channels,3,4))throw O.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);a.createBackground=this._getBackgroundColourOption(t.create.background)}else throw new Error("Expected valid noise or background to create a new input image");delete a.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(O.defined(t.text))if(O.object(t.text)&&O.string(t.text.text)){if(a.textValue=t.text.text,O.defined(t.text.height)&&O.defined(t.text.dpi))throw new Error("Expected only one of dpi or height");if(O.defined(t.text.font))if(O.string(t.text.font))a.textFont=t.text.font;else throw O.invalidParameterError("text.font","string",t.text.font);if(O.defined(t.text.fontfile))if(O.string(t.text.fontfile))a.textFontfile=t.text.fontfile;else throw O.invalidParameterError("text.fontfile","string",t.text.fontfile);if(O.defined(t.text.width))if(O.integer(t.text.width)&&O.inRange(t.text.width,1,1e6))a.textWidth=t.text.width;else throw O.invalidParameterError("text.width","integer between 1 and 1000000",t.text.width);if(O.defined(t.text.height))if(O.integer(t.text.height)&&O.inRange(t.text.height,1,1e6))a.textHeight=t.text.height;else throw O.invalidParameterError("text.height","integer between 1 and 1000000",t.text.height);if(O.defined(t.text.align))if(O.string(t.text.align)&&O.string(this.constructor.align[t.text.align]))a.textAlign=this.constructor.align[t.text.align];else throw O.invalidParameterError("text.align","valid alignment",t.text.align);if(O.defined(t.text.justify))if(O.bool(t.text.justify))a.textJustify=t.text.justify;else throw O.invalidParameterError("text.justify","boolean",t.text.justify);if(O.defined(t.text.dpi))if(O.integer(t.text.dpi)&&O.inRange(t.text.dpi,1,1e6))a.textDpi=t.text.dpi;else throw O.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(O.defined(t.text.rgba))if(O.bool(t.text.rgba))a.textRgba=t.text.rgba;else throw O.invalidParameterError("text.rgba","bool",t.text.rgba);if(O.defined(t.text.spacing))if(O.integer(t.text.spacing)&&O.inRange(t.text.spacing,-1e6,1e6))a.textSpacing=t.text.spacing;else throw O.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(O.defined(t.text.wrap))if(O.string(t.text.wrap)&&O.inArray(t.text.wrap,["word","char","word-char","none"]))a.textWrap=t.text.wrap;else throw O.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete a.buffer}else throw new Error("Expected a valid string to create an image with text.");if(O.defined(t.join))if(O.defined(this.options.join)){if(O.defined(t.join.animated))if(O.bool(t.join.animated))a.joinAnimated=t.join.animated;else throw O.invalidParameterError("join.animated","boolean",t.join.animated);if(O.defined(t.join.across))if(O.integer(t.join.across)&&O.inRange(t.join.across,1,1e6))a.joinAcross=t.join.across;else throw O.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(O.defined(t.join.shim))if(O.integer(t.join.shim)&&O.inRange(t.join.shim,0,1e6))a.joinShim=t.join.shim;else throw O.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(O.defined(t.join.background)&&(a.joinBackground=this._getBackgroundColourOption(t.join.background)),O.defined(t.join.halign))if(O.string(t.join.halign)&&O.string(this.constructor.align[t.join.halign]))a.joinHalign=this.constructor.align[t.join.halign];else throw O.invalidParameterError("join.halign","valid alignment",t.join.halign);if(O.defined(t.join.valign))if(O.string(t.join.valign)&&O.string(this.constructor.align[t.join.valign]))a.joinValign=this.constructor.align[t.join.valign];else throw O.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw new Error("Expected input to be an array of images to join")}else if(O.defined(t))throw new Error(`Invalid input options ${t}`);return a}function cJe(n,t,o){Array.isArray(this.options.input.buffer)?O.buffer(n)?(this.options.input.buffer.length===0&&this.on("finish",()=>{this.streamInFinished=!0}),this.options.input.buffer.push(n),o()):o(new Error("Non-Buffer data on Writable Stream")):o(new Error("Unexpected data on Writable Stream"))}function IJe(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function lJe(){return Array.isArray(this.options.input.buffer)}function pJe(n){let t=Error();return O.fn(n)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),Ot.metadata(this.options,(o,a)=>{o?n(O.nativeError(o,t)):n(null,a)})}):Ot.metadata(this.options,(o,a)=>{o?n(O.nativeError(o,t)):n(null,a)}),this):this._isStreamInput()?new Promise((o,a)=>{let e=()=>{this._flattenBufferIn(),Ot.metadata(this.options,(i,A)=>{i?a(O.nativeError(i,t)):o(A)})};this.writableFinished?e():this.once("finish",e)}):new Promise((o,a)=>{Ot.metadata(this.options,(e,i)=>{e?a(O.nativeError(e,t)):o(i)})})}function dJe(n){let t=Error();return O.fn(n)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),Ot.stats(this.options,(o,a)=>{o?n(O.nativeError(o,t)):n(null,a)})}):Ot.stats(this.options,(o,a)=>{o?n(O.nativeError(o,t)):n(null,a)}),this):this._isStreamInput()?new Promise((o,a)=>{this.on("finish",function(){this._flattenBufferIn(),Ot.stats(this.options,(e,i)=>{e?a(O.nativeError(e,t)):o(i)})})}):new Promise((o,a)=>{Ot.stats(this.options,(e,i)=>{e?a(O.nativeError(e,t)):o(i)})})}var nJe,sJe,Gte,Fte=ue(()=>{Fs();of();nJe={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},sJe=["failOn","limitInputPixels","limitInputChannels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","openSlideLevel","pdfBackground","tiffSubifd"];Gte=n=>{Object.assign(n.prototype,{_inputOptionsFromObject:Pte,_createInputDescriptor:gJe,_write:cJe,_flattenBufferIn:IJe,_isStreamInput:lJe,metadata:pJe,stats:dJe}),n.align=nJe}});function l2(n){return n.angle%360!==0||n.rotationAngle!==0}function pO(n){return n.width!==-1||n.height!==-1}function uJe(n,t,o){if(pO(this.options)&&this.options.debuglog("ignoring previous resize options"),this.options.widthPost!==-1&&this.options.debuglog("operation order will be: extract, resize, extract"),O.defined(n))if(O.object(n)&&!O.defined(o))o=n;else if(O.integer(n)&&n>0)this.options.width=n;else throw O.invalidParameterError("width","positive integer",n);else this.options.width=-1;if(O.defined(t))if(O.integer(t)&&t>0)this.options.height=t;else throw O.invalidParameterError("height","positive integer",t);else this.options.height=-1;if(O.object(o)){if(O.defined(o.width))if(O.integer(o.width)&&o.width>0)this.options.width=o.width;else throw O.invalidParameterError("width","positive integer",o.width);if(O.defined(o.height))if(O.integer(o.height)&&o.height>0)this.options.height=o.height;else throw O.invalidParameterError("height","positive integer",o.height);if(O.defined(o.fit)){let a=EJe[o.fit];if(O.string(a))this.options.canvas=a;else throw O.invalidParameterError("fit","valid fit",o.fit)}if(O.defined(o.position)){let a=O.integer(o.position)?o.position:Kte[o.position]||Hte[o.position]||Ute[o.position];if(O.integer(a)&&(O.inRange(a,0,8)||O.inRange(a,16,17)))this.options.position=a;else throw O.invalidParameterError("position","valid position/gravity/strategy",o.position)}if(this._setBackgroundColourOption("resizeBackground",o.background),O.defined(o.kernel))if(O.string(I2[o.kernel]))this.options.kernel=I2[o.kernel];else throw O.invalidParameterError("kernel","valid kernel name",o.kernel);O.defined(o.withoutEnlargement)&&this._setBooleanOption("withoutEnlargement",o.withoutEnlargement),O.defined(o.withoutReduction)&&this._setBooleanOption("withoutReduction",o.withoutReduction),O.defined(o.fastShrinkOnLoad)&&this._setBooleanOption("fastShrinkOnLoad",o.fastShrinkOnLoad)}return l2(this.options)&&pO(this.options)&&(this.options.rotateBefore=!0),this}function CJe(n){if(O.integer(n))if(O.inRange(n,1,1e4))this.options.extendTop=n,this.options.extendBottom=n,this.options.extendLeft=n,this.options.extendRight=n;else throw O.invalidParameterError("extend","integer between 1 and 10000",n);else if(O.object(n)){if(O.defined(n.top))if(O.integer(n.top)&&O.inRange(n.top,0,1e4))this.options.extendTop=n.top;else throw O.invalidParameterError("top","integer between 0 and 10000",n.top);if(O.defined(n.bottom))if(O.integer(n.bottom)&&O.inRange(n.bottom,0,1e4))this.options.extendBottom=n.bottom;else throw O.invalidParameterError("bottom","integer between 0 and 10000",n.bottom);if(O.defined(n.left))if(O.integer(n.left)&&O.inRange(n.left,0,1e4))this.options.extendLeft=n.left;else throw O.invalidParameterError("left","integer between 0 and 10000",n.left);if(O.defined(n.right))if(O.integer(n.right)&&O.inRange(n.right,0,1e4))this.options.extendRight=n.right;else throw O.invalidParameterError("right","integer between 0 and 10000",n.right);if(this._setBackgroundColourOption("extendBackground",n.background),O.defined(n.extendWith))if(O.string(Lte[n.extendWith]))this.options.extendWith=Lte[n.extendWith];else throw O.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",n.extendWith)}else throw O.invalidParameterError("extend","integer or object",n);return this}function BJe(n){let t=pO(this.options)||this.options.widthPre!==-1?"Post":"Pre";return this.options[`width${t}`]!==-1&&this.options.debuglog("ignoring previous extract options"),["left","top","width","height"].forEach(function(o){let a=n[o];if(O.integer(a)&&O.inRange(a,0,1e8))this.options[o+(o==="left"||o==="top"?"Offset":"")+t]=a;else throw O.invalidParameterError(o,"integer between 0 and 100000000",a)},this),l2(this.options)&&!pO(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBefore=!0),this.options.input.autoOrient&&(this.options.orientBefore=!0),this}function fJe(n){if(this.options.trimThreshold=10,O.defined(n))if(O.object(n)){if(O.defined(n.background)&&this._setBackgroundColourOption("trimBackground",n.background),O.defined(n.threshold))if(O.number(n.threshold)&&n.threshold>=0)this.options.trimThreshold=n.threshold;else throw O.invalidParameterError("threshold","positive number",n.threshold);if(O.defined(n.lineArt)&&this._setBooleanOption("trimLineArt",n.lineArt),O.defined(n.margin))if(O.integer(n.margin)&&O.inRange(n.margin,0,1e7))this.options.trimMargin=n.margin;else throw O.invalidParameterError("margin","integer between 0 and 10000000",n.margin)}else throw O.invalidParameterError("trim","object",n);return l2(this.options)&&(this.options.rotateBefore=!0),this}var Ute,Hte,Lte,Kte,I2,hJe,EJe,xte,Yte=ue(()=>{Fs();Ute={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},Hte={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},Lte={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},Kte={entropy:16,attention:17},I2={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},hJe={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},EJe={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};xte=n=>{Object.assign(n.prototype,{resize:uJe,extend:CJe,extract:BJe,trim:fJe}),n.gravity=Ute,n.strategy=Kte,n.kernel=I2,n.fit=hJe,n.position=Hte}});function QJe(n){if(!Array.isArray(n))throw O.invalidParameterError("images to composite","array",n);return this.options.composite=n.map(t=>{if(!O.object(t))throw O.invalidParameterError("image to composite","object",t);let o=this._inputOptionsFromObject(t),a={input:this._createInputDescriptor(t.input,o,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(O.defined(t.blend))if(O.string(p2[t.blend]))a.blend=p2[t.blend];else throw O.invalidParameterError("blend","valid blend name",t.blend);if(O.defined(t.tile))if(O.bool(t.tile))a.tile=t.tile;else throw O.invalidParameterError("tile","boolean",t.tile);if(O.defined(t.left))if(O.integer(t.left))a.left=t.left;else throw O.invalidParameterError("left","integer",t.left);if(O.defined(t.top))if(O.integer(t.top))a.top=t.top;else throw O.invalidParameterError("top","integer",t.top);if(O.defined(t.top)!==O.defined(t.left))throw new Error("Expected both left and top to be set");if(a.hasOffset=O.integer(t.top)&&O.integer(t.left),O.defined(t.gravity))if(O.integer(t.gravity)&&O.inRange(t.gravity,0,8))a.gravity=t.gravity;else if(O.string(t.gravity)&&O.integer(this.constructor.gravity[t.gravity]))a.gravity=this.constructor.gravity[t.gravity];else throw O.invalidParameterError("gravity","valid gravity",t.gravity);if(O.defined(t.premultiplied))if(O.bool(t.premultiplied))a.premultiplied=t.premultiplied;else throw O.invalidParameterError("premultiplied","boolean",t.premultiplied);return a}),this}var p2,jte,Jte=ue(()=>{Fs();p2={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};jte=n=>{n.prototype.composite=QJe,n.blend=p2}});function yJe(n,t){if(!O.defined(n))return this.autoOrient();if((this.options.angle||this.options.rotationAngle)&&(this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0),O.integer(n)&&!(n%90))this.options.angle=n;else if(O.number(n))this.options.rotationAngle=n,O.object(t)&&t.background&&this._setBackgroundColourOption("rotationBackground",t.background);else throw O.invalidParameterError("angle","numeric",n);return this}function mJe(){return this.options.input.autoOrient=!0,this}function SJe(n){return this.options.flip=O.bool(n)?n:!0,this}function wJe(n){return this.options.flop=O.bool(n)?n:!0,this}function DJe(n,t){let a=Array.isArray(n)&&(n.length===4&&n.every(O.number)||n.length===2&&n.every(e=>Array.isArray(e)&&e.length===2))?n.flat():[];if(a.length===4&&a.every(O.number))this.options.affineMatrix=a;else throw O.invalidParameterError("matrix","1x4 or 2x2 array",n);if(O.defined(t))if(O.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),O.defined(t.idx))if(O.number(t.idx))this.options.affineIdx=t.idx;else throw O.invalidParameterError("options.idx","number",t.idx);if(O.defined(t.idy))if(O.number(t.idy))this.options.affineIdy=t.idy;else throw O.invalidParameterError("options.idy","number",t.idy);if(O.defined(t.odx))if(O.number(t.odx))this.options.affineOdx=t.odx;else throw O.invalidParameterError("options.odx","number",t.odx);if(O.defined(t.ody))if(O.number(t.ody))this.options.affineOdy=t.ody;else throw O.invalidParameterError("options.ody","number",t.ody);if(O.defined(t.interpolator))if(O.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw O.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw O.invalidParameterError("options","object",t);return this}function OJe(n){if(O.plainObject(n)){if(O.number(n.sigma)&&O.inRange(n.sigma,1e-6,10))this.options.sharpenSigma=n.sigma;else throw O.invalidParameterError("options.sigma","number between 0.000001 and 10",n.sigma);if(O.defined(n.m1))if(O.number(n.m1)&&O.inRange(n.m1,0,1e6))this.options.sharpenM1=n.m1;else throw O.invalidParameterError("options.m1","number between 0 and 1000000",n.m1);if(O.defined(n.m2))if(O.number(n.m2)&&O.inRange(n.m2,0,1e6))this.options.sharpenM2=n.m2;else throw O.invalidParameterError("options.m2","number between 0 and 1000000",n.m2);if(O.defined(n.x1))if(O.number(n.x1)&&O.inRange(n.x1,0,1e6))this.options.sharpenX1=n.x1;else throw O.invalidParameterError("options.x1","number between 0 and 1000000",n.x1);if(O.defined(n.y2))if(O.number(n.y2)&&O.inRange(n.y2,0,1e6))this.options.sharpenY2=n.y2;else throw O.invalidParameterError("options.y2","number between 0 and 1000000",n.y2);if(O.defined(n.y3))if(O.number(n.y3)&&O.inRange(n.y3,0,1e6))this.options.sharpenY3=n.y3;else throw O.invalidParameterError("options.y3","number between 0 and 1000000",n.y3)}else this.options.sharpenSigma=-1;return this}function bJe(n){if(!O.defined(n))this.options.medianSize=3;else if(O.integer(n)&&O.inRange(n,1,1e3))this.options.medianSize=n;else throw O.invalidParameterError("size","integer between 1 and 1000",n);return this}function MJe(n){let t;if(O.number(n))t=n;else if(O.plainObject(n)){if(!O.number(n.sigma))throw O.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=n.sigma,"precision"in n)if(O.string(qte[n.precision]))this.options.precision=qte[n.precision];else throw O.invalidParameterError("precision","one of: integer, float, approximate",n.precision);if("minAmplitude"in n)if(O.number(n.minAmplitude)&&O.inRange(n.minAmplitude,.001,1))this.options.minAmpl=n.minAmplitude;else throw O.invalidParameterError("minAmplitude","number between 0.001 and 1",n.minAmplitude)}if(!O.defined(n))this.options.blurSigma=-1;else if(O.bool(n))this.options.blurSigma=n?-1:0;else if(O.number(t)&&O.inRange(t,.3,1e3))this.options.blurSigma=t;else throw O.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function _Je(n){if(!O.defined(n))this.options.dilateWidth=1;else if(O.integer(n)&&O.inRange(n,1,65536))this.options.dilateWidth=n;else throw O.invalidParameterError("width","integer between 1 and 65536",n);return this}function TJe(n){if(!O.defined(n))this.options.erodeWidth=1;else if(O.integer(n)&&O.inRange(n,1,65536))this.options.erodeWidth=n;else throw O.invalidParameterError("width","integer between 1 and 65536",n);return this}function NJe(n){return this.options.flatten=O.bool(n)?n:!0,O.object(n)&&this._setBackgroundColourOption("flattenBackground",n.background),this}function RJe(){return this.options.unflatten=!0,this}function kJe(n,t){if(!O.defined(n))this.options.gamma=2.2;else if(O.number(n)&&O.inRange(n,1,3))this.options.gamma=n;else throw O.invalidParameterError("gamma","number between 1.0 and 3.0",n);if(!O.defined(t))this.options.gammaOut=this.options.gamma;else if(O.number(t)&&O.inRange(t,1,3))this.options.gammaOut=t;else throw O.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function vJe(n){if(this.options.negate=O.bool(n)?n:!0,O.plainObject(n)&&"alpha"in n)if(O.bool(n.alpha))this.options.negateAlpha=n.alpha;else throw O.invalidParameterError("alpha","should be boolean value",n.alpha);return this}function PJe(n){if(O.plainObject(n)){if(O.defined(n.lower))if(O.number(n.lower)&&O.inRange(n.lower,0,99))this.options.normaliseLower=n.lower;else throw O.invalidParameterError("lower","number between 0 and 99",n.lower);if(O.defined(n.upper))if(O.number(n.upper)&&O.inRange(n.upper,1,100))this.options.normaliseUpper=n.upper;else throw O.invalidParameterError("upper","number between 1 and 100",n.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw O.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function GJe(n){return this.normalise(n)}function FJe(n){if(O.plainObject(n)){if(O.integer(n.width)&&O.inRange(n.width,1,65536))this.options.claheWidth=n.width;else throw O.invalidParameterError("width","integer between 1 and 65536",n.width);if(O.integer(n.height)&&O.inRange(n.height,1,65536))this.options.claheHeight=n.height;else throw O.invalidParameterError("height","integer between 1 and 65536",n.height);if(O.defined(n.maxSlope))if(O.integer(n.maxSlope)&&O.inRange(n.maxSlope,0,100))this.options.claheMaxSlope=n.maxSlope;else throw O.invalidParameterError("maxSlope","integer between 0 and 100",n.maxSlope)}else throw O.invalidParameterError("options","plain object",n);return this}function LJe(n){if(!O.object(n)||!Array.isArray(n.kernel)||!O.integer(n.width)||!O.integer(n.height)||!O.inRange(n.width,3,1001)||!O.inRange(n.height,3,1001)||n.height*n.width!==n.kernel.length||!n.kernel.every(O.number))throw new Error("Invalid convolution kernel");return O.integer(n.scale)||(n.scale=n.kernel.reduce((t,o)=>t+o,0)),n.scale<1&&(n.scale=1),O.integer(n.offset)||(n.offset=0),this.options.convKernel=n,this}function UJe(n,t){if(!O.defined(n))this.options.threshold=128;else if(O.bool(n))this.options.threshold=n?128:0;else if(O.integer(n)&&O.inRange(n,0,255))this.options.threshold=n;else throw O.invalidParameterError("threshold","integer between 0 and 255",n);return!O.object(t)||t.greyscale===!0||t.grayscale===!0?this.options.thresholdGrayscale=!0:this.options.thresholdGrayscale=!1,this}function HJe(n,t,o){if(this.options.boolean=this._createInputDescriptor(n,o),O.string(t)&&O.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw O.invalidParameterError("operator","one of: and, or, eor",t);return this}function KJe(n,t){if(!O.defined(n)&&O.number(t)?n=1:O.number(n)&&!O.defined(t)&&(t=0),!O.defined(n))this.options.linearA=[];else if(O.number(n))this.options.linearA=[n];else if(Array.isArray(n)&&n.length&&n.every(O.number))this.options.linearA=n;else throw O.invalidParameterError("a","number or array of numbers",n);if(!O.defined(t))this.options.linearB=[];else if(O.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&t.length&&t.every(O.number))this.options.linearB=t;else throw O.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw new Error("Expected a and b to be arrays of the same length");return this}function xJe(n){if(!Array.isArray(n))throw O.invalidParameterError("inputMatrix","array",n);let t=n.length;if(t!==3&&t!==4)throw O.invalidParameterError("inputMatrix","3x3 or 4x4 array",t);if(!n.every(a=>Array.isArray(a)&&a.length===t))throw O.invalidParameterError("inputMatrix",`array of ${t} arrays of length ${t}`,n);let o=n.flat();if(!o.every(O.number))throw O.invalidParameterError("inputMatrix","array of numbers",o);return this.options.recombMatrix=o,this}function YJe(n){if(!O.plainObject(n))throw O.invalidParameterError("options","plain object",n);if("brightness"in n)if(O.number(n.brightness)&&n.brightness>=0)this.options.brightness=n.brightness;else throw O.invalidParameterError("brightness","number above zero",n.brightness);if("saturation"in n)if(O.number(n.saturation)&&n.saturation>=0)this.options.saturation=n.saturation;else throw O.invalidParameterError("saturation","number above zero",n.saturation);if("hue"in n)if(O.integer(n.hue))this.options.hue=n.hue%360;else throw O.invalidParameterError("hue","number",n.hue);if("lightness"in n)if(O.number(n.lightness))this.options.lightness=n.lightness;else throw O.invalidParameterError("lightness","number",n.lightness);return this}var qte,zte,Vte=ue(()=>{Fs();qte={integer:"integer",float:"float",approximate:"approximate"};zte=n=>{Object.assign(n.prototype,{autoOrient:mJe,rotate:yJe,flip:SJe,flop:wJe,affine:DJe,sharpen:OJe,erode:TJe,dilate:_Je,median:bJe,blur:MJe,flatten:NJe,unflatten:RJe,gamma:kJe,negate:vJe,normalise:PJe,normalize:GJe,clahe:FJe,convolve:LJe,threshold:UJe,boolean:HJe,linear:KJe,recomb:xJe,modulate:YJe})}});var Are=ee((XDA,ere)=>{var C2=Object.defineProperty,jJe=Object.getOwnPropertyDescriptor,JJe=Object.getOwnPropertyNames,qJe=Object.prototype.hasOwnProperty,zJe=(n,t)=>{for(var o in t)C2(n,o,{get:t[o],enumerable:!0})},VJe=(n,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of JJe(t))!qJe.call(n,e)&&e!==o&&C2(n,e,{get:()=>t[e],enumerable:!(a=jJe(t,e))||a.enumerable});return n},WJe=n=>VJe(C2({},"__esModule",{value:!0}),n),Wte={};zJe(Wte,{default:()=>cqe});ere.exports=WJe(Wte);var d2={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(let n in d2)Object.freeze(d2[n]);var Ys=Object.freeze(d2),Zte=Object.create(null);for(let n in Ys)Object.hasOwn(Ys,n)&&(Zte[Ys[n]]=n);var Xa={to:{},get:{}};Xa.get=function(n){let t=n.slice(0,3).toLowerCase(),o,a;switch(t){case"hsl":{o=Xa.get.hsl(n),a="hsl";break}case"hwb":{o=Xa.get.hwb(n),a="hwb";break}default:{o=Xa.get.rgb(n),a="rgb";break}}return o?{model:a,value:o}:null};Xa.get.rgb=function(n){if(!n)return null;let t=/^#([a-f\d]{3,4})$/i,o=/^#([a-f\d]{6})([a-f\d]{2})?$/i,a=/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i,e=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i,i=/^(\w+)$/,A=[0,0,0,1],r,s,g;if(r=n.match(o)){for(g=r[2],r=r[1],s=0;s<3;s++){let c=s*2;A[s]=Number.parseInt(r.slice(c,c+2),16)}g&&(A[3]=Number.parseInt(g,16)/255)}else if(r=n.match(t)){for(r=r[1],g=r[3],s=0;s<3;s++)A[s]=Number.parseInt(r[s]+r[s],16);g&&(A[3]=Number.parseInt(g+g,16)/255)}else if(r=n.match(a)){for(s=0;s<3;s++)A[s]=Number.parseFloat(r[s+1]);r[4]&&(A[3]=r[5]?Number.parseFloat(r[4])*.01:Number.parseFloat(r[4]))}else if(r=n.match(e)){for(s=0;s<3;s++)A[s]=Math.round(Number.parseFloat(r[s+1])*2.55);r[4]&&(A[3]=r[5]?Number.parseFloat(r[4])*.01:Number.parseFloat(r[4]))}else return(r=n.toLowerCase().match(i))?r[1]==="transparent"?[0,0,0,0]:Object.hasOwn(Ys,r[1])?(A=Ys[r[1]].slice(),A[3]=1,A):null:null;for(s=0;s<3;s++)A[s]=pI(A[s],0,255);return A[3]=pI(A[3],0,1),A};Xa.get.hsl=function(n){if(!n)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,o=n.match(t);if(o){let a=Number.parseFloat(o[4]),e=(Number.parseFloat(o[1])%360+360)%360,i=pI(Number.parseFloat(o[2]),0,100),A=pI(Number.parseFloat(o[3]),0,100),r=pI(Number.isNaN(a)?1:a,0,1);return[e,i,A,r]}return null};Xa.get.hwb=function(n){if(!n)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i,o=n.match(t);if(o){let a=Number.parseFloat(o[4]),e=(Number.parseFloat(o[1])%360+360)%360,i=pI(Number.parseFloat(o[2]),0,100),A=pI(Number.parseFloat(o[3]),0,100),r=pI(Number.isNaN(a)?1:a,0,1);return[e,i,A,r]}return null};Xa.to.hex=function(...n){return"#"+dO(n[0])+dO(n[1])+dO(n[2])+(n[3]<1?dO(Math.round(n[3]*255)):"")};Xa.to.rgb=function(...n){return n.length<4||n[3]===1?"rgb("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+")":"rgba("+Math.round(n[0])+", "+Math.round(n[1])+", "+Math.round(n[2])+", "+n[3]+")"};Xa.to.rgb.percent=function(...n){let t=Math.round(n[0]/255*100),o=Math.round(n[1]/255*100),a=Math.round(n[2]/255*100);return n.length<4||n[3]===1?"rgb("+t+"%, "+o+"%, "+a+"%)":"rgba("+t+"%, "+o+"%, "+a+"%, "+n[3]+")"};Xa.to.hsl=function(...n){return n.length<4||n[3]===1?"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)":"hsla("+n[0]+", "+n[1]+"%, "+n[2]+"%, "+n[3]+")"};Xa.to.hwb=function(...n){let t="";return n.length>=4&&n[3]!==1&&(t=", "+n[3]),"hwb("+n[0]+", "+n[1]+"%, "+n[2]+"%"+t+")"};Xa.to.keyword=function(...n){return Zte[n.slice(0,3)]};function pI(n,t,o){return Math.min(Math.max(t,n),o)}function dO(n){let t=Math.round(n).toString(16).toUpperCase();return t.length<2?"0"+t:t}var xh=Xa,Xte={};for(let n of Object.keys(Ys))Xte[Ys[n]]=n;var sA={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},Xl=sA,Ac=(6/29)**3;function jh(n){let t=n>.0031308?1.055*n**.4166666666666667-.055:n*12.92;return Math.min(Math.max(0,t),1)}function Jh(n){return n>.04045?((n+.055)/1.055)**2.4:n/12.92}for(let n of Object.keys(sA)){if(!("channels"in sA[n]))throw new Error("missing channels property: "+n);if(!("labels"in sA[n]))throw new Error("missing channel labels property: "+n);if(sA[n].labels.length!==sA[n].channels)throw new Error("channel and label counts mismatch: "+n);let{channels:t,labels:o}=sA[n];delete sA[n].channels,delete sA[n].labels,Object.defineProperty(sA[n],"channels",{value:t}),Object.defineProperty(sA[n],"labels",{value:o})}sA.rgb.hsl=function(n){let t=n[0]/255,o=n[1]/255,a=n[2]/255,e=Math.min(t,o,a),i=Math.max(t,o,a),A=i-e,r,s;switch(i){case e:{r=0;break}case t:{r=(o-a)/A;break}case o:{r=2+(a-t)/A;break}case a:{r=4+(t-o)/A;break}}r=Math.min(r*60,360),r<0&&(r+=360);let g=(e+i)/2;return i===e?s=0:g<=.5?s=A/(i+e):s=A/(2-i-e),[r,s*100,g*100]};sA.rgb.hsv=function(n){let t,o,a,e,i,A=n[0]/255,r=n[1]/255,s=n[2]/255,g=Math.max(A,r,s),c=g-Math.min(A,r,s),I=function(p){return(g-p)/6/c+1/2};if(c===0)e=0,i=0;else{switch(i=c/g,t=I(A),o=I(r),a=I(s),g){case A:{e=a-o;break}case r:{e=1/3+t-a;break}case s:{e=2/3+o-t;break}}e<0?e+=1:e>1&&(e-=1)}return[e*360,i*100,g*100]};sA.rgb.hwb=function(n){let t=n[0],o=n[1],a=n[2],e=sA.rgb.hsl(n)[0],i=1/255*Math.min(t,Math.min(o,a));return a=1-1/255*Math.max(t,Math.max(o,a)),[e,i*100,a*100]};sA.rgb.oklab=function(n){let t=Jh(n[0]/255),o=Jh(n[1]/255),a=Jh(n[2]/255),e=Math.cbrt(.4122214708*t+.5363325363*o+.0514459929*a),i=Math.cbrt(.2119034982*t+.6806995451*o+.1073969566*a),A=Math.cbrt(.0883024619*t+.2817188376*o+.6299787005*a),r=.2104542553*e+.793617785*i-.0040720468*A,s=1.9779984951*e-2.428592205*i+.4505937099*A,g=.0259040371*e+.7827717662*i-.808675766*A;return[r*100,s*100,g*100]};sA.rgb.cmyk=function(n){let t=n[0]/255,o=n[1]/255,a=n[2]/255,e=Math.min(1-t,1-o,1-a),i=(1-t-e)/(1-e)||0,A=(1-o-e)/(1-e)||0,r=(1-a-e)/(1-e)||0;return[i*100,A*100,r*100,e*100]};function ZJe(n,t){return(n[0]-t[0])**2+(n[1]-t[1])**2+(n[2]-t[2])**2}sA.rgb.keyword=function(n){let t=Xte[n];if(t)return t;let o=Number.POSITIVE_INFINITY,a;for(let e of Object.keys(Ys)){let i=Ys[e],A=ZJe(n,i);AAc?o**(1/3):7.787*o+16/116,a=a>Ac?a**(1/3):7.787*a+16/116,e=e>Ac?e**(1/3):7.787*e+16/116;let i=116*a-16,A=500*(o-a),r=200*(a-e);return[i,A,r]};sA.hsl.rgb=function(n){let t=n[0]/360,o=n[1]/100,a=n[2]/100,e,i;if(o===0)return i=a*255,[i,i,i];let A=a<.5?a*(1+o):a+o-a*o,r=2*a-A,s=[0,0,0];for(let g=0;g<3;g++)e=t+1/3*-(g-1),e<0&&e++,e>1&&e--,6*e<1?i=r+(A-r)*6*e:2*e<1?i=A:3*e<2?i=r+(A-r)*(2/3-e)*6:i=r,s[g]=i*255;return s};sA.hsl.hsv=function(n){let t=n[0],o=n[1]/100,a=n[2]/100,e=o,i=Math.max(a,.01);a*=2,o*=a<=1?a:2-a,e*=i<=1?i:2-i;let A=(a+o)/2,r=a===0?2*e/(i+e):2*o/(a+o);return[t,r*100,A*100]};sA.hsv.rgb=function(n){let t=n[0]/60,o=n[1]/100,a=n[2]/100,e=Math.floor(t)%6,i=t-Math.floor(t),A=255*a*(1-o),r=255*a*(1-o*i),s=255*a*(1-o*(1-i));switch(a*=255,e){case 0:return[a,s,A];case 1:return[r,a,A];case 2:return[A,a,s];case 3:return[A,r,a];case 4:return[s,A,a];case 5:return[a,A,r]}};sA.hsv.hsl=function(n){let t=n[0],o=n[1]/100,a=n[2]/100,e=Math.max(a,.01),i,A;A=(2-o)*a;let r=(2-o)*e;return i=o*e,i/=r<=1?r:2-r,i=i||0,A/=2,[t,i*100,A*100]};sA.hwb.rgb=function(n){let t=n[0]/360,o=n[1]/100,a=n[2]/100,e=o+a,i;e>1&&(o/=e,a/=e);let A=Math.floor(6*t),r=1-a;i=6*t-A,(A&1)!==0&&(i=1-i);let s=o+i*(r-o),g,c,I;switch(A){default:case 6:case 0:{g=r,c=s,I=o;break}case 1:{g=s,c=r,I=o;break}case 2:{g=o,c=r,I=s;break}case 3:{g=o,c=s,I=r;break}case 4:{g=s,c=o,I=r;break}case 5:{g=r,c=o,I=s;break}}return[g*255,c*255,I*255]};sA.cmyk.rgb=function(n){let t=n[0]/100,o=n[1]/100,a=n[2]/100,e=n[3]/100,i=1-Math.min(1,t*(1-e)+e),A=1-Math.min(1,o*(1-e)+e),r=1-Math.min(1,a*(1-e)+e);return[i*255,A*255,r*255]};sA.xyz.rgb=function(n){let t=n[0]/100,o=n[1]/100,a=n[2]/100,e,i,A;return e=t*3.2404542+o*-1.5371385+a*-.4985314,i=t*-.969266+o*1.8760108+a*.041556,A=t*.0556434+o*-.2040259+a*1.0572252,e=jh(e),i=jh(i),A=jh(A),[e*255,i*255,A*255]};sA.xyz.lab=function(n){let t=n[0],o=n[1],a=n[2];t/=95.047,o/=100,a/=108.883,t=t>Ac?t**(1/3):7.787*t+16/116,o=o>Ac?o**(1/3):7.787*o+16/116,a=a>Ac?a**(1/3):7.787*a+16/116;let e=116*o-16,i=500*(t-o),A=200*(o-a);return[e,i,A]};sA.xyz.oklab=function(n){let t=n[0]/100,o=n[1]/100,a=n[2]/100,e=Math.cbrt(.8189330101*t+.3618667424*o-.1288597137*a),i=Math.cbrt(.0329845436*t+.9293118715*o+.0361456387*a),A=Math.cbrt(.0482003018*t+.2643662691*o+.633851707*a),r=.2104542553*e+.793617785*i-.0040720468*A,s=1.9779984951*e-2.428592205*i+.4505937099*A,g=.0259040371*e+.7827717662*i-.808675766*A;return[r*100,s*100,g*100]};sA.oklab.oklch=function(n){return sA.lab.lch(n)};sA.oklab.xyz=function(n){let t=n[0]/100,o=n[1]/100,a=n[2]/100,e=(.999999998*t+.396337792*o+.215803758*a)**3,i=(1.000000008*t-.105561342*o-.063854175*a)**3,A=(1.000000055*t-.089484182*o-1.291485538*a)**3,r=1.227013851*e-.55779998*i+.281256149*A,s=-.040580178*e+1.11225687*i-.071676679*A,g=-.076381285*e-.421481978*i+1.58616322*A;return[r*100,s*100,g*100]};sA.oklab.rgb=function(n){let t=n[0]/100,o=n[1]/100,a=n[2]/100,e=(t+.3963377774*o+.2158037573*a)**3,i=(t-.1055613458*o-.0638541728*a)**3,A=(t-.0894841775*o-1.291485548*a)**3,r=jh(4.0767416621*e-3.3077115913*i+.2309699292*A),s=jh(-1.2684380046*e+2.6097574011*i-.3413193965*A),g=jh(-.0041960863*e-.7034186147*i+1.707614701*A);return[r*255,s*255,g*255]};sA.oklch.oklab=function(n){return sA.lch.lab(n)};sA.lab.xyz=function(n){let t=n[0],o=n[1],a=n[2],e,i,A;i=(t+16)/116,e=o/500+i,A=i-a/200;let r=i**3,s=e**3,g=A**3;return i=r>Ac?r:(i-16/116)/7.787,e=s>Ac?s:(e-16/116)/7.787,A=g>Ac?g:(A-16/116)/7.787,e*=95.047,i*=100,A*=108.883,[e,i,A]};sA.lab.lch=function(n){let t=n[0],o=n[1],a=n[2],e;e=Math.atan2(a,o)*360/2/Math.PI,e<0&&(e+=360);let A=Math.sqrt(o*o+a*a);return[t,A,e]};sA.lch.lab=function(n){let t=n[0],o=n[1],e=n[2]/360*2*Math.PI,i=o*Math.cos(e),A=o*Math.sin(e);return[t,i,A]};sA.rgb.ansi16=function(n,t=null){let[o,a,e]=n,i=t===null?sA.rgb.hsv(n)[2]:t;if(i=Math.round(i/50),i===0)return 30;let A=30+(Math.round(e/255)<<2|Math.round(a/255)<<1|Math.round(o/255));return i===2&&(A+=60),A};sA.hsv.ansi16=function(n){return sA.rgb.ansi16(sA.hsv.rgb(n),n[2])};sA.rgb.ansi256=function(n){let t=n[0],o=n[1],a=n[2];return t>>4===o>>4&&o>>4===a>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(o/255*5)+Math.round(a/255*5)};sA.ansi16.rgb=function(n){n=n[0];let t=n%10;if(t===0||t===7)return n>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let o=(Math.trunc(n>50)+1)*.5,a=(t&1)*o*255,e=(t>>1&1)*o*255,i=(t>>2&1)*o*255;return[a,e,i]};sA.ansi256.rgb=function(n){if(n=n[0],n>=232){let i=(n-232)*10+8;return[i,i,i]}n-=16;let t,o=Math.floor(n/36)/5*255,a=Math.floor((t=n%36)/6)/5*255,e=t%6/5*255;return[o,a,e]};sA.rgb.hex=function(n){let o=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".slice(o.length)+o};sA.hex.rgb=function(n){let t=n.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let o=t[0];t[0].length===3&&(o=[...o].map(r=>r+r).join(""));let a=Number.parseInt(o,16),e=a>>16&255,i=a>>8&255,A=a&255;return[e,i,A]};sA.rgb.hcg=function(n){let t=n[0]/255,o=n[1]/255,a=n[2]/255,e=Math.max(Math.max(t,o),a),i=Math.min(Math.min(t,o),a),A=e-i,r,s=A<1?i/(1-A):0;return A<=0?r=0:e===t?r=(o-a)/A%6:e===o?r=2+(a-t)/A:r=4+(t-o)/A,r/=6,r%=1,[r*360,A*100,s*100]};sA.hsl.hcg=function(n){let t=n[1]/100,o=n[2]/100,a=o<.5?2*t*o:2*t*(1-o),e=0;return a<1&&(e=(o-.5*a)/(1-a)),[n[0],a*100,e*100]};sA.hsv.hcg=function(n){let t=n[1]/100,o=n[2]/100,a=t*o,e=0;return a<1&&(e=(o-a)/(1-a)),[n[0],a*100,e*100]};sA.hcg.rgb=function(n){let t=n[0]/360,o=n[1]/100,a=n[2]/100;if(o===0)return[a*255,a*255,a*255];let e=[0,0,0],i=t%1*6,A=i%1,r=1-A,s=0;switch(Math.floor(i)){case 0:{e[0]=1,e[1]=A,e[2]=0;break}case 1:{e[0]=r,e[1]=1,e[2]=0;break}case 2:{e[0]=0,e[1]=1,e[2]=A;break}case 3:{e[0]=0,e[1]=r,e[2]=1;break}case 4:{e[0]=A,e[1]=0,e[2]=1;break}default:e[0]=1,e[1]=0,e[2]=r}return s=(1-o)*a,[(o*e[0]+s)*255,(o*e[1]+s)*255,(o*e[2]+s)*255]};sA.hcg.hsv=function(n){let t=n[1]/100,o=n[2]/100,a=t+o*(1-t),e=0;return a>0&&(e=t/a),[n[0],e*100,a*100]};sA.hcg.hsl=function(n){let t=n[1]/100,a=n[2]/100*(1-t)+.5*t,e=0;return a>0&&a<.5?e=t/(2*a):a>=.5&&a<1&&(e=t/(2*(1-a))),[n[0],e*100,a*100]};sA.hcg.hwb=function(n){let t=n[1]/100,o=n[2]/100,a=t+o*(1-t);return[n[0],(a-t)*100,(1-a)*100]};sA.hwb.hcg=function(n){let t=n[1]/100,a=1-n[2]/100,e=a-t,i=0;return e<1&&(i=(a-e)/(1-e)),[n[0],e*100,i*100]};sA.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};sA.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};sA.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};sA.gray.hsl=function(n){return[0,0,n[0]]};sA.gray.hsv=sA.gray.hsl;sA.gray.hwb=function(n){return[0,100,n[0]]};sA.gray.cmyk=function(n){return[0,0,0,n[0]]};sA.gray.lab=function(n){return[n[0],0,0]};sA.gray.hex=function(n){let t=Math.round(n[0]/100*255)&255,a=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(a.length)+a};sA.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]};function XJe(){let n={},t=Object.keys(Xl);for(let{length:o}=t,a=0;a0;){let a=o.pop(),e=Object.keys(Xl[a]);for(let{length:i}=e,A=0;A1&&(o=a),n(o))};return"conversion"in n&&(t.conversion=n.conversion),t}function oqe(n){let t=function(...o){let a=o[0];if(a==null)return a;a.length>1&&(o=a);let e=n(o);if(typeof e=="object")for(let{length:i}=e,A=0;A0){this.model=t||"rgb",a=fo[this.model].channels;let e=Array.prototype.slice.call(n,0,a);this.color=u2(e,a),this.valpha=typeof n[a]=="number"?n[a]:1}else if(typeof n=="number")this.model="rgb",this.color=[n>>16&255,n>>8&255,n&255],this.valpha=1;else{this.valpha=1;let e=Object.keys(n);"alpha"in n&&(e.splice(e.indexOf("alpha"),1),this.valpha=typeof n.alpha=="number"?n.alpha:0);let i=e.sort().join("");if(!(i in h2))throw new Error("Unable to parse color from object: "+JSON.stringify(n));this.model=h2[i];let{labels:A}=fo[this.model],r=[];for(o=0;o(n%360+360)%360),saturationl:Mr("hsl",1,Xr(100)),lightness:Mr("hsl",2,Xr(100)),saturationv:Mr("hsv",1,Xr(100)),value:Mr("hsv",2,Xr(100)),chroma:Mr("hcg",1,Xr(100)),gray:Mr("hcg",2,Xr(100)),white:Mr("hwb",1,Xr(100)),wblack:Mr("hwb",2,Xr(100)),cyan:Mr("cmyk",0,Xr(100)),magenta:Mr("cmyk",1,Xr(100)),yellow:Mr("cmyk",2,Xr(100)),black:Mr("cmyk",3,Xr(100)),x:Mr("xyz",0,Xr(95.047)),y:Mr("xyz",1,Xr(100)),z:Mr("xyz",2,Xr(108.833)),l:Mr("lab",0,Xr(100)),a:Mr("lab",1),b:Mr("lab",2),keyword(n){return n!==void 0?new Bi(n):fo[this.model].keyword(this.color)},hex(n){return n!==void 0?new Bi(n):xh.to.hex(...this.rgb().round().color)},hexa(n){if(n!==void 0)return new Bi(n);let t=this.rgb().round().color,o=Math.round(this.valpha*255).toString(16).toUpperCase();return o.length===1&&(o="0"+o),xh.to.hex(...t)+o},rgbNumber(){let n=this.rgb().color;return(n[0]&255)<<16|(n[1]&255)<<8|n[2]&255},luminosity(){let n=this.rgb().color,t=[];for(let[o,a]of n.entries()){let e=a/255;t[o]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(n){let t=this.luminosity(),o=n.luminosity();return t>o?(t+.05)/(o+.05):(o+.05)/(t+.05)},level(n){let t=this.contrast(n);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){let n=this.rgb().color;return(n[0]*2126+n[1]*7152+n[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let n=this.rgb();for(let t=0;t<3;t++)n.color[t]=255-n.color[t];return n},lighten(n){let t=this.hsl();return t.color[2]+=t.color[2]*n,t},darken(n){let t=this.hsl();return t.color[2]-=t.color[2]*n,t},saturate(n){let t=this.hsl();return t.color[1]+=t.color[1]*n,t},desaturate(n){let t=this.hsl();return t.color[1]-=t.color[1]*n,t},whiten(n){let t=this.hwb();return t.color[1]+=t.color[1]*n,t},blacken(n){let t=this.hwb();return t.color[2]+=t.color[2]*n,t},grayscale(){let n=this.rgb().color,t=n[0]*.3+n[1]*.59+n[2]*.11;return Bi.rgb(t,t,t)},fade(n){return this.alpha(this.valpha-this.valpha*n)},opaquer(n){return this.alpha(this.valpha+this.valpha*n)},rotate(n){let t=this.hsl(),o=t.color[0];return o=(o+n)%360,o=o<0?360+o:o,t.color[0]=o,t},mix(n,t){if(!n||!n.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof n);let o=n.rgb(),a=this.rgb(),e=t===void 0?.5:t,i=2*e-1,A=o.alpha()-a.alpha(),r=((i*A===-1?i:(i+A)/(1+i*A))+1)/2,s=1-r;return Bi.rgb(r*o.red()+s*a.red(),r*o.green()+s*a.green(),r*o.blue()+s*a.blue(),o.alpha()*e+a.alpha()*(1-e))}};for(let n of Object.keys(fo)){if($te.includes(n))continue;let{channels:t}=fo[n];Bi.prototype[n]=function(...o){return this.model===n?new Bi(this):o.length>0?new Bi(o,n):new Bi([...gqe(fo[this.model][n].raw(this.color)),this.valpha],n)},Bi[n]=function(...o){let a=o[0];return typeof a=="number"&&(a=u2(o,t)),new Bi(a,n)}}function nqe(n,t){return Number(n.toFixed(t))}function sqe(n){return function(t){return nqe(t,n)}}function Mr(n,t,o){n=Array.isArray(n)?n:[n];for(let a of n)(E2[a]||=[])[t]=o;return n=n[0],function(a){let e;return a!==void 0?(o&&(a=o(a)),e=this[n](),e.color[t]=a,e):(e=this[n]().color[t],o&&(e=o(e)),e)}}function Xr(n){return function(t){return Math.max(0,Math.min(n,t))}}function gqe(n){return Array.isArray(n)?n:[n]}function u2(n,t){for(let o=0;o{tre.exports=Are().default});function Iqe(n){return this._setBackgroundColourOption("tint",n),this}function lqe(n){return this.options.greyscale=O.bool(n)?n:!0,this}function pqe(n){return this.greyscale(n)}function dqe(n){if(!O.string(n))throw O.invalidParameterError("colourspace","string",n);return this.options.colourspacePipeline=n,this}function hqe(n){return this.pipelineColourspace(n)}function Eqe(n){if(!O.string(n))throw O.invalidParameterError("colourspace","string",n);return this.options.colourspace=n,this}function uqe(n){return this.toColourspace(n)}function ore(n){if(O.object(n)||O.string(n)&&n.length>=3&&n.length<=200){let t=(0,are.default)(n),o=t.red(),a=t.green(),e=t.blue(),i=Math.round(t.alpha()*255);for(let[A,r]of[["red",o],["green",a],["blue",e],["alpha",i]])if(!O.number(r))throw O.invalidParameterError(`background.${A}`,"number",r);return[o,a,e,i]}else throw O.invalidParameterError("background","object or string",n)}function Cqe(n,t){O.defined(t)&&(this.options[n]=ore(t))}var are,ire,nre,sre=ue(()=>{are=ze(rre(),1);Fs();ire={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};nre=n=>{Object.assign(n.prototype,{tint:Iqe,greyscale:lqe,grayscale:pqe,pipelineColourspace:dqe,pipelineColorspace:hqe,toColourspace:Eqe,toColorspace:uqe,_getBackgroundColourOption:ore,_setBackgroundColourOption:Cqe}),n.colourspace=ire,n.colorspace=ire}});function fqe(){return this.options.removeAlpha=!0,this}function Qqe(n){if(O.defined(n))if(O.number(n)&&O.inRange(n,0,1))this.options.ensureAlpha=n;else throw O.invalidParameterError("alpha","number between 0 and 1",n);else this.options.ensureAlpha=1;return this}function yqe(n){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(n)&&(n=t[n]),O.integer(n)&&O.inRange(n,0,4))this.options.extractChannel=n;else throw O.invalidParameterError("channel","integer or one of: red, green, blue, alpha",n);return this}function mqe(n,t){return Array.isArray(n)?n.forEach(function(o){this.options.joinChannelIn.push(this._createInputDescriptor(o,t))},this):this.options.joinChannelIn.push(this._createInputDescriptor(n,t)),this}function Sqe(n){if(O.string(n)&&O.inArray(n,["and","or","eor"]))this.options.bandBoolOp=n;else throw O.invalidParameterError("boolOp","one of: and, or, eor",n);return this}var Bqe,gre,cre=ue(()=>{Fs();Bqe={and:"and",or:"or",eor:"eor"};gre=n=>{Object.assign(n.prototype,{removeAlpha:fqe,ensureAlpha:Qqe,extractChannel:yqe,joinChannel:mqe,bandbool:Sqe}),n.bool=Bqe}});import B2 from"node:path";function Dqe(n,t){let o;if(O.string(n)?O.string(this.options.input.file)&&B2.resolve(this.options.input.file)===B2.resolve(n)?o=new Error("Cannot use same file for input and output"):wqe.test(B2.extname(n))&&!this.constructor.format.jp2.output.file&&(o=lre()):o=new Error("Missing output file path"),o)if(O.fn(t))t(o);else return Promise.reject(o);else{this.options.fileOut=n;let a=Error();return this._pipeline(t,a)}return this}function Oqe(n,t){O.object(n)?this._setBooleanOption("resolveWithObject",n.resolveWithObject):this.options.resolveWithObject&&(this.options.resolveWithObject=!1),this.options.fileOut="";let o=Error();return this._pipeline(O.fn(n)?n:t,o)}function bqe(){this.options.resolveWithObject=!0,this.options.typedArrayOut=!0;let n=Error();return this._pipeline(null,n)}function Mqe(n){if(O.number(n)&&n>0)this.options.withMetadataDensity=n;else throw O.invalidParameterError("density","positive number",n);return this.keepExif()}function _qe(){return this.options.keepMetadata|=1,this}function Tqe(n){if(O.object(n))for(let[t,o]of Object.entries(n))if(O.object(o))for(let[a,e]of Object.entries(o))if(O.string(e))this.options.withExif[`exif-${t.toLowerCase()}-${a}`]=e;else throw O.invalidParameterError(`${t}.${a}`,"string",e);else throw O.invalidParameterError(t,"object",o);else throw O.invalidParameterError("exif","object",n);return this.options.withExifMerge=!1,this.keepExif()}function Nqe(n){return this.withExif(n),this.options.withExifMerge=!0,this}function Rqe(){return this.options.keepMetadata|=8,this}function kqe(n,t){if(O.string(n))this.options.withIccProfile=n;else throw O.invalidParameterError("icc","string",n);if(this.keepIccProfile(),O.object(t)&&O.defined(t.attach))if(O.bool(t.attach))t.attach||(this.options.keepMetadata&=-9);else throw O.invalidParameterError("attach","boolean",t.attach);return this}function vqe(){return this.options.keepGainMap=!0,this.options.withGainMap=!1,this.options.keepMetadata|=32,this}function Pqe(){return this.options.withGainMap=!0,this.options.keepGainMap=!1,this.options.colourspace="scrgb",this}function Gqe(){return this.options.keepMetadata|=2,this}function Fqe(n){if(O.string(n)&&n.length>0)this.options.withXmp=n,this.options.keepMetadata|=2;else throw O.invalidParameterError("xmp","non-empty string",n);return this}function Lqe(){return this.options.keepMetadata|=31,this}function Uqe(n){if(this.keepMetadata(),this.withIccProfile("srgb"),O.object(n)){if(O.defined(n.orientation))if(O.integer(n.orientation)&&O.inRange(n.orientation,1,8))this.options.withMetadataOrientation=n.orientation;else throw O.invalidParameterError("orientation","integer between 1 and 8",n.orientation);if(O.defined(n.density))if(O.number(n.density)&&n.density>0)this.options.withMetadataDensity=n.density;else throw O.invalidParameterError("density","positive number",n.density);O.defined(n.icc)&&this.withIccProfile(n.icc),O.defined(n.exif)&&this.withExifMerge(n.exif)}return this}function Hqe(n,t){let o=Ire.get((O.object(n)&&O.string(n.id)?n.id:n).toLowerCase());if(!o)throw O.invalidParameterError("format",`one of: ${[...Ire.keys()].join(", ")}`,n);return this[o](t)}function Kqe(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.jpegQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.progressive)&&this._setBooleanOption("jpegProgressive",n.progressive),O.defined(n.chromaSubsampling))if(O.string(n.chromaSubsampling)&&O.inArray(n.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=n.chromaSubsampling;else throw O.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",n.chromaSubsampling);let t=O.bool(n.optimizeCoding)?n.optimizeCoding:n.optimiseCoding;if(O.defined(t)&&this._setBooleanOption("jpegOptimiseCoding",t),O.defined(n.mozjpeg))if(O.bool(n.mozjpeg))n.mozjpeg&&(this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3);else throw O.invalidParameterError("mozjpeg","boolean",n.mozjpeg);let o=O.bool(n.trellisQuantization)?n.trellisQuantization:n.trellisQuantisation;O.defined(o)&&this._setBooleanOption("jpegTrellisQuantisation",o),O.defined(n.overshootDeringing)&&this._setBooleanOption("jpegOvershootDeringing",n.overshootDeringing);let a=O.bool(n.optimizeScans)?n.optimizeScans:n.optimiseScans;O.defined(a)&&(this._setBooleanOption("jpegOptimiseScans",a),a&&(this.options.jpegProgressive=!0));let e=O.number(n.quantizationTable)?n.quantizationTable:n.quantisationTable;if(O.defined(e))if(O.integer(e)&&O.inRange(e,0,8))this.options.jpegQuantisationTable=e;else throw O.invalidParameterError("quantisationTable","integer between 0 and 8",e)}return this._updateFormatOut("jpeg",n)}function xqe(n){if(O.object(n)){if(O.defined(n.progressive)&&this._setBooleanOption("pngProgressive",n.progressive),O.defined(n.compressionLevel))if(O.integer(n.compressionLevel)&&O.inRange(n.compressionLevel,0,9))this.options.pngCompressionLevel=n.compressionLevel;else throw O.invalidParameterError("compressionLevel","integer between 0 and 9",n.compressionLevel);O.defined(n.adaptiveFiltering)&&this._setBooleanOption("pngAdaptiveFiltering",n.adaptiveFiltering);let t=n.colours||n.colors;if(O.defined(t))if(O.integer(t)&&O.inRange(t,2,256))this.options.pngBitdepth=pre(t);else throw O.invalidParameterError("colours","integer between 2 and 256",t);if(O.defined(n.palette)?this._setBooleanOption("pngPalette",n.palette):[n.quality,n.effort,n.colours,n.colors,n.dither].some(O.defined)&&this._setBooleanOption("pngPalette",!0),this.options.pngPalette){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,0,100))this.options.pngQuality=n.quality;else throw O.invalidParameterError("quality","integer between 0 and 100",n.quality);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,1,10))this.options.pngEffort=n.effort;else throw O.invalidParameterError("effort","integer between 1 and 10",n.effort);if(O.defined(n.dither))if(O.number(n.dither)&&O.inRange(n.dither,0,1))this.options.pngDither=n.dither;else throw O.invalidParameterError("dither","number between 0.0 and 1.0",n.dither)}}return this._updateFormatOut("png",n)}function Yqe(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.webpQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.alphaQuality))if(O.integer(n.alphaQuality)&&O.inRange(n.alphaQuality,0,100))this.options.webpAlphaQuality=n.alphaQuality;else throw O.invalidParameterError("alphaQuality","integer between 0 and 100",n.alphaQuality);if(O.defined(n.lossless)&&this._setBooleanOption("webpLossless",n.lossless),O.defined(n.nearLossless)&&this._setBooleanOption("webpNearLossless",n.nearLossless),O.defined(n.smartSubsample)&&this._setBooleanOption("webpSmartSubsample",n.smartSubsample),O.defined(n.smartDeblock)&&this._setBooleanOption("webpSmartDeblock",n.smartDeblock),O.defined(n.preset))if(O.string(n.preset)&&O.inArray(n.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=n.preset;else throw O.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",n.preset);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,0,6))this.options.webpEffort=n.effort;else throw O.invalidParameterError("effort","integer between 0 and 6",n.effort);O.defined(n.minSize)&&this._setBooleanOption("webpMinSize",n.minSize),O.defined(n.mixed)&&this._setBooleanOption("webpMixed",n.mixed),O.defined(n.exact)&&this._setBooleanOption("webpExact",n.exact)}return f2(n,this.options),this._updateFormatOut("webp",n)}function jqe(n){if(O.object(n)){O.defined(n.reuse)&&this._setBooleanOption("gifReuse",n.reuse),O.defined(n.progressive)&&this._setBooleanOption("gifProgressive",n.progressive);let t=n.colours||n.colors;if(O.defined(t))if(O.integer(t)&&O.inRange(t,2,256))this.options.gifBitdepth=pre(t);else throw O.invalidParameterError("colours","integer between 2 and 256",t);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,1,10))this.options.gifEffort=n.effort;else throw O.invalidParameterError("effort","integer between 1 and 10",n.effort);if(O.defined(n.dither))if(O.number(n.dither)&&O.inRange(n.dither,0,1))this.options.gifDither=n.dither;else throw O.invalidParameterError("dither","number between 0.0 and 1.0",n.dither);if(O.defined(n.interFrameMaxError))if(O.number(n.interFrameMaxError)&&O.inRange(n.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=n.interFrameMaxError;else throw O.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",n.interFrameMaxError);if(O.defined(n.interPaletteMaxError))if(O.number(n.interPaletteMaxError)&&O.inRange(n.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=n.interPaletteMaxError;else throw O.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",n.interPaletteMaxError);if(O.defined(n.keepDuplicateFrames))if(O.bool(n.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",n.keepDuplicateFrames);else throw O.invalidParameterError("keepDuplicateFrames","boolean",n.keepDuplicateFrames)}return f2(n,this.options),this._updateFormatOut("gif",n)}function Jqe(n){if(!this.constructor.format.jp2.output.buffer)throw lre();if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.jp2Quality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.lossless))if(O.bool(n.lossless))this.options.jp2Lossless=n.lossless;else throw O.invalidParameterError("lossless","boolean",n.lossless);if(O.defined(n.tileWidth))if(O.integer(n.tileWidth)&&O.inRange(n.tileWidth,1,32768))this.options.jp2TileWidth=n.tileWidth;else throw O.invalidParameterError("tileWidth","integer between 1 and 32768",n.tileWidth);if(O.defined(n.tileHeight))if(O.integer(n.tileHeight)&&O.inRange(n.tileHeight,1,32768))this.options.jp2TileHeight=n.tileHeight;else throw O.invalidParameterError("tileHeight","integer between 1 and 32768",n.tileHeight);if(O.defined(n.chromaSubsampling))if(O.string(n.chromaSubsampling)&&O.inArray(n.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=n.chromaSubsampling;else throw O.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",n.chromaSubsampling)}return this._updateFormatOut("jp2",n)}function f2(n,t){if(O.object(n)&&O.defined(n.loop))if(O.integer(n.loop)&&O.inRange(n.loop,0,65535))t.loop=n.loop;else throw O.invalidParameterError("loop","integer between 0 and 65535",n.loop);if(O.object(n)&&O.defined(n.delay))if(O.integer(n.delay)&&O.inRange(n.delay,0,65535))t.delay=[n.delay];else if(Array.isArray(n.delay)&&n.delay.every(O.integer)&&n.delay.every(o=>O.inRange(o,0,65535)))t.delay=n.delay;else throw O.invalidParameterError("delay","integer or an array of integers between 0 and 65535",n.delay)}function qqe(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.tiffQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.bitdepth))if(O.integer(n.bitdepth)&&O.inArray(n.bitdepth,[1,2,4]))this.options.tiffBitdepth=n.bitdepth;else throw O.invalidParameterError("bitdepth","1, 2 or 4",n.bitdepth);if(O.defined(n.tile)&&this._setBooleanOption("tiffTile",n.tile),O.defined(n.tileWidth))if(O.integer(n.tileWidth)&&O.inRange(n.tileWidth,1,32768))this.options.tiffTileWidth=n.tileWidth;else throw O.invalidParameterError("tileWidth","integer between 1 and 32768",n.tileWidth);if(O.defined(n.tileHeight))if(O.integer(n.tileHeight)&&O.inRange(n.tileHeight,1,32768))this.options.tiffTileHeight=n.tileHeight;else throw O.invalidParameterError("tileHeight","integer between 1 and 32768",n.tileHeight);if(O.defined(n.miniswhite)&&this._setBooleanOption("tiffMiniswhite",n.miniswhite),O.defined(n.pyramid)&&this._setBooleanOption("tiffPyramid",n.pyramid),O.defined(n.xres))if(O.number(n.xres)&&O.inRange(n.xres,.001,1e6))this.options.tiffXres=n.xres;else throw O.invalidParameterError("xres","number between 0.001 and 1000000",n.xres);if(O.defined(n.yres))if(O.number(n.yres)&&O.inRange(n.yres,.001,1e6))this.options.tiffYres=n.yres;else throw O.invalidParameterError("yres","number between 0.001 and 1000000",n.yres);if(O.defined(n.compression))if(O.string(n.compression)&&O.inArray(n.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=n.compression;else throw O.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",n.compression);if(O.defined(n.bigtiff)&&this._setBooleanOption("tiffBigtiff",n.bigtiff),O.defined(n.predictor))if(O.string(n.predictor)&&O.inArray(n.predictor,["none","horizontal","float"]))this.options.tiffPredictor=n.predictor;else throw O.invalidParameterError("predictor","one of: none, horizontal, float",n.predictor);if(O.defined(n.resolutionUnit))if(O.string(n.resolutionUnit)&&O.inArray(n.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=n.resolutionUnit;else throw O.invalidParameterError("resolutionUnit","one of: inch, cm",n.resolutionUnit)}return this._updateFormatOut("tiff",n)}function zqe(n){return this.heif({...n,compression:"av1"})}function Vqe(n){if(O.object(n)){if(O.string(n.compression)&&O.inArray(n.compression,["av1","hevc"]))this.options.heifCompression=n.compression;else throw O.invalidParameterError("compression","one of: av1, hevc",n.compression);if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.heifQuality=n.quality;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);if(O.defined(n.lossless))if(O.bool(n.lossless))this.options.heifLossless=n.lossless;else throw O.invalidParameterError("lossless","boolean",n.lossless);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,0,9))this.options.heifEffort=n.effort;else throw O.invalidParameterError("effort","integer between 0 and 9",n.effort);if(O.defined(n.chromaSubsampling))if(O.string(n.chromaSubsampling)&&O.inArray(n.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=n.chromaSubsampling;else throw O.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",n.chromaSubsampling);if(O.defined(n.bitdepth))if(O.integer(n.bitdepth)&&O.inArray(n.bitdepth,[8,10,12]))this.options.heifBitdepth=n.bitdepth;else throw O.invalidParameterError("bitdepth","8, 10 or 12",n.bitdepth);if(O.defined(n.tune))if(O.string(n.tune)&&O.inArray(n.tune,["auto","iq","psnr","ssim"]))this.options.heifLossless&&n.tune==="iq"?this.options.heifTune="ssim":this.options.heifTune=n.tune;else throw O.invalidParameterError("tune","one of: auto, iq, psnr, ssim",n.tune)}else throw O.invalidParameterError("options","Object",n);return this._updateFormatOut("heif",n)}function Wqe(n){if(O.object(n)){if(O.defined(n.quality))if(O.integer(n.quality)&&O.inRange(n.quality,1,100))this.options.jxlDistance=n.quality>=30?.1+(100-n.quality)*.09:53/3e3*n.quality*n.quality-23/20*n.quality+25;else throw O.invalidParameterError("quality","integer between 1 and 100",n.quality);else if(O.defined(n.distance))if(O.number(n.distance)&&O.inRange(n.distance,0,15))this.options.jxlDistance=n.distance;else throw O.invalidParameterError("distance","number between 0.0 and 15.0",n.distance);if(O.defined(n.decodingTier))if(O.integer(n.decodingTier)&&O.inRange(n.decodingTier,0,4))this.options.jxlDecodingTier=n.decodingTier;else throw O.invalidParameterError("decodingTier","integer between 0 and 4",n.decodingTier);if(O.defined(n.lossless))if(O.bool(n.lossless))this.options.jxlLossless=n.lossless;else throw O.invalidParameterError("lossless","boolean",n.lossless);if(O.defined(n.effort))if(O.integer(n.effort)&&O.inRange(n.effort,1,9))this.options.jxlEffort=n.effort;else throw O.invalidParameterError("effort","integer between 1 and 9",n.effort)}return f2(n,this.options),this._updateFormatOut("jxl",n)}function Zqe(n){if(O.object(n)&&O.defined(n.depth))if(O.string(n.depth)&&O.inArray(n.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=n.depth;else throw O.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",n.depth);return this._updateFormatOut("raw")}function Xqe(n){if(O.object(n)){if(O.defined(n.size))if(O.integer(n.size)&&O.inRange(n.size,1,8192))this.options.tileSize=n.size;else throw O.invalidParameterError("size","integer between 1 and 8192",n.size);if(O.defined(n.overlap))if(O.integer(n.overlap)&&O.inRange(n.overlap,0,8192)){if(n.overlap>this.options.tileSize)throw O.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,n.overlap);this.options.tileOverlap=n.overlap}else throw O.invalidParameterError("overlap","integer between 0 and 8192",n.overlap);if(O.defined(n.container))if(O.string(n.container)&&O.inArray(n.container,["fs","zip"]))this.options.tileContainer=n.container;else throw O.invalidParameterError("container","one of: fs, zip",n.container);if(O.defined(n.layout))if(O.string(n.layout)&&O.inArray(n.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=n.layout;else throw O.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",n.layout);if(O.defined(n.angle))if(O.integer(n.angle)&&!(n.angle%90))this.options.tileAngle=n.angle;else throw O.invalidParameterError("angle","positive/negative multiple of 90",n.angle);if(this._setBackgroundColourOption("tileBackground",n.background),O.defined(n.depth))if(O.string(n.depth)&&O.inArray(n.depth,["onepixel","onetile","one"]))this.options.tileDepth=n.depth;else throw O.invalidParameterError("depth","one of: onepixel, onetile, one",n.depth);if(O.defined(n.skipBlanks))if(O.integer(n.skipBlanks)&&O.inRange(n.skipBlanks,-1,65535))this.options.tileSkipBlanks=n.skipBlanks;else throw O.invalidParameterError("skipBlanks","integer between -1 and 255/65535",n.skipBlanks);else O.defined(n.layout)&&n.layout==="google"&&(this.options.tileSkipBlanks=5);let t=O.bool(n.center)?n.center:n.centre;if(O.defined(t)&&this._setBooleanOption("tileCentre",t),O.defined(n.id))if(O.string(n.id))this.options.tileId=n.id;else throw O.invalidParameterError("id","string",n.id);if(O.defined(n.basename))if(O.string(n.basename))this.options.tileBasename=n.basename;else throw O.invalidParameterError("basename","string",n.basename)}if(O.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw O.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function $qe(n){if(!O.plainObject(n))throw O.invalidParameterError("options","object",n);if(O.integer(n.seconds)&&O.inRange(n.seconds,0,3600))this.options.timeoutSeconds=n.seconds;else throw O.invalidParameterError("seconds","integer between 0 and 3600",n.seconds);return this}function e4e(n,t){return O.object(t)&&t.force===!1||(this.options.formatOut=n),this}function A4e(n,t){if(O.bool(t))this.options[n]=t;else throw O.invalidParameterError(n,"boolean",t)}function t4e(){if(!this.options.streamOut){this.options.streamOut=!0;let n=Error();this._pipeline(void 0,n)}}function r4e(n,t){return typeof n=="function"?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),Ot.pipeline(this.options,(o,a,e)=>{o?n(O.nativeError(o,t)):n(null,a,e)})}):Ot.pipeline(this.options,(o,a,e)=>{o?n(O.nativeError(o,t)):n(null,a,e)}),this):this.options.streamOut?(this._isStreamInput()?(this.once("finish",()=>{this._flattenBufferIn(),Ot.pipeline(this.options,(o,a,e)=>{o?this.emit("error",O.nativeError(o,t)):(this.emit("info",e),this.push(a)),this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished&&this.emit("finish")):Ot.pipeline(this.options,(o,a,e)=>{o?this.emit("error",O.nativeError(o,t)):(this.emit("info",e),this.push(a)),this.push(null),this.on("end",()=>this.emit("close"))}),this):this._isStreamInput()?new Promise((o,a)=>{this.once("finish",()=>{this._flattenBufferIn(),Ot.pipeline(this.options,(e,i,A)=>{e?a(O.nativeError(e,t)):this.options.resolveWithObject?o({data:i,info:A}):o(i)})})}):new Promise((o,a)=>{Ot.pipeline(this.options,(e,i,A)=>{e?a(O.nativeError(e,t)):this.options.resolveWithObject?o({data:i,info:A}):o(i)})})}var Ire,wqe,lre,pre,dre,hre=ue(()=>{Fs();of();Ire=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),wqe=/\.(jp[2x]|j2[kc])$/i,lre=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),pre=n=>1<<31-Math.clz32(Math.ceil(Math.log2(n)));dre=n=>{Object.assign(n.prototype,{toFile:Dqe,toBuffer:Oqe,toUint8Array:bqe,withDensity:Mqe,keepExif:_qe,withExif:Tqe,withExifMerge:Nqe,keepIccProfile:Rqe,withIccProfile:kqe,keepGainMap:vqe,withGainMap:Pqe,keepXmp:Gqe,withXmp:Fqe,keepMetadata:Lqe,withMetadata:Uqe,toFormat:Hqe,jpeg:Kqe,jp2:Jqe,png:xqe,webp:Yqe,tiff:qqe,avif:zqe,heif:Vqe,jxl:Wqe,gif:jqe,raw:Zqe,tile:Xqe,timeout:$qe,_updateFormatOut:e4e,_setBooleanOption:A4e,_read:t4e,_pipeline:r4e})}});import i4e from"node:events";import{createRequire as a4e}from"node:module";import{availableParallelism as o4e}from"node:os";function ure(n){if(O.bool(n))return n?Ot.cache(50,20,100):Ot.cache(0,0,0);if(O.object(n)){for(let t of["memory","files","items"]){let o=n[t];if(O.defined(o)&&!(O.integer(o)&&o>=0))throw O.invalidParameterError(t,"a positive integer",o)}return Ot.cache(n.memory,n.files,n.items)}else return Ot.cache()}function s4e(n){return Ot.concurrency(O.integer(n)?n:null)}function c4e(){return Ot.counters()}function I4e(n){return Ot.simd(O.bool(n)?n:null)}function l4e(n){if(O.object(n))if(Array.isArray(n.operation)&&n.operation.every(O.string))Ot.block(n.operation,!0);else throw O.invalidParameterError("operation","Array",n.operation);else throw O.invalidParameterError("options","object",n)}function p4e(n){if(O.object(n))if(Array.isArray(n.operation)&&n.operation.every(O.string))Ot.block(n.operation,!1);else throw O.invalidParameterError("operation","Array",n.operation);else throw O.invalidParameterError("options","object",n)}var nf,Q2,Ere,y2,dI,n4e,qh,g4e,Cre,Bre=ue(()=>{nf=ze(WD(),1);Fs();g2();of();cO();Q2=a4e(import.meta.url),Ere=IO.runtimePlatformArch(),y2=Ot.libvipsVersion(),dI=Ot.format();dI.heif.output.alias=["avif","heic"];dI.jpeg.output.alias=["jpe","jpg"];dI.tiff.output.alias=["tif"];dI.jp2.output.alias=["j2c","j2k","jp2","jpx"];n4e={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},qh={vips:y2.semver};if(!y2.isGlobal)if(y2.isWasm)try{qh=Q2("@img/sharp-wasm32/versions")}catch{}else try{qh=Q2(`@img/sharp-${Ere}/versions`)}catch{try{qh=Q2(`@img/sharp-libvips-${Ere}/versions`)}catch{}}qh.sharp=$g.version;qh.heif&&dI.heif&&(dI.heif.input.fileSuffix=[".avif"],dI.heif.output.alias=["avif"]);ure(!0);!process.env.MALLOC_ARENA_MAX&&nf.default.familySync()===nf.default.GLIBC&&!Ot._isUsingJemalloc()?Ot.concurrency(1):nf.default.familySync()===nf.default.MUSL&&Ot.concurrency()===1024&&Ot.concurrency(o4e());g4e=new i4e.EventEmitter;Cre=n=>{n.cache=ure,n.concurrency=s4e,n.counters=c4e,n.simd=I4e,n.format=dI,n.interpolators=n4e,n.versions=qh,n.queue=g4e,n.block=l4e,n.unblock=p4e}});var fre={};Lr(fre,{default:()=>d4e});var d4e,Qre=ue(()=>{vte();Fte();Yte();Jte();Vte();sre();cre();hre();Bre();Gte(xs);xte(xs);jte(xs);zte(xs);nre(xs);gre(xs);dre(xs);Cre(xs);d4e=xs});var h4e,kA,hI,sf=ue(()=>{h4e="End-Of-Stream",kA=class extends Error{constructor(){super(h4e),this.name="EndOfStreamError"}},hI=class extends Error{constructor(t="The operation was aborted"){super(t),this.name="AbortError"}}});var hO,yre=ue(()=>{hO=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise((t,o)=>{this.reject=o,this.resolve=t})}}});var EI,EO=ue(()=>{sf();EI=class{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(t,o=!1){let a=await this.read(t,o);return this.peekQueue.push(t.subarray(0,a)),a}async read(t,o=!1){if(t.length===0)return 0;let a=this.readFromPeekBuffer(t);if(this.endOfStream||(a+=await this.readRemainderFromStream(t.subarray(a),o)),a===0&&!o)throw new kA;return a}readFromPeekBuffer(t){let o=t.length,a=0;for(;this.peekQueue.length>0&&o>0;){let e=this.peekQueue.pop();if(!e)throw new Error("peekData should be defined");let i=Math.min(e.length,o);t.set(e.subarray(0,i),a),a+=i,o-=i,i{sf();yre();EO();gf=class extends EI{constructor(t){if(super(),this.s=t,this.deferred=null,!t.read||!t.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",()=>{this.endOfStream=!0,this.deferred&&this.deferred.resolve(0)}),this.s.once("error",o=>this.reject(o)),this.s.once("close",()=>this.abort())}async readFromStream(t,o){if(t.length===0)return 0;let a=this.s.read(t.length);if(a)return t.set(a),a.length;let e={buffer:t,mayBeLess:o,deferred:new hO};return this.deferred=e.deferred,this.s.once("readable",()=>{this.readDeferred(e)}),e.deferred.promise}readDeferred(t){let o=this.s.read(t.buffer.length);o?(t.buffer.set(o),t.deferred.resolve(o.length),this.deferred=null):this.s.once("readable",()=>{this.readDeferred(t)})}reject(t){this.interrupted=!0,this.deferred&&(this.deferred.reject(t),this.deferred=null)}async abort(){this.reject(new hI)}async close(){return this.abort()}}});var uO,Sre=ue(()=>{EO();uO=class extends EI{constructor(t){super(),this.reader=t}async abort(){return this.close()}async close(){this.reader.releaseLock()}}});var cf,m2=ue(()=>{Sre();cf=class extends uO{async readFromStream(t,o){if(t.length===0)return 0;let a=await this.reader.read(new Uint8Array(t.length),{min:o?void 0:t.length});return a.done&&(this.endOfStream=a.done),a.value?(t.set(a.value),a.value.length):0}}});var zh,S2=ue(()=>{sf();EO();zh=class extends EI{constructor(t){super(),this.reader=t,this.buffer=null}writeChunk(t,o){let a=Math.min(o.length,t.length);return t.set(o.subarray(0,a)),a{m2();S2()});var uI=ue(()=>{sf();mre();m2();S2();wre()});var Zn,Vh=ue(()=>{uI();Zn=class{constructor(t){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=t?.onClose,t?.abortSignal&&t.abortSignal.addEventListener("abort",()=>{this.abort()})}async readToken(t,o=this.position){let a=new Uint8Array(t.len);if(await this.readBuffer(a,{position:o})o)return this.position+=o,o}return this.position+=t,t}async close(){await this.abort(),await this.onClose?.()}normalizeOptions(t,o){if(!this.supportsRandomAccess()&&o&&o.position!==void 0&&o.position{Vh();uI();E4e=256e3,If=class extends Zn{constructor(t,o){super(o),this.streamReader=t,this.fileInfo=o?.fileInfo??{}}async readBuffer(t,o){let a=this.normalizeOptions(t,o),e=a.position-this.position;if(e>0)return await this.ignore(e),this.readBuffer(t,o);if(e<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(a.length===0)return 0;let i=await this.streamReader.read(t.subarray(0,a.length),a.mayBeLess);if(this.position+=i,(!o||!o.mayBeLess)&&i0){let A=new Uint8Array(a.length+i);return e=await this.peekBuffer(A,{mayBeLess:a.mayBeLess}),t.set(A.subarray(i)),e-i}if(i<0)throw new Error("Cannot peek from a negative offset in a stream")}if(a.length>0){try{e=await this.streamReader.peek(t.subarray(0,a.length),a.mayBeLess)}catch(i){if(o?.mayBeLess&&i instanceof kA)return 0;throw i}if(!a.mayBeLess&&e{uI();Vh();CO=class extends Zn{constructor(t,o){super(o),this.uint8Array=t,this.fileInfo={...o?.fileInfo??{},size:t.length}}async readBuffer(t,o){o?.position&&(this.position=o.position);let a=await this.peekBuffer(t,o);return this.position+=a,a}async peekBuffer(t,o){let a=this.normalizeOptions(t,o),e=Math.min(this.uint8Array.length-a.position,a.length);if(!a.mayBeLess&&e{uI();Vh();BO=class extends Zn{constructor(t,o){super(o),this.blob=t,this.fileInfo={...o?.fileInfo??{},size:t.size,mimeType:t.type}}async readBuffer(t,o){o?.position&&(this.position=o.position);let a=await this.peekBuffer(t,o);return this.position+=a,a}async peekBuffer(t,o){let a=this.normalizeOptions(t,o),e=Math.min(this.blob.size-a.position,a.length);if(!a.mayBeLess&&e{if(await o.close(),e)return e()},new If(o,a)}function fO(n,t){let o=w2(n),a=t??{},e=a.onClose;return a.onClose=async()=>{if(await o.close(),e)return e()},new If(o,a)}function Qo(n,t){return new CO(n,t)}function QO(n,t){return new BO(n,t)}var yO=ue(()=>{uI();Dre();Ore();bre();uI();Vh()});import{open as C4e}from"node:fs/promises";var Wh,D2=ue(()=>{Vh();uI();Wh=class n extends Zn{static async fromFile(t){let o=await C4e(t,"r"),a=await o.stat();return new n(o,{fileInfo:{path:t,size:a.size}})}constructor(t,o){super(o),this.fileHandle=t,this.fileInfo=o.fileInfo}async readBuffer(t,o){let a=this.normalizeOptions(t,o);if(this.position=a.position,a.length===0)return 0;let e=await this.fileHandle.read(t,0,a.length,a.position);if(this.position+=e.bytesRead,e.bytesRead{yO();D2();D2();yO();_re=Wh.fromFile});var Tre=ee(b2=>{b2.read=function(n,t,o,a,e){var i,A,r=e*8-a-1,s=(1<>1,c=-7,I=o?e-1:0,p=o?-1:1,B=n[t+I];for(I+=p,i=B&(1<<-c)-1,B>>=-c,c+=r;c>0;i=i*256+n[t+I],I+=p,c-=8);for(A=i&(1<<-c)-1,i>>=-c,c+=a;c>0;A=A*256+n[t+I],I+=p,c-=8);if(i===0)i=1-g;else{if(i===s)return A?NaN:(B?-1:1)*(1/0);A=A+Math.pow(2,a),i=i-g}return(B?-1:1)*A*Math.pow(2,i-a)};b2.write=function(n,t,o,a,e,i){var A,r,s,g=i*8-e-1,c=(1<>1,p=e===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=a?0:i-1,f=a?1:-1,Q=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(r=isNaN(t)?1:0,A=c):(A=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-A))<1&&(A--,s*=2),A+I>=1?t+=p/s:t+=p*Math.pow(2,1-I),t*s>=2&&(A++,s/=2),A+I>=c?(r=0,A=c):A+I>=1?(r=(t*s-1)*Math.pow(2,e),A=A+I):(r=t*Math.pow(2,I-1)*Math.pow(2,e),A=0));e>=8;n[o+B]=r&255,B+=f,r/=256,e-=8);for(A=A<0;n[o+B]=A&255,B+=f,A/=256,g-=8);n[o+B-f]|=Q*128}});function f4e(){if(!(typeof globalThis.TextDecoder>"u"))return mO??(mO=new globalThis.TextDecoder("utf-8"))}function Q4e(){if(!(typeof globalThis.TextEncoder>"u"))return SO??(SO=new globalThis.TextEncoder)}function Tr(n,t="utf-8"){switch(t.toLowerCase()){case"utf-8":case"utf8":{let o=f4e();return o?o.decode(n):m4e(n)}case"utf-16le":return S4e(n);case"us-ascii":case"ascii":return w4e(n);case"latin1":case"iso-8859-1":return D4e(n);case"windows-1252":return O4e(n);default:throw new RangeError(`Encoding '${t}' not supported`)}}function Rre(n="",t="utf-8"){switch(t.toLowerCase()){case"utf-8":case"utf8":{let o=Q4e();return o?o.encode(n):b4e(n)}case"utf-16le":return M4e(n);case"us-ascii":case"ascii":return _4e(n);case"latin1":case"iso-8859-1":return T4e(n);case"windows-1252":return N4e(n);default:throw new RangeError(`Encoding '${t}' not supported`)}}function _2(n,t){t.length!==0&&(n.push(String.fromCharCode.apply(null,t)),t.length=0)}function Pr(n,t,o){t.push(o),t.length>=Zh&&_2(n,t)}function y4e(n,t,o){if(o<=65535){Pr(n,t,o);return}o-=65536,Pr(n,t,55296+(o>>10)),Pr(n,t,56320+(o&1023))}function m4e(n){let t=[],o=[],a=0;for(n.length>=3&&n[0]===239&&n[1]===187&&n[2]===191&&(a=3);a244){Pr(t,o,Fi),a++;continue}if(e<=223){if(a+1>=n.length){Pr(t,o,Fi),a++;continue}let c=n[a+1];if((c&192)!==128){Pr(t,o,Fi),a++;continue}let I=(e&31)<<6|c&63;Pr(t,o,I),a+=2;continue}if(e<=239){if(a+2>=n.length){Pr(t,o,Fi),a++;continue}let c=n[a+1],I=n[a+2];if(!((c&192)===128&&(I&192)===128&&!(e===224&&c<160)&&!(e===237&&c>=160))){Pr(t,o,Fi),a++;continue}let B=(e&15)<<12|(c&63)<<6|I&63;Pr(t,o,B),a+=3;continue}if(a+3>=n.length){Pr(t,o,Fi),a++;continue}let i=n[a+1],A=n[a+2],r=n[a+3];if(!((i&192)===128&&(A&192)===128&&(r&192)===128&&!(e===240&&i<144)&&!(e===244&&i>143))){Pr(t,o,Fi),a++;continue}let g=(e&7)<<18|(i&63)<<12|(A&63)<<6|r&63;y4e(t,o,g),a+=4}return _2(t,o),t.join("")}function S4e(n){let t=[],o=[],a=n.length,e=0;for(;e+1=55296&&i<=56319){if(e+1=56320&&A<=57343?(Pr(t,o,i),Pr(t,o,A),e+=2):Pr(t,o,Fi)}else Pr(t,o,Fi);continue}if(i>=56320&&i<=57343){Pr(t,o,Fi);continue}Pr(t,o,i)}return e=128&&e<=159?Nre[e]:void 0;o+=i??String.fromCharCode(e),o.length>=Zh&&(t.push(o),o="")}return o&&t.push(o),t.join("")}function b4e(n){let t=[];for(let o=0;o=55296&&a<=56319)if(o+1=56320&&e<=57343?(a=65536+(a-55296<<10)+(e-56320),o++):a=Fi}else a=Fi;else a>=56320&&a<=57343&&(a=Fi);a<128?t.push(a):a<2048?t.push(192|a>>6,128|a&63):a<65536?t.push(224|a>>12,128|a>>6&63,128|a&63):t.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|a&63)}return new Uint8Array(t)}function M4e(n){let t=[];for(let a=0;a=55296&&e<=56319){if(a+1=56320&&i<=57343?(t.push(e,i),a++):t.push(Fi)}else t.push(Fi);continue}if(e>=56320&&e<=57343){t.push(Fi);continue}t.push(e)}let o=new Uint8Array(t.length*2);for(let a=0;a>>8}return o}function _4e(n){let t=new Uint8Array(n.length);for(let o=0;o=0&&e<=127||e>=160&&e<=255){t[o]=e;continue}t[o]=63}return t}var Nre,M2,mO,SO,Zh,Fi,js=ue(()=>{Nre={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},M2={};for(let[n,t]of Object.entries(Nre))M2[t]=Number.parseInt(n,10);Zh=32*1024,Fi=65533});var VA={};Lr(VA,{AnsiStringType:()=>N2,Float16_BE:()=>v4e,Float16_LE:()=>P4e,Float32_BE:()=>k2,Float32_LE:()=>G4e,Float64_BE:()=>DO,Float64_LE:()=>F4e,Float80_BE:()=>L4e,Float80_LE:()=>U4e,INT16_BE:()=>on,INT16_LE:()=>R4e,INT24_BE:()=>wO,INT24_LE:()=>k4e,INT32_BE:()=>Qa,INT32_LE:()=>ur,INT64_BE:()=>R2,INT64_LE:()=>df,INT8:()=>qs,IgnoreType:()=>T2,StringType:()=>We,UINT16_BE:()=>LA,UINT16_LE:()=>SA,UINT24_BE:()=>Gr,UINT24_LE:()=>pf,UINT32_BE:()=>xe,UINT32_LE:()=>Le,UINT64_BE:()=>zs,UINT64_LE:()=>Fr,UINT8:()=>QA,Uint8ArrayType:()=>Mt});function zA(n){return new DataView(n.buffer,n.byteOffset)}var Js,QA,SA,LA,pf,Gr,Le,xe,qs,on,R4e,k4e,wO,Qa,ur,Fr,df,zs,R2,v4e,P4e,k2,G4e,DO,F4e,L4e,U4e,T2,Mt,We,N2,DA=ue(()=>{Js=ze(Tre(),1);js();QA={len:1,get(n,t){return zA(n).getUint8(t)},put(n,t,o){return zA(n).setUint8(t,o),t+1}},SA={len:2,get(n,t){return zA(n).getUint16(t,!0)},put(n,t,o){return zA(n).setUint16(t,o,!0),t+2}},LA={len:2,get(n,t){return zA(n).getUint16(t)},put(n,t,o){return zA(n).setUint16(t,o),t+2}},pf={len:3,get(n,t){let o=zA(n);return o.getUint8(t)+(o.getUint16(t+1,!0)<<8)},put(n,t,o){let a=zA(n);return a.setUint8(t,o&255),a.setUint16(t+1,o>>8,!0),t+3}},Gr={len:3,get(n,t){let o=zA(n);return(o.getUint16(t)<<8)+o.getUint8(t+2)},put(n,t,o){let a=zA(n);return a.setUint16(t,o>>8),a.setUint8(t+2,o&255),t+3}},Le={len:4,get(n,t){return zA(n).getUint32(t,!0)},put(n,t,o){return zA(n).setUint32(t,o,!0),t+4}},xe={len:4,get(n,t){return zA(n).getUint32(t)},put(n,t,o){return zA(n).setUint32(t,o),t+4}},qs={len:1,get(n,t){return zA(n).getInt8(t)},put(n,t,o){return zA(n).setInt8(t,o),t+1}},on={len:2,get(n,t){return zA(n).getInt16(t)},put(n,t,o){return zA(n).setInt16(t,o),t+2}},R4e={len:2,get(n,t){return zA(n).getInt16(t,!0)},put(n,t,o){return zA(n).setInt16(t,o,!0),t+2}},k4e={len:3,get(n,t){let o=pf.get(n,t);return o>8388607?o-16777216:o},put(n,t,o){let a=zA(n);return a.setUint8(t,o&255),a.setUint16(t+1,o>>8,!0),t+3}},wO={len:3,get(n,t){let o=Gr.get(n,t);return o>8388607?o-16777216:o},put(n,t,o){let a=zA(n);return a.setUint16(t,o>>8),a.setUint8(t+2,o&255),t+3}},Qa={len:4,get(n,t){return zA(n).getInt32(t)},put(n,t,o){return zA(n).setInt32(t,o),t+4}},ur={len:4,get(n,t){return zA(n).getInt32(t,!0)},put(n,t,o){return zA(n).setInt32(t,o,!0),t+4}},Fr={len:8,get(n,t){return zA(n).getBigUint64(t,!0)},put(n,t,o){return zA(n).setBigUint64(t,o,!0),t+8}},df={len:8,get(n,t){return zA(n).getBigInt64(t,!0)},put(n,t,o){return zA(n).setBigInt64(t,o,!0),t+8}},zs={len:8,get(n,t){return zA(n).getBigUint64(t)},put(n,t,o){return zA(n).setBigUint64(t,o),t+8}},R2={len:8,get(n,t){return zA(n).getBigInt64(t)},put(n,t,o){return zA(n).setBigInt64(t,o),t+8}},v4e={len:2,get(n,t){return Js.read(n,t,!1,10,this.len)},put(n,t,o){return Js.write(n,o,t,!1,10,this.len),t+this.len}},P4e={len:2,get(n,t){return Js.read(n,t,!0,10,this.len)},put(n,t,o){return Js.write(n,o,t,!0,10,this.len),t+this.len}},k2={len:4,get(n,t){return zA(n).getFloat32(t)},put(n,t,o){return zA(n).setFloat32(t,o),t+4}},G4e={len:4,get(n,t){return zA(n).getFloat32(t,!0)},put(n,t,o){return zA(n).setFloat32(t,o,!0),t+4}},DO={len:8,get(n,t){return zA(n).getFloat64(t)},put(n,t,o){return zA(n).setFloat64(t,o),t+8}},F4e={len:8,get(n,t){return zA(n).getFloat64(t,!0)},put(n,t,o){return zA(n).setFloat64(t,o,!0),t+8}},L4e={len:10,get(n,t){return Js.read(n,t,!1,63,this.len)},put(n,t,o){return Js.write(n,o,t,!1,63,this.len),t+this.len}},U4e={len:10,get(n,t){return Js.read(n,t,!0,63,this.len)},put(n,t,o){return Js.write(n,o,t,!0,63,this.len),t+this.len}},T2=class{constructor(t){this.len=t}get(t,o){}},Mt=class{constructor(t){this.len=t}get(t,o){return t.subarray(o,o+this.len)}},We=class{constructor(t,o){this.len=t,this.encoding=o}get(t,o=0){let a=t.subarray(o,o+this.len);return Tr(a,this.encoding)}},N2=class extends We{constructor(t){super(t,"windows-1252")}}});var $l,v2,kre,vre,Pre,Gre=ue(()=>{DA();$l={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},v2={get(n){return{signature:Le.get(n,0),compressedSize:Le.get(n,8),uncompressedSize:Le.get(n,12)}},len:16},kre={get(n){let t=SA.get(n,6);return{signature:Le.get(n,0),minVersion:SA.get(n,4),dataDescriptor:!!(t&8),compressedMethod:SA.get(n,8),compressedSize:Le.get(n,18),uncompressedSize:Le.get(n,22),filenameLength:SA.get(n,26),extraFieldLength:SA.get(n,28),filename:null}},len:30},vre={get(n){return{signature:Le.get(n,0),nrOfThisDisk:SA.get(n,4),nrOfThisDiskWithTheStart:SA.get(n,6),nrOfEntriesOnThisDisk:SA.get(n,8),nrOfEntriesOfSize:SA.get(n,10),sizeOfCd:Le.get(n,12),offsetOfStartOfCd:Le.get(n,16),zipFileCommentLength:SA.get(n,20)}},len:22},Pre={get(n){let t=SA.get(n,8);return{signature:Le.get(n,0),minVersion:SA.get(n,6),dataDescriptor:!!(t&8),compressedMethod:SA.get(n,10),compressedSize:Le.get(n,20),uncompressedSize:Le.get(n,24),filenameLength:SA.get(n,28),extraFieldLength:SA.get(n,30),fileCommentLength:SA.get(n,32),relativeOffsetOfLocalHeader:Le.get(n,42),filename:null}},len:46}});function Lre(n){let t=new Uint8Array(Le.len);return Le.put(t,0,n),t}function K4e(n,t){let o=n.length,a=t.length;if(a>o)return-1;for(let e=0;e<=o-a;e++){let i=!0;for(let A=0;Ae+i.length,0),o=new Uint8Array(t),a=0;for(let e of n)o.set(e,a),a+=e.length;return o}var Fre,Vs,P2,H4e,OO,ep,Ure=ue(()=>{DA();Fre=ze(lt(),1);Gre();Vs=(0,Fre.default)("tokenizer:inflate"),P2=256*1024,H4e=Lre($l.DataDescriptor),OO=Lre($l.EndOfCentralDirectory),ep=class n{constructor(t){this.tokenizer=t,this.syncBuffer=new Uint8Array(P2)}async isZip(){return await this.peekSignature()===$l.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(Le)}async findEndOfCentralDirectoryLocator(){let t=this.tokenizer,o=Math.min(16*1024,t.fileInfo.size),a=this.syncBuffer.subarray(0,o);await this.tokenizer.readBuffer(a,{position:t.fileInfo.size-o});for(let e=a.length-4;e>=0;e--)if(a[e]===OO[0]&&a[e+1]===OO[1]&&a[e+2]===OO[2]&&a[e+3]===OO[3])return t.fileInfo.size-o+e;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){Vs("Cannot reading central-directory without random-read support");return}Vs("Reading central-directory...");let t=this.tokenizer.position,o=await this.findEndOfCentralDirectoryLocator();if(o>0){Vs("Central-directory 32-bit signature found");let a=await this.tokenizer.readToken(vre,o),e=[];this.tokenizer.setPosition(a.offsetOfStartOfCd);for(let i=0;i=0?g:s;if(i.handler){let I=new Uint8Array(c);await this.tokenizer.readBuffer(I),r.push(I)}else await this.tokenizer.ignore(c)}Vs(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),i.handler&&await this.inflate(e,x4e(r),i.handler)}else i.handler?(Vs(`Reading compressed-file-data: ${e.compressedSize} bytes`),A=new Uint8Array(e.compressedSize),await this.tokenizer.readBuffer(A),await this.inflate(e,A,i.handler)):(Vs(`Ignoring compressed-file-data: ${e.compressedSize} bytes`),await this.tokenizer.ignore(e.compressedSize));if(Vs(`Reading data-descriptor at pos=${this.tokenizer.position}`),e.dataDescriptor&&(await this.tokenizer.readToken(v2)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-v2.len}`)}while(!a)}async iterateOverCentralDirectory(t,o){for(let a of t){let e=o(a);if(e.handler){this.tokenizer.setPosition(a.relativeOffsetOfLocalHeader);let i=await this.readLocalFileHeader();if(i){await this.tokenizer.ignore(i.extraFieldLength);let A=new Uint8Array(a.compressedSize);await this.tokenizer.readBuffer(A),await this.inflate(i,A,e.handler)}}if(e.stop)break}}async inflate(t,o,a){if(t.compressedMethod===0)return a(o);if(t.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${t.compressedMethod}`);Vs(`Decompress filename=${t.filename}, compressed-size=${o.length}`);let e=await n.decompressDeflateRaw(o);return a(e)}static async decompressDeflateRaw(t){let o=new ReadableStream({start(i){i.enqueue(t),i.close()}}),a=new DecompressionStream("deflate-raw"),e=o.pipeThrough(a);try{let A=await new Response(e).arrayBuffer();return new Uint8Array(A)}catch(i){let A=i instanceof Error?`Failed to deflate ZIP entry: ${i.message}`:"Unknown decompression error in ZIP entry";throw new TypeError(A)}}async readLocalFileHeader(){let t=await this.tokenizer.peekToken(Le);if(t===$l.LocalFileHeader){let o=await this.tokenizer.readToken(kre);return o.filename=await this.tokenizer.readToken(new We(o.filenameLength,"utf-8")),o}if(t===$l.CentralFileHeader)return!1;throw t===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}}});var hf,Hre=ue(()=>{hf=class{constructor(t){this.tokenizer=t}inflate(){let t=this.tokenizer;return new ReadableStream({async pull(o){let a=new Uint8Array(1024),e=await t.readBuffer(a,{mayBeLess:!0});if(e===0){o.close();return}o.enqueue(a.subarray(0,e))}}).pipeThrough(new DecompressionStream("gzip"))}}});var Kre=ue(()=>{Ure();Hre()});function J4e(n,t,o){return n?n.constructor===t?!0:Y4e.call(n)===o:!1}function q4e(n){return J4e(n,Uint8Array,j4e)}function z4e(n){if(!q4e(n))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof n}\``)}function bO(n){z4e(n);let t="";for(let o=0;o{Y4e=Object.prototype.toString,j4e="[object Uint8Array]";RbA={utf8:new globalThis.TextDecoder("utf8")},kbA=new globalThis.TextEncoder,V4e=Array.from({length:256},(n,t)=>t.toString(16).padStart(2,"0"))});function xre(n,t){if(t==="utf-16le"){let o=[];for(let a=0;a>8&255)}return o}if(t==="utf-16be"){let o=[];for(let a=0;a>8&255,e&255)}return o}return[...n].map(o=>o.charCodeAt(0))}function Yre(n,t=0){let o=Number.parseInt(new We(6).get(n,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(o))return!1;let a=256;for(let e=t;e{DA();jre={get:(n,t)=>n[t+3]&127|n[t+2]<<7|n[t+1]<<14|n[t]<<21,len:4}});var qre,zre,Vre=ue(()=>{qre=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","jmp","rm","sav","ppsm","ppsx","tar.gz","reg","dat"],zre=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia","application/x-spss-sav","application/x-ms-regedit","application/x-ft-windows-registry-hive","application/x-jmp-data"]});function g8e(n){let t=n?.streamReader;if(t?.constructor?.name!=="WebStreamByobReader")return n;let{reader:o}=t,a=async()=>{await o.cancel(),o.releaseLock()};return t.close=a,t.abort=async()=>{t.interrupted=!0,await a()},n}function U2(n,t,o){if(!Number.isFinite(n)||n<0||n>t)throw new tc(`${o} has invalid size ${n} (maximum ${t} bytes)`);return n}async function CI(n,t,{maximumLength:o=nn,reason:a="skip"}={}){let e=U2(t,o,a);await n.ignore(e)}async function F2(n,t,o,{maximumLength:a=t.length,reason:e="read"}={}){let i=o?.length??t.length,A=U2(i,a,e);return n.readBuffer(t,{...o,length:A})}async function c8e(n,{maximumLength:t=Zs}={}){let e=new ReadableStream({start(g){g.enqueue(n),g.close()}}).pipeThrough(new DecompressionStream("deflate-raw")).getReader(),i=[],A=0;try{for(;;){let{done:g,value:c}=await e.read();if(g)break;if(A+=c.length,A>t)throw await e.cancel(),new Error(`ZIP entry decompressed data exceeds ${t} bytes`);i.push(c)}}finally{e.releaseLock()}let r=new Uint8Array(A),s=0;for(let g of i)r.set(g,s),s+=g.length;return r}function l8e(n,t){if(n.length=0?0:r===e?Math.min(I8e,r-1):0,c=s>=0?s:r-g;if(c===0)break;if(A+=c,A>o)throw new Error(`ZIP entry compressed data exceeds ${o} bytes`);if(t){let I=new Uint8Array(c);await n.tokenizer.readBuffer(I),i.push(I)}else await n.tokenizer.ignore(c);if(s>=0)break}if(ya(n.tokenizer)||(n.knownSizeDescriptorScannedBytes+=A),!!t)return d8e(i,A)}function E8e(n,t){return ya(n.tokenizer)?Math.max(0,nn-(n.tokenizer.position-t)):Math.max(0,Zs-n.knownSizeDescriptorScannedBytes)}async function u8e(n,t,{shouldBuffer:o,maximumDescriptorLength:a=Zs}={}){if(t.dataDescriptor&&t.compressedSize===0)return h8e(n,{shouldBuffer:o,maximumLength:a});if(!o){await CI(n.tokenizer,t.compressedSize,{maximumLength:ya(n.tokenizer)?Zs:n.tokenizer.fileInfo.size,reason:"ZIP entry compressed data"});return}let e=m8e(n.tokenizer);if(!Number.isFinite(t.compressedSize)||t.compressedSize<0||t.compressedSize>e)throw new Error(`ZIP entry compressed data exceeds ${e} bytes`);let i=new Uint8Array(t.compressedSize);return await n.tokenizer.readBuffer(i),i}function C8e(n,t){let o=n.getReader(),a=0,e=!1,i=!1,A=async r=>{e||i||(i=!0,await o.cancel(r))};return new ReadableStream({async pull(r){if(a>=t){r.close(),await A();return}let{done:s,value:g}=await o.read();if(s||!g){e=!0,r.close();return}let c=t-a;if(g.length>c){r.enqueue(g.subarray(0,c)),a+=c,r.close(),await A();return}r.enqueue(g),a+=g.length},async cancel(r){await A(r)}})}async function ff(n,t){return new L2(t).fromBuffer(n)}function aie(n){switch(n=n.toLowerCase(),n){case"application/epub+zip":return{ext:"epub",mime:n};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:n};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:n};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:n};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:n};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:n};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:n};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:n};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:n};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:n};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:n};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:n};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:n};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:n};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:n};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:n};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"};default:}}function Ws(n,t,o){o={offset:0,...o};for(let[a,e]of t.entries())if(o.mask){if(e!==(o.mask[a]&n[a+o.offset]))return!1}else if(e!==n[a+o.offset])return!1;return!0}function B8e(n){return Number.isFinite(n)?Math.max(1,Math.trunc(n)):Cf}function f8e(n,t,o){return o===void 0?n.read(t):(o.throwIfAborted(),new Promise((a,e)=>{let i=()=>{o.removeEventListener("abort",A)},A=()=>{let r=o.reason;i(),(async()=>{try{await n.cancel(r)}catch{}})(),e(r)};o.addEventListener("abort",A,{once:!0}),(async()=>{try{let r=await n.read(t);i(),a(r)}catch(r){i(),e(r)}})()}))}function Q8e(n){return Number.isFinite(n)?Math.max(0,Math.min(W4e,Math.trunc(n))):0}function y8e(n){return Number.isFinite(n)?Math.max(0,n):Number.MAX_SAFE_INTEGER}function ya(n){let t=n.fileInfo.size;return!Number.isFinite(t)||t===Number.MAX_SAFE_INTEGER}function Bf(n,t,o){return ya(n)&&n.position-t>o}function m8e(n){let t=n.fileInfo.size,o=Number.isFinite(t)?Math.max(0,t-n.position):Number.MAX_SAFE_INTEGER;return Math.min(o,Z4e)}function S8e(n){if(n instanceof kA||n instanceof tc)return!0;if(!(n instanceof Error))return!1;if(o8e.has(n.message)||s8e.has(n.code))return!0;for(let t of n8e)if(n.message.startsWith(t))return!0;return!1}function oie(n,t=Zs){let o=[n.compressedSize,n.uncompressedSize];for(let a of o)if(!Number.isFinite(a)||a<0||a>t)return!1;return!0}function w8e(){return{hasContentTypesEntry:!1,hasParsedContentTypesEntry:!1,isParsingContentTypes:!1,hasUnparseableContentTypes:!1,hasWordDirectory:!1,hasPresentationDirectory:!1,hasSpreadsheetDirectory:!1,hasThreeDimensionalModelEntry:!1}}function D8e(n,t){t.startsWith("word/")&&(n.hasWordDirectory=!0),t.startsWith("ppt/")&&(n.hasPresentationDirectory=!0),t.startsWith("xl/")&&(n.hasSpreadsheetDirectory=!0),t.startsWith("3D/")&&t.endsWith(".model")&&(n.hasThreeDimensionalModelEntry=!0)}function nie(n){if(!(!n.hasContentTypesEntry||n.hasUnparseableContentTypes||n.isParsingContentTypes||n.hasParsedContentTypesEntry)){if(n.hasWordDirectory)return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};if(n.hasPresentationDirectory)return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};if(n.hasSpreadsheetDirectory)return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(n.hasThreeDimensionalModelEntry)return{ext:"3mf",mime:"model/3mf"}}}function O8e(n){let t=n.indexOf('.main+xml"');if(t===-1){let e="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";return n.includes(`ContentType="${e}"`)?e:void 0}let o=n.slice(0,t),a=o.lastIndexOf('"');return o.slice(a+1)}var Cf,W4e,Zs,Wre,Z4e,nn,_O,Zre,X4e,$4e,Xre,G2,$re,eie,e8e,A8e,t8e,r8e,i8e,Aie,tie,rie,a8e,iie,o8e,n8e,s8e,tc,sie,MO,I8e,L2,b8e,M8e,gie=ue(()=>{DA();yO();Kre();uf();Jre();Vre();Cf=4100,W4e=Cf-2,Zs=1024*1024,Wre=1024,Z4e=2**31-1,nn=16*1024*1024,_O=Zs,Zre=Zs,X4e=nn,$4e=1,Xre=100,G2=nn,$re=64,eie=_O,e8e=256,A8e=512,t8e=nn,r8e=512,i8e=512,Aie=256,tie=_O,rie=_O,a8e=_O,iie=nn,o8e=new Set(["Unexpected signature","Encrypted ZIP","Expected Central-File-Header signature"]),n8e=["ZIP entry count exceeds ","Unsupported ZIP compression method:","ZIP entry compressed data exceeds ","ZIP entry decompressed data exceeds ","Expected data-descriptor-signature at position "],s8e=new Set(["Z_BUF_ERROR","Z_DATA_ERROR","ERR_INVALID_STATE"]),tc=class extends Error{};sie=134695760,MO=16,I8e=MO-1;ep.prototype.inflate=async function(n,t,o){if(n.compressedMethod===0)return o(t);if(n.compressedMethod!==8)throw new Error(`Unsupported ZIP compression method: ${n.compressedMethod}`);let a=await c8e(t,{maximumLength:Zs});return o(a)};ep.prototype.unzip=async function(n){let t=!1,o=0,a=this.tokenizer.position;this.knownSizeDescriptorScannedBytes=0;do{if(Bf(this.tokenizer,a,nn))throw new tc(`ZIP stream probing exceeds ${nn} bytes`);let e=await this.readLocalFileHeader();if(!e)break;if(o++,o>Wre)throw new Error(`ZIP entry count exceeds ${Wre}`);let i=n(e);t=!!i.stop,await this.tokenizer.ignore(e.extraFieldLength);let A=await u8e(this,e,{shouldBuffer:!!i.handler,maximumDescriptorLength:Math.min(Zs,E8e(this,a))});if(i.handler&&await this.inflate(e,A,i.handler),e.dataDescriptor){let r=new Uint8Array(MO);if(await this.tokenizer.readBuffer(r),Le.get(r,0)!==sie)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-r.length}`)}if(Bf(this.tokenizer,a,nn))throw new tc(`ZIP stream probing exceeds ${nn} bytes`)}while(!t)};L2=class n{constructor(t){let o=Q8e(t?.mpegOffsetTolerance);this.options={...t,mpegOffsetTolerance:o},this.detectors=[...this.options.customDetectors??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:this.options.signal},this.gzipProbeDepth=0}getTokenizerOptions(){return{...this.tokenizerOptions}}createTokenizerFromWebStream(t){return g8e(fO(t,this.getTokenizerOptions()))}async parseTokenizer(t,o=0){this.detectionReentryCount=o;let a=t.position;for(let e of this.detectors){let i;try{i=await e.detect(t)}catch(A){if(A instanceof kA||A instanceof tc)return;throw A}if(i)return i;if(a!==t.position)return}}async fromTokenizer(t){try{return await this.parseTokenizer(t)}finally{await t.close()}}async fromBuffer(t){if(!(t instanceof Uint8Array||t instanceof ArrayBuffer))throw new TypeError(`Expected the \`input\` argument to be of type \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``);let o=t instanceof Uint8Array?t:new Uint8Array(t);if(o?.length>1)return this.fromTokenizer(Qo(o,this.getTokenizerOptions()))}async fromBlob(t){this.options.signal?.throwIfAborted();let o=QO(t,this.getTokenizerOptions());return this.fromTokenizer(o)}async fromStream(t){this.options.signal?.throwIfAborted();let o=this.createTokenizerFromWebStream(t);return this.fromTokenizer(o)}async toDetectionStream(t,o){let a=B8e(o?.sampleSize??Cf),e,i,A=t.getReader({mode:"byob"});try{let{value:g,done:c}=await f8e(A,new Uint8Array(a),this.options.signal);if(i=g,!c&&g)try{e=await this.fromBuffer(g.subarray(0,a))}catch(I){if(!(I instanceof kA))throw I;e=void 0}i=g}finally{A.releaseLock()}let r=new TransformStream({async start(g){g.enqueue(i)},transform(g,c){c.enqueue(g)}}),s=t.pipeThrough(r);return s.fileType=e,s}async detectGzip(t){if(this.gzipProbeDepth>=$4e)return{ext:"gz",mime:"application/gzip"};let o=new hf(t),a=C8e(o.inflate(),X4e),e=ya(t),i,A,r,s;if(e){let g=new AbortController;i=setTimeout(()=>{g.abort(new DOMException(`Operation timed out after ${Xre} ms`,"TimeoutError"))},Xre),A=this.options.signal===void 0?g.signal:AbortSignal.any([this.options.signal,g.signal]),r=new n({...this.options,signal:A}),r.gzipProbeDepth=this.gzipProbeDepth+1}else this.gzipProbeDepth++;try{s=await(r??this).fromStream(a)}catch(g){if(g?.name==="AbortError"&&A?.reason?.name!=="TimeoutError")throw g}finally{clearTimeout(i),e||this.gzipProbeDepth--}return s?.ext==="tar"?{ext:"tar.gz",mime:"application/gzip"}:{ext:"gz",mime:"application/gzip"}}check(t,o){return Ws(this.buffer,t,o)}checkString(t,o){return this.check(xre(t,o?.encoding),o)}detectConfident=async t=>{if(this.buffer=new Uint8Array(Cf),t.fileInfo.size===void 0&&(t.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=t,ya(t)&&(await t.peekBuffer(this.buffer,{length:3,mayBeLess:!0}),this.check([31,139,8])))return this.detectGzip(t);if(await t.peekBuffer(this.buffer,{length:32,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await t.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.detectionReentryCount>=Aie?void 0:(this.detectionReentryCount++,await this.tokenizer.ignore(3),this.detectConfident(t));if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return this.detectGzip(t);if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await CI(t,6,{maximumLength:6,reason:"ID3 header prefix"});let o=await t.readToken(jre),a=ya(t);if(!Number.isFinite(o)||o<0||a&&(o>G2||t.position+o>G2))return;if(t.position+o>t.fileInfo.size)return a?void 0:{ext:"mp3",mime:"audio/mpeg"};try{await CI(t,o,{maximumLength:a?G2:t.fileInfo.size,reason:"ID3 payload"})}catch(e){if(e instanceof kA)return;throw e}return this.detectionReentryCount>=Aie?void 0:(this.detectionReentryCount++,this.parseTokenizer(t,this.detectionReentryCount))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let o,a=w8e();try{await new ep(t).unzip(e=>{D8e(a,e.filename);let i=e.filename==="[Content_Types].xml",A=nie(a);if(!i&&A)return o=A,{stop:!0};switch(e.filename){case"META-INF/mozilla.rsa":return o={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return o={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return oie(e,Zre)?{async handler(r){let s=new TextDecoder("utf-8").decode(r).trim();o=aie(s)},stop:!0}:{};case"[Content_Types].xml":return a.hasContentTypesEntry=!0,oie(e,Zre)?(a.isParsingContentTypes=!0,{async handler(r){let s=new TextDecoder("utf-8").decode(r),g=O8e(s);g&&(o=aie(g)),a.hasParsedContentTypesEntry=!0,a.isParsingContentTypes=!1},stop:!0}):(a.hasUnparseableContentTypes=!0,{});default:return/classes\d*\.dex/.test(e.filename)?(o={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}})}catch(e){if(!S8e(e))throw e;a.isParsingContentTypes&&(a.isParsingContentTypes=!1,a.hasUnparseableContentTypes=!0)}return o??nie(a)??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await t.ignore(28);let o=new Uint8Array(8);return await t.readBuffer(o),Ws(o,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:Ws(o,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:Ws(o,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:Ws(o,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:Ws(o,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:Ws(o,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){let o=await this.readTiffHeader(!1);if(o)return o}if(this.check([77,77])){let o=await this.readTiffHeader(!0);if(o)return o}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function o(){let s=await t.peekNumber(QA),g=128,c=0;for(;(s&g)===0&&g!==0;)++c,g>>=1;let I=new Uint8Array(c+1);return await F2(t,I,void 0,{maximumLength:I.length,reason:"EBML field"}),I}async function a(){let s=await o(),g=await o();g[0]^=128>>g.length-1;let c=Math.min(6,g.length),I=new DataView(s.buffer),p=new DataView(g.buffer,g.length-c,c);return{id:Ef(I),len:Ef(p)}}async function e(s){let g=0;for(;s>0;){if(g++,g>e8e||Bf(t,A,nn))return;let c=t.position,I=await a();if(I.id===17026){if(I.len>$re)return;let p=U2(I.len,$re,"EBML DocType");return(await t.readToken(new We(p))).replaceAll(/\00.*$/g,"")}if(ya(t)&&(!Number.isFinite(I.len)||I.len<0||I.len>eie)||(await CI(t,I.len,{maximumLength:ya(t)?eie:t.fileInfo.size,reason:"EBML payload"}),--s,t.position<=c))return}}let i=await a(),A=t.position;switch(await e(i.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([254,237,250,206])||this.check([254,237,250,207])||this.check([206,250,237,254])||this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.checkString("regf"))return{ext:"dat",mime:"application/x-ft-windows-registry-hive"};if(this.checkString("$FL2")||this.checkString("$FL3"))return{ext:"sav",mime:"application/x-spss-sav"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190])){let o=xe.get(this.buffer,4),a=LA.get(this.buffer,6);if(o>0&&o<=30)return{ext:"macho",mime:"application/x-mach-binary"};if(a>30)return{ext:"class",mime:"application/java-vm"}}if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("=1e3&&o<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!"))return await t.ignore(8),await t.readToken(new We(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[` `,"\r"," "," ","\0"].some(o=>this.checkString(o,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){let o={ext:"png",mime:"image/png"},a={ext:"apng",mime:"image/apng"};await t.ignore(8);async function e(){return{length:await t.readToken(Qa),type:await t.readToken(new We(4,"latin1"))}}let i=ya(t),A=t.position,r=0,s=!1;do{if(r++,r>A8e||Bf(t,A,t8e))break;let g=t.position,c=await e();if(c.length<0)return;if(c.type==="IHDR"){if(c.length!==13)return;s=!0}switch(c.type){case"IDAT":return o;case"acTL":return a;default:if(!s&&c.type!=="CgBI")return;if(i&&c.length>tie)return s&&p8e(c.type)?o:void 0;try{await CI(t,c.length+4,{maximumLength:i?tie+4:t.fileInfo.size,reason:"PNG chunk payload"})}catch(I){if(!i&&(I instanceof tc||I instanceof kA))return o;throw I}}if(t.position<=g)break}while(t.position+8r8e||Bf(t,i,nn)));){let r=t.position,s=await a(),g=s.size-24;if(!Number.isFinite(g)||g<0){o=!0;break}if(Ws(s.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){let c=new Uint8Array(16);if(g-=await F2(t,c,void 0,{maximumLength:c.length,reason:"ASF stream type GUID"}),Ws(c,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(Ws(c,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}if(e&&g>rie){o=!0;break}if(await CI(t,g,{maximumLength:e?rie:t.fileInfo.size,reason:"ASF header payload"}),t.position<=r){o=!0;break}}}catch(a){if(a instanceof kA||a instanceof tc)ya(t)&&(o=!0);else throw a}return o?void 0:{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await t.ignore(20),await t.readToken(new We(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.checkString("=16){let o=new DataView(this.buffer.buffer).getUint32(12,!0);if(o>12&&this.buffer.length>=o+16)try{let a=new TextDecoder().decode(this.buffer.subarray(16,o+16));if(JSON.parse(a).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(this.check([255,255,0,0,7,0,0,0,4,0,0,0,1,0,1,0])||this.check([0,0,255,255,0,0,0,7,0,0,0,4,0,1,0,1]))return{ext:"jmp",mime:"application/x-jmp-data"};if(await t.peekBuffer(this.buffer,{length:Math.min(512,t.fileInfo.size),mayBeLess:!0}),this.checkString("ustar",{offset:257})&&(this.checkString("\0",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&Yre(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254])){let o="utf-16le";return this.checkString("{this.buffer=new Uint8Array(Cf);let o=y8e(t.fileInfo.size);if(await t.peekBuffer(this.buffer,{length:Math.min(8,o),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await t.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,o),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let a=0;a<=this.options.mpegOffsetTolerance;++a){let e=this.scanMpeg(a);if(e)return e}};async readTiffTag(t){let o=await this.tokenizer.readToken(t?LA:SA);switch(await this.tokenizer.ignore(10),o){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(t){let o=await this.tokenizer.readToken(t?LA:SA);if(!(o>i8e)&&!(ya(this.tokenizer)&&2+o*12>iie))for(let a=0;a=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(e>=8){let r=(t?LA:SA).get(this.buffer,8),s=(t?LA:SA).get(this.buffer,10);if(r===28&&s===254||r===31&&s===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(ya(this.tokenizer)&&e>a8e)return o;let i=ya(this.tokenizer)?iie:this.tokenizer.fileInfo.size;try{await CI(this.tokenizer,e,{maximumLength:i,reason:"TIFF IFD offset"})}catch(r){if(r instanceof kA)return;throw r}let A;try{A=await this.readTiffIFD(t)}catch(r){if(r instanceof kA)return;throw r}return A??o}if(a===43)return o}scanMpeg(t){if(this.check([255,224],{offset:t,mask:[255,224]})){if(this.check([16],{offset:t+1,mask:[22]}))return this.check([8],{offset:t+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:t+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:t+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:t+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},b8e=new Set(qre),M8e=new Set(zre)});var H2=ue(()=>{an();gie()});var Eie=ee(TO=>{"use strict";Object.defineProperty(TO,"__esModule",{value:!0});TO.format=R8e;TO.parse=k8e;var _8e=/^[\u0009\u0020-\u007e\u0080-\u00ff]*$/,Iie=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,T8e=/[\\"]/g,N8e=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,lie=(()=>{let n=function(){};return n.prototype=Object.create(null),n})();function R8e(n){let{type:t,parameters:o}=n;if(!t||!N8e.test(t))throw new TypeError(`Invalid type: ${t}`);let a=t;if(o)for(let e of Object.keys(o)){if(!Iie.test(e))throw new TypeError(`Invalid parameter name: ${e}`);a+=`; ${e}=${L8e(o[e])}`}return a}function k8e(n,t){let o=t?.comma===!0?G8e:65536,a=n.length,e=x2(n,t?.start??0,a),i=e;e=K2(n,e,a,o);let A=Y2(n,i,e),r=n.slice(i,A).toLowerCase();return t?.parameters===!1?{type:r,index:e,parameters:new lie}:F8e(n,r,e,a,o)}var pie=32,die=9,hie=59,v8e=61,cie=34,P8e=92,G8e=44;function F8e(n,t,o,a,e){let i=new lie;e:for(;ot;){let a=n.charCodeAt(o-1);if(a!==pie&&a!==die)break;o--}return o}function L8e(n){if(Iie.test(n))return n;if(_8e.test(n))return`"${n.replace(T8e,"\\$&")}"`;throw new TypeError(`Invalid parameter value: ${n}`)}});function uie(n){if(!U8e.test(n))throw new TypeError(`Invalid media type: ${n}`);let t=n.indexOf("/"),o=n.slice(0,t).toLowerCase(),a=n.slice(t+1).toLowerCase(),e,i=a.lastIndexOf("+");return i!==-1&&(e=a.slice(i+1),a=a.slice(0,i)),{type:o,subtype:a,suffix:e}}var U8e,Cie=ue(()=>{U8e=/^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}\/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/});var Bie,fi,j2,J2=ue(()=>{Bie={10:"shot",20:"scene",30:"track",40:"part",50:"album",60:"edition",70:"collection"},fi={video:1,audio:2,complex:3,logo:4,subtitle:17,button:18,control:32},j2={[fi.video]:"video",[fi.audio]:"audio",[fi.complex]:"complex",[fi.logo]:"logo",[fi.subtitle]:"subtitle",[fi.button]:"button",[fi.control]:"control"}});var Xh,BI,fI,q2,sn,Ap,mt,or=ue(()=>{Xh=n=>class extends Error{constructor(o){super(o),this.name=n}},BI=class extends Xh("CouldNotDetermineFileTypeError"){},fI=class extends Xh("UnsupportedFileTypeError"){},q2=class extends Xh("UnexpectedFileContentError"){constructor(t,o){super(o),this.fileType=t}toString(){return`${this.name} (FileType: ${this.fileType}): ${this.message}`}},sn=class extends Xh("FieldDecodingError"){},Ap=class extends Xh("InternalParserError"){},mt=n=>class extends q2{constructor(t){super(n,t)}}});function GA(n,t,o){return(n[t]&1<>i;let r=8-i,s=a-r;return s<0?A>>=8-i-a:s>0&&(A<<=s,A|=XA(n,t,o+r,s)),A}function Li(n,t,o){return XA(n,t,o,1)===1}function Qie(n){let t=[];for(let o=0,a=n.length;oo.trim().toLowerCase());if(t.length>=1){let o=Number.parseFloat(t[0]);return t.length===2&&t[1]==="db"?{dB:o,ratio:K8e(o)}:{dB:H8e(o),ratio:o}}}function z2(n){if(n.length===0)throw new Error("decodeUintBE: empty Uint8Array");let t=new DataView(n.buffer,n.byteOffset,n.byteLength);return Ef(t)}var nr=ue(()=>{DA();or();uf()});var $h,eE,AE,V2,Qf,W2,tE,RO,Z2,QI=ue(()=>{DA();nr();$h={0:"Other",1:"32x32 pixels 'file icon' (PNG only)",2:"Other file icon",3:"Cover (front)",4:"Cover (back)",5:"Leaflet page",6:"Media (e.g. label side of CD)",7:"Lead artist/lead performer/soloist",8:"Artist/performer",9:"Conductor",10:"Band/Orchestra",11:"Composer",12:"Lyricist/text writer",13:"Recording Location",14:"During recording",15:"During performance",16:"Movie/video screen capture",17:"A bright coloured fish",18:"Illustration",19:"Band/artist logotype",20:"Publisher/Studio logotype"},eE={other:0,lyrics:1,text:2,movement_part:3,events:4,chord:5,trivia_pop:6},AE={notSynchronized:0,mpegFrameNumber:1,milliseconds:2},V2={get:(n,t)=>n[t+3]&127|n[t+2]<<7|n[t+1]<<14|n[t]<<21,len:4},Qf={len:10,get:(n,t)=>({fileIdentifier:new We(3,"ascii").get(n,t),version:{major:qs.get(n,t+3),revision:qs.get(n,t+4)},flags:{unsynchronisation:GA(n,t+5,7),isExtendedHeader:GA(n,t+5,6),expIndicator:GA(n,t+5,5),footer:GA(n,t+5,4)},size:V2.get(n,t+6)})},W2={len:10,get:(n,t)=>({size:xe.get(n,t),extendedFlags:LA.get(n,t+4),sizeOfPadding:xe.get(n,t+6),crcDataPresent:GA(n,t+4,31)})},tE={len:1,get:(n,t)=>{switch(n[t]){case 0:return{encoding:"latin1"};case 1:return{encoding:"utf-16le",bom:!0};case 2:return{encoding:"utf-16be",bom:!1};case 3:return{encoding:"utf8",bom:!1};default:return{encoding:"utf8",bom:!1}}}},RO={len:4,get:(n,t)=>({encoding:tE.get(n,t),language:new We(3,"latin1").get(n,t+1)})},Z2={len:6,get:(n,t)=>{let o=RO.get(n,t);return{encoding:o.encoding,language:o.language,timeStampFormat:QA.get(n,t+4),contentType:QA.get(n,t+5)}}}});var tp=ue(()=>{J2();QI()});function mie(n){return kO[n]&&!kO[n].multiple}function Sie(n){return!kO[n].multiple||kO[n].unique||!1}var AA,kO,wie=ue(()=>{AA={multiple:!1},kO={year:AA,track:AA,disk:AA,title:AA,artist:AA,artists:{multiple:!0,unique:!0},albumartist:AA,albumartists:{multiple:!0,unique:!0},album:AA,date:AA,originaldate:AA,originalyear:AA,releasedate:AA,comment:{multiple:!0,unique:!1},genre:{multiple:!0,unique:!0},picture:{multiple:!0,unique:!0},composer:{multiple:!0,unique:!0},lyrics:{multiple:!0,unique:!1},albumsort:{multiple:!1,unique:!0},titlesort:{multiple:!1,unique:!0},work:{multiple:!1,unique:!0},artistsort:{multiple:!1,unique:!0},albumartistsort:{multiple:!1,unique:!0},composersort:{multiple:!1,unique:!0},lyricist:{multiple:!0,unique:!0},writer:{multiple:!0,unique:!0},conductor:{multiple:!0,unique:!0},remixer:{multiple:!0,unique:!0},arranger:{multiple:!0,unique:!0},engineer:{multiple:!0,unique:!0},producer:{multiple:!0,unique:!0},technician:{multiple:!0,unique:!0},djmixer:{multiple:!0,unique:!0},mixer:{multiple:!0,unique:!0},label:{multiple:!0,unique:!0},grouping:AA,subtitle:{multiple:!0},discsubtitle:AA,totaltracks:AA,totaldiscs:AA,compilation:AA,rating:{multiple:!0},bpm:AA,mood:AA,media:AA,catalognumber:{multiple:!0,unique:!0},tvShow:AA,tvShowSort:AA,tvSeason:AA,tvEpisode:AA,tvEpisodeId:AA,tvNetwork:AA,podcast:AA,podcasturl:AA,releasestatus:AA,releasetype:{multiple:!0},releasecountry:AA,script:AA,language:AA,copyright:AA,license:AA,encodedby:AA,encodersettings:AA,gapless:AA,barcode:AA,isrc:{multiple:!0},asin:AA,musicbrainz_recordingid:AA,musicbrainz_trackid:AA,musicbrainz_albumid:AA,musicbrainz_artistid:{multiple:!0},musicbrainz_albumartistid:{multiple:!0},musicbrainz_releasegroupid:AA,musicbrainz_workid:AA,musicbrainz_trmid:AA,musicbrainz_discid:AA,acoustid_id:AA,acoustid_fingerprint:AA,musicip_puid:AA,musicip_fingerprint:AA,website:AA,"performer:instrument":{multiple:!0,unique:!0},averageLevel:AA,peakLevel:AA,notes:{multiple:!0,unique:!1},key:AA,originalalbum:AA,originalartist:AA,discogs_artist_id:{multiple:!0,unique:!0},discogs_release_id:AA,discogs_label_id:AA,discogs_master_release_id:AA,discogs_votes:AA,discogs_rating:AA,replaygain_track_peak:AA,replaygain_track_gain:AA,replaygain_album_peak:AA,replaygain_album_gain:AA,replaygain_track_minmax:AA,replaygain_album_minmax:AA,replaygain_undo:AA,description:{multiple:!0},longDescription:AA,category:{multiple:!0},hdVideo:AA,keywords:{multiple:!0},movement:AA,movementIndex:AA,movementTotal:AA,podcastId:AA,showMovement:AA,stik:AA,playCounter:AA}});var Cr,rc=ue(()=>{Cr=class{static toIntOrNull(t){let o=Number.parseInt(t,10);return Number.isNaN(o)?null:o}static normalizeTrack(t){let o=t.toString().split("/");return{no:Number.parseInt(o[0],10)||null,of:Number.parseInt(o[1],10)||null}}constructor(t,o){this.tagTypes=t,this.tagMap=o}mapGenericTag(t,o){t={id:t.id,value:t.value},this.postMap(t,o);let a=this.getCommonName(t.id);return a?{id:a,value:t.value}:null}getCommonName(t){return this.tagMap[t]}postMap(t,o){}};Cr.maxRatingScore=1});var x8e,vO,Die=ue(()=>{rc();x8e={title:"title",artist:"artist",album:"album",year:"year",comment:"comment",track:"track",genre:"genre"},vO=class extends Cr{constructor(){super(["ID3v1"],x8e)}}});var cn,rE=ue(()=>{rc();cn=class extends Cr{constructor(t,o){let a={};for(let e of Object.keys(o))a[e.toUpperCase()]=o[e];super(t,a)}getCommonName(t){return this.tagMap[t.toUpperCase()]}}});var Y8e,PO,Oie=ue(()=>{DA();rc();rE();nr();Y8e={TIT2:"title",TPE1:"artist","TXXX:Artists":"artists",TPE2:"albumartist",TALB:"album",TDRV:"date",TORY:"originalyear",TPOS:"disk",TCON:"genre",APIC:"picture",TCOM:"composer",USLT:"lyrics",TSOA:"albumsort",TSOT:"titlesort",TOAL:"originalalbum",TSOP:"artistsort",TSO2:"albumartistsort",TSOC:"composersort",TEXT:"lyricist","TXXX:Writer":"writer",TPE3:"conductor",TPE4:"remixer","IPLS:arranger":"arranger","IPLS:engineer":"engineer","IPLS:producer":"producer","IPLS:DJ-mix":"djmixer","IPLS:mix":"mixer",TPUB:"label",TIT1:"grouping",TIT3:"subtitle",TRCK:"track",TCMP:"compilation",POPM:"rating",TBPM:"bpm",TMED:"media","TXXX:CATALOGNUMBER":"catalognumber","TXXX:MusicBrainz Album Status":"releasestatus","TXXX:MusicBrainz Album Type":"releasetype","TXXX:MusicBrainz Album Release Country":"releasecountry","TXXX:RELEASECOUNTRY":"releasecountry","TXXX:SCRIPT":"script",TLAN:"language",TCOP:"copyright",WCOP:"license",TENC:"encodedby",TSSE:"encodersettings","TXXX:BARCODE":"barcode","TXXX:ISRC":"isrc",TSRC:"isrc","TXXX:ASIN":"asin","TXXX:originalyear":"originalyear","UFID:http://musicbrainz.org":"musicbrainz_recordingid","TXXX:MusicBrainz Release Track Id":"musicbrainz_trackid","TXXX:MusicBrainz Album Id":"musicbrainz_albumid","TXXX:MusicBrainz Artist Id":"musicbrainz_artistid","TXXX:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","TXXX:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","TXXX:MusicBrainz Work Id":"musicbrainz_workid","TXXX:MusicBrainz TRM Id":"musicbrainz_trmid","TXXX:MusicBrainz Disc Id":"musicbrainz_discid","TXXX:ACOUSTID_ID":"acoustid_id","TXXX:Acoustid Id":"acoustid_id","TXXX:Acoustid Fingerprint":"acoustid_fingerprint","TXXX:MusicIP PUID":"musicip_puid","TXXX:MusicMagic Fingerprint":"musicip_fingerprint",WOAR:"website",TDRC:"date",TYER:"year",TDOR:"originaldate","TIPL:arranger":"arranger","TIPL:engineer":"engineer","TIPL:producer":"producer","TIPL:DJ-mix":"djmixer","TIPL:mix":"mixer",TMOO:"mood",SYLT:"lyrics",TSST:"discsubtitle",TKEY:"key",COMM:"comment",TOPE:"originalartist","PRIV:AverageLevel":"averageLevel","PRIV:PeakLevel":"peakLevel","TXXX:DISCOGS_ARTIST_ID":"discogs_artist_id","TXXX:DISCOGS_ARTISTS":"artists","TXXX:DISCOGS_ARTIST_NAME":"artists","TXXX:DISCOGS_ALBUM_ARTISTS":"albumartist","TXXX:DISCOGS_CATALOG":"catalognumber","TXXX:DISCOGS_COUNTRY":"releasecountry","TXXX:DISCOGS_DATE":"originaldate","TXXX:DISCOGS_LABEL":"label","TXXX:DISCOGS_LABEL_ID":"discogs_label_id","TXXX:DISCOGS_MASTER_RELEASE_ID":"discogs_master_release_id","TXXX:DISCOGS_RATING":"discogs_rating","TXXX:DISCOGS_RELEASED":"date","TXXX:DISCOGS_RELEASE_ID":"discogs_release_id","TXXX:DISCOGS_VOTES":"discogs_votes","TXXX:CATALOGID":"catalognumber","TXXX:STYLE":"genre","TXXX:REPLAYGAIN_TRACK_PEAK":"replaygain_track_peak","TXXX:REPLAYGAIN_TRACK_GAIN":"replaygain_track_gain","TXXX:REPLAYGAIN_ALBUM_PEAK":"replaygain_album_peak","TXXX:REPLAYGAIN_ALBUM_GAIN":"replaygain_album_gain","TXXX:MP3GAIN_MINMAX":"replaygain_track_minmax","TXXX:MP3GAIN_ALBUM_MINMAX":"replaygain_album_minmax","TXXX:MP3GAIN_UNDO":"replaygain_undo",MVNM:"movement",MVIN:"movementIndex",PCST:"podcast",TCAT:"category",TDES:"description",TDRL:"releasedate",TGID:"podcastId",TKWD:"keywords",WFED:"podcasturl",GRP1:"grouping",PCNT:"playCounter"},PO=class n extends cn{static toRating(t){return{source:t.email,rating:t.rating>0?(t.rating-1)/254*Cr.maxRatingScore:void 0}}constructor(){super(["ID3v2.3","ID3v2.4"],Y8e)}postMap(t,o){switch(t.id){case"UFID":{let a=t.value;a.owner_identifier==="http://musicbrainz.org"&&(t.id+=`:${a.owner_identifier}`,t.value=Qi(a.identifier,"latin1"))}break;case"PRIV":{let a=t.value;switch(a.owner_identifier){case"AverageLevel":case"PeakValue":t.id+=`:${a.owner_identifier}`,t.value=a.data.length===4?Le.get(a.data,0):null,t.value===null&&o.addWarning("Failed to parse PRIV:PeakValue");break;default:o.addWarning(`Unknown PRIV owner-identifier: ${a.data}`)}}break;case"POPM":t.value=n.toRating(t.value);break;default:break}}}});var j8e,GO,bie=ue(()=>{rc();j8e={Title:"title",Author:"artist","WM/AlbumArtist":"albumartist","WM/AlbumTitle":"album","WM/Year":"date","WM/OriginalReleaseTime":"originaldate","WM/OriginalReleaseYear":"originalyear",Description:"comment","WM/TrackNumber":"track","WM/PartOfSet":"disk","WM/Genre":"genre","WM/Composer":"composer","WM/Lyrics":"lyrics","WM/AlbumSortOrder":"albumsort","WM/TitleSortOrder":"titlesort","WM/ArtistSortOrder":"artistsort","WM/AlbumArtistSortOrder":"albumartistsort","WM/ComposerSortOrder":"composersort","WM/Writer":"lyricist","WM/Conductor":"conductor","WM/ModifiedBy":"remixer","WM/Engineer":"engineer","WM/Producer":"producer","WM/DJMixer":"djmixer","WM/Mixer":"mixer","WM/Publisher":"label","WM/ContentGroupDescription":"grouping","WM/SubTitle":"subtitle","WM/SetSubTitle":"discsubtitle","WM/IsCompilation":"compilation","WM/SharedUserRating":"rating","WM/BeatsPerMinute":"bpm","WM/Mood":"mood","WM/Media":"media","WM/CatalogNo":"catalognumber","MusicBrainz/Album Status":"releasestatus","MusicBrainz/Album Type":"releasetype","MusicBrainz/Album Release Country":"releasecountry","WM/Script":"script","WM/Language":"language",Copyright:"copyright",LICENSE:"license","WM/EncodedBy":"encodedby","WM/EncodingSettings":"encodersettings","WM/Barcode":"barcode","WM/ISRC":"isrc","MusicBrainz/Track Id":"musicbrainz_recordingid","MusicBrainz/Release Track Id":"musicbrainz_trackid","MusicBrainz/Album Id":"musicbrainz_albumid","MusicBrainz/Artist Id":"musicbrainz_artistid","MusicBrainz/Album Artist Id":"musicbrainz_albumartistid","MusicBrainz/Release Group Id":"musicbrainz_releasegroupid","MusicBrainz/Work Id":"musicbrainz_workid","MusicBrainz/TRM Id":"musicbrainz_trmid","MusicBrainz/Disc Id":"musicbrainz_discid","Acoustid/Id":"acoustid_id","Acoustid/Fingerprint":"acoustid_fingerprint","MusicIP/PUID":"musicip_puid","WM/ARTISTS":"artists","WM/InitialKey":"key",ASIN:"asin","WM/Work":"work","WM/AuthorURL":"website","WM/Picture":"picture"},GO=class n extends Cr{static toRating(t){return{rating:Number.parseFloat(t+1)/5}}constructor(){super(["asf"],j8e)}postMap(t){switch(t.id){case"WM/SharedUserRating":{let o=t.id.split(":");t.value=n.toRating(t.value),t.id=o[0];break}}}}});var J8e,FO,Mie=ue(()=>{rE();J8e={TT2:"title",TP1:"artist",TP2:"albumartist",TAL:"album",TYE:"year",COM:"comment",TRK:"track",TPA:"disk",TCO:"genre",PIC:"picture",TCM:"composer",TOR:"originaldate",TOT:"originalalbum",TXT:"lyricist",TP3:"conductor",TPB:"label",TT1:"grouping",TT3:"subtitle",TLA:"language",TCR:"copyright",WCP:"license",TEN:"encodedby",TSS:"encodersettings",WAR:"website",PCS:"podcast",TCP:"compilation",TDR:"date",TS2:"albumartistsort",TSA:"albumsort",TSC:"composersort",TSP:"artistsort",TST:"titlesort",WFD:"podcasturl",TBP:"bpm",GP1:"grouping"},FO=class extends cn{constructor(){super(["ID3v2.2"],J8e)}}});var q8e,LO,_ie=ue(()=>{rE();q8e={Title:"title",Artist:"artist",Artists:"artists","Album Artist":"albumartist",Album:"album",Year:"date",Originalyear:"originalyear",Originaldate:"originaldate",Releasedate:"releasedate",Comment:"comment",Track:"track",Disc:"disk",DISCNUMBER:"disk",Genre:"genre","Cover Art (Front)":"picture","Cover Art (Back)":"picture",Composer:"composer",Lyrics:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",Lyricist:"lyricist",Writer:"writer",Conductor:"conductor",MixArtist:"remixer",Arranger:"arranger",Engineer:"engineer",Producer:"producer",DJMixer:"djmixer",Mixer:"mixer",Label:"label",Grouping:"grouping",Subtitle:"subtitle",DiscSubtitle:"discsubtitle",Compilation:"compilation",BPM:"bpm",Mood:"mood",Media:"media",CatalogNumber:"catalognumber",MUSICBRAINZ_ALBUMSTATUS:"releasestatus",MUSICBRAINZ_ALBUMTYPE:"releasetype",RELEASECOUNTRY:"releasecountry",Script:"script",Language:"language",Copyright:"copyright",LICENSE:"license",EncodedBy:"encodedby",EncoderSettings:"encodersettings",Barcode:"barcode",ISRC:"isrc",ASIN:"asin",musicbrainz_trackid:"musicbrainz_recordingid",musicbrainz_releasetrackid:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",Acoustid_Id:"acoustid_id",ACOUSTID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",Weblink:"website",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",MP3GAIN_MINMAX:"replaygain_track_minmax",MP3GAIN_UNDO:"replaygain_undo"},LO=class extends cn{constructor(){super(["APEv2"],q8e)}}});var z8e,V8e,yf,Tie=ue(()=>{rE();z8e={"\xA9nam":"title","\xA9ART":"artist",aART:"albumartist","----:com.apple.iTunes:Band":"albumartist","\xA9alb":"album","\xA9day":"date","\xA9cmt":"comment","\xA9com":"comment",trkn:"track",disk:"disk","\xA9gen":"genre",covr:"picture","\xA9wrt":"composer","\xA9lyr":"lyrics",soal:"albumsort",sonm:"titlesort",soar:"artistsort",soaa:"albumartistsort",soco:"composersort","----:com.apple.iTunes:LYRICIST":"lyricist","----:com.apple.iTunes:CONDUCTOR":"conductor","----:com.apple.iTunes:REMIXER":"remixer","----:com.apple.iTunes:ENGINEER":"engineer","----:com.apple.iTunes:PRODUCER":"producer","----:com.apple.iTunes:DJMIXER":"djmixer","----:com.apple.iTunes:MIXER":"mixer","----:com.apple.iTunes:LABEL":"label","\xA9grp":"grouping","----:com.apple.iTunes:SUBTITLE":"subtitle","----:com.apple.iTunes:DISCSUBTITLE":"discsubtitle",cpil:"compilation",tmpo:"bpm","----:com.apple.iTunes:MOOD":"mood","----:com.apple.iTunes:MEDIA":"media","----:com.apple.iTunes:CATALOGNUMBER":"catalognumber",tvsh:"tvShow",tvsn:"tvSeason",tves:"tvEpisode",sosn:"tvShowSort",tven:"tvEpisodeId",tvnn:"tvNetwork",pcst:"podcast",purl:"podcasturl","----:com.apple.iTunes:MusicBrainz Album Status":"releasestatus","----:com.apple.iTunes:MusicBrainz Album Type":"releasetype","----:com.apple.iTunes:MusicBrainz Album Release Country":"releasecountry","----:com.apple.iTunes:SCRIPT":"script","----:com.apple.iTunes:LANGUAGE":"language",cprt:"copyright","\xA9cpy":"copyright","----:com.apple.iTunes:LICENSE":"license","\xA9too":"encodedby",pgap:"gapless","----:com.apple.iTunes:BARCODE":"barcode","----:com.apple.iTunes:ISRC":"isrc","----:com.apple.iTunes:ASIN":"asin","----:com.apple.iTunes:NOTES":"comment","----:com.apple.iTunes:MusicBrainz Track Id":"musicbrainz_recordingid","----:com.apple.iTunes:MusicBrainz Release Track Id":"musicbrainz_trackid","----:com.apple.iTunes:MusicBrainz Album Id":"musicbrainz_albumid","----:com.apple.iTunes:MusicBrainz Artist Id":"musicbrainz_artistid","----:com.apple.iTunes:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","----:com.apple.iTunes:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","----:com.apple.iTunes:MusicBrainz Work Id":"musicbrainz_workid","----:com.apple.iTunes:MusicBrainz TRM Id":"musicbrainz_trmid","----:com.apple.iTunes:MusicBrainz Disc Id":"musicbrainz_discid","----:com.apple.iTunes:Acoustid Id":"acoustid_id","----:com.apple.iTunes:Acoustid Fingerprint":"acoustid_fingerprint","----:com.apple.iTunes:MusicIP PUID":"musicip_puid","----:com.apple.iTunes:fingerprint":"musicip_fingerprint","----:com.apple.iTunes:replaygain_track_gain":"replaygain_track_gain","----:com.apple.iTunes:replaygain_track_peak":"replaygain_track_peak","----:com.apple.iTunes:replaygain_album_gain":"replaygain_album_gain","----:com.apple.iTunes:replaygain_album_peak":"replaygain_album_peak","----:com.apple.iTunes:replaygain_track_minmax":"replaygain_track_minmax","----:com.apple.iTunes:replaygain_album_minmax":"replaygain_album_minmax","----:com.apple.iTunes:replaygain_undo":"replaygain_undo",gnre:"genre","----:com.apple.iTunes:ALBUMARTISTSORT":"albumartistsort","----:com.apple.iTunes:ARTISTS":"artists","----:com.apple.iTunes:ORIGINALDATE":"originaldate","----:com.apple.iTunes:ORIGINALYEAR":"originalyear","----:com.apple.iTunes:RELEASEDATE":"releasedate",desc:"description",ldes:"longDescription","\xA9mvn":"movement","\xA9mvi":"movementIndex","\xA9mvc":"movementTotal","\xA9wrk":"work",catg:"category",egid:"podcastId",hdvd:"hdVideo",keyw:"keywords",shwm:"showMovement",stik:"stik",rate:"rating"},V8e="iTunes",yf=class extends cn{constructor(){super([V8e],z8e)}postMap(t,o){switch(t.id){case"rate":t.value={source:void 0,rating:Number.parseFloat(t.value)/100};break}}}});var W8e,UO,Nie=ue(()=>{rc();W8e={TITLE:"title",ARTIST:"artist",ARTISTS:"artists",ALBUMARTIST:"albumartist","ALBUM ARTIST":"albumartist",ALBUM:"album",DATE:"date",ORIGINALDATE:"originaldate",ORIGINALYEAR:"originalyear",RELEASEDATE:"releasedate",COMMENT:"comment",TRACKNUMBER:"track",DISCNUMBER:"disk",GENRE:"genre",METADATA_BLOCK_PICTURE:"picture",COMPOSER:"composer",LYRICS:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",LYRICIST:"lyricist",WRITER:"writer",CONDUCTOR:"conductor",REMIXER:"remixer",ARRANGER:"arranger",ENGINEER:"engineer",PRODUCER:"producer",DJMIXER:"djmixer",MIXER:"mixer",LABEL:"label",GROUPING:"grouping",SUBTITLE:"subtitle",DISCSUBTITLE:"discsubtitle",TRACKTOTAL:"totaltracks",DISCTOTAL:"totaldiscs",COMPILATION:"compilation",RATING:"rating",BPM:"bpm",KEY:"key",MOOD:"mood",MEDIA:"media",CATALOGNUMBER:"catalognumber",RELEASESTATUS:"releasestatus",RELEASETYPE:"releasetype",RELEASECOUNTRY:"releasecountry",SCRIPT:"script",LANGUAGE:"language",COPYRIGHT:"copyright",LICENSE:"license",ENCODEDBY:"encodedby",ENCODERSETTINGS:"encodersettings",BARCODE:"barcode",ISRC:"isrc",ASIN:"asin",MUSICBRAINZ_TRACKID:"musicbrainz_recordingid",MUSICBRAINZ_RELEASETRACKID:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",ACOUSTID_ID:"acoustid_id",ACOUSTID_ID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",WEBSITE:"website",NOTES:"notes",TOTALTRACKS:"totaltracks",TOTALDISCS:"totaldiscs",DISCOGS_ARTIST_ID:"discogs_artist_id",DISCOGS_ARTISTS:"artists",DISCOGS_ARTIST_NAME:"artists",DISCOGS_ALBUM_ARTISTS:"albumartist",DISCOGS_CATALOG:"catalognumber",DISCOGS_COUNTRY:"releasecountry",DISCOGS_DATE:"originaldate",DISCOGS_LABEL:"label",DISCOGS_LABEL_ID:"discogs_label_id",DISCOGS_MASTER_RELEASE_ID:"discogs_master_release_id",DISCOGS_RATING:"discogs_rating",DISCOGS_RELEASED:"date",DISCOGS_RELEASE_ID:"discogs_release_id",DISCOGS_VOTES:"discogs_votes",CATALOGID:"catalognumber",STYLE:"genre",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",REPLAYGAIN_ALBUM_GAIN:"replaygain_album_gain",REPLAYGAIN_ALBUM_PEAK:"replaygain_album_peak",REPLAYGAIN_MINMAX:"replaygain_track_minmax",REPLAYGAIN_ALBUM_MINMAX:"replaygain_album_minmax",REPLAYGAIN_UNDO:"replaygain_undo"},UO=class n extends Cr{static toRating(t,o,a){return{source:t?t.toLowerCase():void 0,rating:Number.parseFloat(o)/a*Cr.maxRatingScore}}constructor(){super(["vorbis"],W8e)}postMap(t){if(t.id==="RATING")t.value=n.toRating(void 0,t.value,100);else if(t.id.indexOf("RATING:")===0){let o=t.id.split(":");t.value=n.toRating(o[1],t.value,1),t.id=o[0]}}}});var Z8e,HO,Rie=ue(()=>{rc();Z8e={IART:"artist",ICRD:"date",INAM:"title",TITL:"title",IPRD:"album",ITRK:"track",IPRT:"track",COMM:"comment",ICMT:"comment",ICNT:"releasecountry",GNRE:"genre",IWRI:"writer",RATE:"rating",YEAR:"year",ISFT:"encodedby",CODE:"encodedby",TURL:"website",IGNR:"genre",IENG:"engineer",ITCH:"technician",IMED:"media",IRPD:"album"},HO=class extends Cr{constructor(){super(["exif"],Z8e)}}});var X8e,KO,kie=ue(()=>{rE();X8e={"segment:title":"title","album:ARTIST":"albumartist","album:ARTISTSORT":"albumartistsort","album:TITLE":"album","album:DATE_RECORDED":"originaldate","album:DATE_RELEASED":"releasedate","album:PART_NUMBER":"disk","album:TOTAL_PARTS":"totaltracks","track:ARTIST":"artist","track:ARTISTSORT":"artistsort","track:TITLE":"title","track:PART_NUMBER":"track","track:MUSICBRAINZ_TRACKID":"musicbrainz_recordingid","track:MUSICBRAINZ_ALBUMID":"musicbrainz_albumid","track:MUSICBRAINZ_ARTISTID":"musicbrainz_artistid","track:PUBLISHER":"label","track:GENRE":"genre","track:ENCODER":"encodedby","track:ENCODER_OPTIONS":"encodersettings","edition:TOTAL_PARTS":"totaldiscs",picture:"picture"},KO=class extends cn{constructor(){super(["matroska"],X8e)}}});var $8e,xO,vie=ue(()=>{rc();$8e={NAME:"title",AUTH:"artist","(c) ":"copyright",ANNO:"comment"},xO=class extends Cr{constructor(){super(["AIFF"],$8e)}}});var YO,Pie=ue(()=>{Die();Oie();bie();Mie();_ie();Tie();Nie();Rie();kie();vie();or();YO=class{constructor(){this.tagMappers={},[new vO,new FO,new PO,new yf,new yf,new UO,new LO,new GO,new HO,new KO,new xO].forEach(t=>{this.registerTagMapper(t)})}mapTag(t,o,a){if(this.tagMappers[t])return this.tagMappers[t].mapGenericTag(o,a);throw new Ap(`No generic tag mapper defined for tag-format: ${t}`)}registerTagMapper(t){for(let o of t.tagTypes)this.tagMappers[o]=t}}});function Gie(n){return X2.test(n)?Aze(n):eze(n)}function eze(n){return{contentType:eE.lyrics,timeStampFormat:AE.notSynchronized,text:n.trim(),syncText:[]}}function Aze(n){let t=n.split(` +`,{offset:2,encoding:o})?{ext:"reg",mime:"application/x-ms-regedit"}:void 0}if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}};detectImprecise=async t=>{this.buffer=new Uint8Array(Cf);let o=y8e(t.fileInfo.size);if(await t.peekBuffer(this.buffer,{length:Math.min(8,o),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await t.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,o),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let a=0;a<=this.options.mpegOffsetTolerance;++a){let e=this.scanMpeg(a);if(e)return e}};async readTiffTag(t){let o=await this.tokenizer.readToken(t?LA:SA);switch(await this.tokenizer.ignore(10),o){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"};default:}}async readTiffIFD(t){let o=await this.tokenizer.readToken(t?LA:SA);if(!(o>i8e)&&!(ya(this.tokenizer)&&2+o*12>iie))for(let a=0;a=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(e>=8){let r=(t?LA:SA).get(this.buffer,8),s=(t?LA:SA).get(this.buffer,10);if(r===28&&s===254||r===31&&s===11)return{ext:"nef",mime:"image/x-nikon-nef"}}}if(ya(this.tokenizer)&&e>a8e)return o;let i=ya(this.tokenizer)?iie:this.tokenizer.fileInfo.size;try{await CI(this.tokenizer,e,{maximumLength:i,reason:"TIFF IFD offset"})}catch(r){if(r instanceof kA)return;throw r}let A;try{A=await this.readTiffIFD(t)}catch(r){if(r instanceof kA)return;throw r}return A??o}if(a===43)return o}scanMpeg(t){if(this.check([255,224],{offset:t,mask:[255,224]})){if(this.check([16],{offset:t+1,mask:[22]}))return this.check([8],{offset:t+1,mask:[8]})?{ext:"aac",mime:"audio/aac"}:{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:t+1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:t+1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:t+1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}},b8e=new Set(qre),M8e=new Set(zre)});var H2=ue(()=>{an();gie()});var Eie=ee(TO=>{"use strict";Object.defineProperty(TO,"__esModule",{value:!0});TO.format=R8e;TO.parse=k8e;var _8e=/^[\u0009\u0020-\u007e\u0080-\u00ff]*$/,Iie=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,T8e=/[\\"]/g,N8e=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,lie=(()=>{let n=function(){};return n.prototype=Object.create(null),n})();function R8e(n){let{type:t,parameters:o}=n;if(!t||!N8e.test(t))throw new TypeError(`Invalid type: ${t}`);let a=t;if(o)for(let e of Object.keys(o)){if(!Iie.test(e))throw new TypeError(`Invalid parameter name: ${e}`);a+=`; ${e}=${L8e(o[e])}`}return a}function k8e(n,t){let o=t?.comma===!0?G8e:65536,a=n.length,e=x2(n,t?.start??0,a),i=e;e=K2(n,e,a,o);let A=Y2(n,i,e),r=n.slice(i,A).toLowerCase();return t?.parameters===!1?{type:r,index:e,parameters:new lie}:F8e(n,r,e,a,o)}var pie=32,die=9,hie=59,v8e=61,cie=34,P8e=92,G8e=44;function F8e(n,t,o,a,e){let i=new lie;e:for(;ot;){let a=n.charCodeAt(o-1);if(a!==pie&&a!==die)break;o--}return o}function L8e(n){if(Iie.test(n))return n;if(_8e.test(n))return`"${n.replace(T8e,"\\$&")}"`;throw new TypeError(`Invalid parameter value: ${n}`)}});function uie(n){if(!U8e.test(n))throw new TypeError(`Invalid media type: ${n}`);let t=n.indexOf("/"),o=n.slice(0,t).toLowerCase(),a=n.slice(t+1).toLowerCase(),e,i=a.lastIndexOf("+");return i!==-1&&(e=a.slice(i+1),a=a.slice(0,i)),{type:o,subtype:a,suffix:e}}var U8e,Cie=ue(()=>{U8e=/^[A-Za-z0-9][A-Za-z0-9!#$&^_-]{0,126}\/[A-Za-z0-9][A-Za-z0-9!#$&^_.+-]{0,126}$/});var Bie,fi,j2,J2=ue(()=>{Bie={10:"shot",20:"scene",30:"track",40:"part",50:"album",60:"edition",70:"collection"},fi={video:1,audio:2,complex:3,logo:4,subtitle:17,button:18,control:32},j2={[fi.video]:"video",[fi.audio]:"audio",[fi.complex]:"complex",[fi.logo]:"logo",[fi.subtitle]:"subtitle",[fi.button]:"button",[fi.control]:"control"}});var Xh,BI,fI,q2,sn,Ap,St,or=ue(()=>{Xh=n=>class extends Error{constructor(o){super(o),this.name=n}},BI=class extends Xh("CouldNotDetermineFileTypeError"){},fI=class extends Xh("UnsupportedFileTypeError"){},q2=class extends Xh("UnexpectedFileContentError"){constructor(t,o){super(o),this.fileType=t}toString(){return`${this.name} (FileType: ${this.fileType}): ${this.message}`}},sn=class extends Xh("FieldDecodingError"){},Ap=class extends Xh("InternalParserError"){},St=n=>class extends q2{constructor(t){super(n,t)}}});function GA(n,t,o){return(n[t]&1<>i;let r=8-i,s=a-r;return s<0?A>>=8-i-a:s>0&&(A<<=s,A|=XA(n,t,o+r,s)),A}function Li(n,t,o){return XA(n,t,o,1)===1}function Qie(n){let t=[];for(let o=0,a=n.length;oo.trim().toLowerCase());if(t.length>=1){let o=Number.parseFloat(t[0]);return t.length===2&&t[1]==="db"?{dB:o,ratio:K8e(o)}:{dB:H8e(o),ratio:o}}}function z2(n){if(n.length===0)throw new Error("decodeUintBE: empty Uint8Array");let t=new DataView(n.buffer,n.byteOffset,n.byteLength);return Ef(t)}var nr=ue(()=>{DA();or();uf()});var $h,eE,AE,V2,Qf,W2,tE,RO,Z2,QI=ue(()=>{DA();nr();$h={0:"Other",1:"32x32 pixels 'file icon' (PNG only)",2:"Other file icon",3:"Cover (front)",4:"Cover (back)",5:"Leaflet page",6:"Media (e.g. label side of CD)",7:"Lead artist/lead performer/soloist",8:"Artist/performer",9:"Conductor",10:"Band/Orchestra",11:"Composer",12:"Lyricist/text writer",13:"Recording Location",14:"During recording",15:"During performance",16:"Movie/video screen capture",17:"A bright coloured fish",18:"Illustration",19:"Band/artist logotype",20:"Publisher/Studio logotype"},eE={other:0,lyrics:1,text:2,movement_part:3,events:4,chord:5,trivia_pop:6},AE={notSynchronized:0,mpegFrameNumber:1,milliseconds:2},V2={get:(n,t)=>n[t+3]&127|n[t+2]<<7|n[t+1]<<14|n[t]<<21,len:4},Qf={len:10,get:(n,t)=>({fileIdentifier:new We(3,"ascii").get(n,t),version:{major:qs.get(n,t+3),revision:qs.get(n,t+4)},flags:{unsynchronisation:GA(n,t+5,7),isExtendedHeader:GA(n,t+5,6),expIndicator:GA(n,t+5,5),footer:GA(n,t+5,4)},size:V2.get(n,t+6)})},W2={len:10,get:(n,t)=>({size:xe.get(n,t),extendedFlags:LA.get(n,t+4),sizeOfPadding:xe.get(n,t+6),crcDataPresent:GA(n,t+4,31)})},tE={len:1,get:(n,t)=>{switch(n[t]){case 0:return{encoding:"latin1"};case 1:return{encoding:"utf-16le",bom:!0};case 2:return{encoding:"utf-16be",bom:!1};case 3:return{encoding:"utf8",bom:!1};default:return{encoding:"utf8",bom:!1}}}},RO={len:4,get:(n,t)=>({encoding:tE.get(n,t),language:new We(3,"latin1").get(n,t+1)})},Z2={len:6,get:(n,t)=>{let o=RO.get(n,t);return{encoding:o.encoding,language:o.language,timeStampFormat:QA.get(n,t+4),contentType:QA.get(n,t+5)}}}});var tp=ue(()=>{J2();QI()});function mie(n){return kO[n]&&!kO[n].multiple}function Sie(n){return!kO[n].multiple||kO[n].unique||!1}var AA,kO,wie=ue(()=>{AA={multiple:!1},kO={year:AA,track:AA,disk:AA,title:AA,artist:AA,artists:{multiple:!0,unique:!0},albumartist:AA,albumartists:{multiple:!0,unique:!0},album:AA,date:AA,originaldate:AA,originalyear:AA,releasedate:AA,comment:{multiple:!0,unique:!1},genre:{multiple:!0,unique:!0},picture:{multiple:!0,unique:!0},composer:{multiple:!0,unique:!0},lyrics:{multiple:!0,unique:!1},albumsort:{multiple:!1,unique:!0},titlesort:{multiple:!1,unique:!0},work:{multiple:!1,unique:!0},artistsort:{multiple:!1,unique:!0},albumartistsort:{multiple:!1,unique:!0},composersort:{multiple:!1,unique:!0},lyricist:{multiple:!0,unique:!0},writer:{multiple:!0,unique:!0},conductor:{multiple:!0,unique:!0},remixer:{multiple:!0,unique:!0},arranger:{multiple:!0,unique:!0},engineer:{multiple:!0,unique:!0},producer:{multiple:!0,unique:!0},technician:{multiple:!0,unique:!0},djmixer:{multiple:!0,unique:!0},mixer:{multiple:!0,unique:!0},label:{multiple:!0,unique:!0},grouping:AA,subtitle:{multiple:!0},discsubtitle:AA,totaltracks:AA,totaldiscs:AA,compilation:AA,rating:{multiple:!0},bpm:AA,mood:AA,media:AA,catalognumber:{multiple:!0,unique:!0},tvShow:AA,tvShowSort:AA,tvSeason:AA,tvEpisode:AA,tvEpisodeId:AA,tvNetwork:AA,podcast:AA,podcasturl:AA,releasestatus:AA,releasetype:{multiple:!0},releasecountry:AA,script:AA,language:AA,copyright:AA,license:AA,encodedby:AA,encodersettings:AA,gapless:AA,barcode:AA,isrc:{multiple:!0},asin:AA,musicbrainz_recordingid:AA,musicbrainz_trackid:AA,musicbrainz_albumid:AA,musicbrainz_artistid:{multiple:!0},musicbrainz_albumartistid:{multiple:!0},musicbrainz_releasegroupid:AA,musicbrainz_workid:AA,musicbrainz_trmid:AA,musicbrainz_discid:AA,acoustid_id:AA,acoustid_fingerprint:AA,musicip_puid:AA,musicip_fingerprint:AA,website:AA,"performer:instrument":{multiple:!0,unique:!0},averageLevel:AA,peakLevel:AA,notes:{multiple:!0,unique:!1},key:AA,originalalbum:AA,originalartist:AA,discogs_artist_id:{multiple:!0,unique:!0},discogs_release_id:AA,discogs_label_id:AA,discogs_master_release_id:AA,discogs_votes:AA,discogs_rating:AA,replaygain_track_peak:AA,replaygain_track_gain:AA,replaygain_album_peak:AA,replaygain_album_gain:AA,replaygain_track_minmax:AA,replaygain_album_minmax:AA,replaygain_undo:AA,description:{multiple:!0},longDescription:AA,category:{multiple:!0},hdVideo:AA,keywords:{multiple:!0},movement:AA,movementIndex:AA,movementTotal:AA,podcastId:AA,showMovement:AA,stik:AA,playCounter:AA}});var Cr,rc=ue(()=>{Cr=class{static toIntOrNull(t){let o=Number.parseInt(t,10);return Number.isNaN(o)?null:o}static normalizeTrack(t){let o=t.toString().split("/");return{no:Number.parseInt(o[0],10)||null,of:Number.parseInt(o[1],10)||null}}constructor(t,o){this.tagTypes=t,this.tagMap=o}mapGenericTag(t,o){t={id:t.id,value:t.value},this.postMap(t,o);let a=this.getCommonName(t.id);return a?{id:a,value:t.value}:null}getCommonName(t){return this.tagMap[t]}postMap(t,o){}};Cr.maxRatingScore=1});var x8e,vO,Die=ue(()=>{rc();x8e={title:"title",artist:"artist",album:"album",year:"year",comment:"comment",track:"track",genre:"genre"},vO=class extends Cr{constructor(){super(["ID3v1"],x8e)}}});var cn,rE=ue(()=>{rc();cn=class extends Cr{constructor(t,o){let a={};for(let e of Object.keys(o))a[e.toUpperCase()]=o[e];super(t,a)}getCommonName(t){return this.tagMap[t.toUpperCase()]}}});var Y8e,PO,Oie=ue(()=>{DA();rc();rE();nr();Y8e={TIT2:"title",TPE1:"artist","TXXX:Artists":"artists",TPE2:"albumartist",TALB:"album",TDRV:"date",TORY:"originalyear",TPOS:"disk",TCON:"genre",APIC:"picture",TCOM:"composer",USLT:"lyrics",TSOA:"albumsort",TSOT:"titlesort",TOAL:"originalalbum",TSOP:"artistsort",TSO2:"albumartistsort",TSOC:"composersort",TEXT:"lyricist","TXXX:Writer":"writer",TPE3:"conductor",TPE4:"remixer","IPLS:arranger":"arranger","IPLS:engineer":"engineer","IPLS:producer":"producer","IPLS:DJ-mix":"djmixer","IPLS:mix":"mixer",TPUB:"label",TIT1:"grouping",TIT3:"subtitle",TRCK:"track",TCMP:"compilation",POPM:"rating",TBPM:"bpm",TMED:"media","TXXX:CATALOGNUMBER":"catalognumber","TXXX:MusicBrainz Album Status":"releasestatus","TXXX:MusicBrainz Album Type":"releasetype","TXXX:MusicBrainz Album Release Country":"releasecountry","TXXX:RELEASECOUNTRY":"releasecountry","TXXX:SCRIPT":"script",TLAN:"language",TCOP:"copyright",WCOP:"license",TENC:"encodedby",TSSE:"encodersettings","TXXX:BARCODE":"barcode","TXXX:ISRC":"isrc",TSRC:"isrc","TXXX:ASIN":"asin","TXXX:originalyear":"originalyear","UFID:http://musicbrainz.org":"musicbrainz_recordingid","TXXX:MusicBrainz Release Track Id":"musicbrainz_trackid","TXXX:MusicBrainz Album Id":"musicbrainz_albumid","TXXX:MusicBrainz Artist Id":"musicbrainz_artistid","TXXX:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","TXXX:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","TXXX:MusicBrainz Work Id":"musicbrainz_workid","TXXX:MusicBrainz TRM Id":"musicbrainz_trmid","TXXX:MusicBrainz Disc Id":"musicbrainz_discid","TXXX:ACOUSTID_ID":"acoustid_id","TXXX:Acoustid Id":"acoustid_id","TXXX:Acoustid Fingerprint":"acoustid_fingerprint","TXXX:MusicIP PUID":"musicip_puid","TXXX:MusicMagic Fingerprint":"musicip_fingerprint",WOAR:"website",TDRC:"date",TYER:"year",TDOR:"originaldate","TIPL:arranger":"arranger","TIPL:engineer":"engineer","TIPL:producer":"producer","TIPL:DJ-mix":"djmixer","TIPL:mix":"mixer",TMOO:"mood",SYLT:"lyrics",TSST:"discsubtitle",TKEY:"key",COMM:"comment",TOPE:"originalartist","PRIV:AverageLevel":"averageLevel","PRIV:PeakLevel":"peakLevel","TXXX:DISCOGS_ARTIST_ID":"discogs_artist_id","TXXX:DISCOGS_ARTISTS":"artists","TXXX:DISCOGS_ARTIST_NAME":"artists","TXXX:DISCOGS_ALBUM_ARTISTS":"albumartist","TXXX:DISCOGS_CATALOG":"catalognumber","TXXX:DISCOGS_COUNTRY":"releasecountry","TXXX:DISCOGS_DATE":"originaldate","TXXX:DISCOGS_LABEL":"label","TXXX:DISCOGS_LABEL_ID":"discogs_label_id","TXXX:DISCOGS_MASTER_RELEASE_ID":"discogs_master_release_id","TXXX:DISCOGS_RATING":"discogs_rating","TXXX:DISCOGS_RELEASED":"date","TXXX:DISCOGS_RELEASE_ID":"discogs_release_id","TXXX:DISCOGS_VOTES":"discogs_votes","TXXX:CATALOGID":"catalognumber","TXXX:STYLE":"genre","TXXX:REPLAYGAIN_TRACK_PEAK":"replaygain_track_peak","TXXX:REPLAYGAIN_TRACK_GAIN":"replaygain_track_gain","TXXX:REPLAYGAIN_ALBUM_PEAK":"replaygain_album_peak","TXXX:REPLAYGAIN_ALBUM_GAIN":"replaygain_album_gain","TXXX:MP3GAIN_MINMAX":"replaygain_track_minmax","TXXX:MP3GAIN_ALBUM_MINMAX":"replaygain_album_minmax","TXXX:MP3GAIN_UNDO":"replaygain_undo",MVNM:"movement",MVIN:"movementIndex",PCST:"podcast",TCAT:"category",TDES:"description",TDRL:"releasedate",TGID:"podcastId",TKWD:"keywords",WFED:"podcasturl",GRP1:"grouping",PCNT:"playCounter"},PO=class n extends cn{static toRating(t){return{source:t.email,rating:t.rating>0?(t.rating-1)/254*Cr.maxRatingScore:void 0}}constructor(){super(["ID3v2.3","ID3v2.4"],Y8e)}postMap(t,o){switch(t.id){case"UFID":{let a=t.value;a.owner_identifier==="http://musicbrainz.org"&&(t.id+=`:${a.owner_identifier}`,t.value=Qi(a.identifier,"latin1"))}break;case"PRIV":{let a=t.value;switch(a.owner_identifier){case"AverageLevel":case"PeakValue":t.id+=`:${a.owner_identifier}`,t.value=a.data.length===4?Le.get(a.data,0):null,t.value===null&&o.addWarning("Failed to parse PRIV:PeakValue");break;default:o.addWarning(`Unknown PRIV owner-identifier: ${a.data}`)}}break;case"POPM":t.value=n.toRating(t.value);break;default:break}}}});var j8e,GO,bie=ue(()=>{rc();j8e={Title:"title",Author:"artist","WM/AlbumArtist":"albumartist","WM/AlbumTitle":"album","WM/Year":"date","WM/OriginalReleaseTime":"originaldate","WM/OriginalReleaseYear":"originalyear",Description:"comment","WM/TrackNumber":"track","WM/PartOfSet":"disk","WM/Genre":"genre","WM/Composer":"composer","WM/Lyrics":"lyrics","WM/AlbumSortOrder":"albumsort","WM/TitleSortOrder":"titlesort","WM/ArtistSortOrder":"artistsort","WM/AlbumArtistSortOrder":"albumartistsort","WM/ComposerSortOrder":"composersort","WM/Writer":"lyricist","WM/Conductor":"conductor","WM/ModifiedBy":"remixer","WM/Engineer":"engineer","WM/Producer":"producer","WM/DJMixer":"djmixer","WM/Mixer":"mixer","WM/Publisher":"label","WM/ContentGroupDescription":"grouping","WM/SubTitle":"subtitle","WM/SetSubTitle":"discsubtitle","WM/IsCompilation":"compilation","WM/SharedUserRating":"rating","WM/BeatsPerMinute":"bpm","WM/Mood":"mood","WM/Media":"media","WM/CatalogNo":"catalognumber","MusicBrainz/Album Status":"releasestatus","MusicBrainz/Album Type":"releasetype","MusicBrainz/Album Release Country":"releasecountry","WM/Script":"script","WM/Language":"language",Copyright:"copyright",LICENSE:"license","WM/EncodedBy":"encodedby","WM/EncodingSettings":"encodersettings","WM/Barcode":"barcode","WM/ISRC":"isrc","MusicBrainz/Track Id":"musicbrainz_recordingid","MusicBrainz/Release Track Id":"musicbrainz_trackid","MusicBrainz/Album Id":"musicbrainz_albumid","MusicBrainz/Artist Id":"musicbrainz_artistid","MusicBrainz/Album Artist Id":"musicbrainz_albumartistid","MusicBrainz/Release Group Id":"musicbrainz_releasegroupid","MusicBrainz/Work Id":"musicbrainz_workid","MusicBrainz/TRM Id":"musicbrainz_trmid","MusicBrainz/Disc Id":"musicbrainz_discid","Acoustid/Id":"acoustid_id","Acoustid/Fingerprint":"acoustid_fingerprint","MusicIP/PUID":"musicip_puid","WM/ARTISTS":"artists","WM/InitialKey":"key",ASIN:"asin","WM/Work":"work","WM/AuthorURL":"website","WM/Picture":"picture"},GO=class n extends Cr{static toRating(t){return{rating:Number.parseFloat(t+1)/5}}constructor(){super(["asf"],j8e)}postMap(t){switch(t.id){case"WM/SharedUserRating":{let o=t.id.split(":");t.value=n.toRating(t.value),t.id=o[0];break}}}}});var J8e,FO,Mie=ue(()=>{rE();J8e={TT2:"title",TP1:"artist",TP2:"albumartist",TAL:"album",TYE:"year",COM:"comment",TRK:"track",TPA:"disk",TCO:"genre",PIC:"picture",TCM:"composer",TOR:"originaldate",TOT:"originalalbum",TXT:"lyricist",TP3:"conductor",TPB:"label",TT1:"grouping",TT3:"subtitle",TLA:"language",TCR:"copyright",WCP:"license",TEN:"encodedby",TSS:"encodersettings",WAR:"website",PCS:"podcast",TCP:"compilation",TDR:"date",TS2:"albumartistsort",TSA:"albumsort",TSC:"composersort",TSP:"artistsort",TST:"titlesort",WFD:"podcasturl",TBP:"bpm",GP1:"grouping"},FO=class extends cn{constructor(){super(["ID3v2.2"],J8e)}}});var q8e,LO,_ie=ue(()=>{rE();q8e={Title:"title",Artist:"artist",Artists:"artists","Album Artist":"albumartist",Album:"album",Year:"date",Originalyear:"originalyear",Originaldate:"originaldate",Releasedate:"releasedate",Comment:"comment",Track:"track",Disc:"disk",DISCNUMBER:"disk",Genre:"genre","Cover Art (Front)":"picture","Cover Art (Back)":"picture",Composer:"composer",Lyrics:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",Lyricist:"lyricist",Writer:"writer",Conductor:"conductor",MixArtist:"remixer",Arranger:"arranger",Engineer:"engineer",Producer:"producer",DJMixer:"djmixer",Mixer:"mixer",Label:"label",Grouping:"grouping",Subtitle:"subtitle",DiscSubtitle:"discsubtitle",Compilation:"compilation",BPM:"bpm",Mood:"mood",Media:"media",CatalogNumber:"catalognumber",MUSICBRAINZ_ALBUMSTATUS:"releasestatus",MUSICBRAINZ_ALBUMTYPE:"releasetype",RELEASECOUNTRY:"releasecountry",Script:"script",Language:"language",Copyright:"copyright",LICENSE:"license",EncodedBy:"encodedby",EncoderSettings:"encodersettings",Barcode:"barcode",ISRC:"isrc",ASIN:"asin",musicbrainz_trackid:"musicbrainz_recordingid",musicbrainz_releasetrackid:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",Acoustid_Id:"acoustid_id",ACOUSTID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",Weblink:"website",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",MP3GAIN_MINMAX:"replaygain_track_minmax",MP3GAIN_UNDO:"replaygain_undo"},LO=class extends cn{constructor(){super(["APEv2"],q8e)}}});var z8e,V8e,yf,Tie=ue(()=>{rE();z8e={"\xA9nam":"title","\xA9ART":"artist",aART:"albumartist","----:com.apple.iTunes:Band":"albumartist","\xA9alb":"album","\xA9day":"date","\xA9cmt":"comment","\xA9com":"comment",trkn:"track",disk:"disk","\xA9gen":"genre",covr:"picture","\xA9wrt":"composer","\xA9lyr":"lyrics",soal:"albumsort",sonm:"titlesort",soar:"artistsort",soaa:"albumartistsort",soco:"composersort","----:com.apple.iTunes:LYRICIST":"lyricist","----:com.apple.iTunes:CONDUCTOR":"conductor","----:com.apple.iTunes:REMIXER":"remixer","----:com.apple.iTunes:ENGINEER":"engineer","----:com.apple.iTunes:PRODUCER":"producer","----:com.apple.iTunes:DJMIXER":"djmixer","----:com.apple.iTunes:MIXER":"mixer","----:com.apple.iTunes:LABEL":"label","\xA9grp":"grouping","----:com.apple.iTunes:SUBTITLE":"subtitle","----:com.apple.iTunes:DISCSUBTITLE":"discsubtitle",cpil:"compilation",tmpo:"bpm","----:com.apple.iTunes:MOOD":"mood","----:com.apple.iTunes:MEDIA":"media","----:com.apple.iTunes:CATALOGNUMBER":"catalognumber",tvsh:"tvShow",tvsn:"tvSeason",tves:"tvEpisode",sosn:"tvShowSort",tven:"tvEpisodeId",tvnn:"tvNetwork",pcst:"podcast",purl:"podcasturl","----:com.apple.iTunes:MusicBrainz Album Status":"releasestatus","----:com.apple.iTunes:MusicBrainz Album Type":"releasetype","----:com.apple.iTunes:MusicBrainz Album Release Country":"releasecountry","----:com.apple.iTunes:SCRIPT":"script","----:com.apple.iTunes:LANGUAGE":"language",cprt:"copyright","\xA9cpy":"copyright","----:com.apple.iTunes:LICENSE":"license","\xA9too":"encodedby",pgap:"gapless","----:com.apple.iTunes:BARCODE":"barcode","----:com.apple.iTunes:ISRC":"isrc","----:com.apple.iTunes:ASIN":"asin","----:com.apple.iTunes:NOTES":"comment","----:com.apple.iTunes:MusicBrainz Track Id":"musicbrainz_recordingid","----:com.apple.iTunes:MusicBrainz Release Track Id":"musicbrainz_trackid","----:com.apple.iTunes:MusicBrainz Album Id":"musicbrainz_albumid","----:com.apple.iTunes:MusicBrainz Artist Id":"musicbrainz_artistid","----:com.apple.iTunes:MusicBrainz Album Artist Id":"musicbrainz_albumartistid","----:com.apple.iTunes:MusicBrainz Release Group Id":"musicbrainz_releasegroupid","----:com.apple.iTunes:MusicBrainz Work Id":"musicbrainz_workid","----:com.apple.iTunes:MusicBrainz TRM Id":"musicbrainz_trmid","----:com.apple.iTunes:MusicBrainz Disc Id":"musicbrainz_discid","----:com.apple.iTunes:Acoustid Id":"acoustid_id","----:com.apple.iTunes:Acoustid Fingerprint":"acoustid_fingerprint","----:com.apple.iTunes:MusicIP PUID":"musicip_puid","----:com.apple.iTunes:fingerprint":"musicip_fingerprint","----:com.apple.iTunes:replaygain_track_gain":"replaygain_track_gain","----:com.apple.iTunes:replaygain_track_peak":"replaygain_track_peak","----:com.apple.iTunes:replaygain_album_gain":"replaygain_album_gain","----:com.apple.iTunes:replaygain_album_peak":"replaygain_album_peak","----:com.apple.iTunes:replaygain_track_minmax":"replaygain_track_minmax","----:com.apple.iTunes:replaygain_album_minmax":"replaygain_album_minmax","----:com.apple.iTunes:replaygain_undo":"replaygain_undo",gnre:"genre","----:com.apple.iTunes:ALBUMARTISTSORT":"albumartistsort","----:com.apple.iTunes:ARTISTS":"artists","----:com.apple.iTunes:ORIGINALDATE":"originaldate","----:com.apple.iTunes:ORIGINALYEAR":"originalyear","----:com.apple.iTunes:RELEASEDATE":"releasedate",desc:"description",ldes:"longDescription","\xA9mvn":"movement","\xA9mvi":"movementIndex","\xA9mvc":"movementTotal","\xA9wrk":"work",catg:"category",egid:"podcastId",hdvd:"hdVideo",keyw:"keywords",shwm:"showMovement",stik:"stik",rate:"rating"},V8e="iTunes",yf=class extends cn{constructor(){super([V8e],z8e)}postMap(t,o){switch(t.id){case"rate":t.value={source:void 0,rating:Number.parseFloat(t.value)/100};break}}}});var W8e,UO,Nie=ue(()=>{rc();W8e={TITLE:"title",ARTIST:"artist",ARTISTS:"artists",ALBUMARTIST:"albumartist","ALBUM ARTIST":"albumartist",ALBUM:"album",DATE:"date",ORIGINALDATE:"originaldate",ORIGINALYEAR:"originalyear",RELEASEDATE:"releasedate",COMMENT:"comment",TRACKNUMBER:"track",DISCNUMBER:"disk",GENRE:"genre",METADATA_BLOCK_PICTURE:"picture",COMPOSER:"composer",LYRICS:"lyrics",ALBUMSORT:"albumsort",TITLESORT:"titlesort",WORK:"work",ARTISTSORT:"artistsort",ALBUMARTISTSORT:"albumartistsort",COMPOSERSORT:"composersort",LYRICIST:"lyricist",WRITER:"writer",CONDUCTOR:"conductor",REMIXER:"remixer",ARRANGER:"arranger",ENGINEER:"engineer",PRODUCER:"producer",DJMIXER:"djmixer",MIXER:"mixer",LABEL:"label",GROUPING:"grouping",SUBTITLE:"subtitle",DISCSUBTITLE:"discsubtitle",TRACKTOTAL:"totaltracks",DISCTOTAL:"totaldiscs",COMPILATION:"compilation",RATING:"rating",BPM:"bpm",KEY:"key",MOOD:"mood",MEDIA:"media",CATALOGNUMBER:"catalognumber",RELEASESTATUS:"releasestatus",RELEASETYPE:"releasetype",RELEASECOUNTRY:"releasecountry",SCRIPT:"script",LANGUAGE:"language",COPYRIGHT:"copyright",LICENSE:"license",ENCODEDBY:"encodedby",ENCODERSETTINGS:"encodersettings",BARCODE:"barcode",ISRC:"isrc",ASIN:"asin",MUSICBRAINZ_TRACKID:"musicbrainz_recordingid",MUSICBRAINZ_RELEASETRACKID:"musicbrainz_trackid",MUSICBRAINZ_ALBUMID:"musicbrainz_albumid",MUSICBRAINZ_ARTISTID:"musicbrainz_artistid",MUSICBRAINZ_ALBUMARTISTID:"musicbrainz_albumartistid",MUSICBRAINZ_RELEASEGROUPID:"musicbrainz_releasegroupid",MUSICBRAINZ_WORKID:"musicbrainz_workid",MUSICBRAINZ_TRMID:"musicbrainz_trmid",MUSICBRAINZ_DISCID:"musicbrainz_discid",ACOUSTID_ID:"acoustid_id",ACOUSTID_ID_FINGERPRINT:"acoustid_fingerprint",MUSICIP_PUID:"musicip_puid",WEBSITE:"website",NOTES:"notes",TOTALTRACKS:"totaltracks",TOTALDISCS:"totaldiscs",DISCOGS_ARTIST_ID:"discogs_artist_id",DISCOGS_ARTISTS:"artists",DISCOGS_ARTIST_NAME:"artists",DISCOGS_ALBUM_ARTISTS:"albumartist",DISCOGS_CATALOG:"catalognumber",DISCOGS_COUNTRY:"releasecountry",DISCOGS_DATE:"originaldate",DISCOGS_LABEL:"label",DISCOGS_LABEL_ID:"discogs_label_id",DISCOGS_MASTER_RELEASE_ID:"discogs_master_release_id",DISCOGS_RATING:"discogs_rating",DISCOGS_RELEASED:"date",DISCOGS_RELEASE_ID:"discogs_release_id",DISCOGS_VOTES:"discogs_votes",CATALOGID:"catalognumber",STYLE:"genre",REPLAYGAIN_TRACK_GAIN:"replaygain_track_gain",REPLAYGAIN_TRACK_PEAK:"replaygain_track_peak",REPLAYGAIN_ALBUM_GAIN:"replaygain_album_gain",REPLAYGAIN_ALBUM_PEAK:"replaygain_album_peak",REPLAYGAIN_MINMAX:"replaygain_track_minmax",REPLAYGAIN_ALBUM_MINMAX:"replaygain_album_minmax",REPLAYGAIN_UNDO:"replaygain_undo"},UO=class n extends Cr{static toRating(t,o,a){return{source:t?t.toLowerCase():void 0,rating:Number.parseFloat(o)/a*Cr.maxRatingScore}}constructor(){super(["vorbis"],W8e)}postMap(t){if(t.id==="RATING")t.value=n.toRating(void 0,t.value,100);else if(t.id.indexOf("RATING:")===0){let o=t.id.split(":");t.value=n.toRating(o[1],t.value,1),t.id=o[0]}}}});var Z8e,HO,Rie=ue(()=>{rc();Z8e={IART:"artist",ICRD:"date",INAM:"title",TITL:"title",IPRD:"album",ITRK:"track",IPRT:"track",COMM:"comment",ICMT:"comment",ICNT:"releasecountry",GNRE:"genre",IWRI:"writer",RATE:"rating",YEAR:"year",ISFT:"encodedby",CODE:"encodedby",TURL:"website",IGNR:"genre",IENG:"engineer",ITCH:"technician",IMED:"media",IRPD:"album"},HO=class extends Cr{constructor(){super(["exif"],Z8e)}}});var X8e,KO,kie=ue(()=>{rE();X8e={"segment:title":"title","album:ARTIST":"albumartist","album:ARTISTSORT":"albumartistsort","album:TITLE":"album","album:DATE_RECORDED":"originaldate","album:DATE_RELEASED":"releasedate","album:PART_NUMBER":"disk","album:TOTAL_PARTS":"totaltracks","track:ARTIST":"artist","track:ARTISTSORT":"artistsort","track:TITLE":"title","track:PART_NUMBER":"track","track:MUSICBRAINZ_TRACKID":"musicbrainz_recordingid","track:MUSICBRAINZ_ALBUMID":"musicbrainz_albumid","track:MUSICBRAINZ_ARTISTID":"musicbrainz_artistid","track:PUBLISHER":"label","track:GENRE":"genre","track:ENCODER":"encodedby","track:ENCODER_OPTIONS":"encodersettings","edition:TOTAL_PARTS":"totaldiscs",picture:"picture"},KO=class extends cn{constructor(){super(["matroska"],X8e)}}});var $8e,xO,vie=ue(()=>{rc();$8e={NAME:"title",AUTH:"artist","(c) ":"copyright",ANNO:"comment"},xO=class extends Cr{constructor(){super(["AIFF"],$8e)}}});var YO,Pie=ue(()=>{Die();Oie();bie();Mie();_ie();Tie();Nie();Rie();kie();vie();or();YO=class{constructor(){this.tagMappers={},[new vO,new FO,new PO,new yf,new yf,new UO,new LO,new GO,new HO,new KO,new xO].forEach(t=>{this.registerTagMapper(t)})}mapTag(t,o,a){if(this.tagMappers[t])return this.tagMappers[t].mapGenericTag(o,a);throw new Ap(`No generic tag mapper defined for tag-format: ${t}`)}registerTagMapper(t){for(let o of t.tagTypes)this.tagMappers[o]=t}}});function Gie(n){return X2.test(n)?Aze(n):eze(n)}function eze(n){return{contentType:eE.lyrics,timeStampFormat:AE.notSynchronized,text:n.trim(),syncText:[]}}function Aze(n){let t=n.split(` `),o=[];for(let a of t){let e=a.match(X2);if(e){let i=Number.parseInt(e[1],10),A=Number.parseInt(e[2],10),r=e[3].length===3?Number.parseInt(e[3],10):Number.parseInt(e[3],10)*10,s=(i*60+A)*1e3+r,g=a.replace(X2,"").trim();o.push({timestamp:s,text:g})}}return{contentType:eE.lyrics,timeStampFormat:AE.milliseconds,text:o.map(a=>a.text).join(` -`),syncText:o}}var X2,Fie=ue(()=>{tp();X2=/\[(\d{2}):(\d{2})\.(\d{2,3})]/});function rze(n){return n.length>2?`${n.slice(0,n.length-1).join(", ")} & ${n[n.length-1]}`:n.join(" & ")}var Lie,rp,tze,jO,Uie=ue(()=>{tp();Lie=ze(lt(),1);wie();Pie();rc();nr();H2();Fie();rp=(0,Lie.default)("music-metadata:collector"),tze=["matroska","APEv2","vorbis","ID3v2.4","ID3v2.3","ID3v2.2","exif","asf","iTunes","AIFF","ID3v1"],jO=class{constructor(t){this.format={tagTypes:[],trackInfo:[]},this.native={},this.common={track:{no:null,of:null},disk:{no:null,of:null},movementIndex:{no:null,of:null}},this.quality={warnings:[]},this.commonOrigin={},this.originPriority={},this.tagMapper=new YO,this.opts=t;let o=1;for(let a of tze)this.originPriority[a]=o++;this.originPriority.artificial=500,this.originPriority.id3v1=600}hasAny(){return Object.keys(this.native).length>0}addStreamInfo(t){rp(`streamInfo: type=${t.type?j2[t.type]:"?"}, codec=${t.codecName}`),this.format.trackInfo.push(t)}setFormat(t,o){rp(`format: ${t} = ${o}`),this.format[t]=o,this.opts?.observer&&this.opts.observer({metadata:this,tag:{type:"format",id:t,value:o}})}setAudioOnly(){this.setFormat("hasAudio",!0),this.setFormat("hasVideo",!1)}async addTag(t,o,a){rp(`tag ${t}.${o} = ${a}`),this.native[t]||(this.format.tagTypes.push(t),this.native[t]=[]),this.native[t].push({id:o,value:a}),await this.toCommon(t,o,a)}addWarning(t){this.quality.warnings.push({message:t})}async postMap(t,o){switch(o.id){case"artist":return this.handleSingularArtistTag(t,o,"artist","artists");case"albumartist":return this.handleSingularArtistTag(t,o,"albumartist","albumartists");case"artists":return this.handlePluralArtistTag(t,o,"artist","artists");case"albumartists":return this.handlePluralArtistTag(t,o,"albumartist","albumartists");case"picture":return this.postFixPicture(o.value).then(a=>{a!==null&&(o.value=a,this.setGenericTag(t,o))});case"totaltracks":this.common.track.of=Cr.toIntOrNull(o.value);return;case"totaldiscs":this.common.disk.of=Cr.toIntOrNull(o.value);return;case"movementTotal":this.common.movementIndex.of=Cr.toIntOrNull(o.value);return;case"track":case"disk":case"movementIndex":{let a=this.common[o.id].of;this.common[o.id]=Cr.normalizeTrack(o.value),this.common[o.id].of=a??this.common[o.id].of;return}case"bpm":case"year":case"originalyear":o.value=Number.parseInt(o.value,10);break;case"date":{let a=Number.parseInt(o.value.substr(0,4),10);Number.isNaN(a)||(this.common.year=a);break}case"discogs_label_id":case"discogs_release_id":case"discogs_master_release_id":case"discogs_artist_id":case"discogs_votes":o.value=typeof o.value=="string"?Number.parseInt(o.value,10):o.value;break;case"replaygain_track_gain":case"replaygain_track_peak":case"replaygain_album_gain":case"replaygain_album_peak":o.value=yie(o.value);break;case"replaygain_track_minmax":o.value=o.value.split(",").map(a=>Number.parseInt(a,10));break;case"replaygain_undo":{let a=o.value.split(",").map(e=>Number.parseInt(e,10));o.value={leftChannel:a[0],rightChannel:a[1]};break}case"gapless":case"compilation":case"podcast":case"showMovement":o.value=o.value==="1"||o.value===1;break;case"isrc":{let a=this.common[o.id];if(a&&a.indexOf(o.value)!==-1)return;break}case"comment":typeof o.value=="string"&&(o.value={text:o.value}),o.value.descriptor==="iTunPGAP"&&this.setGenericTag(t,{id:"gapless",value:o.value.text==="1"});break;case"lyrics":typeof o.value=="string"&&(o.value=Gie(o.value));break;default:}o.value!==null&&this.setGenericTag(t,o)}toCommonMetadata(){return{format:this.format,native:this.native,quality:this.quality,common:this.common}}handleSingularArtistTag(t,o,a,e){if(this.commonOrigin[a]===this.originPriority[t])return this.postMap("artificial",{id:e,value:o.value});this.common[e]||this.setGenericTag("artificial",{id:e,value:o.value}),this.setGenericTag(t,o)}handlePluralArtistTag(t,o,a,e){if((!this.common[a]||this.commonOrigin[a]===this.originPriority.artificial)&&(!this.common[e]||this.common[e].indexOf(o.value)===-1)){let i=(this.common[e]||[]).concat([o.value]),A=rze(i);this.setGenericTag("artificial",{id:a,value:A})}this.setGenericTag(t,o)}async postFixPicture(t){if(t.data&&t.data.length>0){if(!t.format){let o=await ff(Uint8Array.from(t.data));if(o)t.format=o.mime;else return null}switch(t.format=t.format.toLocaleLowerCase(),t.format){case"image/jpg":t.format="image/jpeg"}return t}return this.addWarning("Empty picture tag found"),null}async toCommon(t,o,a){let e={id:o,value:a},i=this.tagMapper.mapTag(t,e,this);i&&await this.postMap(t,i)}setGenericTag(t,o){rp(`common.${o.id} = ${o.value}`);let a=this.commonOrigin[o.id]||1e3,e=this.originPriority[t];if(mie(o.id))if(e<=a)this.common[o.id]=o.value,this.commonOrigin[o.id]=e;else return rp(`Ignore native tag (singleton): ${t}.${o.id} = ${o.value}`);else if(e===a)!Sie(o.id)||this.common[o.id].indexOf(o.value)===-1?this.common[o.id].push(o.value):rp(`Ignore duplicate value: ${t}.${o.id} = ${o.value}`);else if(e{Gt=class{constructor(t,o,a){this.metadata=t,this.tokenizer=o,this.options=a}}});var ize,at,ma=ue(()=>{js();nr();or();ize=/^[\x21-\x7e©][\x20-\x7e\x00()]{3}/,at={len:4,get:(n,t)=>{let o=Tr(n.subarray(t,t+at.len),"latin1");if(!o.match(ize))throw new sn(`FourCC contains invalid characters: ${Qie(o)} "${o}"`);return o},put:(n,t,o)=>{let a=Rre(o,"latin1");if(a.length!==4)throw new Ap("Invalid length");return n.set(a,t),t+4}}});function Kie(n){return{containsHeader:JO(n,31),containsFooter:JO(n,30),isHeader:JO(n,29),readOnly:JO(n,0),dataType:(n&6)>>1}}function JO(n,t){return(n&1<{DA();ma();mf={text_utf8:0,binary:1,external_info:2,reserved:3},$2={len:52,get:(n,t)=>({ID:at.get(n,t),version:Le.get(n,t+4)/1e3,descriptorBytes:Le.get(n,t+8),headerBytes:Le.get(n,t+12),seekTableBytes:Le.get(n,t+16),headerDataBytes:Le.get(n,t+20),apeFrameDataBytes:Le.get(n,t+24),apeFrameDataBytesHigh:Le.get(n,t+28),terminatingDataBytes:Le.get(n,t+32),fileMD5:new Mt(16).get(n,t+36)})},Hie={len:24,get:(n,t)=>({compressionLevel:SA.get(n,t),formatFlags:SA.get(n,t+2),blocksPerFrame:Le.get(n,t+4),finalFrameBlocks:Le.get(n,t+8),totalFrames:Le.get(n,t+12),bitsPerSample:SA.get(n,t+16),channel:SA.get(n,t+18),sampleRate:Le.get(n,t+20)})},eo={len:32,get:(n,t)=>({ID:new We(8,"ascii").get(n,t),version:Le.get(n,t+8),size:Le.get(n,t+12),fields:Le.get(n,t+16),flags:Kie(Le.get(n,t+20))})},qO={len:8,get:(n,t)=>({size:Le.get(n,t),flags:Kie(Le.get(n,t+4))})}});var qie={};Lr(qie,{APEv2Parser:()=>mI,ApeContentError:()=>iE,tryParseApeHeader:()=>ip});function ip(n,t,o){return new mI(n,t,o).tryParseApeHeader()}var Jie,yI,Yie,jie,iE,mI,ap=ue(()=>{Jie=ze(lt(),1);an();DA();nr();$a();xie();or();js();yI=(0,Jie.default)("music-metadata:parser:APEv2"),Yie="APEv2",jie="APETAGEX",iE=class extends mt("APEv2"){};mI=class n extends Gt{constructor(){super(...arguments),this.ape={}}static calculateDuration(t){let o=t.totalFrames>1?t.blocksPerFrame*(t.totalFrames-1):0;return o+=t.finalFrameBlocks,o/t.sampleRate}static async findApeFooterOffset(t,o){let a=new Uint8Array(eo.len),e=t.position;if(o<=eo.len){yI(`Offset is too small to read APE footer: offset=${o}`);return}if(o>eo.len){await t.readBuffer(a,{position:o-eo.len}),t.setPosition(e);let i=eo.get(a,0);if(i.ID==="APETAGEX")return i.flags.isHeader?yI(`APE Header found at offset=${o-eo.len}`):(yI(`APE Footer found at offset=${o-eo.len}`),o-=i.size),{footer:i,offset:o}}}static parseTagFooter(t,o,a){let e=eo.get(o,o.length-eo.len);if(e.ID!==jie)throw new iE("Unexpected APEv2 Footer ID preamble value");return Qo(o),new n(t,Qo(o),a).parseTags(e)}async tryParseApeHeader(){if(this.tokenizer.fileInfo.size&&this.tokenizer.fileInfo.size-this.tokenizer.position0?this.parseDescriptorExpansion(o):this.parseHeader());return this.metadata.setAudioOnly(),await this.tokenizer.ignore(a.forwardBytes),this.tryParseApeHeader()}async parseTags(t){let o=new Uint8Array(256),a=t.size-eo.len;yI(`Parse APE tags at offset=${this.tokenizer.position}, size=${a}`);for(let e=0;ethis.metadata.addTag(Yie,r,c)));break}case mf.binary:if(this.options.skipCovers)await this.tokenizer.ignore(i.size);else{let s=new Uint8Array(i.size);await this.tokenizer.readBuffer(s),A=Xs(s);let g=Tr(s.subarray(0,A),"utf-8"),c=s.subarray(A+1);await this.metadata.addTag(Yie,r,{description:g,data:c})}break;case mf.external_info:yI(`Ignore external info ${r}`),await this.tokenizer.ignore(i.size);break;case mf.reserved:yI(`Ignore external info ${r}`),this.metadata.addWarning(`APEv2 header declares a reserved datatype for "${r}"`),await this.tokenizer.ignore(i.size);break}}}async parseDescriptorExpansion(t){return await this.tokenizer.ignore(t),this.parseHeader()}async parseHeader(){let t=await this.tokenizer.readToken(Hie);if(this.metadata.setFormat("lossless",!0),this.metadata.setFormat("container","Monkey's Audio"),this.metadata.setFormat("bitsPerSample",t.bitsPerSample),this.metadata.setFormat("sampleRate",t.sampleRate),this.metadata.setFormat("numberOfChannels",t.channel),this.metadata.setFormat("duration",n.calculateDuration(t)),!this.ape.descriptor)throw new iE("Missing APE descriptor");return{forwardBytes:this.ape.descriptor.seekTableBytes+this.ape.descriptor.headerDataBytes+this.ape.descriptor.apeFrameDataBytes+this.ape.descriptor.terminatingDataBytes}}}});async function Vie(n){if(n.fileInfo.size>=128){let t=new Uint8Array(3),o=n.position;return await n.readBuffer(t,{position:n.fileInfo.size-128}),n.setPosition(o),Tr(t,"latin1")==="TAG"}return!1}var zie,zO,aE,VO,SI,WO,Sf=ue(()=>{zie=ze(lt(),1);DA();nr();$a();ap();js();zO=(0,zie.default)("music-metadata:parser:ID3v1"),aE=["Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska","Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise","Alt. Rock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic","Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta Rap","Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychedelic","Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical","Rock & Roll","Hard Rock","Folk","Folk/Rock","National Folk","Swing","Fast-Fusion","Bebob","Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic Rock","Progressive Rock","Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson","Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove","Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad","Power Ballad","Rhythmic Soul","Freestyle","Duet","Punk Rock","Drum Solo","A Cappella","Euro-House","Dance Hall","Goa","Drum & Bass","Club-House","Hardcore","Terror","Indie","BritPop","Negerpunk","Polsk Punk","Beat","Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover","Contemporary Christian","Christian Rock","Merengue","Salsa","Thrash Metal","Anime","JPop","Synthpop","Abstract","Art Rock","Baroque","Bhangra","Big Beat","Breakbeat","Chillout","Downtempo","Dub","EBM","Eclectic","Electro","Electroclash","Emo","Experimental","Garage","Global","IDM","Illbient","Industro-Goth","Jam Band","Krautrock","Leftfield","Lounge","Math Rock","New Romantic","Nu-Breakz","Post-Punk","Post-Rock","Psytrance","Shoegaze","Space Rock","Trop Rock","World Music","Neoclassical","Audiobook","Audio Theatre","Neue Deutsche Welle","Podcast","Indie Rock","G-Funk","Dubstep","Garage Rock","Psybient"],VO={len:128,get:(n,t)=>{let o=new SI(3).get(n,t);return o==="TAG"?{header:o,title:new SI(30).get(n,t+3),artist:new SI(30).get(n,t+33),album:new SI(30).get(n,t+63),year:new SI(4).get(n,t+93),comment:new SI(28).get(n,t+97),zeroByte:QA.get(n,t+127),track:QA.get(n,t+126),genre:QA.get(n,t+127)}:null}},SI=class{constructor(t){this.len=t,this.stringType=new We(t,"latin1")}get(t,o){let a=this.stringType.get(t,o);return a=NO(a),a=a.trim(),a.length>0?a:void 0}},WO=class n extends Gt{constructor(t,o,a){super(t,o,a),this.apeHeader=a.apeHeader}static getGenre(t){if(tt){zO("Already consumed the last 128 bytes");return}let o=await this.tokenizer.readToken(VO,t);if(o){zO("ID3v1 header found at: pos=%s",this.tokenizer.fileInfo.size-VO.len);let a=["title","artist","album","comment","track","year"];for(let i of a)o[i]&&o[i]!==""&&await this.addTag(i,o[i]);let e=n.getGenre(o.genre);e&&await this.addTag("genre",e)}else zO("ID3v1 header not found at: pos=%s",this.tokenizer.fileInfo.size-VO.len)}async addTag(t,o){await this.metadata.addTag("ID3v1",t,o)}}});var eU,Wie=ue(()=>{DA();eU={len:16,get:(n,t)=>{let o=xe.get(n,t+8),a=xe.get(n,t+12);return{startTime:xe.get(n,t),endTime:xe.get(n,t+4),startOffset:o===4294967295?void 0:o,endOffset:a===4294967295?void 0:a}}}});function wf(n){switch(n){case 2:return 6;case 3:case 4:return 10;default:throw Zie(n)}}function aze(n,t){return t===3?{status:{tag_alter_preservation:GA(n,0,7),file_alter_preservation:GA(n,0,6),read_only:GA(n,0,5)},format:{compression:GA(n,1,7),encryption:GA(n,1,6),grouping_identity:GA(n,1,5),unsynchronisation:!1,data_length_indicator:!1}}:{status:{tag_alter_preservation:GA(n,0,6),file_alter_preservation:GA(n,0,5),read_only:GA(n,0,4)},format:{grouping_identity:GA(n,1,6),compression:GA(n,1,3),encryption:GA(n,1,2),unsynchronisation:GA(n,1,1),data_length_indicator:GA(n,1,0)}}}function Df(n,t,o){switch(t){case 2:return oze(n,t,o);case 3:case 4:return nze(n,t,o);default:throw Zie(t)}}function oze(n,t,o){let a={id:Tr(n.subarray(0,3),"ascii"),length:Gr.get(n,3)};return a.id.match(/^[A-Z0-9]{3}$/)||o.addWarning(`Invalid ID3v2.${t} frame-header-ID: ${a.id}`),a}function nze(n,t,o){let a={id:Tr(n.subarray(0,4),"ascii"),length:(t===4?V2:xe).get(n,4),flags:aze(n.subarray(8,10),t)};return a.id.match(/^[A-Z0-9]{4}$/)||o.addWarning(`Invalid ID3v2.${t} frame-header-ID: ${a.id}`),a}function Zie(n){throw new wI(`Unexpected majorVer: ${n}`)}var AU=ue(()=>{DA();nr();QI();js();tU()});function sze(n){let t=[],o,a="";for(let e of n)if(typeof o=="string")if(e==="("&&o==="")a+="(",o=void 0;else if(e===")"){a!==""&&(t.push(a),a="");let i=Xie(o);i&&t.push(i),o=void 0}else o+=e;else e==="("?o="":a+=e;return a&&(t.length===0&&a.match(/^\d*$/)&&(a=Xie(a)),a&&t.push(a)),t}function Xie(n){if(n==="RX")return"Remix";if(n==="CR")return"Cover";if(n.match(/^\d*$/))return aE[Number.parseInt(n,10)]}function gze(n){throw new wI(`Unexpected majorVer: ${n}`)}var $ie,ZO,In,rU,XO,wI,tU=ue(()=>{$ie=ze(lt(),1);DA();nr();QI();Sf();or();nr();Wie();AU();ZO=(0,$ie.default)("music-metadata:id3v2:frame-parser"),In="latin1",rU={encoding:In,bom:!1};XO=class n{constructor(t,o){this.major=t,this.warningCollector=o}readData(t,o,a){if(t.length===0){this.warningCollector.addWarning(`id3v2.${this.major} header has empty tag type=${o}`);return}let{encoding:e,bom:i}=tE.get(t,0),A=t.length,r=0,s=[],g=n.getNullTerminatorLength(e),c;switch(ZO(`Parsing tag type=${o}, encoding=${e}, bom=${i}`),o!=="TXXX"&&o[0]==="T"?"T*":o){case"T*":case"GRP1":case"GP1":case"IPLS":case"MVIN":case"MVNM":case"PCS":case"PCST":{let I;try{I=n.trimNullPadding(Qi(t.subarray(1),e))}catch(p){if(p instanceof Error){this.warningCollector.addWarning(`id3v2.${this.major} type=${o} header has invalid string value: ${p.message}`);break}throw p}switch(o){case"TMCL":case"TIPL":case"IPLS":s=n.functionList(this.splitValue(o,I));break;case"TRK":case"TRCK":case"TPOS":case"TIT1":case"TIT2":case"TIT3":s=I;break;case"TCOM":case"TEXT":case"TOLY":case"TOPE":case"TPE1":case"TSRC":s=this.splitValue(o,I);break;case"TCO":case"TCON":s=this.splitValue(o,I).map(p=>sze(p)).reduce((p,B)=>p.concat(B),[]);break;case"PCS":case"PCST":s=this.major>=4?this.splitValue(o,I):[I],s=Array.isArray(s)&&s[0]===""?1:0;break;default:s=this.major>=4?this.splitValue(o,I):[I]}break}case"TXXX":{let I=n.readIdentifierAndData(t.subarray(1),e);s={description:I.id,text:this.splitValue(o,Qi(I.data,e).replace(/\x00+$/,""))};break}case"PIC":case"APIC":if(a){let I={};switch(t=t.subarray(1),this.major){case 2:I.format=Qi(t.subarray(0,3),"latin1"),t=t.subarray(3);break;case 3:case 4:c=Xs(t,In),I.format=Qi(t.subarray(0,c),In),t=t.subarray(c+1);break;default:throw gze(this.major)}I.format=n.fixPictureMimeType(I.format),I.type=$h[t[0]],t=t.subarray(1),c=Xs(t,e),I.description=Qi(t.subarray(0,c),e),t=t.subarray(c+g),I.data=t,s=I}break;case"CNT":case"PCNT":s=z2(t);break;case"SYLT":{let I=Z2.get(t,0);t=t.subarray(Z2.len);let p={descriptor:"",language:I.language,contentType:I.contentType,timeStampFormat:I.timeStampFormat,syncText:[]},B=!1;for(;t.length>0;){let f=n.readNullTerminatedString(t,I.encoding);if(t=t.subarray(f.len),B){let Q=xe.get(t,0);t=t.subarray(xe.len),p.syncText.push({text:f.text,timestamp:Q})}else p.descriptor=f.text,B=!0}s=p;break}case"ULT":case"USLT":case"COM":case"COMM":{let I=RO.get(t,r);r+=RO.len;let p=n.readNullTerminatedString(t.subarray(r),I.encoding);r+=p.len;let B=n.readNullTerminatedString(t.subarray(r),I.encoding);s={language:I.language,descriptor:p.text,text:B.text};break}case"UFID":{let I=n.readIdentifierAndData(t,In);s={owner_identifier:I.id,identifier:I.data};break}case"PRIV":{let I=n.readIdentifierAndData(t,In);s={owner_identifier:I.id,data:I.data};break}case"POPM":{t=t.subarray(r);let I=n.readNullTerminatedString(t,rU),p=I.text;if(t=t.subarray(I.len),t.length===0){this.warningCollector.addWarning(`id3v2.${this.major} type=${o} POPM frame missing rating byte`),s={email:p,rating:0,counter:void 0};break}let B=QA.get(t,0),f=t.subarray(QA.len);s={email:p,rating:B,counter:f.length>0?z2(f):void 0};break}case"GEOB":{let I=tE.get(t,0);t=t.subarray(1);let p=n.readNullTerminatedString(t,rU),B=p.text;t=t.subarray(p.len);let f=n.readNullTerminatedString(t,I),Q=f.text;t=t.subarray(f.len);let y=n.readNullTerminatedString(t,I),m=y.text;t=t.subarray(y.len),s={type:B,filename:Q,description:m,data:t};break}case"WCOM":case"WCOP":case"WOAF":case"WOAR":case"WOAS":case"WORS":case"WPAY":case"WPUB":s=n.readNullTerminatedString(t,rU).text;break;case"WXXX":{let I=tE.get(t,0);t=t.subarray(1);let p=n.readNullTerminatedString(t,I),B=p.text;t=t.subarray(p.len),s={description:B,url:n.trimNullPadding(Qi(t,In))};break}case"WFD":case"WFED":{let I=tE.get(t,0);t=t.subarray(1),s=n.readNullTerminatedString(t,I).text;break}case"MCDI":{s=t.subarray(0,A);break}case"CHAP":{ZO("Reading CHAP"),c=Xs(t,In);let I={label:Qi(t.subarray(0,c),In),info:eU.get(t,c+1),frames:new Map};for(r+=c+1+eU.len;r=i.length)return{text:Qi(t,o.encoding),len:e};let r=t.subarray(0,a+A);return{text:Qi(r,o.encoding),len:a+A+n.getNullTerminatorLength(o.encoding)}}static fixPictureMimeType(t){switch(t=t.toLocaleLowerCase(),t){case"jpg":return"image/jpeg";case"png":return"image/png"}return t}static functionList(t){let o={};for(let a=0;a+11?this.warningCollector.addWarning(`ID3v2.${this.major} ${t} uses non standard null-separator.`):a=o.split(/\//g)):a=o.split(/\x00/g),n.trimArray(a)}static trimArray(t){return t.map(o=>n.trimNullPadding(o).trim())}static trimNullPadding(t){let o=t.length;for(;o>0&&t.charCodeAt(o-1)===0;)o--;return o===t.length?t:t.slice(0,o)}static readIdentifierAndData(t,o){let a=n.readNullTerminatedString(t,{encoding:o,bom:!1});return{id:a.text,data:t.subarray(a.len)}}static getNullTerminatorLength(t){return t.startsWith("utf-16")?2:1}},wI=class extends mt("id3v2"){}});function cze(n){throw new wI(`Unexpected majorVer: ${n}`)}var ln,oE=ue(()=>{DA();tU();QI();AU();ln=class n{constructor(){this.tokenizer=void 0,this.id3Header=void 0,this.metadata=void 0,this.headerType=void 0,this.options=void 0}static removeUnsyncBytes(t){let o=0,a=0;for(;o0?this.parseExtendedHeaderData(o,t.size):this.parseId3Data(this.id3Header.size-t.size)}async parseExtendedHeaderData(t,o){return await this.tokenizer.ignore(t),this.parseId3Data(this.id3Header.size-o)}async parseId3Data(t){let o=await this.tokenizer.readToken(new Mt(t));for(let a of this.parseMetadata(o))switch(a.id){case"TXXX":a.value&&await this.handleTag(a,a.value.text,()=>a.value.description);break;default:await(Array.isArray(a.value)?Promise.all(a.value.map(e=>this.addTag(a.id,e))):this.addTag(a.id,a.value))}}async handleTag(t,o,a,e=i=>i){await Promise.all(o.map(i=>this.addTag(n.makeDescriptionTagName(t.id,a(i)),e(i))))}async addTag(t,o){await this.metadata.addTag(this.headerType,t,o)}parseMetadata(t){let o=0,a=[];for(;o!==t.length;){let e=wf(this.id3Header.version.major);if(o+e>t.length){this.metadata.addWarning("Illegal ID3v2 tag length");break}let i=t.subarray(o,o+e);o+=e;let A=Df(i,this.id3Header.version.major,this.metadata),r=t.subarray(o,o+A.length);o+=A.length;let s=n.readFrameData(r,A,this.id3Header.version.major,!this.options.skipCovers,this.metadata);s&&a.push({id:A.id,value:s})}return a}static mapId3v2Chapters(t){if(!t)return;let o=t.filter(g=>g.id==="CHAP");if(!o?.length)return;let e=t.filter(g=>g.id==="CTOC")?.find(g=>g.value.flags?.topLevel),i=new Map;for(let g of o)i.set(g.value.label,g.value);let A=e?.value.childElementIds,r=[],s=A??[...i.keys()];for(let g of s){let c=i.get(g);if(!c)continue;let I=c.frames,p=I.get("TIT2");p&&r.push({id:g,title:p,url:I.get("WXXX"),start:c.info.startTime/1e3,end:c.info.endTime/1e3,image:I.get("APIC")})}return A||r.sort((g,c)=>g.start-c.start),r.length?r:void 0}}});var eae,iU,$s,Of=ue(()=>{an();eae=ze(lt(),1);QI();oE();Sf();$a();iU=(0,eae.default)("music-metadata:parser:ID3"),$s=class extends Gt{constructor(){super(...arguments),this.id3parser=new ln}static async startsWithID3v2Header(t){return(await t.peekToken(Qf)).fileIdentifier==="ID3"}async parse(){try{await this.parseID3v2()}catch(t){if(t instanceof kA)iU("End-of-stream");else throw t}}finalize(){}async parseID3v2(){await this.tryReadId3v2Headers(),iU("End of ID3v2 header, go to MPEG-parser: pos=%s",this.tokenizer.position),await this.postId3v2Parse(),this.options.skipPostHeaders&&this.metadata.hasAny()?this.finalize():(await new WO(this.metadata,this.tokenizer,this.options).parse(),this.finalize())}async tryReadId3v2Headers(){if((await this.tokenizer.peekToken(Qf)).fileIdentifier==="ID3")return iU("Found ID3v2 header, pos=%s",this.tokenizer.position),await this.id3parser.parse(this.metadata,this.tokenizer,this.options),this.tryReadId3v2Headers()}}});var aU,Aae=ue(()=>{nr();aU={len:2,get:(n,t)=>{let o=XA(n,t,0,3),a=XA(n,t,6,1),e=XA(n,t,7,9)/10;if(o>0)return{type:XA(n,t,0,3),origin:XA(n,t,3,3),adjustment:a?-e:e}}}});var tae,rae=ue(()=>{DA();nr();Aae();tae={len:27,get:(n,t)=>{let o=xe.get(n,t+2);return{revision:XA(n,t,0,4),vbr_method:XA(n,t,4,4),lowpass_filter:100*QA.get(n,t+1),track_peak:o===0?null:o/2**23,track_gain:aU.get(n,6),album_gain:aU.get(n,8),music_length:xe.get(n,t+20),music_crc:QA.get(n,t+24),header_crc:LA.get(n,t+24)}}}});async function iae(n){let t=await n.readToken(Ize),o={numFrames:null,streamSize:null,vbrScale:null};if(t.frames&&(o.numFrames=await n.readToken(xe)),t.bytes&&(o.streamSize=await n.readToken(xe)),t.toc&&(o.toc=new Uint8Array(100),await n.readBuffer(o.toc)),t.vbrScale&&(o.vbrScale=await n.readToken(xe)),await n.peekToken(new We(4,"ascii"))==="LAME"){await n.ignore(4),o.lame={version:await n.readToken(new We(5,"ascii"))};let e=o.lame.version.match(/\d+.\d+/g);if(e!==null){let A=e[0].split(".").map(r=>Number.parseInt(r,10));A[0]>=3&&A[1]>=90&&(o.lame.extended=await n.readToken(tae))}}return o}var oU,$O,Ize,aae=ue(()=>{DA();nr();rae();oU=new We(4,"ascii"),$O=new We(6,"ascii"),Ize={len:4,get:(n,t)=>({frames:Li(n,t,31),bytes:Li(n,t,30),toc:Li(n,t,29),vbrScale:Li(n,t,28)})}});var cae={};Lr(cae,{MpegContentError:()=>op,MpegParser:()=>nU});function pze(n){return`V${Math.floor((100-n)/10)}`}var gae,yo,op,oae,nae,lze,mo,sae,nU,Iae=ue(()=>{DA();an();gae=ze(lt(),1);nr();Of();aae();or();yo=(0,gae.default)("music-metadata:parser:mpeg"),op=class extends mt("MPEG"){},oae=1024,nae={AudioObjectTypes:["AAC Main","AAC LC","AAC SSR","AAC LTP"],SamplingFrequencies:[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350,null,null,null]},lze=[void 0,["front-center"],["front-left","front-right"],["front-center","front-left","front-right"],["front-center","front-left","front-right","back-center"],["front-center","front-left","front-right","back-left","back-right"],["front-center","front-left","front-right","back-left","back-right","LFE-channel"],["front-center","front-left","front-right","side-left","side-right","back-left","back-right","LFE-channel"]],mo=class n{constructor(t,o){this.bitrateIndex=null,this.sampRateFreqIndex=null,this.padding=null,this.privateBit=null,this.channelModeIndex=null,this.modeExtension=null,this.isOriginalMedia=null,this.version=null,this.bitrate=null,this.samplingRate=null,this.frameLength=0,this.versionIndex=XA(t,o+1,3,2),this.layer=n.LayerDescription[XA(t,o+1,5,2)],this.versionIndex>1&&this.layer===0?this.parseAdtsHeader(t,o):this.parseMpegHeader(t,o),this.isProtectedByCRC=!Li(t,o+1,7)}calcDuration(t){return this.samplingRate==null?null:t*this.calcSamplesPerFrame()/this.samplingRate}calcSamplesPerFrame(){return n.samplesInFrameTable[this.version===1?0:1][this.layer]}calculateSideInfoLength(){if(this.layer!==3)return 2;if(this.channelModeIndex===3){if(this.version===1)return 17;if(this.version===2||this.version===2.5)return 9}else{if(this.version===1)return 32;if(this.version===2||this.version===2.5)return 17}return null}calcSlotSize(){return[null,4,1,1][this.layer]}parseMpegHeader(t,o){this.container="MPEG",this.bitrateIndex=XA(t,o+2,0,4),this.sampRateFreqIndex=XA(t,o+2,4,2),this.padding=Li(t,o+2,6),this.privateBit=Li(t,o+2,7),this.channelModeIndex=XA(t,o+3,0,2),this.modeExtension=XA(t,o+3,2,2),this.isCopyrighted=Li(t,o+3,4),this.isOriginalMedia=Li(t,o+3,5),this.emphasis=XA(t,o+3,7,2),this.version=n.VersionID[this.versionIndex],this.channelMode=n.ChannelMode[this.channelModeIndex],this.codec=`MPEG ${this.version} Layer ${this.layer}`;let a=this.calcBitrate();if(!a)throw new op("Cannot determine bit-rate");if(this.bitrate=a*1e3,this.samplingRate=this.calcSamplingRate(),this.samplingRate==null)throw new op("Cannot determine sampling-rate")}parseAdtsHeader(t,o){yo("layer=0 => ADTS"),this.version=this.versionIndex===2?4:2,this.container=`ADTS/MPEG-${this.version}`;let a=XA(t,o+2,0,2);this.codec="AAC",this.codecProfile=nae.AudioObjectTypes[a],yo(`MPEG-4 audio-codec=${this.codec}`);let e=XA(t,o+2,2,4);this.samplingRate=nae.SamplingFrequencies[e],yo(`sampling-rate=${this.samplingRate}`);let i=XA(t,o+2,7,3);this.mp4ChannelConfig=lze[i],yo(`channel-config=${this.mp4ChannelConfig?this.mp4ChannelConfig.join("+"):"?"}`),this.frameLength=XA(t,o+3,6,2)<<11}calcBitrate(){if(this.bitrateIndex===0||this.bitrateIndex===15)return null;if(this.version&&this.bitrateIndex){let t=10*Math.floor(this.version)+this.layer;return n.bitrate_index[this.bitrateIndex][t]}return null}calcSamplingRate(){return this.sampRateFreqIndex===3||this.version===null||this.sampRateFreqIndex==null?null:n.sampling_rate_freq_index[this.version][this.sampRateFreqIndex]}};mo.SyncByte1=255;mo.SyncByte2=224;mo.VersionID=[2.5,null,2,1];mo.LayerDescription=[0,3,2,1];mo.ChannelMode=["stereo","joint_stereo","dual_channel","mono"];mo.bitrate_index={1:{11:32,12:32,13:32,21:32,22:8,23:8},2:{11:64,12:48,13:40,21:48,22:16,23:16},3:{11:96,12:56,13:48,21:56,22:24,23:24},4:{11:128,12:64,13:56,21:64,22:32,23:32},5:{11:160,12:80,13:64,21:80,22:40,23:40},6:{11:192,12:96,13:80,21:96,22:48,23:48},7:{11:224,12:112,13:96,21:112,22:56,23:56},8:{11:256,12:128,13:112,21:128,22:64,23:64},9:{11:288,12:160,13:128,21:144,22:80,23:80},10:{11:320,12:192,13:160,21:160,22:96,23:96},11:{11:352,12:224,13:192,21:176,22:112,23:112},12:{11:384,12:256,13:224,21:192,22:128,23:128},13:{11:416,12:320,13:256,21:224,22:144,23:144},14:{11:448,12:384,13:320,21:256,22:160,23:160}};mo.sampling_rate_freq_index={1:{0:44100,1:48e3,2:32e3},2:{0:22050,1:24e3,2:16e3},2.5:{0:11025,1:12e3,2:8e3}};mo.samplesInFrameTable=[[0,384,1152,1152],[0,384,1152,576]];sae={len:4,get:(n,t)=>new mo(n,t)};nU=class extends $s{constructor(){super(...arguments),this.frameCount=0,this.syncFrameCount=-1,this.totalDataLength=0,this.bitrates=[],this.offset=0,this.frame_size=0,this.calculateEofDuration=!1,this.samplesPerFrame=null,this.buf_frame_header=new Uint8Array(4),this.mpegOffset=null,this.syncPeek={buf:new Uint8Array(oae),len:0}}async postId3v2Parse(){this.metadata.setFormat("lossless",!1),this.metadata.setAudioOnly();try{let t=!1;for(;!t;)await this.sync(),t=await this.parseCommonMpegHeader()}catch(t){if(t instanceof kA){if(yo("End-of-stream"),this.calculateEofDuration&&this.samplesPerFrame!==null){let o=this.frameCount*this.samplesPerFrame;if(this.metadata.setFormat("numberOfSamples",o),this.metadata.format.sampleRate){let a=o/this.metadata.format.sampleRate;yo(`Calculate duration at EOF: ${a} sec.`,a),this.metadata.setFormat("duration",a)}}}else throw t}}finalize(){let t=this.metadata.format,o=!!this.metadata.native.ID3v1;if(this.mpegOffset!==null){if(t.duration&&this.tokenizer.fileInfo.size){let a=this.tokenizer.fileInfo.size-this.mpegOffset-(o?128:0);t.codecProfile&&t.codecProfile[0]==="V"&&this.metadata.setFormat("bitrate",a*8/t.duration)}if(this.tokenizer.fileInfo.size&&t.codecProfile==="CBR"){let a=this.tokenizer.fileInfo.size-this.mpegOffset-(o?128:0);if(this.frame_size!==null&&this.samplesPerFrame!==null){let e=Math.round(a/this.frame_size)*this.samplesPerFrame;if(this.metadata.setFormat("numberOfSamples",e),t.sampleRate&&!t.duration){let i=e/t.sampleRate;yo("Calculate CBR duration based on file size: %s",i),this.metadata.setFormat("duration",i)}}}}}async sync(){let t=!1;for(;;){let o=0;if(this.syncPeek.len=await this.tokenizer.peekBuffer(this.syncPeek.buf,{length:oae,mayBeLess:!0}),this.syncPeek.len<=163)throw new kA;for(;;){if(t&&(this.syncPeek.buf[o]&224)===224){this.buf_frame_header[0]=mo.SyncByte1,this.buf_frame_header[1]=this.syncPeek.buf[o],await this.tokenizer.ignore(o),yo(`Sync at offset=${this.tokenizer.position-1}, frameCount=${this.frameCount}`),this.syncFrameCount===this.frameCount&&(yo(`Re-synced MPEG stream, frameCount=${this.frameCount}`),this.frameCount=0,this.frame_size=0),this.syncFrameCount=this.frameCount;return}if(t=!1,o=this.syncPeek.buf.indexOf(mo.SyncByte1,o),o===-1){if(this.syncPeek.len=2&&t.layer===0?this.parseAdts(t):this.parseAudioFrameHeader(t)}async parseAudioFrameHeader(t){this.metadata.setFormat("numberOfChannels",t.channelMode==="mono"?1:2),this.metadata.setFormat("bitrate",t.bitrate),this.frameCount<20*1e4&&yo("offset=%s MP%s bitrate=%s sample-rate=%s",this.tokenizer.position-4,t.layer,t.bitrate,t.samplingRate);let o=t.calcSlotSize();if(o===null)throw new op("invalid slot_size");let a=t.calcSamplesPerFrame();yo(`samples_per_frame=${a}`);let e=a/8;if(t.bitrate!==null&&t.samplingRate!=null){let i=e*t.bitrate/t.samplingRate+(t.padding?o:0);this.frame_size=Math.floor(i)}if(this.audioFrameHeader=t,t.bitrate!==null&&this.bitrates.push(t.bitrate),this.frameCount===1)return this.offset=sae.len,await this.skipSideInformation(),!1;if(this.frameCount===4){if(this.areAllSame(this.bitrates)){if(this.samplesPerFrame=a,this.metadata.setFormat("codecProfile","CBR"),this.tokenizer.fileInfo.size)return!0}else if(this.metadata.format.duration)return!0;if(!this.options.duration)return!0}return this.options.duration&&this.frameCount===4&&(this.samplesPerFrame=a,this.calculateEofDuration=!0),this.offset=4,t.isProtectedByCRC?(await this.parseCrc(),!1):(await this.skipSideInformation(),!1)}async parseAdts(t){let o=new Uint8Array(3);if(await this.tokenizer.readBuffer(o),t.frameLength+=XA(o,0,0,11),this.totalDataLength+=t.frameLength,this.samplesPerFrame=1024,t.samplingRate!==null){let a=t.samplingRate/this.samplesPerFrame,i=8*(this.frameCount===0?0:this.totalDataLength/this.frameCount)*a+.5;this.metadata.setFormat("bitrate",i),yo(`frame-count=${this.frameCount}, size=${t.frameLength} bytes, bit-rate=${i}`)}if(await this.tokenizer.ignore(t.frameLength>7?t.frameLength-7:1),this.frameCount===3)if(this.metadata.setFormat("codecProfile",t.codecProfile),t.mp4ChannelConfig&&this.metadata.setFormat("numberOfChannels",t.mp4ChannelConfig.length),this.options.duration)this.calculateEofDuration=!0;else return!0;return!1}async parseCrc(){return await this.tokenizer.ignore(on.len),this.offset+=on.len,this.skipSideInformation()}async skipSideInformation(){if(this.audioFrameHeader){let t=this.audioFrameHeader.calculateSideInfoLength();if(t!==null){await this.tokenizer.readToken(new Mt(t)),this.offset+=t,await this.readXtraInfoHeader();return}}}async readXtraInfoHeader(){let t=await this.tokenizer.readToken(oU);switch(this.offset+=oU.len,t){case"Info":return this.metadata.setFormat("codecProfile","CBR"),this.readXingInfoHeader();case"Xing":{let a=await this.readXingInfoHeader();if(a.vbrScale!==null){let e=pze(a.vbrScale);this.metadata.setFormat("codecProfile",e)}return null}case"Xtra":break;case"LAME":{let a=await this.tokenizer.readToken($O);if(this.frame_size!==null&&this.frame_size>=this.offset+$O.len)return this.offset+=$O.len,this.metadata.setFormat("tool",`LAME ${a}`),await this.skipFrameData(this.frame_size-this.offset),null;this.metadata.addWarning("Corrupt LAME header");break}}let o=this.frame_size-this.offset;return o<0?this.metadata.addWarning(`Frame ${this.frameCount}corrupt: negative frameDataLeft`):await this.skipFrameData(o),null}async readXingInfoHeader(){let t=this.tokenizer.position,o=await iae(this.tokenizer);if(this.offset+=this.tokenizer.position-t,o.lame&&(this.metadata.setFormat("tool",`LAME ${gn(o.lame.version)}`),o.lame.extended&&(this.metadata.setFormat("trackPeakLevel",o.lame.extended.track_peak),o.lame.extended.track_gain&&this.metadata.setFormat("trackGain",o.lame.extended.track_gain.adjustment),o.lame.extended.album_gain&&this.metadata.setFormat("albumGain",o.lame.extended.album_gain.adjustment),this.metadata.setFormat("duration",o.lame.extended.music_length/1e3))),o.streamSize&&this.audioFrameHeader&&o.numFrames!==null){let e=this.audioFrameHeader.calcDuration(o.numFrames);return this.metadata.setFormat("duration",e),yo("Get duration from Xing header: %s",this.metadata.format.duration),o}let a=this.frame_size-this.offset;return await this.skipFrameData(a),o}async skipFrameData(t){if(t<0)throw new op("frame-data-left cannot be negative");await this.tokenizer.ignore(t)}areAllSame(t){let o=t[0];return t.every(a=>a===o)}}});var lae,pae=ue(()=>{lae={parserType:"mpeg",extensions:[".mp2",".mp3",".m2a",".aac","aacp"],mimeTypes:["audio/mpeg","audio/mp3","audio/aacs","audio/aacp"],async load(){return(await Promise.resolve().then(()=>(Iae(),cae))).MpegParser}}});var dae,hae=ue(()=>{dae={parserType:"apev2",extensions:[".ape"],mimeTypes:["audio/ape","audio/monkeys-audio"],async load(){return(await Promise.resolve().then(()=>(ap(),qie))).APEv2Parser}}});function sU(n){let t=n.trim();if(t.length!==36||t[8]!=="-"||t[13]!=="-"||t[18]!=="-"||t[23]!=="-")throw new Error(`Invalid GUID format: ${n}`);let o,a=new Uint8Array(16);o=parseInt(t.slice(0,8),16),a[0]=o&255,a[1]=o>>>8&255,a[2]=o>>>16&255,a[3]=o>>>24&255,o=parseInt(t.slice(9,13),16),a[4]=o&255,a[5]=o>>>8&255,o=parseInt(t.slice(14,18),16),a[6]=o&255,a[7]=o>>>8&255,o=parseInt(t.slice(19,23),16),a[8]=o>>>8&255,a[9]=o&255,o=parseInt(t.slice(24,32),16),a[10]=o>>>24&255,a[11]=o>>>16&255,a[12]=o>>>8&255,a[13]=o&255,o=parseInt(t.slice(32,36),16),a[14]=o>>>8&255,a[15]=o&255;for(let e=0;e<16;e++)if(!Number.isFinite(a[e]))throw new Error(`Invalid GUID format: ${n}`);if(!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(t))throw new Error(`Invalid GUID format: ${n}`);return a}var eb,Eae=ue(()=>{eb=class n{constructor(t){if(t.length!==16)throw new Error("GUID must be exactly 16 bytes");this.bytes=t}static fromString(t){return new n(sU(t))}toString(){let t=this.bytes,o=s=>s.toString(16).padStart(2,"0"),a=o(t[3])+o(t[2])+o(t[1])+o(t[0]),e=o(t[5])+o(t[4]),i=o(t[7])+o(t[6]),A=o(t[8])+o(t[9]),r=o(t[10])+o(t[11])+o(t[12])+o(t[13])+o(t[14])+o(t[15]);return`${a}-${e}-${i}-${A}-${r}`.toUpperCase()}equals(t,o=0){if(o<0||t.length-o<16)return!1;let a=this.bytes;for(let e=0;e<16;e++)if(t[o+e]!==a[e])return!1;return!0}}});var Ye,sr,gU=ue(()=>{Eae();Ye=class n{static fromBin(t,o=0){return new n(n.decode(t,o))}static decode(t,o=0){return new eb(t.subarray(o,o+16)).toString()}static decodeMediaType(t){switch(t.str){case n.AudioMedia.str:return"audio";case n.VideoMedia.str:return"video";case n.CommandMedia.str:return"command";case n.Degradable_JPEG_Media.str:return"degradable-jpeg";case n.FileTransferMedia.str:return"file-transfer";case n.BinaryMedia.str:return"binary"}}static encode(t){return sU(t)}constructor(t){this.str=t}equals(t){return this.str===t.str}toBin(){return n.encode(this.str)}};Ye.HeaderObject=new Ye("75B22630-668E-11CF-A6D9-00AA0062CE6C");Ye.DataObject=new Ye("75B22636-668E-11CF-A6D9-00AA0062CE6C");Ye.SimpleIndexObject=new Ye("33000890-E5B1-11CF-89F4-00A0C90349CB");Ye.IndexObject=new Ye("D6E229D3-35DA-11D1-9034-00A0C90349BE");Ye.MediaObjectIndexObject=new Ye("FEB103F8-12AD-4C64-840F-2A1D2F7AD48C");Ye.TimecodeIndexObject=new Ye("3CB73FD0-0C4A-4803-953D-EDF7B6228F0C");Ye.FilePropertiesObject=new Ye("8CABDCA1-A947-11CF-8EE4-00C00C205365");Ye.StreamPropertiesObject=new Ye("B7DC0791-A9B7-11CF-8EE6-00C00C205365");Ye.HeaderExtensionObject=new Ye("5FBF03B5-A92E-11CF-8EE3-00C00C205365");Ye.CodecListObject=new Ye("86D15240-311D-11D0-A3A4-00A0C90348F6");Ye.ScriptCommandObject=new Ye("1EFB1A30-0B62-11D0-A39B-00A0C90348F6");Ye.MarkerObject=new Ye("F487CD01-A951-11CF-8EE6-00C00C205365");Ye.BitrateMutualExclusionObject=new Ye("D6E229DC-35DA-11D1-9034-00A0C90349BE");Ye.ErrorCorrectionObject=new Ye("75B22635-668E-11CF-A6D9-00AA0062CE6C");Ye.ContentDescriptionObject=new Ye("75B22633-668E-11CF-A6D9-00AA0062CE6C");Ye.ExtendedContentDescriptionObject=new Ye("D2D0A440-E307-11D2-97F0-00A0C95EA850");Ye.ContentBrandingObject=new Ye("2211B3FA-BD23-11D2-B4B7-00A0C955FC6E");Ye.StreamBitratePropertiesObject=new Ye("7BF875CE-468D-11D1-8D82-006097C9A2B2");Ye.ContentEncryptionObject=new Ye("2211B3FB-BD23-11D2-B4B7-00A0C955FC6E");Ye.ExtendedContentEncryptionObject=new Ye("298AE614-2622-4C17-B935-DAE07EE9289C");Ye.DigitalSignatureObject=new Ye("2211B3FC-BD23-11D2-B4B7-00A0C955FC6E");Ye.PaddingObject=new Ye("1806D474-CADF-4509-A4BA-9AABCB96AAE8");Ye.ExtendedStreamPropertiesObject=new Ye("14E6A5CB-C672-4332-8399-A96952065B5A");Ye.AdvancedMutualExclusionObject=new Ye("A08649CF-4775-4670-8A16-6E35357566CD");Ye.GroupMutualExclusionObject=new Ye("D1465A40-5A79-4338-B71B-E36B8FD6C249");Ye.StreamPrioritizationObject=new Ye("D4FED15B-88D3-454F-81F0-ED5C45999E24");Ye.BandwidthSharingObject=new Ye("A69609E6-517B-11D2-B6AF-00C04FD908E9");Ye.LanguageListObject=new Ye("7C4346A9-EFE0-4BFC-B229-393EDE415C85");Ye.MetadataObject=new Ye("C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA");Ye.MetadataLibraryObject=new Ye("44231C94-9498-49D1-A141-1D134E457054");Ye.IndexParametersObject=new Ye("D6E229DF-35DA-11D1-9034-00A0C90349BE");Ye.MediaObjectIndexParametersObject=new Ye("6B203BAD-3F11-48E4-ACA8-D7613DE2CFA7");Ye.TimecodeIndexParametersObject=new Ye("F55E496D-9797-4B5D-8C8B-604DFE9BFB24");Ye.CompatibilityObject=new Ye("26F18B5D-4584-47EC-9F5F-0E651F0452C9");Ye.AdvancedContentEncryptionObject=new Ye("43058533-6981-49E6-9B74-AD12CB86D58C");Ye.AudioMedia=new Ye("F8699E40-5B4D-11CF-A8FD-00805F5C442B");Ye.VideoMedia=new Ye("BC19EFC0-5B4D-11CF-A8FD-00805F5C442B");Ye.CommandMedia=new Ye("59DACFC0-59E6-11D0-A3AC-00A0C90348F6");Ye.JFIF_Media=new Ye("B61BE100-5B4E-11CF-A8FD-00805F5C442B");Ye.Degradable_JPEG_Media=new Ye("35907DE0-E415-11CF-A917-00805F5C442B");Ye.FileTransferMedia=new Ye("91BD222C-F21C-497A-8B6D-5AA86BFC0185");Ye.BinaryMedia=new Ye("3AFB65E2-47EF-40F2-AC2C-70A90D71D343");Ye.ASF_Index_Placeholder_Object=new Ye("D9AADE20-7C17-4F9C-BC28-8555DD98E2A2");sr=Ye});function Cae(n){return dze[n]}function bf(n){return gn(Qi(n,"utf-16le"))}function uae(n){return new Uint8Array(n)}function hze(n,t=0){return Bae(n,t)===1}function Eze(n,t=0){return Le.get(n,t)}function uze(n,t=0){return Fr.get(n,t)}function Bae(n,t=0){return SA.get(n,t)}var dze,fae=ue(()=>{DA();nr();dze=[bf,uae,hze,Eze,uze,Bae,uae]});async function Qae(n){let t=await n.readNumber(SA);return(await n.readToken(new We(t*2,"utf-16le"))).replace("\0","")}async function mae(n){let t=await n.readToken(Cze),o=[];for(let a=0;a{DA();nr();gU();fae();QI();or();nE=class extends mt("ASF"){},yae={len:30,get:(n,t)=>({objectId:sr.fromBin(n,t),objectSize:Number(Fr.get(n,t+16)),numberOfHeaderObjects:Le.get(n,t+24)})},DI={len:24,get:(n,t)=>({objectId:sr.fromBin(n,t),objectSize:Number(Fr.get(n,t+16))})},ic=class{constructor(t){this.len=Number(t.objectSize)-DI.len}postProcessTag(t,o,a,e){if(o==="WM/Picture")t.push({id:o,value:cU.fromBuffer(e)});else{let i=Cae(a);if(!i)throw new nE(`unexpected value headerType: ${a}`);t.push({id:o,value:i(e)})}}},Mf=class extends ic{get(t,o){return null}},sE=class extends ic{get(t,o){return{fileId:sr.fromBin(t,o),fileSize:Fr.get(t,o+16),creationDate:Fr.get(t,o+24),dataPacketsCount:Fr.get(t,o+32),playDuration:Fr.get(t,o+40),sendDuration:Fr.get(t,o+48),preroll:Fr.get(t,o+56),flags:{broadcast:GA(t,o+64,24),seekable:GA(t,o+64,25)},minimumDataPacketSize:Le.get(t,o+68),maximumDataPacketSize:Le.get(t,o+72),maximumBitrate:Le.get(t,o+76)}}};sE.guid=sr.FilePropertiesObject;gE=class extends ic{get(t,o){return{streamType:sr.decodeMediaType(sr.fromBin(t,o)),errorCorrectionType:sr.fromBin(t,o+8)}}};gE.guid=sr.StreamPropertiesObject;cE=class{constructor(){this.len=22}get(t,o){let a=new DataView(t.buffer,o);return{reserved1:sr.fromBin(t,o),reserved2:a.getUint16(16,!0),extensionDataSize:a.getUint16(18,!0)}}};cE.guid=sr.HeaderExtensionObject;Cze={len:20,get:(n,t)=>({entryCount:new DataView(n.buffer,t).getUint16(16,!0)})};np=class n extends ic{get(t,o){let a=[],e=new DataView(t.buffer,o),i=10;for(let A=0;A0){let s=n.contentDescTags[A],g=i+r;a.push({id:s,value:bf(t.subarray(o+i,o+g))}),i=g}}return a}};np.guid=sr.ContentDescriptionObject;np.contentDescTags=["Title","Author","Copyright","Description","Rating"];IE=class extends ic{get(t,o){let a=[],e=new DataView(t.buffer,o),i=e.getUint16(0,!0),A=2;for(let r=0;rpU});var Sae,lU,yze,pU,Dae=ue(()=>{Sae=ze(lt(),1);tp();gU();IU();$a();IU();lU=(0,Sae.default)("music-metadata:parser:ASF"),yze="asf",pU=class extends Gt{async parse(){let t=await this.tokenizer.readToken(yae);if(!t.objectId.equals(sr.HeaderObject))throw new nE(`expected asf header; but was not found; got: ${t.objectId.str}`);await this.parseObjectHeader(t.numberOfHeaderObjects)}async parseObjectHeader(t){let o;do{let a=await this.tokenizer.readToken(DI);switch(lU("header GUID=%s",a.objectId.str),a.objectId.str){case sE.guid.str:{let e=await this.tokenizer.readToken(new sE(a));this.metadata.setFormat("duration",Number(e.playDuration/BigInt(1e3))/1e4-Number(e.preroll)/1e3),this.metadata.setFormat("bitrate",e.maximumBitrate);break}case gE.guid.str:{let e=await this.tokenizer.readToken(new gE(a));this.metadata.setFormat("container",`ASF/${e.streamType}`);break}case cE.guid.str:{let e=await this.tokenizer.readToken(new cE);await this.parseExtensionObject(e.extensionDataSize);break}case np.guid.str:o=await this.tokenizer.readToken(new np(a)),await this.addTags(o);break;case IE.guid.str:o=await this.tokenizer.readToken(new IE(a)),await this.addTags(o);break;case sr.CodecListObject.str:{let e=await mae(this.tokenizer);e.forEach(A=>{this.metadata.addStreamInfo({type:A.type.videoCodec?fi.video:fi.audio,codecName:A.codecName})});let i=e.filter(A=>A.type.audioCodec).map(A=>A.codecName).join("/");this.metadata.setFormat("codec",i);break}case sr.StreamBitratePropertiesObject.str:await this.tokenizer.ignore(a.objectSize-DI.len);break;case sr.PaddingObject.str:lU("Padding: %s bytes",a.objectSize-DI.len),await this.tokenizer.ignore(a.objectSize-DI.len);break;default:this.metadata.addWarning(`Ignore ASF-Object-GUID: ${a.objectId.str}`),lU("Ignore ASF-Object-GUID: %s",a.objectId.str),await this.tokenizer.readToken(new Mf(a))}}while(--t)}async addTags(t){await Promise.all(t.map(({id:o,value:a})=>this.metadata.addTag(yze,o,a)))}async parseExtensionObject(t){do{let o=await this.tokenizer.readToken(DI),a=o.objectSize-DI.len;if(a<0)throw new nE(`Invalid ASF header object size: ${o.objectSize}`);switch(o.objectId.str){case lE.guid.str:await this.tokenizer.readToken(new lE(o));break;case sp.guid.str:{let e=await this.tokenizer.readToken(new sp(o));await this.addTags(e);break}case pE.guid.str:{let e=await this.tokenizer.readToken(new pE(o));await this.addTags(e);break}case sr.PaddingObject.str:await this.tokenizer.ignore(a);break;case sr.CompatibilityObject.str:await this.tokenizer.ignore(a);break;case sr.ASF_Index_Placeholder_Object.str:await this.tokenizer.ignore(a);break;default:this.metadata.addWarning(`Ignore ASF-Object-GUID: ${o.objectId.str}`),await this.tokenizer.readToken(new Mf(o));break}t-=o.objectSize}while(t>0)}}});var Oae,bae=ue(()=>{Oae={parserType:"asf",extensions:[".asf",".wma",".wmv"],mimeTypes:["audio/ms-wma","video/ms-wmv","audio/ms-asf","video/ms-asf","application/vnd.ms-asf"],async load(){return(await Promise.resolve().then(()=>(Dae(),wae))).AsfParser}}});var gp,Mae=ue(()=>{DA();ma();gp={len:12,get:(n,t)=>({chunkID:at.get(n,t),chunkSize:R2.get(n,t+4)})}});var Tae={};Lr(Tae,{DsdiffContentParseError:()=>dE,DsdiffParser:()=>dU});var _ae,Sa,dE,dU,Nae=ue(()=>{DA();_ae=ze(lt(),1);an();ma();$a();oE();Mae();or();Sa=(0,_ae.default)("music-metadata:parser:aiff"),dE=class extends mt("DSDIFF"){},dU=class extends Gt{async parse(){let t=await this.tokenizer.readToken(gp);if(t.chunkID!=="FRM8")throw new dE("Unexpected chunk-ID");this.metadata.setAudioOnly();let o=(await this.tokenizer.readToken(at)).trim();switch(o){case"DSD":return this.metadata.setFormat("container",`DSDIFF/${o}`),this.metadata.setFormat("lossless",!0),this.readFmt8Chunks(t.chunkSize-BigInt(at.len));default:throw new dE(`Unsupported DSDIFF type: ${o}`)}}async readFmt8Chunks(t){for(;t>=gp.len;){let o=await this.tokenizer.readToken(gp);Sa(`Chunk id=${o.chunkID}`),await this.readData(o),t-=BigInt(gp.len)+o.chunkSize}}async readData(t){Sa(`Reading data of chunk[ID=${t.chunkID}, size=${t.chunkSize}]`);let o=this.tokenizer.position;switch(t.chunkID.trim()){case"FVER":{let e=await this.tokenizer.readToken(Le);Sa(`DSDIFF version=${e}`);break}case"PROP":{if(await this.tokenizer.readToken(at)!=="SND ")throw new dE("Unexpected PROP-chunk ID");await this.handleSoundPropertyChunks(t.chunkSize-BigInt(at.len));break}case"ID3":{let e=await this.tokenizer.readToken(new Mt(Number(t.chunkSize))),i=Qo(e);await new ln().parse(this.metadata,i,this.options);break}case"DSD":this.metadata.format.numberOfChannels&&this.metadata.setFormat("numberOfSamples",Number(t.chunkSize*BigInt(8)/BigInt(this.metadata.format.numberOfChannels))),this.metadata.format.numberOfSamples&&this.metadata.format.sampleRate&&this.metadata.setFormat("duration",this.metadata.format.numberOfSamples/this.metadata.format.sampleRate);break;default:Sa(`Ignore chunk[ID=${t.chunkID}, size=${t.chunkSize}]`);break}let a=t.chunkSize-BigInt(this.tokenizer.position-o);a>0&&(Sa(`After Parsing chunk, remaining ${a} bytes`),await this.tokenizer.ignore(Number(a)))}async handleSoundPropertyChunks(t){for(Sa(`Parsing sound-property-chunks, remainingSize=${t}`);t>0;){let o=await this.tokenizer.readToken(gp);Sa(`Sound-property-chunk[ID=${o.chunkID}, size=${o.chunkSize}]`);let a=this.tokenizer.position;switch(o.chunkID.trim()){case"FS":{let i=await this.tokenizer.readToken(xe);this.metadata.setFormat("sampleRate",i);break}case"CHNL":{let i=await this.tokenizer.readToken(LA);this.metadata.setFormat("numberOfChannels",i),await this.handleChannelChunks(o.chunkSize-BigInt(LA.len));break}case"CMPR":{let i=(await this.tokenizer.readToken(at)).trim(),A=await this.tokenizer.readToken(QA),r=await this.tokenizer.readToken(new We(A,"ascii"));i==="DSD"&&(this.metadata.setFormat("lossless",!0),this.metadata.setFormat("bitsPerSample",1)),this.metadata.setFormat("codec",`${i} (${r})`);break}case"ABSS":{let i=await this.tokenizer.readToken(LA),A=await this.tokenizer.readToken(QA),r=await this.tokenizer.readToken(QA),s=await this.tokenizer.readToken(xe);Sa(`ABSS ${i}:${A}:${r}.${s}`);break}case"LSCO":{let i=await this.tokenizer.readToken(LA);Sa(`LSCO lsConfig=${i}`);break}default:Sa(`Unknown sound-property-chunk[ID=${o.chunkID}, size=${o.chunkSize}]`),await this.tokenizer.ignore(Number(o.chunkSize))}let e=o.chunkSize-BigInt(this.tokenizer.position-a);e>0&&(Sa(`After Parsing sound-property-chunk ${o.chunkSize}, remaining ${e} bytes`),await this.tokenizer.ignore(Number(e))),t-=BigInt(gp.len)+o.chunkSize,Sa(`Parsing sound-property-chunks, remainingSize=${t}`)}if(this.metadata.format.lossless&&this.metadata.format.sampleRate&&this.metadata.format.numberOfChannels&&this.metadata.format.bitsPerSample){let o=this.metadata.format.sampleRate*this.metadata.format.numberOfChannels*this.metadata.format.bitsPerSample;this.metadata.setFormat("bitrate",o)}}async handleChannelChunks(t){Sa(`Parsing channel-chunks, remainingSize=${t}`);let o=[];for(;t>=at.len;){let a=await this.tokenizer.readToken(at);Sa(`Channel[ID=${a}]`),o.push(a),t-=BigInt(at.len)}return Sa(`Channels: ${o.join(", ")}`),o}}});var Rae,kae=ue(()=>{Rae={parserType:"dsdiff",extensions:[".dff"],mimeTypes:["audio/dsf","audio/dsd"],async load(){return(await Promise.resolve().then(()=>(Nae(),Tae))).DsdiffParser}}});var vae,OI,Ab,hU=ue(()=>{DA();ma();or();vae={NONE:"not compressed PCM Apple Computer",sowt:"PCM (byte swapped)",fl32:"32-bit floating point IEEE 32-bit float",fl64:"64-bit floating point IEEE 64-bit float Apple Computer",alaw:"ALaw 2:1 8-bit ITU-T G.711 A-law",ulaw:"\xB5Law 2:1 8-bit ITU-T G.711 \xB5-law Apple Computer",ULAW:"CCITT G.711 u-law 8-bit ITU-T G.711 \xB5-law",ALAW:"CCITT G.711 A-law 8-bit ITU-T G.711 A-law",FL32:"Float 32 IEEE 32-bit float "},OI=class extends mt("AIFF"){},Ab=class{constructor(t,o){this.isAifc=o;let a=o?22:18;if(t.chunkSize>Math.abs(a):e<22){let A=QA.get(t,o+22);if(A>0){let r=(A+1)%2;if(23+A+r===this.len)i.compressionName=new We(A,"latin1").get(t,o+23);else throw new OI("Illegal pstring length")}else i.compressionName=void 0}}else i.compressionName="PCM";return i}}});var tb,Pae=ue(()=>{DA();ma();tb={len:8,get:(n,t)=>({chunkID:at.get(n,t),chunkSize:Number(BigInt(xe.get(n,t+4)))})}});var Fae={};Lr(Fae,{AIFFParser:()=>uU});var Gae,EU,uU,Lae=ue(()=>{DA();Gae=ze(lt(),1);an();oE();ma();$a();hU();hU();Pae();EU=(0,Gae.default)("music-metadata:parser:aiff"),uU=class extends Gt{constructor(){super(...arguments),this.isCompressed=null}async parse(){if((await this.tokenizer.readToken(tb)).chunkID!=="FORM")throw new OI("Invalid Chunk-ID, expected 'FORM'");let o=await this.tokenizer.readToken(at);switch(o){case"AIFF":this.metadata.setFormat("container",o),this.isCompressed=!1;break;case"AIFC":this.metadata.setFormat("container","AIFF-C"),this.isCompressed=!0;break;default:throw new OI(`Unsupported AIFF type: ${o}`)}this.metadata.setFormat("lossless",!this.isCompressed),this.metadata.setAudioOnly();try{for(;!this.tokenizer.fileInfo.size||this.tokenizer.fileInfo.size-this.tokenizer.position>=tb.len;){EU(`Reading AIFF chunk at offset=${this.tokenizer.position}`);let a=await this.tokenizer.readToken(tb),e=2*Math.round(a.chunkSize/2),i=await this.readData(a);await this.tokenizer.ignore(e-i)}}catch(a){if(a instanceof kA)EU("End-of-stream");else throw a}}async readData(t){switch(t.chunkID){case"COMM":{if(this.isCompressed===null)throw new OI("Failed to parse AIFF.COMM chunk when compression type is unknown");let o=await this.tokenizer.readToken(new Ab(t,this.isCompressed));return this.metadata.setFormat("bitsPerSample",o.sampleSize),this.metadata.setFormat("sampleRate",o.sampleRate),this.metadata.setFormat("numberOfChannels",o.numChannels),this.metadata.setFormat("numberOfSamples",o.numSampleFrames),this.metadata.setFormat("duration",o.numSampleFrames/o.sampleRate),(o.compressionName||o.compressionType)&&this.metadata.setFormat("codec",o.compressionName??vae[o.compressionType]),t.chunkSize}case"ID3 ":{let o=await this.tokenizer.readToken(new Mt(t.chunkSize)),a=Qo(o);return await new ln().parse(this.metadata,a,this.options),t.chunkSize}case"SSND":return this.metadata.format.duration&&this.metadata.setFormat("bitrate",8*t.chunkSize/this.metadata.format.duration),0;case"NAME":case"AUTH":case"(c) ":case"ANNO":return this.readTextChunk(t);default:return EU(`Ignore chunk id=${t.chunkID}, size=${t.chunkSize}`),0}}async readTextChunk(t){let a=(await this.tokenizer.readToken(new We(t.chunkSize,"ascii"))).split("\0").map(e=>e.trim()).filter(e=>e?.length);return await Promise.all(a.map(e=>this.metadata.addTag("AIFF",t.chunkID,e))),t.chunkSize}}});var Uae,Hae=ue(()=>{Uae={parserType:"aiff",extensions:[".aif","aiff","aifc"],mimeTypes:["audio/aiff","audio/aif","audio/aifc","application/aiff"],async load(){return(await Promise.resolve().then(()=>(Lae(),Fae))).AIFFParser}}});var _f,Kae,xae,Yae=ue(()=>{DA();ma();_f={len:12,get:(n,t)=>({id:at.get(n,t),size:Fr.get(n,t+4)})},Kae={len:16,get:(n,t)=>({fileSize:df.get(n,t),metadataPointer:df.get(n,t+8)})},xae={len:40,get:(n,t)=>({formatVersion:ur.get(n,t),formatID:ur.get(n,t+4),channelType:ur.get(n,t+8),channelNum:ur.get(n,t+12),samplingFrequency:ur.get(n,t+16),bitsPerSample:ur.get(n,t+20),sampleCount:df.get(n,t+24),blockSizePerChannel:ur.get(n,t+32)})}});var Jae={};Lr(Jae,{DsdContentParseError:()=>rb,DsfParser:()=>BU});var jae,CU,rb,BU,qae=ue(()=>{jae=ze(lt(),1);Of();Yae();oE();or();CU=(0,jae.default)("music-metadata:parser:DSF"),rb=class extends mt("DSD"){},BU=class extends $s{async postId3v2Parse(){let t=this.tokenizer.position,o=await this.tokenizer.readToken(_f);if(o.id!=="DSD ")throw new rb("Invalid chunk signature");this.metadata.setFormat("container","DSF"),this.metadata.setFormat("lossless",!0),this.metadata.setAudioOnly();let a=await this.tokenizer.readToken(Kae);if(a.metadataPointer===BigInt(0))CU("No ID3v2 tag present");else return CU(`expect ID3v2 at offset=${a.metadataPointer}`),await this.parseChunks(a.fileSize-o.size),await this.tokenizer.ignore(Number(a.metadataPointer)-this.tokenizer.position-t),new ln().parse(this.metadata,this.tokenizer,this.options)}async parseChunks(t){for(;t>=_f.len;){let o=await this.tokenizer.readToken(_f);switch(CU(`Parsing chunk name=${o.id} size=${o.size}`),o.id){case"fmt ":{let a=await this.tokenizer.readToken(xae);this.metadata.setFormat("numberOfChannels",a.channelNum),this.metadata.setFormat("sampleRate",a.samplingFrequency),this.metadata.setFormat("bitsPerSample",a.bitsPerSample),this.metadata.setFormat("numberOfSamples",a.sampleCount),this.metadata.setFormat("duration",Number(a.sampleCount)/a.samplingFrequency);let e=a.bitsPerSample*a.samplingFrequency*a.channelNum;this.metadata.setFormat("bitrate",e);return}default:this.tokenizer.ignore(Number(o.size)-_f.len);break}t-=o.size}}}});var zae,Vae=ue(()=>{zae={parserType:"dsf",extensions:[".dsf"],mimeTypes:["audio/dsf"],async load(){return(await Promise.resolve().then(()=>(qae(),Jae))).DsfParser}}});var bI,Tf,Wae,ib=ue(()=>{DA();QI();bI=class n{static fromBase64(t){return n.fromBuffer(Uint8Array.from(atob(t),o=>o.charCodeAt(0)))}static fromBuffer(t){return new n(t.length).get(t,0)}constructor(t){this.len=t}get(t,o){let a=$h[xe.get(t,o)];o+=4;let e=xe.get(t,o);o+=4;let i=new We(e,"utf-8").get(t,o);o+=e;let A=xe.get(t,o);o+=4;let r=new We(A,"utf-8").get(t,o);o+=A;let s=xe.get(t,o);o+=4;let g=xe.get(t,o);o+=4;let c=xe.get(t,o);o+=4;let I=xe.get(t,o);o+=4;let p=xe.get(t,o);o+=4;let B=t.slice(o,o+p);return{type:a,format:i,description:r,width:s,height:g,colour_depth:c,indexed_color:I,data:B}}},Tf={len:7,get:(n,t)=>({packetType:QA.get(n,t),vorbis:new We(6,"ascii").get(n,t+1)})},Wae={len:23,get:(n,t)=>({version:Le.get(n,t+0),channelMode:QA.get(n,t+4),sampleRate:Le.get(n,t+5),bitrateMax:Le.get(n,t+9),bitrateNominal:Le.get(n,t+13),bitrateMin:Le.get(n,t+17)})}});var hE,fU=ue(()=>{DA();js();hE=class{constructor(t,o){this.data=t,this.offset=o}readInt32(){let t=Le.get(this.data,this.offset);return this.offset+=4,t}readStringUtf8(){let t=this.readInt32(),o=Tr(this.data.subarray(this.offset,this.offset+t),"utf-8");return this.offset+=t,o}parseUserComment(){let t=this.offset,o=this.readStringUtf8(),a=o.indexOf("=");return{key:o.substring(0,a).toUpperCase(),value:o.substring(a+1),len:this.offset-t}}}});var Zae,EE,Nf,eg,Rf=ue(()=>{DA();Zae=ze(lt(),1);fU();ib();or();EE=(0,Zae.default)("music-metadata:parser:ogg:vorbis1"),Nf=class extends mt("Vorbis"){},eg=class n{constructor(t,o){this.pageSegments=[],this.durationOnLastPage=!0,this.metadata=t,this.options=o}async parsePage(t,o){if(this.lastPageHeader=t,t.headerType.firstPage)this.parseFirstPage(t,o);else{if(t.headerType.continued){if(this.pageSegments.length===0)throw new Nf("Cannot continue on previous page");this.pageSegments.push(o)}if(t.headerType.lastPage||!t.headerType.continued){if(this.pageSegments.length>0){let a=n.mergeUint8Arrays(this.pageSegments);await this.parseFullPage(a)}this.pageSegments=t.headerType.lastPage?[]:[o]}}}static mergeUint8Arrays(t){let o=t.reduce((e,i)=>e+i.length,0),a=new Uint8Array(o);return t.forEach((e,i,A)=>{let r=A.slice(0,i).reduce((s,g)=>s+g.length,0);a.set(e,r)}),a}async flush(){await this.parseFullPage(n.mergeUint8Arrays(this.pageSegments))}async parseUserComment(t,o){let e=new hE(t,o).parseUserComment();return await this.addTag(e.key,e.value),e.len}async addTag(t,o){if(t==="METADATA_BLOCK_PICTURE"&&typeof o=="string"){if(this.options.skipCovers){EE("Ignore picture");return}o=bI.fromBase64(o),EE(`Push picture: id=${t}, format=${o.format}`)}else EE(`Push tag: id=${t}, value=${o}`);await this.metadata.addTag("vorbis",t,o)}calculateDuration(t){this.lastPageHeader&&(t||this.lastPageHeader.headerType.lastPage)&&this.metadata.format.sampleRate&&this.lastPageHeader.absoluteGranulePosition>=0&&(this.metadata.setFormat("numberOfSamples",this.lastPageHeader.absoluteGranulePosition),this.metadata.setFormat("duration",this.lastPageHeader.absoluteGranulePosition/this.metadata.format.sampleRate))}parseFirstPage(t,o){this.metadata.setFormat("codec","Vorbis I"),this.metadata.setFormat("hasAudio",!0),EE("Parse first page");let a=Tf.get(o,0);if(a.vorbis!=="vorbis")throw new Nf("Metadata does not look like Vorbis");if(a.packetType===1){let e=Wae.get(o,Tf.len);this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("bitrate",e.bitrateNominal),this.metadata.setFormat("numberOfChannels",e.channelMode),EE("sample-rate=%s[hz], bitrate=%s[b/s], channel-mode=%s",e.sampleRate,e.bitrateNominal,e.channelMode)}else throw new Nf("First Ogg page should be type 1: the identification header")}async parseFullPage(t){let o=Tf.get(t,0);switch(EE("Parse full page: type=%s, byteLength=%s",o.packetType,t.byteLength),o.packetType){case 3:return this.parseUserCommentList(t,Tf.len);case 1:case 5:break}}async parseUserCommentList(t,o){let a=Le.get(t,o);o+=4,o+=a;let e=Le.get(t,o);for(o+=4;e-- >0;)o+=await this.parseUserComment(t,o)}}});var wa,kf,vf,QU=ue(()=>{nr();DA();wa={STREAMINFO:0,PADDING:1,APPLICATION:2,SEEKTABLE:3,VORBIS_COMMENT:4,CUESHEET:5,PICTURE:6},kf={len:4,get:(n,t)=>({lastBlock:GA(n,t,7),type:XA(n,t,1,7),length:Gr.get(n,t+1)})},vf={len:34,get:(n,t)=>({minimumBlockSize:LA.get(n,t),maximumBlockSize:LA.get(n,t+2)/1e3,minimumFrameSize:Gr.get(n,t+4),maximumFrameSize:Gr.get(n,t+7),sampleRate:Gr.get(n,t+10)>>4,channels:XA(n,t+12,4,3)+1,bitsPerSample:XA(n,t+12,7,5)+1,totalSamples:XA(n,t+13,4,36),fileMD5:new Mt(16).get(n,t+18)})}});var eoe={};Lr(eoe,{FlacParser:()=>Pf});var $ae,wze,ab,Pf,yU=ue(()=>{$ae=ze(lt(),1);DA();ib();Of();ma();Rf();fU();or();QU();wze=(0,$ae.default)("music-metadata:parser:FLAC"),ab=class extends mt("FLAC"){},Pf=class extends $s{constructor(){super(...arguments),this.vorbisParser=new eg(this.metadata,this.options)}async postId3v2Parse(){if((await this.tokenizer.readToken(at)).toString()!=="fLaC")throw new ab("Invalid FLAC preamble");let o;do o=await this.tokenizer.readToken(kf),await this.parseDataBlock(o);while(!o.lastBlock);if(this.tokenizer.fileInfo.size&&this.metadata.format.duration){let a=this.tokenizer.fileInfo.size-this.tokenizer.position;this.metadata.setFormat("bitrate",8*a/this.metadata.format.duration)}}async parseDataBlock(t){switch(wze(`blockHeader type=${t.type}, length=${t.length}`),t.type){case wa.STREAMINFO:return this.readBlockStreamInfo(t.length);case wa.PADDING:break;case wa.APPLICATION:break;case wa.SEEKTABLE:break;case wa.VORBIS_COMMENT:return this.readComment(t.length);case wa.CUESHEET:break;case wa.PICTURE:await this.parsePicture(t.length);return;default:this.metadata.addWarning(`Unknown block type: ${t.type}`)}return this.tokenizer.ignore(t.length).then()}async readBlockStreamInfo(t){if(t!==vf.len)throw new ab("Unexpected block-stream-info length");let o=await this.tokenizer.readToken(vf);this.metadata.setFormat("container","FLAC"),this.processsStreamInfo(o)}processsStreamInfo(t){this.metadata.setFormat("codec","FLAC"),this.metadata.setFormat("hasAudio",!0),this.metadata.setFormat("lossless",!0),this.metadata.setFormat("numberOfChannels",t.channels),this.metadata.setFormat("bitsPerSample",t.bitsPerSample),this.metadata.setFormat("sampleRate",t.sampleRate),t.totalSamples>0&&this.metadata.setFormat("duration",t.totalSamples/t.sampleRate)}async readComment(t){let o=await this.tokenizer.readToken(new Mt(t));return this.parseComment(o)}async parseComment(t){let o=new hE(t,0),a=o.readStringUtf8();a.length>0&&this.metadata.setFormat("tool",a);let e=o.readInt32(),i=new Array(e);for(let A=0;A(A.key==="ENCODER"&&this.metadata.setFormat("tool",A.value),this.addTag(A.key,A.value))))}async parsePicture(t){return this.options.skipCovers?this.tokenizer.ignore(t):this.addPictureTag(await this.tokenizer.readToken(new bI(t)))}addPictureTag(t){return this.addTag("METADATA_BLOCK_PICTURE",t)}addTag(t,o){return this.vorbisParser.addTag(t,o)}}});var Aoe,toe=ue(()=>{Aoe={parserType:"flac",extensions:[".flac"],mimeTypes:["audio/flac"],async load(){return(await Promise.resolve().then(()=>(yU(),eoe))).FlacParser}}});var _e,mU=ue(()=>{_e={string:0,uint:1,uid:2,bool:3,binary:4,float:5}});var roe,ioe=ue(()=>{mU();roe={name:"dtd",container:{440786851:{name:"ebml",container:{17030:{name:"ebmlVersion",value:_e.uint},17143:{name:"ebmlReadVersion",value:_e.uint},17138:{name:"ebmlMaxIDWidth",value:_e.uint},17139:{name:"ebmlMaxSizeWidth",value:_e.uint},17026:{name:"docType",value:_e.string},17031:{name:"docTypeVersion",value:_e.uint},17029:{name:"docTypeReadVersion",value:_e.uint}}},408125543:{name:"segment",container:{290298740:{name:"seekHead",container:{19899:{name:"seek",multiple:!0,container:{21419:{name:"id",value:_e.binary},21420:{name:"position",value:_e.uint}}}}},357149030:{name:"info",container:{29604:{name:"uid",value:_e.uid},29572:{name:"filename",value:_e.string},3979555:{name:"prevUID",value:_e.uid},3965867:{name:"prevFilename",value:_e.string},4110627:{name:"nextUID",value:_e.uid},4096955:{name:"nextFilename",value:_e.string},2807729:{name:"timecodeScale",value:_e.uint},17545:{name:"duration",value:_e.float},17505:{name:"dateUTC",value:_e.uint},31657:{name:"title",value:_e.string},19840:{name:"muxingApp",value:_e.string},22337:{name:"writingApp",value:_e.string}}},524531317:{name:"cluster",multiple:!0,container:{231:{name:"timecode",value:_e.uid},22743:{name:"silentTracks ",multiple:!0},167:{name:"position",value:_e.uid},171:{name:"prevSize",value:_e.uid},160:{name:"blockGroup"},163:{name:"simpleBlock"}}},374648427:{name:"tracks",container:{174:{name:"entries",multiple:!0,container:{215:{name:"trackNumber",value:_e.uint},29637:{name:"uid",value:_e.uid},131:{name:"trackType",value:_e.uint},185:{name:"flagEnabled",value:_e.bool},136:{name:"flagDefault",value:_e.bool},21930:{name:"flagForced",value:_e.bool},156:{name:"flagLacing",value:_e.bool},28135:{name:"minCache",value:_e.uint},28136:{name:"maxCache",value:_e.uint},2352003:{name:"defaultDuration",value:_e.uint},2306383:{name:"timecodeScale",value:_e.float},21358:{name:"name",value:_e.string},2274716:{name:"language",value:_e.string},134:{name:"codecID",value:_e.string},25506:{name:"codecPrivate",value:_e.binary},2459272:{name:"codecName",value:_e.string},3839639:{name:"codecSettings",value:_e.string},3883072:{name:"codecInfoUrl",value:_e.string},2536e3:{name:"codecDownloadUrl",value:_e.string},170:{name:"codecDecodeAll",value:_e.bool},28587:{name:"trackOverlay",value:_e.uint},224:{name:"video",container:{154:{name:"flagInterlaced",value:_e.bool},21432:{name:"stereoMode",value:_e.uint},176:{name:"pixelWidth",value:_e.uint},186:{name:"pixelHeight",value:_e.uint},21680:{name:"displayWidth",value:_e.uint},21690:{name:"displayHeight",value:_e.uint},21683:{name:"aspectRatioType",value:_e.uint},3061028:{name:"colourSpace",value:_e.uint},3126563:{name:"gammaValue",value:_e.float}}},225:{name:"audio",container:{181:{name:"samplingFrequency",value:_e.float},30901:{name:"outputSamplingFrequency",value:_e.float},159:{name:"channels",value:_e.uint},148:{name:"channels",value:_e.uint},32123:{name:"channelPositions",value:_e.binary},25188:{name:"bitDepth",value:_e.uint}}},28032:{name:"contentEncodings",container:{25152:{name:"contentEncoding",container:{20529:{name:"order",value:_e.uint},20530:{name:"scope",value:_e.bool},20531:{name:"type",value:_e.uint},20532:{name:"contentEncoding",container:{16980:{name:"contentCompAlgo",value:_e.uint},16981:{name:"contentCompSettings",value:_e.binary}}},20533:{name:"contentEncoding",container:{18401:{name:"contentEncAlgo",value:_e.uint},18402:{name:"contentEncKeyID",value:_e.binary},18403:{name:"contentSignature ",value:_e.binary},18404:{name:"ContentSigKeyID ",value:_e.binary},18405:{name:"contentSigAlgo ",value:_e.uint},18406:{name:"contentSigHashAlgo ",value:_e.uint}}},25188:{name:"bitDepth",value:_e.uint}}}}}}}}},475249515:{name:"cues",container:{187:{name:"cuePoint",container:{179:{name:"cueTime",value:_e.uid},183:{name:"positions",container:{247:{name:"track",value:_e.uint},241:{name:"clusterPosition",value:_e.uint},21368:{name:"blockNumber",value:_e.uint},234:{name:"codecState",value:_e.uint},219:{name:"reference",container:{150:{name:"time",value:_e.uint},151:{name:"cluster",value:_e.uint},21343:{name:"number",value:_e.uint},235:{name:"codecState",value:_e.uint}}},240:{name:"relativePosition",value:_e.uint}}}}}}},423732329:{name:"attachments",container:{24999:{name:"attachedFiles",multiple:!0,container:{18046:{name:"description",value:_e.string},18030:{name:"name",value:_e.string},18016:{name:"mimeType",value:_e.string},18012:{name:"data",value:_e.binary},18094:{name:"uid",value:_e.uid}}}}},272869232:{name:"chapters",container:{17849:{name:"editionEntry",container:{182:{name:"chapterAtom",container:{29636:{name:"uid",value:_e.uid},145:{name:"timeStart",value:_e.uint},146:{name:"timeEnd",value:_e.uid},152:{name:"hidden",value:_e.bool},17816:{name:"enabled",value:_e.uid},143:{name:"track",container:{137:{name:"trackNumber",value:_e.uid},128:{name:"display",container:{133:{name:"string",value:_e.string},17276:{name:"language ",value:_e.string},17278:{name:"country ",value:_e.string}}}}}}}}}}},307544935:{name:"tags",container:{29555:{name:"tag",multiple:!0,container:{25536:{name:"target",container:{25541:{name:"tagTrackUID",value:_e.uid},25540:{name:"tagChapterUID",value:_e.uint},25542:{name:"tagAttachmentUID",value:_e.uid},25546:{name:"targetType",value:_e.string},26826:{name:"targetTypeValue",value:_e.uint},25545:{name:"tagEditionUID",value:_e.uid}}},26568:{name:"simpleTags",multiple:!0,container:{17827:{name:"name",value:_e.string},17543:{name:"string",value:_e.string},17541:{name:"binary",value:_e.binary},17530:{name:"language",value:_e.string},17531:{name:"languageIETF",value:_e.string},17540:{name:"default",value:_e.bool}}}}}}}}}}}});function SU(n,t){return Number(Dze(n,t))}function Dze(n,t){let o=new Uint8Array(8),a=n.subarray(0,t);try{return o.set(a,8-t),zs.get(o,0)}catch{return BigInt(-1)}}function ooe(n){return n.container&&Object.keys(n.container).map(t=>{let o=n.container[t];return o.id=Number.parseInt(t,10),o}).forEach(t=>{t.parent=n,ooe(t)}),n}function cp(n){let t="";return n.parent&&n.parent.name!=="dtd"&&(t+=`${cp(n.parent)}/`),t+n.name}var aoe,uE,ob,Ag,nb,noe=ue(()=>{DA();aoe=ze(lt(),1);an();mU();DA();or();uE=(0,aoe.default)("music-metadata:parser:ebml"),ob=class extends mt("EBML"){},Ag={ReadNext:0,IgnoreElement:2,SkipSiblings:3,TerminateParsing:4,SkipElement:5},nb=class{constructor(t){this.parserMap=new Map,this.ebmlMaxIDLength=4,this.ebmlMaxSizeLength=8,this.tokenizer=t,this.parserMap.set(_e.uint,o=>this.readUint(o)),this.parserMap.set(_e.string,o=>this.readString(o)),this.parserMap.set(_e.binary,o=>this.readBuffer(o)),this.parserMap.set(_e.uid,async o=>this.readBuffer(o)),this.parserMap.set(_e.bool,o=>this.readFlag(o)),this.parserMap.set(_e.float,o=>this.readFloat(o))}async iterate(t,o,a){return this.parseContainer(ooe(t),o,a)}async parseContainer(t,o,a){let e={};for(;this.tokenizer.position=0?this.tokenizer.position+i.len:-1,a);r.multiple?(e[r.name]||(e[r.name]=[]),e[r.name].push(g)):e[r.name]=g,await a.elementValue(r,g,A)}else{let g=this.parserMap.get(r.value);if(typeof g=="function"){let c=await g(i);e[r.name]=c,await a.elementValue(r,c,A)}}break;case Ag.SkipElement:uE(`Go to next element: name=${cp(r)}, element.id=0x${i.id}, container=${!!r.container} at position=${A}`);break;case Ag.IgnoreElement:uE(`Ignore element: name=${cp(r)}, element.id=0x${i.id}, container=${!!r.container} at position=${A}`),await this.tokenizer.ignore(i.len);break;case Ag.SkipSiblings:uE(`Ignore remaining container, at: name=${cp(r)}, element.id=0x${i.id}, container=${!!r.container} at position=${A}`),await this.tokenizer.ignore(o-this.tokenizer.position);break;case Ag.TerminateParsing:return uE(`Terminate parsing at element: name=${cp(r)}, element.id=0x${i.id}, container=${!!r.container} at position=${A}`),e}else switch(i.id){case 236:await this.tokenizer.ignore(i.len);break;default:uE(`parseEbml: parent=${cp(t)}, unknown child: id=${i.id.toString(16)} at position=${A}`),await this.tokenizer.ignore(i.len)}}return e}async readVintData(t){let o=await this.tokenizer.peekNumber(QA),a=128,e=1;for(;(o&a)===0;){if(e>t)throw new ob("VINT value exceeding maximum size");++e,a>>=1}let i=new Uint8Array(e);return await this.tokenizer.readBuffer(i),i}async readElement(){let t=await this.readVintData(this.ebmlMaxIDLength),o=await this.readVintData(this.ebmlMaxSizeLength);return o[0]^=128>>o.length-1,{id:SU(t,t.length),len:SU(o,o.length)}}async readFloat(t){switch(t.len){case 0:return 0;case 4:return this.tokenizer.readNumber(k2);case 8:return this.tokenizer.readNumber(DO);case 10:return this.tokenizer.readNumber(DO);default:throw new ob(`Invalid IEEE-754 float length: ${t.len}`)}}async readFlag(t){return await this.readUint(t)===1}async readUint(t){let o=await this.readBuffer(t);return SU(o,t.len)}async readString(t){return(await this.tokenizer.readToken(new We(t.len,"utf-8"))).replace(/\x00.*$/g,"")}async readBuffer(t){let o=new Uint8Array(t.len);return await this.tokenizer.readBuffer(o),o}}});var goe={};Lr(goe,{MatroskaParser:()=>wU});var soe,sb,wU,coe=ue(()=>{soe=ze(lt(),1);$a();ioe();J2();noe();sb=(0,soe.default)("music-metadata:parser:matroska"),wU=class extends Gt{constructor(){super(...arguments),this.seekHeadOffset=0,this.flagUseIndexToSkipClusters=this.options.mkvUseIndex??!1}async parse(){let t=this.tokenizer.fileInfo.size??Number.MAX_SAFE_INTEGER,o=new nb(this.tokenizer);sb("Initializing DTD end MatroskaIterator"),await o.iterate(roe,t,{startNext:a=>{switch(a.id){case 475249515:return sb(`Skip element: name=${a.name}, id=0x${a.id.toString(16)}`),Ag.IgnoreElement;case 524531317:if(this.flagUseIndexToSkipClusters&&this.seekHead){let e=this.seekHead.seek.find(i=>i.position+this.seekHeadOffset>this.tokenizer.position);if(e){let i=e.position+this.seekHeadOffset-this.tokenizer.position;return sb(`Use index to go to next position, ignoring ${i} bytes`),this.tokenizer.ignore(i),Ag.SkipElement}}return Ag.IgnoreElement;default:return Ag.ReadNext}},elementValue:async(a,e,i)=>{switch(sb(`Received: name=${a.name}, value=${e}`),a.id){case 17026:this.metadata.setFormat("container",`EBML/${e}`);break;case 290298740:this.seekHead=e,this.seekHeadOffset=i;break;case 357149030:{let A=e,r=A.timecodeScale?A.timecodeScale:1e6;if(typeof A.duration=="number"){let s=A.duration*r/1e9;await this.addTag("segment:title",A.title),this.metadata.setFormat("duration",Number(s))}}break;case 374648427:{let A=e;if(A?.entries){A.entries.forEach(s=>{let g={codecName:s.codecID.replace("A_","").replace("V_",""),codecSettings:s.codecSettings,flagDefault:s.flagDefault,flagLacing:s.flagLacing,flagEnabled:s.flagEnabled,language:s.language,name:s.name,type:s.trackType,audio:s.audio,video:s.video};this.metadata.addStreamInfo(g)});let r=A.entries.filter(s=>s.trackType===fi.audio).reduce((s,g)=>!s||g.flagDefault&&!s.flagDefault||g.trackNumber{let s=r.target,g=s?.targetTypeValue?Bie[s.targetTypeValue]:s?.targetType?s.targetType:"track";await Promise.all(r.simpleTags.map(async c=>{let I=c.string?c.string:c.binary;await this.addTag(`${g}:${c.name}`,I)}))}))}break;case 423732329:{let A=e;await Promise.all(A.attachedFiles.filter(r=>r.mimeType.startsWith("image/")).map(r=>this.addTag("picture",{data:r.data,format:r.mimeType,description:r.description,name:r.name})))}break}}})}async addTag(t,o){await this.metadata.addTag("matroska",t,o)}}});var Ioe,loe=ue(()=>{Ioe={parserType:"matroska",extensions:[".mka",".mkv",".mk3d",".mks","webm"],mimeTypes:["audio/matroska","video/matroska","audio/webm","video/webm"],async load(){return(await Promise.resolve().then(()=>(coe(),goe))).MatroskaParser}}});function uoe(n,t,o,a,e){if(OU(`remainingLen=${a}, numberOfEntries=${e} * token-len=${t.len}`),a===0)return[];if(a!==e*t.len)throw new ac("mismatch number-of-entries with remaining atom-length");let i=[];for(let A=0;A{DA();doe=ze(lt(),1);ma();or();nr();or();OU=(0,doe.default)("music-metadata:parser:MP4:atom"),ac=class extends mt("MP4"){},Ip={len:8,get:(n,t)=>{let o=xe.get(n,t);if(o<0)throw new ac("Invalid atom header length");return{length:BigInt(o),name:new We(4,"latin1").get(n,t+4)}},put:(n,t,o)=>(xe.put(n,t,Number(o.length)),at.put(n,t+4,o.name))},hoe=zs,bU={len:4,get:(n,t)=>({type:new We(4,"ascii").get(n,t)})},gb=class{constructor(t,o,a){if(to&&OU(`Warning: atom ${a} expected to be ${o}, but was actually ${t} bytes long.`),this.len=t}},CE={len:4,get:(n,t)=>{let o=xe.get(n,t)-2082844800;return new Date(o*1e3)}},BE={len:8,get:(n,t)=>{let o=Number(zs.get(n,t))-2082844800;return new Date(o*1e3)}},cb=class extends gb{constructor(t){super(t,24,"mdhd")}get(t,o){let a=QA.get(t,o+0),e=Gr.get(t,o+1);switch(a){case 0:return{version:a,flags:e,creationTime:CE.get(t,o+4),modificationTime:CE.get(t,o+8),timeScale:xe.get(t,o+12),duration:xe.get(t,o+16),language:LA.get(t,o+20),quality:LA.get(t,o+22)};case 1:return{version:a,flags:e,creationTime:BE.get(t,o+4),modificationTime:BE.get(t,o+12),timeScale:xe.get(t,o+20),duration:Number(zs.get(t,o+24)),language:LA.get(t,o+32),quality:LA.get(t,o+34)};default:throw new sn("Invalid mdhd version header")}}},Ib=class extends gb{constructor(t){super(t,100,"mvhd")}get(t,o){let a=QA.get(t,o),e=Gr.get(t,o+1);return a===1?{version:a,flags:e,creationTime:BE.get(t,o+4),modificationTime:BE.get(t,o+12),timeScale:xe.get(t,o+20),duration:Number(zs.get(t,o+24)),preferredRate:xe.get(t,o+32),preferredVolume:LA.get(t,o+36),previewTime:xe.get(t,o+84),previewDuration:xe.get(t,o+88),posterTime:xe.get(t,o+92),selectionTime:xe.get(t,o+96),selectionDuration:xe.get(t,o+100),currentTime:xe.get(t,o+104),nextTrackID:xe.get(t,o+108)}:{version:a,flags:e,creationTime:CE.get(t,o+4),modificationTime:CE.get(t,o+8),timeScale:xe.get(t,o+12),duration:xe.get(t,o+16),preferredRate:xe.get(t,o+20),preferredVolume:LA.get(t,o+24),previewTime:xe.get(t,o+72),previewDuration:xe.get(t,o+76),posterTime:xe.get(t,o+80),selectionTime:xe.get(t,o+84),selectionDuration:xe.get(t,o+88),currentTime:xe.get(t,o+92),nextTrackID:xe.get(t,o+96)}}},lb=class{constructor(t){this.len=t}get(t,o){return{type:{set:QA.get(t,o+0),type:Gr.get(t,o+1)},locale:Gr.get(t,o+4),value:new Mt(this.len-8).get(t,o+8)}}},pb=class{constructor(t){this.len=t}get(t,o){return{version:QA.get(t,o),flags:Gr.get(t,o+1),name:new We(this.len-4,"utf-8").get(t,o+4)}}},db=class{constructor(t){this.len=t}get(t,o){let a=QA.get(t,o),e=Gr.get(t,o+1);switch(a){case 0:return{version:a,flags:e,creationTime:CE.get(t,o+4),modificationTime:CE.get(t,o+8),trackId:xe.get(t,o+12),duration:xe.get(t,o+20),layer:LA.get(t,o+32),alternateGroup:LA.get(t,o+34),volume:LA.get(t,o+36)};case 1:return{version:a,flags:e,creationTime:BE.get(t,o+4),modificationTime:BE.get(t,o+12),trackId:xe.get(t,o+20),duration:Number(zs.get(t,o+28)),layer:LA.get(t,o+44),alternateGroup:LA.get(t,o+46),volume:LA.get(t,o+48)};default:throw new sn("Invalid tkhd version header")}}},poe={len:8,get:(n,t)=>({version:QA.get(n,t),flags:Gr.get(n,t+1),numberOfEntries:xe.get(n,t+4)})},DU=class{constructor(t){this.len=t}get(t,o){let a=this.len-12;return{dataFormat:at.get(t,o),dataReferenceIndex:LA.get(t,o+10),description:a>0?new Mt(a).get(t,o+12):void 0}}},Gf=class{constructor(t){this.len=t}get(t,o){let a=poe.get(t,o);o+=poe.len;let e=[];for(let i=0;i=this.len){OU("TrackRunBox size mismatch");break}let r={};e.flags.sampleDurationPresent&&(r.sampleDuration=xe.get(t,i),i+=4),e.flags.sampleSizePresent&&(r.sampleSize=xe.get(t,i),i+=4),e.flags.sampleFlagsPresent&&(r.sampleFlags=xe.get(t,i),i+=4),e.flags.sampleCompositionTimeOffsetsPresent&&(r.sampleCompositionTimeOffset=xe.get(t,i),i+=4),e.samples.push(r)}return e}},Qb=class{constructor(t){this.len=t}get(t,o){let a=o+1,e=new We(4,"utf-8");return{version:qs.get(t,o),flags:Gr.get(t,o+1),componentType:e.get(t,o+4),handlerType:e.get(t,o+8),componentName:new We(this.len-28,"utf-8").get(t,o+28)}}},yb=class{constructor(t){this.len=t}get(t,o){let a=0,e=[];for(;a{foe=ze(lt(),1);Uf();Uf();Boe=(0,foe.default)("music-metadata:parser:MP4:Atom"),mb=class n{static async readAtom(t,o,a,e){let i=t.position;Boe(`Reading next token on offset=${i}...`);let A=await t.readToken(Ip),r=A.length===1n;r&&(A.length=await t.readToken(hoe));let s=new n(A,r,a),g=s.getPayloadLength(e);return Boe(`parse atom name=${s.atomPath}, extended=${s.extended}, offset=${i}, len=${s.header.length}`),await s.readData(t,o,g),s}constructor(t,o,a){this.header=t,this.extended=o,this.parent=a,this.children=[],this.atomPath=(this.parent?`${this.parent.atomPath}.`:"")+this.header.name}getHeaderLength(){return this.extended?16:8}getPayloadLength(t){return(this.header.length===0n?t:Number(this.header.length))-this.getHeaderLength()}async readAtoms(t,o,a){for(;a>0;){let e=await n.readAtom(t,o,this,a);this.children.push(e),a-=e.header.length===0n?a:Number(e.header.length)}}async readData(t,o,a){switch(this.header.name){case"moov":case"udta":case"mdia":case"minf":case"stbl":case"":case"ilst":case"tref":case"moof":return this.readAtoms(t,o,this.getPayloadLength(a));case"meta":{let i=(await t.peekToken(Ip)).name==="hdlr"?0:4;return await t.ignore(i),this.readAtoms(t,o,this.getPayloadLength(a)-i)}default:return o(this,a)}}}});var woe={};Lr(woe,{MP4Parser:()=>_U});function moe(n,t,o){return o.indexOf(n)===t}var Soe,Ao,Mze,yoe,_U,Doe=ue(()=>{Soe=ze(lt(),1);DA();$a();Sf();Qoe();Uf();Uf();tp();uf();js();Ao=(0,Soe.default)("music-metadata:parser:MP4"),Mze="iTunes",yoe={raw:{lossy:!1,format:"raw"},MAC3:{lossy:!0,format:"MACE 3:1"},MAC6:{lossy:!0,format:"MACE 6:1"},ima4:{lossy:!0,format:"IMA 4:1"},ulaw:{lossy:!0,format:"uLaw 2:1"},alaw:{lossy:!0,format:"uLaw 2:1"},Qclp:{lossy:!0,format:"QUALCOMM PureVoice"},".mp3":{lossy:!0,format:"MPEG-1 layer 3"},alac:{lossy:!1,format:"ALAC"},"ac-3":{lossy:!0,format:"AC-3"},mp4a:{lossy:!0,format:"MPEG-4/AAC"},mp4s:{lossy:!0,format:"MP4S"},c608:{lossy:!0,format:"CEA-608"},c708:{lossy:!0,format:"CEA-708"}};_U=class n extends Gt{constructor(){super(...arguments),this.tracks=new Map,this.hasVideoTrack=!1,this.hasAudioTrack=!0,this.atomParsers={mvhd:async t=>{let o=await this.tokenizer.readToken(new Ib(t));this.metadata.setFormat("creationTime",o.creationTime),this.metadata.setFormat("modificationTime",o.modificationTime)},chap:async t=>{let o=this.getTrackDescription(),a=[];for(;t>=xe.len;)a.push(await this.tokenizer.readNumber(xe)),t-=xe.len;o.chapterList=a},mdat:async t=>{if(this.options.includeChapters){let o=[...this.tracks.values()].filter(a=>a.chapterList);if(o.length===1){let a=o[0].chapterList,e=[...this.tracks.values()].filter(i=>a.indexOf(i.header.trackId)!==-1);if(e.length===1)return this.parseChapterTrack(e[0],o[0],t)}}await this.tokenizer.ignore(t)},ftyp:async t=>{let o=[];for(;t>0;){let e=await this.tokenizer.readToken(bU);t-=bU.len;let i=e.type.replace(/\W/g,"");i.length>0&&o.push(i)}Ao(`ftyp: ${o.join("/")}`);let a=o.filter(moe).join("/");this.metadata.setFormat("container",a)},stsd:async t=>{let o=await this.tokenizer.readToken(new Gf(t)),a=this.getTrackDescription();a.soundSampleDescription=o.table.map(e=>this.parseSoundSampleDescription(e))},stsz:async t=>{let o=await this.tokenizer.readToken(new Lf(t)),a=this.getTrackDescription();a.sampleSize=o.sampleSize,a.sampleSizeTable=o.entries},date:async t=>{let o=await this.tokenizer.readToken(new We(t,"utf-8"));await this.addTag("date",o)}}}static read_BE_Integer(t,o){let a=(o?"INT":"UINT")+t.length*8+(t.length>1?"_BE":""),e=VA[a];if(!e)throw new ac(`Token for integer type not found: "${a}"`);return Number(e.get(t,0))}async parse(){this.hasVideoTrack=!1,this.hasAudioTrack=!0,this.tracks.clear();let t=this.tokenizer.fileInfo.size||0;for(;!this.tokenizer.fileInfo.size||t>0;){try{if((await this.tokenizer.peekToken(Ip)).name==="\0\0\0\0"){let A=`Error at offset=${this.tokenizer.position}: box.id=0`;Ao(A),this.addWarning(A);break}}catch(i){if(i instanceof Error){let A=`Error at offset=${this.tokenizer.position}: ${i.message}`;Ao(A),this.addWarning(A)}else throw i;break}let e=await mb.readAtom(this.tokenizer,(i,A)=>this.handleAtom(i,A),null,t);t-=e.header.length===BigInt(0)?t:Number(e.header.length)}let o=[];this.tracks.forEach(e=>{let i=[];e.soundSampleDescription.forEach(A=>{let r={},s=yoe[A.dataFormat];if(s?(i.push(s.format),r.codecName=s.format):r.codecName=`<${A.dataFormat}>`,A.description){let{description:g}=A;g.sampleRate>0&&(r.type=fi.audio,r.audio={samplingFrequency:g.sampleRate,bitDepth:g.sampleSize,channels:g.numAudioChannels})}this.metadata.addStreamInfo(r)}),i.length>=1&&o.push(i.join("/"))}),o.length>0&&this.metadata.setFormat("codec",o.filter(moe).join("+"));let a=[...this.tracks.values()].filter(e=>e.soundSampleDescription.length>=1&&e.soundSampleDescription[0].description&&e.soundSampleDescription[0].description.numAudioChannels>0);for(let e of a){if(e.media.header&&e.media.header.timeScale>0)if(e.sampleRate=e.media.header.timeScale,e.media.header.duration>0&&(Ao("Using duration defined on audio track"),e.samples=e.media.header.duration,e.duration=e.samples/e.sampleRate),e.fragments.length>0){Ao("Calculate duration defined in track fragments");let r=0;e.sizeInBytes=0;for(let s of e.fragments)for(let g of s.trackRun.samples){let c=g.sampleDuration??s.header.defaultSampleDuration??0,I=g.sampleSize??s.header.defaultSampleSize??0;if(c===0)throw new Error("Missing sampleDuration and no defaultSampleDuration in track fragment header");if(I===0)throw new Error("Missing sampleSize and no defaultSampleSize in track fragment header");r+=c,e.sizeInBytes+=I}e.samples||(e.samples=r),e.duration||(e.duration=r/e.sampleRate)}else e.sampleSizeTable.length>0&&(e.sizeInBytes=e.sampleSizeTable.reduce((r,s)=>r+s,0));let i=e.soundSampleDescription[0];if(i.description&&e.media.header&&(this.metadata.setFormat("sampleRate",i.description.sampleRate),this.metadata.setFormat("bitsPerSample",i.description.sampleSize),this.metadata.setFormat("numberOfChannels",i.description.numAudioChannels),e.media.header.timeScale===0&&e.timeToSampleTable.length>0)){let r=e.timeToSampleTable.map(s=>s.count*s.duration).reduce((s,g)=>s+g);e.duration=r/i.description.sampleRate}let A=yoe[i.dataFormat];A&&this.metadata.setFormat("lossless",!A.lossy)}if(a.length>=1){let e=a[0];e.duration&&(this.metadata.setFormat("duration",e.duration),e.sizeInBytes&&this.metadata.setFormat("bitrate",8*e.sizeInBytes/e.duration))}this.metadata.setFormat("hasAudio",this.hasAudioTrack),this.metadata.setFormat("hasVideo",this.hasVideoTrack)}async handleAtom(t,o){if(t.parent)switch(t.parent.header.name){case"ilst":case"":return this.parseMetadataItemData(t);case"moov":switch(t.header.name){case"trak":return this.parseTrackBox(t);case"udta":return this.parseTrackBox(t)}break;case"moof":switch(t.header.name){case"traf":return this.parseTrackFragmentBox(t)}}if(this.atomParsers[t.header.name])return this.atomParsers[t.header.name](o);Ao(`No parser for atom path=${t.atomPath}, payload-len=${o}, ignoring atom`),await this.tokenizer.ignore(o)}getTrackDescription(){let t=[...this.tracks.values()];return t[t.length-1]}async addTag(t,o){await this.metadata.addTag(Mze,t,o)}addWarning(t){Ao(`Warning: ${t}`),this.metadata.addWarning(t)}parseMetadataItemData(t){let o=t.header.name;return t.readAtoms(this.tokenizer,async(a,e)=>{let i=a.getPayloadLength(e);switch(a.header.name){case"data":return this.parseValueAtom(o,a);case"name":case"mean":case"rate":{let A=await this.tokenizer.readToken(new pb(i));o+=`:${A.name}`;break}default:{let A=await this.tokenizer.readToken(new Mt(i));this.addWarning(`Unsupported meta-item: ${o}[${a.header.name}] => value=${bO(A)} ascii=${Tr(A,"ascii")}`)}}},t.getPayloadLength(0))}async parseValueAtom(t,o){let a=await this.tokenizer.readToken(new lb(Number(o.header.length)-Ip.len));if(a.type.set!==0)throw new ac(`Unsupported type-set != 0: ${a.type.set}`);switch(a.type.type){case 0:switch(t){case"trkn":case"disk":{let e=QA.get(a.value,3),i=QA.get(a.value,5);await this.addTag(t,`${e}/${i}`);break}case"gnre":{let e=QA.get(a.value,1),i=aE[e-1];await this.addTag(t,i);break}case"rate":{let e=Tr(a.value,"ascii");await this.addTag(t,e);break}default:Ao(`unknown proprietary value type for: ${o.atomPath}`)}break;case 1:case 18:await this.addTag(t,Tr(a.value));break;case 13:if(this.options.skipCovers)break;await this.addTag(t,{format:"image/jpeg",data:Uint8Array.from(a.value)});break;case 14:if(this.options.skipCovers)break;await this.addTag(t,{format:"image/png",data:Uint8Array.from(a.value)});break;case 21:await this.addTag(t,n.read_BE_Integer(a.value,!0));break;case 22:await this.addTag(t,n.read_BE_Integer(a.value,!1));break;case 65:await this.addTag(t,QA.get(a.value,0));break;case 66:await this.addTag(t,LA.get(a.value,0));break;case 67:await this.addTag(t,xe.get(a.value,0));break;default:this.addWarning(`atom key=${t}, has unknown well-known-type (data-type): ${a.type.type}`)}}async parseTrackBox(t){let o={media:{},fragments:[]};await t.readAtoms(this.tokenizer,async(a,e)=>{let i=a.getPayloadLength(e);switch(a.header.name){case"chap":{let A=await this.tokenizer.readToken(new yb(e));o.chapterList=A;break}case"tkhd":o.header=await this.tokenizer.readToken(new db(i));break;case"hdlr":o.handler=await this.tokenizer.readToken(new Qb(i)),o.isAudio=()=>o.handler.handlerType==="audi"||o.handler.handlerType==="soun",o.isVideo=()=>o.handler.handlerType==="vide",o.isAudio()?this.hasAudioTrack=!0:o.isVideo()&&(this.hasVideoTrack=!0);break;case"mdhd":{let A=await this.tokenizer.readToken(new cb(i));o.media.header=A;break}case"stco":{let A=await this.tokenizer.readToken(new ub(i));o.chunkOffsetTable=A.entries;break}case"stsc":{let A=await this.tokenizer.readToken(new Eb(i));o.sampleToChunkTable=A.entries;break}case"stsd":{let A=await this.tokenizer.readToken(new Gf(i));o.soundSampleDescription=A.table.map(r=>this.parseSoundSampleDescription(r));break}case"stts":{let A=await this.tokenizer.readToken(new hb(i));o.timeToSampleTable=A.entries;break}case"stsz":{let A=await this.tokenizer.readToken(new Lf(i));o.sampleSize=A.sampleSize,o.sampleSizeTable=A.entries;break}case"dinf":case"vmhd":case"smhd":Ao(`Ignoring: ${a.header.name}`),await this.tokenizer.ignore(i);break;default:Ao(`Unexpected track box: ${a.header.name}`),await this.tokenizer.ignore(i)}},t.getPayloadLength(0)),this.tracks.set(o.header.trackId,o)}parseTrackFragmentBox(t){let o;return t.readAtoms(this.tokenizer,async(a,e)=>{let i=a.getPayloadLength(e);switch(a.header.name){case"tfhd":{let A=new Bb(a.getPayloadLength(e));o=await this.tokenizer.readToken(A);break}case"tfdt":await this.tokenizer.ignore(i);break;case"trun":{let A=new fb(i),r=await this.tokenizer.readToken(A);o&&this.tracks.get(o.trackId)?.fragments.push({header:o,trackRun:r});break}default:Ao(`Unexpected box: ${a.header.name}`),await this.tokenizer.ignore(i)}},t.getPayloadLength(0))}parseSoundSampleDescription(t){let o={dataFormat:t.dataFormat,dataReferenceIndex:t.dataReferenceIndex},a=0;if(t.description){let e=MU.get(t.description,a);a+=MU.len,e.version===0||e.version===1?o.description=Eoe.get(t.description,a):Ao(`Warning: sound-sample-description ${e} not implemented`)}return o}async parseChapterTrack(t,o,a){if(!t.sampleSize&&t.chunkOffsetTable.length!==t.sampleSizeTable.length)throw new Error("Expected equal chunk-offset-table & sample-size-table length.");let e=[];for(let i=0;i0;++i){let A=t.timeToSampleTable.slice(0,i).reduce((p,B)=>p+B.duration,0),s=t.chunkOffsetTable[i]-this.tokenizer.position,g=t.sampleSize>0?t.sampleSize:t.sampleSizeTable[i];if(a-=s+g,a<0)throw new ac("Chapter chunk exceeding token length");await this.tokenizer.ignore(s);let c=await this.tokenizer.readToken(new Cb(g));Ao(`Chapter ${i+1}: ${c}`);let I={title:c,timeScale:t.media.header?t.media.header.timeScale:0,start:A,sampleOffset:this.findSampleOffset(o,this.tokenizer.position)};Ao(`Chapter title=${I.title}, offset=${I.sampleOffset}/${o.header.duration}`),e.push(I)}this.metadata.setFormat("chapters",e),await this.tokenizer.ignore(a)}findSampleOffset(t,o){let a=0;for(;a=o[a].firstChunk&&t{Ooe={parserType:"mp4",extensions:[".mp4",".m4a",".m4b",".m4pa","m4v","m4r","3gp",".mov",".movie",".qt"],mimeTypes:["audio/mp4","audio/m4a","video/m4v","video/mp4","video/quicktime"],async load(){return(await Promise.resolve().then(()=>(Doe(),woe))).MP4Parser}}});var Noe,Moe,_ze,_oe,Toe,Sb,Roe=ue(()=>{DA();Noe=ze(lt(),1);nr();Moe=(0,Noe.default)("music-metadata:parser:musepack:sv8"),_ze=new We(2,"latin1"),_oe={len:5,get:(n,t)=>({crc:Le.get(n,t),streamVersion:QA.get(n,t+4)})},Toe={len:2,get:(n,t)=>({sampleFrequency:[44100,48e3,37800,32e3][XA(n,t,0,3)],maxUsedBands:XA(n,t,3,5),channelCount:XA(n,t+1,0,4)+1,msUsed:Li(n,t+1,4),audioBlockFrames:XA(n,t+1,5,3)})},Sb=class{get tokenizer(){return this._tokenizer}set tokenizer(t){this._tokenizer=t}constructor(t){this._tokenizer=t}async readPacketHeader(){let t=await this.tokenizer.readToken(_ze),o=await this.readVariableSizeField();return{key:t,payloadLength:o.value-2-o.len}}async readStreamHeader(t){let o={};Moe(`Reading SH at offset=${this.tokenizer.position}`);let a=await this.tokenizer.readToken(_oe);t-=_oe.len,Object.assign(o,a),Moe(`SH.streamVersion = ${a.streamVersion}`);let e=await this.readVariableSizeField();t-=e.len,o.sampleCount=e.value;let i=await this.readVariableSizeField();t-=i.len,o.beginningOfSilence=i.value;let A=await this.tokenizer.readToken(Toe);return t-=Toe.len,Object.assign(o,A),await this.tokenizer.ignore(t),o}async readVariableSizeField(t=1,o=0){let a=await this.tokenizer.readNumber(QA);return(a&128)===0?{len:t,value:o+a}:(a&=127,a+=o,this.readVariableSizeField(t+1,a<<7))}}});var oc,wb=ue(()=>{or();oc=class extends mt("Musepack"){}});var koe,Nze,Db,voe=ue(()=>{koe=ze(lt(),1);$a();ap();ma();Roe();wb();Nze=(0,koe.default)("music-metadata:parser:musepack"),Db=class extends Gt{constructor(){super(...arguments),this.audioLength=0}async parse(){if(await this.tokenizer.readToken(at)!=="MPCK")throw new oc("Invalid Magic number");return this.metadata.setFormat("container","Musepack, SV8"),this.parsePacket()}async parsePacket(){let t=new Sb(this.tokenizer);do{let o=await t.readPacketHeader();switch(Nze(`packet-header key=${o.key}, payloadLength=${o.payloadLength}`),o.key){case"SH":{let a=await t.readStreamHeader(o.payloadLength);this.metadata.setFormat("numberOfSamples",a.sampleCount),this.metadata.setFormat("sampleRate",a.sampleFrequency),this.metadata.setFormat("duration",a.sampleCount/a.sampleFrequency),this.metadata.setFormat("numberOfChannels",a.channelCount);break}case"AP":this.audioLength+=o.payloadLength,await this.tokenizer.ignore(o.payloadLength);break;case"RG":case"EI":case"SO":case"ST":case"CT":await this.tokenizer.ignore(o.payloadLength);break;case"SE":return this.metadata.format.duration&&this.metadata.setFormat("bitrate",this.audioLength*8/this.metadata.format.duration),ip(this.metadata,this.tokenizer,this.options);default:throw new oc(`Unexpected header: ${o.key}`)}}while(!0)}}});var Ob,Poe=ue(()=>{DA();Ob=class{constructor(t){this.pos=0,this.dword=null,this.tokenizer=t}async read(t){for(;this.dword===null;)this.dword=await this.tokenizer.readToken(Le);let o=this.dword;return this.pos+=t,this.pos<32?(o>>>=32-this.pos,o&(1<>>32-this.pos),o&(1<0){let e=32-this.pos;this.dword=null,t-=e,this.pos=0}let o=t%32,a=(t-o)/32;return await this.tokenizer.ignore(a*4),this.read(o)}}});var Goe,Foe=ue(()=>{DA();nr();js();Goe={len:24,get:(n,t)=>{let o={signature:Tr(n.subarray(t,t+3),"latin1"),streamMinorVersion:XA(n,t+3,0,4),streamMajorVersion:XA(n,t+3,4,4),frameCount:Le.get(n,t+4),maxLevel:SA.get(n,t+8),sampleFrequency:[44100,48e3,37800,32e3][XA(n,t+10,0,2)],link:XA(n,t+10,2,2),profile:XA(n,t+10,4,4),maxBand:XA(n,t+11,0,6),intensityStereo:Li(n,t+11,6),midSideStereo:Li(n,t+11,7),titlePeak:SA.get(n,t+12),titleGain:SA.get(n,t+14),albumPeak:SA.get(n,t+16),albumGain:SA.get(n,t+18),lastFrameLength:Le.get(n,t+20)>>>20&2047,trueGapless:Li(n,t+23,0)};return o.lastFrameLength=o.trueGapless?Le.get(n,20)>>>20&2047:0,o}}});var Uoe,Loe,bb,Hoe=ue(()=>{Uoe=ze(lt(),1);$a();ap();Poe();Foe();wb();Loe=(0,Uoe.default)("music-metadata:parser:musepack"),bb=class extends Gt{constructor(){super(...arguments),this.bitreader=null,this.audioLength=0,this.duration=null}async parse(){let t=await this.tokenizer.readToken(Goe);if(t.signature!=="MP+")throw new oc("Unexpected magic number");Loe(`stream-version=${t.streamMajorVersion}.${t.streamMinorVersion}`),this.metadata.setFormat("container","Musepack, SV7"),this.metadata.setFormat("sampleRate",t.sampleFrequency);let o=1152*(t.frameCount-1)+t.lastFrameLength;this.metadata.setFormat("numberOfSamples",o),this.duration=o/t.sampleFrequency,this.metadata.setFormat("duration",this.duration),this.bitreader=new Ob(this.tokenizer),this.metadata.setFormat("numberOfChannels",t.midSideStereo||t.intensityStereo?2:1);let a=await this.bitreader.read(8);return this.metadata.setFormat("codec",(a/100).toFixed(2)),await this.skipAudioData(t.frameCount),Loe(`End of audio stream, switching to APEv2, offset=${this.tokenizer.position}`),ip(this.metadata,this.tokenizer,this.options)}async skipAudioData(t){for(;t-- >0;){let a=await this.bitreader.read(20);this.audioLength+=20+a,await this.bitreader.ignore(a)}let o=await this.bitreader.read(11);this.audioLength+=o,this.duration!==null&&this.metadata.setFormat("bitrate",this.audioLength/this.duration)}}});var Yoe={};Lr(Yoe,{MusepackParser:()=>TU});var xoe,Koe,TU,joe=ue(()=>{xoe=ze(lt(),1);DA();Of();voe();Hoe();wb();Koe=(0,xoe.default)("music-metadata:parser:musepack"),TU=class extends $s{async postId3v2Parse(){let t=await this.tokenizer.peekToken(new We(3,"latin1")),o;switch(t){case"MP+":{Koe("Stream-version 7"),o=new bb(this.metadata,this.tokenizer,this.options);break}case"MPC":{Koe("Stream-version 8"),o=new Db(this.metadata,this.tokenizer,this.options);break}default:throw new oc("Invalid signature prefix")}return this.metadata.setAudioOnly(),o.parse()}}});var Joe,qoe=ue(()=>{Joe={parserType:"musepack",extensions:[".mpc"],mimeTypes:["audio/musepack"],async load(){return(await Promise.resolve().then(()=>(joe(),Yoe))).MusepackParser}}});var Hf,Mb,NU=ue(()=>{DA();or();Hf=class extends mt("Opus"){},Mb=class{constructor(t){if(t<19)throw new Hf("ID-header-page 0 should be at least 19 bytes long");this.len=t}get(t,o){return{magicSignature:new We(8,"ascii").get(t,o+0),version:QA.get(t,o+8),channelCount:QA.get(t,o+9),preSkip:SA.get(t,o+10),inputSampleRate:Le.get(t,o+12),outputGain:SA.get(t,o+16),channelMapping:QA.get(t,o+18)}}}});var _b,zoe=ue(()=>{DA();Rf();NU();NU();_b=class extends eg{constructor(t,o,a){super(t,o),this.idHeader=null,this.lastPos=-1,this.tokenizer=a,this.durationOnLastPage=!0}parseFirstPage(t,o){if(this.metadata.setFormat("codec","Opus"),this.idHeader=new Mb(o.length).get(o,0),this.idHeader.magicSignature!=="OpusHead")throw new Hf("Illegal ogg/Opus magic-signature");this.metadata.setFormat("sampleRate",this.idHeader.inputSampleRate),this.metadata.setFormat("numberOfChannels",this.idHeader.channelCount),this.metadata.setAudioOnly()}async parseFullPage(t){switch(new We(8,"ascii").get(t,0)){case"OpusTags":await this.parseUserCommentList(t,8),this.lastPos=this.tokenizer.position-t.length;break;default:break}}calculateDuration(t){if(this.lastPageHeader&&(t||this.lastPageHeader.headerType.lastPage)&&this.metadata.format.sampleRate&&this.lastPageHeader.absoluteGranulePosition>=0){let o=this.lastPageHeader.absoluteGranulePosition-this.idHeader.preSkip;if(this.metadata.setFormat("numberOfSamples",o),this.metadata.setFormat("duration",o/48e3),this.lastPos!==-1&&this.tokenizer.fileInfo.size&&this.metadata.format.duration){let a=this.tokenizer.fileInfo.size-this.lastPos;this.metadata.setFormat("bitrate",8*a/this.metadata.format.duration)}}}}});var Voe,Woe=ue(()=>{DA();nr();Voe={len:80,get:(n,t)=>({speex:new We(8,"ascii").get(n,t+0),version:NO(new We(20,"ascii").get(n,t+8)),version_id:ur.get(n,t+28),header_size:ur.get(n,t+32),rate:ur.get(n,t+36),mode:ur.get(n,t+40),mode_bitstream_version:ur.get(n,t+44),nb_channels:ur.get(n,t+48),bitrate:ur.get(n,t+52),frame_size:ur.get(n,t+56),vbr:ur.get(n,t+60),frames_per_packet:ur.get(n,t+64),extra_headers:ur.get(n,t+68),reserved1:ur.get(n,t+72),reserved2:ur.get(n,t+76)})}});var Zoe,Pze,Tb,Xoe=ue(()=>{Zoe=ze(lt(),1);Rf();Woe();Pze=(0,Zoe.default)("music-metadata:parser:ogg:speex"),Tb=class extends eg{constructor(t,o,a){super(t,o)}parseFirstPage(t,o){Pze("First Ogg/Speex page");let a=Voe.get(o,0);this.metadata.setFormat("codec",`Speex ${a.version}`),this.metadata.setFormat("numberOfChannels",a.nb_channels),this.metadata.setFormat("sampleRate",a.rate),a.bitrate!==-1&&this.metadata.setFormat("bitrate",a.bitrate),this.metadata.setAudioOnly()}}});var $oe,ene=ue(()=>{DA();$oe={len:42,get:(n,t)=>({id:new We(7,"ascii").get(n,t),vmaj:QA.get(n,t+7),vmin:QA.get(n,t+8),vrev:QA.get(n,t+9),vmbw:LA.get(n,t+10),vmbh:LA.get(n,t+17),nombr:Gr.get(n,t+37),nqual:QA.get(n,t+40)})}});var tne,Ane,Nb,rne=ue(()=>{tne=ze(lt(),1);ene();Ane=(0,tne.default)("music-metadata:parser:ogg:theora"),Nb=class{constructor(t,o,a){this.durationOnLastPage=!1,this.metadata=t}async parsePage(t,o){t.headerType.firstPage&&await this.parseFirstPage(t,o)}calculateDuration(){Ane("duration calculation not implemented")}async parseFirstPage(t,o){Ane("First Ogg/Theora page"),this.metadata.setFormat("codec","Theora");let a=$oe.get(o,0);this.metadata.setFormat("bitrate",a.nombr),this.metadata.setFormat("hasVideo",!0)}flush(){return Promise.resolve()}}});var ine,Rb,ane=ue(()=>{DA();nr();DA();ine={len:27,get:(n,t)=>({capturePattern:new We(4,"latin1").get(n,t),version:QA.get(n,t+4),headerType:{continued:GA(n,t+5,0),firstPage:GA(n,t+5,1),lastPage:GA(n,t+5,2)},absoluteGranulePosition:Number(Fr.get(n,t+6)),streamSerialNumber:Le.get(n,t+14),pageSequenceNo:Le.get(n,t+18),pageChecksum:Le.get(n,t+22),page_segments:QA.get(n,t+26)})},Rb=class n{static sum(t,o,a){let e=new DataView(t.buffer,0),i=0;for(let A=o;A{one=ze(lt(),1);QU();yU();ma();ib();RU=(0,one.default)("music-metadata:parser:ogg:theora"),kb=class{constructor(t,o,a){this.durationOnLastPage=!1,this.metadata=t,this.options=o,this.tokenizer=a,this.flacParser=new Pf(this.metadata,this.tokenizer,o)}async parsePage(t,o){t.headerType.firstPage&&await this.parseFirstPage(t,o)}calculateDuration(){RU("duration calculation not implemented")}async parseFirstPage(t,o){if(RU("First Ogg/FLAC page"),(await at.get(o,9)).toString()!=="fLaC")throw new Error("Invalid FLAC preamble");let e=await kf.get(o,13);await this.parseDataBlock(e,o.subarray(13+kf.len))}async parseDataBlock(t,o){switch(RU(`blockHeader type=${t.type}, length=${t.length}`),t.type){case wa.STREAMINFO:{let a=vf.get(o,0);return this.flacParser.processsStreamInfo(a)}case wa.PADDING:break;case wa.APPLICATION:break;case wa.SEEKTABLE:break;case wa.VORBIS_COMMENT:return this.flacParser.parseComment(o);case wa.PICTURE:if(!this.options.skipCovers){let a=new bI(o.length).get(o,0);return this.flacParser.addPictureTag(a)}break;default:this.metadata.addWarning(`Unknown block type: ${t.type}`)}return this.tokenizer.ignore(t.length).then()}flush(){return Promise.resolve()}}});var gne={};Lr(gne,{OggContentError:()=>fE,OggParser:()=>vU});var sne,fE,tg,kU,vU,cne=ue(()=>{DA();an();sne=ze(lt(),1);$a();Rf();zoe();Xoe();rne();or();ane();nne();fE=class extends mt("Ogg"){},tg=(0,sne.default)("music-metadata:parser:ogg"),kU=class{constructor(t,o,a){this.pageNumber=0,this.closed=!1,this.metadata=t,this.streamSerial=o,this.options=a}async parsePage(t,o){this.pageNumber=o.pageSequenceNo,tg("serial=%s page#=%s, Ogg.id=%s",o.streamSerialNumber,o.pageSequenceNo,o.capturePattern);let a=await t.readToken(new Rb(o));tg("totalPageSize=%s",a.totalPageSize);let e=await t.readToken(new Mt(a.totalPageSize));if(tg("firstPage=%s, lastPage=%s, continued=%s",o.headerType.firstPage,o.headerType.lastPage,o.headerType.continued),o.headerType.firstPage){this.metadata.setFormat("container","Ogg");let i=e.subarray(0,7),A=Array.from(i).filter(r=>r>=32&&r<=126).map(r=>String.fromCharCode(r)).join("");switch(A){case"vorbis":tg(`Set Ogg stream serial ${o.streamSerialNumber}, codec=Vorbis`),this.pageConsumer=new eg(this.metadata,this.options);break;case"OpusHea":tg("Set page consumer to Ogg/Opus"),this.pageConsumer=new _b(this.metadata,this.options,t);break;case"Speex ":tg("Set page consumer to Ogg/Speex"),this.pageConsumer=new Tb(this.metadata,this.options,t);break;case"fishead":case"theora":tg("Set page consumer to Ogg/Theora"),this.pageConsumer=new Nb(this.metadata,this.options,t);break;case"FLAC":tg("Set page consumer to Vorbis"),this.pageConsumer=new kb(this.metadata,this.options,t);break;default:throw new fE(`Ogg codec not recognized (id=${A}`)}}if(o.headerType.lastPage&&(this.closed=!0),this.pageConsumer)await this.pageConsumer.parsePage(o,e);else throw new Error("pageConsumer should be initialized")}},vU=class extends Gt{constructor(){super(...arguments),this.streams=new Map}async parse(){this.streams=new Map;let t=!1,o;try{do{if(o=await this.tokenizer.readToken(ine),o.capturePattern!=="OggS")throw new fE("Invalid Ogg capture pattern");let a=this.streams.get(o.streamSerialNumber);if(a||(a=new kU(this.metadata,o.streamSerialNumber,this.options),this.streams.set(o.streamSerialNumber,a)),await a.parsePage(this.tokenizer,o),a.pageNumber>12&&!(this.options.duration&&[...this.streams.values()].find(e=>e.pageConsumer?.durationOnLastPage))){tg("Stop processing Ogg stream");break}}while(![...this.streams.values()].every(a=>a.closed))}catch(a){if(a instanceof kA)tg("Reached end-of-stream"),t=!0;else if(a instanceof fE)this.metadata.addWarning(`Corrupt Ogg content at ${this.tokenizer.position}`);else throw a}for(let a of this.streams.values())a.closed||(this.metadata.addWarning(`End-of-stream reached before reaching last page in Ogg stream serial=${a.streamSerial}`),await a.pageConsumer?.flush()),a.pageConsumer?.calculateDuration(t)}}});var Ine,lne=ue(()=>{Ine={parserType:"ogg",extensions:[".ogg",".ogv",".oga",".ogm",".ogx",".opus",".spx"],mimeTypes:["audio/ogg","audio/opus","audio/speex","video/ogg"],async load(){return(await Promise.resolve().then(()=>(cne(),gne))).OggParser}}});function rg(n,t){return vb(n,t,1)===1}function vb(n,t,o){return n>>>t&4294967295>>>32-o}var Gze,Kf,Pb,pne=ue(()=>{DA();ma();Gze=[6e3,8e3,9600,11025,12e3,16e3,22050,24e3,32e3,44100,48e3,64e3,88200,96e3,192e3,-1],Kf={len:32,get:(n,t)=>{let o=Le.get(n,t+24),a={BlockID:at.get(n,t),blockSize:Le.get(n,t+4),version:SA.get(n,t+8),totalSamples:Le.get(n,t+12),blockIndex:Le.get(n,t+16),blockSamples:Le.get(n,t+20),flags:{bitsPerSample:(1+vb(o,0,2))*8,isMono:rg(o,2),isHybrid:rg(o,3),isJointStereo:rg(o,4),crossChannel:rg(o,5),hybridNoiseShaping:rg(o,6),floatingPoint:rg(o,7),samplingRate:Gze[vb(o,23,4)],isDSD:rg(o,31)},crc:new Mt(4).get(n,t+28)};return a.flags.isDSD&&(a.totalSamples*=8),a}},Pb={len:1,get:(n,t)=>({functionId:vb(n[t],0,6),isOptional:rg(n[t],5),isOddSize:rg(n[t],6),largeBlock:rg(n[t],7)})}});var hne={};Lr(hne,{WavPackContentError:()=>QE,WavPackParser:()=>PU});var dne,lp,QE,PU,Ene=ue(()=>{DA();ap();ma();$a();pne();dne=ze(lt(),1);uf();or();lp=(0,dne.default)("music-metadata:parser:WavPack"),QE=class extends mt("WavPack"){},PU=class extends Gt{constructor(){super(...arguments),this.audioDataSize=0}async parse(){return this.metadata.setAudioOnly(),this.audioDataSize=0,await this.parseWavPackBlocks(),ip(this.metadata,this.tokenizer,this.options)}async parseWavPackBlocks(){do{if(await this.tokenizer.peekToken(at)!=="wvpk")break;let o=await this.tokenizer.readToken(Kf);if(o.BlockID!=="wvpk")throw new QE("Invalid WavPack Block-ID");lp(`WavPack header blockIndex=${o.blockIndex}, len=${Kf.len}`),o.blockIndex===0&&!this.metadata.format.container&&(this.metadata.setFormat("container","WavPack"),this.metadata.setFormat("lossless",!o.flags.isHybrid),this.metadata.setFormat("bitsPerSample",o.flags.bitsPerSample),o.flags.isDSD||(this.metadata.setFormat("sampleRate",o.flags.samplingRate),this.metadata.setFormat("duration",o.totalSamples/o.flags.samplingRate)),this.metadata.setFormat("numberOfChannels",o.flags.isMono?1:2),this.metadata.setFormat("numberOfSamples",o.totalSamples),this.metadata.setFormat("codec",o.flags.isDSD?"DSD":"PCM"));let a=o.blockSize-(Kf.len-8);await(o.blockIndex===0?this.parseMetadataSubBlock(o,a):this.tokenizer.ignore(a)),o.blockSamples>0&&(this.audioDataSize+=o.blockSize)}while(!this.tokenizer.fileInfo.size||this.tokenizer.fileInfo.size-this.tokenizer.position>=Kf.len);this.metadata.format.duration&&this.metadata.setFormat("bitrate",this.audioDataSize*8/this.metadata.format.duration)}async parseMetadataSubBlock(t,o){let a=o;for(;a>Pb.len;){let e=await this.tokenizer.readToken(Pb),i=await this.tokenizer.readNumber(e.largeBlock?pf:QA),A=new Uint8Array(i*2-(e.isOddSize?1:0));switch(await this.tokenizer.readBuffer(A),lp(`Metadata Sub-Blocks functionId=0x${e.functionId.toString(16)}, id.largeBlock=${e.largeBlock},data-size=${A.length}`),e.functionId){case 0:break;case 14:{lp("ID_DSD_BLOCK");let r=1<{une={parserType:"wavpack",extensions:[".wv",".wvp"],mimeTypes:["audio/wavpack"],async load(){return(await Promise.resolve().then(()=>(Ene(),hne))).WavPackParser}}});var yE,Gb,Bne=ue(()=>{DA();yE={len:8,get:(n,t)=>({chunkID:new We(4,"latin1").get(n,t),chunkSize:Le.get(n,t+4)})},Gb=class{constructor(t){this.tagHeader=t,this.len=t.chunkSize,this.len+=this.len&1}get(t,o){return new We(this.tagHeader.chunkSize,"ascii").get(t,o)}}});var pp,yi,fne,Fb,Lb,GU=ue(()=>{DA();or();pp=class extends mt("Wave"){},yi={PCM:1,ADPCM:2,IEEE_FLOAT:3,ALAW:6,MULAW:7,DVI_ADPCM:17,GSM610:49,MPEG_ADTS_AAC:5632,MPEG_LOAS:5634,RAW_AAC1:255,DOLBY_AC3_SPDIF:146,DVM:8192,RAW_SPORT:576,ESST_AC3:577,DRM:9,DTS2:8193,MPEG:80,MPEGLAYER3:85},fne={[yi.PCM]:"PCM",[yi.ADPCM]:"ADPCM",[yi.IEEE_FLOAT]:"IEEE_FLOAT",[yi.ALAW]:"ALAW",[yi.MULAW]:"MULAW",[yi.DVI_ADPCM]:"DVI_ADPCM",[yi.GSM610]:"GSM610",[yi.MPEG_ADTS_AAC]:"MPEG_ADTS_AAC",[yi.MPEG_LOAS]:"MPEG_LOAS",[yi.RAW_AAC1]:"RAW_AAC1",[yi.DOLBY_AC3_SPDIF]:"DOLBY_AC3_SPDIF",[yi.DVM]:"DVM",[yi.RAW_SPORT]:"RAW_SPORT",[yi.ESST_AC3]:"ESST_AC3",[yi.DRM]:"DRM",[yi.DTS2]:"DTS2",[yi.MPEG]:"MPEG",[yi.MPEGLAYER3]:"MPEGLAYER3"},Fb=class{constructor(t){if(t.chunkSize<16)throw new pp("Invalid chunk size");this.len=t.chunkSize}get(t,o){return{wFormatTag:SA.get(t,o),nChannels:SA.get(t,o+2),nSamplesPerSec:Le.get(t,o+4),nAvgBytesPerSec:Le.get(t,o+8),nBlockAlign:SA.get(t,o+12),wBitsPerSample:SA.get(t,o+14)}}},Lb=class{constructor(t){if(t.chunkSize<4)throw new pp("Invalid fact chunk size.");this.len=t.chunkSize}get(t,o){return{dwSampleLength:Le.get(t,o)}}}});var FU,Qne=ue(()=>{DA();nr();FU={len:420,get:(n,t)=>({description:gn(new We(256,"ascii").get(n,t)).trim(),originator:gn(new We(32,"ascii").get(n,t+256)).trim(),originatorReference:gn(new We(32,"ascii").get(n,t+288)).trim(),originationDate:gn(new We(10,"ascii").get(n,t+320)).trim(),originationTime:gn(new We(8,"ascii").get(n,t+330)).trim(),timeReferenceLow:Le.get(n,t+338),timeReferenceHigh:Le.get(n,t+342),version:SA.get(n,t+346),umid:new Mt(64).get(n,t+348),loudnessValue:SA.get(n,t+412),maxTruePeakLevel:SA.get(n,t+414),maxMomentaryLoudness:SA.get(n,t+416),maxShortTermLoudness:SA.get(n,t+418)})}});var mne={};Lr(mne,{WaveParser:()=>LU});var yne,MI,LU,Sne=ue(()=>{an();DA();yne=ze(lt(),1);Bne();GU();oE();nr();ma();$a();Qne();GU();MI=(0,yne.default)("music-metadata:parser:RIFF"),LU=class extends Gt{constructor(){super(...arguments),this.blockAlign=0,this.avgBytesPerSec=0}async parse(){let t=await this.tokenizer.readToken(yE);if(MI(`pos=${this.tokenizer.position}, parse: chunkID=${t.chunkID}`),t.chunkID==="RIFF")return this.metadata.setAudioOnly(),this.parseRiffChunk(t.chunkSize).catch(o=>{if(!(o instanceof kA))throw o})}async parseRiffChunk(t){let o=await this.tokenizer.readToken(at);switch(this.metadata.setFormat("container",o),o){case"WAVE":return this.readWaveChunk(t-at.len);default:throw new pp(`Unsupported RIFF format: RIFF/${o}`)}}async readWaveChunk(t){for(;t>=yE.len;){let o=await this.tokenizer.readToken(yE);switch(t-=yE.len+o.chunkSize,o.chunkSize>t&&this.metadata.addWarning("Data chunk size exceeds file size"),this.header=o,MI(`pos=${this.tokenizer.position}, readChunk: chunkID=RIFF/WAVE/${o.chunkID}`),o.chunkID){case"LIST":await this.parseListTag(o);break;case"fact":this.metadata.setFormat("lossless",!1),this.fact=await this.tokenizer.readToken(new Lb(o));break;case"fmt ":{let a=await this.tokenizer.readToken(new Fb(o)),e=fne[a.wFormatTag];e||(MI(`WAVE/non-PCM format=${a.wFormatTag}`),e=`non-PCM (${a.wFormatTag})`),this.metadata.setFormat("codec",e),this.metadata.setFormat("bitsPerSample",a.wBitsPerSample),this.metadata.setFormat("sampleRate",a.nSamplesPerSec),this.metadata.setFormat("numberOfChannels",a.nChannels),this.blockAlign=a.nBlockAlign,this.avgBytesPerSec=a.nAvgBytesPerSec;break}case"id3 ":case"ID3 ":{let a=await this.tokenizer.readToken(new Mt(o.chunkSize)),e=Qo(a);await new ln().parse(this.metadata,e,this.options);break}case"data":{this.metadata.format.lossless!==!1&&this.metadata.setFormat("lossless",!0);let a=o.chunkSize;if(this.tokenizer.fileInfo.size){let i=this.tokenizer.fileInfo.size-this.tokenizer.position;i0?this.metadata.setFormat("bitrate",this.avgBytesPerSec*8):this.metadata.format.duration&&this.metadata.setFormat("bitrate",a*8/this.metadata.format.duration),await this.tokenizer.ignore(o.chunkSize);break}case"bext":{let a=await this.tokenizer.readToken(FU);Object.keys(a).forEach(i=>{this.metadata.addTag("exif",`bext.${i}`,a[i])});let e=o.chunkSize-FU.len;await this.tokenizer.ignore(e);break}case"\0\0\0\0":MI(`Ignore padding chunk: RIFF/${o.chunkID} of ${o.chunkSize} bytes`),this.metadata.addWarning(`Ignore chunk: RIFF/${o.chunkID}`),await this.tokenizer.ignore(o.chunkSize);break;default:MI(`Ignore chunk: RIFF/${o.chunkID} of ${o.chunkSize} bytes`),this.metadata.addWarning(`Ignore chunk: RIFF/${o.chunkID}`),await this.tokenizer.ignore(o.chunkSize)}this.header.chunkSize%2===1&&(MI("Read odd padding byte"),await this.tokenizer.ignore(1))}}async parseListTag(t){let o=await this.tokenizer.readToken(new We(4,"latin1"));switch(MI("pos=%s, parseListTag: chunkID=RIFF/WAVE/LIST/%s",this.tokenizer.position,o),o){case"INFO":return this.parseRiffInfoTags(t.chunkSize-4);default:return this.metadata.addWarning(`Ignore chunk: RIFF/WAVE/LIST/${o}`),MI(`Ignoring chunkID=RIFF/WAVE/LIST/${o}`),this.tokenizer.ignore(t.chunkSize-4).then()}}async parseRiffInfoTags(t){for(;t>=8;){let o=await this.tokenizer.readToken(yE),a=new Gb(o),e=await this.tokenizer.readToken(a);this.addTag(o.chunkID,gn(e)),t-=8+a.len}if(t!==0)throw new pp(`Illegal remaining size: ${t}`)}addTag(t,o){this.metadata.addTag("exif",t,o)}}});var wne,Dne=ue(()=>{wne={parserType:"riff",extensions:[".wav","wave",".bwf"],mimeTypes:["audio/vnd.wave","audio/wav","audio/wave"],async load(){return(await Promise.resolve().then(()=>(Sne(),mne))).WaveParser}}});function Uze(n){let t=One.default.parse(n),o=uie(t.type);return{type:o.type,subtype:o.subtype,suffix:o.suffix,parameters:t.parameters}}function Hze(n){let t=n.lastIndexOf(".");return t===-1?"":n.substring(t)}var One,bne,dp,hp,UU=ue(()=>{H2();One=ze(Eie(),1);Cie();bne=ze(lt(),1);Uie();tp();pae();or();hae();bae();kae();Hae();Vae();toe();loe();boe();qoe();lne();Cne();Dne();Ub();dp=(0,bne.default)("music-metadata:parser:factory");hp=class{constructor(){this.parsers=[],[Aoe,lae,dae,Ooe,Ioe,wne,Ine,Oae,Uae,une,Joe,zae,Rae].forEach(t=>{this.registerParser(t)})}registerParser(t){this.parsers.push(t)}async parse(t,o,a){if(t.supportsRandomAccess()?(dp("tokenizer supports random-access, scanning for appending headers"),await HU(t,a)):dp("tokenizer does not support random-access, cannot scan for appending headers"),!o){let r=new Uint8Array(4100);if(t.fileInfo.mimeType&&(o=this.findLoaderForContentType(t.fileInfo.mimeType)),!o&&t.fileInfo.path&&(o=this.findLoaderForExtension(t.fileInfo.path)),!o){dp("Guess parser on content..."),await t.peekBuffer(r,{mayBeLess:!0});let s=await ff(r,{mpegOffsetTolerance:10});if(!s||!s.mime)throw new BI("Failed to determine audio format");if(dp(`Guessed file type is mime=${s.mime}, extension=${s.ext}`),o=this.findLoaderForContentType(s.mime),!o)throw new fI(`Guessed MIME-type not supported: ${s.mime}`)}}dp(`Loading ${o.parserType} parser...`);let e=new jO(a),i=await o.load(),A=new i(e,t,a??{});return dp(`Parser ${o.parserType} loaded`),await A.parse(),e.format.trackInfo&&(e.format.hasAudio===void 0&&e.setFormat("hasAudio",!!e.format.trackInfo.find(r=>r.type===fi.audio)),e.format.hasVideo===void 0&&e.setFormat("hasVideo",!!e.format.trackInfo.find(r=>r.type===fi.video))),e.toCommonMetadata()}findLoaderForExtension(t){if(!t)return;let o=Hze(t).toLocaleLowerCase()||t;return this.parsers.find(a=>a.extensions.indexOf(o)!==-1)}findLoaderForContentType(t){let o;if(!t)return;try{o=Uze(t)}catch{dp(`Invalid HTTP Content-Type header value: ${t}`);return}let a=o.subtype.indexOf("x-")===0?o.subtype.substring(2):o.subtype;return this.parsers.find(e=>e.mimeTypes.find(i=>i.indexOf(`${o.type}/${a}`)!==-1))}getSupportedMimeTypes(){let t=new Set;return this.parsers.forEach(o=>{o.mimeTypes.forEach(a=>{t.add(a),t.add(a.replace("/","/x-"))})}),Array.from(t)}}});async function Mne(n){let t=n.fileInfo.size;if(t>=143){let o=new Uint8Array(15),a=n.position;await n.readBuffer(o,{position:t-143}),n.setPosition(a);let e=Tr(o,"latin1");if(e.substring(6)===Kze)return Number.parseInt(e.substring(0,6),10)+15}return 0}var Kze,_ne=ue(()=>{js();Kze="LYRICS200"});async function xze(n,t={}){let o=QO(n);try{return await mE(o,t)}finally{await o.close()}}async function Yze(n,t,o={}){let a=fO(n,{fileInfo:typeof t=="string"?{mimeType:t}:t});try{return await mE(a,o)}finally{await a.close()}}async function jze(n,t,o={}){let a=Qo(n,{fileInfo:typeof t=="string"?{mimeType:t}:t});return mE(a,o)}function mE(n,t){return new hp().parse(n,void 0,t)}function Jze(n){let t={};for(let{id:o,value:a}of n)(t[o]||(t[o]=[])).push(a);return t}function qze(n){return n===void 0?0:1+Math.round(n*4)}function zze(n){return n?n.reduce((t,o)=>o.name&&o.name.toLowerCase()in["front","cover","cover (front)"]?o:t):null}async function HU(n,t={}){let o=n.fileInfo.size;if(await Vie(n)){o-=128;let a=await Mne(n);o-=a}t.apeHeader=await mI.findApeFooterOffset(n,o)}function Vze(){return new hp().getSupportedMimeTypes()}var Ub=ue(()=>{an();UU();ap();Sf();_ne();tp();or();or()});var Rne={};Lr(Rne,{CouldNotDetermineFileTypeError:()=>BI,FieldDecodingError:()=>sn,InternalParserError:()=>Ap,LyricsContentType:()=>eE,TimestampFormat:()=>AE,UnsupportedFileTypeError:()=>fI,getSupportedMimeTypes:()=>Vze,makeParseError:()=>Xh,makeUnexpectedFileContentError:()=>mt,orderTags:()=>Jze,parseBlob:()=>xze,parseBuffer:()=>jze,parseFile:()=>Zze,parseFromTokenizer:()=>mE,parseStream:()=>Wze,parseWebStream:()=>Yze,ratingToStars:()=>qze,scanAppendingHeaders:()=>HU,selectCover:()=>zze});async function Wze(n,t,o={}){let a=await O2(n,{fileInfo:typeof t=="string"?{mimeType:t}:t});try{return await mE(a,o)}finally{await a.close()}}async function Zze(n,t={}){Tne(`parseFile: ${n}`);let o=await _re(n),a=new hp;try{let e=a.findLoaderForExtension(n);e||Tne("Parser could not be determined by file extension");try{return await a.parse(o,e,t)}catch(i){throw(i instanceof BI||i instanceof fI)&&(i.message+=`: ${n}`),i}}finally{await o.close()}}var Nne,Tne,kne=ue(()=>{an();Nne=ze(lt(),1);Ub();UU();Ub();Tne=(0,Nne.default)("music-metadata:parser")});var zse=ee((TvA,QH)=>{"use strict";var oWe=Object.prototype.hasOwnProperty,Da="~";function AQ(){}Object.create&&(AQ.prototype=Object.create(null),new AQ().__proto__||(Da=!1));function nWe(n,t,o){this.fn=n,this.context=t,this.once=o||!1}function qse(n,t,o,a,e){if(typeof o!="function")throw new TypeError("The listener must be a function");var i=new nWe(o,a||n,e),A=Da?Da+t:t;return n._events[A]?n._events[A].fn?n._events[A]=[n._events[A],i]:n._events[A].push(i):(n._events[A]=i,n._eventsCount++),n}function eM(n,t){--n._eventsCount===0?n._events=new AQ:delete n._events[t]}function ga(){this._events=new AQ,this._eventsCount=0}ga.prototype.eventNames=function(){var t=[],o,a;if(this._eventsCount===0)return t;for(a in o=this._events)oWe.call(o,a)&&t.push(Da?a.slice(1):a);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(o)):t};ga.prototype.listeners=function(t){var o=Da?Da+t:t,a=this._events[o];if(!a)return[];if(a.fn)return[a.fn];for(var e=0,i=a.length,A=new Array(i);e{"use strict";var aQ=n=>n&&typeof n.message=="string",vH=n=>{if(!n)return;let t=n.cause;if(typeof t=="function"){let o=n.cause();return aQ(o)?o:void 0}else return aQ(t)?t:void 0},yge=(n,t)=>{if(!aQ(n))return"";let o=n.stack||"";if(t.has(n))return o+` +`),syncText:o}}var X2,Fie=ue(()=>{tp();X2=/\[(\d{2}):(\d{2})\.(\d{2,3})]/});function rze(n){return n.length>2?`${n.slice(0,n.length-1).join(", ")} & ${n[n.length-1]}`:n.join(" & ")}var Lie,rp,tze,jO,Uie=ue(()=>{tp();Lie=ze(lt(),1);wie();Pie();rc();nr();H2();Fie();rp=(0,Lie.default)("music-metadata:collector"),tze=["matroska","APEv2","vorbis","ID3v2.4","ID3v2.3","ID3v2.2","exif","asf","iTunes","AIFF","ID3v1"],jO=class{constructor(t){this.format={tagTypes:[],trackInfo:[]},this.native={},this.common={track:{no:null,of:null},disk:{no:null,of:null},movementIndex:{no:null,of:null}},this.quality={warnings:[]},this.commonOrigin={},this.originPriority={},this.tagMapper=new YO,this.opts=t;let o=1;for(let a of tze)this.originPriority[a]=o++;this.originPriority.artificial=500,this.originPriority.id3v1=600}hasAny(){return Object.keys(this.native).length>0}addStreamInfo(t){rp(`streamInfo: type=${t.type?j2[t.type]:"?"}, codec=${t.codecName}`),this.format.trackInfo.push(t)}setFormat(t,o){rp(`format: ${t} = ${o}`),this.format[t]=o,this.opts?.observer&&this.opts.observer({metadata:this,tag:{type:"format",id:t,value:o}})}setAudioOnly(){this.setFormat("hasAudio",!0),this.setFormat("hasVideo",!1)}async addTag(t,o,a){rp(`tag ${t}.${o} = ${a}`),this.native[t]||(this.format.tagTypes.push(t),this.native[t]=[]),this.native[t].push({id:o,value:a}),await this.toCommon(t,o,a)}addWarning(t){this.quality.warnings.push({message:t})}async postMap(t,o){switch(o.id){case"artist":return this.handleSingularArtistTag(t,o,"artist","artists");case"albumartist":return this.handleSingularArtistTag(t,o,"albumartist","albumartists");case"artists":return this.handlePluralArtistTag(t,o,"artist","artists");case"albumartists":return this.handlePluralArtistTag(t,o,"albumartist","albumartists");case"picture":return this.postFixPicture(o.value).then(a=>{a!==null&&(o.value=a,this.setGenericTag(t,o))});case"totaltracks":this.common.track.of=Cr.toIntOrNull(o.value);return;case"totaldiscs":this.common.disk.of=Cr.toIntOrNull(o.value);return;case"movementTotal":this.common.movementIndex.of=Cr.toIntOrNull(o.value);return;case"track":case"disk":case"movementIndex":{let a=this.common[o.id].of;this.common[o.id]=Cr.normalizeTrack(o.value),this.common[o.id].of=a??this.common[o.id].of;return}case"bpm":case"year":case"originalyear":o.value=Number.parseInt(o.value,10);break;case"date":{let a=Number.parseInt(o.value.substr(0,4),10);Number.isNaN(a)||(this.common.year=a);break}case"discogs_label_id":case"discogs_release_id":case"discogs_master_release_id":case"discogs_artist_id":case"discogs_votes":o.value=typeof o.value=="string"?Number.parseInt(o.value,10):o.value;break;case"replaygain_track_gain":case"replaygain_track_peak":case"replaygain_album_gain":case"replaygain_album_peak":o.value=yie(o.value);break;case"replaygain_track_minmax":o.value=o.value.split(",").map(a=>Number.parseInt(a,10));break;case"replaygain_undo":{let a=o.value.split(",").map(e=>Number.parseInt(e,10));o.value={leftChannel:a[0],rightChannel:a[1]};break}case"gapless":case"compilation":case"podcast":case"showMovement":o.value=o.value==="1"||o.value===1;break;case"isrc":{let a=this.common[o.id];if(a&&a.indexOf(o.value)!==-1)return;break}case"comment":typeof o.value=="string"&&(o.value={text:o.value}),o.value.descriptor==="iTunPGAP"&&this.setGenericTag(t,{id:"gapless",value:o.value.text==="1"});break;case"lyrics":typeof o.value=="string"&&(o.value=Gie(o.value));break;default:}o.value!==null&&this.setGenericTag(t,o)}toCommonMetadata(){return{format:this.format,native:this.native,quality:this.quality,common:this.common}}handleSingularArtistTag(t,o,a,e){if(this.commonOrigin[a]===this.originPriority[t])return this.postMap("artificial",{id:e,value:o.value});this.common[e]||this.setGenericTag("artificial",{id:e,value:o.value}),this.setGenericTag(t,o)}handlePluralArtistTag(t,o,a,e){if((!this.common[a]||this.commonOrigin[a]===this.originPriority.artificial)&&(!this.common[e]||this.common[e].indexOf(o.value)===-1)){let i=(this.common[e]||[]).concat([o.value]),A=rze(i);this.setGenericTag("artificial",{id:a,value:A})}this.setGenericTag(t,o)}async postFixPicture(t){if(t.data&&t.data.length>0){if(!t.format){let o=await ff(Uint8Array.from(t.data));if(o)t.format=o.mime;else return null}switch(t.format=t.format.toLocaleLowerCase(),t.format){case"image/jpg":t.format="image/jpeg"}return t}return this.addWarning("Empty picture tag found"),null}async toCommon(t,o,a){let e={id:o,value:a},i=this.tagMapper.mapTag(t,e,this);i&&await this.postMap(t,i)}setGenericTag(t,o){rp(`common.${o.id} = ${o.value}`);let a=this.commonOrigin[o.id]||1e3,e=this.originPriority[t];if(mie(o.id))if(e<=a)this.common[o.id]=o.value,this.commonOrigin[o.id]=e;else return rp(`Ignore native tag (singleton): ${t}.${o.id} = ${o.value}`);else if(e===a)!Sie(o.id)||this.common[o.id].indexOf(o.value)===-1?this.common[o.id].push(o.value):rp(`Ignore duplicate value: ${t}.${o.id} = ${o.value}`);else if(e{Gt=class{constructor(t,o,a){this.metadata=t,this.tokenizer=o,this.options=a}}});var ize,at,ma=ue(()=>{js();nr();or();ize=/^[\x21-\x7e©][\x20-\x7e\x00()]{3}/,at={len:4,get:(n,t)=>{let o=Tr(n.subarray(t,t+at.len),"latin1");if(!o.match(ize))throw new sn(`FourCC contains invalid characters: ${Qie(o)} "${o}"`);return o},put:(n,t,o)=>{let a=Rre(o,"latin1");if(a.length!==4)throw new Ap("Invalid length");return n.set(a,t),t+4}}});function Kie(n){return{containsHeader:JO(n,31),containsFooter:JO(n,30),isHeader:JO(n,29),readOnly:JO(n,0),dataType:(n&6)>>1}}function JO(n,t){return(n&1<{DA();ma();mf={text_utf8:0,binary:1,external_info:2,reserved:3},$2={len:52,get:(n,t)=>({ID:at.get(n,t),version:Le.get(n,t+4)/1e3,descriptorBytes:Le.get(n,t+8),headerBytes:Le.get(n,t+12),seekTableBytes:Le.get(n,t+16),headerDataBytes:Le.get(n,t+20),apeFrameDataBytes:Le.get(n,t+24),apeFrameDataBytesHigh:Le.get(n,t+28),terminatingDataBytes:Le.get(n,t+32),fileMD5:new Mt(16).get(n,t+36)})},Hie={len:24,get:(n,t)=>({compressionLevel:SA.get(n,t),formatFlags:SA.get(n,t+2),blocksPerFrame:Le.get(n,t+4),finalFrameBlocks:Le.get(n,t+8),totalFrames:Le.get(n,t+12),bitsPerSample:SA.get(n,t+16),channel:SA.get(n,t+18),sampleRate:Le.get(n,t+20)})},eo={len:32,get:(n,t)=>({ID:new We(8,"ascii").get(n,t),version:Le.get(n,t+8),size:Le.get(n,t+12),fields:Le.get(n,t+16),flags:Kie(Le.get(n,t+20))})},qO={len:8,get:(n,t)=>({size:Le.get(n,t),flags:Kie(Le.get(n,t+4))})}});var qie={};Lr(qie,{APEv2Parser:()=>mI,ApeContentError:()=>iE,tryParseApeHeader:()=>ip});function ip(n,t,o){return new mI(n,t,o).tryParseApeHeader()}var Jie,yI,Yie,jie,iE,mI,ap=ue(()=>{Jie=ze(lt(),1);an();DA();nr();$a();xie();or();js();yI=(0,Jie.default)("music-metadata:parser:APEv2"),Yie="APEv2",jie="APETAGEX",iE=class extends St("APEv2"){};mI=class n extends Gt{constructor(){super(...arguments),this.ape={}}static calculateDuration(t){let o=t.totalFrames>1?t.blocksPerFrame*(t.totalFrames-1):0;return o+=t.finalFrameBlocks,o/t.sampleRate}static async findApeFooterOffset(t,o){let a=new Uint8Array(eo.len),e=t.position;if(o<=eo.len){yI(`Offset is too small to read APE footer: offset=${o}`);return}if(o>eo.len){await t.readBuffer(a,{position:o-eo.len}),t.setPosition(e);let i=eo.get(a,0);if(i.ID==="APETAGEX")return i.flags.isHeader?yI(`APE Header found at offset=${o-eo.len}`):(yI(`APE Footer found at offset=${o-eo.len}`),o-=i.size),{footer:i,offset:o}}}static parseTagFooter(t,o,a){let e=eo.get(o,o.length-eo.len);if(e.ID!==jie)throw new iE("Unexpected APEv2 Footer ID preamble value");return Qo(o),new n(t,Qo(o),a).parseTags(e)}async tryParseApeHeader(){if(this.tokenizer.fileInfo.size&&this.tokenizer.fileInfo.size-this.tokenizer.position0?this.parseDescriptorExpansion(o):this.parseHeader());return this.metadata.setAudioOnly(),await this.tokenizer.ignore(a.forwardBytes),this.tryParseApeHeader()}async parseTags(t){let o=new Uint8Array(256),a=t.size-eo.len;yI(`Parse APE tags at offset=${this.tokenizer.position}, size=${a}`);for(let e=0;ethis.metadata.addTag(Yie,r,c)));break}case mf.binary:if(this.options.skipCovers)await this.tokenizer.ignore(i.size);else{let s=new Uint8Array(i.size);await this.tokenizer.readBuffer(s),A=Xs(s);let g=Tr(s.subarray(0,A),"utf-8"),c=s.subarray(A+1);await this.metadata.addTag(Yie,r,{description:g,data:c})}break;case mf.external_info:yI(`Ignore external info ${r}`),await this.tokenizer.ignore(i.size);break;case mf.reserved:yI(`Ignore external info ${r}`),this.metadata.addWarning(`APEv2 header declares a reserved datatype for "${r}"`),await this.tokenizer.ignore(i.size);break}}}async parseDescriptorExpansion(t){return await this.tokenizer.ignore(t),this.parseHeader()}async parseHeader(){let t=await this.tokenizer.readToken(Hie);if(this.metadata.setFormat("lossless",!0),this.metadata.setFormat("container","Monkey's Audio"),this.metadata.setFormat("bitsPerSample",t.bitsPerSample),this.metadata.setFormat("sampleRate",t.sampleRate),this.metadata.setFormat("numberOfChannels",t.channel),this.metadata.setFormat("duration",n.calculateDuration(t)),!this.ape.descriptor)throw new iE("Missing APE descriptor");return{forwardBytes:this.ape.descriptor.seekTableBytes+this.ape.descriptor.headerDataBytes+this.ape.descriptor.apeFrameDataBytes+this.ape.descriptor.terminatingDataBytes}}}});async function Vie(n){if(n.fileInfo.size>=128){let t=new Uint8Array(3),o=n.position;return await n.readBuffer(t,{position:n.fileInfo.size-128}),n.setPosition(o),Tr(t,"latin1")==="TAG"}return!1}var zie,zO,aE,VO,SI,WO,Sf=ue(()=>{zie=ze(lt(),1);DA();nr();$a();ap();js();zO=(0,zie.default)("music-metadata:parser:ID3v1"),aE=["Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge","Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Pop","R&B","Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska","Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient","Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical","Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise","Alt. Rock","Bass","Soul","Punk","Space","Meditative","Instrumental Pop","Instrumental Rock","Ethnic","Gothic","Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance","Dream","Southern Rock","Comedy","Cult","Gangsta Rap","Top 40","Christian Rap","Pop/Funk","Jungle","Native American","Cabaret","New Wave","Psychedelic","Rave","Showtunes","Trailer","Lo-Fi","Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical","Rock & Roll","Hard Rock","Folk","Folk/Rock","National Folk","Swing","Fast-Fusion","Bebob","Latin","Revival","Celtic","Bluegrass","Avantgarde","Gothic Rock","Progressive Rock","Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band","Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson","Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus","Porn Groove","Satire","Slow Jam","Club","Tango","Samba","Folklore","Ballad","Power Ballad","Rhythmic Soul","Freestyle","Duet","Punk Rock","Drum Solo","A Cappella","Euro-House","Dance Hall","Goa","Drum & Bass","Club-House","Hardcore","Terror","Indie","BritPop","Negerpunk","Polsk Punk","Beat","Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover","Contemporary Christian","Christian Rock","Merengue","Salsa","Thrash Metal","Anime","JPop","Synthpop","Abstract","Art Rock","Baroque","Bhangra","Big Beat","Breakbeat","Chillout","Downtempo","Dub","EBM","Eclectic","Electro","Electroclash","Emo","Experimental","Garage","Global","IDM","Illbient","Industro-Goth","Jam Band","Krautrock","Leftfield","Lounge","Math Rock","New Romantic","Nu-Breakz","Post-Punk","Post-Rock","Psytrance","Shoegaze","Space Rock","Trop Rock","World Music","Neoclassical","Audiobook","Audio Theatre","Neue Deutsche Welle","Podcast","Indie Rock","G-Funk","Dubstep","Garage Rock","Psybient"],VO={len:128,get:(n,t)=>{let o=new SI(3).get(n,t);return o==="TAG"?{header:o,title:new SI(30).get(n,t+3),artist:new SI(30).get(n,t+33),album:new SI(30).get(n,t+63),year:new SI(4).get(n,t+93),comment:new SI(28).get(n,t+97),zeroByte:QA.get(n,t+127),track:QA.get(n,t+126),genre:QA.get(n,t+127)}:null}},SI=class{constructor(t){this.len=t,this.stringType=new We(t,"latin1")}get(t,o){let a=this.stringType.get(t,o);return a=NO(a),a=a.trim(),a.length>0?a:void 0}},WO=class n extends Gt{constructor(t,o,a){super(t,o,a),this.apeHeader=a.apeHeader}static getGenre(t){if(tt){zO("Already consumed the last 128 bytes");return}let o=await this.tokenizer.readToken(VO,t);if(o){zO("ID3v1 header found at: pos=%s",this.tokenizer.fileInfo.size-VO.len);let a=["title","artist","album","comment","track","year"];for(let i of a)o[i]&&o[i]!==""&&await this.addTag(i,o[i]);let e=n.getGenre(o.genre);e&&await this.addTag("genre",e)}else zO("ID3v1 header not found at: pos=%s",this.tokenizer.fileInfo.size-VO.len)}async addTag(t,o){await this.metadata.addTag("ID3v1",t,o)}}});var eU,Wie=ue(()=>{DA();eU={len:16,get:(n,t)=>{let o=xe.get(n,t+8),a=xe.get(n,t+12);return{startTime:xe.get(n,t),endTime:xe.get(n,t+4),startOffset:o===4294967295?void 0:o,endOffset:a===4294967295?void 0:a}}}});function wf(n){switch(n){case 2:return 6;case 3:case 4:return 10;default:throw Zie(n)}}function aze(n,t){return t===3?{status:{tag_alter_preservation:GA(n,0,7),file_alter_preservation:GA(n,0,6),read_only:GA(n,0,5)},format:{compression:GA(n,1,7),encryption:GA(n,1,6),grouping_identity:GA(n,1,5),unsynchronisation:!1,data_length_indicator:!1}}:{status:{tag_alter_preservation:GA(n,0,6),file_alter_preservation:GA(n,0,5),read_only:GA(n,0,4)},format:{grouping_identity:GA(n,1,6),compression:GA(n,1,3),encryption:GA(n,1,2),unsynchronisation:GA(n,1,1),data_length_indicator:GA(n,1,0)}}}function Df(n,t,o){switch(t){case 2:return oze(n,t,o);case 3:case 4:return nze(n,t,o);default:throw Zie(t)}}function oze(n,t,o){let a={id:Tr(n.subarray(0,3),"ascii"),length:Gr.get(n,3)};return a.id.match(/^[A-Z0-9]{3}$/)||o.addWarning(`Invalid ID3v2.${t} frame-header-ID: ${a.id}`),a}function nze(n,t,o){let a={id:Tr(n.subarray(0,4),"ascii"),length:(t===4?V2:xe).get(n,4),flags:aze(n.subarray(8,10),t)};return a.id.match(/^[A-Z0-9]{4}$/)||o.addWarning(`Invalid ID3v2.${t} frame-header-ID: ${a.id}`),a}function Zie(n){throw new wI(`Unexpected majorVer: ${n}`)}var AU=ue(()=>{DA();nr();QI();js();tU()});function sze(n){let t=[],o,a="";for(let e of n)if(typeof o=="string")if(e==="("&&o==="")a+="(",o=void 0;else if(e===")"){a!==""&&(t.push(a),a="");let i=Xie(o);i&&t.push(i),o=void 0}else o+=e;else e==="("?o="":a+=e;return a&&(t.length===0&&a.match(/^\d*$/)&&(a=Xie(a)),a&&t.push(a)),t}function Xie(n){if(n==="RX")return"Remix";if(n==="CR")return"Cover";if(n.match(/^\d*$/))return aE[Number.parseInt(n,10)]}function gze(n){throw new wI(`Unexpected majorVer: ${n}`)}var $ie,ZO,In,rU,XO,wI,tU=ue(()=>{$ie=ze(lt(),1);DA();nr();QI();Sf();or();nr();Wie();AU();ZO=(0,$ie.default)("music-metadata:id3v2:frame-parser"),In="latin1",rU={encoding:In,bom:!1};XO=class n{constructor(t,o){this.major=t,this.warningCollector=o}readData(t,o,a){if(t.length===0){this.warningCollector.addWarning(`id3v2.${this.major} header has empty tag type=${o}`);return}let{encoding:e,bom:i}=tE.get(t,0),A=t.length,r=0,s=[],g=n.getNullTerminatorLength(e),c;switch(ZO(`Parsing tag type=${o}, encoding=${e}, bom=${i}`),o!=="TXXX"&&o[0]==="T"?"T*":o){case"T*":case"GRP1":case"GP1":case"IPLS":case"MVIN":case"MVNM":case"PCS":case"PCST":{let I;try{I=n.trimNullPadding(Qi(t.subarray(1),e))}catch(p){if(p instanceof Error){this.warningCollector.addWarning(`id3v2.${this.major} type=${o} header has invalid string value: ${p.message}`);break}throw p}switch(o){case"TMCL":case"TIPL":case"IPLS":s=n.functionList(this.splitValue(o,I));break;case"TRK":case"TRCK":case"TPOS":case"TIT1":case"TIT2":case"TIT3":s=I;break;case"TCOM":case"TEXT":case"TOLY":case"TOPE":case"TPE1":case"TSRC":s=this.splitValue(o,I);break;case"TCO":case"TCON":s=this.splitValue(o,I).map(p=>sze(p)).reduce((p,B)=>p.concat(B),[]);break;case"PCS":case"PCST":s=this.major>=4?this.splitValue(o,I):[I],s=Array.isArray(s)&&s[0]===""?1:0;break;default:s=this.major>=4?this.splitValue(o,I):[I]}break}case"TXXX":{let I=n.readIdentifierAndData(t.subarray(1),e);s={description:I.id,text:this.splitValue(o,Qi(I.data,e).replace(/\x00+$/,""))};break}case"PIC":case"APIC":if(a){let I={};switch(t=t.subarray(1),this.major){case 2:I.format=Qi(t.subarray(0,3),"latin1"),t=t.subarray(3);break;case 3:case 4:c=Xs(t,In),I.format=Qi(t.subarray(0,c),In),t=t.subarray(c+1);break;default:throw gze(this.major)}I.format=n.fixPictureMimeType(I.format),I.type=$h[t[0]],t=t.subarray(1),c=Xs(t,e),I.description=Qi(t.subarray(0,c),e),t=t.subarray(c+g),I.data=t,s=I}break;case"CNT":case"PCNT":s=z2(t);break;case"SYLT":{let I=Z2.get(t,0);t=t.subarray(Z2.len);let p={descriptor:"",language:I.language,contentType:I.contentType,timeStampFormat:I.timeStampFormat,syncText:[]},B=!1;for(;t.length>0;){let f=n.readNullTerminatedString(t,I.encoding);if(t=t.subarray(f.len),B){let Q=xe.get(t,0);t=t.subarray(xe.len),p.syncText.push({text:f.text,timestamp:Q})}else p.descriptor=f.text,B=!0}s=p;break}case"ULT":case"USLT":case"COM":case"COMM":{let I=RO.get(t,r);r+=RO.len;let p=n.readNullTerminatedString(t.subarray(r),I.encoding);r+=p.len;let B=n.readNullTerminatedString(t.subarray(r),I.encoding);s={language:I.language,descriptor:p.text,text:B.text};break}case"UFID":{let I=n.readIdentifierAndData(t,In);s={owner_identifier:I.id,identifier:I.data};break}case"PRIV":{let I=n.readIdentifierAndData(t,In);s={owner_identifier:I.id,data:I.data};break}case"POPM":{t=t.subarray(r);let I=n.readNullTerminatedString(t,rU),p=I.text;if(t=t.subarray(I.len),t.length===0){this.warningCollector.addWarning(`id3v2.${this.major} type=${o} POPM frame missing rating byte`),s={email:p,rating:0,counter:void 0};break}let B=QA.get(t,0),f=t.subarray(QA.len);s={email:p,rating:B,counter:f.length>0?z2(f):void 0};break}case"GEOB":{let I=tE.get(t,0);t=t.subarray(1);let p=n.readNullTerminatedString(t,rU),B=p.text;t=t.subarray(p.len);let f=n.readNullTerminatedString(t,I),Q=f.text;t=t.subarray(f.len);let y=n.readNullTerminatedString(t,I),m=y.text;t=t.subarray(y.len),s={type:B,filename:Q,description:m,data:t};break}case"WCOM":case"WCOP":case"WOAF":case"WOAR":case"WOAS":case"WORS":case"WPAY":case"WPUB":s=n.readNullTerminatedString(t,rU).text;break;case"WXXX":{let I=tE.get(t,0);t=t.subarray(1);let p=n.readNullTerminatedString(t,I),B=p.text;t=t.subarray(p.len),s={description:B,url:n.trimNullPadding(Qi(t,In))};break}case"WFD":case"WFED":{let I=tE.get(t,0);t=t.subarray(1),s=n.readNullTerminatedString(t,I).text;break}case"MCDI":{s=t.subarray(0,A);break}case"CHAP":{ZO("Reading CHAP"),c=Xs(t,In);let I={label:Qi(t.subarray(0,c),In),info:eU.get(t,c+1),frames:new Map};for(r+=c+1+eU.len;r=i.length)return{text:Qi(t,o.encoding),len:e};let r=t.subarray(0,a+A);return{text:Qi(r,o.encoding),len:a+A+n.getNullTerminatorLength(o.encoding)}}static fixPictureMimeType(t){switch(t=t.toLocaleLowerCase(),t){case"jpg":return"image/jpeg";case"png":return"image/png"}return t}static functionList(t){let o={};for(let a=0;a+11?this.warningCollector.addWarning(`ID3v2.${this.major} ${t} uses non standard null-separator.`):a=o.split(/\//g)):a=o.split(/\x00/g),n.trimArray(a)}static trimArray(t){return t.map(o=>n.trimNullPadding(o).trim())}static trimNullPadding(t){let o=t.length;for(;o>0&&t.charCodeAt(o-1)===0;)o--;return o===t.length?t:t.slice(0,o)}static readIdentifierAndData(t,o){let a=n.readNullTerminatedString(t,{encoding:o,bom:!1});return{id:a.text,data:t.subarray(a.len)}}static getNullTerminatorLength(t){return t.startsWith("utf-16")?2:1}},wI=class extends St("id3v2"){}});function cze(n){throw new wI(`Unexpected majorVer: ${n}`)}var ln,oE=ue(()=>{DA();tU();QI();AU();ln=class n{constructor(){this.tokenizer=void 0,this.id3Header=void 0,this.metadata=void 0,this.headerType=void 0,this.options=void 0}static removeUnsyncBytes(t){let o=0,a=0;for(;o0?this.parseExtendedHeaderData(o,t.size):this.parseId3Data(this.id3Header.size-t.size)}async parseExtendedHeaderData(t,o){return await this.tokenizer.ignore(t),this.parseId3Data(this.id3Header.size-o)}async parseId3Data(t){let o=await this.tokenizer.readToken(new Mt(t));for(let a of this.parseMetadata(o))switch(a.id){case"TXXX":a.value&&await this.handleTag(a,a.value.text,()=>a.value.description);break;default:await(Array.isArray(a.value)?Promise.all(a.value.map(e=>this.addTag(a.id,e))):this.addTag(a.id,a.value))}}async handleTag(t,o,a,e=i=>i){await Promise.all(o.map(i=>this.addTag(n.makeDescriptionTagName(t.id,a(i)),e(i))))}async addTag(t,o){await this.metadata.addTag(this.headerType,t,o)}parseMetadata(t){let o=0,a=[];for(;o!==t.length;){let e=wf(this.id3Header.version.major);if(o+e>t.length){this.metadata.addWarning("Illegal ID3v2 tag length");break}let i=t.subarray(o,o+e);o+=e;let A=Df(i,this.id3Header.version.major,this.metadata),r=t.subarray(o,o+A.length);o+=A.length;let s=n.readFrameData(r,A,this.id3Header.version.major,!this.options.skipCovers,this.metadata);s&&a.push({id:A.id,value:s})}return a}static mapId3v2Chapters(t){if(!t)return;let o=t.filter(g=>g.id==="CHAP");if(!o?.length)return;let e=t.filter(g=>g.id==="CTOC")?.find(g=>g.value.flags?.topLevel),i=new Map;for(let g of o)i.set(g.value.label,g.value);let A=e?.value.childElementIds,r=[],s=A??[...i.keys()];for(let g of s){let c=i.get(g);if(!c)continue;let I=c.frames,p=I.get("TIT2");p&&r.push({id:g,title:p,url:I.get("WXXX"),start:c.info.startTime/1e3,end:c.info.endTime/1e3,image:I.get("APIC")})}return A||r.sort((g,c)=>g.start-c.start),r.length?r:void 0}}});var eae,iU,$s,Of=ue(()=>{an();eae=ze(lt(),1);QI();oE();Sf();$a();iU=(0,eae.default)("music-metadata:parser:ID3"),$s=class extends Gt{constructor(){super(...arguments),this.id3parser=new ln}static async startsWithID3v2Header(t){return(await t.peekToken(Qf)).fileIdentifier==="ID3"}async parse(){try{await this.parseID3v2()}catch(t){if(t instanceof kA)iU("End-of-stream");else throw t}}finalize(){}async parseID3v2(){await this.tryReadId3v2Headers(),iU("End of ID3v2 header, go to MPEG-parser: pos=%s",this.tokenizer.position),await this.postId3v2Parse(),this.options.skipPostHeaders&&this.metadata.hasAny()?this.finalize():(await new WO(this.metadata,this.tokenizer,this.options).parse(),this.finalize())}async tryReadId3v2Headers(){if((await this.tokenizer.peekToken(Qf)).fileIdentifier==="ID3")return iU("Found ID3v2 header, pos=%s",this.tokenizer.position),await this.id3parser.parse(this.metadata,this.tokenizer,this.options),this.tryReadId3v2Headers()}}});var aU,Aae=ue(()=>{nr();aU={len:2,get:(n,t)=>{let o=XA(n,t,0,3),a=XA(n,t,6,1),e=XA(n,t,7,9)/10;if(o>0)return{type:XA(n,t,0,3),origin:XA(n,t,3,3),adjustment:a?-e:e}}}});var tae,rae=ue(()=>{DA();nr();Aae();tae={len:27,get:(n,t)=>{let o=xe.get(n,t+2);return{revision:XA(n,t,0,4),vbr_method:XA(n,t,4,4),lowpass_filter:100*QA.get(n,t+1),track_peak:o===0?null:o/2**23,track_gain:aU.get(n,6),album_gain:aU.get(n,8),music_length:xe.get(n,t+20),music_crc:QA.get(n,t+24),header_crc:LA.get(n,t+24)}}}});async function iae(n){let t=await n.readToken(Ize),o={numFrames:null,streamSize:null,vbrScale:null};if(t.frames&&(o.numFrames=await n.readToken(xe)),t.bytes&&(o.streamSize=await n.readToken(xe)),t.toc&&(o.toc=new Uint8Array(100),await n.readBuffer(o.toc)),t.vbrScale&&(o.vbrScale=await n.readToken(xe)),await n.peekToken(new We(4,"ascii"))==="LAME"){await n.ignore(4),o.lame={version:await n.readToken(new We(5,"ascii"))};let e=o.lame.version.match(/\d+.\d+/g);if(e!==null){let A=e[0].split(".").map(r=>Number.parseInt(r,10));A[0]>=3&&A[1]>=90&&(o.lame.extended=await n.readToken(tae))}}return o}var oU,$O,Ize,aae=ue(()=>{DA();nr();rae();oU=new We(4,"ascii"),$O=new We(6,"ascii"),Ize={len:4,get:(n,t)=>({frames:Li(n,t,31),bytes:Li(n,t,30),toc:Li(n,t,29),vbrScale:Li(n,t,28)})}});var cae={};Lr(cae,{MpegContentError:()=>op,MpegParser:()=>nU});function pze(n){return`V${Math.floor((100-n)/10)}`}var gae,yo,op,oae,nae,lze,mo,sae,nU,Iae=ue(()=>{DA();an();gae=ze(lt(),1);nr();Of();aae();or();yo=(0,gae.default)("music-metadata:parser:mpeg"),op=class extends St("MPEG"){},oae=1024,nae={AudioObjectTypes:["AAC Main","AAC LC","AAC SSR","AAC LTP"],SamplingFrequencies:[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350,null,null,null]},lze=[void 0,["front-center"],["front-left","front-right"],["front-center","front-left","front-right"],["front-center","front-left","front-right","back-center"],["front-center","front-left","front-right","back-left","back-right"],["front-center","front-left","front-right","back-left","back-right","LFE-channel"],["front-center","front-left","front-right","side-left","side-right","back-left","back-right","LFE-channel"]],mo=class n{constructor(t,o){this.bitrateIndex=null,this.sampRateFreqIndex=null,this.padding=null,this.privateBit=null,this.channelModeIndex=null,this.modeExtension=null,this.isOriginalMedia=null,this.version=null,this.bitrate=null,this.samplingRate=null,this.frameLength=0,this.versionIndex=XA(t,o+1,3,2),this.layer=n.LayerDescription[XA(t,o+1,5,2)],this.versionIndex>1&&this.layer===0?this.parseAdtsHeader(t,o):this.parseMpegHeader(t,o),this.isProtectedByCRC=!Li(t,o+1,7)}calcDuration(t){return this.samplingRate==null?null:t*this.calcSamplesPerFrame()/this.samplingRate}calcSamplesPerFrame(){return n.samplesInFrameTable[this.version===1?0:1][this.layer]}calculateSideInfoLength(){if(this.layer!==3)return 2;if(this.channelModeIndex===3){if(this.version===1)return 17;if(this.version===2||this.version===2.5)return 9}else{if(this.version===1)return 32;if(this.version===2||this.version===2.5)return 17}return null}calcSlotSize(){return[null,4,1,1][this.layer]}parseMpegHeader(t,o){this.container="MPEG",this.bitrateIndex=XA(t,o+2,0,4),this.sampRateFreqIndex=XA(t,o+2,4,2),this.padding=Li(t,o+2,6),this.privateBit=Li(t,o+2,7),this.channelModeIndex=XA(t,o+3,0,2),this.modeExtension=XA(t,o+3,2,2),this.isCopyrighted=Li(t,o+3,4),this.isOriginalMedia=Li(t,o+3,5),this.emphasis=XA(t,o+3,7,2),this.version=n.VersionID[this.versionIndex],this.channelMode=n.ChannelMode[this.channelModeIndex],this.codec=`MPEG ${this.version} Layer ${this.layer}`;let a=this.calcBitrate();if(!a)throw new op("Cannot determine bit-rate");if(this.bitrate=a*1e3,this.samplingRate=this.calcSamplingRate(),this.samplingRate==null)throw new op("Cannot determine sampling-rate")}parseAdtsHeader(t,o){yo("layer=0 => ADTS"),this.version=this.versionIndex===2?4:2,this.container=`ADTS/MPEG-${this.version}`;let a=XA(t,o+2,0,2);this.codec="AAC",this.codecProfile=nae.AudioObjectTypes[a],yo(`MPEG-4 audio-codec=${this.codec}`);let e=XA(t,o+2,2,4);this.samplingRate=nae.SamplingFrequencies[e],yo(`sampling-rate=${this.samplingRate}`);let i=XA(t,o+2,7,3);this.mp4ChannelConfig=lze[i],yo(`channel-config=${this.mp4ChannelConfig?this.mp4ChannelConfig.join("+"):"?"}`),this.frameLength=XA(t,o+3,6,2)<<11}calcBitrate(){if(this.bitrateIndex===0||this.bitrateIndex===15)return null;if(this.version&&this.bitrateIndex){let t=10*Math.floor(this.version)+this.layer;return n.bitrate_index[this.bitrateIndex][t]}return null}calcSamplingRate(){return this.sampRateFreqIndex===3||this.version===null||this.sampRateFreqIndex==null?null:n.sampling_rate_freq_index[this.version][this.sampRateFreqIndex]}};mo.SyncByte1=255;mo.SyncByte2=224;mo.VersionID=[2.5,null,2,1];mo.LayerDescription=[0,3,2,1];mo.ChannelMode=["stereo","joint_stereo","dual_channel","mono"];mo.bitrate_index={1:{11:32,12:32,13:32,21:32,22:8,23:8},2:{11:64,12:48,13:40,21:48,22:16,23:16},3:{11:96,12:56,13:48,21:56,22:24,23:24},4:{11:128,12:64,13:56,21:64,22:32,23:32},5:{11:160,12:80,13:64,21:80,22:40,23:40},6:{11:192,12:96,13:80,21:96,22:48,23:48},7:{11:224,12:112,13:96,21:112,22:56,23:56},8:{11:256,12:128,13:112,21:128,22:64,23:64},9:{11:288,12:160,13:128,21:144,22:80,23:80},10:{11:320,12:192,13:160,21:160,22:96,23:96},11:{11:352,12:224,13:192,21:176,22:112,23:112},12:{11:384,12:256,13:224,21:192,22:128,23:128},13:{11:416,12:320,13:256,21:224,22:144,23:144},14:{11:448,12:384,13:320,21:256,22:160,23:160}};mo.sampling_rate_freq_index={1:{0:44100,1:48e3,2:32e3},2:{0:22050,1:24e3,2:16e3},2.5:{0:11025,1:12e3,2:8e3}};mo.samplesInFrameTable=[[0,384,1152,1152],[0,384,1152,576]];sae={len:4,get:(n,t)=>new mo(n,t)};nU=class extends $s{constructor(){super(...arguments),this.frameCount=0,this.syncFrameCount=-1,this.totalDataLength=0,this.bitrates=[],this.offset=0,this.frame_size=0,this.calculateEofDuration=!1,this.samplesPerFrame=null,this.buf_frame_header=new Uint8Array(4),this.mpegOffset=null,this.syncPeek={buf:new Uint8Array(oae),len:0}}async postId3v2Parse(){this.metadata.setFormat("lossless",!1),this.metadata.setAudioOnly();try{let t=!1;for(;!t;)await this.sync(),t=await this.parseCommonMpegHeader()}catch(t){if(t instanceof kA){if(yo("End-of-stream"),this.calculateEofDuration&&this.samplesPerFrame!==null){let o=this.frameCount*this.samplesPerFrame;if(this.metadata.setFormat("numberOfSamples",o),this.metadata.format.sampleRate){let a=o/this.metadata.format.sampleRate;yo(`Calculate duration at EOF: ${a} sec.`,a),this.metadata.setFormat("duration",a)}}}else throw t}}finalize(){let t=this.metadata.format,o=!!this.metadata.native.ID3v1;if(this.mpegOffset!==null){if(t.duration&&this.tokenizer.fileInfo.size){let a=this.tokenizer.fileInfo.size-this.mpegOffset-(o?128:0);t.codecProfile&&t.codecProfile[0]==="V"&&this.metadata.setFormat("bitrate",a*8/t.duration)}if(this.tokenizer.fileInfo.size&&t.codecProfile==="CBR"){let a=this.tokenizer.fileInfo.size-this.mpegOffset-(o?128:0);if(this.frame_size!==null&&this.samplesPerFrame!==null){let e=Math.round(a/this.frame_size)*this.samplesPerFrame;if(this.metadata.setFormat("numberOfSamples",e),t.sampleRate&&!t.duration){let i=e/t.sampleRate;yo("Calculate CBR duration based on file size: %s",i),this.metadata.setFormat("duration",i)}}}}}async sync(){let t=!1;for(;;){let o=0;if(this.syncPeek.len=await this.tokenizer.peekBuffer(this.syncPeek.buf,{length:oae,mayBeLess:!0}),this.syncPeek.len<=163)throw new kA;for(;;){if(t&&(this.syncPeek.buf[o]&224)===224){this.buf_frame_header[0]=mo.SyncByte1,this.buf_frame_header[1]=this.syncPeek.buf[o],await this.tokenizer.ignore(o),yo(`Sync at offset=${this.tokenizer.position-1}, frameCount=${this.frameCount}`),this.syncFrameCount===this.frameCount&&(yo(`Re-synced MPEG stream, frameCount=${this.frameCount}`),this.frameCount=0,this.frame_size=0),this.syncFrameCount=this.frameCount;return}if(t=!1,o=this.syncPeek.buf.indexOf(mo.SyncByte1,o),o===-1){if(this.syncPeek.len=2&&t.layer===0?this.parseAdts(t):this.parseAudioFrameHeader(t)}async parseAudioFrameHeader(t){this.metadata.setFormat("numberOfChannels",t.channelMode==="mono"?1:2),this.metadata.setFormat("bitrate",t.bitrate),this.frameCount<20*1e4&&yo("offset=%s MP%s bitrate=%s sample-rate=%s",this.tokenizer.position-4,t.layer,t.bitrate,t.samplingRate);let o=t.calcSlotSize();if(o===null)throw new op("invalid slot_size");let a=t.calcSamplesPerFrame();yo(`samples_per_frame=${a}`);let e=a/8;if(t.bitrate!==null&&t.samplingRate!=null){let i=e*t.bitrate/t.samplingRate+(t.padding?o:0);this.frame_size=Math.floor(i)}if(this.audioFrameHeader=t,t.bitrate!==null&&this.bitrates.push(t.bitrate),this.frameCount===1)return this.offset=sae.len,await this.skipSideInformation(),!1;if(this.frameCount===4){if(this.areAllSame(this.bitrates)){if(this.samplesPerFrame=a,this.metadata.setFormat("codecProfile","CBR"),this.tokenizer.fileInfo.size)return!0}else if(this.metadata.format.duration)return!0;if(!this.options.duration)return!0}return this.options.duration&&this.frameCount===4&&(this.samplesPerFrame=a,this.calculateEofDuration=!0),this.offset=4,t.isProtectedByCRC?(await this.parseCrc(),!1):(await this.skipSideInformation(),!1)}async parseAdts(t){let o=new Uint8Array(3);if(await this.tokenizer.readBuffer(o),t.frameLength+=XA(o,0,0,11),this.totalDataLength+=t.frameLength,this.samplesPerFrame=1024,t.samplingRate!==null){let a=t.samplingRate/this.samplesPerFrame,i=8*(this.frameCount===0?0:this.totalDataLength/this.frameCount)*a+.5;this.metadata.setFormat("bitrate",i),yo(`frame-count=${this.frameCount}, size=${t.frameLength} bytes, bit-rate=${i}`)}if(await this.tokenizer.ignore(t.frameLength>7?t.frameLength-7:1),this.frameCount===3)if(this.metadata.setFormat("codecProfile",t.codecProfile),t.mp4ChannelConfig&&this.metadata.setFormat("numberOfChannels",t.mp4ChannelConfig.length),this.options.duration)this.calculateEofDuration=!0;else return!0;return!1}async parseCrc(){return await this.tokenizer.ignore(on.len),this.offset+=on.len,this.skipSideInformation()}async skipSideInformation(){if(this.audioFrameHeader){let t=this.audioFrameHeader.calculateSideInfoLength();if(t!==null){await this.tokenizer.readToken(new Mt(t)),this.offset+=t,await this.readXtraInfoHeader();return}}}async readXtraInfoHeader(){let t=await this.tokenizer.readToken(oU);switch(this.offset+=oU.len,t){case"Info":return this.metadata.setFormat("codecProfile","CBR"),this.readXingInfoHeader();case"Xing":{let a=await this.readXingInfoHeader();if(a.vbrScale!==null){let e=pze(a.vbrScale);this.metadata.setFormat("codecProfile",e)}return null}case"Xtra":break;case"LAME":{let a=await this.tokenizer.readToken($O);if(this.frame_size!==null&&this.frame_size>=this.offset+$O.len)return this.offset+=$O.len,this.metadata.setFormat("tool",`LAME ${a}`),await this.skipFrameData(this.frame_size-this.offset),null;this.metadata.addWarning("Corrupt LAME header");break}}let o=this.frame_size-this.offset;return o<0?this.metadata.addWarning(`Frame ${this.frameCount}corrupt: negative frameDataLeft`):await this.skipFrameData(o),null}async readXingInfoHeader(){let t=this.tokenizer.position,o=await iae(this.tokenizer);if(this.offset+=this.tokenizer.position-t,o.lame&&(this.metadata.setFormat("tool",`LAME ${gn(o.lame.version)}`),o.lame.extended&&(this.metadata.setFormat("trackPeakLevel",o.lame.extended.track_peak),o.lame.extended.track_gain&&this.metadata.setFormat("trackGain",o.lame.extended.track_gain.adjustment),o.lame.extended.album_gain&&this.metadata.setFormat("albumGain",o.lame.extended.album_gain.adjustment),this.metadata.setFormat("duration",o.lame.extended.music_length/1e3))),o.streamSize&&this.audioFrameHeader&&o.numFrames!==null){let e=this.audioFrameHeader.calcDuration(o.numFrames);return this.metadata.setFormat("duration",e),yo("Get duration from Xing header: %s",this.metadata.format.duration),o}let a=this.frame_size-this.offset;return await this.skipFrameData(a),o}async skipFrameData(t){if(t<0)throw new op("frame-data-left cannot be negative");await this.tokenizer.ignore(t)}areAllSame(t){let o=t[0];return t.every(a=>a===o)}}});var lae,pae=ue(()=>{lae={parserType:"mpeg",extensions:[".mp2",".mp3",".m2a",".aac","aacp"],mimeTypes:["audio/mpeg","audio/mp3","audio/aacs","audio/aacp"],async load(){return(await Promise.resolve().then(()=>(Iae(),cae))).MpegParser}}});var dae,hae=ue(()=>{dae={parserType:"apev2",extensions:[".ape"],mimeTypes:["audio/ape","audio/monkeys-audio"],async load(){return(await Promise.resolve().then(()=>(ap(),qie))).APEv2Parser}}});function sU(n){let t=n.trim();if(t.length!==36||t[8]!=="-"||t[13]!=="-"||t[18]!=="-"||t[23]!=="-")throw new Error(`Invalid GUID format: ${n}`);let o,a=new Uint8Array(16);o=parseInt(t.slice(0,8),16),a[0]=o&255,a[1]=o>>>8&255,a[2]=o>>>16&255,a[3]=o>>>24&255,o=parseInt(t.slice(9,13),16),a[4]=o&255,a[5]=o>>>8&255,o=parseInt(t.slice(14,18),16),a[6]=o&255,a[7]=o>>>8&255,o=parseInt(t.slice(19,23),16),a[8]=o>>>8&255,a[9]=o&255,o=parseInt(t.slice(24,32),16),a[10]=o>>>24&255,a[11]=o>>>16&255,a[12]=o>>>8&255,a[13]=o&255,o=parseInt(t.slice(32,36),16),a[14]=o>>>8&255,a[15]=o&255;for(let e=0;e<16;e++)if(!Number.isFinite(a[e]))throw new Error(`Invalid GUID format: ${n}`);if(!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(t))throw new Error(`Invalid GUID format: ${n}`);return a}var eb,Eae=ue(()=>{eb=class n{constructor(t){if(t.length!==16)throw new Error("GUID must be exactly 16 bytes");this.bytes=t}static fromString(t){return new n(sU(t))}toString(){let t=this.bytes,o=s=>s.toString(16).padStart(2,"0"),a=o(t[3])+o(t[2])+o(t[1])+o(t[0]),e=o(t[5])+o(t[4]),i=o(t[7])+o(t[6]),A=o(t[8])+o(t[9]),r=o(t[10])+o(t[11])+o(t[12])+o(t[13])+o(t[14])+o(t[15]);return`${a}-${e}-${i}-${A}-${r}`.toUpperCase()}equals(t,o=0){if(o<0||t.length-o<16)return!1;let a=this.bytes;for(let e=0;e<16;e++)if(t[o+e]!==a[e])return!1;return!0}}});var Ye,sr,gU=ue(()=>{Eae();Ye=class n{static fromBin(t,o=0){return new n(n.decode(t,o))}static decode(t,o=0){return new eb(t.subarray(o,o+16)).toString()}static decodeMediaType(t){switch(t.str){case n.AudioMedia.str:return"audio";case n.VideoMedia.str:return"video";case n.CommandMedia.str:return"command";case n.Degradable_JPEG_Media.str:return"degradable-jpeg";case n.FileTransferMedia.str:return"file-transfer";case n.BinaryMedia.str:return"binary"}}static encode(t){return sU(t)}constructor(t){this.str=t}equals(t){return this.str===t.str}toBin(){return n.encode(this.str)}};Ye.HeaderObject=new Ye("75B22630-668E-11CF-A6D9-00AA0062CE6C");Ye.DataObject=new Ye("75B22636-668E-11CF-A6D9-00AA0062CE6C");Ye.SimpleIndexObject=new Ye("33000890-E5B1-11CF-89F4-00A0C90349CB");Ye.IndexObject=new Ye("D6E229D3-35DA-11D1-9034-00A0C90349BE");Ye.MediaObjectIndexObject=new Ye("FEB103F8-12AD-4C64-840F-2A1D2F7AD48C");Ye.TimecodeIndexObject=new Ye("3CB73FD0-0C4A-4803-953D-EDF7B6228F0C");Ye.FilePropertiesObject=new Ye("8CABDCA1-A947-11CF-8EE4-00C00C205365");Ye.StreamPropertiesObject=new Ye("B7DC0791-A9B7-11CF-8EE6-00C00C205365");Ye.HeaderExtensionObject=new Ye("5FBF03B5-A92E-11CF-8EE3-00C00C205365");Ye.CodecListObject=new Ye("86D15240-311D-11D0-A3A4-00A0C90348F6");Ye.ScriptCommandObject=new Ye("1EFB1A30-0B62-11D0-A39B-00A0C90348F6");Ye.MarkerObject=new Ye("F487CD01-A951-11CF-8EE6-00C00C205365");Ye.BitrateMutualExclusionObject=new Ye("D6E229DC-35DA-11D1-9034-00A0C90349BE");Ye.ErrorCorrectionObject=new Ye("75B22635-668E-11CF-A6D9-00AA0062CE6C");Ye.ContentDescriptionObject=new Ye("75B22633-668E-11CF-A6D9-00AA0062CE6C");Ye.ExtendedContentDescriptionObject=new Ye("D2D0A440-E307-11D2-97F0-00A0C95EA850");Ye.ContentBrandingObject=new Ye("2211B3FA-BD23-11D2-B4B7-00A0C955FC6E");Ye.StreamBitratePropertiesObject=new Ye("7BF875CE-468D-11D1-8D82-006097C9A2B2");Ye.ContentEncryptionObject=new Ye("2211B3FB-BD23-11D2-B4B7-00A0C955FC6E");Ye.ExtendedContentEncryptionObject=new Ye("298AE614-2622-4C17-B935-DAE07EE9289C");Ye.DigitalSignatureObject=new Ye("2211B3FC-BD23-11D2-B4B7-00A0C955FC6E");Ye.PaddingObject=new Ye("1806D474-CADF-4509-A4BA-9AABCB96AAE8");Ye.ExtendedStreamPropertiesObject=new Ye("14E6A5CB-C672-4332-8399-A96952065B5A");Ye.AdvancedMutualExclusionObject=new Ye("A08649CF-4775-4670-8A16-6E35357566CD");Ye.GroupMutualExclusionObject=new Ye("D1465A40-5A79-4338-B71B-E36B8FD6C249");Ye.StreamPrioritizationObject=new Ye("D4FED15B-88D3-454F-81F0-ED5C45999E24");Ye.BandwidthSharingObject=new Ye("A69609E6-517B-11D2-B6AF-00C04FD908E9");Ye.LanguageListObject=new Ye("7C4346A9-EFE0-4BFC-B229-393EDE415C85");Ye.MetadataObject=new Ye("C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA");Ye.MetadataLibraryObject=new Ye("44231C94-9498-49D1-A141-1D134E457054");Ye.IndexParametersObject=new Ye("D6E229DF-35DA-11D1-9034-00A0C90349BE");Ye.MediaObjectIndexParametersObject=new Ye("6B203BAD-3F11-48E4-ACA8-D7613DE2CFA7");Ye.TimecodeIndexParametersObject=new Ye("F55E496D-9797-4B5D-8C8B-604DFE9BFB24");Ye.CompatibilityObject=new Ye("26F18B5D-4584-47EC-9F5F-0E651F0452C9");Ye.AdvancedContentEncryptionObject=new Ye("43058533-6981-49E6-9B74-AD12CB86D58C");Ye.AudioMedia=new Ye("F8699E40-5B4D-11CF-A8FD-00805F5C442B");Ye.VideoMedia=new Ye("BC19EFC0-5B4D-11CF-A8FD-00805F5C442B");Ye.CommandMedia=new Ye("59DACFC0-59E6-11D0-A3AC-00A0C90348F6");Ye.JFIF_Media=new Ye("B61BE100-5B4E-11CF-A8FD-00805F5C442B");Ye.Degradable_JPEG_Media=new Ye("35907DE0-E415-11CF-A917-00805F5C442B");Ye.FileTransferMedia=new Ye("91BD222C-F21C-497A-8B6D-5AA86BFC0185");Ye.BinaryMedia=new Ye("3AFB65E2-47EF-40F2-AC2C-70A90D71D343");Ye.ASF_Index_Placeholder_Object=new Ye("D9AADE20-7C17-4F9C-BC28-8555DD98E2A2");sr=Ye});function Cae(n){return dze[n]}function bf(n){return gn(Qi(n,"utf-16le"))}function uae(n){return new Uint8Array(n)}function hze(n,t=0){return Bae(n,t)===1}function Eze(n,t=0){return Le.get(n,t)}function uze(n,t=0){return Fr.get(n,t)}function Bae(n,t=0){return SA.get(n,t)}var dze,fae=ue(()=>{DA();nr();dze=[bf,uae,hze,Eze,uze,Bae,uae]});async function Qae(n){let t=await n.readNumber(SA);return(await n.readToken(new We(t*2,"utf-16le"))).replace("\0","")}async function mae(n){let t=await n.readToken(Cze),o=[];for(let a=0;a{DA();nr();gU();fae();QI();or();nE=class extends St("ASF"){},yae={len:30,get:(n,t)=>({objectId:sr.fromBin(n,t),objectSize:Number(Fr.get(n,t+16)),numberOfHeaderObjects:Le.get(n,t+24)})},DI={len:24,get:(n,t)=>({objectId:sr.fromBin(n,t),objectSize:Number(Fr.get(n,t+16))})},ic=class{constructor(t){this.len=Number(t.objectSize)-DI.len}postProcessTag(t,o,a,e){if(o==="WM/Picture")t.push({id:o,value:cU.fromBuffer(e)});else{let i=Cae(a);if(!i)throw new nE(`unexpected value headerType: ${a}`);t.push({id:o,value:i(e)})}}},Mf=class extends ic{get(t,o){return null}},sE=class extends ic{get(t,o){return{fileId:sr.fromBin(t,o),fileSize:Fr.get(t,o+16),creationDate:Fr.get(t,o+24),dataPacketsCount:Fr.get(t,o+32),playDuration:Fr.get(t,o+40),sendDuration:Fr.get(t,o+48),preroll:Fr.get(t,o+56),flags:{broadcast:GA(t,o+64,24),seekable:GA(t,o+64,25)},minimumDataPacketSize:Le.get(t,o+68),maximumDataPacketSize:Le.get(t,o+72),maximumBitrate:Le.get(t,o+76)}}};sE.guid=sr.FilePropertiesObject;gE=class extends ic{get(t,o){return{streamType:sr.decodeMediaType(sr.fromBin(t,o)),errorCorrectionType:sr.fromBin(t,o+8)}}};gE.guid=sr.StreamPropertiesObject;cE=class{constructor(){this.len=22}get(t,o){let a=new DataView(t.buffer,o);return{reserved1:sr.fromBin(t,o),reserved2:a.getUint16(16,!0),extensionDataSize:a.getUint16(18,!0)}}};cE.guid=sr.HeaderExtensionObject;Cze={len:20,get:(n,t)=>({entryCount:new DataView(n.buffer,t).getUint16(16,!0)})};np=class n extends ic{get(t,o){let a=[],e=new DataView(t.buffer,o),i=10;for(let A=0;A0){let s=n.contentDescTags[A],g=i+r;a.push({id:s,value:bf(t.subarray(o+i,o+g))}),i=g}}return a}};np.guid=sr.ContentDescriptionObject;np.contentDescTags=["Title","Author","Copyright","Description","Rating"];IE=class extends ic{get(t,o){let a=[],e=new DataView(t.buffer,o),i=e.getUint16(0,!0),A=2;for(let r=0;rpU});var Sae,lU,yze,pU,Dae=ue(()=>{Sae=ze(lt(),1);tp();gU();IU();$a();IU();lU=(0,Sae.default)("music-metadata:parser:ASF"),yze="asf",pU=class extends Gt{async parse(){let t=await this.tokenizer.readToken(yae);if(!t.objectId.equals(sr.HeaderObject))throw new nE(`expected asf header; but was not found; got: ${t.objectId.str}`);await this.parseObjectHeader(t.numberOfHeaderObjects)}async parseObjectHeader(t){let o;do{let a=await this.tokenizer.readToken(DI);switch(lU("header GUID=%s",a.objectId.str),a.objectId.str){case sE.guid.str:{let e=await this.tokenizer.readToken(new sE(a));this.metadata.setFormat("duration",Number(e.playDuration/BigInt(1e3))/1e4-Number(e.preroll)/1e3),this.metadata.setFormat("bitrate",e.maximumBitrate);break}case gE.guid.str:{let e=await this.tokenizer.readToken(new gE(a));this.metadata.setFormat("container",`ASF/${e.streamType}`);break}case cE.guid.str:{let e=await this.tokenizer.readToken(new cE);await this.parseExtensionObject(e.extensionDataSize);break}case np.guid.str:o=await this.tokenizer.readToken(new np(a)),await this.addTags(o);break;case IE.guid.str:o=await this.tokenizer.readToken(new IE(a)),await this.addTags(o);break;case sr.CodecListObject.str:{let e=await mae(this.tokenizer);e.forEach(A=>{this.metadata.addStreamInfo({type:A.type.videoCodec?fi.video:fi.audio,codecName:A.codecName})});let i=e.filter(A=>A.type.audioCodec).map(A=>A.codecName).join("/");this.metadata.setFormat("codec",i);break}case sr.StreamBitratePropertiesObject.str:await this.tokenizer.ignore(a.objectSize-DI.len);break;case sr.PaddingObject.str:lU("Padding: %s bytes",a.objectSize-DI.len),await this.tokenizer.ignore(a.objectSize-DI.len);break;default:this.metadata.addWarning(`Ignore ASF-Object-GUID: ${a.objectId.str}`),lU("Ignore ASF-Object-GUID: %s",a.objectId.str),await this.tokenizer.readToken(new Mf(a))}}while(--t)}async addTags(t){await Promise.all(t.map(({id:o,value:a})=>this.metadata.addTag(yze,o,a)))}async parseExtensionObject(t){do{let o=await this.tokenizer.readToken(DI),a=o.objectSize-DI.len;if(a<0)throw new nE(`Invalid ASF header object size: ${o.objectSize}`);switch(o.objectId.str){case lE.guid.str:await this.tokenizer.readToken(new lE(o));break;case sp.guid.str:{let e=await this.tokenizer.readToken(new sp(o));await this.addTags(e);break}case pE.guid.str:{let e=await this.tokenizer.readToken(new pE(o));await this.addTags(e);break}case sr.PaddingObject.str:await this.tokenizer.ignore(a);break;case sr.CompatibilityObject.str:await this.tokenizer.ignore(a);break;case sr.ASF_Index_Placeholder_Object.str:await this.tokenizer.ignore(a);break;default:this.metadata.addWarning(`Ignore ASF-Object-GUID: ${o.objectId.str}`),await this.tokenizer.readToken(new Mf(o));break}t-=o.objectSize}while(t>0)}}});var Oae,bae=ue(()=>{Oae={parserType:"asf",extensions:[".asf",".wma",".wmv"],mimeTypes:["audio/ms-wma","video/ms-wmv","audio/ms-asf","video/ms-asf","application/vnd.ms-asf"],async load(){return(await Promise.resolve().then(()=>(Dae(),wae))).AsfParser}}});var gp,Mae=ue(()=>{DA();ma();gp={len:12,get:(n,t)=>({chunkID:at.get(n,t),chunkSize:R2.get(n,t+4)})}});var Tae={};Lr(Tae,{DsdiffContentParseError:()=>dE,DsdiffParser:()=>dU});var _ae,Sa,dE,dU,Nae=ue(()=>{DA();_ae=ze(lt(),1);an();ma();$a();oE();Mae();or();Sa=(0,_ae.default)("music-metadata:parser:aiff"),dE=class extends St("DSDIFF"){},dU=class extends Gt{async parse(){let t=await this.tokenizer.readToken(gp);if(t.chunkID!=="FRM8")throw new dE("Unexpected chunk-ID");this.metadata.setAudioOnly();let o=(await this.tokenizer.readToken(at)).trim();switch(o){case"DSD":return this.metadata.setFormat("container",`DSDIFF/${o}`),this.metadata.setFormat("lossless",!0),this.readFmt8Chunks(t.chunkSize-BigInt(at.len));default:throw new dE(`Unsupported DSDIFF type: ${o}`)}}async readFmt8Chunks(t){for(;t>=gp.len;){let o=await this.tokenizer.readToken(gp);Sa(`Chunk id=${o.chunkID}`),await this.readData(o),t-=BigInt(gp.len)+o.chunkSize}}async readData(t){Sa(`Reading data of chunk[ID=${t.chunkID}, size=${t.chunkSize}]`);let o=this.tokenizer.position;switch(t.chunkID.trim()){case"FVER":{let e=await this.tokenizer.readToken(Le);Sa(`DSDIFF version=${e}`);break}case"PROP":{if(await this.tokenizer.readToken(at)!=="SND ")throw new dE("Unexpected PROP-chunk ID");await this.handleSoundPropertyChunks(t.chunkSize-BigInt(at.len));break}case"ID3":{let e=await this.tokenizer.readToken(new Mt(Number(t.chunkSize))),i=Qo(e);await new ln().parse(this.metadata,i,this.options);break}case"DSD":this.metadata.format.numberOfChannels&&this.metadata.setFormat("numberOfSamples",Number(t.chunkSize*BigInt(8)/BigInt(this.metadata.format.numberOfChannels))),this.metadata.format.numberOfSamples&&this.metadata.format.sampleRate&&this.metadata.setFormat("duration",this.metadata.format.numberOfSamples/this.metadata.format.sampleRate);break;default:Sa(`Ignore chunk[ID=${t.chunkID}, size=${t.chunkSize}]`);break}let a=t.chunkSize-BigInt(this.tokenizer.position-o);a>0&&(Sa(`After Parsing chunk, remaining ${a} bytes`),await this.tokenizer.ignore(Number(a)))}async handleSoundPropertyChunks(t){for(Sa(`Parsing sound-property-chunks, remainingSize=${t}`);t>0;){let o=await this.tokenizer.readToken(gp);Sa(`Sound-property-chunk[ID=${o.chunkID}, size=${o.chunkSize}]`);let a=this.tokenizer.position;switch(o.chunkID.trim()){case"FS":{let i=await this.tokenizer.readToken(xe);this.metadata.setFormat("sampleRate",i);break}case"CHNL":{let i=await this.tokenizer.readToken(LA);this.metadata.setFormat("numberOfChannels",i),await this.handleChannelChunks(o.chunkSize-BigInt(LA.len));break}case"CMPR":{let i=(await this.tokenizer.readToken(at)).trim(),A=await this.tokenizer.readToken(QA),r=await this.tokenizer.readToken(new We(A,"ascii"));i==="DSD"&&(this.metadata.setFormat("lossless",!0),this.metadata.setFormat("bitsPerSample",1)),this.metadata.setFormat("codec",`${i} (${r})`);break}case"ABSS":{let i=await this.tokenizer.readToken(LA),A=await this.tokenizer.readToken(QA),r=await this.tokenizer.readToken(QA),s=await this.tokenizer.readToken(xe);Sa(`ABSS ${i}:${A}:${r}.${s}`);break}case"LSCO":{let i=await this.tokenizer.readToken(LA);Sa(`LSCO lsConfig=${i}`);break}default:Sa(`Unknown sound-property-chunk[ID=${o.chunkID}, size=${o.chunkSize}]`),await this.tokenizer.ignore(Number(o.chunkSize))}let e=o.chunkSize-BigInt(this.tokenizer.position-a);e>0&&(Sa(`After Parsing sound-property-chunk ${o.chunkSize}, remaining ${e} bytes`),await this.tokenizer.ignore(Number(e))),t-=BigInt(gp.len)+o.chunkSize,Sa(`Parsing sound-property-chunks, remainingSize=${t}`)}if(this.metadata.format.lossless&&this.metadata.format.sampleRate&&this.metadata.format.numberOfChannels&&this.metadata.format.bitsPerSample){let o=this.metadata.format.sampleRate*this.metadata.format.numberOfChannels*this.metadata.format.bitsPerSample;this.metadata.setFormat("bitrate",o)}}async handleChannelChunks(t){Sa(`Parsing channel-chunks, remainingSize=${t}`);let o=[];for(;t>=at.len;){let a=await this.tokenizer.readToken(at);Sa(`Channel[ID=${a}]`),o.push(a),t-=BigInt(at.len)}return Sa(`Channels: ${o.join(", ")}`),o}}});var Rae,kae=ue(()=>{Rae={parserType:"dsdiff",extensions:[".dff"],mimeTypes:["audio/dsf","audio/dsd"],async load(){return(await Promise.resolve().then(()=>(Nae(),Tae))).DsdiffParser}}});var vae,OI,Ab,hU=ue(()=>{DA();ma();or();vae={NONE:"not compressed PCM Apple Computer",sowt:"PCM (byte swapped)",fl32:"32-bit floating point IEEE 32-bit float",fl64:"64-bit floating point IEEE 64-bit float Apple Computer",alaw:"ALaw 2:1 8-bit ITU-T G.711 A-law",ulaw:"\xB5Law 2:1 8-bit ITU-T G.711 \xB5-law Apple Computer",ULAW:"CCITT G.711 u-law 8-bit ITU-T G.711 \xB5-law",ALAW:"CCITT G.711 A-law 8-bit ITU-T G.711 A-law",FL32:"Float 32 IEEE 32-bit float "},OI=class extends St("AIFF"){},Ab=class{constructor(t,o){this.isAifc=o;let a=o?22:18;if(t.chunkSize>Math.abs(a):e<22){let A=QA.get(t,o+22);if(A>0){let r=(A+1)%2;if(23+A+r===this.len)i.compressionName=new We(A,"latin1").get(t,o+23);else throw new OI("Illegal pstring length")}else i.compressionName=void 0}}else i.compressionName="PCM";return i}}});var tb,Pae=ue(()=>{DA();ma();tb={len:8,get:(n,t)=>({chunkID:at.get(n,t),chunkSize:Number(BigInt(xe.get(n,t+4)))})}});var Fae={};Lr(Fae,{AIFFParser:()=>uU});var Gae,EU,uU,Lae=ue(()=>{DA();Gae=ze(lt(),1);an();oE();ma();$a();hU();hU();Pae();EU=(0,Gae.default)("music-metadata:parser:aiff"),uU=class extends Gt{constructor(){super(...arguments),this.isCompressed=null}async parse(){if((await this.tokenizer.readToken(tb)).chunkID!=="FORM")throw new OI("Invalid Chunk-ID, expected 'FORM'");let o=await this.tokenizer.readToken(at);switch(o){case"AIFF":this.metadata.setFormat("container",o),this.isCompressed=!1;break;case"AIFC":this.metadata.setFormat("container","AIFF-C"),this.isCompressed=!0;break;default:throw new OI(`Unsupported AIFF type: ${o}`)}this.metadata.setFormat("lossless",!this.isCompressed),this.metadata.setAudioOnly();try{for(;!this.tokenizer.fileInfo.size||this.tokenizer.fileInfo.size-this.tokenizer.position>=tb.len;){EU(`Reading AIFF chunk at offset=${this.tokenizer.position}`);let a=await this.tokenizer.readToken(tb),e=2*Math.round(a.chunkSize/2),i=await this.readData(a);await this.tokenizer.ignore(e-i)}}catch(a){if(a instanceof kA)EU("End-of-stream");else throw a}}async readData(t){switch(t.chunkID){case"COMM":{if(this.isCompressed===null)throw new OI("Failed to parse AIFF.COMM chunk when compression type is unknown");let o=await this.tokenizer.readToken(new Ab(t,this.isCompressed));return this.metadata.setFormat("bitsPerSample",o.sampleSize),this.metadata.setFormat("sampleRate",o.sampleRate),this.metadata.setFormat("numberOfChannels",o.numChannels),this.metadata.setFormat("numberOfSamples",o.numSampleFrames),this.metadata.setFormat("duration",o.numSampleFrames/o.sampleRate),(o.compressionName||o.compressionType)&&this.metadata.setFormat("codec",o.compressionName??vae[o.compressionType]),t.chunkSize}case"ID3 ":{let o=await this.tokenizer.readToken(new Mt(t.chunkSize)),a=Qo(o);return await new ln().parse(this.metadata,a,this.options),t.chunkSize}case"SSND":return this.metadata.format.duration&&this.metadata.setFormat("bitrate",8*t.chunkSize/this.metadata.format.duration),0;case"NAME":case"AUTH":case"(c) ":case"ANNO":return this.readTextChunk(t);default:return EU(`Ignore chunk id=${t.chunkID}, size=${t.chunkSize}`),0}}async readTextChunk(t){let a=(await this.tokenizer.readToken(new We(t.chunkSize,"ascii"))).split("\0").map(e=>e.trim()).filter(e=>e?.length);return await Promise.all(a.map(e=>this.metadata.addTag("AIFF",t.chunkID,e))),t.chunkSize}}});var Uae,Hae=ue(()=>{Uae={parserType:"aiff",extensions:[".aif","aiff","aifc"],mimeTypes:["audio/aiff","audio/aif","audio/aifc","application/aiff"],async load(){return(await Promise.resolve().then(()=>(Lae(),Fae))).AIFFParser}}});var _f,Kae,xae,Yae=ue(()=>{DA();ma();_f={len:12,get:(n,t)=>({id:at.get(n,t),size:Fr.get(n,t+4)})},Kae={len:16,get:(n,t)=>({fileSize:df.get(n,t),metadataPointer:df.get(n,t+8)})},xae={len:40,get:(n,t)=>({formatVersion:ur.get(n,t),formatID:ur.get(n,t+4),channelType:ur.get(n,t+8),channelNum:ur.get(n,t+12),samplingFrequency:ur.get(n,t+16),bitsPerSample:ur.get(n,t+20),sampleCount:df.get(n,t+24),blockSizePerChannel:ur.get(n,t+32)})}});var Jae={};Lr(Jae,{DsdContentParseError:()=>rb,DsfParser:()=>BU});var jae,CU,rb,BU,qae=ue(()=>{jae=ze(lt(),1);Of();Yae();oE();or();CU=(0,jae.default)("music-metadata:parser:DSF"),rb=class extends St("DSD"){},BU=class extends $s{async postId3v2Parse(){let t=this.tokenizer.position,o=await this.tokenizer.readToken(_f);if(o.id!=="DSD ")throw new rb("Invalid chunk signature");this.metadata.setFormat("container","DSF"),this.metadata.setFormat("lossless",!0),this.metadata.setAudioOnly();let a=await this.tokenizer.readToken(Kae);if(a.metadataPointer===BigInt(0))CU("No ID3v2 tag present");else return CU(`expect ID3v2 at offset=${a.metadataPointer}`),await this.parseChunks(a.fileSize-o.size),await this.tokenizer.ignore(Number(a.metadataPointer)-this.tokenizer.position-t),new ln().parse(this.metadata,this.tokenizer,this.options)}async parseChunks(t){for(;t>=_f.len;){let o=await this.tokenizer.readToken(_f);switch(CU(`Parsing chunk name=${o.id} size=${o.size}`),o.id){case"fmt ":{let a=await this.tokenizer.readToken(xae);this.metadata.setFormat("numberOfChannels",a.channelNum),this.metadata.setFormat("sampleRate",a.samplingFrequency),this.metadata.setFormat("bitsPerSample",a.bitsPerSample),this.metadata.setFormat("numberOfSamples",a.sampleCount),this.metadata.setFormat("duration",Number(a.sampleCount)/a.samplingFrequency);let e=a.bitsPerSample*a.samplingFrequency*a.channelNum;this.metadata.setFormat("bitrate",e);return}default:this.tokenizer.ignore(Number(o.size)-_f.len);break}t-=o.size}}}});var zae,Vae=ue(()=>{zae={parserType:"dsf",extensions:[".dsf"],mimeTypes:["audio/dsf"],async load(){return(await Promise.resolve().then(()=>(qae(),Jae))).DsfParser}}});var bI,Tf,Wae,ib=ue(()=>{DA();QI();bI=class n{static fromBase64(t){return n.fromBuffer(Uint8Array.from(atob(t),o=>o.charCodeAt(0)))}static fromBuffer(t){return new n(t.length).get(t,0)}constructor(t){this.len=t}get(t,o){let a=$h[xe.get(t,o)];o+=4;let e=xe.get(t,o);o+=4;let i=new We(e,"utf-8").get(t,o);o+=e;let A=xe.get(t,o);o+=4;let r=new We(A,"utf-8").get(t,o);o+=A;let s=xe.get(t,o);o+=4;let g=xe.get(t,o);o+=4;let c=xe.get(t,o);o+=4;let I=xe.get(t,o);o+=4;let p=xe.get(t,o);o+=4;let B=t.slice(o,o+p);return{type:a,format:i,description:r,width:s,height:g,colour_depth:c,indexed_color:I,data:B}}},Tf={len:7,get:(n,t)=>({packetType:QA.get(n,t),vorbis:new We(6,"ascii").get(n,t+1)})},Wae={len:23,get:(n,t)=>({version:Le.get(n,t+0),channelMode:QA.get(n,t+4),sampleRate:Le.get(n,t+5),bitrateMax:Le.get(n,t+9),bitrateNominal:Le.get(n,t+13),bitrateMin:Le.get(n,t+17)})}});var hE,fU=ue(()=>{DA();js();hE=class{constructor(t,o){this.data=t,this.offset=o}readInt32(){let t=Le.get(this.data,this.offset);return this.offset+=4,t}readStringUtf8(){let t=this.readInt32(),o=Tr(this.data.subarray(this.offset,this.offset+t),"utf-8");return this.offset+=t,o}parseUserComment(){let t=this.offset,o=this.readStringUtf8(),a=o.indexOf("=");return{key:o.substring(0,a).toUpperCase(),value:o.substring(a+1),len:this.offset-t}}}});var Zae,EE,Nf,eg,Rf=ue(()=>{DA();Zae=ze(lt(),1);fU();ib();or();EE=(0,Zae.default)("music-metadata:parser:ogg:vorbis1"),Nf=class extends St("Vorbis"){},eg=class n{constructor(t,o){this.pageSegments=[],this.durationOnLastPage=!0,this.metadata=t,this.options=o}async parsePage(t,o){if(this.lastPageHeader=t,t.headerType.firstPage)this.parseFirstPage(t,o);else{if(t.headerType.continued){if(this.pageSegments.length===0)throw new Nf("Cannot continue on previous page");this.pageSegments.push(o)}if(t.headerType.lastPage||!t.headerType.continued){if(this.pageSegments.length>0){let a=n.mergeUint8Arrays(this.pageSegments);await this.parseFullPage(a)}this.pageSegments=t.headerType.lastPage?[]:[o]}}}static mergeUint8Arrays(t){let o=t.reduce((e,i)=>e+i.length,0),a=new Uint8Array(o);return t.forEach((e,i,A)=>{let r=A.slice(0,i).reduce((s,g)=>s+g.length,0);a.set(e,r)}),a}async flush(){await this.parseFullPage(n.mergeUint8Arrays(this.pageSegments))}async parseUserComment(t,o){let e=new hE(t,o).parseUserComment();return await this.addTag(e.key,e.value),e.len}async addTag(t,o){if(t==="METADATA_BLOCK_PICTURE"&&typeof o=="string"){if(this.options.skipCovers){EE("Ignore picture");return}o=bI.fromBase64(o),EE(`Push picture: id=${t}, format=${o.format}`)}else EE(`Push tag: id=${t}, value=${o}`);await this.metadata.addTag("vorbis",t,o)}calculateDuration(t){this.lastPageHeader&&(t||this.lastPageHeader.headerType.lastPage)&&this.metadata.format.sampleRate&&this.lastPageHeader.absoluteGranulePosition>=0&&(this.metadata.setFormat("numberOfSamples",this.lastPageHeader.absoluteGranulePosition),this.metadata.setFormat("duration",this.lastPageHeader.absoluteGranulePosition/this.metadata.format.sampleRate))}parseFirstPage(t,o){this.metadata.setFormat("codec","Vorbis I"),this.metadata.setFormat("hasAudio",!0),EE("Parse first page");let a=Tf.get(o,0);if(a.vorbis!=="vorbis")throw new Nf("Metadata does not look like Vorbis");if(a.packetType===1){let e=Wae.get(o,Tf.len);this.metadata.setFormat("sampleRate",e.sampleRate),this.metadata.setFormat("bitrate",e.bitrateNominal),this.metadata.setFormat("numberOfChannels",e.channelMode),EE("sample-rate=%s[hz], bitrate=%s[b/s], channel-mode=%s",e.sampleRate,e.bitrateNominal,e.channelMode)}else throw new Nf("First Ogg page should be type 1: the identification header")}async parseFullPage(t){let o=Tf.get(t,0);switch(EE("Parse full page: type=%s, byteLength=%s",o.packetType,t.byteLength),o.packetType){case 3:return this.parseUserCommentList(t,Tf.len);case 1:case 5:break}}async parseUserCommentList(t,o){let a=Le.get(t,o);o+=4,o+=a;let e=Le.get(t,o);for(o+=4;e-- >0;)o+=await this.parseUserComment(t,o)}}});var wa,kf,vf,QU=ue(()=>{nr();DA();wa={STREAMINFO:0,PADDING:1,APPLICATION:2,SEEKTABLE:3,VORBIS_COMMENT:4,CUESHEET:5,PICTURE:6},kf={len:4,get:(n,t)=>({lastBlock:GA(n,t,7),type:XA(n,t,1,7),length:Gr.get(n,t+1)})},vf={len:34,get:(n,t)=>({minimumBlockSize:LA.get(n,t),maximumBlockSize:LA.get(n,t+2)/1e3,minimumFrameSize:Gr.get(n,t+4),maximumFrameSize:Gr.get(n,t+7),sampleRate:Gr.get(n,t+10)>>4,channels:XA(n,t+12,4,3)+1,bitsPerSample:XA(n,t+12,7,5)+1,totalSamples:XA(n,t+13,4,36),fileMD5:new Mt(16).get(n,t+18)})}});var eoe={};Lr(eoe,{FlacParser:()=>Pf});var $ae,wze,ab,Pf,yU=ue(()=>{$ae=ze(lt(),1);DA();ib();Of();ma();Rf();fU();or();QU();wze=(0,$ae.default)("music-metadata:parser:FLAC"),ab=class extends St("FLAC"){},Pf=class extends $s{constructor(){super(...arguments),this.vorbisParser=new eg(this.metadata,this.options)}async postId3v2Parse(){if((await this.tokenizer.readToken(at)).toString()!=="fLaC")throw new ab("Invalid FLAC preamble");let o;do o=await this.tokenizer.readToken(kf),await this.parseDataBlock(o);while(!o.lastBlock);if(this.tokenizer.fileInfo.size&&this.metadata.format.duration){let a=this.tokenizer.fileInfo.size-this.tokenizer.position;this.metadata.setFormat("bitrate",8*a/this.metadata.format.duration)}}async parseDataBlock(t){switch(wze(`blockHeader type=${t.type}, length=${t.length}`),t.type){case wa.STREAMINFO:return this.readBlockStreamInfo(t.length);case wa.PADDING:break;case wa.APPLICATION:break;case wa.SEEKTABLE:break;case wa.VORBIS_COMMENT:return this.readComment(t.length);case wa.CUESHEET:break;case wa.PICTURE:await this.parsePicture(t.length);return;default:this.metadata.addWarning(`Unknown block type: ${t.type}`)}return this.tokenizer.ignore(t.length).then()}async readBlockStreamInfo(t){if(t!==vf.len)throw new ab("Unexpected block-stream-info length");let o=await this.tokenizer.readToken(vf);this.metadata.setFormat("container","FLAC"),this.processsStreamInfo(o)}processsStreamInfo(t){this.metadata.setFormat("codec","FLAC"),this.metadata.setFormat("hasAudio",!0),this.metadata.setFormat("lossless",!0),this.metadata.setFormat("numberOfChannels",t.channels),this.metadata.setFormat("bitsPerSample",t.bitsPerSample),this.metadata.setFormat("sampleRate",t.sampleRate),t.totalSamples>0&&this.metadata.setFormat("duration",t.totalSamples/t.sampleRate)}async readComment(t){let o=await this.tokenizer.readToken(new Mt(t));return this.parseComment(o)}async parseComment(t){let o=new hE(t,0),a=o.readStringUtf8();a.length>0&&this.metadata.setFormat("tool",a);let e=o.readInt32(),i=new Array(e);for(let A=0;A(A.key==="ENCODER"&&this.metadata.setFormat("tool",A.value),this.addTag(A.key,A.value))))}async parsePicture(t){return this.options.skipCovers?this.tokenizer.ignore(t):this.addPictureTag(await this.tokenizer.readToken(new bI(t)))}addPictureTag(t){return this.addTag("METADATA_BLOCK_PICTURE",t)}addTag(t,o){return this.vorbisParser.addTag(t,o)}}});var Aoe,toe=ue(()=>{Aoe={parserType:"flac",extensions:[".flac"],mimeTypes:["audio/flac"],async load(){return(await Promise.resolve().then(()=>(yU(),eoe))).FlacParser}}});var _e,mU=ue(()=>{_e={string:0,uint:1,uid:2,bool:3,binary:4,float:5}});var roe,ioe=ue(()=>{mU();roe={name:"dtd",container:{440786851:{name:"ebml",container:{17030:{name:"ebmlVersion",value:_e.uint},17143:{name:"ebmlReadVersion",value:_e.uint},17138:{name:"ebmlMaxIDWidth",value:_e.uint},17139:{name:"ebmlMaxSizeWidth",value:_e.uint},17026:{name:"docType",value:_e.string},17031:{name:"docTypeVersion",value:_e.uint},17029:{name:"docTypeReadVersion",value:_e.uint}}},408125543:{name:"segment",container:{290298740:{name:"seekHead",container:{19899:{name:"seek",multiple:!0,container:{21419:{name:"id",value:_e.binary},21420:{name:"position",value:_e.uint}}}}},357149030:{name:"info",container:{29604:{name:"uid",value:_e.uid},29572:{name:"filename",value:_e.string},3979555:{name:"prevUID",value:_e.uid},3965867:{name:"prevFilename",value:_e.string},4110627:{name:"nextUID",value:_e.uid},4096955:{name:"nextFilename",value:_e.string},2807729:{name:"timecodeScale",value:_e.uint},17545:{name:"duration",value:_e.float},17505:{name:"dateUTC",value:_e.uint},31657:{name:"title",value:_e.string},19840:{name:"muxingApp",value:_e.string},22337:{name:"writingApp",value:_e.string}}},524531317:{name:"cluster",multiple:!0,container:{231:{name:"timecode",value:_e.uid},22743:{name:"silentTracks ",multiple:!0},167:{name:"position",value:_e.uid},171:{name:"prevSize",value:_e.uid},160:{name:"blockGroup"},163:{name:"simpleBlock"}}},374648427:{name:"tracks",container:{174:{name:"entries",multiple:!0,container:{215:{name:"trackNumber",value:_e.uint},29637:{name:"uid",value:_e.uid},131:{name:"trackType",value:_e.uint},185:{name:"flagEnabled",value:_e.bool},136:{name:"flagDefault",value:_e.bool},21930:{name:"flagForced",value:_e.bool},156:{name:"flagLacing",value:_e.bool},28135:{name:"minCache",value:_e.uint},28136:{name:"maxCache",value:_e.uint},2352003:{name:"defaultDuration",value:_e.uint},2306383:{name:"timecodeScale",value:_e.float},21358:{name:"name",value:_e.string},2274716:{name:"language",value:_e.string},134:{name:"codecID",value:_e.string},25506:{name:"codecPrivate",value:_e.binary},2459272:{name:"codecName",value:_e.string},3839639:{name:"codecSettings",value:_e.string},3883072:{name:"codecInfoUrl",value:_e.string},2536e3:{name:"codecDownloadUrl",value:_e.string},170:{name:"codecDecodeAll",value:_e.bool},28587:{name:"trackOverlay",value:_e.uint},224:{name:"video",container:{154:{name:"flagInterlaced",value:_e.bool},21432:{name:"stereoMode",value:_e.uint},176:{name:"pixelWidth",value:_e.uint},186:{name:"pixelHeight",value:_e.uint},21680:{name:"displayWidth",value:_e.uint},21690:{name:"displayHeight",value:_e.uint},21683:{name:"aspectRatioType",value:_e.uint},3061028:{name:"colourSpace",value:_e.uint},3126563:{name:"gammaValue",value:_e.float}}},225:{name:"audio",container:{181:{name:"samplingFrequency",value:_e.float},30901:{name:"outputSamplingFrequency",value:_e.float},159:{name:"channels",value:_e.uint},148:{name:"channels",value:_e.uint},32123:{name:"channelPositions",value:_e.binary},25188:{name:"bitDepth",value:_e.uint}}},28032:{name:"contentEncodings",container:{25152:{name:"contentEncoding",container:{20529:{name:"order",value:_e.uint},20530:{name:"scope",value:_e.bool},20531:{name:"type",value:_e.uint},20532:{name:"contentEncoding",container:{16980:{name:"contentCompAlgo",value:_e.uint},16981:{name:"contentCompSettings",value:_e.binary}}},20533:{name:"contentEncoding",container:{18401:{name:"contentEncAlgo",value:_e.uint},18402:{name:"contentEncKeyID",value:_e.binary},18403:{name:"contentSignature ",value:_e.binary},18404:{name:"ContentSigKeyID ",value:_e.binary},18405:{name:"contentSigAlgo ",value:_e.uint},18406:{name:"contentSigHashAlgo ",value:_e.uint}}},25188:{name:"bitDepth",value:_e.uint}}}}}}}}},475249515:{name:"cues",container:{187:{name:"cuePoint",container:{179:{name:"cueTime",value:_e.uid},183:{name:"positions",container:{247:{name:"track",value:_e.uint},241:{name:"clusterPosition",value:_e.uint},21368:{name:"blockNumber",value:_e.uint},234:{name:"codecState",value:_e.uint},219:{name:"reference",container:{150:{name:"time",value:_e.uint},151:{name:"cluster",value:_e.uint},21343:{name:"number",value:_e.uint},235:{name:"codecState",value:_e.uint}}},240:{name:"relativePosition",value:_e.uint}}}}}}},423732329:{name:"attachments",container:{24999:{name:"attachedFiles",multiple:!0,container:{18046:{name:"description",value:_e.string},18030:{name:"name",value:_e.string},18016:{name:"mimeType",value:_e.string},18012:{name:"data",value:_e.binary},18094:{name:"uid",value:_e.uid}}}}},272869232:{name:"chapters",container:{17849:{name:"editionEntry",container:{182:{name:"chapterAtom",container:{29636:{name:"uid",value:_e.uid},145:{name:"timeStart",value:_e.uint},146:{name:"timeEnd",value:_e.uid},152:{name:"hidden",value:_e.bool},17816:{name:"enabled",value:_e.uid},143:{name:"track",container:{137:{name:"trackNumber",value:_e.uid},128:{name:"display",container:{133:{name:"string",value:_e.string},17276:{name:"language ",value:_e.string},17278:{name:"country ",value:_e.string}}}}}}}}}}},307544935:{name:"tags",container:{29555:{name:"tag",multiple:!0,container:{25536:{name:"target",container:{25541:{name:"tagTrackUID",value:_e.uid},25540:{name:"tagChapterUID",value:_e.uint},25542:{name:"tagAttachmentUID",value:_e.uid},25546:{name:"targetType",value:_e.string},26826:{name:"targetTypeValue",value:_e.uint},25545:{name:"tagEditionUID",value:_e.uid}}},26568:{name:"simpleTags",multiple:!0,container:{17827:{name:"name",value:_e.string},17543:{name:"string",value:_e.string},17541:{name:"binary",value:_e.binary},17530:{name:"language",value:_e.string},17531:{name:"languageIETF",value:_e.string},17540:{name:"default",value:_e.bool}}}}}}}}}}}});function SU(n,t){return Number(Dze(n,t))}function Dze(n,t){let o=new Uint8Array(8),a=n.subarray(0,t);try{return o.set(a,8-t),zs.get(o,0)}catch{return BigInt(-1)}}function ooe(n){return n.container&&Object.keys(n.container).map(t=>{let o=n.container[t];return o.id=Number.parseInt(t,10),o}).forEach(t=>{t.parent=n,ooe(t)}),n}function cp(n){let t="";return n.parent&&n.parent.name!=="dtd"&&(t+=`${cp(n.parent)}/`),t+n.name}var aoe,uE,ob,Ag,nb,noe=ue(()=>{DA();aoe=ze(lt(),1);an();mU();DA();or();uE=(0,aoe.default)("music-metadata:parser:ebml"),ob=class extends St("EBML"){},Ag={ReadNext:0,IgnoreElement:2,SkipSiblings:3,TerminateParsing:4,SkipElement:5},nb=class{constructor(t){this.parserMap=new Map,this.ebmlMaxIDLength=4,this.ebmlMaxSizeLength=8,this.tokenizer=t,this.parserMap.set(_e.uint,o=>this.readUint(o)),this.parserMap.set(_e.string,o=>this.readString(o)),this.parserMap.set(_e.binary,o=>this.readBuffer(o)),this.parserMap.set(_e.uid,async o=>this.readBuffer(o)),this.parserMap.set(_e.bool,o=>this.readFlag(o)),this.parserMap.set(_e.float,o=>this.readFloat(o))}async iterate(t,o,a){return this.parseContainer(ooe(t),o,a)}async parseContainer(t,o,a){let e={};for(;this.tokenizer.position=0?this.tokenizer.position+i.len:-1,a);r.multiple?(e[r.name]||(e[r.name]=[]),e[r.name].push(g)):e[r.name]=g,await a.elementValue(r,g,A)}else{let g=this.parserMap.get(r.value);if(typeof g=="function"){let c=await g(i);e[r.name]=c,await a.elementValue(r,c,A)}}break;case Ag.SkipElement:uE(`Go to next element: name=${cp(r)}, element.id=0x${i.id}, container=${!!r.container} at position=${A}`);break;case Ag.IgnoreElement:uE(`Ignore element: name=${cp(r)}, element.id=0x${i.id}, container=${!!r.container} at position=${A}`),await this.tokenizer.ignore(i.len);break;case Ag.SkipSiblings:uE(`Ignore remaining container, at: name=${cp(r)}, element.id=0x${i.id}, container=${!!r.container} at position=${A}`),await this.tokenizer.ignore(o-this.tokenizer.position);break;case Ag.TerminateParsing:return uE(`Terminate parsing at element: name=${cp(r)}, element.id=0x${i.id}, container=${!!r.container} at position=${A}`),e}else switch(i.id){case 236:await this.tokenizer.ignore(i.len);break;default:uE(`parseEbml: parent=${cp(t)}, unknown child: id=${i.id.toString(16)} at position=${A}`),await this.tokenizer.ignore(i.len)}}return e}async readVintData(t){let o=await this.tokenizer.peekNumber(QA),a=128,e=1;for(;(o&a)===0;){if(e>t)throw new ob("VINT value exceeding maximum size");++e,a>>=1}let i=new Uint8Array(e);return await this.tokenizer.readBuffer(i),i}async readElement(){let t=await this.readVintData(this.ebmlMaxIDLength),o=await this.readVintData(this.ebmlMaxSizeLength);return o[0]^=128>>o.length-1,{id:SU(t,t.length),len:SU(o,o.length)}}async readFloat(t){switch(t.len){case 0:return 0;case 4:return this.tokenizer.readNumber(k2);case 8:return this.tokenizer.readNumber(DO);case 10:return this.tokenizer.readNumber(DO);default:throw new ob(`Invalid IEEE-754 float length: ${t.len}`)}}async readFlag(t){return await this.readUint(t)===1}async readUint(t){let o=await this.readBuffer(t);return SU(o,t.len)}async readString(t){return(await this.tokenizer.readToken(new We(t.len,"utf-8"))).replace(/\x00.*$/g,"")}async readBuffer(t){let o=new Uint8Array(t.len);return await this.tokenizer.readBuffer(o),o}}});var goe={};Lr(goe,{MatroskaParser:()=>wU});var soe,sb,wU,coe=ue(()=>{soe=ze(lt(),1);$a();ioe();J2();noe();sb=(0,soe.default)("music-metadata:parser:matroska"),wU=class extends Gt{constructor(){super(...arguments),this.seekHeadOffset=0,this.flagUseIndexToSkipClusters=this.options.mkvUseIndex??!1}async parse(){let t=this.tokenizer.fileInfo.size??Number.MAX_SAFE_INTEGER,o=new nb(this.tokenizer);sb("Initializing DTD end MatroskaIterator"),await o.iterate(roe,t,{startNext:a=>{switch(a.id){case 475249515:return sb(`Skip element: name=${a.name}, id=0x${a.id.toString(16)}`),Ag.IgnoreElement;case 524531317:if(this.flagUseIndexToSkipClusters&&this.seekHead){let e=this.seekHead.seek.find(i=>i.position+this.seekHeadOffset>this.tokenizer.position);if(e){let i=e.position+this.seekHeadOffset-this.tokenizer.position;return sb(`Use index to go to next position, ignoring ${i} bytes`),this.tokenizer.ignore(i),Ag.SkipElement}}return Ag.IgnoreElement;default:return Ag.ReadNext}},elementValue:async(a,e,i)=>{switch(sb(`Received: name=${a.name}, value=${e}`),a.id){case 17026:this.metadata.setFormat("container",`EBML/${e}`);break;case 290298740:this.seekHead=e,this.seekHeadOffset=i;break;case 357149030:{let A=e,r=A.timecodeScale?A.timecodeScale:1e6;if(typeof A.duration=="number"){let s=A.duration*r/1e9;await this.addTag("segment:title",A.title),this.metadata.setFormat("duration",Number(s))}}break;case 374648427:{let A=e;if(A?.entries){A.entries.forEach(s=>{let g={codecName:s.codecID.replace("A_","").replace("V_",""),codecSettings:s.codecSettings,flagDefault:s.flagDefault,flagLacing:s.flagLacing,flagEnabled:s.flagEnabled,language:s.language,name:s.name,type:s.trackType,audio:s.audio,video:s.video};this.metadata.addStreamInfo(g)});let r=A.entries.filter(s=>s.trackType===fi.audio).reduce((s,g)=>!s||g.flagDefault&&!s.flagDefault||g.trackNumber{let s=r.target,g=s?.targetTypeValue?Bie[s.targetTypeValue]:s?.targetType?s.targetType:"track";await Promise.all(r.simpleTags.map(async c=>{let I=c.string?c.string:c.binary;await this.addTag(`${g}:${c.name}`,I)}))}))}break;case 423732329:{let A=e;await Promise.all(A.attachedFiles.filter(r=>r.mimeType.startsWith("image/")).map(r=>this.addTag("picture",{data:r.data,format:r.mimeType,description:r.description,name:r.name})))}break}}})}async addTag(t,o){await this.metadata.addTag("matroska",t,o)}}});var Ioe,loe=ue(()=>{Ioe={parserType:"matroska",extensions:[".mka",".mkv",".mk3d",".mks","webm"],mimeTypes:["audio/matroska","video/matroska","audio/webm","video/webm"],async load(){return(await Promise.resolve().then(()=>(coe(),goe))).MatroskaParser}}});function uoe(n,t,o,a,e){if(OU(`remainingLen=${a}, numberOfEntries=${e} * token-len=${t.len}`),a===0)return[];if(a!==e*t.len)throw new ac("mismatch number-of-entries with remaining atom-length");let i=[];for(let A=0;A{DA();doe=ze(lt(),1);ma();or();nr();or();OU=(0,doe.default)("music-metadata:parser:MP4:atom"),ac=class extends St("MP4"){},Ip={len:8,get:(n,t)=>{let o=xe.get(n,t);if(o<0)throw new ac("Invalid atom header length");return{length:BigInt(o),name:new We(4,"latin1").get(n,t+4)}},put:(n,t,o)=>(xe.put(n,t,Number(o.length)),at.put(n,t+4,o.name))},hoe=zs,bU={len:4,get:(n,t)=>({type:new We(4,"ascii").get(n,t)})},gb=class{constructor(t,o,a){if(to&&OU(`Warning: atom ${a} expected to be ${o}, but was actually ${t} bytes long.`),this.len=t}},CE={len:4,get:(n,t)=>{let o=xe.get(n,t)-2082844800;return new Date(o*1e3)}},BE={len:8,get:(n,t)=>{let o=Number(zs.get(n,t))-2082844800;return new Date(o*1e3)}},cb=class extends gb{constructor(t){super(t,24,"mdhd")}get(t,o){let a=QA.get(t,o+0),e=Gr.get(t,o+1);switch(a){case 0:return{version:a,flags:e,creationTime:CE.get(t,o+4),modificationTime:CE.get(t,o+8),timeScale:xe.get(t,o+12),duration:xe.get(t,o+16),language:LA.get(t,o+20),quality:LA.get(t,o+22)};case 1:return{version:a,flags:e,creationTime:BE.get(t,o+4),modificationTime:BE.get(t,o+12),timeScale:xe.get(t,o+20),duration:Number(zs.get(t,o+24)),language:LA.get(t,o+32),quality:LA.get(t,o+34)};default:throw new sn("Invalid mdhd version header")}}},Ib=class extends gb{constructor(t){super(t,100,"mvhd")}get(t,o){let a=QA.get(t,o),e=Gr.get(t,o+1);return a===1?{version:a,flags:e,creationTime:BE.get(t,o+4),modificationTime:BE.get(t,o+12),timeScale:xe.get(t,o+20),duration:Number(zs.get(t,o+24)),preferredRate:xe.get(t,o+32),preferredVolume:LA.get(t,o+36),previewTime:xe.get(t,o+84),previewDuration:xe.get(t,o+88),posterTime:xe.get(t,o+92),selectionTime:xe.get(t,o+96),selectionDuration:xe.get(t,o+100),currentTime:xe.get(t,o+104),nextTrackID:xe.get(t,o+108)}:{version:a,flags:e,creationTime:CE.get(t,o+4),modificationTime:CE.get(t,o+8),timeScale:xe.get(t,o+12),duration:xe.get(t,o+16),preferredRate:xe.get(t,o+20),preferredVolume:LA.get(t,o+24),previewTime:xe.get(t,o+72),previewDuration:xe.get(t,o+76),posterTime:xe.get(t,o+80),selectionTime:xe.get(t,o+84),selectionDuration:xe.get(t,o+88),currentTime:xe.get(t,o+92),nextTrackID:xe.get(t,o+96)}}},lb=class{constructor(t){this.len=t}get(t,o){return{type:{set:QA.get(t,o+0),type:Gr.get(t,o+1)},locale:Gr.get(t,o+4),value:new Mt(this.len-8).get(t,o+8)}}},pb=class{constructor(t){this.len=t}get(t,o){return{version:QA.get(t,o),flags:Gr.get(t,o+1),name:new We(this.len-4,"utf-8").get(t,o+4)}}},db=class{constructor(t){this.len=t}get(t,o){let a=QA.get(t,o),e=Gr.get(t,o+1);switch(a){case 0:return{version:a,flags:e,creationTime:CE.get(t,o+4),modificationTime:CE.get(t,o+8),trackId:xe.get(t,o+12),duration:xe.get(t,o+20),layer:LA.get(t,o+32),alternateGroup:LA.get(t,o+34),volume:LA.get(t,o+36)};case 1:return{version:a,flags:e,creationTime:BE.get(t,o+4),modificationTime:BE.get(t,o+12),trackId:xe.get(t,o+20),duration:Number(zs.get(t,o+28)),layer:LA.get(t,o+44),alternateGroup:LA.get(t,o+46),volume:LA.get(t,o+48)};default:throw new sn("Invalid tkhd version header")}}},poe={len:8,get:(n,t)=>({version:QA.get(n,t),flags:Gr.get(n,t+1),numberOfEntries:xe.get(n,t+4)})},DU=class{constructor(t){this.len=t}get(t,o){let a=this.len-12;return{dataFormat:at.get(t,o),dataReferenceIndex:LA.get(t,o+10),description:a>0?new Mt(a).get(t,o+12):void 0}}},Gf=class{constructor(t){this.len=t}get(t,o){let a=poe.get(t,o);o+=poe.len;let e=[];for(let i=0;i=this.len){OU("TrackRunBox size mismatch");break}let r={};e.flags.sampleDurationPresent&&(r.sampleDuration=xe.get(t,i),i+=4),e.flags.sampleSizePresent&&(r.sampleSize=xe.get(t,i),i+=4),e.flags.sampleFlagsPresent&&(r.sampleFlags=xe.get(t,i),i+=4),e.flags.sampleCompositionTimeOffsetsPresent&&(r.sampleCompositionTimeOffset=xe.get(t,i),i+=4),e.samples.push(r)}return e}},Qb=class{constructor(t){this.len=t}get(t,o){let a=o+1,e=new We(4,"utf-8");return{version:qs.get(t,o),flags:Gr.get(t,o+1),componentType:e.get(t,o+4),handlerType:e.get(t,o+8),componentName:new We(this.len-28,"utf-8").get(t,o+28)}}},yb=class{constructor(t){this.len=t}get(t,o){let a=0,e=[];for(;a{foe=ze(lt(),1);Uf();Uf();Boe=(0,foe.default)("music-metadata:parser:MP4:Atom"),mb=class n{static async readAtom(t,o,a,e){let i=t.position;Boe(`Reading next token on offset=${i}...`);let A=await t.readToken(Ip),r=A.length===1n;r&&(A.length=await t.readToken(hoe));let s=new n(A,r,a),g=s.getPayloadLength(e);return Boe(`parse atom name=${s.atomPath}, extended=${s.extended}, offset=${i}, len=${s.header.length}`),await s.readData(t,o,g),s}constructor(t,o,a){this.header=t,this.extended=o,this.parent=a,this.children=[],this.atomPath=(this.parent?`${this.parent.atomPath}.`:"")+this.header.name}getHeaderLength(){return this.extended?16:8}getPayloadLength(t){return(this.header.length===0n?t:Number(this.header.length))-this.getHeaderLength()}async readAtoms(t,o,a){for(;a>0;){let e=await n.readAtom(t,o,this,a);this.children.push(e),a-=e.header.length===0n?a:Number(e.header.length)}}async readData(t,o,a){switch(this.header.name){case"moov":case"udta":case"mdia":case"minf":case"stbl":case"":case"ilst":case"tref":case"moof":return this.readAtoms(t,o,this.getPayloadLength(a));case"meta":{let i=(await t.peekToken(Ip)).name==="hdlr"?0:4;return await t.ignore(i),this.readAtoms(t,o,this.getPayloadLength(a)-i)}default:return o(this,a)}}}});var woe={};Lr(woe,{MP4Parser:()=>_U});function moe(n,t,o){return o.indexOf(n)===t}var Soe,Ao,Mze,yoe,_U,Doe=ue(()=>{Soe=ze(lt(),1);DA();$a();Sf();Qoe();Uf();Uf();tp();uf();js();Ao=(0,Soe.default)("music-metadata:parser:MP4"),Mze="iTunes",yoe={raw:{lossy:!1,format:"raw"},MAC3:{lossy:!0,format:"MACE 3:1"},MAC6:{lossy:!0,format:"MACE 6:1"},ima4:{lossy:!0,format:"IMA 4:1"},ulaw:{lossy:!0,format:"uLaw 2:1"},alaw:{lossy:!0,format:"uLaw 2:1"},Qclp:{lossy:!0,format:"QUALCOMM PureVoice"},".mp3":{lossy:!0,format:"MPEG-1 layer 3"},alac:{lossy:!1,format:"ALAC"},"ac-3":{lossy:!0,format:"AC-3"},mp4a:{lossy:!0,format:"MPEG-4/AAC"},mp4s:{lossy:!0,format:"MP4S"},c608:{lossy:!0,format:"CEA-608"},c708:{lossy:!0,format:"CEA-708"}};_U=class n extends Gt{constructor(){super(...arguments),this.tracks=new Map,this.hasVideoTrack=!1,this.hasAudioTrack=!0,this.atomParsers={mvhd:async t=>{let o=await this.tokenizer.readToken(new Ib(t));this.metadata.setFormat("creationTime",o.creationTime),this.metadata.setFormat("modificationTime",o.modificationTime)},chap:async t=>{let o=this.getTrackDescription(),a=[];for(;t>=xe.len;)a.push(await this.tokenizer.readNumber(xe)),t-=xe.len;o.chapterList=a},mdat:async t=>{if(this.options.includeChapters){let o=[...this.tracks.values()].filter(a=>a.chapterList);if(o.length===1){let a=o[0].chapterList,e=[...this.tracks.values()].filter(i=>a.indexOf(i.header.trackId)!==-1);if(e.length===1)return this.parseChapterTrack(e[0],o[0],t)}}await this.tokenizer.ignore(t)},ftyp:async t=>{let o=[];for(;t>0;){let e=await this.tokenizer.readToken(bU);t-=bU.len;let i=e.type.replace(/\W/g,"");i.length>0&&o.push(i)}Ao(`ftyp: ${o.join("/")}`);let a=o.filter(moe).join("/");this.metadata.setFormat("container",a)},stsd:async t=>{let o=await this.tokenizer.readToken(new Gf(t)),a=this.getTrackDescription();a.soundSampleDescription=o.table.map(e=>this.parseSoundSampleDescription(e))},stsz:async t=>{let o=await this.tokenizer.readToken(new Lf(t)),a=this.getTrackDescription();a.sampleSize=o.sampleSize,a.sampleSizeTable=o.entries},date:async t=>{let o=await this.tokenizer.readToken(new We(t,"utf-8"));await this.addTag("date",o)}}}static read_BE_Integer(t,o){let a=(o?"INT":"UINT")+t.length*8+(t.length>1?"_BE":""),e=VA[a];if(!e)throw new ac(`Token for integer type not found: "${a}"`);return Number(e.get(t,0))}async parse(){this.hasVideoTrack=!1,this.hasAudioTrack=!0,this.tracks.clear();let t=this.tokenizer.fileInfo.size||0;for(;!this.tokenizer.fileInfo.size||t>0;){try{if((await this.tokenizer.peekToken(Ip)).name==="\0\0\0\0"){let A=`Error at offset=${this.tokenizer.position}: box.id=0`;Ao(A),this.addWarning(A);break}}catch(i){if(i instanceof Error){let A=`Error at offset=${this.tokenizer.position}: ${i.message}`;Ao(A),this.addWarning(A)}else throw i;break}let e=await mb.readAtom(this.tokenizer,(i,A)=>this.handleAtom(i,A),null,t);t-=e.header.length===BigInt(0)?t:Number(e.header.length)}let o=[];this.tracks.forEach(e=>{let i=[];e.soundSampleDescription.forEach(A=>{let r={},s=yoe[A.dataFormat];if(s?(i.push(s.format),r.codecName=s.format):r.codecName=`<${A.dataFormat}>`,A.description){let{description:g}=A;g.sampleRate>0&&(r.type=fi.audio,r.audio={samplingFrequency:g.sampleRate,bitDepth:g.sampleSize,channels:g.numAudioChannels})}this.metadata.addStreamInfo(r)}),i.length>=1&&o.push(i.join("/"))}),o.length>0&&this.metadata.setFormat("codec",o.filter(moe).join("+"));let a=[...this.tracks.values()].filter(e=>e.soundSampleDescription.length>=1&&e.soundSampleDescription[0].description&&e.soundSampleDescription[0].description.numAudioChannels>0);for(let e of a){if(e.media.header&&e.media.header.timeScale>0)if(e.sampleRate=e.media.header.timeScale,e.media.header.duration>0&&(Ao("Using duration defined on audio track"),e.samples=e.media.header.duration,e.duration=e.samples/e.sampleRate),e.fragments.length>0){Ao("Calculate duration defined in track fragments");let r=0;e.sizeInBytes=0;for(let s of e.fragments)for(let g of s.trackRun.samples){let c=g.sampleDuration??s.header.defaultSampleDuration??0,I=g.sampleSize??s.header.defaultSampleSize??0;if(c===0)throw new Error("Missing sampleDuration and no defaultSampleDuration in track fragment header");if(I===0)throw new Error("Missing sampleSize and no defaultSampleSize in track fragment header");r+=c,e.sizeInBytes+=I}e.samples||(e.samples=r),e.duration||(e.duration=r/e.sampleRate)}else e.sampleSizeTable.length>0&&(e.sizeInBytes=e.sampleSizeTable.reduce((r,s)=>r+s,0));let i=e.soundSampleDescription[0];if(i.description&&e.media.header&&(this.metadata.setFormat("sampleRate",i.description.sampleRate),this.metadata.setFormat("bitsPerSample",i.description.sampleSize),this.metadata.setFormat("numberOfChannels",i.description.numAudioChannels),e.media.header.timeScale===0&&e.timeToSampleTable.length>0)){let r=e.timeToSampleTable.map(s=>s.count*s.duration).reduce((s,g)=>s+g);e.duration=r/i.description.sampleRate}let A=yoe[i.dataFormat];A&&this.metadata.setFormat("lossless",!A.lossy)}if(a.length>=1){let e=a[0];e.duration&&(this.metadata.setFormat("duration",e.duration),e.sizeInBytes&&this.metadata.setFormat("bitrate",8*e.sizeInBytes/e.duration))}this.metadata.setFormat("hasAudio",this.hasAudioTrack),this.metadata.setFormat("hasVideo",this.hasVideoTrack)}async handleAtom(t,o){if(t.parent)switch(t.parent.header.name){case"ilst":case"":return this.parseMetadataItemData(t);case"moov":switch(t.header.name){case"trak":return this.parseTrackBox(t);case"udta":return this.parseTrackBox(t)}break;case"moof":switch(t.header.name){case"traf":return this.parseTrackFragmentBox(t)}}if(this.atomParsers[t.header.name])return this.atomParsers[t.header.name](o);Ao(`No parser for atom path=${t.atomPath}, payload-len=${o}, ignoring atom`),await this.tokenizer.ignore(o)}getTrackDescription(){let t=[...this.tracks.values()];return t[t.length-1]}async addTag(t,o){await this.metadata.addTag(Mze,t,o)}addWarning(t){Ao(`Warning: ${t}`),this.metadata.addWarning(t)}parseMetadataItemData(t){let o=t.header.name;return t.readAtoms(this.tokenizer,async(a,e)=>{let i=a.getPayloadLength(e);switch(a.header.name){case"data":return this.parseValueAtom(o,a);case"name":case"mean":case"rate":{let A=await this.tokenizer.readToken(new pb(i));o+=`:${A.name}`;break}default:{let A=await this.tokenizer.readToken(new Mt(i));this.addWarning(`Unsupported meta-item: ${o}[${a.header.name}] => value=${bO(A)} ascii=${Tr(A,"ascii")}`)}}},t.getPayloadLength(0))}async parseValueAtom(t,o){let a=await this.tokenizer.readToken(new lb(Number(o.header.length)-Ip.len));if(a.type.set!==0)throw new ac(`Unsupported type-set != 0: ${a.type.set}`);switch(a.type.type){case 0:switch(t){case"trkn":case"disk":{let e=QA.get(a.value,3),i=QA.get(a.value,5);await this.addTag(t,`${e}/${i}`);break}case"gnre":{let e=QA.get(a.value,1),i=aE[e-1];await this.addTag(t,i);break}case"rate":{let e=Tr(a.value,"ascii");await this.addTag(t,e);break}default:Ao(`unknown proprietary value type for: ${o.atomPath}`)}break;case 1:case 18:await this.addTag(t,Tr(a.value));break;case 13:if(this.options.skipCovers)break;await this.addTag(t,{format:"image/jpeg",data:Uint8Array.from(a.value)});break;case 14:if(this.options.skipCovers)break;await this.addTag(t,{format:"image/png",data:Uint8Array.from(a.value)});break;case 21:await this.addTag(t,n.read_BE_Integer(a.value,!0));break;case 22:await this.addTag(t,n.read_BE_Integer(a.value,!1));break;case 65:await this.addTag(t,QA.get(a.value,0));break;case 66:await this.addTag(t,LA.get(a.value,0));break;case 67:await this.addTag(t,xe.get(a.value,0));break;default:this.addWarning(`atom key=${t}, has unknown well-known-type (data-type): ${a.type.type}`)}}async parseTrackBox(t){let o={media:{},fragments:[]};await t.readAtoms(this.tokenizer,async(a,e)=>{let i=a.getPayloadLength(e);switch(a.header.name){case"chap":{let A=await this.tokenizer.readToken(new yb(e));o.chapterList=A;break}case"tkhd":o.header=await this.tokenizer.readToken(new db(i));break;case"hdlr":o.handler=await this.tokenizer.readToken(new Qb(i)),o.isAudio=()=>o.handler.handlerType==="audi"||o.handler.handlerType==="soun",o.isVideo=()=>o.handler.handlerType==="vide",o.isAudio()?this.hasAudioTrack=!0:o.isVideo()&&(this.hasVideoTrack=!0);break;case"mdhd":{let A=await this.tokenizer.readToken(new cb(i));o.media.header=A;break}case"stco":{let A=await this.tokenizer.readToken(new ub(i));o.chunkOffsetTable=A.entries;break}case"stsc":{let A=await this.tokenizer.readToken(new Eb(i));o.sampleToChunkTable=A.entries;break}case"stsd":{let A=await this.tokenizer.readToken(new Gf(i));o.soundSampleDescription=A.table.map(r=>this.parseSoundSampleDescription(r));break}case"stts":{let A=await this.tokenizer.readToken(new hb(i));o.timeToSampleTable=A.entries;break}case"stsz":{let A=await this.tokenizer.readToken(new Lf(i));o.sampleSize=A.sampleSize,o.sampleSizeTable=A.entries;break}case"dinf":case"vmhd":case"smhd":Ao(`Ignoring: ${a.header.name}`),await this.tokenizer.ignore(i);break;default:Ao(`Unexpected track box: ${a.header.name}`),await this.tokenizer.ignore(i)}},t.getPayloadLength(0)),this.tracks.set(o.header.trackId,o)}parseTrackFragmentBox(t){let o;return t.readAtoms(this.tokenizer,async(a,e)=>{let i=a.getPayloadLength(e);switch(a.header.name){case"tfhd":{let A=new Bb(a.getPayloadLength(e));o=await this.tokenizer.readToken(A);break}case"tfdt":await this.tokenizer.ignore(i);break;case"trun":{let A=new fb(i),r=await this.tokenizer.readToken(A);o&&this.tracks.get(o.trackId)?.fragments.push({header:o,trackRun:r});break}default:Ao(`Unexpected box: ${a.header.name}`),await this.tokenizer.ignore(i)}},t.getPayloadLength(0))}parseSoundSampleDescription(t){let o={dataFormat:t.dataFormat,dataReferenceIndex:t.dataReferenceIndex},a=0;if(t.description){let e=MU.get(t.description,a);a+=MU.len,e.version===0||e.version===1?o.description=Eoe.get(t.description,a):Ao(`Warning: sound-sample-description ${e} not implemented`)}return o}async parseChapterTrack(t,o,a){if(!t.sampleSize&&t.chunkOffsetTable.length!==t.sampleSizeTable.length)throw new Error("Expected equal chunk-offset-table & sample-size-table length.");let e=[];for(let i=0;i0;++i){let A=t.timeToSampleTable.slice(0,i).reduce((p,B)=>p+B.duration,0),s=t.chunkOffsetTable[i]-this.tokenizer.position,g=t.sampleSize>0?t.sampleSize:t.sampleSizeTable[i];if(a-=s+g,a<0)throw new ac("Chapter chunk exceeding token length");await this.tokenizer.ignore(s);let c=await this.tokenizer.readToken(new Cb(g));Ao(`Chapter ${i+1}: ${c}`);let I={title:c,timeScale:t.media.header?t.media.header.timeScale:0,start:A,sampleOffset:this.findSampleOffset(o,this.tokenizer.position)};Ao(`Chapter title=${I.title}, offset=${I.sampleOffset}/${o.header.duration}`),e.push(I)}this.metadata.setFormat("chapters",e),await this.tokenizer.ignore(a)}findSampleOffset(t,o){let a=0;for(;a=o[a].firstChunk&&t{Ooe={parserType:"mp4",extensions:[".mp4",".m4a",".m4b",".m4pa","m4v","m4r","3gp",".mov",".movie",".qt"],mimeTypes:["audio/mp4","audio/m4a","video/m4v","video/mp4","video/quicktime"],async load(){return(await Promise.resolve().then(()=>(Doe(),woe))).MP4Parser}}});var Noe,Moe,_ze,_oe,Toe,Sb,Roe=ue(()=>{DA();Noe=ze(lt(),1);nr();Moe=(0,Noe.default)("music-metadata:parser:musepack:sv8"),_ze=new We(2,"latin1"),_oe={len:5,get:(n,t)=>({crc:Le.get(n,t),streamVersion:QA.get(n,t+4)})},Toe={len:2,get:(n,t)=>({sampleFrequency:[44100,48e3,37800,32e3][XA(n,t,0,3)],maxUsedBands:XA(n,t,3,5),channelCount:XA(n,t+1,0,4)+1,msUsed:Li(n,t+1,4),audioBlockFrames:XA(n,t+1,5,3)})},Sb=class{get tokenizer(){return this._tokenizer}set tokenizer(t){this._tokenizer=t}constructor(t){this._tokenizer=t}async readPacketHeader(){let t=await this.tokenizer.readToken(_ze),o=await this.readVariableSizeField();return{key:t,payloadLength:o.value-2-o.len}}async readStreamHeader(t){let o={};Moe(`Reading SH at offset=${this.tokenizer.position}`);let a=await this.tokenizer.readToken(_oe);t-=_oe.len,Object.assign(o,a),Moe(`SH.streamVersion = ${a.streamVersion}`);let e=await this.readVariableSizeField();t-=e.len,o.sampleCount=e.value;let i=await this.readVariableSizeField();t-=i.len,o.beginningOfSilence=i.value;let A=await this.tokenizer.readToken(Toe);return t-=Toe.len,Object.assign(o,A),await this.tokenizer.ignore(t),o}async readVariableSizeField(t=1,o=0){let a=await this.tokenizer.readNumber(QA);return(a&128)===0?{len:t,value:o+a}:(a&=127,a+=o,this.readVariableSizeField(t+1,a<<7))}}});var oc,wb=ue(()=>{or();oc=class extends St("Musepack"){}});var koe,Nze,Db,voe=ue(()=>{koe=ze(lt(),1);$a();ap();ma();Roe();wb();Nze=(0,koe.default)("music-metadata:parser:musepack"),Db=class extends Gt{constructor(){super(...arguments),this.audioLength=0}async parse(){if(await this.tokenizer.readToken(at)!=="MPCK")throw new oc("Invalid Magic number");return this.metadata.setFormat("container","Musepack, SV8"),this.parsePacket()}async parsePacket(){let t=new Sb(this.tokenizer);do{let o=await t.readPacketHeader();switch(Nze(`packet-header key=${o.key}, payloadLength=${o.payloadLength}`),o.key){case"SH":{let a=await t.readStreamHeader(o.payloadLength);this.metadata.setFormat("numberOfSamples",a.sampleCount),this.metadata.setFormat("sampleRate",a.sampleFrequency),this.metadata.setFormat("duration",a.sampleCount/a.sampleFrequency),this.metadata.setFormat("numberOfChannels",a.channelCount);break}case"AP":this.audioLength+=o.payloadLength,await this.tokenizer.ignore(o.payloadLength);break;case"RG":case"EI":case"SO":case"ST":case"CT":await this.tokenizer.ignore(o.payloadLength);break;case"SE":return this.metadata.format.duration&&this.metadata.setFormat("bitrate",this.audioLength*8/this.metadata.format.duration),ip(this.metadata,this.tokenizer,this.options);default:throw new oc(`Unexpected header: ${o.key}`)}}while(!0)}}});var Ob,Poe=ue(()=>{DA();Ob=class{constructor(t){this.pos=0,this.dword=null,this.tokenizer=t}async read(t){for(;this.dword===null;)this.dword=await this.tokenizer.readToken(Le);let o=this.dword;return this.pos+=t,this.pos<32?(o>>>=32-this.pos,o&(1<>>32-this.pos),o&(1<0){let e=32-this.pos;this.dword=null,t-=e,this.pos=0}let o=t%32,a=(t-o)/32;return await this.tokenizer.ignore(a*4),this.read(o)}}});var Goe,Foe=ue(()=>{DA();nr();js();Goe={len:24,get:(n,t)=>{let o={signature:Tr(n.subarray(t,t+3),"latin1"),streamMinorVersion:XA(n,t+3,0,4),streamMajorVersion:XA(n,t+3,4,4),frameCount:Le.get(n,t+4),maxLevel:SA.get(n,t+8),sampleFrequency:[44100,48e3,37800,32e3][XA(n,t+10,0,2)],link:XA(n,t+10,2,2),profile:XA(n,t+10,4,4),maxBand:XA(n,t+11,0,6),intensityStereo:Li(n,t+11,6),midSideStereo:Li(n,t+11,7),titlePeak:SA.get(n,t+12),titleGain:SA.get(n,t+14),albumPeak:SA.get(n,t+16),albumGain:SA.get(n,t+18),lastFrameLength:Le.get(n,t+20)>>>20&2047,trueGapless:Li(n,t+23,0)};return o.lastFrameLength=o.trueGapless?Le.get(n,20)>>>20&2047:0,o}}});var Uoe,Loe,bb,Hoe=ue(()=>{Uoe=ze(lt(),1);$a();ap();Poe();Foe();wb();Loe=(0,Uoe.default)("music-metadata:parser:musepack"),bb=class extends Gt{constructor(){super(...arguments),this.bitreader=null,this.audioLength=0,this.duration=null}async parse(){let t=await this.tokenizer.readToken(Goe);if(t.signature!=="MP+")throw new oc("Unexpected magic number");Loe(`stream-version=${t.streamMajorVersion}.${t.streamMinorVersion}`),this.metadata.setFormat("container","Musepack, SV7"),this.metadata.setFormat("sampleRate",t.sampleFrequency);let o=1152*(t.frameCount-1)+t.lastFrameLength;this.metadata.setFormat("numberOfSamples",o),this.duration=o/t.sampleFrequency,this.metadata.setFormat("duration",this.duration),this.bitreader=new Ob(this.tokenizer),this.metadata.setFormat("numberOfChannels",t.midSideStereo||t.intensityStereo?2:1);let a=await this.bitreader.read(8);return this.metadata.setFormat("codec",(a/100).toFixed(2)),await this.skipAudioData(t.frameCount),Loe(`End of audio stream, switching to APEv2, offset=${this.tokenizer.position}`),ip(this.metadata,this.tokenizer,this.options)}async skipAudioData(t){for(;t-- >0;){let a=await this.bitreader.read(20);this.audioLength+=20+a,await this.bitreader.ignore(a)}let o=await this.bitreader.read(11);this.audioLength+=o,this.duration!==null&&this.metadata.setFormat("bitrate",this.audioLength/this.duration)}}});var Yoe={};Lr(Yoe,{MusepackParser:()=>TU});var xoe,Koe,TU,joe=ue(()=>{xoe=ze(lt(),1);DA();Of();voe();Hoe();wb();Koe=(0,xoe.default)("music-metadata:parser:musepack"),TU=class extends $s{async postId3v2Parse(){let t=await this.tokenizer.peekToken(new We(3,"latin1")),o;switch(t){case"MP+":{Koe("Stream-version 7"),o=new bb(this.metadata,this.tokenizer,this.options);break}case"MPC":{Koe("Stream-version 8"),o=new Db(this.metadata,this.tokenizer,this.options);break}default:throw new oc("Invalid signature prefix")}return this.metadata.setAudioOnly(),o.parse()}}});var Joe,qoe=ue(()=>{Joe={parserType:"musepack",extensions:[".mpc"],mimeTypes:["audio/musepack"],async load(){return(await Promise.resolve().then(()=>(joe(),Yoe))).MusepackParser}}});var Hf,Mb,NU=ue(()=>{DA();or();Hf=class extends St("Opus"){},Mb=class{constructor(t){if(t<19)throw new Hf("ID-header-page 0 should be at least 19 bytes long");this.len=t}get(t,o){return{magicSignature:new We(8,"ascii").get(t,o+0),version:QA.get(t,o+8),channelCount:QA.get(t,o+9),preSkip:SA.get(t,o+10),inputSampleRate:Le.get(t,o+12),outputGain:SA.get(t,o+16),channelMapping:QA.get(t,o+18)}}}});var _b,zoe=ue(()=>{DA();Rf();NU();NU();_b=class extends eg{constructor(t,o,a){super(t,o),this.idHeader=null,this.lastPos=-1,this.tokenizer=a,this.durationOnLastPage=!0}parseFirstPage(t,o){if(this.metadata.setFormat("codec","Opus"),this.idHeader=new Mb(o.length).get(o,0),this.idHeader.magicSignature!=="OpusHead")throw new Hf("Illegal ogg/Opus magic-signature");this.metadata.setFormat("sampleRate",this.idHeader.inputSampleRate),this.metadata.setFormat("numberOfChannels",this.idHeader.channelCount),this.metadata.setAudioOnly()}async parseFullPage(t){switch(new We(8,"ascii").get(t,0)){case"OpusTags":await this.parseUserCommentList(t,8),this.lastPos=this.tokenizer.position-t.length;break;default:break}}calculateDuration(t){if(this.lastPageHeader&&(t||this.lastPageHeader.headerType.lastPage)&&this.metadata.format.sampleRate&&this.lastPageHeader.absoluteGranulePosition>=0){let o=this.lastPageHeader.absoluteGranulePosition-this.idHeader.preSkip;if(this.metadata.setFormat("numberOfSamples",o),this.metadata.setFormat("duration",o/48e3),this.lastPos!==-1&&this.tokenizer.fileInfo.size&&this.metadata.format.duration){let a=this.tokenizer.fileInfo.size-this.lastPos;this.metadata.setFormat("bitrate",8*a/this.metadata.format.duration)}}}}});var Voe,Woe=ue(()=>{DA();nr();Voe={len:80,get:(n,t)=>({speex:new We(8,"ascii").get(n,t+0),version:NO(new We(20,"ascii").get(n,t+8)),version_id:ur.get(n,t+28),header_size:ur.get(n,t+32),rate:ur.get(n,t+36),mode:ur.get(n,t+40),mode_bitstream_version:ur.get(n,t+44),nb_channels:ur.get(n,t+48),bitrate:ur.get(n,t+52),frame_size:ur.get(n,t+56),vbr:ur.get(n,t+60),frames_per_packet:ur.get(n,t+64),extra_headers:ur.get(n,t+68),reserved1:ur.get(n,t+72),reserved2:ur.get(n,t+76)})}});var Zoe,Pze,Tb,Xoe=ue(()=>{Zoe=ze(lt(),1);Rf();Woe();Pze=(0,Zoe.default)("music-metadata:parser:ogg:speex"),Tb=class extends eg{constructor(t,o,a){super(t,o)}parseFirstPage(t,o){Pze("First Ogg/Speex page");let a=Voe.get(o,0);this.metadata.setFormat("codec",`Speex ${a.version}`),this.metadata.setFormat("numberOfChannels",a.nb_channels),this.metadata.setFormat("sampleRate",a.rate),a.bitrate!==-1&&this.metadata.setFormat("bitrate",a.bitrate),this.metadata.setAudioOnly()}}});var $oe,ene=ue(()=>{DA();$oe={len:42,get:(n,t)=>({id:new We(7,"ascii").get(n,t),vmaj:QA.get(n,t+7),vmin:QA.get(n,t+8),vrev:QA.get(n,t+9),vmbw:LA.get(n,t+10),vmbh:LA.get(n,t+17),nombr:Gr.get(n,t+37),nqual:QA.get(n,t+40)})}});var tne,Ane,Nb,rne=ue(()=>{tne=ze(lt(),1);ene();Ane=(0,tne.default)("music-metadata:parser:ogg:theora"),Nb=class{constructor(t,o,a){this.durationOnLastPage=!1,this.metadata=t}async parsePage(t,o){t.headerType.firstPage&&await this.parseFirstPage(t,o)}calculateDuration(){Ane("duration calculation not implemented")}async parseFirstPage(t,o){Ane("First Ogg/Theora page"),this.metadata.setFormat("codec","Theora");let a=$oe.get(o,0);this.metadata.setFormat("bitrate",a.nombr),this.metadata.setFormat("hasVideo",!0)}flush(){return Promise.resolve()}}});var ine,Rb,ane=ue(()=>{DA();nr();DA();ine={len:27,get:(n,t)=>({capturePattern:new We(4,"latin1").get(n,t),version:QA.get(n,t+4),headerType:{continued:GA(n,t+5,0),firstPage:GA(n,t+5,1),lastPage:GA(n,t+5,2)},absoluteGranulePosition:Number(Fr.get(n,t+6)),streamSerialNumber:Le.get(n,t+14),pageSequenceNo:Le.get(n,t+18),pageChecksum:Le.get(n,t+22),page_segments:QA.get(n,t+26)})},Rb=class n{static sum(t,o,a){let e=new DataView(t.buffer,0),i=0;for(let A=o;A{one=ze(lt(),1);QU();yU();ma();ib();RU=(0,one.default)("music-metadata:parser:ogg:theora"),kb=class{constructor(t,o,a){this.durationOnLastPage=!1,this.metadata=t,this.options=o,this.tokenizer=a,this.flacParser=new Pf(this.metadata,this.tokenizer,o)}async parsePage(t,o){t.headerType.firstPage&&await this.parseFirstPage(t,o)}calculateDuration(){RU("duration calculation not implemented")}async parseFirstPage(t,o){if(RU("First Ogg/FLAC page"),(await at.get(o,9)).toString()!=="fLaC")throw new Error("Invalid FLAC preamble");let e=await kf.get(o,13);await this.parseDataBlock(e,o.subarray(13+kf.len))}async parseDataBlock(t,o){switch(RU(`blockHeader type=${t.type}, length=${t.length}`),t.type){case wa.STREAMINFO:{let a=vf.get(o,0);return this.flacParser.processsStreamInfo(a)}case wa.PADDING:break;case wa.APPLICATION:break;case wa.SEEKTABLE:break;case wa.VORBIS_COMMENT:return this.flacParser.parseComment(o);case wa.PICTURE:if(!this.options.skipCovers){let a=new bI(o.length).get(o,0);return this.flacParser.addPictureTag(a)}break;default:this.metadata.addWarning(`Unknown block type: ${t.type}`)}return this.tokenizer.ignore(t.length).then()}flush(){return Promise.resolve()}}});var gne={};Lr(gne,{OggContentError:()=>fE,OggParser:()=>vU});var sne,fE,tg,kU,vU,cne=ue(()=>{DA();an();sne=ze(lt(),1);$a();Rf();zoe();Xoe();rne();or();ane();nne();fE=class extends St("Ogg"){},tg=(0,sne.default)("music-metadata:parser:ogg"),kU=class{constructor(t,o,a){this.pageNumber=0,this.closed=!1,this.metadata=t,this.streamSerial=o,this.options=a}async parsePage(t,o){this.pageNumber=o.pageSequenceNo,tg("serial=%s page#=%s, Ogg.id=%s",o.streamSerialNumber,o.pageSequenceNo,o.capturePattern);let a=await t.readToken(new Rb(o));tg("totalPageSize=%s",a.totalPageSize);let e=await t.readToken(new Mt(a.totalPageSize));if(tg("firstPage=%s, lastPage=%s, continued=%s",o.headerType.firstPage,o.headerType.lastPage,o.headerType.continued),o.headerType.firstPage){this.metadata.setFormat("container","Ogg");let i=e.subarray(0,7),A=Array.from(i).filter(r=>r>=32&&r<=126).map(r=>String.fromCharCode(r)).join("");switch(A){case"vorbis":tg(`Set Ogg stream serial ${o.streamSerialNumber}, codec=Vorbis`),this.pageConsumer=new eg(this.metadata,this.options);break;case"OpusHea":tg("Set page consumer to Ogg/Opus"),this.pageConsumer=new _b(this.metadata,this.options,t);break;case"Speex ":tg("Set page consumer to Ogg/Speex"),this.pageConsumer=new Tb(this.metadata,this.options,t);break;case"fishead":case"theora":tg("Set page consumer to Ogg/Theora"),this.pageConsumer=new Nb(this.metadata,this.options,t);break;case"FLAC":tg("Set page consumer to Vorbis"),this.pageConsumer=new kb(this.metadata,this.options,t);break;default:throw new fE(`Ogg codec not recognized (id=${A}`)}}if(o.headerType.lastPage&&(this.closed=!0),this.pageConsumer)await this.pageConsumer.parsePage(o,e);else throw new Error("pageConsumer should be initialized")}},vU=class extends Gt{constructor(){super(...arguments),this.streams=new Map}async parse(){this.streams=new Map;let t=!1,o;try{do{if(o=await this.tokenizer.readToken(ine),o.capturePattern!=="OggS")throw new fE("Invalid Ogg capture pattern");let a=this.streams.get(o.streamSerialNumber);if(a||(a=new kU(this.metadata,o.streamSerialNumber,this.options),this.streams.set(o.streamSerialNumber,a)),await a.parsePage(this.tokenizer,o),a.pageNumber>12&&!(this.options.duration&&[...this.streams.values()].find(e=>e.pageConsumer?.durationOnLastPage))){tg("Stop processing Ogg stream");break}}while(![...this.streams.values()].every(a=>a.closed))}catch(a){if(a instanceof kA)tg("Reached end-of-stream"),t=!0;else if(a instanceof fE)this.metadata.addWarning(`Corrupt Ogg content at ${this.tokenizer.position}`);else throw a}for(let a of this.streams.values())a.closed||(this.metadata.addWarning(`End-of-stream reached before reaching last page in Ogg stream serial=${a.streamSerial}`),await a.pageConsumer?.flush()),a.pageConsumer?.calculateDuration(t)}}});var Ine,lne=ue(()=>{Ine={parserType:"ogg",extensions:[".ogg",".ogv",".oga",".ogm",".ogx",".opus",".spx"],mimeTypes:["audio/ogg","audio/opus","audio/speex","video/ogg"],async load(){return(await Promise.resolve().then(()=>(cne(),gne))).OggParser}}});function rg(n,t){return vb(n,t,1)===1}function vb(n,t,o){return n>>>t&4294967295>>>32-o}var Gze,Kf,Pb,pne=ue(()=>{DA();ma();Gze=[6e3,8e3,9600,11025,12e3,16e3,22050,24e3,32e3,44100,48e3,64e3,88200,96e3,192e3,-1],Kf={len:32,get:(n,t)=>{let o=Le.get(n,t+24),a={BlockID:at.get(n,t),blockSize:Le.get(n,t+4),version:SA.get(n,t+8),totalSamples:Le.get(n,t+12),blockIndex:Le.get(n,t+16),blockSamples:Le.get(n,t+20),flags:{bitsPerSample:(1+vb(o,0,2))*8,isMono:rg(o,2),isHybrid:rg(o,3),isJointStereo:rg(o,4),crossChannel:rg(o,5),hybridNoiseShaping:rg(o,6),floatingPoint:rg(o,7),samplingRate:Gze[vb(o,23,4)],isDSD:rg(o,31)},crc:new Mt(4).get(n,t+28)};return a.flags.isDSD&&(a.totalSamples*=8),a}},Pb={len:1,get:(n,t)=>({functionId:vb(n[t],0,6),isOptional:rg(n[t],5),isOddSize:rg(n[t],6),largeBlock:rg(n[t],7)})}});var hne={};Lr(hne,{WavPackContentError:()=>QE,WavPackParser:()=>PU});var dne,lp,QE,PU,Ene=ue(()=>{DA();ap();ma();$a();pne();dne=ze(lt(),1);uf();or();lp=(0,dne.default)("music-metadata:parser:WavPack"),QE=class extends St("WavPack"){},PU=class extends Gt{constructor(){super(...arguments),this.audioDataSize=0}async parse(){return this.metadata.setAudioOnly(),this.audioDataSize=0,await this.parseWavPackBlocks(),ip(this.metadata,this.tokenizer,this.options)}async parseWavPackBlocks(){do{if(await this.tokenizer.peekToken(at)!=="wvpk")break;let o=await this.tokenizer.readToken(Kf);if(o.BlockID!=="wvpk")throw new QE("Invalid WavPack Block-ID");lp(`WavPack header blockIndex=${o.blockIndex}, len=${Kf.len}`),o.blockIndex===0&&!this.metadata.format.container&&(this.metadata.setFormat("container","WavPack"),this.metadata.setFormat("lossless",!o.flags.isHybrid),this.metadata.setFormat("bitsPerSample",o.flags.bitsPerSample),o.flags.isDSD||(this.metadata.setFormat("sampleRate",o.flags.samplingRate),this.metadata.setFormat("duration",o.totalSamples/o.flags.samplingRate)),this.metadata.setFormat("numberOfChannels",o.flags.isMono?1:2),this.metadata.setFormat("numberOfSamples",o.totalSamples),this.metadata.setFormat("codec",o.flags.isDSD?"DSD":"PCM"));let a=o.blockSize-(Kf.len-8);await(o.blockIndex===0?this.parseMetadataSubBlock(o,a):this.tokenizer.ignore(a)),o.blockSamples>0&&(this.audioDataSize+=o.blockSize)}while(!this.tokenizer.fileInfo.size||this.tokenizer.fileInfo.size-this.tokenizer.position>=Kf.len);this.metadata.format.duration&&this.metadata.setFormat("bitrate",this.audioDataSize*8/this.metadata.format.duration)}async parseMetadataSubBlock(t,o){let a=o;for(;a>Pb.len;){let e=await this.tokenizer.readToken(Pb),i=await this.tokenizer.readNumber(e.largeBlock?pf:QA),A=new Uint8Array(i*2-(e.isOddSize?1:0));switch(await this.tokenizer.readBuffer(A),lp(`Metadata Sub-Blocks functionId=0x${e.functionId.toString(16)}, id.largeBlock=${e.largeBlock},data-size=${A.length}`),e.functionId){case 0:break;case 14:{lp("ID_DSD_BLOCK");let r=1<{une={parserType:"wavpack",extensions:[".wv",".wvp"],mimeTypes:["audio/wavpack"],async load(){return(await Promise.resolve().then(()=>(Ene(),hne))).WavPackParser}}});var yE,Gb,Bne=ue(()=>{DA();yE={len:8,get:(n,t)=>({chunkID:new We(4,"latin1").get(n,t),chunkSize:Le.get(n,t+4)})},Gb=class{constructor(t){this.tagHeader=t,this.len=t.chunkSize,this.len+=this.len&1}get(t,o){return new We(this.tagHeader.chunkSize,"ascii").get(t,o)}}});var pp,yi,fne,Fb,Lb,GU=ue(()=>{DA();or();pp=class extends St("Wave"){},yi={PCM:1,ADPCM:2,IEEE_FLOAT:3,ALAW:6,MULAW:7,DVI_ADPCM:17,GSM610:49,MPEG_ADTS_AAC:5632,MPEG_LOAS:5634,RAW_AAC1:255,DOLBY_AC3_SPDIF:146,DVM:8192,RAW_SPORT:576,ESST_AC3:577,DRM:9,DTS2:8193,MPEG:80,MPEGLAYER3:85},fne={[yi.PCM]:"PCM",[yi.ADPCM]:"ADPCM",[yi.IEEE_FLOAT]:"IEEE_FLOAT",[yi.ALAW]:"ALAW",[yi.MULAW]:"MULAW",[yi.DVI_ADPCM]:"DVI_ADPCM",[yi.GSM610]:"GSM610",[yi.MPEG_ADTS_AAC]:"MPEG_ADTS_AAC",[yi.MPEG_LOAS]:"MPEG_LOAS",[yi.RAW_AAC1]:"RAW_AAC1",[yi.DOLBY_AC3_SPDIF]:"DOLBY_AC3_SPDIF",[yi.DVM]:"DVM",[yi.RAW_SPORT]:"RAW_SPORT",[yi.ESST_AC3]:"ESST_AC3",[yi.DRM]:"DRM",[yi.DTS2]:"DTS2",[yi.MPEG]:"MPEG",[yi.MPEGLAYER3]:"MPEGLAYER3"},Fb=class{constructor(t){if(t.chunkSize<16)throw new pp("Invalid chunk size");this.len=t.chunkSize}get(t,o){return{wFormatTag:SA.get(t,o),nChannels:SA.get(t,o+2),nSamplesPerSec:Le.get(t,o+4),nAvgBytesPerSec:Le.get(t,o+8),nBlockAlign:SA.get(t,o+12),wBitsPerSample:SA.get(t,o+14)}}},Lb=class{constructor(t){if(t.chunkSize<4)throw new pp("Invalid fact chunk size.");this.len=t.chunkSize}get(t,o){return{dwSampleLength:Le.get(t,o)}}}});var FU,Qne=ue(()=>{DA();nr();FU={len:420,get:(n,t)=>({description:gn(new We(256,"ascii").get(n,t)).trim(),originator:gn(new We(32,"ascii").get(n,t+256)).trim(),originatorReference:gn(new We(32,"ascii").get(n,t+288)).trim(),originationDate:gn(new We(10,"ascii").get(n,t+320)).trim(),originationTime:gn(new We(8,"ascii").get(n,t+330)).trim(),timeReferenceLow:Le.get(n,t+338),timeReferenceHigh:Le.get(n,t+342),version:SA.get(n,t+346),umid:new Mt(64).get(n,t+348),loudnessValue:SA.get(n,t+412),maxTruePeakLevel:SA.get(n,t+414),maxMomentaryLoudness:SA.get(n,t+416),maxShortTermLoudness:SA.get(n,t+418)})}});var mne={};Lr(mne,{WaveParser:()=>LU});var yne,MI,LU,Sne=ue(()=>{an();DA();yne=ze(lt(),1);Bne();GU();oE();nr();ma();$a();Qne();GU();MI=(0,yne.default)("music-metadata:parser:RIFF"),LU=class extends Gt{constructor(){super(...arguments),this.blockAlign=0,this.avgBytesPerSec=0}async parse(){let t=await this.tokenizer.readToken(yE);if(MI(`pos=${this.tokenizer.position}, parse: chunkID=${t.chunkID}`),t.chunkID==="RIFF")return this.metadata.setAudioOnly(),this.parseRiffChunk(t.chunkSize).catch(o=>{if(!(o instanceof kA))throw o})}async parseRiffChunk(t){let o=await this.tokenizer.readToken(at);switch(this.metadata.setFormat("container",o),o){case"WAVE":return this.readWaveChunk(t-at.len);default:throw new pp(`Unsupported RIFF format: RIFF/${o}`)}}async readWaveChunk(t){for(;t>=yE.len;){let o=await this.tokenizer.readToken(yE);switch(t-=yE.len+o.chunkSize,o.chunkSize>t&&this.metadata.addWarning("Data chunk size exceeds file size"),this.header=o,MI(`pos=${this.tokenizer.position}, readChunk: chunkID=RIFF/WAVE/${o.chunkID}`),o.chunkID){case"LIST":await this.parseListTag(o);break;case"fact":this.metadata.setFormat("lossless",!1),this.fact=await this.tokenizer.readToken(new Lb(o));break;case"fmt ":{let a=await this.tokenizer.readToken(new Fb(o)),e=fne[a.wFormatTag];e||(MI(`WAVE/non-PCM format=${a.wFormatTag}`),e=`non-PCM (${a.wFormatTag})`),this.metadata.setFormat("codec",e),this.metadata.setFormat("bitsPerSample",a.wBitsPerSample),this.metadata.setFormat("sampleRate",a.nSamplesPerSec),this.metadata.setFormat("numberOfChannels",a.nChannels),this.blockAlign=a.nBlockAlign,this.avgBytesPerSec=a.nAvgBytesPerSec;break}case"id3 ":case"ID3 ":{let a=await this.tokenizer.readToken(new Mt(o.chunkSize)),e=Qo(a);await new ln().parse(this.metadata,e,this.options);break}case"data":{this.metadata.format.lossless!==!1&&this.metadata.setFormat("lossless",!0);let a=o.chunkSize;if(this.tokenizer.fileInfo.size){let i=this.tokenizer.fileInfo.size-this.tokenizer.position;i0?this.metadata.setFormat("bitrate",this.avgBytesPerSec*8):this.metadata.format.duration&&this.metadata.setFormat("bitrate",a*8/this.metadata.format.duration),await this.tokenizer.ignore(o.chunkSize);break}case"bext":{let a=await this.tokenizer.readToken(FU);Object.keys(a).forEach(i=>{this.metadata.addTag("exif",`bext.${i}`,a[i])});let e=o.chunkSize-FU.len;await this.tokenizer.ignore(e);break}case"\0\0\0\0":MI(`Ignore padding chunk: RIFF/${o.chunkID} of ${o.chunkSize} bytes`),this.metadata.addWarning(`Ignore chunk: RIFF/${o.chunkID}`),await this.tokenizer.ignore(o.chunkSize);break;default:MI(`Ignore chunk: RIFF/${o.chunkID} of ${o.chunkSize} bytes`),this.metadata.addWarning(`Ignore chunk: RIFF/${o.chunkID}`),await this.tokenizer.ignore(o.chunkSize)}this.header.chunkSize%2===1&&(MI("Read odd padding byte"),await this.tokenizer.ignore(1))}}async parseListTag(t){let o=await this.tokenizer.readToken(new We(4,"latin1"));switch(MI("pos=%s, parseListTag: chunkID=RIFF/WAVE/LIST/%s",this.tokenizer.position,o),o){case"INFO":return this.parseRiffInfoTags(t.chunkSize-4);default:return this.metadata.addWarning(`Ignore chunk: RIFF/WAVE/LIST/${o}`),MI(`Ignoring chunkID=RIFF/WAVE/LIST/${o}`),this.tokenizer.ignore(t.chunkSize-4).then()}}async parseRiffInfoTags(t){for(;t>=8;){let o=await this.tokenizer.readToken(yE),a=new Gb(o),e=await this.tokenizer.readToken(a);this.addTag(o.chunkID,gn(e)),t-=8+a.len}if(t!==0)throw new pp(`Illegal remaining size: ${t}`)}addTag(t,o){this.metadata.addTag("exif",t,o)}}});var wne,Dne=ue(()=>{wne={parserType:"riff",extensions:[".wav","wave",".bwf"],mimeTypes:["audio/vnd.wave","audio/wav","audio/wave"],async load(){return(await Promise.resolve().then(()=>(Sne(),mne))).WaveParser}}});function Uze(n){let t=One.default.parse(n),o=uie(t.type);return{type:o.type,subtype:o.subtype,suffix:o.suffix,parameters:t.parameters}}function Hze(n){let t=n.lastIndexOf(".");return t===-1?"":n.substring(t)}var One,bne,dp,hp,UU=ue(()=>{H2();One=ze(Eie(),1);Cie();bne=ze(lt(),1);Uie();tp();pae();or();hae();bae();kae();Hae();Vae();toe();loe();boe();qoe();lne();Cne();Dne();Ub();dp=(0,bne.default)("music-metadata:parser:factory");hp=class{constructor(){this.parsers=[],[Aoe,lae,dae,Ooe,Ioe,wne,Ine,Oae,Uae,une,Joe,zae,Rae].forEach(t=>{this.registerParser(t)})}registerParser(t){this.parsers.push(t)}async parse(t,o,a){if(t.supportsRandomAccess()?(dp("tokenizer supports random-access, scanning for appending headers"),await HU(t,a)):dp("tokenizer does not support random-access, cannot scan for appending headers"),!o){let r=new Uint8Array(4100);if(t.fileInfo.mimeType&&(o=this.findLoaderForContentType(t.fileInfo.mimeType)),!o&&t.fileInfo.path&&(o=this.findLoaderForExtension(t.fileInfo.path)),!o){dp("Guess parser on content..."),await t.peekBuffer(r,{mayBeLess:!0});let s=await ff(r,{mpegOffsetTolerance:10});if(!s||!s.mime)throw new BI("Failed to determine audio format");if(dp(`Guessed file type is mime=${s.mime}, extension=${s.ext}`),o=this.findLoaderForContentType(s.mime),!o)throw new fI(`Guessed MIME-type not supported: ${s.mime}`)}}dp(`Loading ${o.parserType} parser...`);let e=new jO(a),i=await o.load(),A=new i(e,t,a??{});return dp(`Parser ${o.parserType} loaded`),await A.parse(),e.format.trackInfo&&(e.format.hasAudio===void 0&&e.setFormat("hasAudio",!!e.format.trackInfo.find(r=>r.type===fi.audio)),e.format.hasVideo===void 0&&e.setFormat("hasVideo",!!e.format.trackInfo.find(r=>r.type===fi.video))),e.toCommonMetadata()}findLoaderForExtension(t){if(!t)return;let o=Hze(t).toLocaleLowerCase()||t;return this.parsers.find(a=>a.extensions.indexOf(o)!==-1)}findLoaderForContentType(t){let o;if(!t)return;try{o=Uze(t)}catch{dp(`Invalid HTTP Content-Type header value: ${t}`);return}let a=o.subtype.indexOf("x-")===0?o.subtype.substring(2):o.subtype;return this.parsers.find(e=>e.mimeTypes.find(i=>i.indexOf(`${o.type}/${a}`)!==-1))}getSupportedMimeTypes(){let t=new Set;return this.parsers.forEach(o=>{o.mimeTypes.forEach(a=>{t.add(a),t.add(a.replace("/","/x-"))})}),Array.from(t)}}});async function Mne(n){let t=n.fileInfo.size;if(t>=143){let o=new Uint8Array(15),a=n.position;await n.readBuffer(o,{position:t-143}),n.setPosition(a);let e=Tr(o,"latin1");if(e.substring(6)===Kze)return Number.parseInt(e.substring(0,6),10)+15}return 0}var Kze,_ne=ue(()=>{js();Kze="LYRICS200"});async function xze(n,t={}){let o=QO(n);try{return await mE(o,t)}finally{await o.close()}}async function Yze(n,t,o={}){let a=fO(n,{fileInfo:typeof t=="string"?{mimeType:t}:t});try{return await mE(a,o)}finally{await a.close()}}async function jze(n,t,o={}){let a=Qo(n,{fileInfo:typeof t=="string"?{mimeType:t}:t});return mE(a,o)}function mE(n,t){return new hp().parse(n,void 0,t)}function Jze(n){let t={};for(let{id:o,value:a}of n)(t[o]||(t[o]=[])).push(a);return t}function qze(n){return n===void 0?0:1+Math.round(n*4)}function zze(n){return n?n.reduce((t,o)=>o.name&&o.name.toLowerCase()in["front","cover","cover (front)"]?o:t):null}async function HU(n,t={}){let o=n.fileInfo.size;if(await Vie(n)){o-=128;let a=await Mne(n);o-=a}t.apeHeader=await mI.findApeFooterOffset(n,o)}function Vze(){return new hp().getSupportedMimeTypes()}var Ub=ue(()=>{an();UU();ap();Sf();_ne();tp();or();or()});var Rne={};Lr(Rne,{CouldNotDetermineFileTypeError:()=>BI,FieldDecodingError:()=>sn,InternalParserError:()=>Ap,LyricsContentType:()=>eE,TimestampFormat:()=>AE,UnsupportedFileTypeError:()=>fI,getSupportedMimeTypes:()=>Vze,makeParseError:()=>Xh,makeUnexpectedFileContentError:()=>St,orderTags:()=>Jze,parseBlob:()=>xze,parseBuffer:()=>jze,parseFile:()=>Zze,parseFromTokenizer:()=>mE,parseStream:()=>Wze,parseWebStream:()=>Yze,ratingToStars:()=>qze,scanAppendingHeaders:()=>HU,selectCover:()=>zze});async function Wze(n,t,o={}){let a=await O2(n,{fileInfo:typeof t=="string"?{mimeType:t}:t});try{return await mE(a,o)}finally{await a.close()}}async function Zze(n,t={}){Tne(`parseFile: ${n}`);let o=await _re(n),a=new hp;try{let e=a.findLoaderForExtension(n);e||Tne("Parser could not be determined by file extension");try{return await a.parse(o,e,t)}catch(i){throw(i instanceof BI||i instanceof fI)&&(i.message+=`: ${n}`),i}}finally{await o.close()}}var Nne,Tne,kne=ue(()=>{an();Nne=ze(lt(),1);Ub();UU();Ub();Tne=(0,Nne.default)("music-metadata:parser")});var zse=ee((kvA,QH)=>{"use strict";var oWe=Object.prototype.hasOwnProperty,Da="~";function AQ(){}Object.create&&(AQ.prototype=Object.create(null),new AQ().__proto__||(Da=!1));function nWe(n,t,o){this.fn=n,this.context=t,this.once=o||!1}function qse(n,t,o,a,e){if(typeof o!="function")throw new TypeError("The listener must be a function");var i=new nWe(o,a||n,e),A=Da?Da+t:t;return n._events[A]?n._events[A].fn?n._events[A]=[n._events[A],i]:n._events[A].push(i):(n._events[A]=i,n._eventsCount++),n}function eM(n,t){--n._eventsCount===0?n._events=new AQ:delete n._events[t]}function ga(){this._events=new AQ,this._eventsCount=0}ga.prototype.eventNames=function(){var t=[],o,a;if(this._eventsCount===0)return t;for(a in o=this._events)oWe.call(o,a)&&t.push(Da?a.slice(1):a);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(o)):t};ga.prototype.listeners=function(t){var o=Da?Da+t:t,a=this._events[o];if(!a)return[];if(a.fn)return[a.fn];for(var e=0,i=a.length,A=new Array(i);e{"use strict";var aQ=n=>n&&typeof n.message=="string",vH=n=>{if(!n)return;let t=n.cause;if(typeof t=="function"){let o=n.cause();return aQ(o)?o:void 0}else return aQ(t)?t:void 0},yge=(n,t)=>{if(!aQ(n))return"";let o=n.stack||"";if(t.has(n))return o+` causes have become circular...`;let a=vH(n);return a?(t.add(n),o+` -caused by: `+yge(a,t)):o},xWe=n=>yge(n,new Set),mge=(n,t,o)=>{if(!aQ(n))return"";let a=o?"":n.message||"";if(t.has(n))return a+": ...";let e=vH(n);if(e){t.add(n);let i=typeof n.cause=="function";return a+(i?"":": ")+mge(e,t,i)}else return a},YWe=n=>mge(n,new Set);Sge.exports={isErrorLike:aQ,getErrorCause:vH,stackWithCauses:xWe,messageWithCauses:YWe}});var GH=ee((oFA,Dge)=>{"use strict";var jWe=Symbol("circular-ref-tag"),lM=Symbol("pino-raw-err-ref"),wge=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[lM]},set:function(n){this[lM]=n}}});Object.defineProperty(wge,lM,{writable:!0,value:{}});Dge.exports={pinoErrProto:wge,pinoErrorSymbols:{seen:jWe,rawSymbol:lM}}});var Mge=ee((nFA,bge)=>{"use strict";bge.exports=LH;var{messageWithCauses:JWe,stackWithCauses:qWe,isErrorLike:Oge}=PH(),{pinoErrProto:zWe,pinoErrorSymbols:VWe}=GH(),{seen:FH}=VWe,{toString:WWe}=Object.prototype;function LH(n){if(!Oge(n))return n;n[FH]=void 0;let t=Object.create(zWe);t.type=WWe.call(n.constructor)==="[object Function]"?n.constructor.name:n.name,t.message=JWe(n),t.stack=qWe(n),Array.isArray(n.errors)&&(t.aggregateErrors=n.errors.map(o=>LH(o)));for(let o in n)if(t[o]===void 0){let a=n[o];Oge(a)?o!=="cause"&&!Object.prototype.hasOwnProperty.call(a,FH)&&(t[o]=LH(a)):t[o]=a}return delete n[FH],t.raw=n,t}});var Tge=ee((sFA,_ge)=>{"use strict";_ge.exports=dM;var{isErrorLike:UH}=PH(),{pinoErrProto:ZWe,pinoErrorSymbols:XWe}=GH(),{seen:pM}=XWe,{toString:$We}=Object.prototype;function dM(n){if(!UH(n))return n;n[pM]=void 0;let t=Object.create(ZWe);t.type=$We.call(n.constructor)==="[object Function]"?n.constructor.name:n.name,t.message=n.message,t.stack=n.stack,Array.isArray(n.errors)&&(t.aggregateErrors=n.errors.map(o=>dM(o))),UH(n.cause)&&!Object.prototype.hasOwnProperty.call(n.cause,pM)&&(t.cause=dM(n.cause));for(let o in n)if(t[o]===void 0){let a=n[o];UH(a)?Object.prototype.hasOwnProperty.call(a,pM)||(t[o]=dM(a)):t[o]=a}return delete n[pM],t.raw=n,t}});var vge=ee((gFA,kge)=>{"use strict";kge.exports={mapHttpRequest:e6e,reqSerializer:Rge};var HH=Symbol("pino-raw-req-ref"),Nge=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[HH]},set:function(n){this[HH]=n}}});Object.defineProperty(Nge,HH,{writable:!0,value:{}});function Rge(n){let t=n.info||n.socket,o=Object.create(Nge);if(o.id=typeof n.id=="function"?n.id():n.id||(n.info?n.info.id:void 0),o.method=n.method,n.originalUrl)o.url=n.originalUrl;else{let a=n.path;o.url=typeof a=="string"?a:n.url?n.url.path||n.url:void 0}return n.query&&(o.query=n.query),n.params&&(o.params=n.params),o.headers=n.headers,o.remoteAddress=t&&t.remoteAddress,o.remotePort=t&&t.remotePort,o.raw=n.raw||n,o}function e6e(n){return{req:Rge(n)}}});var Lge=ee((cFA,Fge)=>{"use strict";Fge.exports={mapHttpResponse:A6e,resSerializer:Gge};var KH=Symbol("pino-raw-res-ref"),Pge=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[KH]},set:function(n){this[KH]=n}}});Object.defineProperty(Pge,KH,{writable:!0,value:{}});function Gge(n){let t=Object.create(Pge);return t.statusCode=n.headersSent?n.statusCode:null,t.headers=n.getHeaders?n.getHeaders():n._headers,t.raw=n,t}function A6e(n){return{res:Gge(n)}}});var YH=ee((IFA,Uge)=>{"use strict";var xH=Mge(),t6e=Tge(),hM=vge(),EM=Lge();Uge.exports={err:xH,errWithCause:t6e,mapHttpRequest:hM.mapHttpRequest,mapHttpResponse:EM.mapHttpResponse,req:hM.reqSerializer,res:EM.resSerializer,wrapErrorSerializer:function(t){return t===xH?t:function(a){return t(xH(a))}},wrapRequestSerializer:function(t){return t===hM.reqSerializer?t:function(a){return t(hM.reqSerializer(a))}},wrapResponseSerializer:function(t){return t===EM.resSerializer?t:function(a){return t(EM.resSerializer(a))}}}});var jH=ee((lFA,Hge)=>{"use strict";function r6e(n,t){return t}Hge.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=r6e;let o=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(o))return;let a=o.slice(2),e=[];for(let i of a)i&&e.push(i.getFileName());return e}});var qge=ee((pFA,Jge)=>{"use strict";function JH(n){if(n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(n instanceof Array){let t=[];for(let o=0;o{let Q=[...s.slice(0,I),...f];return o(B,Q)}:o,e,i);else if(i)Yge(c,r);else{let p=typeof o=="function"?o(a6e(c,r),[...s.slice(0,I),...r]):o;xge(c,r,p)}}if(A.length===0)g(n,0);else{let c=n;for(let I=0;I0)o?i===a&&(o=!1,a=""):(o=!0,a=i);else if(i==="["&&!o)t++;else if(i==="]"&&!o&&(t--,t<0))throw new Error(`Invalid redaction path (${n})`)}if(t!==0)throw new Error(`Invalid redaction path (${n})`)}function I6e(n){if(!Array.isArray(n))throw new TypeError("paths must be an array");for(let t of n)c6e(t)}function l6e(n={}){let{paths:t=[],censor:o="[REDACTED]",serialize:a=JSON.stringify,strict:e=!0,remove:i=!1}=n;I6e(t);let A=s6e(t);return function(s){if(e&&(s===null||typeof s!="object")&&(s==null||typeof s!="object"))return a?a(s):s;let g=g6e(s,A),c=s,I=o;return typeof o=="function"&&(I=o),o6e(g,t,I,i),a===!1?(g.restore=function(){return JH(c)},g):typeof a=="function"?a(g):JSON.stringify(g)}}Jge.exports=l6e});var PE=ee((dFA,zge)=>{"use strict";var p6e=Symbol("pino.setLevel"),d6e=Symbol("pino.getLevel"),h6e=Symbol("pino.levelVal"),E6e=Symbol("pino.levelComp"),u6e=Symbol("pino.useLevelLabels"),C6e=Symbol("pino.useOnlyCustomLevels"),B6e=Symbol("pino.mixin"),f6e=Symbol("pino.lsCache"),Q6e=Symbol("pino.chindings"),y6e=Symbol("pino.asJson"),m6e=Symbol("pino.write"),S6e=Symbol("pino.redactFmt"),w6e=Symbol("pino.time"),D6e=Symbol("pino.timeSliceIndex"),O6e=Symbol("pino.stream"),b6e=Symbol("pino.stringify"),M6e=Symbol("pino.stringifySafe"),_6e=Symbol("pino.stringifiers"),T6e=Symbol("pino.end"),N6e=Symbol("pino.formatOpts"),R6e=Symbol("pino.messageKey"),k6e=Symbol("pino.errorKey"),v6e=Symbol("pino.nestedKey"),P6e=Symbol("pino.nestedKeyStr"),G6e=Symbol("pino.mixinMergeStrategy"),F6e=Symbol("pino.msgPrefix"),L6e=Symbol("pino.wildcardFirst"),U6e=Symbol.for("pino.serializers"),H6e=Symbol.for("pino.formatters"),K6e=Symbol.for("pino.hooks"),x6e=Symbol.for("pino.metadata");zge.exports={setLevelSym:p6e,getLevelSym:d6e,levelValSym:h6e,levelCompSym:E6e,useLevelLabelsSym:u6e,mixinSym:B6e,lsCacheSym:f6e,chindingsSym:Q6e,asJsonSym:y6e,writeSym:m6e,serializersSym:U6e,redactFmtSym:S6e,timeSym:w6e,timeSliceIndexSym:D6e,streamSym:O6e,stringifySym:b6e,stringifySafeSym:M6e,stringifiersSym:_6e,endSym:T6e,formatOptsSym:N6e,messageKeySym:R6e,errorKeySym:k6e,nestedKeySym:v6e,wildcardFirstSym:L6e,needsMetadataGsym:x6e,useOnlyCustomLevelsSym:C6e,formattersSym:H6e,hooksSym:K6e,nestedKeyStrSym:P6e,mixinMergeStrategySym:G6e,msgPrefixSym:F6e}});var zH=ee((hFA,Xge)=>{"use strict";var Vge=qge(),{redactFmtSym:Y6e,wildcardFirstSym:CM}=PE(),qH=/[^.[\]]+|\[([^[\]]*?)\]/g,Wge="[Redacted]",Zge=!1;function j6e(n,t){let{paths:o,censor:a,remove:e}=J6e(n),i=o.reduce((s,g)=>{qH.lastIndex=0;let c=qH.exec(g),I=qH.exec(g),p=c[1]!==void 0?c[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):c[0];if(p==="*"&&(p=CM),I===null)return s[p]=null,s;if(s[p]===null)return s;let{index:B}=I,f=`${g.substr(B,g.length-1)}`;return s[p]=s[p]||[],p!==CM&&s[p].length===0&&s[p].push(...s[CM]||[]),p===CM&&Object.keys(s).forEach(function(Q){s[Q]&&s[Q].push(f)}),s[p].push(f),s},{}),A={[Y6e]:Vge({paths:o,censor:a,serialize:t,strict:Zge,remove:e})},r=(...s)=>t(typeof a=="function"?a(...s):a);return[...Object.keys(i),...Object.getOwnPropertySymbols(i)].reduce((s,g)=>{if(i[g]===null)s[g]=c=>r(c,[g]);else{let c=typeof a=="function"?(I,p)=>a(I,[g,...p]):a;s[g]=Vge({paths:i[g],censor:c,serialize:t,strict:Zge,remove:e})}return s},A)}function J6e(n){if(Array.isArray(n))return n={paths:n,censor:Wge},n;let{paths:t,censor:o=Wge,remove:a}=n;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return a===!0&&(o=void 0),{paths:t,censor:o,remove:a}}Xge.exports=j6e});var Ace=ee((EFA,ece)=>{"use strict";var q6e=()=>"",z6e=()=>`,"time":${Date.now()}`,V6e=()=>`,"time":${Math.round(Date.now()/1e3)}`,W6e=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,Z6e=1000000n,$ge=1000000000n,X6e=BigInt(Date.now())*Z6e,$6e=process.hrtime.bigint(),e5e=()=>{let n=process.hrtime.bigint()-$6e,t=X6e+n,o=t/$ge,a=t%$ge,e=Number(o*1000n+a/1000000n),i=new Date(e),A=i.getUTCFullYear(),r=(i.getUTCMonth()+1).toString().padStart(2,"0"),s=i.getUTCDate().toString().padStart(2,"0"),g=i.getUTCHours().toString().padStart(2,"0"),c=i.getUTCMinutes().toString().padStart(2,"0"),I=i.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${A}-${r}-${s}T${g}:${c}:${I}.${a.toString().padStart(9,"0")}Z"`};ece.exports={nullTime:q6e,epochTime:z6e,unixTime:V6e,isoTime:W6e,isoTimeNano:e5e}});var rce=ee((uFA,tce)=>{"use strict";function A5e(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}tce.exports=t5e;function t5e(n,t,o){var a=o&&o.stringify||A5e,e=1;if(typeof n=="object"&&n!==null){var i=t.length+e;if(i===1)return n;var A=new Array(i);A[0]=a(n);for(var r=1;r-1?I:0,n.charCodeAt(B+1)){case 100:case 102:if(c>=s||t[c]==null)break;I=s||t[c]==null)break;I=s||t[c]===void 0)break;I",I=B+2,B++;break}g+=a(t[c]),I=B+2,B++;break;case 115:if(c>=s)break;I{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(o){if((o>0&&o<1/0)===!1)throw typeof o!="number"&&typeof o!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(n,0,0,Number(o))},n=new Int32Array(new SharedArrayBuffer(4));VH.exports=t}else{let n=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let a=Date.now()+Number(t);for(;a>Date.now(););};VH.exports=n}});var Ice=ee((BFA,cce)=>{"use strict";var $t=$e("fs"),r5e=$e("events"),i5e=$e("util").inherits,ice=$e("path"),XH=WH(),a5e=$e("assert"),BM=100,fM=Buffer.allocUnsafe(0),o5e=16*1024,ace="buffer",oce="utf8",[n5e,s5e]=(process.versions.node||"0.0").split(".").map(Number),g5e=n5e>=22&&s5e>=7;function nce(n,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function o(i,A){if(i){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",i)}):t.emit("error",i);return}let r=t._reopening;t.fd=A,t.file=n,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit("ready")):t.emit("ready"),!t.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():r&&process.nextTick(()=>t.emit("drain")))}let a=t.append?"a":"w",e=t.mode;if(t.sync)try{t.mkdir&&$t.mkdirSync(ice.dirname(n),{recursive:!0});let i=$t.openSync(n,a,e);o(null,i)}catch(i){throw o(i),i}else t.mkdir?$t.mkdir(ice.dirname(n),{recursive:!0},i=>{if(i)return o(i);$t.open(n,a,e,o)}):$t.open(n,a,e,o)}function As(n){if(!(this instanceof As))return new As(n);let{fd:t,dest:o,minLength:a,maxLength:e,maxWrite:i,periodicFlush:A,sync:r,append:s=!0,mkdir:g,retryEAGAIN:c,fsync:I,contentMode:p,mode:B}=n||{};t=t||o,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(a||0,16387),this.file=null,this.destroyed=!1,this.minLength=a||0,this.maxLength=e||0,this.maxWrite=i||o5e,this._periodicFlush=A||0,this._periodicFlushTimer=void 0,this.sync=r||!1,this.writable=!0,this._fsync=I||!1,this.append=s||!1,this.mode=B,this.retryEAGAIN=c||(()=>!0),this.mkdir=g||!1;let f,Q;if(p===ace)this._writingBuf=fM,this.write=l5e,this.flush=d5e,this.flushSync=E5e,this._actualWrite=C5e,f=()=>$t.writeSync(this.fd,this._writingBuf),Q=()=>$t.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===oce)this._writingBuf="",this.write=I5e,this.flush=p5e,this.flushSync=h5e,this._actualWrite=u5e,f=()=>Buffer.isBuffer(this._writingBuf)?$t.writeSync(this.fd,this._writingBuf):$t.writeSync(this.fd,this._writingBuf,"utf8"),Q=()=>Buffer.isBuffer(this._writingBuf)?$t.write(this.fd,this._writingBuf,this.release):$t.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${oce}" and "${ace}", but passed ${p}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")nce(t,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(y,m)=>{if(y){if((y.code==="EAGAIN"||y.code==="EBUSY")&&this.retryEAGAIN(y,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{XH(BM),this.release(void 0,0)}catch(R){this.release(R)}else setTimeout(Q,BM);else this._writing=!1,this.emit("error",y);return}this.emit("write",m);let T=ZH(this._writingBuf,this._len,m);if(this._len=T.len,this._writingBuf=T.writingBuf,this._writingBuf.length){if(!this.sync){Q();return}try{do{let R=f(),L=ZH(this._writingBuf,this._len,R);this._len=L.len,this._writingBuf=L.writingBuf}while(this._writingBuf.length)}catch(R){this.release(R);return}}this._fsync&&$t.fsyncSync(this.fd);let _=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):_>this.minLength?this._actualWrite():this._ending?_>0?this._actualWrite():(this._writing=!1,QM(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(c5e,this)):this.emit("drain"))},this.on("newListener",function(y){y==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function ZH(n,t,o){return typeof n=="string"&&(n=Buffer.from(n)),t=Math.max(t-o,0),n=n.subarray(o),{writingBuf:n,len:t}}function c5e(n){n.listenerCount("drain")>0&&(n._asyncDrainScheduled=!1,n.emit("drain"))}i5e(As,r5e);function sce(n,t){return n.length===0?fM:n.length===1?n[0]:Buffer.concat(n,t)}function I5e(n){if(this.destroyed)throw new Error("SonicBoom destroyed");n=""+n;let t=Buffer.byteLength(n),o=this._len+t,a=this._bufs;return this.maxLength&&o>this.maxLength?(this.emit("drop",n),this._lenthis.maxWrite?a.push(n):a[a.length-1]+=n,this._len=o,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._lenthis.maxLength?(this.emit("drop",n),this._lenthis.maxWrite?(o.push([n]),a.push(n.length)):(o[o.length-1].push(n),a[a.length-1]+=n.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len{if(this._fsync)this._flushPending=!1,n();else try{$t.fsync(this.fd,a=>{this._flushPending=!1,n(a)})}catch(a){n(a)}this.off("error",o)},o=a=>{this._flushPending=!1,n(a),this.off("drain",t)};this.once("drain",t),this.once("error",o)}function p5e(n){if(n!=null&&typeof n!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(n){n(t);return}throw t}if(this.minLength<=0){n?.();return}n&&gce.call(this,n),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function d5e(n){if(n!=null&&typeof n!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(n){n(t);return}throw t}if(this.minLength<=0){n?.();return}n&&gce.call(this,n),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}As.prototype.reopen=function(n){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(n)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(n&&(this.file=n),this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&$t.close(t,o=>{if(o)return this.emit("error",o)})}),nce(this.file,this)};As.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():QM(this)))};function h5e(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let n="";for(;this._bufs.length||n.length;){n.length<=0&&(n=this._bufs[0]);try{let t=Buffer.isBuffer(n)?$t.writeSync(this.fd,n):$t.writeSync(this.fd,n,"utf8"),o=ZH(n,this._len,t);n=o.writingBuf,this._len=o.len,n.length<=0&&this._bufs.shift()}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,n.length,this._len-n.length))throw t;XH(BM)}}try{$t.fsyncSync(this.fd)}catch{}}function E5e(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=fM);let n=fM;for(;this._bufs.length||n.length;){n.length<=0&&(n=sce(this._bufs[0],this._lens[0]));try{let t=$t.writeSync(this.fd,n);n=n.subarray(t),this._len=Math.max(this._len-t,0),n.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,n.length,this._len-n.length))throw t;XH(BM)}}}As.prototype.destroy=function(){this.destroyed||QM(this)};function u5e(){let n=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let t=Buffer.isBuffer(this._writingBuf)?$t.writeSync(this.fd,this._writingBuf):$t.writeSync(this.fd,this._writingBuf,"utf8");n(null,t)}catch(t){n(t)}else $t.write(this.fd,this._writingBuf,n)}function C5e(){let n=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:sce(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=$t.writeSync(this.fd,this._writingBuf);n(null,t)}catch(t){n(t)}else g5e&&(this._writingBuf=Buffer.from(this._writingBuf)),$t.write(this.fd,this._writingBuf,n)}function QM(n){if(n.fd===-1){n.once("ready",QM.bind(null,n));return}n._periodicFlushTimer!==void 0&&clearInterval(n._periodicFlushTimer),n.destroyed=!0,n._bufs=[],n._lens=[],a5e(typeof n.fd=="number",`sonic.fd must be a number, got ${typeof n.fd}`);try{$t.fsync(n.fd,t)}catch{}function t(){n.fd!==1&&n.fd!==2?$t.close(n.fd,o):o()}function o(a){if(a){n.emit("error",a);return}n._ending&&!n._writing&&n.emit("finish"),n.emit("close")}}As.SonicBoom=As;As.default=As;cce.exports=As});var $H=ee((fFA,Ece)=>{"use strict";var ts={exit:[],beforeExit:[]},lce={exit:Q5e,beforeExit:y5e},GE;function B5e(){GE===void 0&&(GE=new FinalizationRegistry(m5e))}function f5e(n){ts[n].length>0||process.on(n,lce[n])}function pce(n){ts[n].length>0||(process.removeListener(n,lce[n]),ts.exit.length===0&&ts.beforeExit.length===0&&(GE=void 0))}function Q5e(){dce("exit")}function y5e(){dce("beforeExit")}function dce(n){for(let t of ts[n]){let o=t.deref(),a=t.fn;o!==void 0&&a(o,n)}ts[n]=[]}function m5e(n){for(let t of["exit","beforeExit"]){let o=ts[t].indexOf(n);ts[t].splice(o,o+1),pce(t)}}function hce(n,t,o){if(t===void 0)throw new Error("the object can't be undefined");f5e(n);let a=new WeakRef(t);a.fn=o,B5e(),GE.register(t,a),ts[n].push(a)}function S5e(n,t){hce("exit",n,t)}function w5e(n,t){hce("beforeExit",n,t)}function D5e(n){if(GE!==void 0){GE.unregister(n);for(let t of["exit","beforeExit"])ts[t]=ts[t].filter(o=>{let a=o.deref();return a&&a!==n}),pce(t)}}Ece.exports={register:S5e,registerBeforeExit:w5e,unregister:D5e}});var uce=ee((QFA,O5e)=>{O5e.exports={name:"thread-stream",version:"3.2.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0","@yao-pkg/pkg":"^5.11.5",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^9.0.6","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^5.3.2","why-is-node-running":"^2.2.2"},scripts:{build:"tsc --noEmit",test:'standard && npm run build && npm run transpile && tap "test/**/*.test.*js" && tap --ts test/*.test.*ts',"test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --timeout=120 --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*","test/syntax-error.mjs"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina ",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var Bce=ee((yFA,Cce)=>{"use strict";function b5e(n,t,o,a,e){let i=Date.now()+a,A=Atomics.load(n,t);if(A===o){e(null,"ok");return}let r=A,s=g=>{Date.now()>i?e(null,"timed-out"):setTimeout(()=>{r=A,A=Atomics.load(n,t),A===r?s(g>=1e3?1e3:g*2):A===o?e(null,"ok"):e(null,"not-equal")},g)};s(1)}function M5e(n,t,o,a,e){let i=Date.now()+a,A=Atomics.load(n,t);if(A!==o){e(null,"ok");return}let r=s=>{Date.now()>i?e(null,"timed-out"):setTimeout(()=>{A=Atomics.load(n,t),A!==o?e(null,"ok"):r(s>=1e3?1e3:s*2)},s)};r(1)}Cce.exports={wait:b5e,waitDiff:M5e}});var Qce=ee((mFA,fce)=>{"use strict";fce.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}});var Dce=ee((SFA,wce)=>{"use strict";var{version:_5e}=uce(),{EventEmitter:T5e}=$e("events"),{Worker:N5e}=$e("worker_threads"),{join:R5e}=$e("path"),{pathToFileURL:k5e}=$e("url"),{wait:v5e}=Bce(),{WRITE_INDEX:dn,READ_INDEX:to,SEQ_INDEX:eK}=Qce(),P5e=$e("buffer"),G5e=$e("assert"),Te=Symbol("kImpl"),F5e=P5e.constants.MAX_STRING_LENGTH;function FE(n,t){Atomics.add(n[Te].state,eK,1),t(),Atomics.add(n[Te].state,eK,1),Atomics.notify(n[Te].state,eK)}var oQ=class{constructor(t){this._value=t}deref(){return this._value}},mM=class{register(){}unregister(){}},L5e=process.env.NODE_V8_COVERAGE?mM:global.FinalizationRegistry||mM,U5e=process.env.NODE_V8_COVERAGE?oQ:global.WeakRef||oQ,yce=new L5e(n=>{n.exited||n.terminate()});function H5e(n,t){let{filename:o,workerData:a}=t,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||R5e(__dirname,"lib","worker.js"),A=new N5e(i,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:o.indexOf("file://")===0?o:k5e(o).href,dataBuf:n[Te].dataBuf,stateBuf:n[Te].stateBuf,workerData:{$context:{threadStreamVersion:_5e},...a}}});return A.stream=new oQ(n),A.on("message",K5e),A.on("exit",Sce),yce.register(n,A),A}function mce(n){G5e(!n[Te].sync),n[Te].needDrain&&(n[Te].needDrain=!1,n.emit("drain"))}function yM(n){let t=Atomics.load(n[Te].state,dn),o=n[Te].data.length-t;if(o>0){if(n[Te].buf.length===0){n[Te].flushing=!1,n[Te].ending?aK(n):n[Te].needDrain&&process.nextTick(mce,n);return}let a=n[Te].buf.slice(0,o),e=Buffer.byteLength(a);e<=o?(n[Te].buf=n[Te].buf.slice(o),SM(n,a,yM.bind(null,n))):n.flush(()=>{if(!n.destroyed){for(FE(n,()=>{Atomics.store(n[Te].state,to,0),Atomics.store(n[Te].state,dn,0)}),Atomics.notify(n[Te].state,to);e>n[Te].data.length;)o=o/2,a=n[Te].buf.slice(0,o),e=Buffer.byteLength(a);n[Te].buf=n[Te].buf.slice(o),SM(n,a,yM.bind(null,n))}})}else if(o===0){if(t===0&&n[Te].buf.length===0)return;n.flush(()=>{FE(n,()=>{Atomics.store(n[Te].state,to,0),Atomics.store(n[Te].state,dn,0)}),Atomics.notify(n[Te].state,to),yM(n)})}else ng(n,new Error("overwritten"))}function K5e(n){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}if(n?.code!=null)switch(n.code){case"READY":this.stream=new U5e(t),t.flush(()=>{t[Te].ready=!0,t.emit("ready")});break;case"ERROR":ng(t,n.err);break;case"EVENT":Array.isArray(n.args)?t.emit(n.name,...n.args):t.emit(n.name,n.args);break;case"WARNING":process.emitWarning(n.err);break;default:ng(t,new Error("this should not happen: "+n.code))}}function Sce(n){let t=this.stream.deref();t!==void 0&&(yce.unregister(t),t.worker.exited=!0,t.worker.off("exit",Sce),ng(t,n!==0?new Error("the worker thread exited"):null))}var tK=class extends T5e{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[Te]={},this[Te].stateBuf=new SharedArrayBuffer(128),this[Te].state=new Int32Array(this[Te].stateBuf),this[Te].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[Te].data=Buffer.from(this[Te].dataBuf),this[Te].sync=t.sync||!1,this[Te].ending=!1,this[Te].ended=!1,this[Te].needDrain=!1,this[Te].destroyed=!1,this[Te].flushing=!1,this[Te].ready=!1,this[Te].finished=!1,this[Te].errored=null,this[Te].closed=!1,this[Te].buf="",this.worker=H5e(this,t),this.on("message",(o,a)=>{this.worker.postMessage(o,a)})}write(t){if(this[Te].destroyed)return rK(this,new Error("the worker has exited")),!1;if(this[Te].ending)return rK(this,new Error("the worker is ending")),!1;if(this[Te].flushing&&this[Te].buf.length+t.length>=F5e)try{AK(this),this[Te].flushing=!0}catch(o){return ng(this,o),!1}if(this[Te].buf+=t,this[Te].sync)try{return AK(this),!0}catch(o){return ng(this,o),!1}return this[Te].flushing||(this[Te].flushing=!0,setImmediate(yM,this)),this[Te].needDrain=this[Te].data.length-this[Te].buf.length-Atomics.load(this[Te].state,dn)<=0,!this[Te].needDrain}end(){this[Te].destroyed||(this[Te].ending=!0,aK(this))}flush(t){if(this[Te].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let o=Atomics.load(this[Te].state,dn);v5e(this[Te].state,to,o,1/0,(a,e)=>{if(a){ng(this,a),process.nextTick(t,a);return}if(e==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[Te].destroyed||(AK(this),iK(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[Te].ready}get destroyed(){return this[Te].destroyed}get closed(){return this[Te].closed}get writable(){return!this[Te].destroyed&&!this[Te].ending}get writableEnded(){return this[Te].ending}get writableFinished(){return this[Te].finished}get writableNeedDrain(){return this[Te].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[Te].errored}};function rK(n,t){setImmediate(()=>{n.emit("error",t)})}function ng(n,t){n[Te].destroyed||(n[Te].destroyed=!0,t&&(n[Te].errored=t,rK(n,t)),n.worker.exited?setImmediate(()=>{n[Te].closed=!0,n.emit("close")}):n.worker.terminate().catch(()=>{}).then(()=>{n[Te].closed=!0,n.emit("close")}))}function SM(n,t,o){let a=Atomics.load(n[Te].state,dn),e=Buffer.byteLength(t);return n[Te].data.write(t,a),FE(n,()=>{Atomics.store(n[Te].state,dn,a+e)}),o(),!0}function aK(n){if(!(n[Te].ended||!n[Te].ending||n[Te].flushing)){n[Te].ended=!0;try{n.flushSync();let t=Atomics.load(n[Te].state,to);FE(n,()=>{Atomics.store(n[Te].state,dn,-1)});let o=0;for(;t!==-1;){if(Atomics.wait(n[Te].state,to,t,1e3),t=Atomics.load(n[Te].state,to),t===-2){ng(n,new Error("end() failed"));return}if(++o===10){ng(n,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{n[Te].finished=!0,n.emit("finish")})}catch(t){ng(n,t)}}}function AK(n){let t=()=>{n[Te].ending?aK(n):n[Te].needDrain&&process.nextTick(mce,n)};for(n[Te].flushing=!1;n[Te].buf.length!==0;){let o=Atomics.load(n[Te].state,dn),a=n[Te].data.length-o;if(a===0){iK(n),FE(n,()=>{Atomics.store(n[Te].state,to,0),Atomics.store(n[Te].state,dn,0)}),Atomics.notify(n[Te].state,to);continue}else if(a<0)throw new Error("overwritten");let e=n[Te].buf.slice(0,a),i=Buffer.byteLength(e);if(i<=a)n[Te].buf=n[Te].buf.slice(a),SM(n,e,t);else{for(iK(n),FE(n,()=>{Atomics.store(n[Te].state,to,0),Atomics.store(n[Te].state,dn,0)}),Atomics.notify(n[Te].state,to);i>n[Te].buf.length;)a=a/2,e=n[Te].buf.slice(0,a),i=Buffer.byteLength(e);n[Te].buf=n[Te].buf.slice(a),SM(n,e,t)}}}function iK(n){if(n[Te].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(n[Te].state,dn),o=0;for(;;){let a=Atomics.load(n[Te].state,to);if(a===-2)throw Error("_flushSync failed");if(a!==t)Atomics.wait(n[Te].state,to,a,1e3);else break;if(++o===10)throw new Error("_flushSync took too long (10s)")}}wce.exports=tK});var sK=ee((wFA,Oce)=>{"use strict";var{createRequire:x5e}=$e("module"),Y5e=jH(),{join:oK,isAbsolute:j5e,sep:J5e}=$e("node:path"),q5e=WH(),nK=$H(),z5e=Dce();function V5e(n){nK.register(n,Z5e),nK.registerBeforeExit(n,X5e),n.on("close",function(){nK.unregister(n)})}function W5e(n,t,o,a){let e=new z5e({filename:n,workerData:t,workerOpts:o,sync:a});e.on("ready",i),e.on("close",function(){process.removeListener("exit",A)}),process.on("exit",A);function i(){process.removeListener("exit",A),e.unref(),o.autoEnd!==!1&&V5e(e)}function A(){e.closed||(e.flushSync(),q5e(100),e.end())}return e}function Z5e(n){n.ref(),n.flushSync(),n.end(),n.once("close",function(){n.unref()})}function X5e(n){n.flushSync()}function $5e(n){let{pipeline:t,targets:o,levels:a,dedupe:e,worker:i={},caller:A=Y5e(),sync:r=!1}=n,s={...n.options},g=typeof A=="string"?[A]:A,c="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},I=n.target;if(I&&o)throw new Error("only one of target or targets can be specified");return o?(I=c["pino-worker"]||oK(__dirname,"worker.js"),s.targets=o.filter(B=>B.target).map(B=>({...B,target:p(B.target)})),s.pipelines=o.filter(B=>B.pipeline).map(B=>B.pipeline.map(f=>({...f,level:B.level,target:p(f.target)})))):t&&(I=c["pino-worker"]||oK(__dirname,"worker.js"),s.pipelines=[t.map(B=>({...B,target:p(B.target)}))]),a&&(s.levels=a),e&&(s.dedupe=e),s.pinoWillSendConfig=!0,W5e(p(I),s,i,r);function p(B){if(B=c[B]||B,j5e(B)||B.indexOf("file://")===0)return B;if(B==="pino/file")return oK(__dirname,"..","file.js");let f;for(let Q of g)try{let y=Q==="node:repl"?process.cwd()+J5e:Q;f=x5e(y).resolve(B);break}catch{continue}if(!f)throw new Error(`unable to determine transport target for "${B}"`);return f}}Oce.exports=$5e});var bM=ee((DFA,Uce)=>{"use strict";var bce=$e("node:diagnostics_channel"),Mce=rce(),{mapHttpRequest:eZe,mapHttpResponse:AZe}=YH(),cK=Ice(),_ce=$H(),{lsCacheSym:tZe,chindingsSym:kce,writeSym:Tce,serializersSym:vce,formatOptsSym:Nce,endSym:rZe,stringifiersSym:Pce,stringifySym:Gce,stringifySafeSym:IK,wildcardFirstSym:Fce,nestedKeySym:iZe,formattersSym:Lce,messageKeySym:aZe,errorKeySym:oZe,nestedKeyStrSym:nZe,msgPrefixSym:wM}=PE(),{isMainThread:sZe}=$e("worker_threads"),gZe=sK(),OM;typeof bce.tracingChannel=="function"?OM=bce.tracingChannel("pino_asJson"):OM={hasSubscribers:!1,traceSync(n,t,o,...a){return n.call(o,...a)}};function LE(){}function cZe(n,t){if(!t)return o;return function(...e){t.call(this,e,o,n)};function o(a,...e){if(typeof a=="object"){let i=a;a!==null&&(a.method&&a.headers&&a.socket?a=eZe(a):typeof a.setHeader=="function"&&(a=AZe(a)));let A;i===null&&e.length===0?A=[null]:(i=e.shift(),A=e),typeof this[wM]=="string"&&i!==void 0&&i!==null&&(i=this[wM]+i),this[Tce](a,Mce(i,A,this[Nce]),n)}else{let i=a===void 0?e.shift():a;typeof this[wM]=="string"&&i!==void 0&&i!==null&&(i=this[wM]+i),this[Tce](null,Mce(i,e,this[Nce]),n)}}}function gK(n){let t="",o=0,a=!1,e=255,i=n.length;if(i>100)return JSON.stringify(n);for(var A=0;A=32;A++)e=n.charCodeAt(A),(e===34||e===92)&&(t+=n.slice(o,A)+"\\",o=A,a=!0);return a?t+=n.slice(o):t=n,e<32?JSON.stringify(n):'"'+t+'"'}function IZe(n,t,o,a){if(OM.hasSubscribers===!1)return Rce.call(this,n,t,o,a);let e={instance:this,arguments};return OM.traceSync(Rce,e,this,n,t,o,a)}function Rce(n,t,o,a){let e=this[Gce],i=this[IK],A=this[Pce],r=this[rZe],s=this[kce],g=this[vce],c=this[Lce],I=this[aZe],p=this[oZe],B=this[tZe][o]+a;B=B+s;let f;c.log&&(n=c.log(n));let Q=A[Fce],y="";for(let T in n)if(f=n[T],Object.prototype.hasOwnProperty.call(n,T)&&f!==void 0){g[T]?f=g[T](f):T===p&&g.err&&(f=g.err(f));let _=A[T]||Q;switch(typeof f){case"undefined":case"function":continue;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":_&&(f=_(f));break;case"string":f=(_||gK)(f);break;default:f=(_||e)(f,i)}if(f===void 0)continue;let R=gK(T);y+=","+R+":"+f}let m="";if(t!==void 0){f=g[I]?g[I](t):t;let T=A[I]||Q;switch(typeof f){case"function":break;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":T&&(f=T(f)),m=',"'+I+'":'+f;break;case"string":f=(T||gK)(f),m=',"'+I+'":'+f;break;default:f=(T||e)(f,i),m=',"'+I+'":'+f}}return this[iZe]&&y?B+this[nZe]+y.slice(1)+"}"+m+r:B+y+m+r}function lZe(n,t){let o,a=n[kce],e=n[Gce],i=n[IK],A=n[Pce],r=A[Fce],s=n[vce],g=n[Lce].bindings;t=g(t);for(let c in t)if(o=t[c],((c.length<5||c!=="level"&&c!=="serializers"&&c!=="formatters"&&c!=="customLevels")&&t.hasOwnProperty(c)&&o!==void 0)===!0){if(o=s[c]?s[c](o):o,o=(A[c]||r||e)(o,i),o===void 0)continue;a+=',"'+c+'":'+o}return a}function pZe(n){return n.write!==n.constructor.prototype.write}function DM(n){let t=new cK(n);return t.on("error",o),!n.sync&&sZe&&(_ce.register(t,dZe),t.on("close",function(){_ce.unregister(t)})),t;function o(a){if(a.code==="EPIPE"){t.write=LE,t.end=LE,t.flushSync=LE,t.destroy=LE;return}t.removeListener("error",o),t.emit("error",a)}}function dZe(n,t){n.destroyed||(t==="beforeExit"?(n.flush(),n.on("drain",function(){n.end()})):n.flushSync())}function hZe(n){return function(o,a,e={},i){if(typeof e=="string")i=DM({dest:e}),e={};else if(typeof i=="string"){if(e&&e.transport)throw Error("only one of option.transport or stream can be specified");i=DM({dest:i})}else if(e instanceof cK||e.writable||e._writableState)i=e,e={};else if(e.transport){if(e.transport instanceof cK||e.transport.writable||e.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(e.transport.targets&&e.transport.targets.length&&e.formatters&&typeof e.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let s;e.customLevels&&(s=e.useOnlyCustomLevels?e.customLevels:Object.assign({},e.levels,e.customLevels)),i=gZe({caller:a,...e.transport,levels:s})}if(e=Object.assign({},n,e),e.serializers=Object.assign({},n.serializers,e.serializers),e.formatters=Object.assign({},n.formatters,e.formatters),e.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:A,onChild:r}=e;return A===!1&&(e.level="silent"),r||(e.onChild=LE),i||(pZe(process.stdout)?i=process.stdout:i=DM({fd:process.stdout.fd||1})),{opts:e,stream:i}}}function EZe(n,t){try{return JSON.stringify(n)}catch{try{return(t||this[IK])(n)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function uZe(n,t,o){return{level:n,bindings:t,log:o}}function CZe(n){let t=Number(n);return typeof n=="string"&&Number.isFinite(t)?t:n===void 0?1:n}Uce.exports={noop:LE,buildSafeSonicBoom:DM,asChindings:lZe,asJson:IZe,genLog:cZe,createArgsNormalizer:hZe,stringify:EZe,buildFormatters:uZe,normalizeDestFileDescriptor:CZe}});var MM=ee((OFA,Hce)=>{var BZe={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},fZe={ASC:"ASC",DESC:"DESC"};Hce.exports={DEFAULT_LEVELS:BZe,SORTING_ORDER:fZe}});var dK=ee((bFA,jce)=>{"use strict";var{lsCacheSym:QZe,levelValSym:lK,useOnlyCustomLevelsSym:yZe,streamSym:mZe,formattersSym:SZe,hooksSym:wZe,levelCompSym:Kce}=PE(),{noop:DZe,genLog:Sp}=bM(),{DEFAULT_LEVELS:sg,SORTING_ORDER:xce}=MM(),Yce={fatal:n=>{let t=Sp(sg.fatal,n);return function(...o){let a=this[mZe];if(t.call(this,...o),typeof a.flushSync=="function")try{a.flushSync()}catch{}}},error:n=>Sp(sg.error,n),warn:n=>Sp(sg.warn,n),info:n=>Sp(sg.info,n),debug:n=>Sp(sg.debug,n),trace:n=>Sp(sg.trace,n)},pK=Object.keys(sg).reduce((n,t)=>(n[sg[t]]=t,n),{}),OZe=Object.keys(pK).reduce((n,t)=>(n[t]='{"level":'+Number(t),n),{});function bZe(n){let t=n[SZe].level,{labels:o}=n.levels,a={};for(let e in o){let i=t(o[e],Number(e));a[e]=JSON.stringify(i).slice(0,-1)}return n[QZe]=a,n}function MZe(n,t){if(t)return!1;switch(n){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function _Ze(n){let{labels:t,values:o}=this.levels;if(typeof n=="number"){if(t[n]===void 0)throw Error("unknown level value"+n);n=t[n]}if(o[n]===void 0)throw Error("unknown level "+n);let a=this[lK],e=this[lK]=o[n],i=this[yZe],A=this[Kce],r=this[wZe].logMethod;for(let s in o){if(A(o[s],e)===!1){this[s]=DZe;continue}this[s]=MZe(s,i)?Yce[s](r):Sp(o[s],r)}this.emit("level-change",n,e,t[a],a,this)}function TZe(n){let{levels:t,levelVal:o}=this;return t&&t.labels?t.labels[o]:""}function NZe(n){let{values:t}=this.levels,o=t[n];return o!==void 0&&this[Kce](o,this[lK])}function RZe(n,t,o){return n===xce.DESC?t<=o:t>=o}function kZe(n){return typeof n=="string"?RZe.bind(null,n):n}function vZe(n=null,t=!1){let o=n?Object.keys(n).reduce((i,A)=>(i[n[A]]=A,i),{}):null,a=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:pK,o),e=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:sg,n);return{labels:a,values:e}}function PZe(n,t,o){if(typeof n=="number"){if(![].concat(Object.keys(t||{}).map(i=>t[i]),o?[]:Object.keys(pK).map(i=>+i),1/0).includes(n))throw Error(`default level:${n} must be included in custom levels`);return}let a=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),o?null:sg,t);if(!(n in a))throw Error(`default level:${n} must be included in custom levels`)}function GZe(n,t){let{labels:o,values:a}=n;for(let e in t){if(e in a)throw Error("levels cannot be overridden");if(t[e]in o)throw Error("pre-existing level values cannot be used for new levels")}}function FZe(n){if(typeof n!="function"&&!(typeof n=="string"&&Object.values(xce).includes(n)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}jce.exports={initialLsCache:OZe,genLsCache:bZe,levelMethods:Yce,getLevel:TZe,setLevel:_Ze,isLevelEnabled:NZe,mappings:vZe,assertNoLevelCollisions:GZe,assertDefaultLevelFound:PZe,genLevelComparison:kZe,assertLevelComparison:FZe}});var hK=ee((MFA,Jce)=>{"use strict";Jce.exports={version:"9.14.0"}});var eIe=ee((TFA,$ce)=>{"use strict";var{EventEmitter:LZe}=$e("node:events"),{lsCacheSym:UZe,levelValSym:HZe,setLevelSym:TM,getLevelSym:qce,chindingsSym:NM,parsedChindingsSym:KZe,mixinSym:xZe,asJsonSym:Vce,writeSym:YZe,mixinMergeStrategySym:jZe,timeSym:JZe,timeSliceIndexSym:qZe,streamSym:Wce,serializersSym:wp,formattersSym:nQ,errorKeySym:zZe,messageKeySym:VZe,useOnlyCustomLevelsSym:WZe,needsMetadataGsym:ZZe,redactFmtSym:XZe,stringifySym:$Ze,formatOptsSym:e9e,stringifiersSym:A9e,msgPrefixSym:uK,hooksSym:t9e}=PE(),{getLevel:r9e,setLevel:i9e,isLevelEnabled:a9e,mappings:o9e,initialLsCache:n9e,genLsCache:s9e,assertNoLevelCollisions:g9e}=dK(),{asChindings:CK,asJson:c9e,buildFormatters:EK,stringify:zce,noop:Zce}=bM(),{version:I9e}=hK(),l9e=zH(),p9e=class{},Xce={constructor:p9e,child:d9e,bindings:h9e,setBindings:E9e,flush:B9e,isLevelEnabled:a9e,version:I9e,get level(){return this[qce]()},set level(n){this[TM](n)},get levelVal(){return this[HZe]},set levelVal(n){throw Error("levelVal is read-only")},get msgPrefix(){return this[uK]},get[Symbol.toStringTag](){return"Pino"},[UZe]:n9e,[YZe]:C9e,[Vce]:c9e,[qce]:r9e,[TM]:i9e};Object.setPrototypeOf(Xce,LZe.prototype);$ce.exports=function(){return Object.create(Xce)};var _M=n=>n;function d9e(n,t){if(!n)throw Error("missing bindings for child Pino");let o=this[wp],a=this[nQ],e=Object.create(this);if(t==null)return e[nQ].bindings!==_M&&(e[nQ]=EK(a.level,_M,a.log)),e[NM]=CK(e,n),e[TM](this.level),this.onChild!==Zce&&this.onChild(e),e;if(t.hasOwnProperty("serializers")===!0){e[wp]=Object.create(null);for(let c in o)e[wp][c]=o[c];let s=Object.getOwnPropertySymbols(o);for(var i=0;i{"use strict";var{hasOwnProperty:sQ}=Object.prototype,Op=QK();Op.configure=QK;Op.stringify=Op;Op.default=Op;yK.stringify=Op;yK.configure=QK;rIe.exports=Op;var f9e=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function kI(n){return n.length<5e3&&!f9e.test(n)?`"${n}"`:JSON.stringify(n)}function BK(n,t){if(n.length>200||t)return n.sort(t);for(let o=1;oa;)n[e]=n[e-1],e--;n[e]=a}return n}var Q9e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function fK(n){return Q9e.call(n)!==void 0&&n.length!==0}function AIe(n,t,o){n.length= 1`)}return o===void 0?1/0:o}function Dp(n){return n===1?"1 item":`${n} items`}function w9e(n){let t=new Set;for(let o of n)(typeof o=="string"||typeof o=="number")&&t.add(String(o));return t}function D9e(n){if(sQ.call(n,"strict")){let t=n.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return o=>{let a=`Object can not safely be stringified. Received type ${typeof o}`;throw typeof o!="function"&&(a+=` (${o.toString()})`),new Error(a)}}}function QK(n){n={...n};let t=D9e(n);t&&(n.bigint===void 0&&(n.bigint=!1),"circularValue"in n||(n.circularValue=Error));let o=y9e(n),a=S9e(n,"bigint"),e=m9e(n),i=typeof e=="function"?e:void 0,A=tIe(n,"maximumDepth"),r=tIe(n,"maximumBreadth");function s(B,f,Q,y,m,T){let _=f[B];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(B)),_=y.call(f,B,_),typeof _){case"string":return kI(_);case"object":{if(_===null)return"null";if(Q.indexOf(_)!==-1)return o;let R="",L=",",U=T;if(Array.isArray(_)){if(_.length===0)return"[]";if(Ayge(n,new Set),mge=(n,t,o)=>{if(!aQ(n))return"";let a=o?"":n.message||"";if(t.has(n))return a+": ...";let e=vH(n);if(e){t.add(n);let i=typeof n.cause=="function";return a+(i?"":": ")+mge(e,t,i)}else return a},YWe=n=>mge(n,new Set);Sge.exports={isErrorLike:aQ,getErrorCause:vH,stackWithCauses:xWe,messageWithCauses:YWe}});var GH=ee((gFA,Dge)=>{"use strict";var jWe=Symbol("circular-ref-tag"),lM=Symbol("pino-raw-err-ref"),wge=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[lM]},set:function(n){this[lM]=n}}});Object.defineProperty(wge,lM,{writable:!0,value:{}});Dge.exports={pinoErrProto:wge,pinoErrorSymbols:{seen:jWe,rawSymbol:lM}}});var Mge=ee((cFA,bge)=>{"use strict";bge.exports=LH;var{messageWithCauses:JWe,stackWithCauses:qWe,isErrorLike:Oge}=PH(),{pinoErrProto:zWe,pinoErrorSymbols:VWe}=GH(),{seen:FH}=VWe,{toString:WWe}=Object.prototype;function LH(n){if(!Oge(n))return n;n[FH]=void 0;let t=Object.create(zWe);t.type=WWe.call(n.constructor)==="[object Function]"?n.constructor.name:n.name,t.message=JWe(n),t.stack=qWe(n),Array.isArray(n.errors)&&(t.aggregateErrors=n.errors.map(o=>LH(o)));for(let o in n)if(t[o]===void 0){let a=n[o];Oge(a)?o!=="cause"&&!Object.prototype.hasOwnProperty.call(a,FH)&&(t[o]=LH(a)):t[o]=a}return delete n[FH],t.raw=n,t}});var Tge=ee((IFA,_ge)=>{"use strict";_ge.exports=dM;var{isErrorLike:UH}=PH(),{pinoErrProto:ZWe,pinoErrorSymbols:XWe}=GH(),{seen:pM}=XWe,{toString:$We}=Object.prototype;function dM(n){if(!UH(n))return n;n[pM]=void 0;let t=Object.create(ZWe);t.type=$We.call(n.constructor)==="[object Function]"?n.constructor.name:n.name,t.message=n.message,t.stack=n.stack,Array.isArray(n.errors)&&(t.aggregateErrors=n.errors.map(o=>dM(o))),UH(n.cause)&&!Object.prototype.hasOwnProperty.call(n.cause,pM)&&(t.cause=dM(n.cause));for(let o in n)if(t[o]===void 0){let a=n[o];UH(a)?Object.prototype.hasOwnProperty.call(a,pM)||(t[o]=dM(a)):t[o]=a}return delete n[pM],t.raw=n,t}});var vge=ee((lFA,kge)=>{"use strict";kge.exports={mapHttpRequest:e6e,reqSerializer:Rge};var HH=Symbol("pino-raw-req-ref"),Nge=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[HH]},set:function(n){this[HH]=n}}});Object.defineProperty(Nge,HH,{writable:!0,value:{}});function Rge(n){let t=n.info||n.socket,o=Object.create(Nge);if(o.id=typeof n.id=="function"?n.id():n.id||(n.info?n.info.id:void 0),o.method=n.method,n.originalUrl)o.url=n.originalUrl;else{let a=n.path;o.url=typeof a=="string"?a:n.url?n.url.path||n.url:void 0}return n.query&&(o.query=n.query),n.params&&(o.params=n.params),o.headers=n.headers,o.remoteAddress=t&&t.remoteAddress,o.remotePort=t&&t.remotePort,o.raw=n.raw||n,o}function e6e(n){return{req:Rge(n)}}});var Lge=ee((pFA,Fge)=>{"use strict";Fge.exports={mapHttpResponse:A6e,resSerializer:Gge};var KH=Symbol("pino-raw-res-ref"),Pge=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[KH]},set:function(n){this[KH]=n}}});Object.defineProperty(Pge,KH,{writable:!0,value:{}});function Gge(n){let t=Object.create(Pge);return t.statusCode=n.headersSent?n.statusCode:null,t.headers=n.getHeaders?n.getHeaders():n._headers,t.raw=n,t}function A6e(n){return{res:Gge(n)}}});var YH=ee((dFA,Uge)=>{"use strict";var xH=Mge(),t6e=Tge(),hM=vge(),EM=Lge();Uge.exports={err:xH,errWithCause:t6e,mapHttpRequest:hM.mapHttpRequest,mapHttpResponse:EM.mapHttpResponse,req:hM.reqSerializer,res:EM.resSerializer,wrapErrorSerializer:function(t){return t===xH?t:function(a){return t(xH(a))}},wrapRequestSerializer:function(t){return t===hM.reqSerializer?t:function(a){return t(hM.reqSerializer(a))}},wrapResponseSerializer:function(t){return t===EM.resSerializer?t:function(a){return t(EM.resSerializer(a))}}}});var jH=ee((hFA,Hge)=>{"use strict";function r6e(n,t){return t}Hge.exports=function(){let t=Error.prepareStackTrace;Error.prepareStackTrace=r6e;let o=new Error().stack;if(Error.prepareStackTrace=t,!Array.isArray(o))return;let a=o.slice(2),e=[];for(let i of a)i&&e.push(i.getFileName());return e}});var qge=ee((EFA,Jge)=>{"use strict";function JH(n){if(n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(n instanceof Array){let t=[];for(let o=0;o{let Q=[...s.slice(0,I),...f];return o(B,Q)}:o,e,i);else if(i)Yge(c,r);else{let p=typeof o=="function"?o(a6e(c,r),[...s.slice(0,I),...r]):o;xge(c,r,p)}}if(A.length===0)g(n,0);else{let c=n;for(let I=0;I0)o?i===a&&(o=!1,a=""):(o=!0,a=i);else if(i==="["&&!o)t++;else if(i==="]"&&!o&&(t--,t<0))throw new Error(`Invalid redaction path (${n})`)}if(t!==0)throw new Error(`Invalid redaction path (${n})`)}function I6e(n){if(!Array.isArray(n))throw new TypeError("paths must be an array");for(let t of n)c6e(t)}function l6e(n={}){let{paths:t=[],censor:o="[REDACTED]",serialize:a=JSON.stringify,strict:e=!0,remove:i=!1}=n;I6e(t);let A=s6e(t);return function(s){if(e&&(s===null||typeof s!="object")&&(s==null||typeof s!="object"))return a?a(s):s;let g=g6e(s,A),c=s,I=o;return typeof o=="function"&&(I=o),o6e(g,t,I,i),a===!1?(g.restore=function(){return JH(c)},g):typeof a=="function"?a(g):JSON.stringify(g)}}Jge.exports=l6e});var PE=ee((uFA,zge)=>{"use strict";var p6e=Symbol("pino.setLevel"),d6e=Symbol("pino.getLevel"),h6e=Symbol("pino.levelVal"),E6e=Symbol("pino.levelComp"),u6e=Symbol("pino.useLevelLabels"),C6e=Symbol("pino.useOnlyCustomLevels"),B6e=Symbol("pino.mixin"),f6e=Symbol("pino.lsCache"),Q6e=Symbol("pino.chindings"),y6e=Symbol("pino.asJson"),m6e=Symbol("pino.write"),S6e=Symbol("pino.redactFmt"),w6e=Symbol("pino.time"),D6e=Symbol("pino.timeSliceIndex"),O6e=Symbol("pino.stream"),b6e=Symbol("pino.stringify"),M6e=Symbol("pino.stringifySafe"),_6e=Symbol("pino.stringifiers"),T6e=Symbol("pino.end"),N6e=Symbol("pino.formatOpts"),R6e=Symbol("pino.messageKey"),k6e=Symbol("pino.errorKey"),v6e=Symbol("pino.nestedKey"),P6e=Symbol("pino.nestedKeyStr"),G6e=Symbol("pino.mixinMergeStrategy"),F6e=Symbol("pino.msgPrefix"),L6e=Symbol("pino.wildcardFirst"),U6e=Symbol.for("pino.serializers"),H6e=Symbol.for("pino.formatters"),K6e=Symbol.for("pino.hooks"),x6e=Symbol.for("pino.metadata");zge.exports={setLevelSym:p6e,getLevelSym:d6e,levelValSym:h6e,levelCompSym:E6e,useLevelLabelsSym:u6e,mixinSym:B6e,lsCacheSym:f6e,chindingsSym:Q6e,asJsonSym:y6e,writeSym:m6e,serializersSym:U6e,redactFmtSym:S6e,timeSym:w6e,timeSliceIndexSym:D6e,streamSym:O6e,stringifySym:b6e,stringifySafeSym:M6e,stringifiersSym:_6e,endSym:T6e,formatOptsSym:N6e,messageKeySym:R6e,errorKeySym:k6e,nestedKeySym:v6e,wildcardFirstSym:L6e,needsMetadataGsym:x6e,useOnlyCustomLevelsSym:C6e,formattersSym:H6e,hooksSym:K6e,nestedKeyStrSym:P6e,mixinMergeStrategySym:G6e,msgPrefixSym:F6e}});var zH=ee((CFA,Xge)=>{"use strict";var Vge=qge(),{redactFmtSym:Y6e,wildcardFirstSym:CM}=PE(),qH=/[^.[\]]+|\[([^[\]]*?)\]/g,Wge="[Redacted]",Zge=!1;function j6e(n,t){let{paths:o,censor:a,remove:e}=J6e(n),i=o.reduce((s,g)=>{qH.lastIndex=0;let c=qH.exec(g),I=qH.exec(g),p=c[1]!==void 0?c[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):c[0];if(p==="*"&&(p=CM),I===null)return s[p]=null,s;if(s[p]===null)return s;let{index:B}=I,f=`${g.substr(B,g.length-1)}`;return s[p]=s[p]||[],p!==CM&&s[p].length===0&&s[p].push(...s[CM]||[]),p===CM&&Object.keys(s).forEach(function(Q){s[Q]&&s[Q].push(f)}),s[p].push(f),s},{}),A={[Y6e]:Vge({paths:o,censor:a,serialize:t,strict:Zge,remove:e})},r=(...s)=>t(typeof a=="function"?a(...s):a);return[...Object.keys(i),...Object.getOwnPropertySymbols(i)].reduce((s,g)=>{if(i[g]===null)s[g]=c=>r(c,[g]);else{let c=typeof a=="function"?(I,p)=>a(I,[g,...p]):a;s[g]=Vge({paths:i[g],censor:c,serialize:t,strict:Zge,remove:e})}return s},A)}function J6e(n){if(Array.isArray(n))return n={paths:n,censor:Wge},n;let{paths:t,censor:o=Wge,remove:a}=n;if(Array.isArray(t)===!1)throw Error("pino \u2013 redact must contain an array of strings");return a===!0&&(o=void 0),{paths:t,censor:o,remove:a}}Xge.exports=j6e});var Ace=ee((BFA,ece)=>{"use strict";var q6e=()=>"",z6e=()=>`,"time":${Date.now()}`,V6e=()=>`,"time":${Math.round(Date.now()/1e3)}`,W6e=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,Z6e=1000000n,$ge=1000000000n,X6e=BigInt(Date.now())*Z6e,$6e=process.hrtime.bigint(),e5e=()=>{let n=process.hrtime.bigint()-$6e,t=X6e+n,o=t/$ge,a=t%$ge,e=Number(o*1000n+a/1000000n),i=new Date(e),A=i.getUTCFullYear(),r=(i.getUTCMonth()+1).toString().padStart(2,"0"),s=i.getUTCDate().toString().padStart(2,"0"),g=i.getUTCHours().toString().padStart(2,"0"),c=i.getUTCMinutes().toString().padStart(2,"0"),I=i.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${A}-${r}-${s}T${g}:${c}:${I}.${a.toString().padStart(9,"0")}Z"`};ece.exports={nullTime:q6e,epochTime:z6e,unixTime:V6e,isoTime:W6e,isoTimeNano:e5e}});var rce=ee((fFA,tce)=>{"use strict";function A5e(n){try{return JSON.stringify(n)}catch{return'"[Circular]"'}}tce.exports=t5e;function t5e(n,t,o){var a=o&&o.stringify||A5e,e=1;if(typeof n=="object"&&n!==null){var i=t.length+e;if(i===1)return n;var A=new Array(i);A[0]=a(n);for(var r=1;r-1?I:0,n.charCodeAt(B+1)){case 100:case 102:if(c>=s||t[c]==null)break;I=s||t[c]==null)break;I=s||t[c]===void 0)break;I",I=B+2,B++;break}g+=a(t[c]),I=B+2,B++;break;case 115:if(c>=s)break;I{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let t=function(o){if((o>0&&o<1/0)===!1)throw typeof o!="number"&&typeof o!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(n,0,0,Number(o))},n=new Int32Array(new SharedArrayBuffer(4));VH.exports=t}else{let n=function(t){if((t>0&&t<1/0)===!1)throw typeof t!="number"&&typeof t!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let a=Date.now()+Number(t);for(;a>Date.now(););};VH.exports=n}});var Ice=ee((yFA,cce)=>{"use strict";var $t=$e("fs"),r5e=$e("events"),i5e=$e("util").inherits,ice=$e("path"),XH=WH(),a5e=$e("assert"),BM=100,fM=Buffer.allocUnsafe(0),o5e=16*1024,ace="buffer",oce="utf8",[n5e,s5e]=(process.versions.node||"0.0").split(".").map(Number),g5e=n5e>=22&&s5e>=7;function nce(n,t){t._opening=!0,t._writing=!0,t._asyncDrainScheduled=!1;function o(i,A){if(i){t._reopening=!1,t._writing=!1,t._opening=!1,t.sync?process.nextTick(()=>{t.listenerCount("error")>0&&t.emit("error",i)}):t.emit("error",i);return}let r=t._reopening;t.fd=A,t.file=n,t._reopening=!1,t._opening=!1,t._writing=!1,t.sync?process.nextTick(()=>t.emit("ready")):t.emit("ready"),!t.destroyed&&(!t._writing&&t._len>t.minLength||t._flushPending?t._actualWrite():r&&process.nextTick(()=>t.emit("drain")))}let a=t.append?"a":"w",e=t.mode;if(t.sync)try{t.mkdir&&$t.mkdirSync(ice.dirname(n),{recursive:!0});let i=$t.openSync(n,a,e);o(null,i)}catch(i){throw o(i),i}else t.mkdir?$t.mkdir(ice.dirname(n),{recursive:!0},i=>{if(i)return o(i);$t.open(n,a,e,o)}):$t.open(n,a,e,o)}function As(n){if(!(this instanceof As))return new As(n);let{fd:t,dest:o,minLength:a,maxLength:e,maxWrite:i,periodicFlush:A,sync:r,append:s=!0,mkdir:g,retryEAGAIN:c,fsync:I,contentMode:p,mode:B}=n||{};t=t||o,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(a||0,16387),this.file=null,this.destroyed=!1,this.minLength=a||0,this.maxLength=e||0,this.maxWrite=i||o5e,this._periodicFlush=A||0,this._periodicFlushTimer=void 0,this.sync=r||!1,this.writable=!0,this._fsync=I||!1,this.append=s||!1,this.mode=B,this.retryEAGAIN=c||(()=>!0),this.mkdir=g||!1;let f,Q;if(p===ace)this._writingBuf=fM,this.write=l5e,this.flush=d5e,this.flushSync=E5e,this._actualWrite=C5e,f=()=>$t.writeSync(this.fd,this._writingBuf),Q=()=>$t.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===oce)this._writingBuf="",this.write=I5e,this.flush=p5e,this.flushSync=h5e,this._actualWrite=u5e,f=()=>Buffer.isBuffer(this._writingBuf)?$t.writeSync(this.fd,this._writingBuf):$t.writeSync(this.fd,this._writingBuf,"utf8"),Q=()=>Buffer.isBuffer(this._writingBuf)?$t.write(this.fd,this._writingBuf,this.release):$t.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${oce}" and "${ace}", but passed ${p}`);if(typeof t=="number")this.fd=t,process.nextTick(()=>this.emit("ready"));else if(typeof t=="string")nce(t,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(y,m)=>{if(y){if((y.code==="EAGAIN"||y.code==="EBUSY")&&this.retryEAGAIN(y,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{XH(BM),this.release(void 0,0)}catch(R){this.release(R)}else setTimeout(Q,BM);else this._writing=!1,this.emit("error",y);return}this.emit("write",m);let T=ZH(this._writingBuf,this._len,m);if(this._len=T.len,this._writingBuf=T.writingBuf,this._writingBuf.length){if(!this.sync){Q();return}try{do{let R=f(),L=ZH(this._writingBuf,this._len,R);this._len=L.len,this._writingBuf=L.writingBuf}while(this._writingBuf.length)}catch(R){this.release(R);return}}this._fsync&&$t.fsyncSync(this.fd);let _=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):_>this.minLength?this._actualWrite():this._ending?_>0?this._actualWrite():(this._writing=!1,QM(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(c5e,this)):this.emit("drain"))},this.on("newListener",function(y){y==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function ZH(n,t,o){return typeof n=="string"&&(n=Buffer.from(n)),t=Math.max(t-o,0),n=n.subarray(o),{writingBuf:n,len:t}}function c5e(n){n.listenerCount("drain")>0&&(n._asyncDrainScheduled=!1,n.emit("drain"))}i5e(As,r5e);function sce(n,t){return n.length===0?fM:n.length===1?n[0]:Buffer.concat(n,t)}function I5e(n){if(this.destroyed)throw new Error("SonicBoom destroyed");n=""+n;let t=Buffer.byteLength(n),o=this._len+t,a=this._bufs;return this.maxLength&&o>this.maxLength?(this.emit("drop",n),this._lenthis.maxWrite?a.push(n):a[a.length-1]+=n,this._len=o,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._lenthis.maxLength?(this.emit("drop",n),this._lenthis.maxWrite?(o.push([n]),a.push(n.length)):(o[o.length-1].push(n),a[a.length-1]+=n.length),this._len=t,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len{if(this._fsync)this._flushPending=!1,n();else try{$t.fsync(this.fd,a=>{this._flushPending=!1,n(a)})}catch(a){n(a)}this.off("error",o)},o=a=>{this._flushPending=!1,n(a),this.off("drain",t)};this.once("drain",t),this.once("error",o)}function p5e(n){if(n!=null&&typeof n!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(n){n(t);return}throw t}if(this.minLength<=0){n?.();return}n&&gce.call(this,n),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function d5e(n){if(n!=null&&typeof n!="function")throw new Error("flush cb must be a function");if(this.destroyed){let t=new Error("SonicBoom destroyed");if(n){n(t);return}throw t}if(this.minLength<=0){n?.();return}n&&gce.call(this,n),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}As.prototype.reopen=function(n){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(n)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(n&&(this.file=n),this._reopening=!0,this._writing)return;let t=this.fd;this.once("ready",()=>{t!==this.fd&&$t.close(t,o=>{if(o)return this.emit("error",o)})}),nce(this.file,this)};As.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():QM(this)))};function h5e(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let n="";for(;this._bufs.length||n.length;){n.length<=0&&(n=this._bufs[0]);try{let t=Buffer.isBuffer(n)?$t.writeSync(this.fd,n):$t.writeSync(this.fd,n,"utf8"),o=ZH(n,this._len,t);n=o.writingBuf,this._len=o.len,n.length<=0&&this._bufs.shift()}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,n.length,this._len-n.length))throw t;XH(BM)}}try{$t.fsyncSync(this.fd)}catch{}}function E5e(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=fM);let n=fM;for(;this._bufs.length||n.length;){n.length<=0&&(n=sce(this._bufs[0],this._lens[0]));try{let t=$t.writeSync(this.fd,n);n=n.subarray(t),this._len=Math.max(this._len-t,0),n.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(t){if((t.code==="EAGAIN"||t.code==="EBUSY")&&!this.retryEAGAIN(t,n.length,this._len-n.length))throw t;XH(BM)}}}As.prototype.destroy=function(){this.destroyed||QM(this)};function u5e(){let n=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let t=Buffer.isBuffer(this._writingBuf)?$t.writeSync(this.fd,this._writingBuf):$t.writeSync(this.fd,this._writingBuf,"utf8");n(null,t)}catch(t){n(t)}else $t.write(this.fd,this._writingBuf,n)}function C5e(){let n=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:sce(this._bufs.shift(),this._lens.shift()),this.sync)try{let t=$t.writeSync(this.fd,this._writingBuf);n(null,t)}catch(t){n(t)}else g5e&&(this._writingBuf=Buffer.from(this._writingBuf)),$t.write(this.fd,this._writingBuf,n)}function QM(n){if(n.fd===-1){n.once("ready",QM.bind(null,n));return}n._periodicFlushTimer!==void 0&&clearInterval(n._periodicFlushTimer),n.destroyed=!0,n._bufs=[],n._lens=[],a5e(typeof n.fd=="number",`sonic.fd must be a number, got ${typeof n.fd}`);try{$t.fsync(n.fd,t)}catch{}function t(){n.fd!==1&&n.fd!==2?$t.close(n.fd,o):o()}function o(a){if(a){n.emit("error",a);return}n._ending&&!n._writing&&n.emit("finish"),n.emit("close")}}As.SonicBoom=As;As.default=As;cce.exports=As});var $H=ee((mFA,Ece)=>{"use strict";var ts={exit:[],beforeExit:[]},lce={exit:Q5e,beforeExit:y5e},GE;function B5e(){GE===void 0&&(GE=new FinalizationRegistry(m5e))}function f5e(n){ts[n].length>0||process.on(n,lce[n])}function pce(n){ts[n].length>0||(process.removeListener(n,lce[n]),ts.exit.length===0&&ts.beforeExit.length===0&&(GE=void 0))}function Q5e(){dce("exit")}function y5e(){dce("beforeExit")}function dce(n){for(let t of ts[n]){let o=t.deref(),a=t.fn;o!==void 0&&a(o,n)}ts[n]=[]}function m5e(n){for(let t of["exit","beforeExit"]){let o=ts[t].indexOf(n);ts[t].splice(o,o+1),pce(t)}}function hce(n,t,o){if(t===void 0)throw new Error("the object can't be undefined");f5e(n);let a=new WeakRef(t);a.fn=o,B5e(),GE.register(t,a),ts[n].push(a)}function S5e(n,t){hce("exit",n,t)}function w5e(n,t){hce("beforeExit",n,t)}function D5e(n){if(GE!==void 0){GE.unregister(n);for(let t of["exit","beforeExit"])ts[t]=ts[t].filter(o=>{let a=o.deref();return a&&a!==n}),pce(t)}}Ece.exports={register:S5e,registerBeforeExit:w5e,unregister:D5e}});var uce=ee((SFA,O5e)=>{O5e.exports={name:"thread-stream",version:"3.2.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0","@yao-pkg/pkg":"^5.11.5",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^9.0.6","pino-elasticsearch":"^8.0.0","sonic-boom":"^4.0.1",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^5.3.2","why-is-node-running":"^2.2.2"},scripts:{build:"tsc --noEmit",test:'standard && npm run build && npm run transpile && tap "test/**/*.test.*js" && tap --ts test/*.test.*ts',"test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --timeout=120 --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*","test/syntax-error.mjs"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina ",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var Bce=ee((wFA,Cce)=>{"use strict";function b5e(n,t,o,a,e){let i=Date.now()+a,A=Atomics.load(n,t);if(A===o){e(null,"ok");return}let r=A,s=g=>{Date.now()>i?e(null,"timed-out"):setTimeout(()=>{r=A,A=Atomics.load(n,t),A===r?s(g>=1e3?1e3:g*2):A===o?e(null,"ok"):e(null,"not-equal")},g)};s(1)}function M5e(n,t,o,a,e){let i=Date.now()+a,A=Atomics.load(n,t);if(A!==o){e(null,"ok");return}let r=s=>{Date.now()>i?e(null,"timed-out"):setTimeout(()=>{A=Atomics.load(n,t),A!==o?e(null,"ok"):r(s>=1e3?1e3:s*2)},s)};r(1)}Cce.exports={wait:b5e,waitDiff:M5e}});var Qce=ee((DFA,fce)=>{"use strict";fce.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}});var Dce=ee((OFA,wce)=>{"use strict";var{version:_5e}=uce(),{EventEmitter:T5e}=$e("events"),{Worker:N5e}=$e("worker_threads"),{join:R5e}=$e("path"),{pathToFileURL:k5e}=$e("url"),{wait:v5e}=Bce(),{WRITE_INDEX:dn,READ_INDEX:to,SEQ_INDEX:eK}=Qce(),P5e=$e("buffer"),G5e=$e("assert"),Te=Symbol("kImpl"),F5e=P5e.constants.MAX_STRING_LENGTH;function FE(n,t){Atomics.add(n[Te].state,eK,1),t(),Atomics.add(n[Te].state,eK,1),Atomics.notify(n[Te].state,eK)}var oQ=class{constructor(t){this._value=t}deref(){return this._value}},mM=class{register(){}unregister(){}},L5e=process.env.NODE_V8_COVERAGE?mM:global.FinalizationRegistry||mM,U5e=process.env.NODE_V8_COVERAGE?oQ:global.WeakRef||oQ,yce=new L5e(n=>{n.exited||n.terminate()});function H5e(n,t){let{filename:o,workerData:a}=t,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||R5e(__dirname,"lib","worker.js"),A=new N5e(i,{...t.workerOpts,trackUnmanagedFds:!1,workerData:{filename:o.indexOf("file://")===0?o:k5e(o).href,dataBuf:n[Te].dataBuf,stateBuf:n[Te].stateBuf,workerData:{$context:{threadStreamVersion:_5e},...a}}});return A.stream=new oQ(n),A.on("message",K5e),A.on("exit",Sce),yce.register(n,A),A}function mce(n){G5e(!n[Te].sync),n[Te].needDrain&&(n[Te].needDrain=!1,n.emit("drain"))}function yM(n){let t=Atomics.load(n[Te].state,dn),o=n[Te].data.length-t;if(o>0){if(n[Te].buf.length===0){n[Te].flushing=!1,n[Te].ending?aK(n):n[Te].needDrain&&process.nextTick(mce,n);return}let a=n[Te].buf.slice(0,o),e=Buffer.byteLength(a);e<=o?(n[Te].buf=n[Te].buf.slice(o),SM(n,a,yM.bind(null,n))):n.flush(()=>{if(!n.destroyed){for(FE(n,()=>{Atomics.store(n[Te].state,to,0),Atomics.store(n[Te].state,dn,0)}),Atomics.notify(n[Te].state,to);e>n[Te].data.length;)o=o/2,a=n[Te].buf.slice(0,o),e=Buffer.byteLength(a);n[Te].buf=n[Te].buf.slice(o),SM(n,a,yM.bind(null,n))}})}else if(o===0){if(t===0&&n[Te].buf.length===0)return;n.flush(()=>{FE(n,()=>{Atomics.store(n[Te].state,to,0),Atomics.store(n[Te].state,dn,0)}),Atomics.notify(n[Te].state,to),yM(n)})}else ng(n,new Error("overwritten"))}function K5e(n){let t=this.stream.deref();if(t===void 0){this.exited=!0,this.terminate();return}if(n?.code!=null)switch(n.code){case"READY":this.stream=new U5e(t),t.flush(()=>{t[Te].ready=!0,t.emit("ready")});break;case"ERROR":ng(t,n.err);break;case"EVENT":Array.isArray(n.args)?t.emit(n.name,...n.args):t.emit(n.name,n.args);break;case"WARNING":process.emitWarning(n.err);break;default:ng(t,new Error("this should not happen: "+n.code))}}function Sce(n){let t=this.stream.deref();t!==void 0&&(yce.unregister(t),t.worker.exited=!0,t.worker.off("exit",Sce),ng(t,n!==0?new Error("the worker thread exited"):null))}var tK=class extends T5e{constructor(t={}){if(super(),t.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[Te]={},this[Te].stateBuf=new SharedArrayBuffer(128),this[Te].state=new Int32Array(this[Te].stateBuf),this[Te].dataBuf=new SharedArrayBuffer(t.bufferSize||4*1024*1024),this[Te].data=Buffer.from(this[Te].dataBuf),this[Te].sync=t.sync||!1,this[Te].ending=!1,this[Te].ended=!1,this[Te].needDrain=!1,this[Te].destroyed=!1,this[Te].flushing=!1,this[Te].ready=!1,this[Te].finished=!1,this[Te].errored=null,this[Te].closed=!1,this[Te].buf="",this.worker=H5e(this,t),this.on("message",(o,a)=>{this.worker.postMessage(o,a)})}write(t){if(this[Te].destroyed)return rK(this,new Error("the worker has exited")),!1;if(this[Te].ending)return rK(this,new Error("the worker is ending")),!1;if(this[Te].flushing&&this[Te].buf.length+t.length>=F5e)try{AK(this),this[Te].flushing=!0}catch(o){return ng(this,o),!1}if(this[Te].buf+=t,this[Te].sync)try{return AK(this),!0}catch(o){return ng(this,o),!1}return this[Te].flushing||(this[Te].flushing=!0,setImmediate(yM,this)),this[Te].needDrain=this[Te].data.length-this[Te].buf.length-Atomics.load(this[Te].state,dn)<=0,!this[Te].needDrain}end(){this[Te].destroyed||(this[Te].ending=!0,aK(this))}flush(t){if(this[Te].destroyed){typeof t=="function"&&process.nextTick(t,new Error("the worker has exited"));return}let o=Atomics.load(this[Te].state,dn);v5e(this[Te].state,to,o,1/0,(a,e)=>{if(a){ng(this,a),process.nextTick(t,a);return}if(e==="not-equal"){this.flush(t);return}process.nextTick(t)})}flushSync(){this[Te].destroyed||(AK(this),iK(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[Te].ready}get destroyed(){return this[Te].destroyed}get closed(){return this[Te].closed}get writable(){return!this[Te].destroyed&&!this[Te].ending}get writableEnded(){return this[Te].ending}get writableFinished(){return this[Te].finished}get writableNeedDrain(){return this[Te].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[Te].errored}};function rK(n,t){setImmediate(()=>{n.emit("error",t)})}function ng(n,t){n[Te].destroyed||(n[Te].destroyed=!0,t&&(n[Te].errored=t,rK(n,t)),n.worker.exited?setImmediate(()=>{n[Te].closed=!0,n.emit("close")}):n.worker.terminate().catch(()=>{}).then(()=>{n[Te].closed=!0,n.emit("close")}))}function SM(n,t,o){let a=Atomics.load(n[Te].state,dn),e=Buffer.byteLength(t);return n[Te].data.write(t,a),FE(n,()=>{Atomics.store(n[Te].state,dn,a+e)}),o(),!0}function aK(n){if(!(n[Te].ended||!n[Te].ending||n[Te].flushing)){n[Te].ended=!0;try{n.flushSync();let t=Atomics.load(n[Te].state,to);FE(n,()=>{Atomics.store(n[Te].state,dn,-1)});let o=0;for(;t!==-1;){if(Atomics.wait(n[Te].state,to,t,1e3),t=Atomics.load(n[Te].state,to),t===-2){ng(n,new Error("end() failed"));return}if(++o===10){ng(n,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{n[Te].finished=!0,n.emit("finish")})}catch(t){ng(n,t)}}}function AK(n){let t=()=>{n[Te].ending?aK(n):n[Te].needDrain&&process.nextTick(mce,n)};for(n[Te].flushing=!1;n[Te].buf.length!==0;){let o=Atomics.load(n[Te].state,dn),a=n[Te].data.length-o;if(a===0){iK(n),FE(n,()=>{Atomics.store(n[Te].state,to,0),Atomics.store(n[Te].state,dn,0)}),Atomics.notify(n[Te].state,to);continue}else if(a<0)throw new Error("overwritten");let e=n[Te].buf.slice(0,a),i=Buffer.byteLength(e);if(i<=a)n[Te].buf=n[Te].buf.slice(a),SM(n,e,t);else{for(iK(n),FE(n,()=>{Atomics.store(n[Te].state,to,0),Atomics.store(n[Te].state,dn,0)}),Atomics.notify(n[Te].state,to);i>n[Te].buf.length;)a=a/2,e=n[Te].buf.slice(0,a),i=Buffer.byteLength(e);n[Te].buf=n[Te].buf.slice(a),SM(n,e,t)}}}function iK(n){if(n[Te].flushing)throw new Error("unable to flush while flushing");let t=Atomics.load(n[Te].state,dn),o=0;for(;;){let a=Atomics.load(n[Te].state,to);if(a===-2)throw Error("_flushSync failed");if(a!==t)Atomics.wait(n[Te].state,to,a,1e3);else break;if(++o===10)throw new Error("_flushSync took too long (10s)")}}wce.exports=tK});var sK=ee((bFA,Oce)=>{"use strict";var{createRequire:x5e}=$e("module"),Y5e=jH(),{join:oK,isAbsolute:j5e,sep:J5e}=$e("node:path"),q5e=WH(),nK=$H(),z5e=Dce();function V5e(n){nK.register(n,Z5e),nK.registerBeforeExit(n,X5e),n.on("close",function(){nK.unregister(n)})}function W5e(n,t,o,a){let e=new z5e({filename:n,workerData:t,workerOpts:o,sync:a});e.on("ready",i),e.on("close",function(){process.removeListener("exit",A)}),process.on("exit",A);function i(){process.removeListener("exit",A),e.unref(),o.autoEnd!==!1&&V5e(e)}function A(){e.closed||(e.flushSync(),q5e(100),e.end())}return e}function Z5e(n){n.ref(),n.flushSync(),n.end(),n.once("close",function(){n.unref()})}function X5e(n){n.flushSync()}function $5e(n){let{pipeline:t,targets:o,levels:a,dedupe:e,worker:i={},caller:A=Y5e(),sync:r=!1}=n,s={...n.options},g=typeof A=="string"?[A]:A,c="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},I=n.target;if(I&&o)throw new Error("only one of target or targets can be specified");return o?(I=c["pino-worker"]||oK(__dirname,"worker.js"),s.targets=o.filter(B=>B.target).map(B=>({...B,target:p(B.target)})),s.pipelines=o.filter(B=>B.pipeline).map(B=>B.pipeline.map(f=>({...f,level:B.level,target:p(f.target)})))):t&&(I=c["pino-worker"]||oK(__dirname,"worker.js"),s.pipelines=[t.map(B=>({...B,target:p(B.target)}))]),a&&(s.levels=a),e&&(s.dedupe=e),s.pinoWillSendConfig=!0,W5e(p(I),s,i,r);function p(B){if(B=c[B]||B,j5e(B)||B.indexOf("file://")===0)return B;if(B==="pino/file")return oK(__dirname,"..","file.js");let f;for(let Q of g)try{let y=Q==="node:repl"?process.cwd()+J5e:Q;f=x5e(y).resolve(B);break}catch{continue}if(!f)throw new Error(`unable to determine transport target for "${B}"`);return f}}Oce.exports=$5e});var bM=ee((MFA,Uce)=>{"use strict";var bce=$e("node:diagnostics_channel"),Mce=rce(),{mapHttpRequest:eZe,mapHttpResponse:AZe}=YH(),cK=Ice(),_ce=$H(),{lsCacheSym:tZe,chindingsSym:kce,writeSym:Tce,serializersSym:vce,formatOptsSym:Nce,endSym:rZe,stringifiersSym:Pce,stringifySym:Gce,stringifySafeSym:IK,wildcardFirstSym:Fce,nestedKeySym:iZe,formattersSym:Lce,messageKeySym:aZe,errorKeySym:oZe,nestedKeyStrSym:nZe,msgPrefixSym:wM}=PE(),{isMainThread:sZe}=$e("worker_threads"),gZe=sK(),OM;typeof bce.tracingChannel=="function"?OM=bce.tracingChannel("pino_asJson"):OM={hasSubscribers:!1,traceSync(n,t,o,...a){return n.call(o,...a)}};function LE(){}function cZe(n,t){if(!t)return o;return function(...e){t.call(this,e,o,n)};function o(a,...e){if(typeof a=="object"){let i=a;a!==null&&(a.method&&a.headers&&a.socket?a=eZe(a):typeof a.setHeader=="function"&&(a=AZe(a)));let A;i===null&&e.length===0?A=[null]:(i=e.shift(),A=e),typeof this[wM]=="string"&&i!==void 0&&i!==null&&(i=this[wM]+i),this[Tce](a,Mce(i,A,this[Nce]),n)}else{let i=a===void 0?e.shift():a;typeof this[wM]=="string"&&i!==void 0&&i!==null&&(i=this[wM]+i),this[Tce](null,Mce(i,e,this[Nce]),n)}}}function gK(n){let t="",o=0,a=!1,e=255,i=n.length;if(i>100)return JSON.stringify(n);for(var A=0;A=32;A++)e=n.charCodeAt(A),(e===34||e===92)&&(t+=n.slice(o,A)+"\\",o=A,a=!0);return a?t+=n.slice(o):t=n,e<32?JSON.stringify(n):'"'+t+'"'}function IZe(n,t,o,a){if(OM.hasSubscribers===!1)return Rce.call(this,n,t,o,a);let e={instance:this,arguments};return OM.traceSync(Rce,e,this,n,t,o,a)}function Rce(n,t,o,a){let e=this[Gce],i=this[IK],A=this[Pce],r=this[rZe],s=this[kce],g=this[vce],c=this[Lce],I=this[aZe],p=this[oZe],B=this[tZe][o]+a;B=B+s;let f;c.log&&(n=c.log(n));let Q=A[Fce],y="";for(let T in n)if(f=n[T],Object.prototype.hasOwnProperty.call(n,T)&&f!==void 0){g[T]?f=g[T](f):T===p&&g.err&&(f=g.err(f));let _=A[T]||Q;switch(typeof f){case"undefined":case"function":continue;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":_&&(f=_(f));break;case"string":f=(_||gK)(f);break;default:f=(_||e)(f,i)}if(f===void 0)continue;let R=gK(T);y+=","+R+":"+f}let m="";if(t!==void 0){f=g[I]?g[I](t):t;let T=A[I]||Q;switch(typeof f){case"function":break;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":T&&(f=T(f)),m=',"'+I+'":'+f;break;case"string":f=(T||gK)(f),m=',"'+I+'":'+f;break;default:f=(T||e)(f,i),m=',"'+I+'":'+f}}return this[iZe]&&y?B+this[nZe]+y.slice(1)+"}"+m+r:B+y+m+r}function lZe(n,t){let o,a=n[kce],e=n[Gce],i=n[IK],A=n[Pce],r=A[Fce],s=n[vce],g=n[Lce].bindings;t=g(t);for(let c in t)if(o=t[c],((c.length<5||c!=="level"&&c!=="serializers"&&c!=="formatters"&&c!=="customLevels")&&t.hasOwnProperty(c)&&o!==void 0)===!0){if(o=s[c]?s[c](o):o,o=(A[c]||r||e)(o,i),o===void 0)continue;a+=',"'+c+'":'+o}return a}function pZe(n){return n.write!==n.constructor.prototype.write}function DM(n){let t=new cK(n);return t.on("error",o),!n.sync&&sZe&&(_ce.register(t,dZe),t.on("close",function(){_ce.unregister(t)})),t;function o(a){if(a.code==="EPIPE"){t.write=LE,t.end=LE,t.flushSync=LE,t.destroy=LE;return}t.removeListener("error",o),t.emit("error",a)}}function dZe(n,t){n.destroyed||(t==="beforeExit"?(n.flush(),n.on("drain",function(){n.end()})):n.flushSync())}function hZe(n){return function(o,a,e={},i){if(typeof e=="string")i=DM({dest:e}),e={};else if(typeof i=="string"){if(e&&e.transport)throw Error("only one of option.transport or stream can be specified");i=DM({dest:i})}else if(e instanceof cK||e.writable||e._writableState)i=e,e={};else if(e.transport){if(e.transport instanceof cK||e.transport.writable||e.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(e.transport.targets&&e.transport.targets.length&&e.formatters&&typeof e.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let s;e.customLevels&&(s=e.useOnlyCustomLevels?e.customLevels:Object.assign({},e.levels,e.customLevels)),i=gZe({caller:a,...e.transport,levels:s})}if(e=Object.assign({},n,e),e.serializers=Object.assign({},n.serializers,e.serializers),e.formatters=Object.assign({},n.formatters,e.formatters),e.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:A,onChild:r}=e;return A===!1&&(e.level="silent"),r||(e.onChild=LE),i||(pZe(process.stdout)?i=process.stdout:i=DM({fd:process.stdout.fd||1})),{opts:e,stream:i}}}function EZe(n,t){try{return JSON.stringify(n)}catch{try{return(t||this[IK])(n)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function uZe(n,t,o){return{level:n,bindings:t,log:o}}function CZe(n){let t=Number(n);return typeof n=="string"&&Number.isFinite(t)?t:n===void 0?1:n}Uce.exports={noop:LE,buildSafeSonicBoom:DM,asChindings:lZe,asJson:IZe,genLog:cZe,createArgsNormalizer:hZe,stringify:EZe,buildFormatters:uZe,normalizeDestFileDescriptor:CZe}});var MM=ee((_FA,Hce)=>{var BZe={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},fZe={ASC:"ASC",DESC:"DESC"};Hce.exports={DEFAULT_LEVELS:BZe,SORTING_ORDER:fZe}});var dK=ee((TFA,jce)=>{"use strict";var{lsCacheSym:QZe,levelValSym:lK,useOnlyCustomLevelsSym:yZe,streamSym:mZe,formattersSym:SZe,hooksSym:wZe,levelCompSym:Kce}=PE(),{noop:DZe,genLog:Sp}=bM(),{DEFAULT_LEVELS:sg,SORTING_ORDER:xce}=MM(),Yce={fatal:n=>{let t=Sp(sg.fatal,n);return function(...o){let a=this[mZe];if(t.call(this,...o),typeof a.flushSync=="function")try{a.flushSync()}catch{}}},error:n=>Sp(sg.error,n),warn:n=>Sp(sg.warn,n),info:n=>Sp(sg.info,n),debug:n=>Sp(sg.debug,n),trace:n=>Sp(sg.trace,n)},pK=Object.keys(sg).reduce((n,t)=>(n[sg[t]]=t,n),{}),OZe=Object.keys(pK).reduce((n,t)=>(n[t]='{"level":'+Number(t),n),{});function bZe(n){let t=n[SZe].level,{labels:o}=n.levels,a={};for(let e in o){let i=t(o[e],Number(e));a[e]=JSON.stringify(i).slice(0,-1)}return n[QZe]=a,n}function MZe(n,t){if(t)return!1;switch(n){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function _Ze(n){let{labels:t,values:o}=this.levels;if(typeof n=="number"){if(t[n]===void 0)throw Error("unknown level value"+n);n=t[n]}if(o[n]===void 0)throw Error("unknown level "+n);let a=this[lK],e=this[lK]=o[n],i=this[yZe],A=this[Kce],r=this[wZe].logMethod;for(let s in o){if(A(o[s],e)===!1){this[s]=DZe;continue}this[s]=MZe(s,i)?Yce[s](r):Sp(o[s],r)}this.emit("level-change",n,e,t[a],a,this)}function TZe(n){let{levels:t,levelVal:o}=this;return t&&t.labels?t.labels[o]:""}function NZe(n){let{values:t}=this.levels,o=t[n];return o!==void 0&&this[Kce](o,this[lK])}function RZe(n,t,o){return n===xce.DESC?t<=o:t>=o}function kZe(n){return typeof n=="string"?RZe.bind(null,n):n}function vZe(n=null,t=!1){let o=n?Object.keys(n).reduce((i,A)=>(i[n[A]]=A,i),{}):null,a=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),t?null:pK,o),e=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),t?null:sg,n);return{labels:a,values:e}}function PZe(n,t,o){if(typeof n=="number"){if(![].concat(Object.keys(t||{}).map(i=>t[i]),o?[]:Object.keys(pK).map(i=>+i),1/0).includes(n))throw Error(`default level:${n} must be included in custom levels`);return}let a=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),o?null:sg,t);if(!(n in a))throw Error(`default level:${n} must be included in custom levels`)}function GZe(n,t){let{labels:o,values:a}=n;for(let e in t){if(e in a)throw Error("levels cannot be overridden");if(t[e]in o)throw Error("pre-existing level values cannot be used for new levels")}}function FZe(n){if(typeof n!="function"&&!(typeof n=="string"&&Object.values(xce).includes(n)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}jce.exports={initialLsCache:OZe,genLsCache:bZe,levelMethods:Yce,getLevel:TZe,setLevel:_Ze,isLevelEnabled:NZe,mappings:vZe,assertNoLevelCollisions:GZe,assertDefaultLevelFound:PZe,genLevelComparison:kZe,assertLevelComparison:FZe}});var hK=ee((NFA,Jce)=>{"use strict";Jce.exports={version:"9.14.0"}});var eIe=ee((kFA,$ce)=>{"use strict";var{EventEmitter:LZe}=$e("node:events"),{lsCacheSym:UZe,levelValSym:HZe,setLevelSym:TM,getLevelSym:qce,chindingsSym:NM,parsedChindingsSym:KZe,mixinSym:xZe,asJsonSym:Vce,writeSym:YZe,mixinMergeStrategySym:jZe,timeSym:JZe,timeSliceIndexSym:qZe,streamSym:Wce,serializersSym:wp,formattersSym:nQ,errorKeySym:zZe,messageKeySym:VZe,useOnlyCustomLevelsSym:WZe,needsMetadataGsym:ZZe,redactFmtSym:XZe,stringifySym:$Ze,formatOptsSym:e9e,stringifiersSym:A9e,msgPrefixSym:uK,hooksSym:t9e}=PE(),{getLevel:r9e,setLevel:i9e,isLevelEnabled:a9e,mappings:o9e,initialLsCache:n9e,genLsCache:s9e,assertNoLevelCollisions:g9e}=dK(),{asChindings:CK,asJson:c9e,buildFormatters:EK,stringify:zce,noop:Zce}=bM(),{version:I9e}=hK(),l9e=zH(),p9e=class{},Xce={constructor:p9e,child:d9e,bindings:h9e,setBindings:E9e,flush:B9e,isLevelEnabled:a9e,version:I9e,get level(){return this[qce]()},set level(n){this[TM](n)},get levelVal(){return this[HZe]},set levelVal(n){throw Error("levelVal is read-only")},get msgPrefix(){return this[uK]},get[Symbol.toStringTag](){return"Pino"},[UZe]:n9e,[YZe]:C9e,[Vce]:c9e,[qce]:r9e,[TM]:i9e};Object.setPrototypeOf(Xce,LZe.prototype);$ce.exports=function(){return Object.create(Xce)};var _M=n=>n;function d9e(n,t){if(!n)throw Error("missing bindings for child Pino");let o=this[wp],a=this[nQ],e=Object.create(this);if(t==null)return e[nQ].bindings!==_M&&(e[nQ]=EK(a.level,_M,a.log)),e[NM]=CK(e,n),e[TM](this.level),this.onChild!==Zce&&this.onChild(e),e;if(t.hasOwnProperty("serializers")===!0){e[wp]=Object.create(null);for(let c in o)e[wp][c]=o[c];let s=Object.getOwnPropertySymbols(o);for(var i=0;i{"use strict";var{hasOwnProperty:sQ}=Object.prototype,Op=QK();Op.configure=QK;Op.stringify=Op;Op.default=Op;yK.stringify=Op;yK.configure=QK;rIe.exports=Op;var f9e=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function kI(n){return n.length<5e3&&!f9e.test(n)?`"${n}"`:JSON.stringify(n)}function BK(n,t){if(n.length>200||t)return n.sort(t);for(let o=1;oa;)n[e]=n[e-1],e--;n[e]=a}return n}var Q9e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function fK(n){return Q9e.call(n)!==void 0&&n.length!==0}function AIe(n,t,o){n.length= 1`)}return o===void 0?1/0:o}function Dp(n){return n===1?"1 item":`${n} items`}function w9e(n){let t=new Set;for(let o of n)(typeof o=="string"||typeof o=="number")&&t.add(String(o));return t}function D9e(n){if(sQ.call(n,"strict")){let t=n.strict;if(typeof t!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(t)return o=>{let a=`Object can not safely be stringified. Received type ${typeof o}`;throw typeof o!="function"&&(a+=` (${o.toString()})`),new Error(a)}}}function QK(n){n={...n};let t=D9e(n);t&&(n.bigint===void 0&&(n.bigint=!1),"circularValue"in n||(n.circularValue=Error));let o=y9e(n),a=S9e(n,"bigint"),e=m9e(n),i=typeof e=="function"?e:void 0,A=tIe(n,"maximumDepth"),r=tIe(n,"maximumBreadth");function s(B,f,Q,y,m,T){let _=f[B];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(B)),_=y.call(f,B,_),typeof _){case"string":return kI(_);case"object":{if(_===null)return"null";if(Q.indexOf(_)!==-1)return o;let R="",L=",",U=T;if(Array.isArray(_)){if(_.length===0)return"[]";if(Ar){let k=_.length-r-1;R+=`${L}"... ${Dp(k)} not stringified"`}return m!==""&&(R+=` ${U}`),Q.pop(),`[${R}]`}let F=Object.keys(_),q=F.length;if(q===0)return"{}";if(Ar){let z=R-r;U+=`${F}"...": "${Dp(z)} not stringified"`,F=L}return F!==""&&(U=` ${m}${U} -${T}`),Q.pop(),`{${U}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(a)return String(f);default:return t?t(f):void 0}}function I(B,f,Q){switch(typeof f){case"string":return kI(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(B),typeof f!="object")return I(B,f,Q);if(f===null)return"null"}if(Q.indexOf(f)!==-1)return o;let y="",m=f.length!==void 0;if(m&&Array.isArray(f)){if(f.length===0)return"[]";if(Ar){let z=f.length-r-1;y+=`,"... ${Dp(z)} not stringified"`}return Q.pop(),`[${y}]`}let T=Object.keys(f),_=T.length;if(_===0)return"{}";if(Ar){let U=_-r;y+=`${R}"...":"${Dp(U)} not stringified"`}return Q.pop(),`{${y}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(a)return String(f);default:return t?t(f):void 0}}function p(B,f,Q){if(arguments.length>1){let y="";if(typeof Q=="number"?y=" ".repeat(Math.min(Q,10)):typeof Q=="string"&&(y=Q.slice(0,10)),f!=null){if(typeof f=="function")return s("",{"":B},[],f,y,"");if(Array.isArray(f))return g("",B,[],w9e(f),y,"")}if(y.length!==0)return c("",B,[],y,"")}return I("",B,[])}return p}});var sIe=ee((NFA,nIe)=>{"use strict";var mK=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:oIe}=MM(),O9e=oIe.info;function b9e(n,t){n=n||[],t=t||{dedupe:!1};let o=Object.create(oIe);o.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(I=>{o[I]=t.levels[I]});let a={write:e,add:r,remove:s,emit:i,flushSync:A,end:g,minLevel:0,lastId:0,streams:[],clone:c,[mK]:!0,streamLevels:o};return Array.isArray(n)?n.forEach(r,a):r.call(a,n),n=null,a;function e(I){let p,B=this.lastLevel,{streams:f}=this,Q=0,y;for(let m=M9e(f.length,t.dedupe);T9e(m,f.length,t.dedupe);m=_9e(m,t.dedupe))if(p=f[m],p.level<=B){if(Q!==0&&Q!==p.level)break;if(y=p.stream,y[mK]){let{lastTime:T,lastMsg:_,lastObj:R,lastLogger:L}=this;y.lastLevel=B,y.lastTime=T,y.lastMsg=_,y.lastObj=R,y.lastLogger=L}y.write(I),t.dedupe&&(Q=p.level)}else if(!t.dedupe)break}function i(...I){for(let{stream:p}of this.streams)typeof p.emit=="function"&&p.emit(...I)}function A(){for(let{stream:I}of this.streams)typeof I.flushSync=="function"&&I.flushSync()}function r(I){if(!I)return a;let p=typeof I.write=="function"||I.stream,B=I.write?I:I.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:f,streamLevels:Q}=this,y;typeof I.levelVal=="number"?y=I.levelVal:typeof I.level=="string"?y=Q[I.level]:typeof I.level=="number"?y=I.level:y=O9e;let m={stream:B,level:y,levelVal:void 0,id:++a.lastId};return f.unshift(m),f.sort(aIe),this.minLevel=f[0].level,a}function s(I){let{streams:p}=this,B=p.findIndex(f=>f.id===I);return B>=0&&(p.splice(B,1),p.sort(aIe),this.minLevel=p.length>0?p[0].level:-1),a}function g(){for(let{stream:I}of this.streams)typeof I.flushSync=="function"&&I.flushSync(),I.end()}function c(I){let p=new Array(this.streams.length);for(let B=0;B=0:n{"use strict";var N9e=$e("node:os"),EIe=YH(),R9e=jH(),k9e=zH(),uIe=Ace(),v9e=eIe(),CIe=PE(),{configure:P9e}=iIe(),{assertDefaultLevelFound:G9e,mappings:BIe,genLsCache:F9e,genLevelComparison:L9e,assertLevelComparison:U9e}=dK(),{DEFAULT_LEVELS:fIe,SORTING_ORDER:H9e}=MM(),{createArgsNormalizer:K9e,asChindings:x9e,buildSafeSonicBoom:gIe,buildFormatters:Y9e,stringify:SK,normalizeDestFileDescriptor:cIe,noop:j9e}=bM(),{version:J9e}=hK(),{chindingsSym:IIe,redactFmtSym:q9e,serializersSym:lIe,timeSym:z9e,timeSliceIndexSym:V9e,streamSym:W9e,stringifySym:pIe,stringifySafeSym:wK,stringifiersSym:dIe,setLevelSym:Z9e,endSym:X9e,formatOptsSym:$9e,messageKeySym:eXe,errorKeySym:AXe,nestedKeySym:tXe,mixinSym:rXe,levelCompSym:iXe,useOnlyCustomLevelsSym:aXe,formattersSym:hIe,hooksSym:oXe,nestedKeyStrSym:nXe,mixinMergeStrategySym:sXe,msgPrefixSym:gXe}=CIe,{epochTime:QIe,nullTime:cXe}=uIe,{pid:IXe}=process,lXe=N9e.hostname(),pXe=EIe.err,dXe={level:"info",levelComparison:H9e.ASC,levels:fIe,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:IXe,hostname:lXe},serializers:Object.assign(Object.create(null),{err:pXe}),formatters:Object.assign(Object.create(null),{bindings(n){return n},level(n,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:QIe,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},hXe=K9e(dXe),EXe=Object.assign(Object.create(null),EIe);function DK(...n){let t={},{opts:o,stream:a}=hXe(t,R9e(),...n);o.level&&typeof o.level=="string"&&fIe[o.level.toLowerCase()]!==void 0&&(o.level=o.level.toLowerCase());let{redact:e,crlf:i,serializers:A,timestamp:r,messageKey:s,errorKey:g,nestedKey:c,base:I,name:p,level:B,customLevels:f,levelComparison:Q,mixin:y,mixinMergeStrategy:m,useOnlyCustomLevels:T,formatters:_,hooks:R,depthLimit:L,edgeLimit:U,onChild:F,msgPrefix:q}=o,z=P9e({maximumDepth:L,maximumBreadth:U}),K=Y9e(_.level,_.bindings,_.log),G=SK.bind({[wK]:z}),V=e?k9e(e,G):{},H=e?{stringify:V[q9e]}:{stringify:G},N="}"+(i?`\r +${T}`),Q.pop(),`{${U}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(a)return String(f);default:return t?t(f):void 0}}function I(B,f,Q){switch(typeof f){case"string":return kI(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(B),typeof f!="object")return I(B,f,Q);if(f===null)return"null"}if(Q.indexOf(f)!==-1)return o;let y="",m=f.length!==void 0;if(m&&Array.isArray(f)){if(f.length===0)return"[]";if(Ar){let z=f.length-r-1;y+=`,"... ${Dp(z)} not stringified"`}return Q.pop(),`[${y}]`}let T=Object.keys(f),_=T.length;if(_===0)return"{}";if(Ar){let U=_-r;y+=`${R}"...":"${Dp(U)} not stringified"`}return Q.pop(),`{${y}}`}case"number":return isFinite(f)?String(f):t?t(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(a)return String(f);default:return t?t(f):void 0}}function p(B,f,Q){if(arguments.length>1){let y="";if(typeof Q=="number"?y=" ".repeat(Math.min(Q,10)):typeof Q=="string"&&(y=Q.slice(0,10)),f!=null){if(typeof f=="function")return s("",{"":B},[],f,y,"");if(Array.isArray(f))return g("",B,[],w9e(f),y,"")}if(y.length!==0)return c("",B,[],y,"")}return I("",B,[])}return p}});var sIe=ee((vFA,nIe)=>{"use strict";var mK=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:oIe}=MM(),O9e=oIe.info;function b9e(n,t){n=n||[],t=t||{dedupe:!1};let o=Object.create(oIe);o.silent=1/0,t.levels&&typeof t.levels=="object"&&Object.keys(t.levels).forEach(I=>{o[I]=t.levels[I]});let a={write:e,add:r,remove:s,emit:i,flushSync:A,end:g,minLevel:0,lastId:0,streams:[],clone:c,[mK]:!0,streamLevels:o};return Array.isArray(n)?n.forEach(r,a):r.call(a,n),n=null,a;function e(I){let p,B=this.lastLevel,{streams:f}=this,Q=0,y;for(let m=M9e(f.length,t.dedupe);T9e(m,f.length,t.dedupe);m=_9e(m,t.dedupe))if(p=f[m],p.level<=B){if(Q!==0&&Q!==p.level)break;if(y=p.stream,y[mK]){let{lastTime:T,lastMsg:_,lastObj:R,lastLogger:L}=this;y.lastLevel=B,y.lastTime=T,y.lastMsg=_,y.lastObj=R,y.lastLogger=L}y.write(I),t.dedupe&&(Q=p.level)}else if(!t.dedupe)break}function i(...I){for(let{stream:p}of this.streams)typeof p.emit=="function"&&p.emit(...I)}function A(){for(let{stream:I}of this.streams)typeof I.flushSync=="function"&&I.flushSync()}function r(I){if(!I)return a;let p=typeof I.write=="function"||I.stream,B=I.write?I:I.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:f,streamLevels:Q}=this,y;typeof I.levelVal=="number"?y=I.levelVal:typeof I.level=="string"?y=Q[I.level]:typeof I.level=="number"?y=I.level:y=O9e;let m={stream:B,level:y,levelVal:void 0,id:++a.lastId};return f.unshift(m),f.sort(aIe),this.minLevel=f[0].level,a}function s(I){let{streams:p}=this,B=p.findIndex(f=>f.id===I);return B>=0&&(p.splice(B,1),p.sort(aIe),this.minLevel=p.length>0?p[0].level:-1),a}function g(){for(let{stream:I}of this.streams)typeof I.flushSync=="function"&&I.flushSync(),I.end()}function c(I){let p=new Array(this.streams.length);for(let B=0;B=0:n{"use strict";var N9e=$e("node:os"),EIe=YH(),R9e=jH(),k9e=zH(),uIe=Ace(),v9e=eIe(),CIe=PE(),{configure:P9e}=iIe(),{assertDefaultLevelFound:G9e,mappings:BIe,genLsCache:F9e,genLevelComparison:L9e,assertLevelComparison:U9e}=dK(),{DEFAULT_LEVELS:fIe,SORTING_ORDER:H9e}=MM(),{createArgsNormalizer:K9e,asChindings:x9e,buildSafeSonicBoom:gIe,buildFormatters:Y9e,stringify:SK,normalizeDestFileDescriptor:cIe,noop:j9e}=bM(),{version:J9e}=hK(),{chindingsSym:IIe,redactFmtSym:q9e,serializersSym:lIe,timeSym:z9e,timeSliceIndexSym:V9e,streamSym:W9e,stringifySym:pIe,stringifySafeSym:wK,stringifiersSym:dIe,setLevelSym:Z9e,endSym:X9e,formatOptsSym:$9e,messageKeySym:eXe,errorKeySym:AXe,nestedKeySym:tXe,mixinSym:rXe,levelCompSym:iXe,useOnlyCustomLevelsSym:aXe,formattersSym:hIe,hooksSym:oXe,nestedKeyStrSym:nXe,mixinMergeStrategySym:sXe,msgPrefixSym:gXe}=CIe,{epochTime:QIe,nullTime:cXe}=uIe,{pid:IXe}=process,lXe=N9e.hostname(),pXe=EIe.err,dXe={level:"info",levelComparison:H9e.ASC,levels:fIe,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:IXe,hostname:lXe},serializers:Object.assign(Object.create(null),{err:pXe}),formatters:Object.assign(Object.create(null),{bindings(n){return n},level(n,t){return{level:t}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:QIe,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},hXe=K9e(dXe),EXe=Object.assign(Object.create(null),EIe);function DK(...n){let t={},{opts:o,stream:a}=hXe(t,R9e(),...n);o.level&&typeof o.level=="string"&&fIe[o.level.toLowerCase()]!==void 0&&(o.level=o.level.toLowerCase());let{redact:e,crlf:i,serializers:A,timestamp:r,messageKey:s,errorKey:g,nestedKey:c,base:I,name:p,level:B,customLevels:f,levelComparison:Q,mixin:y,mixinMergeStrategy:m,useOnlyCustomLevels:T,formatters:_,hooks:R,depthLimit:L,edgeLimit:U,onChild:F,msgPrefix:q}=o,z=P9e({maximumDepth:L,maximumBreadth:U}),K=Y9e(_.level,_.bindings,_.log),G=SK.bind({[wK]:z}),V=e?k9e(e,G):{},H=e?{stringify:V[q9e]}:{stringify:G},N="}"+(i?`\r `:` `),k=x9e.bind(null,{[IIe]:"",[lIe]:A,[dIe]:V,[pIe]:SK,[wK]:z,[hIe]:K}),J="";I!==null&&(p===void 0?J=k(I):J=k(Object.assign({},I,{name:p})));let X=r instanceof Function?r:r?QIe:cXe,ie=X().indexOf(":")+1;if(T&&!f)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(y&&typeof y!="function")throw Error(`Unknown mixin type "${typeof y}" - expected "function"`);if(q&&typeof q!="string")throw Error(`Unknown msgPrefix type "${typeof q}" - expected "string"`);G9e(B,f,T);let De=BIe(f,T);typeof a.emit=="function"&&a.emit("message",{code:"PINO_CONFIG",config:{levels:De,messageKey:s,errorKey:g}}),U9e(Q);let oe=L9e(Q);return Object.assign(t,{levels:De,[iXe]:oe,[aXe]:T,[W9e]:a,[z9e]:X,[V9e]:ie,[pIe]:SK,[wK]:z,[dIe]:V,[X9e]:N,[$9e]:H,[eXe]:s,[AXe]:g,[tXe]:c,[nXe]:c?`,${JSON.stringify(c)}:{`:"",[lIe]:A,[rXe]:y,[sXe]:m,[IIe]:J,[hIe]:K,[oXe]:R,silent:j9e,onChild:F,[gXe]:q}),Object.setPrototypeOf(t,v9e()),F9e(t),t[Z9e](B),t}hn.exports=DK;hn.exports.destination=(n=process.stdout.fd)=>typeof n=="object"?(n.dest=cIe(n.dest||process.stdout.fd),gIe(n)):gIe({dest:cIe(n),minLength:0});hn.exports.transport=sK();hn.exports.multistream=sIe();hn.exports.levels=BIe();hn.exports.stdSerializers=EXe;hn.exports.stdTimeFunctions=Object.assign({},uIe);hn.exports.symbols=CIe;hn.exports.version=J9e;hn.exports.default=DK;hn.exports.pino=DK});import{unlink as qBe}from"node:fs/promises";import{homedir as zBe}from"node:os";import{join as pu,resolve as VI}from"node:path";import{createHash as upe,randomUUID as Jx}from"node:crypto";import{mkdir as Cpe,readFile as Bpe,rename as fpe,unlink as jx,writeFile as Qpe}from"node:fs/promises";import{dirname as ype}from"node:path";var Mx={"\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002":"This question has already been answered from another client; no further reply is needed.","\u4EFB\u52A1\u5DF2\u5B8C\u6210\u3002":"Task completed.",\u7ED3\u679C\u6587\u4EF6:"result file","\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u7684\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002":'The delivery result of the result file "{name}" could not be confirmed. Please check whether it already arrived in the chat before retrying.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 Slack \u5E94\u7528\u7F3A\u5C11 files:write \u6743\u9650\u3002\u8BF7\u66F4\u65B0 Manifest\u3001\u91CD\u65B0\u5B89\u88C5\u5E94\u7528\u5E76\u91CD\u65B0\u8FDE\u63A5\u673A\u5668\u4EBA\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated, but the Slack app is missing the files:write permission. Please update the Manifest, reinstall the app, reconnect the bot, and try again.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u7F3A\u5C11 Discord \u7684 Send Messages\u3001Attach Files \u6216 Read Message History \u6743\u9650\u3002":'The result file "{name}" was generated, but the bot is missing the Discord Send Messages, Attach Files, or Read Message History permission.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 Telegram \u4E0D\u5141\u8BB8\u673A\u5668\u4EBA\u5728\u5F53\u524D\u804A\u5929\u53D1\u9001\u6587\u6863\uFF0C\u8BF7\u68C0\u67E5\u804A\u5929\u6743\u9650\u3002":'The result file "{name}" was generated, but Telegram does not allow the bot to send documents in this chat. Please check the chat permissions.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u6587\u4EF6\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u6E20\u9053\u6743\u9650\u3002":'The result file "{name}" was generated, but the bot does not have permission to send files. Please check the channel permissions.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u6E20\u9053\u5927\u5C0F\u4E0A\u9650\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" exceeds the size limit of this channel and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u672A\u53D1\u9001\u3002":'The result file "{name}" is empty and was not sent.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002":'The result file "{name}" cannot be read or prepared for sending right now. Please make sure the file is still accessible and try again.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5F53\u524D\u6E20\u9053\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was temporarily rate-limited by this channel and could not be sent. Please try again later.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002":'The result file "{name}" was generated, but this channel rejected the file or file message.',"\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":'The result file "{name}" was generated, but this channel could not send it right now. Please try again later.',"\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Failed to process the message. Please try again later.","\u5361\u7247\u5DF2\u7ED3\u675F\uFF0C\u8BF7\u67E5\u770B\u540E\u7EED\u6D88\u606F\u3002":"This card has ended. Please check the next message.","\u5DE5\u5177\u8C03\u7528\u300C{name}\u300D\u672A\u6210\u529F\uFF0C\u8BF7\u68C0\u67E5\u5DE5\u5177\u914D\u7F6E\u6216\u7A0D\u540E\u91CD\u8BD5\u3002":'Tool call "{name}" did not succeed. Check the tool configuration or try again later.',"\u65E0\u6CD5\u8FDE\u63A5\u5904\u7406\u670D\u52A1\uFF0C\u6D88\u606F\u5C1A\u672A\u63D0\u4EA4\u3002\u8BF7\u786E\u8BA4 DeepSeek Harness \u6B63\u5728\u8FD0\u884C\u540E\u91CD\u8BD5\u3002":"Could not connect to the processing service, so the message was not submitted. Make sure DeepSeek Harness is running, then try again.","\u5904\u7406\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u6D88\u606F\u5C1A\u672A\u5F00\u59CB\u5904\u7406\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The processing service timed out before the message started. Please try again later.","\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u4EFB\u52A1\u72B6\u6001\uFF0C\u4EFB\u52A1\u53EF\u80FD\u5DF2\u7ECF\u5F00\u59CB\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"The task status could not be confirmed and the task may have started. Wait or send /stop before submitting it again.","\u6D88\u606F\u63D0\u4EA4\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u4EFB\u52A1\u53EF\u80FD\u5DF2\u7ECF\u5F00\u59CB\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /status \u67E5\u770B\u72B6\u6001\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"The message submission could not be confirmed and the task may have started. Wait or send /status before submitting it again.","\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u4EFB\u52A1\u8FDB\u5EA6\uFF0C\u4EFB\u52A1\u53EF\u80FD\u4ECD\u5728\u8FD0\u884C\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"Task progress is temporarily unavailable and the task may still be running. Wait or send /stop before submitting it again.","\u5904\u7406\u670D\u52A1\u62D2\u7EDD\u4E86\u673A\u5668\u4EBA\u8FDE\u63A5\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u3001\u4EE3\u7406\u6216\u8BBF\u95EE\u914D\u7F6E\u540E\u91CD\u8BD5\u3002":"The processing service rejected the bot connection. Ask an administrator to check the Harness address, proxy, or access settings.","\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u7684\u63A5\u53E3\u4E0D\u517C\u5BB9\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u5E76\u66F4\u65B0\u76F8\u5173\u7248\u672C\u3002":"The bot and DeepSeek Harness use incompatible APIs. Ask an administrator to check the Harness address and update the related components.","DeepSeek Harness \u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u8BF7\u6C42\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"DeepSeek Harness could not complete the request. Please try again later.","\u7B49\u5F85\u6A21\u578B\u56DE\u590D\u8D85\u65F6\uFF0C\u4EFB\u52A1\u53EF\u80FD\u4ECD\u5728\u8FD0\u884C\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"Waiting for the model reply timed out and the task may still be running. Wait or send /stop before submitting it again.","\u6A21\u578B\u51ED\u636E\u7F3A\u5931\u6216\u5DF2\u5931\u6548\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5\u6A21\u578B\u914D\u7F6E\u540E\u91CD\u8BD5\u3002":"The model credentials are missing or invalid. Ask an administrator to check the model settings.","\u6A21\u578B\u989D\u5EA6\u6216\u4F59\u989D\u4E0D\u8DB3\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7BA1\u7406\u5458\u8865\u5145\u989D\u5EA6\u6216\u5207\u6362\u6A21\u578B\u540E\u91CD\u8BD5\u3002":"The model quota or balance is insufficient. Ask an administrator to add quota or switch models, then try again.","\u6A21\u578B\u670D\u52A1\u6B63\u5728\u9650\u6D41\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The model service is rate-limiting requests. Please try again later.","\u5F53\u524D\u4F1A\u8BDD\u5185\u5BB9\u8D85\u8FC7\u6A21\u578B\u4E0A\u4E0B\u6587\u4E0A\u9650\u3002\u8BF7\u53D1\u9001 /compact \u6216 /new \u540E\u91CD\u8BD5\u3002":"This conversation exceeds the model context limit. Send /compact or /new, then try again.","\u5F53\u524D\u6A21\u578B\u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u53D1\u9001 /models \u67E5\u770B\u5E76\u4F7F\u7528 /model \u5207\u6362\u6A21\u578B\u3002":"The current model does not exist or is unavailable. Send /models and use /model to switch models.","\u5F53\u524D\u6A21\u578B\u4E0D\u5B58\u5728\u6216\u4E0D\u652F\u6301\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u53D1\u9001 /models\uFF0C\u5E76\u4F7F\u7528 /model \u91CD\u65B0\u9009\u62E9\u3002":"The current model does not exist or does not support the selected settings. Send /models and use /model to choose again.","\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u8FD9\u7C7B\u5185\u5BB9\u6216\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u8C03\u6574\u5185\u5BB9\u3001\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u540E\u91CD\u8BD5\u3002":"The current model does not support this content or the selected settings. Adjust the content, model, or reasoning effort and try again.","\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u5207\u6362\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u540E\u91CD\u8BD5\u3002":"The current model does not support the selected settings. Switch the model or reasoning effort, then try again.","\u6A21\u578B\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The model service timed out and the task did not finish. Please try again later.","\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u6A21\u578B\u670D\u52A1\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The model service is temporarily unreachable and the task did not finish. Please try again later.","\u6A21\u578B\u670D\u52A1\u6682\u65F6\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The model service is temporarily unavailable and the task did not finish. Please try again later.","\u6A21\u578B\u56DE\u590D\u4E2D\u65AD\u6216\u683C\u5F0F\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002":"The model reply was interrupted or malformed, so the task did not finish. Please try again.","\u6A21\u578B\u6CA1\u6709\u8FD4\u56DE\u53EF\u663E\u793A\u7684\u5185\u5BB9\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u3002":"The model returned no displayable content. Try again, or switch models if this keeps happening.","\u6A21\u578B\u62D2\u7EDD\u5904\u7406\u5F53\u524D\u5185\u5BB9\u3002\u8BF7\u8C03\u6574\u95EE\u9898\u5185\u5BB9\u540E\u91CD\u8BD5\u3002":"The model rejected the current content. Revise the request and try again.","\u6A21\u578B\u8FBE\u5230\u8F93\u51FA\u957F\u5EA6\u4E0A\u9650\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u7ED3\u679C\u3002\u8BF7\u7F29\u5C0F\u4EFB\u52A1\u8303\u56F4\u540E\u91CD\u8BD5\u3002":"The model reached its output limit without producing a displayable result. Reduce the task scope and try again.","\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u65E0\u6CD5\u5728\u5F53\u524D\u6E20\u9053\u5B8C\u6210\u7684\u64CD\u4F5C\u3002\u8BF7\u5728 DeepSeek Harness \u4E2D\u5904\u7406\u540E\u518D\u8BD5\u3002":"The task is waiting for an action that cannot be completed in this channel. Handle it in DeepSeek Harness, then try again.","\u4EFB\u52A1\u88AB\u610F\u5916\u4E2D\u65AD\uFF0C\u672C\u6B21\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002":"The task was unexpectedly interrupted and did not finish. Please try again.","\u5F53\u524D\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u3002\u8BF7\u53D1\u9001 /new \u521B\u5EFA\u65B0\u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002":"The current Session no longer exists. Send /new to create one, then try again.","\u5F53\u524D\u4F1A\u8BDD\u4ECD\u5728\u5904\u7406\u4E0A\u4E00\u9879\u4EFB\u52A1\u3002\u8BF7\u7B49\u5F85\u5B8C\u6210\uFF0C\u6216\u53D1\u9001 /stop \u540E\u91CD\u8BD5\u3002":"The current Session is still processing the previous task. Wait for it to finish, or send /stop before trying again.","\u5DE5\u4F5C\u533A\u6216\u4F1A\u8BDD\u72B6\u6001\u521A\u521A\u53D1\u751F\u53D8\u5316\u3002\u8BF7\u91CD\u65B0\u53D1\u9001\u8FD9\u6761\u6D88\u606F\u3002":"The Workspace or Session state just changed. Please send this message again.","\u5F53\u524D\u5DE5\u4F5C\u533A\u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u91CD\u65B0\u9009\u62E9\u5DE5\u4F5C\u533A\u540E\u91CD\u8BD5\u3002":"The current Workspace does not exist or is unavailable. Select another Workspace and try again.","\u5F53\u524D Agent Preset \u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u53D1\u9001 /presetlist \u540E\u91CD\u65B0\u9009\u62E9\u3002":"The current Agent Preset does not exist or is unavailable. Send /presetlist and select another one.","\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u6CA1\u6709\u53D1\u9001\u6743\u9650\u3002\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u6E20\u9053\u6743\u9650\u6216\u91CD\u65B0\u7ED1\u5B9A\u673A\u5668\u4EBA\u3002":"The reply was generated, but the bot cannot send it. Ask an administrator to check channel permissions or reconnect the bot.","\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6B63\u5728\u9650\u6D41\uFF0C\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The reply was generated, but this channel is rate-limiting messages. Please try again later.","\u56DE\u590D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\u3002\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u7ECF\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002":"Reply delivery could not be confirmed. Check whether it already arrived before submitting the task again.","\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The reply was generated, but this channel could not send it. Please try again later.","\u5F53\u524D\u6D88\u606F\u5305\u542B\u65E0\u6CD5\u5904\u7406\u7684\u56FE\u7247\u6216\u6587\u4EF6\u3002\u8BF7\u8C03\u6574\u540E\u91CD\u65B0\u53D1\u9001\u3002":"This message contains an image or file that cannot be processed. Adjust it and send it again.","\u4EFB\u52A1\u672A\u5B8C\u6210\uFF0C\u6682\u65F6\u65E0\u6CD5\u786E\u5B9A\u539F\u56E0\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5C06\u53C2\u8003\u53F7\u63D0\u4F9B\u7ED9\u7BA1\u7406\u5458\u3002":"The task did not finish and the cause could not be determined. Try again; if it persists, give the reference ID to an administrator.","\u9519\u8BEF\u7801\uFF1A{code}\uFF1B\u53C2\u8003\u53F7\uFF1A{referenceId}":"Error code: {code}; reference: {referenceId}","{label}\u673A\u5668\u4EBA":"{label} bot","\u76EE\u524D\u652F\u6301\u6587\u5B57\u548C\u56FE\u7247\u6D88\u606F\u3002":"Only text and image messages are supported at the moment.","\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u6587\u4EF6\u6D88\u606F\u3002":"Only text, image, and file messages are supported at the moment.","\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\u548C\u8BED\u97F3\u8F6C\u5199\u6D88\u606F\u3002":"Only text, image, file, and voice-transcription messages are supported at the moment.","\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\uFF0C\u4EE5\u53CA\u5FAE\u4FE1\u5DF2\u8F6C\u6210\u6587\u5B57\u7684\u8BED\u97F3\u6D88\u606F\u3002":"Only text, image, file, and voice messages already transcribed to text by WeChat are supported at the moment.","\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u6216\u56FE\u7247\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Send text or an image directly to continue the current session.","\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u6216\u6587\u4EF6\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Send text, an image, or a file directly to continue the current session.","\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\u6216\u5E26\u6587\u5B57\u8BC6\u522B\u7ED3\u679C\u7684\u8BED\u97F3\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002":"Send text, an image, a file, or a voice message already transcribed to text to continue the current session.","{label}\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002":"The {label} bot is connected to DeepSeek Harness.","/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD":"/new Start a brand-new session","/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587":"/compact Compact the earlier context of the current session","/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A":"/workspace Switch workspace","/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84":"/workspacelist List absolute workspace paths","/ws\u3001/wsl\u3001/workspaces \u5DE5\u4F5C\u533A\u547D\u4EE4\u522B\u540D":"/ws, /wsl, /workspaces Workspace command aliases","/sessionlist [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898":"/sessionlist [workspace index or absolute path] List session IDs and titles","/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898":"/sessionlist or /sessions [workspace index or absolute path] List session IDs and titles","/sessionlist --limit N \u4EC5\u5217\u51FA\u5F53\u524D\u5DE5\u4F5C\u533A\u524D N \u4E2A\u4F1A\u8BDD":"/sessionlist --limit N List only the first N sessions in the current workspace","/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD":"/session Bind this chat to the specified session","/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B":"/models List all available models by index","/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7":"/reasoninglist or /reasonings List reasoning efforts for the current model by index","/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7":"/reasoning [index, effort ID, or --default] Show or switch the current reasoning effort","/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B":"/model [index or full model ID] Show or switch the model of the current session","/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B":"/model [index or full model ID] [reasoning effort ID] Show or switch the current Session model","\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2":"Example: send /models first, then /model 2","\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]":"Example: send /models first, then /model 2 [reasoning effort ID]","/presetlist \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset":"/presetlist List available Agent Presets by index","/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset":"/presetlist or /presets List available Agent Presets by index","/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset":"/preset [index or full ID] Show or set the Agent Preset of this bot","\u7EAF\u6570\u5B57 ID\uFF1A/preset id:":"Numeric-only ID: /preset id:","/preset --default \u8DDF\u968F Host \u9ED8\u8BA4":"/preset --default Follow the Host default","/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1":"/stop Stop the current task","/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1":"/steer Steer the current task","/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001":"/status Check the connection status","/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C":"/version Show the plugin version","/help \u663E\u793A\u672C\u5E2E\u52A9":"/help Show this help","{label}\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002":"The {label} bot is connected to DeepSeek Harness and working normally.","{label}\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002":"{label} bot credentials are missing. Remove the bot and connect it again.","{label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The {label} connection is not ready yet. The plugin will retry automatically.","{label}\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002":"The {label} bot is connected, but its message connection is not ready yet.","{label}\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"The {label} connection is still not ready. Please try again later.","{label}\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5":"The {label} bot is not connected yet","{name}\uFF08{id}\uFF09":"{name} ({id})","{label}{connectionLabel}\u8FD0\u884C\u6B63\u5E38":"The {label}{connectionLabel} is running normally","{label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The {label} connection is not ready. The plugin will retry automatically","{label}\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF":"The {label} connection is currently offline","\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002":"A new session has started. Please send your question.","\u6B63\u5728\u4F7F\u7528{name}\u2026":"Using {name}\u2026","\u5DF2\u505C\u6B62\u3002":"Stopped.","\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002":"Please answer the current question with text.","{label}\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002":"Failed to send the {label} interaction question.","\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002":"Failed to submit the answer.","\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002":"Failed to submit the answer. Please resend your answer to the current question.","\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002":"A pending question left over in this Session was detected. It has been safely cancelled, and your latest message is being processed."};var _x={"\u7528\u6CD5\uFF1A/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7\uFF08/session N\uFF09":"Usage: /session Session ID or the session index in the current Workspace (/session N)","\u7528\u6CD5\uFF1A\n/sessionlist \u5217\u51FA\u5F53\u524D\u5DE5\u4F5C\u533A\u4F1A\u8BDD\n/sessionlist --limit N \u5217\u51FA\u5F53\u524D\u5DE5\u4F5C\u533A\u524D N \u4E2A\u4F1A\u8BDD\uFF08N \u4E3A\u6B63\u6574\u6570\uFF09\n/sessionlist \u5DE5\u4F5C\u533A\u5E8F\u53F7 \u6309 /workspacelist \u5E8F\u53F7\u5217\u51FA\u4F1A\u8BDD\n/sessionlist \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84 \u5217\u51FA\u6307\u5B9A\u5DE5\u4F5C\u533A\u4F1A\u8BDD":`Usage: /sessionlist List Sessions in the current Workspace @@ -138,14 +138,14 @@ Reply with a number for a quick action: `,{encoding:"utf8",flag:"wx",mode:384}),await fpe(o,this.#e)}catch(a){try{await jx(o)}catch(e){if(e?.code!=="ENOENT")throw new AggregateError([a,e])}throw a}}};var Zx="https://oapi.dingtalk.com",Tpe="DING_DWS_CLAW";function Qn(n){return typeof n=="string"&&n.trim()?n.trim():null}function Wx(n,t){let o=Number(n);return Number.isFinite(o)&&o>0?o:t}function Npe(n){let t;try{t=new URL(Qn(n)??Zx)}catch{throw new TypeError("DingTalk registration base URL must be a valid HTTPS URL")}let o=t.hostname==="dingtalk.com"||t.hostname.endsWith(".dingtalk.com");if(t.protocol!=="https:"||t.port||!o||t.username||t.password||t.search||t.hash)throw new TypeError("DingTalk registration base URL must be a valid HTTPS URL");return t.pathname=t.pathname.replace(/\/+$/,""),t.href.replace(/\/$/,"")}function Rpe(n){let t=typeof n?.now=="function"?n.now():n();if(!Number.isFinite(t))throw new TypeError("clock must return a finite timestamp");return t}function kpe(n,t){if(!n||typeof n!="object"||Array.isArray(n))throw new os("invalid-response",`DingTalk ${t} returned an invalid response`,t);if(Number(n.errcode)!==0)throw new os("api-error",`DingTalk ${t} request was rejected`,t);return n}var os=class extends Error{constructor(t,o,a,e={}){super(o,e),this.name="DingtalkDeviceAuthError",this.code=t,this.action=a}},RQ=class{#e;#A;#t;#r;constructor({fetch:t=globalThis.fetch,clock:o=Date,baseUrl:a=Zx,timeoutMs:e=15e3}={}){if(typeof t!="function")throw new TypeError("fetch is required");if(typeof o!="function"&&typeof o?.now!="function")throw new TypeError("clock must be a function or expose now()");if(!Number.isFinite(e)||e<=0)throw new TypeError("timeoutMs must be a positive number");this.#e=t,this.#A=o,this.#t=Npe(a),this.#r=e}async start({signal:t}={}){let o=await this.#I("/app/registration/init",{source:Tpe},"initialization",t),a=Qn(o.nonce);if(!a)throw new os("missing-nonce","DingTalk registration initialization did not return a nonce","initialization");let e=await this.#I("/app/registration/begin",{nonce:a},"begin",t),i=Qn(e.device_code),A=Qn(e.verification_uri_complete);if(!i||!A)throw new os("incomplete-registration","DingTalk registration did not return complete QR metadata","begin");let r=Wx(e.expires_in,7200),s=Wx(e.interval,5)*1e3;return Object.freeze({deviceCode:i,verificationUrl:A,verificationUri:Qn(e.verification_uri),userCode:Qn(e.user_code),expiresAt:Rpe(this.#A)+r*1e3,pollIntervalMs:s})}async poll(t){let o=Qn(typeof t=="string"?t:t?.deviceCode),a=typeof t=="object"?t?.signal:void 0;if(!o)throw new TypeError("deviceCode is required");let e=await this.#I("/app/registration/poll",{device_code:o},"poll",a),i=Qn(e.status)?.toUpperCase(),A=["WAITING","SUCCESS","FAIL","EXPIRED"].includes(i)?i:"UNKNOWN";return Object.freeze({status:A,clientId:Qn(e.client_id),clientSecret:Qn(e.client_secret),failReason:Qn(e.fail_reason)})}async#I(t,o,a,e){let i,A=AbortSignal.timeout(this.#r),r=e?AbortSignal.any([e,A]):A;try{i=await this.#e(`${this.#t}${t}`,{method:"POST",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(o),redirect:"error",signal:r})}catch(g){throw e?.aborted?e.reason??g:A.aborted?new os("timeout",`DingTalk ${a} request timed out`,a,{cause:g}):g?.name==="AbortError"?g:new os("network-error",`DingTalk ${a} request could not be completed`,a,{cause:g})}if(!i||i.ok===!1||typeof i.json!="function")throw new os("http-error",`DingTalk ${a} request failed`,a);let s;try{s=await i.json()}catch(g){throw new os("invalid-json",`DingTalk ${a} returned invalid JSON`,a,{cause:g})}return kpe(s,a)}};import{randomUUID as tde}from"node:crypto";var Xx=new WeakMap,h_=Symbol("dsh-im.connection-test-state-identity");function $x(n){return n?.[h_]??n}function vpe(n){return typeof n=="string"&&n.trim()?n.trim():null}function bo(n,t){if(!n||!t||typeof t!="object")return!1;try{return Xx.set($x(n),structuredClone(t)),!0}catch{return!1}}function ZE(n){let t=n?Xx.get($x(n)):null;return t?structuredClone(t):null}function Ui(n,t=w("\u673A\u5668\u4EBA")){let o=vpe(n)??t;return`${w("\u2705 DeepSeek Harness \u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F")} ${w("\u8FD9\u6761\u6D88\u606F\u7531\u300CIM\u673A\u5668\u4EBA\u300D\u8BBE\u7F6E\u9875\u4E2D\u7684\u201C{name}\u201D\u673A\u5668\u4EBA\u5361\u7247\u53D1\u51FA\u3002",{name:o})}`}function Qr(n=w("\u673A\u5668\u4EBA")){let t=new Error(w("{channelLabel}\u5C1A\u672A\u6536\u5230\u53EF\u7528\u4E8E\u6D4B\u8BD5\u7684\u79C1\u804A\u6D88\u606F\u3002",{channelLabel:n}));return t.code="test-target-unavailable",t}async function Ec({state:n,send:t,text:o,channelLabel:a}){let e=ZE(n);if(!e)throw Qr(a);return await t(e,o),{sent:!0}}function lr(n){return Object.freeze(n?{sent:!1,code:n?.code==="test-target-unavailable"?"test-target-unavailable":"test-message-failed"}:{sent:!0})}import{randomUUID as Ppe}from"node:crypto";var Gpe=Object.freeze({AUTH:"MODEL_AUTH",MISSING_CREDENTIAL:"MODEL_AUTH",INVALID_CREDENTIAL:"MODEL_AUTH",QUOTA:"MODEL_QUOTA",RATE_LIMIT:"MODEL_RATE_LIMIT",CONTEXT_WINDOW_EXCEEDED:"MODEL_CONTEXT_LIMIT",UNKNOWN_MODEL:"MODEL_UNAVAILABLE",NO_ADAPTER:"MODEL_UNAVAILABLE",UNSUPPORTED_OPTION:"MODEL_CONFIG",UNSUPPORTED_REASONING_EFFORT:"MODEL_CONFIG",TIMEOUT:"MODEL_TIMEOUT",TRANSPORT:"MODEL_TRANSPORT",SERVER:"MODEL_SERVICE",STREAM_CLOSED:"MODEL_STREAM",MALFORMED_RESPONSE:"MODEL_STREAM",EMPTY_RESPONSE:"MODEL_EMPTY_REPLY",CONTENT_FILTER:"MODEL_CONTENT_REJECTED",UNSUPPORTED_CONTENT:"MODEL_CONFIG"}),Fpe=Object.freeze({HARNESS_CONNECT:"\u65E0\u6CD5\u8FDE\u63A5\u5904\u7406\u670D\u52A1\uFF0C\u6D88\u606F\u5C1A\u672A\u63D0\u4EA4\u3002\u8BF7\u786E\u8BA4 DeepSeek Harness \u6B63\u5728\u8FD0\u884C\u540E\u91CD\u8BD5\u3002",HARNESS_TIMEOUT:"\u5904\u7406\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u6D88\u606F\u5C1A\u672A\u5F00\u59CB\u5904\u7406\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",HARNESS_RESULT_UNCERTAIN:"\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u4EFB\u52A1\u72B6\u6001\uFF0C\u4EFB\u52A1\u53EF\u80FD\u5DF2\u7ECF\u5F00\u59CB\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",HARNESS_ACCESS:"\u5904\u7406\u670D\u52A1\u62D2\u7EDD\u4E86\u673A\u5668\u4EBA\u8FDE\u63A5\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u3001\u4EE3\u7406\u6216\u8BBF\u95EE\u914D\u7F6E\u540E\u91CD\u8BD5\u3002",HARNESS_PROTOCOL:"\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u7684\u63A5\u53E3\u4E0D\u517C\u5BB9\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5 Harness \u5730\u5740\u5E76\u66F4\u65B0\u76F8\u5173\u7248\u672C\u3002",HARNESS_SERVICE:"DeepSeek Harness \u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u8BF7\u6C42\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_REPLY_TIMEOUT:"\u7B49\u5F85\u6A21\u578B\u56DE\u590D\u8D85\u65F6\uFF0C\u4EFB\u52A1\u53EF\u80FD\u4ECD\u5728\u8FD0\u884C\u3002\u8BF7\u5148\u7B49\u5F85\u6216\u53D1\u9001 /stop\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",MODEL_AUTH:"\u6A21\u578B\u51ED\u636E\u7F3A\u5931\u6216\u5DF2\u5931\u6548\u3002\u8BF7\u7BA1\u7406\u5458\u68C0\u67E5\u6A21\u578B\u914D\u7F6E\u540E\u91CD\u8BD5\u3002",MODEL_QUOTA:"\u6A21\u578B\u989D\u5EA6\u6216\u4F59\u989D\u4E0D\u8DB3\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7BA1\u7406\u5458\u8865\u5145\u989D\u5EA6\u6216\u5207\u6362\u6A21\u578B\u540E\u91CD\u8BD5\u3002",MODEL_RATE_LIMIT:"\u6A21\u578B\u670D\u52A1\u6B63\u5728\u9650\u6D41\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_CONTEXT_LIMIT:"\u5F53\u524D\u4F1A\u8BDD\u5185\u5BB9\u8D85\u8FC7\u6A21\u578B\u4E0A\u4E0B\u6587\u4E0A\u9650\u3002\u8BF7\u53D1\u9001 /compact \u6216 /new \u540E\u91CD\u8BD5\u3002",MODEL_UNAVAILABLE:"\u5F53\u524D\u6A21\u578B\u4E0D\u5B58\u5728\u6216\u4E0D\u652F\u6301\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u53D1\u9001 /models\uFF0C\u5E76\u4F7F\u7528 /model \u91CD\u65B0\u9009\u62E9\u3002",MODEL_CONFIG:"\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u8FD9\u7C7B\u5185\u5BB9\u6216\u6240\u9009\u914D\u7F6E\u3002\u8BF7\u8C03\u6574\u5185\u5BB9\u3001\u6A21\u578B\u6216\u63A8\u7406\u7B49\u7EA7\u540E\u91CD\u8BD5\u3002",MODEL_TIMEOUT:"\u6A21\u578B\u670D\u52A1\u54CD\u5E94\u8D85\u65F6\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_TRANSPORT:"\u6682\u65F6\u65E0\u6CD5\u8FDE\u63A5\u6A21\u578B\u670D\u52A1\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_SERVICE:"\u6A21\u578B\u670D\u52A1\u6682\u65F6\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",MODEL_STREAM:"\u6A21\u578B\u56DE\u590D\u4E2D\u65AD\u6216\u683C\u5F0F\u5F02\u5E38\uFF0C\u672C\u6B21\u4EFB\u52A1\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002",MODEL_EMPTY_REPLY:"\u6A21\u578B\u6CA1\u6709\u8FD4\u56DE\u53EF\u663E\u793A\u7684\u5185\u5BB9\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5207\u6362\u6A21\u578B\u3002",MODEL_CONTENT_REJECTED:"\u6A21\u578B\u62D2\u7EDD\u5904\u7406\u5F53\u524D\u5185\u5BB9\u3002\u8BF7\u8C03\u6574\u95EE\u9898\u5185\u5BB9\u540E\u91CD\u8BD5\u3002",MODEL_OUTPUT_LIMIT:"\u6A21\u578B\u8FBE\u5230\u8F93\u51FA\u957F\u5EA6\u4E0A\u9650\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u7ED3\u679C\u3002\u8BF7\u7F29\u5C0F\u4EFB\u52A1\u8303\u56F4\u540E\u91CD\u8BD5\u3002",TURN_BLOCKED:"\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u65E0\u6CD5\u5728\u5F53\u524D\u6E20\u9053\u5B8C\u6210\u7684\u64CD\u4F5C\u3002\u8BF7\u5728 DeepSeek Harness \u4E2D\u5904\u7406\u540E\u518D\u8BD5\u3002",TURN_INTERRUPTED:"\u4EFB\u52A1\u88AB\u610F\u5916\u4E2D\u65AD\uFF0C\u672C\u6B21\u672A\u5B8C\u6210\u3002\u8BF7\u91CD\u8BD5\u3002",SESSION_NOT_FOUND:"\u5F53\u524D\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\u3002\u8BF7\u53D1\u9001 /new \u521B\u5EFA\u65B0\u4F1A\u8BDD\u540E\u91CD\u8BD5\u3002",SESSION_BUSY:"\u5F53\u524D\u4F1A\u8BDD\u4ECD\u5728\u5904\u7406\u4E0A\u4E00\u9879\u4EFB\u52A1\u3002\u8BF7\u7B49\u5F85\u5B8C\u6210\uFF0C\u6216\u53D1\u9001 /stop \u540E\u91CD\u8BD5\u3002",SESSION_STALE:"\u5DE5\u4F5C\u533A\u6216\u4F1A\u8BDD\u72B6\u6001\u521A\u521A\u53D1\u751F\u53D8\u5316\u3002\u8BF7\u91CD\u65B0\u53D1\u9001\u8FD9\u6761\u6D88\u606F\u3002",WORKSPACE_UNAVAILABLE:"\u5F53\u524D\u5DE5\u4F5C\u533A\u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u91CD\u65B0\u9009\u62E9\u5DE5\u4F5C\u533A\u540E\u91CD\u8BD5\u3002",PRESET_UNAVAILABLE:"\u5F53\u524D Agent Preset \u4E0D\u5B58\u5728\u6216\u6682\u4E0D\u53EF\u7528\u3002\u8BF7\u53D1\u9001 /presetlist \u540E\u91CD\u65B0\u9009\u62E9\u3002",CHANNEL_PERMISSION:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u6CA1\u6709\u53D1\u9001\u6743\u9650\u3002\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u68C0\u67E5\u6E20\u9053\u6743\u9650\u6216\u91CD\u65B0\u7ED1\u5B9A\u673A\u5668\u4EBA\u3002",CHANNEL_RATE_LIMIT:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6B63\u5728\u9650\u6D41\uFF0C\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",CHANNEL_DELIVERY_UNCERTAIN:"\u56DE\u590D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\u3002\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u7ECF\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u590D\u63D0\u4EA4\u3002",CHANNEL_DELIVERY:"\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u65E0\u6CD5\u53D1\u9001\u3002\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",INPUT_INVALID:"\u5F53\u524D\u6D88\u606F\u5305\u542B\u65E0\u6CD5\u5904\u7406\u7684\u56FE\u7247\u6216\u6587\u4EF6\u3002\u8BF7\u8C03\u6574\u540E\u91CD\u65B0\u53D1\u9001\u3002",INTERNAL_UNKNOWN:"\u4EFB\u52A1\u672A\u5B8C\u6210\uFF0C\u6682\u65F6\u65E0\u6CD5\u786E\u5B9A\u539F\u56E0\u3002\u8BF7\u91CD\u8BD5\uFF1B\u82E5\u6301\u7EED\u53D1\u751F\uFF0C\u8BF7\u5C06\u53C2\u8003\u53F7\u63D0\u4F9B\u7ED9\u7BA1\u7406\u5458\u3002"});function Lpe(n){if(n?.code!=="harness-turn-failed")return null;let t=n?.providerCode??n?.details?.providerCode;return typeof t!="string"?null:Gpe[t.trim().toUpperCase()]??null}function Upe(n){let t=typeof n?.code=="string"?n.code:"",o=Lpe(n);if(o)return o;if(t==="harness-connect-failed")return["session.prompt","session.history"].includes(n?.method)?"HARNESS_RESULT_UNCERTAIN":"HARNESS_CONNECT";if(t==="harness-timeout")return["session.prompt","session.history"].includes(n?.method)?"HARNESS_RESULT_UNCERTAIN":"HARNESS_TIMEOUT";if(t==="harness-reply-timeout")return"MODEL_REPLY_TIMEOUT";if(["harness-auth-required","harness-proxy-auth-required","harness-loopback-forbidden","harness-host-untrusted","harness-request-forbidden"].includes(t))return"HARNESS_ACCESS";if(["harness-api-not-found","harness-response-invalid"].includes(t))return"HARNESS_PROTOCOL";if(t==="harness-turn-failed")return"INTERNAL_UNKNOWN";if(["harness-http-failed","harness-rpc-rejected"].includes(t))return"HARNESS_SERVICE";if(t==="model-empty-response")return"MODEL_EMPTY_REPLY";if(t==="model-max-tokens")return"MODEL_OUTPUT_LIMIT";if(t==="turn-blocked")return"TURN_BLOCKED";if(["turn-interrupted","turn-aborted"].includes(t))return"TURN_INTERRUPTED";if(t==="session-not-found")return"SESSION_NOT_FOUND";if(t==="agent-busy")return"SESSION_BUSY";if(t==="workspace-session-stale")return"SESSION_STALE";if(t.startsWith("workspace-"))return"WORKSPACE_UNAVAILABLE";if(t.startsWith("agent-preset-"))return"PRESET_UNAVAILABLE";if(t.startsWith("image-")||t.startsWith("inbound-file-")||t==="attachment-error")return"INPUT_INVALID";let a=Number(n?.status??n?.httpStatus);return a===401||a===403||["channel-permission","permission-required","artifact-permission-required","forbidden","stale-token"].includes(t)?"CHANNEL_PERMISSION":a===429||["channel-rate-limit","rate-limited","artifact-rate-limited"].includes(t)?"CHANNEL_RATE_LIMIT":["channel-delivery-uncertain","delivery-uncertain","artifact-delivery-uncertain"].includes(t)?"CHANNEL_DELIVERY_UNCERTAIN":t==="channel-delivery-failed"||t.startsWith("artifact-")||["network-error","timeout"].includes(t)?"CHANNEL_DELIVERY":"INTERNAL_UNKNOWN"}function Hpe(n){return typeof n=="string"&&/^[A-Z0-9-]{6,40}$/u.test(n)?n:`MF-${Ppe().slice(0,8).toUpperCase()}`}function Kpe(n){return typeof n!="string"||!/^[A-Za-z0-9_-]{1,64}$/u.test(n)?null:n.toUpperCase().replaceAll("-","_")}function xpe(n,{userMessage:t,reason:o,referenceId:a,at:e=Date.now()}={}){let i=Kpe(o),A=Upe(n),r=A==="INTERNAL_UNKNOWN"&&i&&typeof t=="string"&&t.trim()?"INPUT_INVALID":A;return Object.freeze({code:r,reason:i??r,message:typeof t=="string"&&t.trim()?t.trim():w(Fpe[r]),referenceId:Hpe(a),at:Number.isFinite(e)?e:Date.now()})}function ut(n){return`${n.message} -${w("\u9519\u8BEF\u7801\uFF1A{code}\uFF1B\u53C2\u8003\u53F7\uFF1A{referenceId}",n)}`}function rt(n,t,o){let a=xpe(t,o);return n.lastMessageError=a,a}function Mo(n){n.lastMessageError=null}function Hi(n,{uncertain:t=!0}={}){let o=new Error("Channel message delivery failed",{cause:n}),a=Number(n?.status??n?.httpStatus);return o.code=a===401||a===403?"channel-permission":a===429?"channel-rate-limit":t?"channel-delivery-uncertain":"channel-delivery-failed",Number.isInteger(a)&&(o.status=a),o}function ti(n){return!n||typeof n!="object"||typeof n.code!="string"||!n.code||typeof n.reason!="string"||!n.reason||typeof n.message!="string"||!n.message||typeof n.referenceId!="string"||!n.referenceId||!Number.isFinite(n.at)?null:{code:n.code.slice(0,64),reason:n.reason.slice(0,64),message:n.message.slice(0,500),referenceId:n.referenceId.slice(0,40),at:n.at}}import{randomUUID as Ype}from"node:crypto";import{createRequire as eY}from"node:module";var jpe=eY(import.meta.url),E_=new Set(["dingtalk-harness-connect-failed","dingtalk-runtime-prepare-failed","dingtalk-stream-client-load-failed","dingtalk-stream-listener-failed","dingtalk-stream-connect-failed"]),Jpe=Object.freeze(["HTTPS_PROXY","https_proxy","HTTP_PROXY","http_proxy","ALL_PROXY","all_proxy"]),qpe=/^\d+\.\d+\.\d+(?:[-+][A-Za-z0-9.-]+)?$/,zpe=/^DT-CONN-[A-F0-9]{8}$/,kQ;function ns(n,t=500){if(typeof n!="string")return null;let o=n.trim();return o?o.slice(0,t):null}function kp(n){let t=ns(n,80);return t&&qpe.test(t)?t:null}function vQ(n,t=jpe){try{let o=t.resolve(`${n}/package.json`);return{version:kp(t(o)?.version),require:eY(o)}}catch{return null}}function Vpe(){if(kQ)return kQ;let n=vQ("dingtalk-stream"),t=n?vQ("axios",n.require):null,o=t?vQ("https-proxy-agent",t.require):null,a=o?vQ("agent-base",o.require):null;return kQ=Object.freeze({dingtalkStream:n?.version??null,axios:t?.version??null,httpsProxyAgent:o?.version??null,agentBase:a?.version??null}),kQ}function Wpe(n){let t=[],o=new Set,a=n;for(;a&&typeof a=="object"&&t.length<4&&!o.has(a);)o.add(a),t.push(a),a=a.cause;return t}function AY(n){return Number.isInteger(n?.status)?n.status:Number.isInteger(n?.statusCode)?n.statusCode:Number.isInteger(n?.response?.status)?n.response.status:null}function Zpe(n){let t=ns(n?.providerCode??n?.response?.data?.code??n?.response?.data?.errorCode??n?.response?.data?.errcode,100);return t&&/^[A-Za-z0-9_.:-]+$/.test(t)?t:null}function Xpe(n,t){let o=ns(n);if(!o)return null;for(let a of t){let e=ns(a,2048);e&&e.length>=4&&(o=o.replaceAll(e,"\u2022\u2022\u2022\u2022"))}return o.replace(/(https?:\/\/)[^/\s@]+@/giu,"$1\u2022\u2022\u2022\u2022@").replace(/([?&](?:appsecret|client_secret|clientsecret|access_token|token|password)=)[^&\s]*/giu,"$1\u2022\u2022\u2022\u2022").replace(/((?:app|client|access)[_-]?secret|authorization|password|token)\s*[=:]\s*[^\s,;,。]+/giu,"$1=\u2022\u2022\u2022\u2022").replace(/\b[A-Za-z0-9_.-]*secret[A-Za-z0-9_.-]*\b/giu,"\u2022\u2022\u2022\u2022").slice(0,500)}function $pe(n){let t=n&&typeof n=="object"?n:{};return{dingtalkStream:kp(t.dingtalkStream),axios:kp(t.axios),httpsProxyAgent:kp(t.httpsProxyAgent),agentBase:kp(t.agentBase)}}function ede(n,t){return n.map(o=>{let a=ns(o?.name,80),e=ns(o?.code,100),i=AY(o),A=Zpe(o),r=Xpe(o?.message,t);return{...a?{name:a}:{},...e?{code:e}:{},...i!==null?{status:i}:{},...A?{providerCode:A}:{},...r?{message:r}:{}}})}function Ade(n){return zpe.test(n??"")?n:`DT-CONN-${Ype().replaceAll("-","").slice(0,8).toUpperCase()}`}function _o(n,t,o,a){return Object.freeze({code:n,message:w(t),hint:w(o),referenceId:a})}function vp(n,t){if(t?.name==="AbortError"||E_.has(t?.code))return t;let o=new Error(ns(t?.message)??"DingTalk runtime startup failed",{cause:t});return o.name="DingtalkRuntimeStartError",o.code=E_.has(n)?n:"dingtalk-runtime-prepare-failed",o}function tY(n,{fallbackMessage:t="\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",clientId:o,clientSecret:a,environment:e=process.env,dependencies:i=Vpe(),nodeVersion:A=process.versions.node,referenceId:r}={}){let s=Ade(r),g=Wpe(n),c=new Set(g.map(L=>ns(L?.code,100)?.toUpperCase()).filter(Boolean)),I=g.map(L=>ns(L?.message)?.toLowerCase()).filter(Boolean),p=g.map(AY).filter(L=>L!==null),B=g.map(L=>L?.code).find(L=>E_.has(L))??null,f=Jpe.filter(L=>ns(e?.[L],4096)),Q=f.length>0,y=$pe(i),m=L=>I.some(U=>L.test(U)),T=L=>[...c].some(U=>L.test(U)),_=p.includes(407)||T(/(?:PROXY|ERR_INVALID_PROTOCOL)/u)||m(/proxy|tunneling socket/u),R;return B==="dingtalk-stream-connect-failed"&&Q&&y.agentBase==="6.0.0"?R=_o("stream-proxy-dependency-incompatible","\u9489\u9489 Stream \u8FDE\u63A5\u5931\u8D25\uFF1A\u68C0\u6D4B\u5230\u4EE3\u7406\u4F9D\u8D56 agent-base 6.0.0\u3002","\u8BF7\u5C06 DSH profile \u4E2D\u7684 agent-base@6 \u56FA\u5B9A\u4E3A 6.0.2 \u540E\u91CD\u65B0\u5B89\u88C5\u4F9D\u8D56\uFF0C\u6216\u5347\u7EA7 pnpm \u540E\u91CD\u65B0\u89E3\u6790 lockfile\u3002",s):B==="dingtalk-harness-connect-failed"?R=_o("harness-unavailable","\u63D2\u4EF6\u65E0\u6CD5\u8FDE\u63A5\u672C\u673A Harness\u3002","\u8BF7\u786E\u8BA4 dsh web \u6B63\u5E38\u8FD0\u884C\uFF0C\u5E76\u67E5\u770B dsh web \u65E5\u5FD7\u4E2D\u76F8\u540C\u53C2\u8003\u53F7\u5BF9\u5E94\u7684\u8BCA\u65AD\u4FE1\u606F\u3002",s):B==="dingtalk-stream-client-load-failed"?R=_o("stream-sdk-load-failed","\u9489\u9489 Stream SDK \u52A0\u8F7D\u5931\u8D25\u3002","\u8BF7\u91CD\u65B0\u5B89\u88C5\u5F53\u524D DSH profile \u7684\u63D2\u4EF6\u4F9D\u8D56\uFF0C\u5E76\u67E5\u770B dsh web \u65E5\u5FD7\u4E2D\u76F8\u540C\u53C2\u8003\u53F7\u5BF9\u5E94\u7684\u8BCA\u65AD\u4FE1\u606F\u3002",s):p.some(L=>L===401||L===403)?R=_o("stream-credentials-rejected","\u9489\u9489\u62D2\u7EDD\u4E86\u5F53\u524D\u5E94\u7528\u51ED\u636E\u3002","\u8BF7\u6838\u5BF9 Client ID\u3001Client Secret \u548C\u673A\u5668\u4EBA\u6743\u9650\u540E\u91CD\u8BD5\u3002",s):T(/(?:TIMEOUT|ETIMEDOUT)/u)||m(/timed? out|timeout/u)?R=_o("stream-handshake-timeout","\u8FDE\u63A5\u9489\u9489 Stream \u8D85\u65F6\u3002","\u8BF7\u68C0\u67E5\u7F51\u7EDC\u3001\u4EE3\u7406\u548C\u9632\u706B\u5899\u540E\u91CD\u8BD5\uFF1B\u8BE6\u7EC6\u539F\u56E0\u53EF\u5728 dsh web \u65E5\u5FD7\u4E2D\u6309\u53C2\u8003\u53F7\u67E5\u627E\u3002",s):T(/^(?:ENOTFOUND|EAI_AGAIN)$/u)?R=_o("stream-dns-failed","\u65E0\u6CD5\u89E3\u6790\u9489\u9489\u670D\u52A1\u5730\u5740\u3002","\u8BF7\u68C0\u67E5 DNS\u3001\u7F51\u7EDC\u548C\u4EE3\u7406\u8BBE\u7F6E\uFF1B\u8BE6\u7EC6\u539F\u56E0\u53EF\u5728 dsh web \u65E5\u5FD7\u4E2D\u6309\u53C2\u8003\u53F7\u67E5\u627E\u3002",s):T(/(?:CERT|TLS|SSL|UNABLE_TO_VERIFY)/u)?R=_o("stream-tls-failed","\u9489\u9489 Stream \u7684 TLS \u8FDE\u63A5\u6821\u9A8C\u5931\u8D25\u3002","\u8BF7\u68C0\u67E5\u7CFB\u7EDF\u8BC1\u4E66\u3001\u4EE3\u7406\u8BC1\u4E66\u6216 HTTPS \u4E2D\u95F4\u4EE3\u7406\uFF1B\u8BE6\u7EC6\u539F\u56E0\u53EF\u5728 dsh web \u65E5\u5FD7\u4E2D\u6309\u53C2\u8003\u53F7\u67E5\u627E\u3002",s):B==="dingtalk-stream-connect-failed"&&_?R=_o("stream-proxy-failed","\u9489\u9489 Stream \u65E0\u6CD5\u901A\u8FC7\u5F53\u524D\u4EE3\u7406\u5EFA\u7ACB\u8FDE\u63A5\u3002","\u8BF7\u68C0\u67E5 HTTP_PROXY\u3001HTTPS_PROXY\u3001NO_PROXY \u548C\u4EE3\u7406\u8FDE\u901A\u6027\uFF1B\u8BE6\u7EC6\u539F\u56E0\u53EF\u5728 dsh web \u65E5\u5FD7\u4E2D\u6309\u53C2\u8003\u53F7\u67E5\u627E\u3002",s):B==="dingtalk-stream-connect-failed"?R=_o("stream-connect-failed","\u9489\u9489 Stream \u6D88\u606F\u8FDE\u63A5\u5EFA\u7ACB\u5931\u8D25\u3002","\u8BF7\u68C0\u67E5\u7F51\u7EDC\u548C\u673A\u5668\u4EBA\u914D\u7F6E\uFF1B\u8BE6\u7EC6\u539F\u56E0\u53EF\u5728 dsh web \u65E5\u5FD7\u4E2D\u6309\u53C2\u8003\u53F7\u67E5\u627E\u3002",s):B==="dingtalk-stream-listener-failed"?R=_o("stream-listener-failed","\u9489\u9489 Stream \u6D88\u606F\u76D1\u542C\u521D\u59CB\u5316\u5931\u8D25\u3002","\u8BF7\u786E\u8BA4 dsh-im \u4E0E dingtalk-stream \u7248\u672C\u517C\u5BB9\uFF0C\u5E76\u6309\u53C2\u8003\u53F7\u67E5\u770B dsh web \u65E5\u5FD7\u3002",s):B==="dingtalk-runtime-prepare-failed"?R=_o("runtime-prepare-failed","\u9489\u9489\u673A\u5668\u4EBA\u8FD0\u884C\u73AF\u5883\u521D\u59CB\u5316\u5931\u8D25\u3002","\u8BF7\u68C0\u67E5 DSH \u6570\u636E\u76EE\u5F55\u3001\u5DE5\u4F5C\u533A\u548C\u63D2\u4EF6\u4F9D\u8D56\uFF0C\u5E76\u6309\u53C2\u8003\u53F7\u67E5\u770B dsh web \u65E5\u5FD7\u3002",s):R=_o("connection-failed",t,"\u8BF7\u5728 dsh web \u65E5\u5FD7\u4E2D\u67E5\u627E\u76F8\u540C\u53C2\u8003\u53F7\uFF0C\u4EE5\u83B7\u53D6\u5DF2\u8131\u654F\u7684\u5177\u4F53\u9519\u8BEF\u3002",s),Object.freeze({publicError:R,diagnostic:Object.freeze({referenceId:s,category:R.code,stage:B,runtime:{node:kp(A)},proxy:{configured:Q,variables:f},dependencies:y,errors:ede(g,[o,a])})})}function u_(n,t){let o=new Error(n.message,{cause:t});return o.name="DingtalkPublicConnectionError",o.code=n.code,o.publicError=structuredClone(n),o}var rY=new Set(["starting","pending","connecting"]),PQ=new Set(["connected","expired","failed","cancelled"]);function ri(n){return typeof n=="string"&&n.trim()?n.trim():null}function yn(n,t){return Object.freeze({code:n,message:t})}function oY(n){return typeof n?.now=="function"?n.now():n()}function rde(n){return new Date(oY(n)).toISOString()}function uc(){return new DOMException("DingTalk provisioning was cancelled","AbortError")}function UI(n){return n?{attemptId:n.id,status:n.state,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.pollIntervalMs?{pollIntervalMs:n.pollIntervalMs}:{},...n.botId?{botId:n.botId}:{},...n.alreadyConnected?{alreadyConnected:!0}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}function C_(n){if(!n)return{};let t=typeof n.status=="function"?n.status():n.status;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function iY(n,t){if(!n||t.connected===!1||t.ready===!1)return!1;let o=ri(t.dingtalkStreamState??t.dingtalkConnectionState??t.connectionState??t.state)?.toLowerCase();return["failed","error","offline","disconnected","stopped"].includes(o)?!1:t.connected===!0||t.ready===!0||o==="connected"||o==="ready"}function nY(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t=ri(n.staffId??n.senderStaffId??n.senderId);if(!t)return null;let o=ri(n.requestId),a=o&&/^ding_sender_[A-Za-z0-9_-]{1,100}$/.test(o)&&!o.includes(t)?o:null;return a?{requestId:a,staffId:t,displayName:ri(n.displayName??n.senderName??n.senderNick)??w("\u9489\u9489\u7528\u6237"),requestedAt:ri(n.requestedAt)}:null}function aY(n){if(!Array.isArray(n.pendingSenders))return[];let t=new Set,o=[];for(let a of n.pendingSenders){let e=nY(a);!e||t.has(e.staffId)||(t.add(e.staffId),o.push(e))}return o}function ide(n){return{requestId:n.requestId,displayName:n.displayName,senderIdMasked:p_(n.staffId),requestedAt:n.requestedAt}}function ade(n){return{senderKey:n.senderKey,displayName:ri(n.displayName)??w("\u9489\u9489\u7528\u6237"),senderIdMasked:p_(n.staffId),approvedAt:ri(n.approvedAt)}}var XE=class{#e;#A;#t;#r;#I;#o;#c;#i=new Map;#a=new Map;#s=new Map;#p=null;#g=new Map;#l=0;#n=!1;constructor({deviceAuth:t,credentials:o,configStore:a,createRuntime:e,deleteState:i=async()=>{},logger:A=console,clock:r=Date}){if(!t||typeof t.start!="function"||typeof t.poll!="function")throw new TypeError("DingtalkController requires a DingTalk device auth client");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError("DingtalkController requires the DSH credential provider");if(!a||typeof a.list!="function"||typeof a.get!="function"||typeof a.getByClientId!="function"||typeof a.save!="function"||typeof a.remove!="function")throw new TypeError("DingtalkController requires a loaded config store");if(typeof e!="function")throw new TypeError("createRuntime is required");if(typeof i!="function")throw new TypeError("deleteState must be a function");if(typeof r!="function"&&typeof r?.now!="function")throw new TypeError("clock must be a function or expose now()");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r}async initialize(){if(this.#n)return this.status();for(let t of this.#t.list()){let o=this.#i.get(t.botId);try{if(iY(o,C_(o)))continue}catch{}await this.#y(t.botId,async()=>{let a=this.#t.get(t.botId);if(!a||this.#n)return;let e=await this.#m(a.secretRef);if(!e){this.#a.set(a.botId,yn("missing-secret",w("\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"))),this.#E();return}try{await this.#u(a,e),this.#a.delete(a.botId)}catch(i){this.#B({config:a,clientSecret:e,error:i,fallbackMessage:"\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",context:`bot ${a.botId} failed to initialize`})}this.#E()})}return this.status()}async startProvisioning({signal:t}={}){if(this.#n)throw new Error("dsh-dingtalk controller is closed");this.#p&&await this.cancelProvisioning(this.#p);let o={id:tde(),state:"starting",controller:new AbortController,deviceCode:null,verificationUrl:null,expiresAt:null,pollIntervalMs:null,pollTask:null,botId:null,alreadyConnected:!1,error:null};this.#s.set(o.id,o),this.#p=o.id,this.#E();let a=()=>o.controller.abort(t?.reason);t?.aborted?a():t?.addEventListener("abort",a,{once:!0});try{let e=await this.#e.start({signal:o.controller.signal});if(this.#Q(o),o.deviceCode=ri(e.deviceCode),o.verificationUrl=ri(e.verificationUrl),o.expiresAt=Number(e.expiresAt),o.pollIntervalMs=Number(e.pollIntervalMs),!o.deviceCode||!o.verificationUrl||!Number.isFinite(o.expiresAt)||!Number.isFinite(o.pollIntervalMs)||o.pollIntervalMs<=0)throw new Error("DingTalk device auth returned incomplete registration metadata");return o.state="pending",this.#E(),UI(o)}catch(e){if(o.controller.signal.aborted||e?.name==="AbortError"?(o.state="cancelled",o.error=yn("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(o.state="failed",o.error=yn("qr-start-failed",w("\u65E0\u6CD5\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#p===o.id&&(this.#p=null),this.#E(),o.state==="failed")throw e;return UI(o)}finally{t?.removeEventListener("abort",a)}}async bindCredentials({clientId:t,clientSecret:o}={}){if(this.#n)throw new Error("dsh-dingtalk controller is closed");let a=ri(t),e=ri(o);if(!a||!e)throw new TypeError("DingTalk Client ID and Client Secret are required");if(this.#p&&await this.cancelProvisioning(this.#p),this.#n)throw new Error("dsh-dingtalk controller is closed");let i=NQ(a);return await this.#y(i.botId,async()=>{if(this.#n)throw uc();let A=this.#t.getByClientId(a),r=await this.#A.resolve(i.secretRef).catch(()=>{});if(this.#n)throw uc();let s={botId:i.botId,clientId:a,secretRef:i.secretRef,approvedSenders:A?.approvedSenders??[]};await this.#A.set(i.secretRef,e);try{await this.#t.save(s)}catch(g){throw await this.#w(i.secretRef,r),g}try{await this.#u(s,e),this.#a.delete(i.botId)}catch(g){this.#B({config:s,clientSecret:e,error:g,fallbackMessage:"\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",context:`credential-bound bot ${i.botId} is not ready`})}this.#E()}),this.status()}async registrationStatus(t){let o=this.#s.get(t);if(!o)return null;if(PQ.has(o.state)||o.state==="starting")return UI(o);if(oY(this.#c)>=o.expiresAt)return o.state="expired",o.error=yn("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),this.#p===o.id&&(this.#p=null),this.#E(),UI(o);if(!o.pollTask){let a=this.#h(o).finally(()=>{o.pollTask===a&&(o.pollTask=null)});o.pollTask=a}return await o.pollTask,UI(o)}async cancelProvisioning(t){let o=this.#s.get(t);return o?(PQ.has(o.state)||(o.controller.abort(),await o.pollTask?.catch(()=>{}),PQ.has(o.state)||(o.state="cancelled"),o.error??=yn("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))),this.#p===o.id&&(this.#p=null),this.#E(),UI(o)):null}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return await this.#y(t,async()=>{let a=await this.#m(o.secretRef);if(!a)throw new Error("The DingTalk client secret is missing");try{await this.#u(o,a),this.#a.delete(t)}catch(e){let i=this.#B({config:o,clientSecret:a,error:e,fallbackMessage:"\u9489\u9489\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",context:`bot ${t} failed to reconnect`});throw u_(i,e)}finally{this.#E()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return this.#y(t,async()=>{let a=this.#i.get(t);if(!a?.status?.ready||typeof a.sendConnectionTest!="function")throw Qr(w("\u9489\u9489\u673A\u5668\u4EBA"));return a.sendConnectionTest(Ui(w("\u9489\u9489\u673A\u5668\u4EBA\uFF08{clientId}\uFF09",{clientId:d_(o.clientId)})))})}async sendProactiveText(t,o,a,e={}){if(!this.#t.get(t))throw new Error("Unknown DingTalk bot");return this.#y(t,async()=>{let A=this.#i.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,a,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return await this.#y(t,async()=>{let a=await this.#A.resolve(o.secretRef).catch(()=>{});await this.#f(t);try{await this.#A.unset(o.secretRef),await this.#t.remove(t)}catch(e){throw ri(a?.value)&&(await this.#A.set(o.secretRef,a.value).catch(()=>{}),await this.#u(o,a.value).catch(()=>{})),new Error("Unable to remove the DingTalk bot safely.",{cause:e})}try{await this.#I({botId:t,config:o})}catch{this.#o.warn?.(`[dsh-dingtalk] bot ${t} state cleanup failed`)}this.#a.delete(t),this.#E()}),this.status()}async approveSender(t,o){let a=this.#t.get(t);if(!a)throw new Error("Unknown DingTalk bot");let e=this.#i.get(t),i=typeof e?.pendingSender=="function"?nY(e.pendingSender(o)):null,A=aY(C_(e)),r=i?.requestId===o?i:A.find(g=>g.requestId===o);if(!r)throw new Error("Unknown DingTalk sender approval request");if(a.approvedSenders.some(g=>g.staffId===r.staffId))return this.status();let s={...a,approvedSenders:[...a.approvedSenders,{senderKey:zx(),staffId:r.staffId,displayName:r.displayName,approvedAt:rde(this.#c)}]};return await this.#C(a,s),this.status()}async revokeSender(t,o){let a=this.#t.get(t);if(!a)throw new Error("Unknown DingTalk bot");let e=a.approvedSenders.findIndex(A=>A.senderKey===o);if(e===-1)throw new Error("Unknown approved DingTalk sender");let i=[...a.approvedSenders];return i.splice(e,1),await this.#C(a,{...a,approvedSenders:i}),this.status()}status(){let t=this.#t.list().map(e=>{let i=this.#i.get(e.botId),A={};try{A=C_(i)}catch{A={state:"error"}}let r=iY(i,A),s=this.#a.get(e.botId),g=r?"connected":s?"error":"offline",c=new Set(e.approvedSenders.map(p=>p.staffId)),I=aY(A).filter(p=>!c.has(p.staffId)).map(ide);return{botId:e.botId,state:g,connected:r,configured:!0,bot:{name:w("\u9489\u9489\u673A\u5668\u4EBA"),clientIdMasked:d_(e.clientId)},health:{status:r?"healthy":s?"error":"offline",summary:r?w("\u9489\u9489 Stream \u6D88\u606F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38"):s?.message??w("\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:A.lastCheckedAt??null},stats:{messagesReceived:Number(A.messagesReceived)||0,messagesReplied:Number(A.messagesReplied)||0},lastMessageError:ti(A.lastMessageError),senders:{pending:I,approved:e.approvedSenders.map(ade)},error:s?structuredClone(s):null}}),o=t.filter(e=>e.connected).length,a=this.#p?this.#s.get(this.#p):null;return{schemaVersion:1,revision:this.#l,state:a&&rY.has(a.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...a&&rY.has(a.state)?{provisioning:UI(a)}:{}}}async close(){this.#n||(this.#n=!0,this.#p&&await this.cancelProvisioning(this.#p),await Promise.allSettled([...this.#i.keys()].map(t=>this.#f(t))),await Promise.allSettled([...this.#g.values()]),await Promise.allSettled([...this.#i.keys()].map(t=>this.#f(t))))}async#h(t){try{this.#Q(t);let o=await this.#e.poll({deviceCode:t.deviceCode,signal:t.controller.signal});this.#Q(t);let a=ri(o.status)?.toUpperCase();if(a==="WAITING")t.state="pending",t.error=null;else if(a==="SUCCESS"){let e=ri(o.clientId),i=ri(o.clientSecret);if(!e||!i)throw new Error("DingTalk returned incomplete credentials");t.state="connecting",t.error=null,this.#E();let A=await this.#d(t,{clientId:e,clientSecret:i});t.botId=A.botId,t.alreadyConnected=A.alreadyConnected,t.state="connected",this.#p===t.id&&(this.#p=null)}else a==="EXPIRED"?(t.state="expired",t.error=yn("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),this.#p===t.id&&(this.#p=null)):a==="FAIL"?(t.state="failed",t.error=yn("authorization-failed",w("\u9489\u9489\u672A\u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u626B\u7801\u3002")),this.#p===t.id&&(this.#p=null)):(t.state="pending",t.error=yn("poll-pending",w("\u9489\u9489\u6388\u6743\u72B6\u6001\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002")))}catch(o){t.controller.signal.aborted||o?.name==="AbortError"?(t.state="cancelled",t.error=yn("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002")),this.#p===t.id&&(this.#p=null)):t.state==="connecting"?(t.state="failed",t.error=yn("activation-failed",w("\u9489\u9489\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002")),this.#p===t.id&&(this.#p=null),this.#o.error?.("[dsh-dingtalk] bot activation failed")):(t.state="pending",t.error=yn("poll-failed",w("\u9489\u9489\u6388\u6743\u67E5\u8BE2\u6682\u65F6\u5931\u8D25\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002")))}finally{this.#E(),this.#b()}}async#d(t,{clientId:o,clientSecret:a}){let e=NQ(o),i=this.#t.getByClientId(o),A=await this.#A.resolve(e.secretRef).catch(()=>{}),r={botId:e.botId,clientId:o,secretRef:e.secretRef,approvedSenders:i?.approvedSenders??[]};return this.#y(e.botId,async()=>{let s=async()=>{await this.#f(e.botId),i?await this.#t.save(i).catch(()=>{}):this.#t.get(e.botId)&&await this.#t.remove(e.botId).catch(()=>null)&&await this.#I({botId:e.botId,config:r}).catch(c=>{this.#o.warn?.("[dsh-dingtalk] failed to clean up cancelled bot state:",c)}),await this.#w(e.secretRef,A),i&&ri(A?.value)&&await this.#u(i,A.value).catch(()=>{})};await this.#A.set(e.secretRef,a);try{this.#Q(t),await this.#t.save(r),this.#Q(t)}catch(g){throw await s(),g}try{await this.#u(r,a),this.#Q(t),this.#a.delete(e.botId)}catch(g){if(t.controller.signal.aborted||this.#p!==t.id)throw await s(),uc();this.#B({config:r,clientSecret:a,error:g,fallbackMessage:"\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",context:`authorized bot ${e.botId} is not ready`})}return{botId:e.botId,alreadyConnected:!!i}})}async#C(t,o){return this.#y(t.botId,async()=>{let a=await this.#m(t.secretRef);if(!a)throw new Error("The DingTalk client secret is missing");await this.#t.save(o);try{await this.#u(o,a),this.#a.delete(t.botId)}catch(e){await this.#t.save(t).catch(()=>{}),await this.#u(t,a).catch(()=>{});let i=this.#B({config:t,clientSecret:a,error:e,fallbackMessage:"\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",context:`bot ${t.botId} failed to apply updated settings`});throw u_(i,e)}finally{this.#E()}})}async#u(t,o){if(this.#n||(await this.#f(t.botId),this.#n))throw uc();let a;try{a=await this.#r({botId:t.botId,config:structuredClone(t),clientSecret:o})}catch(e){throw vp("dingtalk-runtime-prepare-failed",e)}if(!a||typeof a.start!="function"||typeof a.stop!="function")throw vp("dingtalk-runtime-prepare-failed",new TypeError("createRuntime returned an invalid DingTalk runtime"));if(this.#n)throw await a.stop().catch(()=>{}),uc();this.#i.set(t.botId,a);try{if(await a.start(),this.#n)throw await a.stop().catch(()=>{}),uc()}catch(e){throw this.#i.get(t.botId)===a&&this.#i.delete(t.botId),await a.stop().catch(()=>{}),vp("dingtalk-stream-connect-failed",e)}}#B({config:t,clientSecret:o,error:a,fallbackMessage:e,context:i}){let A=tY(a,{fallbackMessage:e,clientId:t.clientId,clientSecret:o});return this.#a.set(t.botId,A.publicError),this.#o.error?.(`[dsh-dingtalk] ${i} [${A.publicError.referenceId}]`,A.diagnostic),A.publicError}async#f(t){let o=this.#i.get(t);this.#i.delete(t),await o?.stop().catch(()=>{this.#o.warn?.(`[dsh-dingtalk] bot ${t} failed to stop cleanly`)})}async#m(t){let o=await this.#A.resolve(t).catch(()=>{});return ri(o?.value)}async#w(t,o){try{ri(o?.value)?await this.#A.set(t,o.value):await this.#A.unset(t)}catch{this.#o.error?.(`[dsh-dingtalk] failed to restore credential ${t}`)}}#Q(t){if(t.controller.signal.aborted||this.#p!==t.id)throw uc()}#y(t,o){if(this.#n)return Promise.reject(new Error("dsh-dingtalk controller is closed"));let i=(this.#g.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#g.get(t)===i&&this.#g.delete(t)});return this.#g.set(t,i),i}#b(){for(let[t,o]of this.#s)t!==this.#p&&PQ.has(o.state)&&this.#s.size>16&&this.#s.delete(t)}#E(){this.#l+=1}};import{randomUUID as $E}from"node:crypto";import{extname as Ede}from"node:path";var gY=5*1024*1024,ode=20,nde=20*1024*1024,sde="\u8BF7\u5206\u6790\u8FD9\u5F20\u56FE\u7247\u3002",cY="\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B\u4E0D\u652F\u6301\u76F4\u63A5\u63A5\u6536\u56FE\u7247\u8F93\u5165\u3002\u7528\u6237\u53D1\u9001\u7684\u56FE\u7247\u5DF2\u4F5C\u4E3A\u6587\u4EF6\u4FDD\u5B58\u5230\u5DE5\u4F5C\u533A\uFF08\u89C1\u4E0B\u65B9\u6587\u4EF6\u6E05\u5355\uFF09\u3002\u8BF7\u4F7F\u7528\u53EF\u7528\u5DE5\u5177\u5206\u6790\u8FD9\u4E9B\u56FE\u7247\u6587\u4EF6\u540E\u56DE\u7B54\uFF0C\u4F8B\u5982 run_code \u6216 pwsh \u8BFB\u53D6\u5B57\u8282\u3001\u89E3\u6790\u5143\u6570\u636E\u3001\u8C03\u7528\u56FE\u50CF\u5904\u7406\u6216 OCR \u5E93\uFF1B\u4E0D\u8981\u5047\u8BBE\u81EA\u5DF1\u80FD\u76F4\u63A5\u770B\u5230\u56FE\u7247\u5185\u5BB9\u3002",ft=class extends Error{constructor(t,o,a,e={}){super(o,e),this.name="ImagePromptError",this.code=t,this.userMessage=a}},sY=Object.freeze({MODEL_DOES_NOT_SUPPORT_IMAGES:"\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u56FE\u7247\uFF0C\u8BF7\u7528 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\uFF0C\u518D\u7528 /model <\u5E8F\u53F7> \u5207\u6362\u540E\u91CD\u53D1\u3002",IMAGE_TOO_LARGE:"\u56FE\u7247\u8D85\u8FC7\u5BBF\u4E3B\u5141\u8BB8\u7684\u5927\u5C0F\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002",IMAGE_TOO_MANY_PIXELS:"\u56FE\u7247\u5206\u8FA8\u7387\u8FC7\u9AD8\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002",INVALID_IMAGE:"\u56FE\u7247\u5185\u5BB9\u65E0\u6548\u6216\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",INVALID_IMAGE_BASE64:"\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",IMAGE_TYPE_MISMATCH:"\u56FE\u7247\u683C\u5F0F\u4E0E\u5B9E\u9645\u5185\u5BB9\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",TOO_MANY_IMAGES:"\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u6570\u91CF\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u540E\u91CD\u8BD5\u3002",IMAGES_TOO_LARGE:"\u56FE\u7247\u603B\u5927\u5C0F\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"});function gde(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}async function B_(n){try{await n?.body?.cancel?.()}catch{}}async function To(n,{fetchImpl:t=fetch,headers:o,signal:a,maxBytes:e=gY,timeoutMs:i=15e3,allowedHosts:A}={}){let r=new URL(n);if(r.protocol!=="https:")throw new Error("Image download URL must use HTTPS");if(Array.isArray(A)&&!A.some(I=>typeof I=="string"&&(r.hostname===I||I.startsWith(".")&&(r.hostname===I.slice(1)||r.hostname.endsWith(I)))))throw new Error("Image download URL is not hosted by the messaging platform");let s=await t(r,{method:"GET",headers:o,signal:gde(a,i),redirect:"manual"});if(Number.isInteger(s?.status)&&s.status>=300&&s.status<400)throw await B_(s),new ft("image-redirect-blocked",`Image download redirect was blocked (HTTP ${s.status})`,w("\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u53D1\u751F\u4E86\u91CD\u5B9A\u5411\uFF0C\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u3002"));if(!s?.ok)throw await B_(s),new ft("image-http-error",`Image download failed with HTTP ${s?.status??"unknown"}`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP {status}\uFF09\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002",{status:s?.status??"unknown"}));let g=Number(s.headers?.get?.("content-length"));if(Number.isFinite(g)&&g>e)throw await B_(s),new ft("image-too-large",`Image response declares ${g} bytes; the limit is ${e}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(s.body?.[Symbol.asyncIterator]){let I=[],p=0;for await(let B of s.body){let f=Buffer.from(B);if(p+=f.length,p>e)throw await s.body.cancel?.().catch?.(()=>{}),new ft("image-too-large",`Image response exceeded ${e} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));I.push(f)}return Buffer.concat(I,p)}let c=Buffer.from(await s.arrayBuffer());if(c.length>e)throw new ft("image-too-large",`Image response contains ${c.length} bytes; the limit is ${e}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return c}function cde(n){return typeof n=="string"?n.trim():""}function IY(n){return Array.isArray(n?.images)?n.images.filter(Boolean):[]}function f_(n){return typeof n!="string"?void 0:n.replaceAll("\\","/").split("/").at(-1)?.replace(/[\u0000-\u001f\u007f]/g,"").trim().slice(0,255)||void 0}function Ide(n){if(n.length>=8&&n[0]===137&&n[1]===80&&n[2]===78&&n[3]===71&&n[4]===13&&n[5]===10&&n[6]===26&&n[7]===10)return"image/png";if(n.length>=3&&n[0]===255&&n[1]===216&&n[2]===255)return"image/jpeg";if(n.length>=6){let t=n.subarray(0,6).toString("ascii");if(t==="GIF87a"||t==="GIF89a")return"image/gif"}return n.length>=12&&n.subarray(0,4).toString("ascii")==="RIFF"&&n.subarray(8,12).toString("ascii")==="WEBP"?"image/webp":null}function lde(n){if(Buffer.isBuffer(n)||n instanceof Uint8Array)return{data:Buffer.from(n)};let t=n?.data??n?.buffer;return Buffer.isBuffer(t)||t instanceof Uint8Array?{data:Buffer.from(t),name:n?.name??n?.filename}:null}function kt(n){return IY(n).length>0}async function Q_(n,{signal:t,maxImageBytes:o=gY,maxImages:a=ode,maxTotalImageBytes:e=nde}={}){let i=IY(n);if(i.length>a)throw new ft("too-many-images",`Image message contains ${i.length} images; the limit is ${a}`,w("\u4E00\u6B21\u6700\u591A\u53EA\u80FD\u5904\u7406 {maxImages} \u5F20\u56FE\u7247\u3002",{maxImages:a}));let A=cde(n?.content),r=[],s=0;A?r.push({type:"text",text:A}):i.length>0&&r.push({type:"text",text:w(sde)});for(let[g,c]of i.entries()){if(t?.throwIfAborted(),Number.isFinite(c?.size)&&c.size>o)throw new ft("image-too-large",`Image ${g+1} declares ${c.size} bytes; the limit is ${o}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(Number.isFinite(c?.size)&&s+c.size>e)throw new ft("images-too-large",`Images declare more than ${e} bytes in total`,w("\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));let I;try{I=c?.data===void 0?await c?.load?.({signal:t,maxBytes:o}):c.data}catch(f){throw t?.aborted||f?.name==="AbortError"||f?.name==="TimeoutError"||f instanceof ft?f:new ft("image-download-failed",`Unable to download image ${g+1}: ${f?.message??String(f)}`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002"),{cause:f})}let p=lde(I);if(!p?.data.length)throw new ft("invalid-image-data",`Image ${g+1} returned no data`,w("\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002"));if(p.data.length>o)throw new ft("image-too-large",`Image ${g+1} contains ${p.data.length} bytes; the limit is ${o}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(s+p.data.length>e)throw new ft("images-too-large",`Images contain more than ${e} bytes in total`,w("\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));s+=p.data.length;let B=Ide(p.data);if(!B)throw new ft("unsupported-image-type",`Image ${g+1} is not JPEG, PNG, GIF, or WebP`,w("\u6682\u4E0D\u652F\u6301\u8BE5\u56FE\u7247\u683C\u5F0F\uFF0C\u8BF7\u53D1\u9001 JPEG\u3001PNG\u3001WebP \u6216 GIF \u56FE\u7247\u3002"));r.push({type:"image",mediaType:B,data:p.data.toString("base64"),...f_(p.name??c?.name)?{name:f_(p.name??c?.name)}:{}})}return r}function ao(n){if(n instanceof ft)return{code:"image-prompt-error",reason:n.code,userMessage:n.userMessage};if(n?.code!=="attachment-error"||typeof n?.details?.reason!="string")return null;let t=n.details.reason,o=Object.hasOwn(sY,t)?w(sY[t]):null;return o?{code:"attachment-error",reason:t,userMessage:o}:null}function No(n){return ao(n)?.userMessage??null}var pde=new Map([["image/png",".png"],["image/jpeg",".jpg"],["image/gif",".gif"],["image/webp",".webp"]]),dde=/\.(?:png|jpe?g|gif|webp)$/i;function hde(n,t,o){let a=pde.get(t)??".img",e=f_(n);return e&&dde.test(e)?e:`${e??`image-${o+1}`}${a}`}function lY(n){return Array.isArray(n)?n.filter(t=>t?.type==="image").map((t,o)=>({name:hde(t.name,t.mediaType,o),...typeof t.mediaType=="string"&&t.mediaType.trim()?{mediaType:t.mediaType.trim()}:{},data:Buffer.from(typeof t.data=="string"?t.data:"","base64")})):[]}function pY(n){return Array.isArray(n)?n.filter(t=>t?.type!=="image"):n}function dY(n){return n?.code==="attachment-error"&&n?.details?.reason==="MODEL_DOES_NOT_SUPPORT_IMAGES"}var hY="https://oapi.dingtalk.com/",ude="https://api.dingtalk.com/",Cde="DING_DWS_CLAW",Bde="02fcf2f4-5e02-4a85-b672-46d1f715543e.schema",HI="\u{1F914}\u601D\u8003\u4E2D",CY="\u2705\u5DF2\u5B8C\u6210",BY="\u274C\u5904\u7406\u5931\u8D25",fde=15e3,Qde=5e3,yde="2659900",mde="im_bg_1",Sde=new Set(["WAITING","SUCCESS","FAIL","EXPIRED"]),It=class extends Error{constructor(t,o,a={}){super(o,a),this.name="DingtalkApiError",this.code=t,this.status=a.status,this.providerCode=a.providerCode}};function WA(n){return typeof n=="string"&&n.trim()?n.trim():null}function tu(n){let t=n==null?null:String(n).trim();return t&&/^-?[A-Za-z0-9_.:-]{1,160}$/.test(t)?t:void 0}function fY(n,t){return Number.isInteger(t?.status)&&(n.status=t.status),t?.providerCode!==void 0&&(n.providerCode=t.providerCode),n}function eu(n,{fallback:t="artifact-provider-rejected"}={}){if(n?.code?.startsWith?.("artifact-"))return n;let o=Number(n?.status),a=tu(n?.providerCode),e=a??"",i=t,A="DingTalk could not prepare the file for delivery.";o===401||o===403||a==="401"||a==="403"||/(?:permission|forbidden|unauthor|access.?denied|\.auth(?:\.|$))/i.test(e)?(i="artifact-permission-required",A="DingTalk denied permission to send the file."):o===413||a==="413"||/(?:too.?large|size.?limit)/i.test(e)?(i="artifact-too-large",A="The file exceeds DingTalk's size limit."):o===429||a==="429"||/(?:rate.?limit|too.?many|throttl)/i.test(e)?(i="artifact-rate-limited",A="DingTalk rate-limited file delivery."):t==="artifact-provider-rejected"&&(A="DingTalk rejected the file message.");let r=new Error(A,{cause:n});return r.code=i,fY(r,n)}function wde(n){let t=new Error("DingTalk file delivery result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",fY(t,n)}function GQ(n){if(!n||typeof n!="object")return null;for(let t of["errcode","code"])if(n[t]!==void 0&&n[t]!==0&&n[t]!=="0")return tu(n[t])??"rejected";return null}function Dde(n,t){if(t?.aborted)throw ss(t);let o=Number(n?.status);return n?.code==="network-error"||n?.code==="timeout"||n?.code==="invalid-response"||o>=500&&o<600?wde(n):eu(n)}function Ode(n){let t;try{t=new URL(n)}catch(o){throw new It("invalid-image-download","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u3002",{cause:o})}return t.protocol==="http:"&&(!t.port||t.port==="80")&&(t.protocol="https:",t.port=""),t}function EY(n){let t=n.toLowerCase().replace(/\.$/,"");return t==="dingtalk.com"||t.endsWith(".dingtalk.com")}function w_(n,{label:t,requireSubdomain:o=!0}={}){let a;try{a=new URL(n)}catch{throw new It("invalid-url",`${t??"\u9489\u9489\u670D\u52A1"}\u8FD4\u56DE\u4E86\u65E0\u6548\u5730\u5740\u3002`)}let e=a.hostname.toLowerCase().replace(/\.$/,""),i=o?e!=="dingtalk.com"&&EY(e):EY(e);if(a.protocol!=="https:"||!i||a.port&&a.port!=="443")throw new It("untrusted-url",`${t??"\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`);if(a.username||a.password)throw new It("untrusted-url",`${t??"\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`);return a}function Cc(n){let t=WA(n);if(!t)throw new It("invalid-session-webhook","\u9489\u9489\u6D88\u606F\u6CA1\u6709\u53EF\u7528\u7684\u56DE\u590D\u5730\u5740\u3002");let o=w_(t,{label:"\u9489\u9489\u56DE\u590D",requireSubdomain:!1});return o.hash="",o.toString()}function QY(n,t=4e3){let o=typeof n=="string"?n.trim():"";if(!o)return[];if(!Number.isInteger(t)||t<1)throw new TypeError("maxChars must be a positive integer");if(o.length<=t)return[o];let a=[],e=o;for(;e.length>t;){let i=e.lastIndexOf(` +${w("\u9519\u8BEF\u7801\uFF1A{code}\uFF1B\u53C2\u8003\u53F7\uFF1A{referenceId}",n)}`}function rt(n,t,o){let a=xpe(t,o);return n.lastMessageError=a,a}function Mo(n){n.lastMessageError=null}function Hi(n,{uncertain:t=!0}={}){let o=new Error("Channel message delivery failed",{cause:n}),a=Number(n?.status??n?.httpStatus);return o.code=a===401||a===403?"channel-permission":a===429?"channel-rate-limit":t?"channel-delivery-uncertain":"channel-delivery-failed",Number.isInteger(a)&&(o.status=a),o}function ti(n){return!n||typeof n!="object"||typeof n.code!="string"||!n.code||typeof n.reason!="string"||!n.reason||typeof n.message!="string"||!n.message||typeof n.referenceId!="string"||!n.referenceId||!Number.isFinite(n.at)?null:{code:n.code.slice(0,64),reason:n.reason.slice(0,64),message:n.message.slice(0,500),referenceId:n.referenceId.slice(0,40),at:n.at}}import{randomUUID as Ype}from"node:crypto";import{createRequire as eY}from"node:module";var jpe=eY(import.meta.url),E_=new Set(["dingtalk-harness-connect-failed","dingtalk-runtime-prepare-failed","dingtalk-stream-client-load-failed","dingtalk-stream-listener-failed","dingtalk-stream-connect-failed"]),Jpe=Object.freeze(["HTTPS_PROXY","https_proxy","HTTP_PROXY","http_proxy","ALL_PROXY","all_proxy"]),qpe=/^\d+\.\d+\.\d+(?:[-+][A-Za-z0-9.-]+)?$/,zpe=/^DT-CONN-[A-F0-9]{8}$/,kQ;function ns(n,t=500){if(typeof n!="string")return null;let o=n.trim();return o?o.slice(0,t):null}function kp(n){let t=ns(n,80);return t&&qpe.test(t)?t:null}function vQ(n,t=jpe){try{let o=t.resolve(`${n}/package.json`);return{version:kp(t(o)?.version),require:eY(o)}}catch{return null}}function Vpe(){if(kQ)return kQ;let n=vQ("dingtalk-stream"),t=n?vQ("axios",n.require):null,o=t?vQ("https-proxy-agent",t.require):null,a=o?vQ("agent-base",o.require):null;return kQ=Object.freeze({dingtalkStream:n?.version??null,axios:t?.version??null,httpsProxyAgent:o?.version??null,agentBase:a?.version??null}),kQ}function Wpe(n){let t=[],o=new Set,a=n;for(;a&&typeof a=="object"&&t.length<4&&!o.has(a);)o.add(a),t.push(a),a=a.cause;return t}function AY(n){return Number.isInteger(n?.status)?n.status:Number.isInteger(n?.statusCode)?n.statusCode:Number.isInteger(n?.response?.status)?n.response.status:null}function Zpe(n){let t=ns(n?.providerCode??n?.response?.data?.code??n?.response?.data?.errorCode??n?.response?.data?.errcode,100);return t&&/^[A-Za-z0-9_.:-]+$/.test(t)?t:null}function Xpe(n,t){let o=ns(n);if(!o)return null;for(let a of t){let e=ns(a,2048);e&&e.length>=4&&(o=o.replaceAll(e,"\u2022\u2022\u2022\u2022"))}return o.replace(/(https?:\/\/)[^/\s@]+@/giu,"$1\u2022\u2022\u2022\u2022@").replace(/([?&](?:appsecret|client_secret|clientsecret|access_token|token|password)=)[^&\s]*/giu,"$1\u2022\u2022\u2022\u2022").replace(/((?:app|client|access)[_-]?secret|authorization|password|token)\s*[=:]\s*[^\s,;,。]+/giu,"$1=\u2022\u2022\u2022\u2022").replace(/\b[A-Za-z0-9_.-]*secret[A-Za-z0-9_.-]*\b/giu,"\u2022\u2022\u2022\u2022").slice(0,500)}function $pe(n){let t=n&&typeof n=="object"?n:{};return{dingtalkStream:kp(t.dingtalkStream),axios:kp(t.axios),httpsProxyAgent:kp(t.httpsProxyAgent),agentBase:kp(t.agentBase)}}function ede(n,t){return n.map(o=>{let a=ns(o?.name,80),e=ns(o?.code,100),i=AY(o),A=Zpe(o),r=Xpe(o?.message,t);return{...a?{name:a}:{},...e?{code:e}:{},...i!==null?{status:i}:{},...A?{providerCode:A}:{},...r?{message:r}:{}}})}function Ade(n){return zpe.test(n??"")?n:`DT-CONN-${Ype().replaceAll("-","").slice(0,8).toUpperCase()}`}function _o(n,t,o,a){return Object.freeze({code:n,message:w(t),hint:w(o),referenceId:a})}function vp(n,t){if(t?.name==="AbortError"||E_.has(t?.code))return t;let o=new Error(ns(t?.message)??"DingTalk runtime startup failed",{cause:t});return o.name="DingtalkRuntimeStartError",o.code=E_.has(n)?n:"dingtalk-runtime-prepare-failed",o}function tY(n,{fallbackMessage:t="\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",clientId:o,clientSecret:a,environment:e=process.env,dependencies:i=Vpe(),nodeVersion:A=process.versions.node,referenceId:r}={}){let s=Ade(r),g=Wpe(n),c=new Set(g.map(L=>ns(L?.code,100)?.toUpperCase()).filter(Boolean)),I=g.map(L=>ns(L?.message)?.toLowerCase()).filter(Boolean),p=g.map(AY).filter(L=>L!==null),B=g.map(L=>L?.code).find(L=>E_.has(L))??null,f=Jpe.filter(L=>ns(e?.[L],4096)),Q=f.length>0,y=$pe(i),m=L=>I.some(U=>L.test(U)),T=L=>[...c].some(U=>L.test(U)),_=p.includes(407)||T(/(?:PROXY|ERR_INVALID_PROTOCOL)/u)||m(/proxy|tunneling socket/u),R;return B==="dingtalk-stream-connect-failed"&&Q&&y.agentBase==="6.0.0"?R=_o("stream-proxy-dependency-incompatible","\u9489\u9489 Stream \u8FDE\u63A5\u5931\u8D25\uFF1A\u68C0\u6D4B\u5230\u4EE3\u7406\u4F9D\u8D56 agent-base 6.0.0\u3002","\u8BF7\u5C06 DSH profile \u4E2D\u7684 agent-base@6 \u56FA\u5B9A\u4E3A 6.0.2 \u540E\u91CD\u65B0\u5B89\u88C5\u4F9D\u8D56\uFF0C\u6216\u5347\u7EA7 pnpm \u540E\u91CD\u65B0\u89E3\u6790 lockfile\u3002",s):B==="dingtalk-harness-connect-failed"?R=_o("harness-unavailable","\u63D2\u4EF6\u65E0\u6CD5\u8FDE\u63A5\u672C\u673A Harness\u3002","\u8BF7\u786E\u8BA4 dsh web \u6B63\u5E38\u8FD0\u884C\uFF0C\u5E76\u67E5\u770B dsh web \u65E5\u5FD7\u4E2D\u76F8\u540C\u53C2\u8003\u53F7\u5BF9\u5E94\u7684\u8BCA\u65AD\u4FE1\u606F\u3002",s):B==="dingtalk-stream-client-load-failed"?R=_o("stream-sdk-load-failed","\u9489\u9489 Stream SDK \u52A0\u8F7D\u5931\u8D25\u3002","\u8BF7\u91CD\u65B0\u5B89\u88C5\u5F53\u524D DSH profile \u7684\u63D2\u4EF6\u4F9D\u8D56\uFF0C\u5E76\u67E5\u770B dsh web \u65E5\u5FD7\u4E2D\u76F8\u540C\u53C2\u8003\u53F7\u5BF9\u5E94\u7684\u8BCA\u65AD\u4FE1\u606F\u3002",s):p.some(L=>L===401||L===403)?R=_o("stream-credentials-rejected","\u9489\u9489\u62D2\u7EDD\u4E86\u5F53\u524D\u5E94\u7528\u51ED\u636E\u3002","\u8BF7\u6838\u5BF9 Client ID\u3001Client Secret \u548C\u673A\u5668\u4EBA\u6743\u9650\u540E\u91CD\u8BD5\u3002",s):T(/(?:TIMEOUT|ETIMEDOUT)/u)||m(/timed? out|timeout/u)?R=_o("stream-handshake-timeout","\u8FDE\u63A5\u9489\u9489 Stream \u8D85\u65F6\u3002","\u8BF7\u68C0\u67E5\u7F51\u7EDC\u3001\u4EE3\u7406\u548C\u9632\u706B\u5899\u540E\u91CD\u8BD5\uFF1B\u8BE6\u7EC6\u539F\u56E0\u53EF\u5728 dsh web \u65E5\u5FD7\u4E2D\u6309\u53C2\u8003\u53F7\u67E5\u627E\u3002",s):T(/^(?:ENOTFOUND|EAI_AGAIN)$/u)?R=_o("stream-dns-failed","\u65E0\u6CD5\u89E3\u6790\u9489\u9489\u670D\u52A1\u5730\u5740\u3002","\u8BF7\u68C0\u67E5 DNS\u3001\u7F51\u7EDC\u548C\u4EE3\u7406\u8BBE\u7F6E\uFF1B\u8BE6\u7EC6\u539F\u56E0\u53EF\u5728 dsh web \u65E5\u5FD7\u4E2D\u6309\u53C2\u8003\u53F7\u67E5\u627E\u3002",s):T(/(?:CERT|TLS|SSL|UNABLE_TO_VERIFY)/u)?R=_o("stream-tls-failed","\u9489\u9489 Stream \u7684 TLS \u8FDE\u63A5\u6821\u9A8C\u5931\u8D25\u3002","\u8BF7\u68C0\u67E5\u7CFB\u7EDF\u8BC1\u4E66\u3001\u4EE3\u7406\u8BC1\u4E66\u6216 HTTPS \u4E2D\u95F4\u4EE3\u7406\uFF1B\u8BE6\u7EC6\u539F\u56E0\u53EF\u5728 dsh web \u65E5\u5FD7\u4E2D\u6309\u53C2\u8003\u53F7\u67E5\u627E\u3002",s):B==="dingtalk-stream-connect-failed"&&_?R=_o("stream-proxy-failed","\u9489\u9489 Stream \u65E0\u6CD5\u901A\u8FC7\u5F53\u524D\u4EE3\u7406\u5EFA\u7ACB\u8FDE\u63A5\u3002","\u8BF7\u68C0\u67E5 HTTP_PROXY\u3001HTTPS_PROXY\u3001NO_PROXY \u548C\u4EE3\u7406\u8FDE\u901A\u6027\uFF1B\u8BE6\u7EC6\u539F\u56E0\u53EF\u5728 dsh web \u65E5\u5FD7\u4E2D\u6309\u53C2\u8003\u53F7\u67E5\u627E\u3002",s):B==="dingtalk-stream-connect-failed"?R=_o("stream-connect-failed","\u9489\u9489 Stream \u6D88\u606F\u8FDE\u63A5\u5EFA\u7ACB\u5931\u8D25\u3002","\u8BF7\u68C0\u67E5\u7F51\u7EDC\u548C\u673A\u5668\u4EBA\u914D\u7F6E\uFF1B\u8BE6\u7EC6\u539F\u56E0\u53EF\u5728 dsh web \u65E5\u5FD7\u4E2D\u6309\u53C2\u8003\u53F7\u67E5\u627E\u3002",s):B==="dingtalk-stream-listener-failed"?R=_o("stream-listener-failed","\u9489\u9489 Stream \u6D88\u606F\u76D1\u542C\u521D\u59CB\u5316\u5931\u8D25\u3002","\u8BF7\u786E\u8BA4 dsh-im \u4E0E dingtalk-stream \u7248\u672C\u517C\u5BB9\uFF0C\u5E76\u6309\u53C2\u8003\u53F7\u67E5\u770B dsh web \u65E5\u5FD7\u3002",s):B==="dingtalk-runtime-prepare-failed"?R=_o("runtime-prepare-failed","\u9489\u9489\u673A\u5668\u4EBA\u8FD0\u884C\u73AF\u5883\u521D\u59CB\u5316\u5931\u8D25\u3002","\u8BF7\u68C0\u67E5 DSH \u6570\u636E\u76EE\u5F55\u3001\u5DE5\u4F5C\u533A\u548C\u63D2\u4EF6\u4F9D\u8D56\uFF0C\u5E76\u6309\u53C2\u8003\u53F7\u67E5\u770B dsh web \u65E5\u5FD7\u3002",s):R=_o("connection-failed",t,"\u8BF7\u5728 dsh web \u65E5\u5FD7\u4E2D\u67E5\u627E\u76F8\u540C\u53C2\u8003\u53F7\uFF0C\u4EE5\u83B7\u53D6\u5DF2\u8131\u654F\u7684\u5177\u4F53\u9519\u8BEF\u3002",s),Object.freeze({publicError:R,diagnostic:Object.freeze({referenceId:s,category:R.code,stage:B,runtime:{node:kp(A)},proxy:{configured:Q,variables:f},dependencies:y,errors:ede(g,[o,a])})})}function u_(n,t){let o=new Error(n.message,{cause:t});return o.name="DingtalkPublicConnectionError",o.code=n.code,o.publicError=structuredClone(n),o}var rY=new Set(["starting","pending","connecting"]),PQ=new Set(["connected","expired","failed","cancelled"]);function ri(n){return typeof n=="string"&&n.trim()?n.trim():null}function yn(n,t){return Object.freeze({code:n,message:t})}function oY(n){return typeof n?.now=="function"?n.now():n()}function rde(n){return new Date(oY(n)).toISOString()}function uc(){return new DOMException("DingTalk provisioning was cancelled","AbortError")}function UI(n){return n?{attemptId:n.id,status:n.state,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.pollIntervalMs?{pollIntervalMs:n.pollIntervalMs}:{},...n.botId?{botId:n.botId}:{},...n.alreadyConnected?{alreadyConnected:!0}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}function C_(n){if(!n)return{};let t=typeof n.status=="function"?n.status():n.status;return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function iY(n,t){if(!n||t.connected===!1||t.ready===!1)return!1;let o=ri(t.dingtalkStreamState??t.dingtalkConnectionState??t.connectionState??t.state)?.toLowerCase();return["failed","error","offline","disconnected","stopped"].includes(o)?!1:t.connected===!0||t.ready===!0||o==="connected"||o==="ready"}function nY(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t=ri(n.staffId??n.senderStaffId??n.senderId);if(!t)return null;let o=ri(n.requestId),a=o&&/^ding_sender_[A-Za-z0-9_-]{1,100}$/.test(o)&&!o.includes(t)?o:null;return a?{requestId:a,staffId:t,displayName:ri(n.displayName??n.senderName??n.senderNick)??w("\u9489\u9489\u7528\u6237"),requestedAt:ri(n.requestedAt)}:null}function aY(n){if(!Array.isArray(n.pendingSenders))return[];let t=new Set,o=[];for(let a of n.pendingSenders){let e=nY(a);!e||t.has(e.staffId)||(t.add(e.staffId),o.push(e))}return o}function ide(n){return{requestId:n.requestId,displayName:n.displayName,senderIdMasked:p_(n.staffId),requestedAt:n.requestedAt}}function ade(n){return{senderKey:n.senderKey,displayName:ri(n.displayName)??w("\u9489\u9489\u7528\u6237"),senderIdMasked:p_(n.staffId),approvedAt:ri(n.approvedAt)}}var XE=class{#e;#A;#t;#r;#I;#o;#c;#i=new Map;#a=new Map;#s=new Map;#p=null;#g=new Map;#l=0;#n=!1;constructor({deviceAuth:t,credentials:o,configStore:a,createRuntime:e,deleteState:i=async()=>{},logger:A=console,clock:r=Date}){if(!t||typeof t.start!="function"||typeof t.poll!="function")throw new TypeError("DingtalkController requires a DingTalk device auth client");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError("DingtalkController requires the DSH credential provider");if(!a||typeof a.list!="function"||typeof a.get!="function"||typeof a.getByClientId!="function"||typeof a.save!="function"||typeof a.remove!="function")throw new TypeError("DingtalkController requires a loaded config store");if(typeof e!="function")throw new TypeError("createRuntime is required");if(typeof i!="function")throw new TypeError("deleteState must be a function");if(typeof r!="function"&&typeof r?.now!="function")throw new TypeError("clock must be a function or expose now()");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r}async initialize(){if(this.#n)return this.status();for(let t of this.#t.list()){let o=this.#i.get(t.botId);try{if(iY(o,C_(o)))continue}catch{}await this.#y(t.botId,async()=>{let a=this.#t.get(t.botId);if(!a||this.#n)return;let e=await this.#m(a.secretRef);if(!e){this.#a.set(a.botId,yn("missing-secret",w("\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"))),this.#E();return}try{await this.#u(a,e),this.#a.delete(a.botId)}catch(i){this.#B({config:a,clientSecret:e,error:i,fallbackMessage:"\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",context:`bot ${a.botId} failed to initialize`})}this.#E()})}return this.status()}async startProvisioning({signal:t}={}){if(this.#n)throw new Error("dsh-dingtalk controller is closed");this.#p&&await this.cancelProvisioning(this.#p);let o={id:tde(),state:"starting",controller:new AbortController,deviceCode:null,verificationUrl:null,expiresAt:null,pollIntervalMs:null,pollTask:null,botId:null,alreadyConnected:!1,error:null};this.#s.set(o.id,o),this.#p=o.id,this.#E();let a=()=>o.controller.abort(t?.reason);t?.aborted?a():t?.addEventListener("abort",a,{once:!0});try{let e=await this.#e.start({signal:o.controller.signal});if(this.#Q(o),o.deviceCode=ri(e.deviceCode),o.verificationUrl=ri(e.verificationUrl),o.expiresAt=Number(e.expiresAt),o.pollIntervalMs=Number(e.pollIntervalMs),!o.deviceCode||!o.verificationUrl||!Number.isFinite(o.expiresAt)||!Number.isFinite(o.pollIntervalMs)||o.pollIntervalMs<=0)throw new Error("DingTalk device auth returned incomplete registration metadata");return o.state="pending",this.#E(),UI(o)}catch(e){if(o.controller.signal.aborted||e?.name==="AbortError"?(o.state="cancelled",o.error=yn("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(o.state="failed",o.error=yn("qr-start-failed",w("\u65E0\u6CD5\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#p===o.id&&(this.#p=null),this.#E(),o.state==="failed")throw e;return UI(o)}finally{t?.removeEventListener("abort",a)}}async bindCredentials({clientId:t,clientSecret:o}={}){if(this.#n)throw new Error("dsh-dingtalk controller is closed");let a=ri(t),e=ri(o);if(!a||!e)throw new TypeError("DingTalk Client ID and Client Secret are required");if(this.#p&&await this.cancelProvisioning(this.#p),this.#n)throw new Error("dsh-dingtalk controller is closed");let i=NQ(a);return await this.#y(i.botId,async()=>{if(this.#n)throw uc();let A=this.#t.getByClientId(a),r=await this.#A.resolve(i.secretRef).catch(()=>{});if(this.#n)throw uc();let s={botId:i.botId,clientId:a,secretRef:i.secretRef,approvedSenders:A?.approvedSenders??[]};await this.#A.set(i.secretRef,e);try{await this.#t.save(s)}catch(g){throw await this.#w(i.secretRef,r),g}try{await this.#u(s,e),this.#a.delete(i.botId)}catch(g){this.#B({config:s,clientSecret:e,error:g,fallbackMessage:"\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",context:`credential-bound bot ${i.botId} is not ready`})}this.#E()}),this.status()}async registrationStatus(t){let o=this.#s.get(t);if(!o)return null;if(PQ.has(o.state)||o.state==="starting")return UI(o);if(oY(this.#c)>=o.expiresAt)return o.state="expired",o.error=yn("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),this.#p===o.id&&(this.#p=null),this.#E(),UI(o);if(!o.pollTask){let a=this.#h(o).finally(()=>{o.pollTask===a&&(o.pollTask=null)});o.pollTask=a}return await o.pollTask,UI(o)}async cancelProvisioning(t){let o=this.#s.get(t);return o?(PQ.has(o.state)||(o.controller.abort(),await o.pollTask?.catch(()=>{}),PQ.has(o.state)||(o.state="cancelled"),o.error??=yn("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))),this.#p===o.id&&(this.#p=null),this.#E(),UI(o)):null}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return await this.#y(t,async()=>{let a=await this.#m(o.secretRef);if(!a)throw new Error("The DingTalk client secret is missing");try{await this.#u(o,a),this.#a.delete(t)}catch(e){let i=this.#B({config:o,clientSecret:a,error:e,fallbackMessage:"\u9489\u9489\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",context:`bot ${t} failed to reconnect`});throw u_(i,e)}finally{this.#E()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return this.#y(t,async()=>{let a=this.#i.get(t);if(!a?.status?.ready||typeof a.sendConnectionTest!="function")throw Qr(w("\u9489\u9489\u673A\u5668\u4EBA"));return a.sendConnectionTest(Ui(w("\u9489\u9489\u673A\u5668\u4EBA\uFF08{clientId}\uFF09",{clientId:d_(o.clientId)})))})}async sendProactiveText(t,o,a,e={}){if(!this.#t.get(t))throw new Error("Unknown DingTalk bot");return this.#y(t,async()=>{let A=this.#i.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,a,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown DingTalk bot");return await this.#y(t,async()=>{let a=await this.#A.resolve(o.secretRef).catch(()=>{});await this.#f(t);try{await this.#A.unset(o.secretRef),await this.#t.remove(t)}catch(e){throw ri(a?.value)&&(await this.#A.set(o.secretRef,a.value).catch(()=>{}),await this.#u(o,a.value).catch(()=>{})),new Error("Unable to remove the DingTalk bot safely.",{cause:e})}try{await this.#I({botId:t,config:o})}catch{this.#o.warn?.(`[dsh-dingtalk] bot ${t} state cleanup failed`)}this.#a.delete(t),this.#E()}),this.status()}async approveSender(t,o){let a=this.#t.get(t);if(!a)throw new Error("Unknown DingTalk bot");let e=this.#i.get(t),i=typeof e?.pendingSender=="function"?nY(e.pendingSender(o)):null,A=aY(C_(e)),r=i?.requestId===o?i:A.find(g=>g.requestId===o);if(!r)throw new Error("Unknown DingTalk sender approval request");if(a.approvedSenders.some(g=>g.staffId===r.staffId))return this.status();let s={...a,approvedSenders:[...a.approvedSenders,{senderKey:zx(),staffId:r.staffId,displayName:r.displayName,approvedAt:rde(this.#c)}]};return await this.#C(a,s),this.status()}async revokeSender(t,o){let a=this.#t.get(t);if(!a)throw new Error("Unknown DingTalk bot");let e=a.approvedSenders.findIndex(A=>A.senderKey===o);if(e===-1)throw new Error("Unknown approved DingTalk sender");let i=[...a.approvedSenders];return i.splice(e,1),await this.#C(a,{...a,approvedSenders:i}),this.status()}status(){let t=this.#t.list().map(e=>{let i=this.#i.get(e.botId),A={};try{A=C_(i)}catch{A={state:"error"}}let r=iY(i,A),s=this.#a.get(e.botId),g=r?"connected":s?"error":"offline",c=new Set(e.approvedSenders.map(p=>p.staffId)),I=aY(A).filter(p=>!c.has(p.staffId)).map(ide);return{botId:e.botId,state:g,connected:r,configured:!0,bot:{name:w("\u9489\u9489\u673A\u5668\u4EBA"),clientIdMasked:d_(e.clientId)},health:{status:r?"healthy":s?"error":"offline",summary:r?w("\u9489\u9489 Stream \u6D88\u606F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38"):s?.message??w("\u9489\u9489\u6D88\u606F\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:A.lastCheckedAt??null},stats:{messagesReceived:Number(A.messagesReceived)||0,messagesReplied:Number(A.messagesReplied)||0},lastMessageError:ti(A.lastMessageError),senders:{pending:I,approved:e.approvedSenders.map(ade)},error:s?structuredClone(s):null}}),o=t.filter(e=>e.connected).length,a=this.#p?this.#s.get(this.#p):null;return{schemaVersion:1,revision:this.#l,state:a&&rY.has(a.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...a&&rY.has(a.state)?{provisioning:UI(a)}:{}}}async close(){this.#n||(this.#n=!0,this.#p&&await this.cancelProvisioning(this.#p),await Promise.allSettled([...this.#i.keys()].map(t=>this.#f(t))),await Promise.allSettled([...this.#g.values()]),await Promise.allSettled([...this.#i.keys()].map(t=>this.#f(t))))}async#h(t){try{this.#Q(t);let o=await this.#e.poll({deviceCode:t.deviceCode,signal:t.controller.signal});this.#Q(t);let a=ri(o.status)?.toUpperCase();if(a==="WAITING")t.state="pending",t.error=null;else if(a==="SUCCESS"){let e=ri(o.clientId),i=ri(o.clientSecret);if(!e||!i)throw new Error("DingTalk returned incomplete credentials");t.state="connecting",t.error=null,this.#E();let A=await this.#d(t,{clientId:e,clientSecret:i});t.botId=A.botId,t.alreadyConnected=A.alreadyConnected,t.state="connected",this.#p===t.id&&(this.#p=null)}else a==="EXPIRED"?(t.state="expired",t.error=yn("expired",w("\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),this.#p===t.id&&(this.#p=null)):a==="FAIL"?(t.state="failed",t.error=yn("authorization-failed",w("\u9489\u9489\u672A\u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u626B\u7801\u3002")),this.#p===t.id&&(this.#p=null)):(t.state="pending",t.error=yn("poll-pending",w("\u9489\u9489\u6388\u6743\u72B6\u6001\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002")))}catch(o){t.controller.signal.aborted||o?.name==="AbortError"?(t.state="cancelled",t.error=yn("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002")),this.#p===t.id&&(this.#p=null)):t.state==="connecting"?(t.state="failed",t.error=yn("activation-failed",w("\u9489\u9489\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002")),this.#p===t.id&&(this.#p=null),this.#o.error?.("[dsh-dingtalk] bot activation failed")):(t.state="pending",t.error=yn("poll-failed",w("\u9489\u9489\u6388\u6743\u67E5\u8BE2\u6682\u65F6\u5931\u8D25\uFF0C\u6B63\u5728\u91CD\u8BD5\u3002")))}finally{this.#E(),this.#b()}}async#d(t,{clientId:o,clientSecret:a}){let e=NQ(o),i=this.#t.getByClientId(o),A=await this.#A.resolve(e.secretRef).catch(()=>{}),r={botId:e.botId,clientId:o,secretRef:e.secretRef,approvedSenders:i?.approvedSenders??[]};return this.#y(e.botId,async()=>{let s=async()=>{await this.#f(e.botId),i?await this.#t.save(i).catch(()=>{}):this.#t.get(e.botId)&&await this.#t.remove(e.botId).catch(()=>null)&&await this.#I({botId:e.botId,config:r}).catch(c=>{this.#o.warn?.("[dsh-dingtalk] failed to clean up cancelled bot state:",c)}),await this.#w(e.secretRef,A),i&&ri(A?.value)&&await this.#u(i,A.value).catch(()=>{})};await this.#A.set(e.secretRef,a);try{this.#Q(t),await this.#t.save(r),this.#Q(t)}catch(g){throw await s(),g}try{await this.#u(r,a),this.#Q(t),this.#a.delete(e.botId)}catch(g){if(t.controller.signal.aborted||this.#p!==t.id)throw await s(),uc();this.#B({config:r,clientSecret:a,error:g,fallbackMessage:"\u9489\u9489\u5DF2\u63A5\u5165\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",context:`authorized bot ${e.botId} is not ready`})}return{botId:e.botId,alreadyConnected:!!i}})}async#C(t,o){return this.#y(t.botId,async()=>{let a=await this.#m(t.secretRef);if(!a)throw new Error("The DingTalk client secret is missing");await this.#t.save(o);try{await this.#u(o,a),this.#a.delete(t.botId)}catch(e){await this.#t.save(t).catch(()=>{}),await this.#u(t,a).catch(()=>{});let i=this.#B({config:t,clientSecret:a,error:e,fallbackMessage:"\u9489\u9489\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",context:`bot ${t.botId} failed to apply updated settings`});throw u_(i,e)}finally{this.#E()}})}async#u(t,o){if(this.#n||(await this.#f(t.botId),this.#n))throw uc();let a;try{a=await this.#r({botId:t.botId,config:structuredClone(t),clientSecret:o})}catch(e){throw vp("dingtalk-runtime-prepare-failed",e)}if(!a||typeof a.start!="function"||typeof a.stop!="function")throw vp("dingtalk-runtime-prepare-failed",new TypeError("createRuntime returned an invalid DingTalk runtime"));if(this.#n)throw await a.stop().catch(()=>{}),uc();this.#i.set(t.botId,a);try{if(await a.start(),this.#n)throw await a.stop().catch(()=>{}),uc()}catch(e){throw this.#i.get(t.botId)===a&&this.#i.delete(t.botId),await a.stop().catch(()=>{}),vp("dingtalk-stream-connect-failed",e)}}#B({config:t,clientSecret:o,error:a,fallbackMessage:e,context:i}){let A=tY(a,{fallbackMessage:e,clientId:t.clientId,clientSecret:o});return this.#a.set(t.botId,A.publicError),this.#o.error?.(`[dsh-dingtalk] ${i} [${A.publicError.referenceId}]`,A.diagnostic),A.publicError}async#f(t){let o=this.#i.get(t);this.#i.delete(t),await o?.stop().catch(()=>{this.#o.warn?.(`[dsh-dingtalk] bot ${t} failed to stop cleanly`)})}async#m(t){let o=await this.#A.resolve(t).catch(()=>{});return ri(o?.value)}async#w(t,o){try{ri(o?.value)?await this.#A.set(t,o.value):await this.#A.unset(t)}catch{this.#o.error?.(`[dsh-dingtalk] failed to restore credential ${t}`)}}#Q(t){if(t.controller.signal.aborted||this.#p!==t.id)throw uc()}#y(t,o){if(this.#n)return Promise.reject(new Error("dsh-dingtalk controller is closed"));let i=(this.#g.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#g.get(t)===i&&this.#g.delete(t)});return this.#g.set(t,i),i}#b(){for(let[t,o]of this.#s)t!==this.#p&&PQ.has(o.state)&&this.#s.size>16&&this.#s.delete(t)}#E(){this.#l+=1}};import{randomUUID as $E}from"node:crypto";import{extname as Ede}from"node:path";var gY=5*1024*1024,ode=20,nde=20*1024*1024,sde="\u8BF7\u5206\u6790\u8FD9\u5F20\u56FE\u7247\u3002",cY="\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B\u4E0D\u652F\u6301\u76F4\u63A5\u63A5\u6536\u56FE\u7247\u8F93\u5165\u3002\u7528\u6237\u53D1\u9001\u7684\u56FE\u7247\u5DF2\u4F5C\u4E3A\u6587\u4EF6\u4FDD\u5B58\u5230\u5DE5\u4F5C\u533A\uFF08\u89C1\u4E0B\u65B9\u6587\u4EF6\u6E05\u5355\uFF09\u3002\u8BF7\u4F7F\u7528\u53EF\u7528\u5DE5\u5177\u5206\u6790\u8FD9\u4E9B\u56FE\u7247\u6587\u4EF6\u540E\u56DE\u7B54\uFF0C\u4F8B\u5982 run_code \u6216 pwsh \u8BFB\u53D6\u5B57\u8282\u3001\u89E3\u6790\u5143\u6570\u636E\u3001\u8C03\u7528\u56FE\u50CF\u5904\u7406\u6216 OCR \u5E93\uFF1B\u4E0D\u8981\u5047\u8BBE\u81EA\u5DF1\u80FD\u76F4\u63A5\u770B\u5230\u56FE\u7247\u5185\u5BB9\u3002",Qt=class extends Error{constructor(t,o,a,e={}){super(o,e),this.name="ImagePromptError",this.code=t,this.userMessage=a}},sY=Object.freeze({MODEL_DOES_NOT_SUPPORT_IMAGES:"\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u56FE\u7247\uFF0C\u8BF7\u7528 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\uFF0C\u518D\u7528 /model <\u5E8F\u53F7> \u5207\u6362\u540E\u91CD\u53D1\u3002",IMAGE_TOO_LARGE:"\u56FE\u7247\u8D85\u8FC7\u5BBF\u4E3B\u5141\u8BB8\u7684\u5927\u5C0F\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002",IMAGE_TOO_MANY_PIXELS:"\u56FE\u7247\u5206\u8FA8\u7387\u8FC7\u9AD8\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002",INVALID_IMAGE:"\u56FE\u7247\u5185\u5BB9\u65E0\u6548\u6216\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",INVALID_IMAGE_BASE64:"\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",IMAGE_TYPE_MISMATCH:"\u56FE\u7247\u683C\u5F0F\u4E0E\u5B9E\u9645\u5185\u5BB9\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002",TOO_MANY_IMAGES:"\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u6570\u91CF\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u540E\u91CD\u8BD5\u3002",IMAGES_TOO_LARGE:"\u56FE\u7247\u603B\u5927\u5C0F\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"});function gde(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}async function B_(n){try{await n?.body?.cancel?.()}catch{}}async function To(n,{fetchImpl:t=fetch,headers:o,signal:a,maxBytes:e=gY,timeoutMs:i=15e3,allowedHosts:A}={}){let r=new URL(n);if(r.protocol!=="https:")throw new Error("Image download URL must use HTTPS");if(Array.isArray(A)&&!A.some(I=>typeof I=="string"&&(r.hostname===I||I.startsWith(".")&&(r.hostname===I.slice(1)||r.hostname.endsWith(I)))))throw new Error("Image download URL is not hosted by the messaging platform");let s=await t(r,{method:"GET",headers:o,signal:gde(a,i),redirect:"manual"});if(Number.isInteger(s?.status)&&s.status>=300&&s.status<400)throw await B_(s),new Qt("image-redirect-blocked",`Image download redirect was blocked (HTTP ${s.status})`,w("\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u53D1\u751F\u4E86\u91CD\u5B9A\u5411\uFF0C\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u3002"));if(!s?.ok)throw await B_(s),new Qt("image-http-error",`Image download failed with HTTP ${s?.status??"unknown"}`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP {status}\uFF09\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002",{status:s?.status??"unknown"}));let g=Number(s.headers?.get?.("content-length"));if(Number.isFinite(g)&&g>e)throw await B_(s),new Qt("image-too-large",`Image response declares ${g} bytes; the limit is ${e}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(s.body?.[Symbol.asyncIterator]){let I=[],p=0;for await(let B of s.body){let f=Buffer.from(B);if(p+=f.length,p>e)throw await s.body.cancel?.().catch?.(()=>{}),new Qt("image-too-large",`Image response exceeded ${e} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));I.push(f)}return Buffer.concat(I,p)}let c=Buffer.from(await s.arrayBuffer());if(c.length>e)throw new Qt("image-too-large",`Image response contains ${c.length} bytes; the limit is ${e}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return c}function cde(n){return typeof n=="string"?n.trim():""}function IY(n){return Array.isArray(n?.images)?n.images.filter(Boolean):[]}function f_(n){return typeof n!="string"?void 0:n.replaceAll("\\","/").split("/").at(-1)?.replace(/[\u0000-\u001f\u007f]/g,"").trim().slice(0,255)||void 0}function Ide(n){if(n.length>=8&&n[0]===137&&n[1]===80&&n[2]===78&&n[3]===71&&n[4]===13&&n[5]===10&&n[6]===26&&n[7]===10)return"image/png";if(n.length>=3&&n[0]===255&&n[1]===216&&n[2]===255)return"image/jpeg";if(n.length>=6){let t=n.subarray(0,6).toString("ascii");if(t==="GIF87a"||t==="GIF89a")return"image/gif"}return n.length>=12&&n.subarray(0,4).toString("ascii")==="RIFF"&&n.subarray(8,12).toString("ascii")==="WEBP"?"image/webp":null}function lde(n){if(Buffer.isBuffer(n)||n instanceof Uint8Array)return{data:Buffer.from(n)};let t=n?.data??n?.buffer;return Buffer.isBuffer(t)||t instanceof Uint8Array?{data:Buffer.from(t),name:n?.name??n?.filename}:null}function kt(n){return IY(n).length>0}async function Q_(n,{signal:t,maxImageBytes:o=gY,maxImages:a=ode,maxTotalImageBytes:e=nde}={}){let i=IY(n);if(i.length>a)throw new Qt("too-many-images",`Image message contains ${i.length} images; the limit is ${a}`,w("\u4E00\u6B21\u6700\u591A\u53EA\u80FD\u5904\u7406 {maxImages} \u5F20\u56FE\u7247\u3002",{maxImages:a}));let A=cde(n?.content),r=[],s=0;A?r.push({type:"text",text:A}):i.length>0&&r.push({type:"text",text:w(sde)});for(let[g,c]of i.entries()){if(t?.throwIfAborted(),Number.isFinite(c?.size)&&c.size>o)throw new Qt("image-too-large",`Image ${g+1} declares ${c.size} bytes; the limit is ${o}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(Number.isFinite(c?.size)&&s+c.size>e)throw new Qt("images-too-large",`Images declare more than ${e} bytes in total`,w("\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));let I;try{I=c?.data===void 0?await c?.load?.({signal:t,maxBytes:o}):c.data}catch(f){throw t?.aborted||f?.name==="AbortError"||f?.name==="TimeoutError"||f instanceof Qt?f:new Qt("image-download-failed",`Unable to download image ${g+1}: ${f?.message??String(f)}`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002"),{cause:f})}let p=lde(I);if(!p?.data.length)throw new Qt("invalid-image-data",`Image ${g+1} returned no data`,w("\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002"));if(p.data.length>o)throw new Qt("image-too-large",`Image ${g+1} contains ${p.data.length} bytes; the limit is ${o}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));if(s+p.data.length>e)throw new Qt("images-too-large",`Images contain more than ${e} bytes in total`,w("\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));s+=p.data.length;let B=Ide(p.data);if(!B)throw new Qt("unsupported-image-type",`Image ${g+1} is not JPEG, PNG, GIF, or WebP`,w("\u6682\u4E0D\u652F\u6301\u8BE5\u56FE\u7247\u683C\u5F0F\uFF0C\u8BF7\u53D1\u9001 JPEG\u3001PNG\u3001WebP \u6216 GIF \u56FE\u7247\u3002"));r.push({type:"image",mediaType:B,data:p.data.toString("base64"),...f_(p.name??c?.name)?{name:f_(p.name??c?.name)}:{}})}return r}function ao(n){if(n instanceof Qt)return{code:"image-prompt-error",reason:n.code,userMessage:n.userMessage};if(n?.code!=="attachment-error"||typeof n?.details?.reason!="string")return null;let t=n.details.reason,o=Object.hasOwn(sY,t)?w(sY[t]):null;return o?{code:"attachment-error",reason:t,userMessage:o}:null}function No(n){return ao(n)?.userMessage??null}var pde=new Map([["image/png",".png"],["image/jpeg",".jpg"],["image/gif",".gif"],["image/webp",".webp"]]),dde=/\.(?:png|jpe?g|gif|webp)$/i;function hde(n,t,o){let a=pde.get(t)??".img",e=f_(n);return e&&dde.test(e)?e:`${e??`image-${o+1}`}${a}`}function lY(n){return Array.isArray(n)?n.filter(t=>t?.type==="image").map((t,o)=>({name:hde(t.name,t.mediaType,o),...typeof t.mediaType=="string"&&t.mediaType.trim()?{mediaType:t.mediaType.trim()}:{},data:Buffer.from(typeof t.data=="string"?t.data:"","base64")})):[]}function pY(n){return Array.isArray(n)?n.filter(t=>t?.type!=="image"):n}function dY(n){return n?.code==="attachment-error"&&n?.details?.reason==="MODEL_DOES_NOT_SUPPORT_IMAGES"}var hY="https://oapi.dingtalk.com/",ude="https://api.dingtalk.com/",Cde="DING_DWS_CLAW",Bde="02fcf2f4-5e02-4a85-b672-46d1f715543e.schema",HI="\u{1F914}\u601D\u8003\u4E2D",CY="\u2705\u5DF2\u5B8C\u6210",BY="\u274C\u5904\u7406\u5931\u8D25",fde=15e3,Qde=5e3,yde="2659900",mde="im_bg_1",Sde=new Set(["WAITING","SUCCESS","FAIL","EXPIRED"]),It=class extends Error{constructor(t,o,a={}){super(o,a),this.name="DingtalkApiError",this.code=t,this.status=a.status,this.providerCode=a.providerCode}};function WA(n){return typeof n=="string"&&n.trim()?n.trim():null}function tu(n){let t=n==null?null:String(n).trim();return t&&/^-?[A-Za-z0-9_.:-]{1,160}$/.test(t)?t:void 0}function fY(n,t){return Number.isInteger(t?.status)&&(n.status=t.status),t?.providerCode!==void 0&&(n.providerCode=t.providerCode),n}function eu(n,{fallback:t="artifact-provider-rejected"}={}){if(n?.code?.startsWith?.("artifact-"))return n;let o=Number(n?.status),a=tu(n?.providerCode),e=a??"",i=t,A="DingTalk could not prepare the file for delivery.";o===401||o===403||a==="401"||a==="403"||/(?:permission|forbidden|unauthor|access.?denied|\.auth(?:\.|$))/i.test(e)?(i="artifact-permission-required",A="DingTalk denied permission to send the file."):o===413||a==="413"||/(?:too.?large|size.?limit)/i.test(e)?(i="artifact-too-large",A="The file exceeds DingTalk's size limit."):o===429||a==="429"||/(?:rate.?limit|too.?many|throttl)/i.test(e)?(i="artifact-rate-limited",A="DingTalk rate-limited file delivery."):t==="artifact-provider-rejected"&&(A="DingTalk rejected the file message.");let r=new Error(A,{cause:n});return r.code=i,fY(r,n)}function wde(n){let t=new Error("DingTalk file delivery result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",fY(t,n)}function GQ(n){if(!n||typeof n!="object")return null;for(let t of["errcode","code"])if(n[t]!==void 0&&n[t]!==0&&n[t]!=="0")return tu(n[t])??"rejected";return null}function Dde(n,t){if(t?.aborted)throw ss(t);let o=Number(n?.status);return n?.code==="network-error"||n?.code==="timeout"||n?.code==="invalid-response"||o>=500&&o<600?wde(n):eu(n)}function Ode(n){let t;try{t=new URL(n)}catch(o){throw new It("invalid-image-download","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u3002",{cause:o})}return t.protocol==="http:"&&(!t.port||t.port==="80")&&(t.protocol="https:",t.port=""),t}function EY(n){let t=n.toLowerCase().replace(/\.$/,"");return t==="dingtalk.com"||t.endsWith(".dingtalk.com")}function w_(n,{label:t,requireSubdomain:o=!0}={}){let a;try{a=new URL(n)}catch{throw new It("invalid-url",`${t??"\u9489\u9489\u670D\u52A1"}\u8FD4\u56DE\u4E86\u65E0\u6548\u5730\u5740\u3002`)}let e=a.hostname.toLowerCase().replace(/\.$/,""),i=o?e!=="dingtalk.com"&&EY(e):EY(e);if(a.protocol!=="https:"||!i||a.port&&a.port!=="443")throw new It("untrusted-url",`${t??"\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`);if(a.username||a.password)throw new It("untrusted-url",`${t??"\u9489\u9489\u670D\u52A1"}\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002`);return a}function Cc(n){let t=WA(n);if(!t)throw new It("invalid-session-webhook","\u9489\u9489\u6D88\u606F\u6CA1\u6709\u53EF\u7528\u7684\u56DE\u590D\u5730\u5740\u3002");let o=w_(t,{label:"\u9489\u9489\u56DE\u590D",requireSubdomain:!1});return o.hash="",o.toString()}function QY(n,t=4e3){let o=typeof n=="string"?n.trim():"";if(!o)return[];if(!Number.isInteger(t)||t<1)throw new TypeError("maxChars must be a positive integer");if(o.length<=t)return[o];let a=[],e=o;for(;e.length>t;){let i=e.lastIndexOf(` `,t);i{if(t?.aborted){a(ss(t));return}let e=setTimeout(()=>{t?.removeEventListener("abort",i),o()},n),i=()=>{clearTimeout(e),a(ss(t))};t?.addEventListener("abort",i,{once:!0})})}async function mn(n,t,{body:o,signal:a,timeoutMs:e=fde,headers:i={},method:A="POST",action:r="request"}={}){let s=new AbortController,g=!1,c=()=>s.abort(a?.reason);if(a?.aborted)throw ss(a);a?.addEventListener("abort",c,{once:!0});let I=e>0?setTimeout(()=>{g=!0,s.abort()},e):null;try{let p=await n(t,{method:A,redirect:"error",headers:{"content-type":"application/json",...i},body:JSON.stringify(o??{}),signal:s.signal});if(!p.ok){let B;try{let f=await p.json();B=tu(f?.code??f?.errcode)}catch{}throw new It("http-error",`\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${p.status}\uFF09\u3002`,{status:p.status,providerCode:B})}try{return await p.json()}catch(B){throw new It("invalid-response","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002",{cause:B})}}catch(p){throw a?.aborted?ss(a):g?new It("timeout","\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002",{cause:p}):p instanceof It?p:new It("network-error",`\u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u9489\u9489${r}\u8BF7\u6C42\u3002`,{cause:p})}finally{I&&clearTimeout(I),a?.removeEventListener("abort",c)}}async function Mde(n,t,{body:o,signal:a,timeoutMs:e=6e4}={}){let i=new AbortController,A=!1,r=()=>i.abort(a?.reason);if(a?.aborted)throw ss(a);a?.addEventListener("abort",r,{once:!0});let s=setTimeout(()=>{A=!0,i.abort()},e);try{let g=await n(t,{method:"POST",body:o,signal:i.signal,redirect:"error"}),c,I;try{c=await g.json()}catch(p){I=p}if(!g.ok)throw new It("http-error",`\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${g.status}\uFF09\u3002`,{status:g.status,providerCode:tu(c?.code??c?.errcode)});if(I)throw new It("invalid-response","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002",{cause:I});return c}catch(g){throw a?.aborted?ss(a):A?new It("timeout","\u9489\u9489\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002",{cause:g}):g instanceof It?g:new It("network-error","\u6682\u65F6\u65E0\u6CD5\u5B8C\u6210\u9489\u9489\u6587\u4EF6\u4E0A\u4F20\u8BF7\u6C42\u3002",{cause:g})}finally{clearTimeout(s),a?.removeEventListener("abort",r)}}function uY(n){let t=WA(n?.robotCode);if(!t)throw new TypeError("DingTalk robotCode is required");if(n?.type==="group"){let o=WA(n.openConversationId);if(o)return{type:"group",robotCode:t,openConversationId:o}}if(n?.type==="user"){let o=WA(n.userId);if(o)return{type:"user",robotCode:t,userId:o}}throw new TypeError("DingTalk file target is invalid")}function _de(n){return Ede(n).slice(1).toLowerCase()}function Tde(n){if(n?.type==="user"){let t=WA(n.userId);if(t)return{type:"user",userId:t}}if(n?.type==="group"){let t=WA(n.openConversationId);if(t)return{type:"group",openConversationId:t,atUserIds:n.atUserIds}}throw new TypeError("DingTalk AI Card target is invalid")}function Au(n,t){let o=e=>String(e).replace(/[&<>"']/g,i=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[i]),a=t?.type==="group"?Object.entries(t.atUserIds??{}).map(([e,i])=>`${o(i)}`).join(" "):"";return Rde(a?`${a} ${n}`:n)}function y_(n,t,o){return{cardParamMap:{flowStatus:t,msgContent:Au(n,o),staticMsgContent:"",sys_full_json_obj:JSON.stringify({order:["msgContent"]}),config:JSON.stringify({autoLayout:!0})}}}function Nde(n,t,o){let a={outTrackId:n,userIdType:1};return t.type==="group"?{...a,openSpaceId:`dtv1.card//IM_GROUP.${t.openConversationId}`,imGroupOpenDeliverModel:{robotCode:o,atUserIds:t.atUserIds}}:{...a,openSpaceId:`dtv1.card//IM_ROBOT.${t.userId}`,imRobotOpenDeliverModel:{spaceType:"IM_ROBOT",robotCode:o,extension:{dynamicSummary:"true"}}}}function Rde(n){let o=(typeof n=="string"?n.replace(/\r\n?/g,` `):"").split(` `),a=!1;return o.map((e,i)=>{let A=/^\s{0,3}```/.test(e),r=a;return A&&(a=!a),i===o.length-1?e:r||A||a||!e||!o[i+1]?`${e} `:/^\s{0,3}(?:[-*+] |\d+[.)] |#{1,6} |\||> )/.test(o[i+1])?`${e} -`:`${e}
`}).join("")}function m_(n,t){if(!n||typeof n!="object"||n.errcode!==0)throw new It("registration-rejected",`\u9489\u9489\u626B\u7801${t}\u5931\u8D25\u3002`);return n}function S_(n,t){let o=Number(n);return Number.isFinite(o)&&o>0?o:t}function yY({fetchImpl:n=fetch,registrationBaseUrl:t=process.env.DINGTALK_REGISTRATION_BASE_URL||hY,registrationSource:o=process.env.DINGTALK_REGISTRATION_SOURCE||Cde,now:a=()=>Date.now(),cardMinIntervalMs:e=50,cardBackoffMs:i=1e3,delay:A=bde}={}){if(typeof n!="function")throw new TypeError("fetchImpl must be a function");if(typeof a!="function")throw new TypeError("now must be a function");if(!Number.isFinite(e)||e<0)throw new TypeError("cardMinIntervalMs must be a non-negative number");if(!Number.isFinite(i)||i<0)throw new TypeError("cardBackoffMs must be a non-negative number");if(typeof A!="function")throw new TypeError("delay must be a function");let r=w_(t,{label:"\u9489\u9489\u6CE8\u518C\u670D\u52A1",requireSubdomain:!1}),s=new URL(ude),g=WA(o);if(!g)throw new TypeError("registrationSource is required");let c=new Map,I=new Map,p=new Map,B=Promise.resolve(),f=0,Q=(F,q)=>new URL(q.replace(/^\//,""),F);async function y({clientId:F,clientSecret:q,signal:z,requestKind:K="normal"}){let G=WA(F),V=WA(q);if(!G||!V)throw new TypeError("clientId and clientSecret are required");let H=c.get(G);if(H&&H.expiresAt>a())return H.token;let N=K==="reaction"?p:I;if(N.has(G))return N.get(G);let J=(async()=>{let X=await mn(n,Q(s,"v1.0/oauth2/accessToken"),{body:{appKey:G,appSecret:V},signal:z,action:"\u9274\u6743"}),ie=WA(X?.accessToken);if(!ie)throw new It("invalid-access-token","\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u8BBF\u95EE\u4EE4\u724C\u3002");let De=S_(X?.expireIn??X?.expiresIn,7200),oe=Math.max(1e3,(De-60)*1e3);return c.set(G,{token:ie,expiresAt:a()+oe}),ie})().finally(()=>N.delete(G));return N.set(G,J),J}async function m({clientId:F,clientSecret:q,robotCode:z,messageId:K,conversationId:G,reactionName:V=HI,signal:H},N){let k=WA(F),J=WA(q),X=WA(z)??k,ie=WA(K),De=WA(G),oe=WA(V);if(!k||!J)throw new TypeError("clientId and clientSecret are required");if(!X)throw new TypeError("robotCode is required");if(!ie||!De)throw new TypeError("messageId and conversationId are required");if(!oe)throw new TypeError("reactionName is required");let Se=await y({clientId:k,clientSecret:J,signal:H,requestKind:"reaction"}),Be=await mn(n,Q(s,`v1.0/robot/emotion/${N}`),{body:{robotCode:X,openMsgId:ie,openConversationId:De,emotionType:2,emotionName:oe,textEmotion:{emotionId:yde,emotionName:oe,text:oe,backgroundId:mde}},headers:{"x-acs-dingtalk-access-token":Se},signal:H,timeoutMs:Qde,action:N==="reply"?"\u6D88\u606F\u72B6\u6001\u6DFB\u52A0":"\u6D88\u606F\u72B6\u6001\u64A4\u56DE"}),Re=Be?.success===!1?tu(Be?.code??Be?.errcode)??"rejected":GQ(Be);if(Re)throw new It("reaction-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6D88\u606F\u72B6\u6001\u8BF7\u6C42\u3002",{providerCode:Re});return!0}async function T({clientId:F,clientSecret:q,robotCode:z,downloadCode:K,signal:G,kind:V}){let H=WA(z),N=WA(K);if(!H||!N)throw new TypeError("robotCode and downloadCode are required");let k=await y({clientId:F,clientSecret:q,signal:G}),J;try{J=await mn(n,Q(s,"v1.0/robot/messageFiles/download"),{body:{downloadCode:N,robotCode:H},headers:{"x-acs-dingtalk-access-token":k},signal:G,action:`${V==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740`})}catch(ie){throw G?.aborted?ie:new It(`${V}-download-address-failed`,`\u9489\u9489${V==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740\u83B7\u53D6\u5931\u8D25\u3002`,{cause:ie,status:ie?.status,providerCode:ie?.providerCode})}let X=WA(J?.downloadUrl??J?.download_url);if(!X)throw new It(`invalid-${V}-download`,`\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE${V==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740\u3002`);return Ode(X)}function _(F){let q=async()=>{let K=Math.max(0,f-a());K>0&&await A(K,F),f=Math.max(f,a())+e},z=B.then(q,q);return B=z.catch(()=>{}),z}async function R(F,q){await _(q.signal);try{return await mn(n,Q(s,F),q)}catch(z){if(!(z instanceof It)||z.status!==403)throw z;return await A(i,q.signal),await _(q.signal),mn(n,Q(s,F),q)}}async function L({clientId:F,clientSecret:q,cardInstanceId:z,text:K,target:G,signal:V}){let H=WA(z),N=WA(K);if(!H)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let J={"x-acs-dingtalk-access-token":await y({clientId:F,clientSecret:q,signal:V})},X=[R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:H,guid:$E(),key:"msgContent",content:Au(N,G),isFull:!0,isFinalize:!1,isError:!0},headers:J,signal:V,action:"AI Card \u5931\u8D25\u6536\u53E3"}),R("v1.0/card/instances",{method:"PUT",body:{outTrackId:H,cardData:y_(N,"5",G),cardUpdateOptions:{updateCardDataByKey:!0}},headers:J,signal:V,action:"AI Card \u5931\u8D25\u72B6\u6001"})],ie=await Promise.allSettled(X);if(ie.every(({status:De})=>De==="rejected"))throw ie[0].reason;return!0}async function U({clientId:F,clientSecret:q,target:z,file:K,signal:G},{uploadType:V,messageKey:H,createMessageParams:N}){if(!K||typeof K!="object"||typeof K.fileName!="string"||!K.fileName||!Buffer.isBuffer(K.bytes))throw new TypeError("A DingTalk file is required");let k=uY(z),J;try{J=await y({clientId:F,clientSecret:q,signal:G})}catch(ve){if(G?.aborted)throw ss(G);let tA=Number(ve?.status),fe=ve?.code==="http-error"&&tA>=400&&tA<500?"artifact-provider-rejected":"artifact-provider-failed";throw eu(ve,{fallback:fe})}let X=new URL("media/upload",hY);X.searchParams.set("access_token",J),X.searchParams.set("type",V);let ie=new FormData;ie.append("media",new Blob([K.bytes],{type:K.mediaType??"application/octet-stream"}),K.fileName);let De;try{De=await Mde(n,X,{body:ie,signal:G})}catch(ve){if(G?.aborted)throw ss(G);let tA=Number(ve?.status),fe=ve?.code==="http-error"&&tA>=400&&tA<500?"artifact-provider-rejected":"artifact-provider-failed";throw eu(ve,{fallback:fe})}let oe=GQ(De),Se=WA(De?.media_id);if(oe||!Se)throw eu(new It("upload-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u4E0A\u4F20\u3002",{providerCode:oe??"missing-media-id"}));G?.throwIfAborted();let Be={robotCode:k.robotCode,msgKey:H,msgParam:JSON.stringify(N(Se,K)),...k.type==="group"?{openConversationId:k.openConversationId}:{userIds:[k.userId]}},Re=k.type==="group"?"v1.0/robot/groupMessages/send":"v1.0/robot/oToMessages/batchSend",Ne;try{Ne=await mn(n,Q(s,Re),{body:Be,headers:{"x-acs-dingtalk-access-token":J},signal:G,action:"\u6587\u4EF6\u6D88\u606F\u53D1\u9001"})}catch(ve){throw Dde(ve,G)}let Je=GQ(Ne);if(Je)throw eu(new It("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u6D88\u606F\u3002",{providerCode:Je}));return Ne}return Object.freeze({async beginRegistration({signal:F}={}){let q=m_(await mn(n,Q(r,"app/registration/init"),{body:{source:g},signal:F,action:"\u521D\u59CB\u5316"}),"\u521D\u59CB\u5316"),z=WA(q.nonce);if(!z)throw new It("invalid-registration","\u9489\u9489\u626B\u7801\u521D\u59CB\u5316\u7F3A\u5C11 nonce\u3002");let K=m_(await mn(n,Q(r,"app/registration/begin"),{body:{nonce:z},signal:F,action:"\u521B\u5EFA"}),"\u521B\u5EFA"),G=WA(K.device_code),V=WA(K.verification_uri_complete);if(!G||!V)throw new It("invalid-registration","\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u7684\u4FE1\u606F\u4E0D\u5B8C\u6574\u3002");let H=w_(V,{label:"\u9489\u9489\u626B\u7801",requireSubdomain:!1}).toString();return{deviceCode:G,userCode:WA(K.user_code)??void 0,verificationUri:WA(K.verification_uri)??void 0,verificationUriComplete:H,expiresInSeconds:S_(K.expires_in,7200),intervalSeconds:S_(K.interval,5)}},async pollRegistration({deviceCode:F,signal:q}={}){let z=WA(F);if(!z)throw new TypeError("deviceCode is required");let K=m_(await mn(n,Q(r,"app/registration/poll"),{body:{device_code:z},signal:q,action:"\u72B6\u6001\u67E5\u8BE2"}),"\u72B6\u6001\u67E5\u8BE2"),G=WA(K.status)?.toUpperCase();if(!G||!Sde.has(G))throw new It("invalid-registration-status","\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u72B6\u6001\u3002");let V={status:G,failReason:WA(K.fail_reason)??void 0};if(G==="SUCCESS"&&(V.clientId=WA(K.client_id)??void 0,V.clientSecret=WA(K.client_secret)??void 0,!V.clientId||!V.clientSecret))throw new It("missing-credentials","\u9489\u9489\u626B\u7801\u5DF2\u786E\u8BA4\uFF0C\u4F46\u6CA1\u6709\u8FD4\u56DE\u673A\u5668\u4EBA\u51ED\u636E\u3002");return V},accessToken:y,async addReaction(F){return m(F,"reply")},async recallReaction(F){return m(F,"recall")},async addThinkingReaction(F){return m({...F,reactionName:HI},"reply")},async recallThinkingReaction(F){return m({...F,reactionName:HI},"recall")},async downloadImage({clientId:F,clientSecret:q,robotCode:z,downloadCode:K,signal:G,maxBytes:V}){let H=await T({clientId:F,clientSecret:q,robotCode:z,downloadCode:K,signal:G,kind:"image"});try{return await To(H,{fetchImpl:n,signal:G,maxBytes:V})}catch(N){throw G?.aborted||N instanceof ft?N:new It("image-content-download-failed","\u9489\u9489\u56FE\u7247\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\u3002",{cause:N})}},async downloadFile({clientId:F,clientSecret:q,robotCode:z,downloadCode:K,signal:G}){let V=await T({clientId:F,clientSecret:q,robotCode:z,downloadCode:K,signal:G,kind:"file"});if(V.protocol!=="https:")throw new It("invalid-file-download","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u6587\u4EF6\u4E0B\u8F7D\u5730\u5740\u3002");try{let H=await n(V,{method:"GET",redirect:"follow",signal:G});if(!H?.ok)throw await H?.body?.cancel?.().catch?.(()=>{}),new It("file-content-download-failed",`\u9489\u9489\u6587\u4EF6\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP ${H?.status??"unknown"}\uFF09\u3002`,{status:H?.status});return Buffer.from(await H.arrayBuffer())}catch(H){throw G?.aborted?ss(G):H instanceof It?H:new It("file-content-download-failed","\u9489\u9489\u6587\u4EF6\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\u3002",{cause:H})}},async createAiCard({clientId:F,clientSecret:q,target:z,initialText:K,signal:G}){let V=WA(F),H=WA(q),N=WA(K);if(!V||!H)throw new TypeError("clientId and clientSecret are required");if(!N)throw new TypeError("initialText is required");let k=Tde(z),J=await y({clientId:V,clientSecret:H,signal:G}),X=`dsh_${$E()}`,ie={"x-acs-dingtalk-access-token":J},De=!1;try{await R("v1.0/card/instances",{body:{cardTemplateId:Bde,outTrackId:X,cardData:{cardParamMap:{config:JSON.stringify({autoLayout:!0})}},callbackType:"STREAM",cardAtUserIds:k.atUserIds?Object.keys(k.atUserIds):void 0,imGroupOpenSpaceModel:{supportForward:!0},imRobotOpenSpaceModel:{supportForward:!0}},headers:ie,signal:G,action:"AI Card \u521B\u5EFA"}),await R("v1.0/card/instances/deliver",{body:Nde(X,k,V),headers:ie,signal:G,action:"AI Card \u6295\u653E"}),De=!0,await R("v1.0/card/instances",{method:"PUT",body:{outTrackId:X,cardData:y_(N,"2",k)},headers:ie,signal:G,action:"AI Card \u542F\u52A8"}),await R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:X,guid:$E(),key:"msgContent",content:Au(N,k).replace(/\n+$/,""),isFull:!0,isFinalize:!1,isError:!1},headers:ie,signal:G,action:"AI Card \u542F\u52A8"})}catch(oe){if(De){let Se=AbortSignal.timeout(5e3);await L({clientId:V,clientSecret:H,cardInstanceId:X,text:w("\u5361\u7247\u5DF2\u7ED3\u675F\uFF0C\u8BF7\u67E5\u770B\u540E\u7EED\u6D88\u606F\u3002"),target:k,signal:Se}).catch(()=>{})}throw oe}return{cardInstanceId:X}},async updateAiCard({clientId:F,clientSecret:q,cardInstanceId:z,text:K,target:G,signal:V}){let H=WA(z),N=WA(K);if(!H)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let k=await y({clientId:F,clientSecret:q,signal:V});return await R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:H,guid:$E(),key:"msgContent",content:Au(N,G).replace(/\n+$/,""),isFull:!0,isFinalize:!1,isError:!1},headers:{"x-acs-dingtalk-access-token":k},signal:V,action:"AI Card \u66F4\u65B0"}),!0},async finishAiCard({clientId:F,clientSecret:q,cardInstanceId:z,text:K,target:G,signal:V}){let H=WA(z),N=WA(K);if(!H)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let J={"x-acs-dingtalk-access-token":await y({clientId:F,clientSecret:q,signal:V})},X=Au(N,G);await R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:H,guid:$E(),key:"msgContent",content:X,isFull:!0,isFinalize:!0,isError:!1},headers:J,signal:V,action:"AI Card \u5B8C\u6210"});let ie=!0,De={method:"PUT",body:{outTrackId:H,cardData:y_(N,"3",G),cardUpdateOptions:{updateCardDataByKey:!0}},headers:J,signal:V,action:"AI Card \u6536\u53E3"};try{await R("v1.0/card/instances",De)}catch{try{await R("v1.0/card/instances",De)}catch{ie=!1}}return{delivered:!0,completed:ie}},failAiCard:L,async sendText({clientId:F,clientSecret:q,sessionWebhook:z,text:K,at:G,signal:V}){let H=WA(K);if(!H)throw new TypeError("text is required");let N=Cc(z),k=await y({clientId:F,clientSecret:q,signal:V}),J=G&&typeof G=="object"&&(Array.isArray(G.atUserIds)&&G.atUserIds.length>0||Array.isArray(G.atMobiles)&&G.atMobiles.length>0||G.isAtAll===!0)?{at:G}:{},X=await mn(n,N,{body:{msgtype:"text",text:{content:H},...J},headers:{"x-acs-dingtalk-access-token":k},signal:V,action:"\u6D88\u606F\u56DE\u590D"});if(X?.errcode!==void 0&&X.errcode!==0||X?.code!==void 0&&X.code!==0)throw new It("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002");return!0},async sendRobotText({clientId:F,clientSecret:q,target:z,text:K,signal:G}){if(typeof K!="string"||!K.trim())throw new TypeError("text is required");let V=K,H=uY(z),N=await y({clientId:F,clientSecret:q,signal:G}),k={robotCode:H.robotCode,msgKey:"sampleText",msgParam:JSON.stringify({content:V}),...H.type==="group"?{openConversationId:H.openConversationId}:{userIds:[H.userId]}},J=H.type==="group"?"v1.0/robot/groupMessages/send":"v1.0/robot/oToMessages/batchSend",X=await mn(n,Q(s,J),{body:k,headers:{"x-acs-dingtalk-access-token":N},signal:G,action:"\u4E3B\u52A8\u6587\u5B57\u6D88\u606F\u53D1\u9001"}),ie=GQ(X);if(ie)throw new It("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u4E3B\u52A8\u6587\u5B57\u6D88\u606F\u3002",{providerCode:ie});return X},async sendFile(F){return U(F,{uploadType:"file",messageKey:"sampleFile",createMessageParams:(q,z)=>({mediaId:q,fileName:z.fileName,fileType:_de(z.fileName)})})},async sendImage(F){return U(F,{uploadType:"image",messageKey:"sampleImageMsg",createMessageParams:q=>({photoURL:q})})},clearAccessToken(F){let q=WA(F);q&&c.delete(q)}})}var kde=500,vde="\u5361\u7247\u5DF2\u7ED3\u675F\uFF0C\u8BF7\u67E5\u770B\u540E\u7EED\u6D88\u606F\u3002";function D_(n,t){if(typeof n!="string")throw new TypeError(`${t} must be a string`);return n}function mY(n,t){if(typeof n!="string"||!n.trim())throw new TypeError(`${t} is required`);return n.trim()}function SY({api:n,clientId:t,clientSecret:o,target:a,signal:e,logger:i=console,updateIntervalMs:A=kde,clock:r=()=>Date.now(),timer:s={setTimeout:(g,c)=>globalThis.setTimeout(g,c),clearTimeout:g=>globalThis.clearTimeout(g)}}={}){if(!n||typeof n.createAiCard!="function"||typeof n.updateAiCard!="function"||typeof n.finishAiCard!="function")throw new TypeError("DingTalk AI Card API is required");let g=mY(t,"clientId"),c=mY(o,"clientSecret");if(a==null)throw new TypeError("target is required");if(!Number.isFinite(A)||A<0)throw new TypeError("updateIntervalMs must be a non-negative number");if(typeof r!="function")throw new TypeError("clock must be a function");if(typeof s?.setTimeout!="function"||typeof s?.clearTimeout!="function")throw new TypeError("timer must provide setTimeout and clearTimeout");let I=()=>{let N=r();if(!Number.isFinite(N))throw new TypeError("clock must return a finite timestamp");return N};I();let p=e?.aborted?"aborted":"idle",B=null,f=null,Q=null,y=null,m=null,T=null,_=0,R=()=>{Q!==null&&(s.clearTimeout(Q),Q=null)},L=()=>e?.removeEventListener("abort",z),U=N=>{p=N,f=null,R(),L()},F=()=>!B||typeof n.failAiCard!="function"?Promise.resolve(!1):(T||(T=n.failAiCard({...B,text:w(vde),signal:AbortSignal.timeout(5e3)}).then(()=>!0,()=>!1)),T),q=N=>{p==="failed"||p==="finished"||p==="aborted"||(F(),U("failed"),i?.error?.(`[dsh-dingtalk] AI Card ${N} failed`))};function z(){p==="finished"||p==="failed"||p==="aborted"||(F(),U("aborted"))}p!=="aborted"&&e?.addEventListener("abort",z,{once:!0});let K=()=>{if(p!=="active"||y||f===null)return;let N=Math.max(0,_+A-I());if(N>0){Q=s.setTimeout(()=>{Q=null,K()},N);return}let k=f;f=null,y=(async()=>{try{await n.updateAiCard({...B,text:k,finished:!1}),_=I()}catch{if(e?.aborted||p==="aborted")return;q("update")}})().finally(()=>{y=null,p==="active"&&f!==null&&K()})};return Object.freeze({start:async N=>{if(D_(N,"initialText"),p!=="idle")return!1;p="starting";try{let k=await n.createAiCard({clientId:g,clientSecret:c,target:a,initialText:N,signal:e}),J=typeof k?.cardInstanceId=="string"?k.cardInstanceId.trim():"";if(!J)throw new TypeError("DingTalk did not return a card instance id");return B=Object.freeze({clientId:g,clientSecret:c,target:a,cardInstanceId:J,signal:e}),p!=="starting"?(F(),!1):(_=I(),p="active",!0)}catch{return e?.aborted||p==="aborted"?(U("aborted"),!1):(q("creation"),!1)}},push:N=>{D_(N,"progressText"),p==="active"&&(f=N,!Q&&!y&&K())},finish:N=>{if(D_(N,"finalText"),p==="finished")return Promise.resolve(!0);if(p==="finishing")return m;if(p!=="active")return Promise.resolve(!1);p="finishing",f=null,R();let k=y;return m=(async()=>{if(k&&await k,p!=="finishing")return!1;try{return await n.finishAiCard({...B,text:N}),p!=="finishing"?!1:(U("finished"),!0)}catch{return e?.aborted||p==="aborted"?(U("aborted"),!1):(q("finish"),!1)}})(),m},get providerMessageIds(){return B?.cardInstanceId?[B.cardInstanceId]:[]}})}function FQ(n){return typeof n=="string"&&n.trim()?n.trim():null}function ba(n){return n&&typeof n.id=="string"&&typeof n.question=="string"&&(n.header===void 0||typeof n.header=="string")&&(n.detail===void 0||typeof n.detail=="string")&&(n.multiSelect===void 0||typeof n.multiSelect=="boolean")&&(n.options===void 0||Array.isArray(n.options)&&n.options.every(t=>t&&typeof t.label=="string"&&(t.description===void 0||typeof t.description=="string")))}function Ia(n,t,o,{requiresMention:a=!1}={}){let e=[],i=o>1?`\uFF08${t+1}/${o}\uFF09`:"";e.push(w("DeepSeek Harness \u9700\u8981\u4F60\u8865\u5145\u4FE1\u606F{progress}\uFF1A",{progress:i})),FQ(n.header)&&e.push("",n.header.trim()),e.push("",FQ(n.question)??w("\u8BF7\u8F93\u5165\u4F60\u7684\u56DE\u7B54\u3002")),FQ(n.detail)&&e.push("",n.detail.trim());let A=Array.isArray(n.options)?n.options:[];return A.length>0?(e.push(""),A.forEach((r,s)=>{let g=typeof r?.label=="string"?r.label:"",c=FQ(r?.description);e.push(`${s+1}. ${g}${c?` \u2014 ${c}`:""}`)}),e.push("",n.multiSelect===!0?w("\u8BF7\u56DE\u590D\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF1B\u591A\u9009\u7528\u9017\u53F7\u5206\u9694\uFF0C\u4E5F\u53EF\u8865\u5145\u5176\u4ED6\u5185\u5BB9\u3002"):w("\u8BF7\u56DE\u590D\u4E00\u4E2A\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF0C\u4E5F\u53EF\u76F4\u63A5\u8F93\u5165\u5176\u4ED6\u7B54\u6848\u3002"))):e.push("",w("\u8BF7\u76F4\u63A5\u56DE\u590D\u4F60\u7684\u7B54\u6848\u3002")),a&&e.push("",w("\u7FA4\u804A\u4E2D\u8BF7 @\u673A\u5668\u4EBA \u540E\u53D1\u9001\u7B54\u6848\u3002")),e.join(` +`:`${e}
`}).join("")}function m_(n,t){if(!n||typeof n!="object"||n.errcode!==0)throw new It("registration-rejected",`\u9489\u9489\u626B\u7801${t}\u5931\u8D25\u3002`);return n}function S_(n,t){let o=Number(n);return Number.isFinite(o)&&o>0?o:t}function yY({fetchImpl:n=fetch,registrationBaseUrl:t=process.env.DINGTALK_REGISTRATION_BASE_URL||hY,registrationSource:o=process.env.DINGTALK_REGISTRATION_SOURCE||Cde,now:a=()=>Date.now(),cardMinIntervalMs:e=50,cardBackoffMs:i=1e3,delay:A=bde}={}){if(typeof n!="function")throw new TypeError("fetchImpl must be a function");if(typeof a!="function")throw new TypeError("now must be a function");if(!Number.isFinite(e)||e<0)throw new TypeError("cardMinIntervalMs must be a non-negative number");if(!Number.isFinite(i)||i<0)throw new TypeError("cardBackoffMs must be a non-negative number");if(typeof A!="function")throw new TypeError("delay must be a function");let r=w_(t,{label:"\u9489\u9489\u6CE8\u518C\u670D\u52A1",requireSubdomain:!1}),s=new URL(ude),g=WA(o);if(!g)throw new TypeError("registrationSource is required");let c=new Map,I=new Map,p=new Map,B=Promise.resolve(),f=0,Q=(F,q)=>new URL(q.replace(/^\//,""),F);async function y({clientId:F,clientSecret:q,signal:z,requestKind:K="normal"}){let G=WA(F),V=WA(q);if(!G||!V)throw new TypeError("clientId and clientSecret are required");let H=c.get(G);if(H&&H.expiresAt>a())return H.token;let N=K==="reaction"?p:I;if(N.has(G))return N.get(G);let J=(async()=>{let X=await mn(n,Q(s,"v1.0/oauth2/accessToken"),{body:{appKey:G,appSecret:V},signal:z,action:"\u9274\u6743"}),ie=WA(X?.accessToken);if(!ie)throw new It("invalid-access-token","\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u8BBF\u95EE\u4EE4\u724C\u3002");let De=S_(X?.expireIn??X?.expiresIn,7200),oe=Math.max(1e3,(De-60)*1e3);return c.set(G,{token:ie,expiresAt:a()+oe}),ie})().finally(()=>N.delete(G));return N.set(G,J),J}async function m({clientId:F,clientSecret:q,robotCode:z,messageId:K,conversationId:G,reactionName:V=HI,signal:H},N){let k=WA(F),J=WA(q),X=WA(z)??k,ie=WA(K),De=WA(G),oe=WA(V);if(!k||!J)throw new TypeError("clientId and clientSecret are required");if(!X)throw new TypeError("robotCode is required");if(!ie||!De)throw new TypeError("messageId and conversationId are required");if(!oe)throw new TypeError("reactionName is required");let Se=await y({clientId:k,clientSecret:J,signal:H,requestKind:"reaction"}),Be=await mn(n,Q(s,`v1.0/robot/emotion/${N}`),{body:{robotCode:X,openMsgId:ie,openConversationId:De,emotionType:2,emotionName:oe,textEmotion:{emotionId:yde,emotionName:oe,text:oe,backgroundId:mde}},headers:{"x-acs-dingtalk-access-token":Se},signal:H,timeoutMs:Qde,action:N==="reply"?"\u6D88\u606F\u72B6\u6001\u6DFB\u52A0":"\u6D88\u606F\u72B6\u6001\u64A4\u56DE"}),Re=Be?.success===!1?tu(Be?.code??Be?.errcode)??"rejected":GQ(Be);if(Re)throw new It("reaction-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6D88\u606F\u72B6\u6001\u8BF7\u6C42\u3002",{providerCode:Re});return!0}async function T({clientId:F,clientSecret:q,robotCode:z,downloadCode:K,signal:G,kind:V}){let H=WA(z),N=WA(K);if(!H||!N)throw new TypeError("robotCode and downloadCode are required");let k=await y({clientId:F,clientSecret:q,signal:G}),J;try{J=await mn(n,Q(s,"v1.0/robot/messageFiles/download"),{body:{downloadCode:N,robotCode:H},headers:{"x-acs-dingtalk-access-token":k},signal:G,action:`${V==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740`})}catch(ie){throw G?.aborted?ie:new It(`${V}-download-address-failed`,`\u9489\u9489${V==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740\u83B7\u53D6\u5931\u8D25\u3002`,{cause:ie,status:ie?.status,providerCode:ie?.providerCode})}let X=WA(J?.downloadUrl??J?.download_url);if(!X)throw new It(`invalid-${V}-download`,`\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE${V==="image"?"\u56FE\u7247":"\u6587\u4EF6"}\u4E0B\u8F7D\u5730\u5740\u3002`);return Ode(X)}function _(F){let q=async()=>{let K=Math.max(0,f-a());K>0&&await A(K,F),f=Math.max(f,a())+e},z=B.then(q,q);return B=z.catch(()=>{}),z}async function R(F,q){await _(q.signal);try{return await mn(n,Q(s,F),q)}catch(z){if(!(z instanceof It)||z.status!==403)throw z;return await A(i,q.signal),await _(q.signal),mn(n,Q(s,F),q)}}async function L({clientId:F,clientSecret:q,cardInstanceId:z,text:K,target:G,signal:V}){let H=WA(z),N=WA(K);if(!H)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let J={"x-acs-dingtalk-access-token":await y({clientId:F,clientSecret:q,signal:V})},X=[R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:H,guid:$E(),key:"msgContent",content:Au(N,G),isFull:!0,isFinalize:!1,isError:!0},headers:J,signal:V,action:"AI Card \u5931\u8D25\u6536\u53E3"}),R("v1.0/card/instances",{method:"PUT",body:{outTrackId:H,cardData:y_(N,"5",G),cardUpdateOptions:{updateCardDataByKey:!0}},headers:J,signal:V,action:"AI Card \u5931\u8D25\u72B6\u6001"})],ie=await Promise.allSettled(X);if(ie.every(({status:De})=>De==="rejected"))throw ie[0].reason;return!0}async function U({clientId:F,clientSecret:q,target:z,file:K,signal:G},{uploadType:V,messageKey:H,createMessageParams:N}){if(!K||typeof K!="object"||typeof K.fileName!="string"||!K.fileName||!Buffer.isBuffer(K.bytes))throw new TypeError("A DingTalk file is required");let k=uY(z),J;try{J=await y({clientId:F,clientSecret:q,signal:G})}catch(ve){if(G?.aborted)throw ss(G);let tA=Number(ve?.status),fe=ve?.code==="http-error"&&tA>=400&&tA<500?"artifact-provider-rejected":"artifact-provider-failed";throw eu(ve,{fallback:fe})}let X=new URL("media/upload",hY);X.searchParams.set("access_token",J),X.searchParams.set("type",V);let ie=new FormData;ie.append("media",new Blob([K.bytes],{type:K.mediaType??"application/octet-stream"}),K.fileName);let De;try{De=await Mde(n,X,{body:ie,signal:G})}catch(ve){if(G?.aborted)throw ss(G);let tA=Number(ve?.status),fe=ve?.code==="http-error"&&tA>=400&&tA<500?"artifact-provider-rejected":"artifact-provider-failed";throw eu(ve,{fallback:fe})}let oe=GQ(De),Se=WA(De?.media_id);if(oe||!Se)throw eu(new It("upload-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u4E0A\u4F20\u3002",{providerCode:oe??"missing-media-id"}));G?.throwIfAborted();let Be={robotCode:k.robotCode,msgKey:H,msgParam:JSON.stringify(N(Se,K)),...k.type==="group"?{openConversationId:k.openConversationId}:{userIds:[k.userId]}},Re=k.type==="group"?"v1.0/robot/groupMessages/send":"v1.0/robot/oToMessages/batchSend",Ne;try{Ne=await mn(n,Q(s,Re),{body:Be,headers:{"x-acs-dingtalk-access-token":J},signal:G,action:"\u6587\u4EF6\u6D88\u606F\u53D1\u9001"})}catch(ve){throw Dde(ve,G)}let Je=GQ(Ne);if(Je)throw eu(new It("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u6D88\u606F\u3002",{providerCode:Je}));return Ne}return Object.freeze({async beginRegistration({signal:F}={}){let q=m_(await mn(n,Q(r,"app/registration/init"),{body:{source:g},signal:F,action:"\u521D\u59CB\u5316"}),"\u521D\u59CB\u5316"),z=WA(q.nonce);if(!z)throw new It("invalid-registration","\u9489\u9489\u626B\u7801\u521D\u59CB\u5316\u7F3A\u5C11 nonce\u3002");let K=m_(await mn(n,Q(r,"app/registration/begin"),{body:{nonce:z},signal:F,action:"\u521B\u5EFA"}),"\u521B\u5EFA"),G=WA(K.device_code),V=WA(K.verification_uri_complete);if(!G||!V)throw new It("invalid-registration","\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u7684\u4FE1\u606F\u4E0D\u5B8C\u6574\u3002");let H=w_(V,{label:"\u9489\u9489\u626B\u7801",requireSubdomain:!1}).toString();return{deviceCode:G,userCode:WA(K.user_code)??void 0,verificationUri:WA(K.verification_uri)??void 0,verificationUriComplete:H,expiresInSeconds:S_(K.expires_in,7200),intervalSeconds:S_(K.interval,5)}},async pollRegistration({deviceCode:F,signal:q}={}){let z=WA(F);if(!z)throw new TypeError("deviceCode is required");let K=m_(await mn(n,Q(r,"app/registration/poll"),{body:{device_code:z},signal:q,action:"\u72B6\u6001\u67E5\u8BE2"}),"\u72B6\u6001\u67E5\u8BE2"),G=WA(K.status)?.toUpperCase();if(!G||!Sde.has(G))throw new It("invalid-registration-status","\u9489\u9489\u626B\u7801\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u72B6\u6001\u3002");let V={status:G,failReason:WA(K.fail_reason)??void 0};if(G==="SUCCESS"&&(V.clientId=WA(K.client_id)??void 0,V.clientSecret=WA(K.client_secret)??void 0,!V.clientId||!V.clientSecret))throw new It("missing-credentials","\u9489\u9489\u626B\u7801\u5DF2\u786E\u8BA4\uFF0C\u4F46\u6CA1\u6709\u8FD4\u56DE\u673A\u5668\u4EBA\u51ED\u636E\u3002");return V},accessToken:y,async addReaction(F){return m(F,"reply")},async recallReaction(F){return m(F,"recall")},async addThinkingReaction(F){return m({...F,reactionName:HI},"reply")},async recallThinkingReaction(F){return m({...F,reactionName:HI},"recall")},async downloadImage({clientId:F,clientSecret:q,robotCode:z,downloadCode:K,signal:G,maxBytes:V}){let H=await T({clientId:F,clientSecret:q,robotCode:z,downloadCode:K,signal:G,kind:"image"});try{return await To(H,{fetchImpl:n,signal:G,maxBytes:V})}catch(N){throw G?.aborted||N instanceof Qt?N:new It("image-content-download-failed","\u9489\u9489\u56FE\u7247\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\u3002",{cause:N})}},async downloadFile({clientId:F,clientSecret:q,robotCode:z,downloadCode:K,signal:G}){let V=await T({clientId:F,clientSecret:q,robotCode:z,downloadCode:K,signal:G,kind:"file"});if(V.protocol!=="https:")throw new It("invalid-file-download","\u9489\u9489\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u6587\u4EF6\u4E0B\u8F7D\u5730\u5740\u3002");try{let H=await n(V,{method:"GET",redirect:"follow",signal:G});if(!H?.ok)throw await H?.body?.cancel?.().catch?.(()=>{}),new It("file-content-download-failed",`\u9489\u9489\u6587\u4EF6\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP ${H?.status??"unknown"}\uFF09\u3002`,{status:H?.status});return Buffer.from(await H.arrayBuffer())}catch(H){throw G?.aborted?ss(G):H instanceof It?H:new It("file-content-download-failed","\u9489\u9489\u6587\u4EF6\u5185\u5BB9\u4E0B\u8F7D\u5931\u8D25\u3002",{cause:H})}},async createAiCard({clientId:F,clientSecret:q,target:z,initialText:K,signal:G}){let V=WA(F),H=WA(q),N=WA(K);if(!V||!H)throw new TypeError("clientId and clientSecret are required");if(!N)throw new TypeError("initialText is required");let k=Tde(z),J=await y({clientId:V,clientSecret:H,signal:G}),X=`dsh_${$E()}`,ie={"x-acs-dingtalk-access-token":J},De=!1;try{await R("v1.0/card/instances",{body:{cardTemplateId:Bde,outTrackId:X,cardData:{cardParamMap:{config:JSON.stringify({autoLayout:!0})}},callbackType:"STREAM",cardAtUserIds:k.atUserIds?Object.keys(k.atUserIds):void 0,imGroupOpenSpaceModel:{supportForward:!0},imRobotOpenSpaceModel:{supportForward:!0}},headers:ie,signal:G,action:"AI Card \u521B\u5EFA"}),await R("v1.0/card/instances/deliver",{body:Nde(X,k,V),headers:ie,signal:G,action:"AI Card \u6295\u653E"}),De=!0,await R("v1.0/card/instances",{method:"PUT",body:{outTrackId:X,cardData:y_(N,"2",k)},headers:ie,signal:G,action:"AI Card \u542F\u52A8"}),await R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:X,guid:$E(),key:"msgContent",content:Au(N,k).replace(/\n+$/,""),isFull:!0,isFinalize:!1,isError:!1},headers:ie,signal:G,action:"AI Card \u542F\u52A8"})}catch(oe){if(De){let Se=AbortSignal.timeout(5e3);await L({clientId:V,clientSecret:H,cardInstanceId:X,text:w("\u5361\u7247\u5DF2\u7ED3\u675F\uFF0C\u8BF7\u67E5\u770B\u540E\u7EED\u6D88\u606F\u3002"),target:k,signal:Se}).catch(()=>{})}throw oe}return{cardInstanceId:X}},async updateAiCard({clientId:F,clientSecret:q,cardInstanceId:z,text:K,target:G,signal:V}){let H=WA(z),N=WA(K);if(!H)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let k=await y({clientId:F,clientSecret:q,signal:V});return await R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:H,guid:$E(),key:"msgContent",content:Au(N,G).replace(/\n+$/,""),isFull:!0,isFinalize:!1,isError:!1},headers:{"x-acs-dingtalk-access-token":k},signal:V,action:"AI Card \u66F4\u65B0"}),!0},async finishAiCard({clientId:F,clientSecret:q,cardInstanceId:z,text:K,target:G,signal:V}){let H=WA(z),N=WA(K);if(!H)throw new TypeError("cardInstanceId is required");if(!N)throw new TypeError("text is required");let J={"x-acs-dingtalk-access-token":await y({clientId:F,clientSecret:q,signal:V})},X=Au(N,G);await R("v1.0/card/streaming",{method:"PUT",body:{outTrackId:H,guid:$E(),key:"msgContent",content:X,isFull:!0,isFinalize:!0,isError:!1},headers:J,signal:V,action:"AI Card \u5B8C\u6210"});let ie=!0,De={method:"PUT",body:{outTrackId:H,cardData:y_(N,"3",G),cardUpdateOptions:{updateCardDataByKey:!0}},headers:J,signal:V,action:"AI Card \u6536\u53E3"};try{await R("v1.0/card/instances",De)}catch{try{await R("v1.0/card/instances",De)}catch{ie=!1}}return{delivered:!0,completed:ie}},failAiCard:L,async sendText({clientId:F,clientSecret:q,sessionWebhook:z,text:K,at:G,signal:V}){let H=WA(K);if(!H)throw new TypeError("text is required");let N=Cc(z),k=await y({clientId:F,clientSecret:q,signal:V}),J=G&&typeof G=="object"&&(Array.isArray(G.atUserIds)&&G.atUserIds.length>0||Array.isArray(G.atMobiles)&&G.atMobiles.length>0||G.isAtAll===!0)?{at:G}:{},X=await mn(n,N,{body:{msgtype:"text",text:{content:H},...J},headers:{"x-acs-dingtalk-access-token":k},signal:V,action:"\u6D88\u606F\u56DE\u590D"});if(X?.errcode!==void 0&&X.errcode!==0||X?.code!==void 0&&X.code!==0)throw new It("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002");return!0},async sendRobotText({clientId:F,clientSecret:q,target:z,text:K,signal:G}){if(typeof K!="string"||!K.trim())throw new TypeError("text is required");let V=K,H=uY(z),N=await y({clientId:F,clientSecret:q,signal:G}),k={robotCode:H.robotCode,msgKey:"sampleText",msgParam:JSON.stringify({content:V}),...H.type==="group"?{openConversationId:H.openConversationId}:{userIds:[H.userId]}},J=H.type==="group"?"v1.0/robot/groupMessages/send":"v1.0/robot/oToMessages/batchSend",X=await mn(n,Q(s,J),{body:k,headers:{"x-acs-dingtalk-access-token":N},signal:G,action:"\u4E3B\u52A8\u6587\u5B57\u6D88\u606F\u53D1\u9001"}),ie=GQ(X);if(ie)throw new It("send-rejected","\u9489\u9489\u670D\u52A1\u62D2\u7EDD\u4E86\u4E3B\u52A8\u6587\u5B57\u6D88\u606F\u3002",{providerCode:ie});return X},async sendFile(F){return U(F,{uploadType:"file",messageKey:"sampleFile",createMessageParams:(q,z)=>({mediaId:q,fileName:z.fileName,fileType:_de(z.fileName)})})},async sendImage(F){return U(F,{uploadType:"image",messageKey:"sampleImageMsg",createMessageParams:q=>({photoURL:q})})},clearAccessToken(F){let q=WA(F);q&&c.delete(q)}})}var kde=500,vde="\u5361\u7247\u5DF2\u7ED3\u675F\uFF0C\u8BF7\u67E5\u770B\u540E\u7EED\u6D88\u606F\u3002";function D_(n,t){if(typeof n!="string")throw new TypeError(`${t} must be a string`);return n}function mY(n,t){if(typeof n!="string"||!n.trim())throw new TypeError(`${t} is required`);return n.trim()}function SY({api:n,clientId:t,clientSecret:o,target:a,signal:e,logger:i=console,updateIntervalMs:A=kde,clock:r=()=>Date.now(),timer:s={setTimeout:(g,c)=>globalThis.setTimeout(g,c),clearTimeout:g=>globalThis.clearTimeout(g)}}={}){if(!n||typeof n.createAiCard!="function"||typeof n.updateAiCard!="function"||typeof n.finishAiCard!="function")throw new TypeError("DingTalk AI Card API is required");let g=mY(t,"clientId"),c=mY(o,"clientSecret");if(a==null)throw new TypeError("target is required");if(!Number.isFinite(A)||A<0)throw new TypeError("updateIntervalMs must be a non-negative number");if(typeof r!="function")throw new TypeError("clock must be a function");if(typeof s?.setTimeout!="function"||typeof s?.clearTimeout!="function")throw new TypeError("timer must provide setTimeout and clearTimeout");let I=()=>{let N=r();if(!Number.isFinite(N))throw new TypeError("clock must return a finite timestamp");return N};I();let p=e?.aborted?"aborted":"idle",B=null,f=null,Q=null,y=null,m=null,T=null,_=0,R=()=>{Q!==null&&(s.clearTimeout(Q),Q=null)},L=()=>e?.removeEventListener("abort",z),U=N=>{p=N,f=null,R(),L()},F=()=>!B||typeof n.failAiCard!="function"?Promise.resolve(!1):(T||(T=n.failAiCard({...B,text:w(vde),signal:AbortSignal.timeout(5e3)}).then(()=>!0,()=>!1)),T),q=N=>{p==="failed"||p==="finished"||p==="aborted"||(F(),U("failed"),i?.error?.(`[dsh-dingtalk] AI Card ${N} failed`))};function z(){p==="finished"||p==="failed"||p==="aborted"||(F(),U("aborted"))}p!=="aborted"&&e?.addEventListener("abort",z,{once:!0});let K=()=>{if(p!=="active"||y||f===null)return;let N=Math.max(0,_+A-I());if(N>0){Q=s.setTimeout(()=>{Q=null,K()},N);return}let k=f;f=null,y=(async()=>{try{await n.updateAiCard({...B,text:k,finished:!1}),_=I()}catch{if(e?.aborted||p==="aborted")return;q("update")}})().finally(()=>{y=null,p==="active"&&f!==null&&K()})};return Object.freeze({start:async N=>{if(D_(N,"initialText"),p!=="idle")return!1;p="starting";try{let k=await n.createAiCard({clientId:g,clientSecret:c,target:a,initialText:N,signal:e}),J=typeof k?.cardInstanceId=="string"?k.cardInstanceId.trim():"";if(!J)throw new TypeError("DingTalk did not return a card instance id");return B=Object.freeze({clientId:g,clientSecret:c,target:a,cardInstanceId:J,signal:e}),p!=="starting"?(F(),!1):(_=I(),p="active",!0)}catch{return e?.aborted||p==="aborted"?(U("aborted"),!1):(q("creation"),!1)}},push:N=>{D_(N,"progressText"),p==="active"&&(f=N,!Q&&!y&&K())},finish:N=>{if(D_(N,"finalText"),p==="finished")return Promise.resolve(!0);if(p==="finishing")return m;if(p!=="active")return Promise.resolve(!1);p="finishing",f=null,R();let k=y;return m=(async()=>{if(k&&await k,p!=="finishing")return!1;try{return await n.finishAiCard({...B,text:N}),p!=="finishing"?!1:(U("finished"),!0)}catch{return e?.aborted||p==="aborted"?(U("aborted"),!1):(q("finish"),!1)}})(),m},get providerMessageIds(){return B?.cardInstanceId?[B.cardInstanceId]:[]}})}function FQ(n){return typeof n=="string"&&n.trim()?n.trim():null}function ba(n){return n&&typeof n.id=="string"&&typeof n.question=="string"&&(n.header===void 0||typeof n.header=="string")&&(n.detail===void 0||typeof n.detail=="string")&&(n.multiSelect===void 0||typeof n.multiSelect=="boolean")&&(n.options===void 0||Array.isArray(n.options)&&n.options.every(t=>t&&typeof t.label=="string"&&(t.description===void 0||typeof t.description=="string")))}function Ia(n,t,o,{requiresMention:a=!1}={}){let e=[],i=o>1?`\uFF08${t+1}/${o}\uFF09`:"";e.push(w("DeepSeek Harness \u9700\u8981\u4F60\u8865\u5145\u4FE1\u606F{progress}\uFF1A",{progress:i})),FQ(n.header)&&e.push("",n.header.trim()),e.push("",FQ(n.question)??w("\u8BF7\u8F93\u5165\u4F60\u7684\u56DE\u7B54\u3002")),FQ(n.detail)&&e.push("",n.detail.trim());let A=Array.isArray(n.options)?n.options:[];return A.length>0?(e.push(""),A.forEach((r,s)=>{let g=typeof r?.label=="string"?r.label:"",c=FQ(r?.description);e.push(`${s+1}. ${g}${c?` \u2014 ${c}`:""}`)}),e.push("",n.multiSelect===!0?w("\u8BF7\u56DE\u590D\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF1B\u591A\u9009\u7528\u9017\u53F7\u5206\u9694\uFF0C\u4E5F\u53EF\u8865\u5145\u5176\u4ED6\u5185\u5BB9\u3002"):w("\u8BF7\u56DE\u590D\u4E00\u4E2A\u9009\u9879\u5E8F\u53F7\u6216\u6587\u5B57\uFF0C\u4E5F\u53EF\u76F4\u63A5\u8F93\u5165\u5176\u4ED6\u7B54\u6848\u3002"))):e.push("",w("\u8BF7\u76F4\u63A5\u56DE\u590D\u4F60\u7684\u7B54\u6848\u3002")),a&&e.push("",w("\u7FA4\u804A\u4E2D\u8BF7 @\u673A\u5668\u4EBA \u540E\u53D1\u9001\u7B54\u6848\u3002")),e.join(` `)}function wY(n,t){let o=n.trim();if(!o)return null;if(/^\d+$/.test(o)){let e=t[Number(o)-1];return typeof e?.label=="string"?e.label:null}let a=t.find(e=>e?.label===o);return typeof a?.label=="string"?a.label:null}function Ma(n,t){let o=Array.isArray(n.options)?n.options:[];if(o.length===0)return{id:n.id,selected:[],custom:t};let a=wY(t,o);if(n.multiSelect!==!0)return a?{id:n.id,selected:[a]}:{id:n.id,selected:[],custom:t};if(a)return{id:n.id,selected:[a]};let e=[],i=[];for(let A of t.split(/[,,、;;\n]+/)){let r=A.trim();if(!r)continue;let s=wY(r,o);s?e.includes(s)||e.push(s):i.push(r)}return{id:n.id,selected:e,...i.length>0?{custom:i.join("\u3001")}:{}}}var Pde=new Map([["\u6279\u51C6","allowed-once"],["\u540C\u610F","allowed-once"],["yes","allowed-once"],["\u62D2\u7EDD","rejected"],["\u4E0D\u540C\u610F","rejected"],["no","rejected"]]),O_="\u8BF7\u7CBE\u51C6\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\uFF08\u4E5F\u652F\u6301\uFF1A\u540C\u610F / \u4E0D\u540C\u610F / yes / no\uFF09\u3002",Gde="\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u95EE\u9898\uFF0C\u518D\u7CBE\u51C6\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\u3002",Pp="\u8BE5\u5BA1\u6279\u5DF2\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u590D\u3002",Fde=5*6e4,Lde=2048;function Di(n){return typeof n=="string"?n.trim():""}function b_(n){return Di(n).replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g,"")}function Ude(n){return Pde.get(Di(n).toLowerCase())??null}function OY(n){return n?.type==="approval/requested"&&!!Di(n.sessionId)&&!!Di(n.approvalId)&&!!Di(n.toolName)&&(n.callId===void 0||!!Di(n.callId))&&(n.reason===void 0||typeof n.reason=="string")}function Hde(n){let t=n?.arguments;if(t!==null&&typeof t=="object")try{return JSON.stringify(t,null,2)}catch{return null}if(typeof t!="string")return null;let o=b_(t);if(!o)return t===""?"{}":null;try{return JSON.stringify(JSON.parse(o),null,2)}catch{return o}}function M_(n,{toolCall:t,requiresMention:o=!1,maxArgumentsLength:a=6e3}={}){if(!OY(n))return null;let e=Di(n.callId);if(!e||Di(t?.callId)!==e||Di(t?.name)!==Di(n.toolName))return null;let i=Hde(t);if(!i||i.length>a)return null;let A=[w("DeepSeek Harness \u9700\u8981\u4F60\u7684\u5BA1\u6279\uFF1A"),"",w("\u5DE5\u5177\uFF1A{tool}",{tool:b_(n.toolName)}),w("\u64CD\u4F5C\u53C2\u6570\uFF1A"),i],r=b_(n.reason);return r&&A.push(w("\u539F\u56E0\uFF1A{reason}",{reason:r})),A.push("",w(O_)),o&&A.push("",w("\u7FA4\u804A\u4E2D\u8BF7 @\u673A\u5668\u4EBA \u540E\u53D1\u9001\u5BA1\u6279\u51B3\u5B9A\u3002")),A.join(` `)}function DY(n,t){return{ok:!0,value:{sessionId:n.sessionId,approvalId:n.approvalId,outcome:t}}}function LQ(n){return n==="allowed-once"?w("\u5DF2\u6279\u51C6\uFF0C\u4EC5\u5BF9\u672C\u6B21\u64CD\u4F5C\u6709\u6548\u3002"):n==="rejected"?w("\u5DF2\u62D2\u7EDD\u6B64\u6B21\u64CD\u4F5C\u3002"):w(Pp)}var _a=class{#e;#A;#t=new Map;#r=new Map;#I=new Map;constructor({label:t="IM",logger:o=console}={}){this.#e=t,this.#A=o}hasPending(t){return this.#r.get(t)?.items.some(o=>!o.inactive)===!0}claimReply({key:t,actor:o,text:a,addressed:e=!0,hasPendingQuestion:i=!1,questionCompletion:A,isQuestionPending:r,send:s}){let c=this.#r.get(t)?.items[0],I=Ude(a),p=(f,Q=!1)=>({...Q?{resolved:!0}:{},process:async y=>{typeof y=="function"&&await y()===!1||await s(f)}}),B=i&&c&&A&&typeof A.then=="function";return i&&!B?null:!c||c.inactive?(this.#I.get(t)??0)<=Date.now()?(this.#I.delete(t),null):I?p(w(Pp),!0):null:c.actor!==o||c.requiresMention&&e!==!0?I?p(w("\u53EA\u6709\u53D1\u8D77\u5F53\u524D\u4EFB\u52A1\u7684\u7528\u6237\u53EF\u4EE5\u5904\u7406\u8FD9\u6761\u5BA1\u6279\u3002")):null:{process:async f=>{let Q=c.presented,m=(c.replyTail??Promise.resolve()).catch(()=>{}).then(async()=>{if(!(typeof f=="function"&&await f()===!1)){if(B){if(await A.catch(()=>{}),c.inactive||c.resolving)return;if(typeof r=="function"&&r()){await s(w(Gde));return}}if(await c.activationTask?.catch(()=>{}),await c.presentationTask?.catch(()=>{}),c.inactive||c.resolving){await s(w(Pp));return}if(c.send=s,!Q||!c.presented){if(c.presented||await this.#o(c),c.inactive||c.resolving)return;await s(w(O_));return}if(c.submitting){await s(w("\u5BA1\u6279\u51B3\u5B9A\u6B63\u5728\u63D0\u4EA4\uFF0C\u8BF7\u7A0D\u5019\u3002"));return}if(!I){await s(w(O_));return}await this.#c(c,I)}});c.replyTail=m;try{await m}finally{c.replyTail===m&&(c.replyTail=null)}}}}async handleRequested(t,o){if(t?.kind!=="approval")return!1;let a=t.payload,e=Di(a?.approvalId);if(!Di(t.rpcId)||!Di(t.sessionId)||!e||!OY(a)||a.sessionId!==t.sessionId||typeof t.respond!="function")return this.#A.warn?.(`[dsh-im:${this.#e}] ignored an invalid Harness approval`),!0;if(t.recovered===!0)return await this.#g(t,a),!0;let i=this.#t.get(e);if(i)return i.interaction=t,i.toolCall=t.toolCall,i.presented||await this.#o(i),!0;let A=o?.send,r=Di(o?.key),s=Di(o?.actor);if(!r||!s||typeof A!="function")return this.#A.warn?.(`[dsh-im:${this.#e}] ignored an approval without a reply route`),await this.#g(t,a),!0;let g=typeof o?.render=="function"?o.render:null,c=M_(a,{toolCall:t.toolCall,requiresMention:o.requiresMention===!0});if(!c){let B=await this.#g(t,a);return await A(B?w("\u65E0\u6CD5\u5B8C\u6574\u5C55\u793A\u8FD9\u6B21\u64CD\u4F5C\uFF0C\u5DF2\u5B89\u5168\u62D2\u7EDD\u6B64\u6B21\u5BA1\u6279\u3002"):w(Pp)),!0}let I={approvalId:e,sessionId:t.sessionId,interaction:t,toolCall:t.toolCall,key:r,actor:s,requiresMention:o.requiresMention===!0,send:A,render:g,text:c,presented:!1,presentationTask:null,deliveryCompleted:!1,replyTail:null,submitting:!1,inactive:!1,resolving:!1,closedOutcome:null,resolutionNotified:!1,activationTask:null};this.#t.set(e,I);let p=this.#r.get(r)??{items:[]};return p.items.push(I),this.#r.set(r,p),p.items[0]===I&&await this.#o(I),!0}async submitByApprovalId(t,o,{actor:a}={}){let e=this.#t.get(Di(t));return!e||e.inactive||e.resolving||e.submitting||a!==void 0&&e.actor!==a?!1:(await this.#c(e,o),!0)}async handleResolved(t){if(t?.kind!=="approval")return!1;let o=this.#t.get(Di(t.interactionId));if(!o||(o.resolving=!0,o.activationTask&&await o.activationTask.catch(()=>{}),o.inactive||this.#t.get(o.approvalId)!==o))return!0;let a=o.presentationTask,e=o.presented||a,i=o.send,A=this.#s(o);return await this.#i(A,async()=>{let r=o.presented;a&&(r=await a.then(()=>!0,()=>!1)),e&&r&&(o.resolutionNotified=!0,await i(LQ(t.outcome)).catch(()=>{}))}),!0}async closeRoute(t){let o=this.#r.get(t);if(!o)return;let a=[...o.items];for(let e of a)this.#s(e);await Promise.all(a.map(async e=>{try{await e.interaction.respond(DY(e,"rejected"),{signal:AbortSignal.timeout(5e3)}),e.closedOutcome="rejected",(e.presented||e.deliveryCompleted)&&!e.resolutionNotified&&(e.resolutionNotified=!0,await e.send(LQ("rejected")).catch(()=>{}))}catch(i){i?.code==="interaction-not-pending"?(e.closedOutcome="resolved",(e.presented||e.deliveryCompleted)&&!e.resolutionNotified&&(e.resolutionNotified=!0,await e.send(w(Pp)).catch(()=>{}))):this.#A.warn?.(`[dsh-im:${this.#e}] failed to reject a closing approval:`,i)}}))}async#o(t){if(this.#r.get(t.key)?.items[0]!==t||t.inactive||t.resolving||t.presented||(await t.activationTask?.catch(()=>{}),this.#r.get(t.key)?.items[0]!==t||t.inactive||t.resolving||t.presented))return;if(t.presentationTask)return t.presentationTask;let o=t.render?Promise.resolve().then(()=>t.render(t,t.send)):Promise.resolve().then(()=>t.send(t.text));t.presentationTask=o;try{await o,t.deliveryCompleted=!0,t.inactive?t.closedOutcome&&!t.resolutionNotified&&(t.resolutionNotified=!0,await t.send(LQ(t.closedOutcome)).catch(()=>{})):t.presented=!0}finally{t.presentationTask===o&&(t.presentationTask=null)}}async#c(t,o){t.submitting=!0;try{await t.interaction.respond(DY(t,o))}catch(i){if(i?.code==="interaction-not-pending"){let A=t.send,r=this.#s(t);await this.#i(r,async()=>{t.resolutionNotified||await A(w(Pp)).catch(()=>{})});return}if(t.inactive)return;t.submitting=!1,this.#A.error?.(`[dsh-im:${this.#e}] failed to submit an approval:`,i),await t.send(w("\u5BA1\u6279\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u56DE\u590D\u300C\u6279\u51C6\u300D\u6216\u300C\u62D2\u7EDD\u300D\u3002")).catch(()=>{});return}let a=t.send,e=this.#s(t);await this.#i(e,async()=>{t.resolutionNotified||await a(LQ(o)).catch(()=>{})})}async#i(t,o){let a,e=new Promise(i=>{a=i});t&&(t.activationTask=e);try{await o()}finally{a(),t?.activationTask===e&&(t.activationTask=null)}await this.#a(t)}async#a(t){if(t)try{await this.#o(t)}catch(o){this.#A.error?.(`[dsh-im:${this.#e}] failed to present the next approval:`,o);try{t.interaction.reconnect?.()}catch{}}}#s(t){if(t.inactive)return null;t.inactive=!0,this.#p(t.key),this.#t.delete(t.approvalId);let o=this.#r.get(t.key);if(!o)return null;let a=o.items[0]===t,e=o.items.indexOf(t);return e!==-1&&o.items.splice(e,1),o.items.length===0?(this.#r.delete(t.key),null):a?o.items[0]:null}#p(t){let o=Date.now();for(let[a,e]of this.#I)e<=o&&this.#I.delete(a);for(this.#I.delete(t),this.#I.set(t,o+Fde);this.#I.size>Lde;)this.#I.delete(this.#I.keys().next().value)}async#g(t,o){try{return await t.respond({ok:!0,value:{sessionId:t.sessionId,approvalId:o.approvalId,outcome:"rejected"}},{signal:AbortSignal.timeout(5e3)}),!0}catch(a){if(a?.code==="interaction-not-pending")return!1;throw a}}};var __=new WeakMap;function Kde(n){let t=__.get(n);return t||(t=new Map,__.set(n,t)),t}async function Ig(n,t,o){let a=typeof n;if(a!=="object"&&a!=="function"||n===null)throw new TypeError("state is required");if(typeof t!="string"||!t)throw new TypeError("conversation key is required");if(typeof o!="function")throw new TypeError("operation is required");let e=Kde(n),i=e.get(t)??Promise.resolve(),A,r=new Promise(s=>{A=s});e.set(t,r),await i;try{return await o()}finally{A(),e.get(t)===r&&(e.delete(t),e.size===0&&__.delete(n))}}var xde=/(?:\u001b\]|\u009d)(?:(?!\u0007|\u001b\\)[\s\S])*(?:\u0007|\u001b\\|$)/gu,Yde=/(?:\u001b\[|\u009b)[0-?]*[ -/]*[@-~]/gu,jde=/\u001b[@-_]/gu,Jde=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f]/gu,qde=/[\u200b\u200e\u200f\u202a-\u202e\u2060-\u2064\u2066-\u206f\ufeff]/gu,zde=/^(?:[\s\S]*?<\/dsh_im_source>\s*)?(?:[\s\S]*?<\/dsh_im_source_guidance>\s*)?(?:[\s\S]*?<\/dsh_im_reply_to>\s*)?/u,Vde=new Intl.Segmenter(void 0,{granularity:"grapheme"});function T_(n){return n.replace(xde,"").replace(Yde,"").replace(jde,"").replace(Jde,"").replace(qde,"").replace(/\s+/gu," ").trim()}function N_(n,t=60){if(Buffer.byteLength(n,"utf8")<=t)return n;let o="\u2026",a=t-Buffer.byteLength(o,"utf8"),e="";for(let{segment:i}of Vde.segment(n)){if(Buffer.byteLength(e+i,"utf8")>a)break;e+=i}return`${e.trimEnd()}${o}`}function Wde(n){return typeof n=="string"?n:Array.isArray(n)?n.filter(t=>t?.type==="text"&&typeof t.text=="string").map(t=>t.text).join(` `):""}function Zde(n){let t=n?.name??n?.filename??n?.fileName;return typeof t!="string"?"":t.replaceAll("\\","/").split("/").at(-1)?.replace(/[\u0000-\u001f\u007f]/gu,"").trim()??""}function bY({text:n,content:t,files:o}={}){let a=typeof n=="string"?T_(n):"";if(a)return N_(a);let e=T_(Wde(t).replace(zde,""));if(e)return N_(e);let i=Array.isArray(o)?o.map(Zde).find(Boolean):"",A=i?T_(i):"";return A?N_(A):null}var Oi="workspace-session-stale";function MY(n,t){if(typeof n.workspaceSession=="function")return n.workspaceSession(t);let o={sessionId:t,sessionExists:(...a)=>n.sessionExists(t,...a),models:(...a)=>n.getSessionModels(t,...a),selectModel:(...a)=>n.selectSessionModel(t,...a),isRunning:(...a)=>n.isSessionRunning(t,...a),hasActiveTurn:(...a)=>n.hasActiveTurn(t,...a),stopActiveTurn:(...a)=>n.stopActiveTurn(t,...a),steerActiveTurn:(...a)=>n.steerActiveTurn(t,...a),ask:(...a)=>n.ask(t,...a)};return typeof n.renameSession=="function"&&(o.renameTitle=(...a)=>n.renameSession(t,...a)),Object.freeze(o)}async function Xde(n,t){return t===void 0?n.sessionExists():n.sessionExists(t)}async function $de(n,t){return t===void 0?n.createSession():n.createSession(t)}async function Ta({harness:n,state:t,key:o,text:a,content:e,contextEnhanced:i=!1,createOptions:A,existsOptions:r,askOptions:s}){let g=i?bY({text:a,content:e,files:typeof s=="object"?s?.files:void 0}):null,c=A?.signal??(typeof s=="object"?s?.signal:void 0),I=c?{signal:c}:void 0;for(;;)try{let p=await Ig(t,o,async()=>{let m=t.sessionFor(o),T=m?MY(n,m):null;if(!T||!await Xde(T,r)){if(m=await $de(n,A),await t.setSession(o,m)===!1)return null;if(T=MY(n,m),g&&typeof T.renameTitle=="function")try{await T.renameTitle(g,I)}catch(_){if(_?.code===Oi||I?.signal?.aborted)throw _;console.warn("[dsh-im] unable to set the initial Session title:",_?.message??_)}}return{sessionId:m,session:T}});if(!p)continue;let B=[],f=typeof s=="object"&&typeof s?.onArtifact=="function"?s.onArtifact:null,Q=typeof s=="number"?{timeoutMs:s}:{...s};Q.onArtifact=async m=>{B.push(m),await f?.(m)};let y=await p.session.ask(e??a,Q);return{sessionId:p.sessionId,answer:y,...B.length>0?{artifacts:B}:{}}}catch(p){if(p?.code!==Oi)throw p}}var TY=/^\/compact(?=$|\s)([\s\S]*)$/i,ehe="\u7528\u6CD5\uFF1A/compact\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",_Y=new Map([["No compactable history yet.","\u6682\u65E0\u53EF\u538B\u7F29\u7684\u5386\u53F2\u8BB0\u5F55\u3002"],["Compaction is unavailable because this process has an active compaction, or the agent is not idle.","\u5F53\u524D\u4F1A\u8BDD\u6B63\u5728\u751F\u6210\u56DE\u590D\u6216\u6267\u884C\u538B\u7F29\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"],["Compaction cancelled.","\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88\u3002"],["The history selected for compaction changed before it could be replaced. The conversation is unchanged; the attempt is recorded in the session log.","\u538B\u7F29\u671F\u95F4\u4F1A\u8BDD\u5386\u53F2\u53D1\u751F\u53D8\u5316\uFF0C\u672C\u6B21\u672A\u4FEE\u6539\u4F1A\u8BDD\uFF0C\u8BF7\u91CD\u8BD5\u3002"],["Compaction could not produce a useful summary. The conversation is unchanged; the attempt is recorded in the session log.","\u672A\u80FD\u751F\u6210\u6709\u6548\u7684\u538B\u7F29\u6458\u8981\uFF0C\u672C\u6B21\u672A\u4FEE\u6539\u4F1A\u8BDD\u3002"],["Compaction did not finish cleanly; some session history may have changed. Inspect the current session state before retrying.","\u4E0A\u4E0B\u6587\u538B\u7F29\u672A\u6B63\u5E38\u5B8C\u6210\uFF0C\u90E8\u5206\u4F1A\u8BDD\u5386\u53F2\u53EF\u80FD\u5DF2\u53D8\u5316\uFF0C\u8BF7\u68C0\u67E5\u4F1A\u8BDD\u540E\u518D\u91CD\u8BD5\u3002"],["Compaction finished, but the session could not be saved.","\u4E0A\u4E0B\u6587\u5DF2\u538B\u7F29\uFF0C\u4F46\u4F1A\u8BDD\u4FDD\u5B58\u5931\u8D25\u3002"]]);function KI(n){return{handled:!0,message:n,messages:[n]}}function Ahe(n){if(!n||typeof n!="object"||!["success","error"].includes(n.kind)||n.text!==void 0&&typeof n.text!="string")throw new TypeError("Harness returned an invalid /compact result");let t=n.text?.trim()??"",o=/^Compacted (\d+) history items \(~(\d+) tokens\)\.$/u.exec(t);return o?w("\u5DF2\u538B\u7F29 {count} \u6761\u5386\u53F2\u8BB0\u5F55\uFF08\u7EA6 {tokens} \u4E2A token\uFF09\u3002",{count:o[1],tokens:o[2]}):_Y.has(t)?w(_Y.get(t)):t||(n.kind==="success"?w("\u4E0A\u4E0B\u6587\u538B\u7F29\u5B8C\u6210\u3002"):w("\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\u3002"))}function the(n){let t=n?.code??n?.failure?.code;return t==="session-not-found"?w("\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u8BF7\u53D1\u9001\u65B0\u6D88\u606F\u5F00\u542F\u4F1A\u8BDD\u3002"):t==="agent-busy"?w("\u5F53\u524D\u4F1A\u8BDD\u6B63\u5728\u751F\u6210\u56DE\u590D\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):t==="cancelled"||n?.name==="AbortError"?w("\u4E0A\u4E0B\u6587\u538B\u7F29\u5DF2\u53D6\u6D88\u3002"):t===Oi||t==="workspace-bot-not-found"?w("\u5DE5\u4F5C\u533A\u6216\u673A\u5668\u4EBA\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u8BD5\u3002"):t==="commands-unavailable"?w("\u5F53\u524D Harness \u6682\u4E0D\u652F\u6301\u4ECE\u673A\u5668\u4EBA\u6267\u884C\u4E0A\u4E0B\u6587\u538B\u7F29\u3002"):w("\u4E0A\u4E0B\u6587\u538B\u7F29\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}async function Na(n,t,o,a,e={}){if(!R_(n))return null;if(TY.exec(n.trim())[1].trim())return KI(w(ehe));if(typeof o?.sessionFor!="function")return KI(w("\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u53EF\u7528\u7684\u4F1A\u8BDD\u72B6\u6001\u3002"));let A=o.sessionFor(a);if(typeof A!="string"||!A)return KI(w("\u5F53\u524D\u804A\u5929\u8FD8\u6CA1\u6709\u53EF\u538B\u7F29\u7684\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u53D1\u9001\u4E00\u6761\u6D88\u606F\u3002"));if(typeof t?.executeCommand!="function")return KI(w("\u5F53\u524D\u673A\u5668\u4EBA\u6682\u4E0D\u652F\u6301\u4E0A\u4E0B\u6587\u538B\u7F29\u3002"));try{let r=await t.executeCommand(A,"/compact",e);return KI(r===void 0?w("\u5F53\u524D Harness \u672A\u6CE8\u518C /compact \u547D\u4EE4\uFF0C\u8BF7\u786E\u8BA4\u4E0A\u4E0B\u6587\u538B\u7F29\u7EC4\u4EF6\u5DF2\u542F\u7528\u3002"):Ahe(r?.result))}catch(r){return KI(the(r))}}function R_(n){return typeof n=="string"&&TY.test(n.trim())}import{isDeepStrictEqual as hhe}from"node:util";import{realpath as kY,stat as vY}from"node:fs/promises";import{isAbsolute as PY,resolve as rhe}from"node:path";var GY=/^\/(?:workspace|ws)(?:\s+([\s\S]+))?$/i,FY=/^\/(?:workspacelist|workspaces|wsl)(?:\s+([\s\S]+))?$/i,LY=/^\/(?:sessionlist|sessions)(?:\s+([\s\S]+))?$/i,UY=/^\/session(?=$|\s)/i,ihe=/^\/session[ \t]+([^\s]+)$/i,ahe=4096,ohe=1800,nhe=256,HY=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u,she=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu,KY="\u7528\u6CD5\uFF1A/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7\uFF08/session N\uFF09",xI=["\u7528\u6CD5\uFF1A","/sessionlist \u5217\u51FA\u5F53\u524D\u5DE5\u4F5C\u533A\u4F1A\u8BDD","/sessionlist --limit N \u5217\u51FA\u5F53\u524D\u5DE5\u4F5C\u533A\u524D N \u4E2A\u4F1A\u8BDD\uFF08N \u4E3A\u6B63\u6574\u6570\uFF09","/sessionlist \u5DE5\u4F5C\u533A\u5E8F\u53F7 \u6309 /workspacelist \u5E8F\u53F7\u5217\u51FA\u4F1A\u8BDD","/sessionlist \u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84 \u5217\u51FA\u6307\u5B9A\u5DE5\u4F5C\u533A\u4F1A\u8BDD"].join(` @@ -169,7 +169,7 @@ ${n}`:n)}function y_(n,t,o){return{cardParamMap:{flowStatus:t,msgContent:Au(n,o) ${Qhe(I.text,s)}`);g=Bc([i,...c,A.join(` `)].join(` -`)),s=Math.floor(s/2)}while(s>0&&(g.message.length>3e3||g.messages.length>3));return g}function mhe(n){let t=n?.code??n?.failure?.code;return t==="session-not-found"?w("\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u7ED1\u5B9A\u4F1A\u8BDD\u3002"):t===Oi||t==="workspace-bot-not-found"||t==="session-binding-changed"?w("\u4F1A\u8BDD\u3001\u5DE5\u4F5C\u533A\u6216\u673A\u5668\u4EBA\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C /history\u3002"):t==="harness-api-not-found"?w("\u5F53\u524D Harness \u6682\u4E0D\u652F\u6301\u8BFB\u53D6\u4F1A\u8BDD\u5386\u53F2\u3002"):n?.name==="AbortError"?w("\u5386\u53F2\u8BFB\u53D6\u5DF2\u53D6\u6D88\u3002"):n?.name==="TimeoutError"||t==="harness-timeout"?w("\u8BFB\u53D6\u5386\u53F2\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):w("\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u4F1A\u8BDD\u5386\u53F2\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}function Ki(n){return typeof n=="string"&&YY.test(n.trim())}async function oo(n,t,o,a,{signal:e,isDirect:i=!1,hasImages:A=!1,hasFiles:r=!1}={}){if(!Ki(n))return null;let s=YY.exec(n.trim())[1].trim();if(s&&(!/^\d+$/u.test(s)||/^0+$/u.test(s)))return Bc(w(Ehe));let g=s?Math.min(Number(s),uhe):3;if(!i)return Bc(w("\u8BF7\u5728\u4E0E\u673A\u5668\u4EBA\u7684\u79C1\u804A\u4E2D\u4F7F\u7528 /history\u3002"));if(A||r)return Bc(w("/history \u4EC5\u652F\u6301\u6587\u5B57\u547D\u4EE4\uFF0C\u8BF7\u79FB\u9664\u56FE\u7247\u6216\u6587\u4EF6\u540E\u91CD\u8BD5\u3002"));let c=o?.sessionFor?.(a);if(typeof c!="string"||!c)return Bc(w("\u5F53\u524D\u804A\u5929\u5C1A\u672A\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u53D1\u9001\u6D88\u606F\u6216\u4F7F\u7528 /session \u7ED1\u5B9A\u4F1A\u8BDD\u3002"));try{let I=t?.workspaceSession?.(c);if(typeof I?.readHistory!="function")return Bc(w("\u5F53\u524D Harness \u6682\u4E0D\u652F\u6301\u8BFB\u53D6\u4F1A\u8BDD\u5386\u53F2\u3002"));let p=AbortSignal.timeout(xY),B=e?AbortSignal.any([e,p]):p,f=Date.now()+xY,Q=new Map,y,m,T=[],_=!1;for(let R=0;R=f)throw new DOMException("History read timed out","TimeoutError");let L=await I.readHistory({maxMessages:Che,...y===void 0?{}:{beforeSeq:y},timeoutMs:Math.max(1,f-Date.now()),signal:B});if(B.throwIfAborted(),Date.now()>=f)throw new DOMException("History read timed out","TimeoutError");if(o.sessionFor(a)!==c){let q=new Error("Session binding changed during history read");throw q.code="session-binding-changed",q}if(!L||!Array.isArray(L.events)||typeof L.hasMore!="boolean")throw new TypeError("Invalid history page");let U=y??1/0;for(let q of L.events){let z=q?.event;if(!z||!Number.isSafeInteger(z.seq)||z.seq<0||typeof z.type!="string"||!z.type)throw new TypeError("Invalid history event");if(m!==void 0&&z.seq>m)continue;let K=Q.get(z.seq);if(K){if(!hhe(K,z))throw new TypeError("Conflicting history events")}else{if(y!==void 0&&z.seq>=y)throw new TypeError("Invalid history cursor");Q.set(z.seq,z)}U=Math.min(U,z.seq)}let F=[...Q.values()].sort((q,z)=>q.seq-z.seq);if(m??=F.at(-1)?.seq,_=L.hasMore,_&&(!Number.isFinite(U)||U===y))throw new TypeError("History cursor did not advance");if(T=fhe(F).slice(-g),T.length>=g||!_)break;y=U}return T.length===0?Bc(_?w("\u672C\u6B21\u6709\u9650\u8BFB\u53D6\u4E2D\u672A\u627E\u5230\u53EF\u9884\u89C8\u7684\u5386\u53F2\u6D88\u606F\u3002"):w("\u5F53\u524D\u4F1A\u8BDD\u6682\u65E0\u53EF\u9884\u89C8\u7684\u5386\u53F2\u6D88\u606F\u3002")):yhe(c,T,g,_)}catch(I){return Bc(mhe(I))}}var HQ={name:"dsh-im-ops",version:"4.9.1-ops.2",description:"Ops fork of dsh-im (all channels kept). Based on @xmanrui/dsh-im@4.9.1 \u2014 access/session policies owned here.",keywords:["deepseek-harness","dsh","dsh-plugin","ai-agent","im","instant-messaging","chatbot","feishu","lark","wechat","wecom","dingtalk","qq","slack","telegram","discord","whatsapp","ai-office","ops","fork"],author:"xmanrui (https://github.com/xmanrui)",contributors:[{name:"C3H3-AI",url:"https://github.com/C3H3-AI"},{name:"divingleee",url:"https://github.com/divingleee"},{name:"Chan-0312",url:"https://github.com/Chan-0312"}],license:"MIT",type:"module",repository:{type:"git",url:"git+https://github.com/hansjone/dsh-im-ops.git"},homepage:"https://github.com/hansjone/dsh-im-ops#readme",bugs:{url:"https://github.com/hansjone/dsh-im-ops/issues"},bin:{"dsh-im":"bin/dsh-im.mjs"},main:"./lib/index.js",exports:{".":"./lib/index.js","./client":"./lib/client.js","./package.json":"./package.json"},files:["assets","bin","cordis.patch.yml","lib","plugin-src","scripts","src","PROACTIVE_DELIVERY.md","PROACTIVE_DELIVERY.en.md","LICENSE","README.md","README.en.md","THIRD_PARTY_NOTICES.md"],dsh:{bundle:{patch:"./cordis.patch.yml"},client:{inject:["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-ui-slots","@deepseek-ai/dsh-client-locale"],platform:"web"}},scripts:{build:"node plugin-src/client/build.mjs && node plugin-src/host/build.mjs",test:"node --test test/*.test.mjs test/channels/*/*.test.mjs",check:"npm run build && npm test && node scripts/verify-package.mjs"},engines:{node:">=22.19"},dependencies:{"@tencent-connect/qqbot-connector":"1.2.0","@tencent-connect/qqbot-nodejs":"1.0.4","@wecom/aibot-node-sdk":"1.0.7","dingtalk-stream":"2.1.4",qrcode:"1.5.4",undici:"7.29.0"},devDependencies:{"@deepseek-ai/cordis":"4.0.1","@larksuiteoapi/node-sdk":"1.73.0","@whiskeysockets/baileys":"7.0.0-rc14",esbuild:"0.25.9","https-proxy-agent":"5.0.1",react:"18.3.1","react-dom":"18.3.1","react-test-renderer":"18.3.1",semver:"7.8.5"},directories:{doc:"docs",lib:"lib",test:"test"}};var whe=/^\/(?:stop|steer|version)(?=$|\s)/iu,Dhe=/^\/stop(?=$|\s)/iu,Ohe=/^\/version(?=$|\s)/iu,bhe="\u7528\u6CD5\uFF1A/stop\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",Mhe="\u7528\u6CD5\uFF1A/version\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",_he="\u7528\u6CD5\uFF1A/steer <\u8865\u5145\u6307\u4EE4>",The="\u63A7\u5236\u547D\u4EE4\u4EC5\u652F\u6301\u7EAF\u6587\u5B57\uFF0C\u8BF7\u79FB\u9664\u56FE\u7247\u540E\u91CD\u8BD5\u3002";function ko(n,t={}){return{message:n,...t}}function JY(n){return n?{signal:n}:{}}function qY(n,t,o){if(typeof t?.sessionFor!="function")return null;let a=t.sessionFor(o);if(typeof a!="string"||!a)return null;if(typeof n?.workspaceSession!="function")throw new TypeError("Harness does not support workspace sessions");let e=n.workspaceSession(a);if(!e||typeof e!="object")throw new TypeError("Harness returned an invalid workspace session");return e}function la(n){return typeof n=="string"&&whe.test(n.trim())}async function Ra(n,t,o,a,{signal:e,hasImages:i=!1,pendingInteraction:A=!1,control:r}={}){if(!la(n))return null;let s=n.trim(),g=Dhe.test(s),c=Ohe.test(s);if(i)return ko(w(The));if(c)return/^\/version$/iu.test(s)?ko(`dsh-im v${HQ.version}`):ko(w(Mhe));if(g){if(!/^\/stop$/iu.test(s))return ko(w(bhe));let Q=qY(t,o,a);if(!Q)return ko(w("\u5F53\u524D\u804A\u5929\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\u3002"));if(typeof Q.stopActiveTurn!="function")throw new TypeError("Harness session does not support stopping active turns");return await Q.stopActiveTurn(r,JY(e))?ko(w("\u5DF2\u8BF7\u6C42\u505C\u6B62\u5F53\u524D\u4EFB\u52A1\u3002"),{stopped:!0}):ko(w("\u5F53\u524D\u804A\u5929\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\u3002"))}let p=/^\/steer(?:\s+([\s\S]*))?$/iu.exec(s)?.[1]?.trim()??"";if(!p)return ko(w(_he));if(A)return ko([w("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u4F60\u7684\u56DE\u7B54\u6216\u5BA1\u6279\u3002"),"",w("\u8BF7\u5148\u5904\u7406\u5F53\u524D\u8BF7\u6C42\uFF0C\u6216\u8005\u53D1\u9001 /stop \u505C\u6B62\u4EFB\u52A1\u3002")].join(` +`)),s=Math.floor(s/2)}while(s>0&&(g.message.length>3e3||g.messages.length>3));return g}function mhe(n){let t=n?.code??n?.failure?.code;return t==="session-not-found"?w("\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u7684\u4F1A\u8BDD\u5DF2\u4E0D\u5B58\u5728\uFF0C\u8BF7\u91CD\u65B0\u7ED1\u5B9A\u4F1A\u8BDD\u3002"):t===Oi||t==="workspace-bot-not-found"||t==="session-binding-changed"?w("\u4F1A\u8BDD\u3001\u5DE5\u4F5C\u533A\u6216\u673A\u5668\u4EBA\u72B6\u6001\u5DF2\u53D1\u751F\u53D8\u5316\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C /history\u3002"):t==="harness-api-not-found"?w("\u5F53\u524D Harness \u6682\u4E0D\u652F\u6301\u8BFB\u53D6\u4F1A\u8BDD\u5386\u53F2\u3002"):n?.name==="AbortError"?w("\u5386\u53F2\u8BFB\u53D6\u5DF2\u53D6\u6D88\u3002"):n?.name==="TimeoutError"||t==="harness-timeout"?w("\u8BFB\u53D6\u5386\u53F2\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"):w("\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u4F1A\u8BDD\u5386\u53F2\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")}function Ki(n){return typeof n=="string"&&YY.test(n.trim())}async function oo(n,t,o,a,{signal:e,isDirect:i=!1,hasImages:A=!1,hasFiles:r=!1}={}){if(!Ki(n))return null;let s=YY.exec(n.trim())[1].trim();if(s&&(!/^\d+$/u.test(s)||/^0+$/u.test(s)))return Bc(w(Ehe));let g=s?Math.min(Number(s),uhe):3;if(!i)return Bc(w("\u8BF7\u5728\u4E0E\u673A\u5668\u4EBA\u7684\u79C1\u804A\u4E2D\u4F7F\u7528 /history\u3002"));if(A||r)return Bc(w("/history \u4EC5\u652F\u6301\u6587\u5B57\u547D\u4EE4\uFF0C\u8BF7\u79FB\u9664\u56FE\u7247\u6216\u6587\u4EF6\u540E\u91CD\u8BD5\u3002"));let c=o?.sessionFor?.(a);if(typeof c!="string"||!c)return Bc(w("\u5F53\u524D\u804A\u5929\u5C1A\u672A\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u53D1\u9001\u6D88\u606F\u6216\u4F7F\u7528 /session \u7ED1\u5B9A\u4F1A\u8BDD\u3002"));try{let I=t?.workspaceSession?.(c);if(typeof I?.readHistory!="function")return Bc(w("\u5F53\u524D Harness \u6682\u4E0D\u652F\u6301\u8BFB\u53D6\u4F1A\u8BDD\u5386\u53F2\u3002"));let p=AbortSignal.timeout(xY),B=e?AbortSignal.any([e,p]):p,f=Date.now()+xY,Q=new Map,y,m,T=[],_=!1;for(let R=0;R=f)throw new DOMException("History read timed out","TimeoutError");let L=await I.readHistory({maxMessages:Che,...y===void 0?{}:{beforeSeq:y},timeoutMs:Math.max(1,f-Date.now()),signal:B});if(B.throwIfAborted(),Date.now()>=f)throw new DOMException("History read timed out","TimeoutError");if(o.sessionFor(a)!==c){let q=new Error("Session binding changed during history read");throw q.code="session-binding-changed",q}if(!L||!Array.isArray(L.events)||typeof L.hasMore!="boolean")throw new TypeError("Invalid history page");let U=y??1/0;for(let q of L.events){let z=q?.event;if(!z||!Number.isSafeInteger(z.seq)||z.seq<0||typeof z.type!="string"||!z.type)throw new TypeError("Invalid history event");if(m!==void 0&&z.seq>m)continue;let K=Q.get(z.seq);if(K){if(!hhe(K,z))throw new TypeError("Conflicting history events")}else{if(y!==void 0&&z.seq>=y)throw new TypeError("Invalid history cursor");Q.set(z.seq,z)}U=Math.min(U,z.seq)}let F=[...Q.values()].sort((q,z)=>q.seq-z.seq);if(m??=F.at(-1)?.seq,_=L.hasMore,_&&(!Number.isFinite(U)||U===y))throw new TypeError("History cursor did not advance");if(T=fhe(F).slice(-g),T.length>=g||!_)break;y=U}return T.length===0?Bc(_?w("\u672C\u6B21\u6709\u9650\u8BFB\u53D6\u4E2D\u672A\u627E\u5230\u53EF\u9884\u89C8\u7684\u5386\u53F2\u6D88\u606F\u3002"):w("\u5F53\u524D\u4F1A\u8BDD\u6682\u65E0\u53EF\u9884\u89C8\u7684\u5386\u53F2\u6D88\u606F\u3002")):yhe(c,T,g,_)}catch(I){return Bc(mhe(I))}}var HQ={name:"dsh-im-ops",version:"4.9.1-ops.3",description:"Ops fork of dsh-im (all channels kept). Based on @xmanrui/dsh-im@4.9.1 \u2014 access/session policies owned here.",keywords:["deepseek-harness","dsh","dsh-plugin","ai-agent","im","instant-messaging","chatbot","feishu","lark","wechat","wecom","dingtalk","qq","slack","telegram","discord","whatsapp","ai-office","ops","fork"],author:"xmanrui (https://github.com/xmanrui)",contributors:[{name:"C3H3-AI",url:"https://github.com/C3H3-AI"},{name:"divingleee",url:"https://github.com/divingleee"},{name:"Chan-0312",url:"https://github.com/Chan-0312"}],license:"MIT",type:"module",repository:{type:"git",url:"git+https://github.com/hansjone/dsh-im-ops.git"},homepage:"https://github.com/hansjone/dsh-im-ops#readme",bugs:{url:"https://github.com/hansjone/dsh-im-ops/issues"},bin:{"dsh-im":"bin/dsh-im.mjs"},main:"./lib/index.js",exports:{".":"./lib/index.js","./client":"./lib/client.js","./package.json":"./package.json"},files:["assets","bin","cordis.patch.yml","lib","plugin-src","scripts","src","PROACTIVE_DELIVERY.md","PROACTIVE_DELIVERY.en.md","LICENSE","README.md","README.en.md","THIRD_PARTY_NOTICES.md"],dsh:{bundle:{patch:"./cordis.patch.yml"},client:{inject:["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-ui-slots","@deepseek-ai/dsh-client-locale"],platform:"web"}},scripts:{build:"node plugin-src/client/build.mjs && node plugin-src/host/build.mjs",test:"node --test test/*.test.mjs test/channels/*/*.test.mjs",check:"npm run build && npm test && node scripts/verify-package.mjs"},engines:{node:">=22.19"},dependencies:{"@tencent-connect/qqbot-connector":"1.2.0","@tencent-connect/qqbot-nodejs":"1.0.4","@wecom/aibot-node-sdk":"1.0.7","dingtalk-stream":"2.1.4",qrcode:"1.5.4",undici:"7.29.0"},devDependencies:{"@deepseek-ai/cordis":"4.0.1","@larksuiteoapi/node-sdk":"1.73.0","@whiskeysockets/baileys":"7.0.0-rc14",esbuild:"0.25.9","https-proxy-agent":"5.0.1",react:"18.3.1","react-dom":"18.3.1","react-test-renderer":"18.3.1",semver:"7.8.5"},directories:{doc:"docs",lib:"lib",test:"test"}};var whe=/^\/(?:stop|steer|version)(?=$|\s)/iu,Dhe=/^\/stop(?=$|\s)/iu,Ohe=/^\/version(?=$|\s)/iu,bhe="\u7528\u6CD5\uFF1A/stop\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",Mhe="\u7528\u6CD5\uFF1A/version\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",_he="\u7528\u6CD5\uFF1A/steer <\u8865\u5145\u6307\u4EE4>",The="\u63A7\u5236\u547D\u4EE4\u4EC5\u652F\u6301\u7EAF\u6587\u5B57\uFF0C\u8BF7\u79FB\u9664\u56FE\u7247\u540E\u91CD\u8BD5\u3002";function ko(n,t={}){return{message:n,...t}}function JY(n){return n?{signal:n}:{}}function qY(n,t,o){if(typeof t?.sessionFor!="function")return null;let a=t.sessionFor(o);if(typeof a!="string"||!a)return null;if(typeof n?.workspaceSession!="function")throw new TypeError("Harness does not support workspace sessions");let e=n.workspaceSession(a);if(!e||typeof e!="object")throw new TypeError("Harness returned an invalid workspace session");return e}function la(n){return typeof n=="string"&&whe.test(n.trim())}async function Ra(n,t,o,a,{signal:e,hasImages:i=!1,pendingInteraction:A=!1,control:r}={}){if(!la(n))return null;let s=n.trim(),g=Dhe.test(s),c=Ohe.test(s);if(i)return ko(w(The));if(c)return/^\/version$/iu.test(s)?ko(`dsh-im v${HQ.version}`):ko(w(Mhe));if(g){if(!/^\/stop$/iu.test(s))return ko(w(bhe));let Q=qY(t,o,a);if(!Q)return ko(w("\u5F53\u524D\u804A\u5929\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\u3002"));if(typeof Q.stopActiveTurn!="function")throw new TypeError("Harness session does not support stopping active turns");return await Q.stopActiveTurn(r,JY(e))?ko(w("\u5DF2\u8BF7\u6C42\u505C\u6B62\u5F53\u524D\u4EFB\u52A1\u3002"),{stopped:!0}):ko(w("\u5F53\u524D\u804A\u5929\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\u3002"))}let p=/^\/steer(?:\s+([\s\S]*))?$/iu.exec(s)?.[1]?.trim()??"";if(!p)return ko(w(_he));if(A)return ko([w("\u5F53\u524D\u4EFB\u52A1\u6B63\u5728\u7B49\u5F85\u4F60\u7684\u56DE\u7B54\u6216\u5BA1\u6279\u3002"),"",w("\u8BF7\u5148\u5904\u7406\u5F53\u524D\u8BF7\u6C42\uFF0C\u6216\u8005\u53D1\u9001 /stop \u505C\u6B62\u4EFB\u52A1\u3002")].join(` `));let B=qY(t,o,a);if(!B)return ko(w("\u5F53\u524D\u804A\u5929\u6CA1\u6709\u7ED1\u5B9A\u4F1A\u8BDD\uFF0C\u65E0\u6CD5\u8865\u5145\u6307\u4EE4\u3002\u8BF7\u5148\u7ED1\u5B9A\u4F1A\u8BDD\u3002"));if(typeof B.steerActiveTurn!="function")throw new TypeError("Harness session does not support steering active turns");let f=await B.steerActiveTurn(p,r,JY(e));return ko(f?w("\u5DF2\u63D0\u4EA4\u8865\u5145\u6307\u4EE4\uFF0CAgent \u4F1A\u5728\u4E0B\u4E00\u6B65\u8BFB\u53D6\u3002"):w("\u4EFB\u52A1\u5DF2\u7ED3\u675F\uFF0C\u6CA1\u6709\u6B63\u5728\u8FD0\u884C\u7684\u4EFB\u52A1\uFF0C\u65E0\u6CD5\u8865\u5145\u6307\u4EE4\u3002\u8BF7\u76F4\u63A5\u53D1\u9001\u6D88\u606F\u5F00\u59CB\u65B0\u4EFB\u52A1\u3002"))}var Nhe=/^\/model(?=$|\s)/i,t1=/^\/models(?=$|\s)/i,r1=/^\/reasoning(?=$|\s)/i,i1=/^\/reasonings(?=$|\s)/i,a1=/^\/reasoninglist(?=$|\s)/i,zY="\u7528\u6CD5\uFF1A/model <\u5E8F\u53F7\u6216 provider/model> [\u63A8\u7406\u7B49\u7EA7ID]",Rhe="\u7528\u6CD5\uFF1A/models\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",khe="\u7528\u6CD5\uFF1A/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default]",vhe="\u7528\u6CD5\uFF1A/reasoninglist \u6216 /reasonings\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",o1="session-binding-changed",n1="model-selection-mismatch",Phe=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu;function Ct(n){return{handled:!0,message:n,messages:lg(n)}}function ii(n){return typeof n!="string"?"":n.replace(Phe," ").replace(/\s+/gu," ").trim()}function Ghe(n){return n?{signal:n}:{}}function Fhe(n){if(n===void 0)return;if(!n||typeof n!="object"||!Array.isArray(n.efforts)||n.efforts.length===0)throw new TypeError("Harness returned invalid model reasoning metadata");let t=n.efforts.map(o=>{if(!o||typeof o!="object"||typeof o.id!="string"||!o.id||typeof o.name!="string"||!o.name||o.description!==void 0&&typeof o.description!="string")throw new TypeError("Harness returned an invalid reasoning effort");return{id:o.id,name:o.name,...o.description===void 0?{}:{description:o.description}}});if(n.defaultEffort!==void 0&&(typeof n.defaultEffort!="string"||!n.defaultEffort))throw new TypeError("Harness returned an invalid default reasoning effort");return{efforts:t,...n.defaultEffort===void 0?{}:{defaultEffort:n.defaultEffort}}}function s1(n,{requireCurrent:t=!1}={}){if(!n||typeof n!="object"||!Array.isArray(n.groups)||!Array.isArray(n.failures))throw new TypeError("Harness returned an invalid model catalog");let o=n.groups.map(i=>{if(!i||typeof i!="object"||typeof i.id!="string"||!i.id||typeof i.name!="string"||!i.name||!Array.isArray(i.models))throw new TypeError("Harness returned an invalid model provider group");return{id:i.id,name:i.name,models:i.models.map(A=>{if(!A||typeof A!="object"||typeof A.id!="string"||!A.id||typeof A.name!="string"||!A.name||A.description!==void 0&&typeof A.description!="string")throw new TypeError("Harness returned an invalid model");return{id:A.id,name:A.name,...A.description===void 0?{}:{description:A.description},...A.reasoning===void 0?{}:{reasoning:Fhe(A.reasoning)}}})}}),a=n.failures.map(i=>{if(!i||typeof i!="object"||typeof i.id!="string"||!i.id||typeof i.name!="string"||!i.name)throw new TypeError("Harness returned an invalid model provider failure");return{id:i.id,name:i.name}}),e=null;if(n.current!==void 0){if(!n.current||typeof n.current!="object"||typeof n.current.provider!="string"||!n.current.provider||typeof n.current.model!="string"||!n.current.model||n.current.reasoningEffort!==void 0&&(typeof n.current.reasoningEffort!="string"||!n.current.reasoningEffort))throw new TypeError("Harness returned an invalid current model");e={provider:n.current.provider,model:n.current.model,...n.current.reasoningEffort===void 0?{}:{reasoningEffort:n.current.reasoningEffort}}}else if(t)throw new TypeError("Harness returned no current model");return{groups:o,failures:a,current:e}}function pg(n,t){return`${n}/${t}`}function g1(n,t){return n?.provider===t?.provider&&n?.model===t?.model}function Lhe(n,t){return g1(n,t)&&n?.reasoningEffort===t?.reasoningEffort}function Uhe(n,t){return g1(n,t)&&(t.reasoningEffort===void 0||n?.reasoningEffort===t.reasoningEffort)}function K_(n){if(!n?.provider||!n?.model)return"";let t=pg(n.provider,n.model);return n.reasoningEffort===void 0?t:`${t} \xB7 reasoningEffort=${ii(n.reasoningEffort)}`}function VY(n,t,o){let a=new Error(`Harness ${o} did not confirm the selected model`);return a.code=n1,a.expected=n,a.actual=t,a.source=o,a}function c1(){let n=new Error("Conversation binding changed during model selection");return n.code=o1,n}function WY(n,t,o){if((typeof n?.sessionFor=="function"?n.sessionFor(t):null)!==o)throw c1()}function Hhe(n,t){for(let o of n.groups)for(let a of o.models)if(pg(o.id,a.id)===t)return{provider:o.id,model:a.id};return null}function Khe(n,t){let o=0;for(let a of n.groups)for(let e of a.models)if(o+=1,o===t)return{provider:a.id,model:e.id};return null}function ZY(n){if(!/^\d+$/u.test(n))return null;let t=Number(n);return{index:Number.isSafeInteger(t)&&t>0?t:null}}function KQ(n,t){return t?n.groups.find(({id:a})=>a===t.provider)?.models.find(({id:a})=>a===t.model)??null:null}function xhe(n,t){return n?.reasoning?.efforts?.[t-1]??null}function x_(n,t){return n?.reasoning?.efforts?.find(({id:o})=>o===t)??null}function xQ(n,t){return n?.reasoningEffort??t?.reasoning?.defaultEffort}function ru(n,t){if(t===void 0)return w("Default\uFF08\u7531\u6A21\u578B\u6216 Provider \u51B3\u5B9A\uFF09");let o=x_(n,t);if(!o)return ii(t);let a=ii(o.name),e=ii(o.id);return a===e?e:`${a} (${e})`}function I1(n){let t=KQ(n,n.current);return ru(t,xQ(n.current,t))}function Yhe(n,t,o){return n===t&&n===o?w("\uFF08\u5F53\u524D\u3001\u9ED8\u8BA4\uFF09"):n===t?w("\uFF08\u5F53\u524D\uFF09"):n===o?w("\uFF08\u9ED8\u8BA4\uFF09"):""}function XY(n){return[w("\u6A21\u578B\u5E8F\u53F7\u65E0\u6548\uFF1A{input}",{input:ii(n)}),"",w("\u8BF7\u53D1\u9001 /models \u67E5\u770B\u5E76\u8F93\u5165\u6709\u6548\u7684\u6B63\u6574\u6570\u5E8F\u53F7\u3002")].join(` `)}function $Y(n){return[w("\u63A8\u7406\u7B49\u7EA7\u5E8F\u53F7\u65E0\u6548\uFF1A{input}",{input:ii(n)}),"",w("\u8BF7\u53D1\u9001 /reasoninglist \u67E5\u770B\u5E76\u8F93\u5165\u6709\u6548\u7684\u6B63\u6574\u6570\u5E8F\u53F7\u3002")].join(` `)}function L_(n,t,o){let a=[w("\u6A21\u578B\u4E0D\u652F\u6301\u63A8\u7406\u7B49\u7EA7\uFF1A{effort}",{effort:ii(t)}),"",ii(K_(n))],e=o?.reasoning?.efforts?.map(({id:i})=>ii(i))??[];return e.length>0?a.push(w("\u53EF\u7528\u63A8\u7406\u7B49\u7EA7\uFF1A{efforts}",{efforts:e.join(", ")})):a.push(w("\u8BE5\u6A21\u578B\u4E0D\u63D0\u4F9B\u53EF\u5207\u6362\u7684\u63A8\u7406\u7B49\u7EA7\u3002")),a.join(` @@ -192,7 +192,7 @@ ${Qhe(I.text,s)}`);g=Bc([i,...c,A.join(` {model} \u63A8\u7406\u7B49\u7EA7\uFF1A{effort} -\u540E\u7EED\u6D88\u606F\u5C06\u4F7F\u7528\u8BE5\u6A21\u578B\u548C\u63A8\u7406\u7B49\u7EA7\u3002`,{model:pg(Q.provider,Q.model),effort:ru(f,xQ(Q,f))}))})}catch(I){return Ct(Lp(I,"select"))}}var Y_=/^[a-z0-9][a-z0-9-]*$/,oAA=Object.freeze({defaultId:"",items:Object.freeze([])});function dg(n){if(n==null||typeof n!="string")return null;let t=n.trim();return Y_.test(t)?t:null}function Hp(n){if(n==null||n==="")return null;let t=dg(n);if(!t){let o=new Error(w("Agent Preset \u65E0\u6548\u3002"));throw o.code="agent-preset-invalid",o}return t}function eEe(n){if(typeof n=="string"){let a=dg(n);return a?{id:a,label:a}:null}if(!n||typeof n!="object"||n.broken!==void 0)return null;let t=dg(n.id);if(!t)return null;let o=typeof n.name=="string"&&n.name.trim()?n.name.trim().slice(0,128):typeof n.label=="string"&&n.label.trim()?n.label.trim().slice(0,128):t;return{id:t,label:o}}function gs(n){if(!n||typeof n!="object"||Array.isArray(n))return{defaultId:"",items:[]};let t=[],o=new Set;for(let a of Array.isArray(n.items)?n.items:[]){let e=eEe(a);!e||o.has(e.id)||(o.add(e.id),t.push(e))}return{defaultId:dg(n.defaultId)??"",items:t}}async function xi(n){try{let t=typeof n?.get=="function"?n.get("agentPresets"):n?.agentPresets;if(!t||typeof t.list!="function")return{defaultId:"",items:[]};let o=await t.list();return gs({defaultId:typeof t.defaultId=="string"?t.defaultId:"",items:Array.isArray(o)?o:[]})}catch{return{defaultId:"",items:[]}}}var AEe=/^\/preset(?=$|\s)/iu,d1=/^\/(?:presetlist|presets)(?=$|\s)/iu,tEe="\u7528\u6CD5\uFF1A/presetlist\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",J_=["\u7528\u6CD5\uFF1A","/preset \u67E5\u770B\u5F53\u524D\u8BBE\u7F6E","/preset <\u5E8F\u53F7> \u6309\u6700\u8FD1\u4E00\u6B21 /presetlist \u7684\u5E8F\u53F7\u9009\u62E9","/preset \u6309 Agent Preset ID \u9009\u62E9","/preset id:<\u7EAF\u6570\u5B57 ID> \u9009\u62E9\u7EAF\u6570\u5B57 ID","/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"].join(` +\u540E\u7EED\u6D88\u606F\u5C06\u4F7F\u7528\u8BE5\u6A21\u578B\u548C\u63A8\u7406\u7B49\u7EA7\u3002`,{model:pg(Q.provider,Q.model),effort:ru(f,xQ(Q,f))}))})}catch(I){return Ct(Lp(I,"select"))}}var Y_=/^[a-z0-9][a-z0-9-]*$/,gAA=Object.freeze({defaultId:"",items:Object.freeze([])});function dg(n){if(n==null||typeof n!="string")return null;let t=n.trim();return Y_.test(t)?t:null}function Hp(n){if(n==null||n==="")return null;let t=dg(n);if(!t){let o=new Error(w("Agent Preset \u65E0\u6548\u3002"));throw o.code="agent-preset-invalid",o}return t}function eEe(n){if(typeof n=="string"){let a=dg(n);return a?{id:a,label:a}:null}if(!n||typeof n!="object"||n.broken!==void 0)return null;let t=dg(n.id);if(!t)return null;let o=typeof n.name=="string"&&n.name.trim()?n.name.trim().slice(0,128):typeof n.label=="string"&&n.label.trim()?n.label.trim().slice(0,128):t;return{id:t,label:o}}function gs(n){if(!n||typeof n!="object"||Array.isArray(n))return{defaultId:"",items:[]};let t=[],o=new Set;for(let a of Array.isArray(n.items)?n.items:[]){let e=eEe(a);!e||o.has(e.id)||(o.add(e.id),t.push(e))}return{defaultId:dg(n.defaultId)??"",items:t}}async function xi(n){try{let t=typeof n?.get=="function"?n.get("agentPresets"):n?.agentPresets;if(!t||typeof t.list!="function")return{defaultId:"",items:[]};let o=await t.list();return gs({defaultId:typeof t.defaultId=="string"?t.defaultId:"",items:Array.isArray(o)?o:[]})}catch{return{defaultId:"",items:[]}}}var AEe=/^\/preset(?=$|\s)/iu,d1=/^\/(?:presetlist|presets)(?=$|\s)/iu,tEe="\u7528\u6CD5\uFF1A/presetlist\uFF08\u4E0D\u5E26\u53C2\u6570\uFF09",J_=["\u7528\u6CD5\uFF1A","/preset \u67E5\u770B\u5F53\u524D\u8BBE\u7F6E","/preset <\u5E8F\u53F7> \u6309\u6700\u8FD1\u4E00\u6B21 /presetlist \u7684\u5E8F\u53F7\u9009\u62E9","/preset \u6309 Agent Preset ID \u9009\u62E9","/preset id:<\u7EAF\u6570\u5B57 ID> \u9009\u62E9\u7EAF\u6570\u5B57 ID","/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"].join(` `),rEe=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu,l1=new WeakMap,iEe=15*6e4,aEe=256;function Sn(n){return{handled:!0,message:n,messages:lg(n)}}function oEe(n){return typeof n!="string"?"":n.replace(rEe," ").replace(/\s+/gu," ").trim()}function nEe(n){return n?{signal:n}:{}}function h1(n){if(!n||typeof n!="object"||Array.isArray(n)||!n.agentPresetCatalog||typeof n.agentPresetCatalog!="object"||!Array.isArray(n.agentPresetCatalog.items))throw new TypeError("Harness returned invalid Agent Preset settings");let t=n.agentPreset===null?null:dg(n.agentPreset);if(n.agentPreset!==null&&t===null)throw new TypeError("Harness returned an invalid current Agent Preset");return{agentPreset:t,agentPresetCatalog:gs(n.agentPresetCatalog)}}function YQ(n){let t=oEe(n.label)||n.id;return w("{label}\uFF08{id}\uFF09",{label:t,id:n.id})}function q_(n,t){return n.items.find(o=>o.id===t)??null}function sEe(n){if(!n.defaultId)return w("\u672A\u8BBE\u7F6E\u6216\u5F53\u524D\u4E0D\u53EF\u7528");let t=q_(n,n.defaultId);return t?YQ(t):w("{id}\uFF08\u5F53\u524D\u4E0D\u53EF\u7528\uFF09",{id:n.defaultId})}function z_(n){let{agentPreset:t,agentPresetCatalog:o}=n;if(t===null){let e=q_(o,o.defaultId);return e?w("\u8DDF\u968F Host \u9ED8\u8BA4\uFF1A{preset}",{preset:YQ(e)}):w("\u8DDF\u968F Host \u9ED8\u8BA4\uFF08Host \u9ED8\u8BA4\u5F53\u524D\u4E0D\u53EF\u7528\uFF09")}let a=q_(o,t);return a?YQ(a):w("{id}\uFF08\u5DF2\u4E0D\u53EF\u7528\uFF09",{id:t})}function gEe(n){return[w("\u5F53\u524D\u673A\u5668\u4EBA\u7528\u4E8E\u65B0\u4F1A\u8BDD\u7684 Agent Preset\uFF1A"),z_(n),"",w("\u5DF2\u6709\u4F1A\u8BDD\u4E0D\u4F1A\u53D7\u6B64\u8BBE\u7F6E\u5F71\u54CD\u3002"),w("\u67E5\u770B\u53EF\u7528\u9879\uFF1A/presetlist"),w("\u6062\u590D\u8DDF\u968F Host \u9ED8\u8BA4\uFF1A/preset --default")].join(` `)}function cEe(n){let{agentPreset:t,agentPresetCatalog:o}=n,a=[w("\u5F53\u524D\u673A\u5668\u4EBA\u7528\u4E8E\u65B0\u4F1A\u8BDD\u7684 Agent Preset\uFF1A"),z_(n),"",w("Host \u9ED8\u8BA4\uFF1A{preset}",{preset:sEe(o)}),"",w("\u53EF\u7528 Agent Preset\uFF08{count}\uFF09\uFF1A",{count:o.items.length})];return o.items.length===0?a.push(w("\u5F53\u524D\u6CA1\u6709\u53EF\u7528 Agent Preset\u3002")):o.items.forEach((e,i)=>{let A=[];e.id===o.defaultId&&A.push(w("Host \u9ED8\u8BA4")),e.id===t&&A.push(w("\u5F53\u524D\u9009\u62E9")),t===null&&e.id===o.defaultId&&A.push(w("\u5F53\u524D\u751F\u6548"));let r=A.length>0?`\uFF08${A.join("\uFF0C")}\uFF09`:"";a.push(`${i+1}. ${YQ(e)}${r}`)}),a.push("",w("\u9009\u62E9\uFF1A/preset <\u5E8F\u53F7\u6216 ID>"),w("\u7EAF\u6570\u5B57 ID\uFF1A/preset id:"),w("\u6062\u590D\u8DDF\u968F Host \u9ED8\u8BA4\uFF1A/preset --default")),a.join(` `)}function IEe(n){return[w("\u5F53\u524D\u673A\u5668\u4EBA\u7528\u4E8E\u65B0\u4F1A\u8BDD\u7684 Agent Preset \u5DF2\u8BBE\u7F6E\u4E3A\uFF1A"),z_(n),"",w("\u5DF2\u6709\u4F1A\u8BDD\u4E0D\u53D8\u3002\u82E5\u5F53\u524D\u804A\u5929\u5DF2\u6709\u4F1A\u8BDD\uFF0C\u8BF7\u5148\u53D1\u9001 /new\uFF0C\u518D\u53D1\u9001\u666E\u901A\u6D88\u606F\uFF0C\u624D\u4F1A\u4F7F\u7528\u65B0\u8BBE\u7F6E\u521B\u5EFA\u4F1A\u8BDD\u3002")].join(` @@ -228,7 +228,7 @@ ${o}`:o}function Fo(n){return n instanceof Go?n.userMessage:null}import{createHa ${L}`:q;m&&await y.finish(z)||await this.#L(g,z,this.#F(t))}catch{this.#a.error?.("[dsh-dingtalk] failed to send the safe error reply")}}finally{await this.#J(e),await this.#f.closeRoute(e)}}async#N(t,o,a,e,i,A){this.#l?.throwIfAborted();let r=this.#h.get(e),s=i.claimedReplyMessageId===o;if(!r||r!==i||r.submitting)return s&&(!r||r!==i)?this.#R(t,o):this.#b(t,o,a,e,{releaseMessageId:!1,statusReaction:A});if(this.#I.hasSeen(o))return;if(await this.#I.markSeen(o),Kr(this.#i,"messagesReceived"),this.#i.lastMessageAt=new Date().toISOString(),String(t.conversationType)==="2"&&t.isInAtList!==!0){Kr(this.#i,"messagesIgnored");return}let g;try{g=Cc(t.sessionWebhook)}catch{Kr(this.#i,"messagesRejected"),this.#i.lastRejectedAt=new Date().toISOString(),this.#i.lastError=w("\u9489\u9489\u6D88\u606F\u6CA1\u6709\u5B89\u5168\u7684\u56DE\u590D\u5730\u5740\u3002");return}let c=t?.msgtype==="text"?ZA(t?.text?.content):null;if(!c){try{await this.#L(g,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"),this.#F(t))}catch{this.#a.error?.("[dsh-dingtalk] failed to reject a non-text interaction reply")}return}let I=this.#h.get(e);if(!I||I!==i||I.submitting){if(s&&(!I||I!==i)){try{await this.#L(g,w(cT),this.#F(t))}catch{this.#a.error?.("[dsh-dingtalk] failed to send an expired interaction notice")}return}return this.#b(t,o,a,e,{releaseMessageId:!1,alreadyRecorded:!0,statusReaction:A})}if(I.sessionWebhook=g,I.needsPresentation){try{await this.#G(I)}catch{this.#y(A,"error"),this.#i.lastError=w("\u9489\u9489\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#a.error?.("[dsh-dingtalk] failed to retry an interaction question"),I.interaction.reconnect?.()}return}let p=I.questions[I.index];if(p){if(I.answers.push(Ma(p,c)),I.index+=1,I.indexthis.#L(e,c)})||t?.kind!=="question")return;let A=t?.payload?.questions,r=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t.rpcId!="string"||typeof r!="string"||typeof t.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!ba(c))){this.#a.warn?.("[dsh-dingtalk] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"DingTalk safely cancelled an interaction left by an earlier client.",details:{}}});try{await this.#L(e,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002"))}catch{this.#a.error?.("[dsh-dingtalk] failed to send an interaction recovery notice")}return}let s=this.#h.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#G(s);return}if(this.#d.has(r))return;if(s){this.#a.warn?.("[dsh-dingtalk] cancelled a second pending Harness question"),await t.respond({ok:!1,error:{code:"cancelled",message:"DingTalk is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:a,requiresMention:i,questions:A,answers:[],index:0,sessionWebhook:e,queue:null,claimedReplyMessageId:null,submitting:!1,needsPresentation:!0};this.#h.set(o,g),this.#d.set(g.interactionId,o),await this.#G(g)}async#_(t){if(await this.#f.handleResolved(t))return;let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let a=this.#d.get(o);a&&this.#K(a,o)}async#G(t){let o=t.questions[t.index];o&&(await this.#L(t.sessionWebhook,Ia(o,t.index,t.questions.length,{requiresMention:t.requiresMention})),t.needsPresentation=!1)}async#R(t,o){if(this.#I.hasSeen(o))return;await this.#I.markSeen(o),Kr(this.#i,"messagesReceived"),this.#i.lastMessageAt=new Date().toISOString();let a;try{a=Cc(t.sessionWebhook)}catch{Kr(this.#i,"messagesRejected"),this.#i.lastRejectedAt=new Date().toISOString();return}try{await this.#L(a,w(cT),this.#F(t))}catch{this.#a.error?.("[dsh-dingtalk] failed to send an expired interaction notice")}}#x(t,o){let a=this.#h.get(t);return!a||o!==void 0&&a.interactionId!==o?null:(this.#h.delete(t),this.#d.delete(a.interactionId),a)}#K(t,o){return this.#x(t,o)!==null}async#J(t){let o=this.#x(t);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The DingTalk interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(a){a?.code!=="interaction-not-pending"&&this.#a.warn?.("[dsh-dingtalk] failed to cancel a pending Harness interaction")}}#U(){typeof this.#I.pendingSenders=="function"&&(this.#i.pendingSenders=this.#I.pendingSenders())}#F(t){let o=$1(t);return String(t?.conversationType)==="2"&&o?{atUserIds:[o]}:void 0}async#L(t,o,a){let e=[];for(let i of QY(o,this.#g)){this.#l?.throwIfAborted();let A=await this.#e.sendText({clientId:this.#A,clientSecret:this.#t,sessionWebhook:t,text:i,at:a,signal:this.#l});e.push(...Ur(A))}return e}async#V(t,o,a,e,i){let A=async(s,g)=>dCe(await this.#e[s]({clientId:this.#A,clientSecret:this.#t,target:t,file:g,signal:this.#l})),r=await Lo({artifacts:e,baseReceipt:i,deliveryId:a,aggregatePresentation:i?"dingtalk-text-and-files":"dingtalk-files",channelKey:"dingtalk",signal:this.#l,sendImage:typeof this.#e.sendImage=="function"?s=>A("sendImage",s):void 0,sendFile:typeof this.#e.sendFile=="function"?s=>A("sendFile",s):void 0,onFailure:(s,g)=>rt(this.#i,g,{userMessage:QCe(s?.fileName,g),reason:g?.code}),sendFailureNotice:(s,g,c)=>this.#L(o,ut(c)),logger:this.#a});return this.#i.artifactsSent=(this.#i.artifactsSent??0)+r.artifactsSent,this.#i.artifactSendErrors=(this.#i.artifactSendErrors??0)+r.artifactSendErrors,{receipt:r.receipt,userVisible:r.userVisible,artifactSendErrors:r.artifactSendErrors}}};function ty(n){return typeof n=="string"&&n.trim()?n.trim():null}function i3(n){let t=Array.isArray(n?.approvedSenders)?n.approvedSenders:n?.approvedSenders instanceof Set?[...n.approvedSenders]:[];return new Set(t.map(o=>ty(typeof o=="string"?o:o?.staffId)).filter(Boolean))}function wCe(n){return i3(n).size}function a3(n){return n?.connected===!0||n?.socket?.readyState===1}function DCe(n,t){return new Promise((o,a)=>{if(t.aborted){a(t.reason);return}let e=()=>a(t.reason);t.addEventListener("abort",e,{once:!0}),Promise.resolve(n).then(i=>{t.removeEventListener("abort",e),o(i)},i=>{t.removeEventListener("abort",e),a(i)})})}async function OCe(n,t,o){for(;;){if(o?.throwIfAborted(),a3(n))return;await new Promise((a,e)=>{let i=setTimeout(()=>{o?.removeEventListener("abort",A),a()},t),A=()=>{clearTimeout(i),e(o.reason??new DOMException("Aborted","AbortError"))};o?.addEventListener("abort",A,{once:!0})})}}async function bCe(n,t,o,a){let e=AbortSignal.timeout(t),i=AbortSignal.any([a,e]),A=!1,r=Promise.resolve().then(()=>n.connect()).finally(()=>{A=!0});try{await DCe(r,i),await OCe(n,o,i)}catch(s){throw i.aborted?(A||r.then(()=>n.disconnect()).catch(()=>{}),a.aborted?a.reason:new Error(`DingTalk Stream handshake timed out after ${t}ms`)):s}}async function MCe({clientId:n,clientSecret:t}){let{DWClient:o,TOPIC_ROBOT:a}=await import("dingtalk-stream");return{client:new o({clientId:n,clientSecret:t,endpoint:"https://api.dingtalk.com",autoReconnect:!1,keepAlive:!0,debug:!1}),topic:a}}function _Ce({pendingSenders:n=[],approvedSenders:t=0}={}){return{startedAt:null,ready:!1,dingtalkStreamState:"idle",harnessReachable:!1,lastConnectedAt:null,lastCheckedAt:null,lastCallbackAt:null,authorizationMode:"sender-staff-id-approval",approvedSenderCount:t,...lT({pendingSenders:n})}}var nu=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g;#l;#n;#h=null;#d=null;#C=null;#u=null;#B=null;#f=null;#m=new Set;constructor({config:t,clientSecret:o,harness:a,state:e,contextEnhancement:i,accessPolicy:A,logger:r=console,replyTimeoutMs:s=6e5,maxMessageChars:g=4e3,connectTimeoutMs:c=15e3,connectPollIntervalMs:I=25,api:p=yY(),streamFactory:B=MCe}){if(!t||!ty(t.clientId)||!ty(o))throw new TypeError("DingtalkRuntime requires app credentials");if(!a||!e)throw new TypeError("DingtalkRuntime requires Harness and state");if(typeof B!="function")throw new TypeError("streamFactory must be a function");this.#e=t,this.#A=o.trim(),this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g,this.#s=c,this.#p=I,this.#g=p,this.#l=B,this.#n=_Ce({pendingSenders:this.#Q(),approvedSenders:wCe(t)})}get status(){if(this.#d){let t=this.#d.status;Object.assign(this.#n,t)}else this.#n.pendingSenders=this.#Q();return structuredClone(this.#n)}pendingSender(t){return typeof this.#r.pendingSender=="function"?this.#r.pendingSender(t):null}pendingSenders(){return this.#Q()}async start(){return this.#h&&this.#n.ready?this.status:this.#u?this.#u:(this.#u=this.#w().finally(()=>{this.#u=null}),this.#u)}async#w(){await this.stop();let t=new AbortController;this.#f=t;let{signal:o}=t;this.#n.startedAt=new Date().toISOString(),this.#n.dingtalkStreamState="connecting",this.#n.lastError=null;let a="dingtalk-harness-connect-failed";try{if(await this.#t.ensureRunning({signal:o}),this.#n.harnessReachable=!0,a="dingtalk-runtime-prepare-failed",typeof this.#r.removePendingSenderByStaffId=="function"){for(let r of i3(this.#e))await this.#r.removePendingSenderByStaffId(r);this.#n.pendingSenders=this.#Q()}this.#d=new Ay({api:this.#g,clientId:this.#e.clientId,clientSecret:this.#A,approvedSenders:this.#e.approvedSenders,harness:this.#t,state:this.#r,contextEnhancement:this.#I,accessPolicy:this.#o,status:this.#n,logger:this.#c,replyTimeoutMs:this.#i,maxMessageChars:this.#a,signal:o}),a="dingtalk-stream-client-load-failed";let e=await this.#l({clientId:this.#e.clientId,clientSecret:this.#A});if(o.throwIfAborted(),this.#h=e?.client??e,this.#C=e?.topic??e?.TOPIC_ROBOT??"/v1.0/im/bot/messages/get",!this.#h||typeof this.#h.registerCallbackListener!="function"||typeof this.#h.connect!="function"||typeof this.#h.disconnect!="function"||typeof this.#h.socketCallBackResponse!="function")throw new TypeError("streamFactory returned an invalid DingTalk Stream client");let i=this.#h,A=this.#d;return a="dingtalk-stream-listener-failed",i.registerCallbackListener(this.#C,r=>{if(this.#h!==i||this.#d!==A)return;let s=ty(r?.headers?.messageId);if(s)try{i.socketCallBackResponse(s,{success:!0})}catch{this.#c.warn?.("[dsh-dingtalk] unable to acknowledge an inbound callback")}let g=this.#I,c;try{c=g?.getSettings?.()}catch{}let I=Promise.resolve().then(async()=>{if(this.#d!==A)return;let p;try{p=typeof r?.data=="string"?JSON.parse(r.data):r?.data}catch{this.#n.lastError=w("\u9489\u9489\u6D88\u606F\u683C\u5F0F\u65E0\u6548\u3002"),this.#c.warn?.("[dsh-dingtalk] ignored an invalid callback payload");return}if(!p||typeof p!="object")return;this.#n.lastCallbackAt=Date.now();let B=ai({getSettings:()=>c,get botId(){return g?.botId}},p.conversationType==="1"||p.conversationType===1?"direct":p.conversationType==="2"||p.conversationType===2?"group":null);await A.accept(p,{contextSnapshot:B})}).catch(()=>{o.aborted||this.#d!==A||(this.#n.lastError=w("\u9489\u9489\u6D88\u606F\u5904\u7406\u5931\u8D25\u3002"),this.#c.error?.("[dsh-dingtalk] callback processing failed"))}).finally(()=>this.#m.delete(I));this.#m.add(I)}),a="dingtalk-stream-connect-failed",await bCe(i,this.#s,this.#p,o),this.#n.ready=!0,this.#n.dingtalkStreamState="connected",this.#n.lastConnectedAt=Date.now(),this.#n.lastCheckedAt=Date.now(),this.#n.lastError=null,this.#B=setInterval(()=>{let r=a3(i);this.#n.ready=r,this.#n.dingtalkStreamState=r?"connected":"reconnecting",this.#n.lastCheckedAt=Date.now(),r&&(this.#n.lastError=null)},1e3),this.#B.unref?.(),this.status}catch(e){let i=o.aborted,A=i?e:vp(a,e);throw this.#n.ready=!1,this.#n.dingtalkStreamState=i?"idle":"failed",this.#n.lastError=i?null:A?.message??String(A),await this.stop({preserveError:!i}),A}}async stop({preserveError:t=!1}={}){let o=t?this.#n.lastError:null,a=this.#f;this.#f=null,a?.abort(new DOMException("DingTalk runtime stopped","AbortError")),this.#B&&clearInterval(this.#B),this.#B=null,this.#n.ready=!1;let e=this.#h;if(this.#h=null,this.#C=null,e)try{await e.disconnect()}catch{this.#c.warn?.("[dsh-dingtalk] DingTalk Stream disconnect failed")}return await Promise.allSettled([...this.#m]),this.#m.clear(),this.#d&&await this.#d.waitForIdle(),this.#d=null,this.#n.dingtalkStreamState=t?"failed":"idle",this.#n.lastError=o,this.status}async sendConnectionTest(t){return Ec({state:this.#r,text:t,channelLabel:w("\u9489\u9489\u673A\u5668\u4EBA"),send:async({sessionWebhook:o},a)=>{if(!this.#n.ready||!this.#f)throw new Error("DingTalk runtime is not connected");await this.#g.sendText({clientId:this.#e.clientId,clientSecret:this.#A,sessionWebhook:o,text:a,signal:this.#f.signal})}})}async sendProactiveText(t,o,{signal:a}={}){let e=typeof t?.route?.userId=="string"?t.route.userId.trim():"",i=typeof t?.route?.openConversationId=="string"?t.route.openConversationId.trim():"";if(t?.kind==="user"&&(!e||i)||t?.kind==="group"&&(!i||e)||t?.kind!=="user"&&t?.kind!=="group"){let A=new TypeError("Invalid DingTalk proactive delivery target");throw A.code="invalid-target",A}if(!this.#n.ready||!this.#f){let A=new Error("DingTalk runtime is not connected");throw A.code="bot-not-connected",A}a?.throwIfAborted();try{await this.#g.sendRobotText({clientId:this.#e.clientId,clientSecret:this.#A,target:{type:t.kind,robotCode:this.#e.clientId,...t.kind==="user"?{userId:e}:{openConversationId:i}},text:o,signal:a??this.#f.signal})}catch(A){if(A?.code!=="send-rejected")throw A;let r=new Error("DingTalk rejected the proactive delivery target",{cause:A});throw r.code="target-rejected",r}return{sent:!0}}#Q(){return typeof this.#r.pendingSenders=="function"?this.#r.pendingSenders():[]}};import{spawn as UCe}from"node:child_process";import{randomUUID as pT}from"node:crypto";import{isAbsolute as HCe}from"node:path";import{isAbsolute as TCe}from"node:path";var NCe=256,RCe=/[\p{White_Space}\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u,kCe=/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u;function su(n,t){let o=new Error(t);return o.code=n,o}function vCe(n){if(typeof n!="string"||!n||n.length>NCe||RCe.test(n))throw su("session-id-invalid","A non-empty, safe session id is required");return n}function PCe(n,t){if(!Array.isArray(t?.items)||!Array.isArray(t?.archivedSessionIds)||t.archivedSessionIds.some(a=>typeof a!="string"||!a))throw new Error("Harness returned an invalid response for workspace.list");let o=[];for(let a of t.items){if(typeof a?.workspaceId!="string"||!a.workspaceId||typeof a.path!="string"||!TCe(a.path)||!Array.isArray(a.sessionIds)||a.sessionIds.some(e=>typeof e!="string"||!e))throw new Error("Harness returned an invalid response for workspace.list");for(let e of a.sessionIds)e===n&&o.push(a)}if(o.length===0)throw su("session-not-registered","The session is not registered to a Harness workspace");if(o.length!==1)throw su("session-workspace-ambiguous","The session is registered to more than one Harness workspace");if(kCe.test(o[0].path))throw new Error("Harness returned an unsafe workspace path for the session");return{workspace:o[0],archived:t.archivedSessionIds.includes(n)}}function GCe(n,t){if(!Array.isArray(t?.items)||t.items.some(i=>typeof i?.sessionId!="string"||!i.sessionId))throw new Error("Harness returned an invalid response for session.list");let o=t.items.filter(i=>i.sessionId===n);if(o.length===0)throw su("session-summary-unavailable","The session is no longer available from Harness");if(o.length!==1)throw new Error("Harness returned duplicate session summaries for session.list");let[a]=o;if(a.origin==="subagent")throw su("session-subagent-unsupported","Subagent sessions cannot be adopted as a bot conversation");if(a.origin!==void 0)throw new Error("Harness returned an invalid session origin for session.list");let e=a.projections?.values?.title;if(e!=null&&typeof e!="string")throw new Error("Harness returned an invalid session title for session.list");return{title:typeof e=="string"?e:null}}async function o3(n,t,o={},a=3e4){let e=vCe(t);await n.ensureRunning(o);let i=await n.rpc("workspace.list",{},a,o),{workspace:A,archived:r}=PCe(e,i),s=GCe(e,await n.rpc("session.list",{},a,o)),g=await n.rpc("session.create",{workspaceId:A.workspaceId,sessionId:e},a,o);if(!g||g.sessionId!==e)throw new Error("Harness returned an invalid response for session.create");return{sessionId:e,workspace:A.path,title:s.title,archived:r}}function gu(n,t,o){try{let a=n?.(t);a&&typeof a.then=="function"&&Promise.resolve(a).catch(o)}catch(a){o(a)}}async function FCe({apiProxy:n,rpcId:t,signal:o,onOpen:a,onEnvelope:e}){let i=new AbortController,A=()=>i.abort(o.reason),r,s,g,c=I=>{i.signal.aborted||(g=I,A())};o.addEventListener("abort",A,{once:!0});try{for(r=n.events.mux({rpcId:t,payload:{}},i.signal)[Symbol.asyncIterator](),s=Promise.resolve(r.next()),i.signal.aborted||gu(a,A,c);!i.signal.aborted;){let{value:I,done:p}=await s;if(p||i.signal.aborted)break;gu(e,{type:"server-request",rpcId:I?.rpcId,method:I?.payload?.type,payload:I?.payload},c),i.signal.aborted||(s=Promise.resolve(r.next()))}}catch(I){c(I)}finally{let I=i.signal.aborted;o.removeEventListener("abort",A),A(),await s?.catch(()=>{});try{await r?.return?.()}catch(p){I||(g??=p)}}if(g)throw g}function LCe({baseUrl:n,createWebSocket:t,signal:o,onOpen:a,onEnvelope:e,onMalformed:i}){let A=new URL("/api/events.mux",n);return A.protocol=A.protocol==="https:"?"wss:":"ws:",new Promise((r,s)=>{let g=t(A.toString()),c=!1,I=!1,p=_=>{if(!I){I=!0,g.removeEventListener("open",f),g.removeEventListener("message",Q),g.removeEventListener("close",y),g.removeEventListener("error",m),o.removeEventListener("abort",T);try{(g.readyState===0||g.readyState===1)&&g.close()}catch{}_&&!o.aborted?s(_):r()}},B=()=>p(),f=()=>{I||c||(c=!0,gu(a,B,p))},Q=_=>{if(I)return;let R;try{if(typeof _.data!="string")throw new Error("binary WebSocket frame");R=JSON.parse(_.data)}catch(L){gu(i,L,()=>{});return}gu(e,R,p)},y=()=>p(c?void 0:new Error("Harness event mux WebSocket closed before opening")),m=()=>p(new Error(c?"Harness event mux WebSocket failed":"Harness event mux WebSocket failed before opening")),T=()=>p();g.addEventListener("open",f),g.addEventListener("message",Q),g.addEventListener("close",y,{once:!0}),g.addEventListener("error",m,{once:!0}),o.addEventListener("abort",T,{once:!0}),o.aborted&&T()})}async function n3(n){if(!n.signal.aborted)return n.baseUrl!==void 0&&n.baseUrl!==null?LCe(n):FCe(n)}var KCe=new Map,xCe=new WeakMap,YCe=64;async function jCe(n){let t=n?.body;if(!t||typeof t.getReader!="function")return null;let o=t.getReader(),a=[],e=0;try{for(;;){let{done:r,value:s}=await o.read();if(r)break;if(!(s instanceof Uint8Array)||e+s.byteLength>YCe)return null;a.push(s),e+=s.byteLength}}catch{return null}finally{try{await o.cancel()}catch{}}let i=new Uint8Array(e),A=0;for(let r of a)i.set(r,A),A+=r.byteLength;return new TextDecoder().decode(i)}function JCe(n){if(n==="localhost"||n==="[::1]")return!0;let t=n.split(".");return t.length===4&&t[0]==="127"&&t.every(o=>/^\d{1,3}$/.test(o)&&Number(o)<=255)}async function qCe(n,t){return n.status===401?"harness-auth-required":n.status===407?"harness-proxy-auth-required":n.status===403?(await jCe(n))?.trim()!=="forbidden"?"harness-request-forbidden":JCe(t)?"harness-loopback-forbidden":"harness-host-untrusted":n.status===404?"harness-api-not-found":"harness-http-failed"}function p3(n){let t=typeof n=="string"?KCe:xCe,o=t.get(n);return o||(o={ownerships:new Map,claims:new Map,controls:new WeakMap,nextOrder:0},t.set(n,o)),o}function s3(n,t){return new Promise((o,a)=>{let e=()=>t.removeEventListener("abort",i),i=()=>{e(),a(t.reason)};if(t.aborted){i();return}t.addEventListener("abort",i,{once:!0}),Promise.resolve().then(()=>(t.throwIfAborted(),n())).then(A=>{e(),o(A)},A=>{e(),a(A)})})}function g3(n){let t=typeof n?.owner;return t!=="object"&&t!=="function"||n.owner===null||typeof n.key!="string"||!n.key?null:{owner:n.owner,key:n.key}}function dT(n){return n!==null&&typeof n=="object"&&typeof n.provider=="string"&&!!n.provider&&typeof n.model=="string"&&!!n.model&&(n.reasoningEffort===void 0||typeof n.reasoningEffort=="string"&&!!n.reasoningEffort)}function zCe(n){return n!==null&&typeof n=="object"&&Array.isArray(n.efforts)&&n.efforts.length>0&&n.efforts.every(t=>t!==null&&typeof t=="object"&&typeof t.id=="string"&&!!t.id&&typeof t.name=="string"&&!!t.name&&(t.description===void 0||typeof t.description=="string"))&&(n.defaultEffort===void 0||typeof n.defaultEffort=="string"&&!!n.defaultEffort)}function c3(n,t,{session:o=!1}={}){if(!n||typeof n!="object"||!Array.isArray(n.groups)||!Array.isArray(n.failures))throw new Error(`Harness returned an invalid response for ${t}`);for(let a of n.groups){if(!a||typeof a!="object"||typeof a.id!="string"||!a.id||typeof a.name!="string"||!a.name||!Array.isArray(a.models))throw new Error(`Harness returned an invalid response for ${t}`);for(let e of a.models)if(!e||typeof e!="object"||typeof e.id!="string"||!e.id||typeof e.name!="string"||!e.name||e.description!==void 0&&typeof e.description!="string"||e.reasoning!==void 0&&!zCe(e.reasoning))throw new Error(`Harness returned an invalid response for ${t}`)}for(let a of n.failures)if(!a||typeof a!="object"||typeof a.id!="string"||!a.id||typeof a.name!="string"||!a.name||a.message!==void 0&&typeof a.message!="string")throw new Error(`Harness returned an invalid response for ${t}`);if(o&&(!dT(n.current)||typeof n.routable!="boolean"))throw new Error(`Harness returned an invalid response for ${t}`);return n}function I3(){let n=new Error("Harness turn was stopped before producing a text reply");return n.code="turn-stopped",n}function VCe(n){return Array.isArray(n?.items)?n.items.flatMap(t=>typeof t?.path=="string"&&HCe(t.path)?[t.path]:[]):[]}function WCe(n,t){if(!Array.isArray(t?.items)||!Array.isArray(t?.archivedSessionIds))throw new Error("Harness returned an invalid response for workspace.list");let o=t.items.find(a=>a?.path===n);if(!o)return null;if(!Array.isArray(o.sessionIds)||o.sessionIds.some(a=>typeof a!="string"))throw new Error("Harness returned invalid session IDs for workspace.list");return o}function ZCe(n){if(typeof n=="number"&&Number.isFinite(n))return n<1e12?n*1e3:n;if(typeof n=="string"&&n){let t=Date.parse(n);if(!Number.isNaN(t))return t}return null}function XCe(n){if(!n||typeof n!="object")return null;let t=[n?.header?.lastActivityAt,n?.header?.updatedAt,n?.header?.createdAt,n?.projections?.values?.lastActivityAt,n?.projections?.values?.updatedAt,n?.projections?.values?.createdAt,n?.lastActivityAt,n?.updatedAt,n?.createdAt];for(let o of t){let a=ZCe(o);if(a!==null)return a}return null}function $Ce(n,t,o){if(!Array.isArray(o?.items))throw new Error("Harness returned an invalid response for session.list");let a=new Set(t),e=new Map(o.items.flatMap(i=>typeof i?.sessionId=="string"?[[i.sessionId,i]]:[]));return{workspace:n.path,sessions:n.sessionIds.map(i=>{let A=e.get(i),r=A?.projections?.values?.title,s={sessionId:i,title:typeof r=="string"?r:null,archived:a.has(i),blank:A?.blank===!0,origin:A?.origin==="subagent"?"subagent":null,summaryAvailable:A!==void 0},g=A?.projections?.asOfSeq;Number.isSafeInteger(g)&&g>=-1&&(s.lastSeq=g);let c=XCe(A);return c!==null&&(s.time=c),s})}}function cu(n,t){return new Promise((o,a)=>{if(t?.aborted){a(t.reason??new DOMException("Aborted","AbortError"));return}let e=setTimeout(()=>{t?.removeEventListener("abort",i),o()},n),i=()=>{clearTimeout(e),a(t.reason??new DOMException("Aborted","AbortError"))};t?.addEventListener("abort",i,{once:!0})})}function eBe(n){return(n?.data?.message?.content??[]).filter(t=>t.type==="text"&&typeof t.text=="string").map(t=>t.text).join(` `).trim()}function Ga(n){return typeof n=="string"&&n.trim()?n.trim():null}function ABe(n){if(!n||typeof n!="object")return null;let t=Ga(n.message);if(t)return t;let o=Ga(n.name),a=Ga(n.code);return o||a?[o??"Error",a].filter(Boolean).join(": "):null}function d3(n,t){let o=[...t].map(a=>a?.event??a).filter(Boolean).sort((a,e)=>(a.seq??-1)-(e.seq??-1));for(let a of o){let e=a.seq??-1;if(e<=n.lastSeq)continue;if(n.lastSeq=e,a.type==="turn/start"){let A=a.data?.turn??null;n.active&&A!==n.turn&&(n.active=!1),n.turn!==null&&A!==n.turn&&(n.completed=!0),n.openTurn=A;continue}if(a.type==="user/message"&&a.data?.source?.rpcId===n.promptRpcId){n.active=!0,n.started=!0,n.completed=!1,n.turn=a.data?.turn??n.openTurn;continue}if(a.type==="turn/end"&&a.data?.turn===n.turn){n.active=!1,n.completed=!0;continue}let i=null;if(a.type==="tool/call"&&n.active&&a.data?.turn===n.turn&&typeof a.data?.callId=="string"&&a.data.callId)i={callId:a.data.callId,name:a.data?.name,arguments:a.data?.arguments};else if(a.type==="tool/code-dispatch-start"&&n.active&&typeof a.data?.subCallId=="string"&&a.data.subCallId){let A;try{A=JSON.stringify(a.data?.arguments)}catch{A=void 0}i={callId:a.data.subCallId,name:a.data?.name,arguments:A}}i&&n.toolCalls.set(i.callId,Object.freeze(i))}}function h3(n,t,o=[]){if(!n||!["object","function","string"].includes(typeof n)||typeof t!="string"||!t)return!1;let a=p3(n).ownerships.get(t);if(!a||a.size===0)return!1;for(let e of a)d3(e,o);return[...a].some(e=>e.active&&!e.completed&&typeof e.reconnect=="function")}var zp=class{#e;#A;#t=null;#r=null;#I=new Map;#o="";#c=!1;#i=null;#a=new Map;#s=null;constructor({promptRpcId:t,afterSeq:o=-1}){this.#e=t,this.#A=o}get finished(){return this.#c}get lastSeq(){return this.#A}get answer(){return this.#o.trim()}get reason(){return this.#i}get tracking(){return this.#r!==null&&!this.#c}get turn(){return this.#r}consumeAll(t){let o=[],a=i=>{if(i.type==="text"&&o.length>0&&o[o.length-1].type==="text"){o[o.length-1]=i;return}o.push(i)},e=[...t].map(i=>i?.event??i).filter(Boolean).sort((i,A)=>(i.seq??-1)-(A.seq??-1));for(let i of e){let A=i.seq??-1;if(!(A<=this.#A)){if(this.#A=A,i.type==="turn/start"&&(this.#t=i.data?.turn??null),i.type==="user/message"&&i.data?.source?.rpcId===this.#e){this.#r=this.#t;continue}if(this.#r!==null){if(i.type==="turn/end"){if(i.data?.turn!==this.#r)continue;this.#c=!0,this.#i=i.data?.reason??null,this.#t=null;continue}if(i.data?.turn===this.#r){if(i.type==="assistant/chunk"&&i.data?.chunk?.type==="text-delta"){let r=i.data?.step??0,s=i.data.chunk.index??0,g=`${r}:${s}`;this.#I.set(g,(this.#I.get(g)??"")+i.data.chunk.text);let c=`${r}:`,I=[...this.#I.entries()].filter(([p])=>p.startsWith(c)).sort(([p],[B])=>Number(p.split(":")[1])-Number(B.split(":")[1])).map(([,p])=>p).join(` -`).trim();I&&I!==this.#o&&(this.#o=I,a({type:"text",text:I}));continue}if(i.type==="assistant/message"){let r=eBe(i);r&&r!==this.#o&&(this.#o=r,a({type:"text",text:r}));continue}if(i.type==="tool/call"){let r=Ga(i.data?.name)??w("\u5DE5\u5177"),s=Ga(i.data?.callId)??Ga(i.data?.subCallId);s&&this.#a.set(s,r),this.#s=r,a({type:"tool",name:r,...s?{callId:s}:{}})}else if(i.type==="tool/result"){let r=Ga(i.data?.message?.source?.callId)??Ga(i.data?.callId)??Ga(i.data?.subCallId),s=(r?this.#a.get(r):null)??this.#s,g=ABe(i.data?.error);a({type:"status",text:w("\u6B63\u5728\u6574\u7406\u7ED3\u679C\u2026"),...s?{toolName:s}:{},...g?{error:g}:{}})}}}}}return o}consume(t){return this.consumeAll(t).at(-1)??null}},Dn=class extends Error{constructor(t,o){super(`${t}: ${o?.message??"unknown Harness RPC error"}`),this.name="HarnessRpcError",this.method=t,this.code=o?.code??"internal",this.details=o?.details??{}}},ps=class extends Error{constructor(t,o,{cause:a,status:e}={}){let i=Number.isInteger(e)?`, HTTP ${e}`:"";super(`Harness ${o} transport failed (${t}${i})`,{cause:a}),this.name="HarnessTransportError",this.code=t,this.method=o,Number.isInteger(e)&&(this.status=e)}},hT=class extends Error{constructor(t){super("Harness health RPC was rejected",{cause:t}),this.name="HarnessHealthError",this.code="harness-rpc-rejected",this.method="host.describe"}},Vp=class extends Error{constructor(t,o){super(o),this.name="HarnessInteractionError",this.code=t}},ds=class extends Error{constructor(t,{reason:o,providerCode:a}={}){super(`Harness turn failed (${t})`),this.name="HarnessTurnError",this.code=t,this.promptAccepted=!0,o&&typeof o=="object"&&(this.reason=o),typeof a=="string"&&a&&(this.providerCode=a)}};function l3(n){let t=Ga(n?.kind)??Ga(n);if(t==="error"){let o=n?.error??n?.failure;return new ds("harness-turn-failed",{reason:n,providerCode:Ga(o?.code)??void 0})}return t==="max-tokens"?new ds("model-max-tokens",{reason:n}):t==="blocked"?new ds("turn-blocked",{reason:n}):["interrupted","stopped","cancelled","canceled"].includes(t)?new ds("turn-interrupted",{reason:n}):t==="aborted"?new ds("turn-aborted",{reason:n}):t==="completed"?new ds("model-empty-response",{reason:n}):new ds("harness-turn-failed",{reason:n})}function tBe(n){return n==null?!0:(Ga(n?.kind)??Ga(n))==="completed"}var yr=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g;#l;#n;#h;#d=null;#C;#u;#B;#f;constructor({baseUrl:t,apiProxy:o,interactionScope:a=o,workspace:e,agentPreset:i,autostart:A=!1,dshBin:r="dsh",fetchImpl:s=fetch,createWebSocket:g=m=>new WebSocket(m),interactionReconnectDelayMs:c=500,rpcIdPrefix:I="im",logPrefix:p="dsh-im",commandExecutor:B,controlExecutor:f,sessionMaintenanceExecutor:Q,fileIngressExecutor:y}){if(typeof g!="function")throw new TypeError("createWebSocket must be a function");if(!Number.isFinite(c)||c<0)throw new TypeError("interactionReconnectDelayMs must be a non-negative number");if(typeof I!="string"||!I.trim())throw new TypeError("rpcIdPrefix must be a non-empty string");if(typeof p!="string"||!p.trim())throw new TypeError("logPrefix must be a non-empty string");if(B!==void 0&&typeof B!="function")throw new TypeError("commandExecutor must be a function");if(f!==void 0&&typeof f!="function")throw new TypeError("controlExecutor must be a function");if(Q!==void 0&&typeof Q!="function")throw new TypeError("sessionMaintenanceExecutor must be a function");if(y!==void 0&&typeof y!="function")throw new TypeError("fileIngressExecutor must be a function");if(this.#e=t===void 0?null:new URL(t),this.#A=this.#e?null:o,!this.#e&&(!this.#A||typeof this.#A!="object"))throw new TypeError("HarnessClient requires the current Host apiProxy or an explicit baseUrl");if(this.#A&&(!a||!["object","function"].includes(typeof a)))throw new TypeError("interactionScope must identify the current Host");this.#t=e,this.#r=i??void 0,this.#I=!!(this.#e&&A),this.#o=r,this.#c=s,this.#i=g,this.#a=c,this.#s=I.trim(),this.#p=p.trim(),this.#g=B,this.#l=f,this.#n=Q,this.#h=y,this.#C=p3(this.#e?.origin??a),this.#u=this.#C.ownerships,this.#B=this.#C.claims,this.#f=this.#C.controls}async rpc(t,o={},a=3e4,e={}){let i=e.rpcId??`${this.#s}-${pT()}`,A=AbortSignal.timeout(a),r=e.signal?AbortSignal.any([e.signal,A]):A,s;try{if(this.#A){let[g,c,I]=t.split("."),p={host:"host",workspace:"workspace",session:"sessions",llm:"llm"}[g],B=p&&this.#A[p];if(I!==void 0||!Object.hasOwn(B??{},c)||typeof B[c]!="function")throw new ps("harness-api-not-found",t);s={type:"server-response",...await s3(()=>B[c]({rpcId:i,payload:o},r),r)}}else{let g=await this.#c(new URL(`/api/${t}`,this.#e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"client-request",rpcId:i,method:t,payload:o}),signal:r});if(!g.ok){let c=await qCe(g,this.#e.hostname);throw new ps(c,t,{status:g.status})}try{s=await g.json()}catch(c){throw new ps("harness-response-invalid",t,{cause:c})}}}catch(g){throw e.signal?.aborted||g instanceof ps?g:new ps(A.aborted?"harness-timeout":"harness-connect-failed",t,{cause:g})}if(s?.type!=="server-response"||s?.rpcId!==i)throw new ps("harness-response-invalid",t,{cause:new Error(`Harness returned an invalid response for ${t}`)});if(!s.result||typeof s.result!="object"||typeof s.result.ok!="boolean")throw new ps("harness-response-invalid",t,{cause:new Error(`Harness returned an invalid result for ${t}`)});if(!s.result?.ok)throw new Dn(t,s.result?.error);return s.result.value}async health(t={}){try{return await this.rpc("host.describe",{},5e3,t),!0}catch(o){throw o instanceof Dn?new hT(o):o}}async ensureRunning(t={}){try{return await this.health(t)}catch(e){if(!this.#I)throw e}if(!this.#d||this.#d.exitCode!==null){let e=this.#e.port||(this.#e.protocol==="https:"?"443":"80");this.#d=UCe(this.#o,["web","--host",this.#e.hostname,"--port",e],{cwd:this.#t,env:process.env,stdio:["ignore","inherit","inherit"]}),this.#d.on("error",i=>{console.error(`[${this.#p}] failed to start Harness:`,i.message)})}let o=Date.now()+6e4,a;for(;Date.now(){let r=A&&a.signal?AbortSignal.any([A,a.signal]):A??a.signal;return this.rpc("session.selectModel",{sessionId:t,provider:o.provider,model:o.model,...o.reasoningEffort===void 0?{}:{reasoningEffort:o.reasoningEffort}},3e4,r?{...a,signal:r}:a)},i=this.#n?await this.#n({sessionId:t,operation:e}):await e();if(!i||typeof i!="object"||!dT(i.selected))throw new Error("Harness returned an invalid response for session.selectModel");return i}async isSessionRunning(t,o={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");await this.ensureRunning(o);let a=await this.rpc("session.list",{},3e4,o);if(!a||typeof a!="object"||!Array.isArray(a.items))throw new Error("Harness returned an invalid response for session.list");for(let e of a.items)if(!e||typeof e!="object"||typeof e.sessionId!="string"||!e.sessionId||typeof e.running!="boolean")throw new Error("Harness returned an invalid response for session.list");return a.items.find(e=>e.sessionId===t)?.running??!1}async adoptWorkspaceSession(t,o={}){return o3(this,t,o)}async workspaceId(t={}){let{workspace:o=this.#t,...a}=t,{items:e}=await this.rpc("workspace.list",{},3e4,a),i=e.find(r=>r.path===o);return i?i.workspaceId:(await this.rpc("workspace.create",{path:o},3e4,a)).workspace.workspaceId}async createSession(t={}){let{agentPreset:o,...a}=t;await this.ensureRunning(a);let i={workspaceId:await this.workspaceId(a)},A=o!==void 0?o:this.#r;return A!=null&&(i.agentPreset=A),(await this.rpc("session.create",i,3e4,a)).sessionId}async renameSession(t,o,a={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(typeof o!="string"||!o.trim())throw new TypeError("session title is required");return this.rpc("session.rename",{sessionId:t,title:o},3e4,a)}async executeCommand(t,o,a={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(typeof o!="string"||!o)throw new TypeError("command line is required");if(!this.#g){let e=new Error("Harness command execution is unavailable");throw e.code="commands-unavailable",e}try{return await this.#g(t,o,a)}catch(e){throw e?.failure&&typeof e.failure=="object"?new Dn("commands.execute",e.failure):e}}async readSessionHistory(t,{maxMessages:o=50,beforeSeq:a,timeoutMs:e=1e4,...i}={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(!Number.isSafeInteger(o)||o<1||a!==void 0&&(!Number.isSafeInteger(a)||a<0))throw new TypeError("Invalid history pagination");return this.rpc("session.history",{sessionId:t,maxMessages:o,...a===void 0?{}:{beforeSeq:a}},e,i)}async sessionExists(t,o={}){try{return await this.rpc("session.history",{sessionId:t,maxMessages:1},3e4,o),!0}catch(a){if(a instanceof Dn&&a.code==="session-not-found")return!1;throw a}}async respondInteraction(t,o,a={}){if(typeof t!="string"||!t)throw new TypeError("rpcId is required");if(!o||typeof o!="object"||typeof o.ok!="boolean")throw new TypeError("A Harness RPC result is required");let e=AbortSignal.timeout(a.timeoutMs??3e4),i=a.signal?AbortSignal.any([a.signal,e]):e,A={type:"client-response",rpcId:t,result:o},r;if(this.#A)r=await s3(()=>this.#A.respond(A),i);else{let g=await this.#c(new URL("/api/respond",this.#e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(A),signal:i});if(!g.ok)throw new Error(`Harness transport respond failed: HTTP ${g.status}`);r=await g.json()}if(r?.accepted===!0)return r;if(r?.accepted!==!1||r.reason!=="bad-response"&&r.reason!=="not-pending")throw new Error("Harness returned an invalid interaction response receipt");let s=r.reason;throw new Vp(`interaction-${s}`,`Harness interaction response was rejected (${s})`)}async watchInteractions(t,{signal:o,onInteraction:a,onResolved:e,onOpen:i,ownership:A}={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(!o||typeof o.addEventListener!="function")throw new TypeError("watchInteractions requires an AbortSignal");if(a!==void 0&&typeof a!="function")throw new TypeError("onInteraction must be a function");if(e!==void 0&&typeof e!="function")throw new TypeError("onResolved must be a function");if(i!==void 0&&typeof i!="function")throw new TypeError("onOpen must be a function");for(;!o.aborted;){try{await this.#N(t,{signal:o,onInteraction:a,onResolved:e,onOpen:i,ownership:A})}catch(r){if(o.aborted)return;console.warn(`[${this.#p}] Harness interaction stream disconnected:`,r.message)}if(o.aborted)return;try{await cu(this.#a,o)}catch{if(o.aborted)return;throw new Error("Harness interaction reconnect wait failed")}}}#m(t,o){let a=this.#u.get(t)??new Set;o.order=this.#C.nextOrder,this.#C.nextOrder+=1,a.add(o),this.#u.set(t,a)}#w(t,o){let a=this.#u.get(t);a?.delete(o),a?.size===0&&this.#u.delete(t);for(let[e,i]of this.#B)i.ownership===o&&this.#B.delete(e)}#Q(t){if(!t.control)return;let o=this.#f.get(t.control.owner);o||(o=new Map,this.#f.set(t.control.owner,o));let a=o.get(t.control.key)??new Set;a.add(t),o.set(t.control.key,a)}#y(t){if(!t.control)return;let o=this.#f.get(t.control.owner),a=o?.get(t.control.key);a?.delete(t),a?.size===0&&o.delete(t.control.key),o?.size===0&&this.#f.delete(t.control.owner)}#b(t,o){let a=g3(o);return a?[...this.#f.get(a.owner)?.get(a.key)??[]].filter(i=>i.sessionId===t).sort((i,A)=>i.order-A.order):[]}#E(t,o){return this.#b(t,o).find(a=>a.started&&a.active&&!a.completed&&a.turn!==null)??null}async#k(t,o,a){let e=this.#b(t,o);if(e.length===0)return null;try{let i=await this.rpc("session.history",{sessionId:t,maxMessages:50},3e4,a);this.#M(t,i.events??[])}catch(i){if(!(i instanceof Dn)||i.code!=="session-not-found")throw i;for(let A of e)A.active=!1,A.completed=!0;return null}return this.#E(t,o)}async hasActiveTurn(t,o,a={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");return!!await this.#k(t,o,a)}async stopActiveTurn(t,o,a={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");let e=await this.#k(t,o,a);if(!e)return!1;if(e.stopRequested)return!0;if(this.#E(t,o)!==e)return!1;e.stopRequested=!0;try{if(this.#l){let i=this.#l({sessionId:t,expectedTurn:e.turn,promptRpcId:e.promptRpcId,action:"stop"});if(i&&typeof i.then=="function")throw new TypeError("controlExecutor must return synchronously");if(i!==void 0){if(typeof i!="boolean")throw new TypeError("controlExecutor must return a boolean or undefined");return i||(e.stopRequested=!1),i}}return await this.rpc("session.cancel",{sessionId:t,keepInbox:!0},3e4,a),!0}catch(i){if(this.#E(t,o)===e&&(e.stopRequested=!1),i instanceof Dn&&i.code==="session-not-found")return!1;throw i}}async steerActiveTurn(t,o,a,e={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(typeof o!="string"||!o.trim())throw new TypeError("Steering text is required");let i=await this.#k(t,a,e);if(!i||i.stopRequested||this.#E(t,a)!==i)return!1;if(this.#l){let A=this.#l({sessionId:t,expectedTurn:i.turn,promptRpcId:i.promptRpcId,action:"steer",text:o});if(A&&typeof A.then=="function")throw new TypeError("controlExecutor must return synchronously");if(A!==void 0){if(typeof A!="boolean")throw new TypeError("controlExecutor must return a boolean or undefined");return A}}return await this.rpc("session.prompt",{sessionId:t,mode:"steer",content:[{type:"text",text:o}],clientTimeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},3e4,e),!0}#M(t,o){for(let a of this.#u.get(t)??[])d3(a,o)}async#D(t,o){let a=await this.rpc("session.history",{sessionId:t,maxMessages:50},3e4,{signal:o});this.#M(t,a.events??[])}#S(t,o,a){let e=this.#B.get(o);if(e&&this.#u.get(t)?.has(e.ownership))return e;let i=[...this.#u.get(t)??[]],A=i.filter(s=>s.active).sort((s,g)=>s.order-g.order);if(A.length>0)return{ownership:A[0],recovered:!1};let r=i.filter(s=>!s.started&&!s.completed).sort((s,g)=>s.order-g.order)[0]??null;return r?{ownership:r,recovered:!0}:null}async#T(t,o,a){if(!this.#h)throw new Go("inbound-file-ingress-unavailable","Harness file ingress is unavailable in this Host process.");let i=(await this.rpc("session.list",{},3e4,{signal:a}))?.items?.find(A=>A?.sessionId===t)?.cwd;return this.#h({sessionId:t,workspace:i,files:o,signal:a})}async ask(t,o,a={}){typeof a=="number"&&(a={timeoutMs:a});let e=a.timeoutMs??6e5,i=a.signal,A=typeof a.onUpdate=="function"?a.onUpdate:null,r=a.progressMode==="all"?"all":"latest",s=typeof a.onArtifact=="function"?a.onArtifact:null,g=typeof a.onInteraction=="function"?a.onInteraction:void 0,c=typeof a.onInteractionResolved=="function"?a.onInteractionResolved:void 0,I=g3(a.control),p=Array.isArray(a.files)?a.files.filter(Boolean):[];await this.ensureRunning({signal:i});let B=await this.rpc("session.history",{sessionId:t,maxMessages:1},3e4,{signal:i}),f=Math.max(-1,...(B.events??[]).map(({event:V})=>V.seq??-1)),Q=`${this.#s}-${pT()}`,y=new zp({promptRpcId:Q,afterSeq:f}),m=g||c?new AbortController:null,T=m?i?AbortSignal.any([i,m.signal]):m.signal:null,_=m||I?{sessionId:t,promptRpcId:Q,active:!1,started:!1,completed:!1,stopRequested:!1,turn:null,openTurn:null,lastSeq:f,reconnect:null,order:-1,toolCalls:new Map,control:I}:null,R=null,L=!1,U=0,F=[],q=!1,z=!1,K=async()=>{if(!s||L||y.turn===null)return U;L=!0;let V=JI.take(t,y.turn,{signal:i});for(let H of V)try{await s(H),U+=1}catch(N){JI.release(H),console.warn(`[${this.#p}] ignored an artifact handoff failure:`,N.message)}return U};_&&(this.#m(t,_),this.#Q(_));let G=JI.openConsumer(t,Q);try{let V=o;if(p.length>0){let J=await this.#T(t,p,i);F.push(J),o=$_(o,J)}if(T){let J,X=new Promise(ie=>{J=ie});R=this.watchInteractions(t,{signal:T,onInteraction:g,onResolved:c,onOpen:J,ownership:_}),R.catch(()=>{}),await Promise.race([X,cu(3e4,T).then(()=>{throw new Error("Harness interaction stream did not open within 30 seconds")})])}let H=typeof o=="string"?[{type:"text",text:o}]:o;if(!Array.isArray(H)||H.length===0)throw new TypeError("Harness prompt content is required");let N=Intl.DateTimeFormat().resolvedOptions().timeZone,k=J=>this.rpc("session.prompt",{sessionId:t,mode:"queue",content:J,clientTimeZone:N},3e4,{rpcId:Q,signal:i});try{await k(H)}catch(J){let X=dY(J)?lY(H):[];if(X.length===0)throw J;let ie;try{ie=await this.#T(t,X,i)}catch(Se){throw i?.aborted?i.reason??Se:(console.warn(`[${this.#p}] unable to restage rejected images as workspace files:`,Se?.message??String(Se)),J)}F.push(ie);let oe=$_([...pY(typeof V=="string"?[{type:"text",text:V}]:V),{type:"text",text:w(cY)}],{files:F.flatMap(Se=>Se?.files??[])});await k(oe)}q=!0;try{let J=Date.now(),X=y.lastSeq;for(;;){await cu(300,i);let ie=await this.rpc("session.history",{sessionId:t,maxMessages:50},3e4,{signal:i}),De=_?.active===!0;_&&(this.#M(t,ie.events??[]),!De&&_.active&&_.reconnect?.());let oe=y.consumeAll(ie.events??[]),Se=y.lastSeq>X;if(X=y.lastSeq,Se&&(J=Date.now()),A){let Re=r==="all"?oe:oe.slice(-1);for(let Ne of Re)try{await A(Ne)}catch(Je){console.warn(`[${this.#p}] ignored a progress update failure:`,Je.message)}}if(y.finished){if(z=!0,!_?.stopRequested&&!tBe(y.reason))throw l3(y.reason);let Re=_?.stopRequested?0:await K();if(y.answer)return y.answer;if(Re>0)return"";throw _?.stopRequested?I3():l3(y.reason)}if(Date.now()-J{})}}async#N(t,{signal:o,onInteraction:a,onResolved:e,onOpen:i,ownership:A}){let r=!1,s=null,g=Promise.resolve(),c=A==null,I=[],p=()=>{},B=m=>{p=m,A&&(A.reconnect=p);try{i?.()}catch(T){console.warn(`[${this.#p}] ignored an interaction open callback failure:`,T.message)}A&&this.#D(t,o).then(()=>{if(!r){c=!0;for(let T of I.splice(0))Q(T)}}).catch(T=>{s??=T,p()})},f=(m,T)=>{m&&(g=g.then(()=>m(T)).catch(_=>{s??=_,p()}))},Q=m=>{let T=m.payload;if(A&&T.type==="session/event"){this.#M(t,[T.event]);return}if(T.type==="question/requested"||T.type==="approval/requested"){let _=T.type==="question/requested"?"question":"approval",R=_==="question"?m.rpcId:T.approvalId,L=`${_}:${R}`;if(A){let F=this.#S(t,L,_);if(F?.ownership!==A)return;this.#B.set(L,F)}let U=_==="approval"&&A&&typeof T.callId=="string"?this.#B.get(L)?.ownership.toolCalls.get(T.callId):void 0;f(a,Object.freeze({kind:_,interactionId:R,rpcId:m.rpcId,sessionId:t,payload:T,recovered:A?this.#B.get(L)?.recovered===!0:!1,...U?{toolCall:U}:{},reconnect:p,respond:(F,q={})=>this.respondInteraction(m.rpcId,F,{...q,signal:q.signal??o})}));return}if(T.type==="question/resolved"||T.type==="approval/resolved"){let _=T.type==="question/resolved"?"question":"approval",R=_==="question"?T.questionRpcId:T.approvalId,L=`${_}:${R}`;if(A){if(this.#B.get(L)?.ownership!==A)return;this.#B.delete(L)}f(e,Object.freeze({kind:_,interactionId:R,sessionId:t,outcome:T.outcome,payload:T}))}},y=m=>{try{let T=m?.payload;if(m?.type!=="server-request"||typeof m.rpcId!="string"||!T||typeof T!="object"||m.method!==T.type)throw new Error("invalid server-request envelope");if(T.sessionId!==t)return;c?Q(m):I.push(m)}catch(T){console.warn(`[${this.#p}] ignored a malformed Harness interaction frame:`,T.message)}};try{await this.#P({signal:o,onOpen:B,onEnvelope:y})}finally{r=!0,A?.reconnect===p&&(A.reconnect=null),o.aborted||await g}if(!o.aborted&&s)throw s}async watchHarnessEvents({signal:t,onSessionEvent:o,onReconnect:a}={}){if(typeof o!="function")throw new TypeError("watchHarnessEvents requires onSessionEvent");if(!t||typeof t.addEventListener!="function")throw new TypeError("watchHarnessEvents requires an AbortSignal");if(a!==void 0&&typeof a!="function")throw new TypeError("onReconnect must be a function");for(;!t.aborted;){try{await this.#P({signal:t,onOpen:()=>{try{a?.()}catch(e){console.warn(`[${this.#p}] mux reconnect hook failed:`,e.message)}},onEnvelope:e=>{try{let i=e?.payload;if(e?.type!=="server-request"||!i||typeof i!="object"||e.method!==i.type||i.type!=="session/event"||typeof i.sessionId!="string"||!i.event||typeof i.event!="object")return;o({sessionId:i.sessionId,event:i.event})}catch(i){console.warn(`[${this.#p}] ignored a malformed global mux frame:`,i.message)}}})}catch(e){if(t.aborted)return;console.warn(`[${this.#p}] Harness event mux disconnected:`,e.message)}if(t.aborted)return;try{await cu(this.#a,t)}catch{if(t.aborted)return;throw new Error("Harness event mux reconnect wait failed")}}}#P(t){return n3({apiProxy:this.#A,baseUrl:this.#e,createWebSocket:this.#i,rpcId:`${this.#s}-${pT()}`,...t,onMalformed:o=>{console.warn(`[${this.#p}] ignored a malformed Harness mux frame:`,o.message)}})}stopManagedProcess(){this.#d?.exitCode===null&&this.#d.kill("SIGTERM")}};var ry=class extends yr{constructor(t){super({...t,rpcIdPrefix:"dingtalk",logPrefix:"dsh-dingtalk"})}};import{mkdir as rBe,readFile as iBe,realpath as aBe,rename as oBe,stat as nBe,unlink as sBe,writeFile as gBe}from"node:fs/promises";import{dirname as cBe,isAbsolute as B3,resolve as Iu}from"node:path";var qtA=Object.freeze(["chat","user_in_chat"]),Wp="user_in_chat";function Zp(n){let t=String(n??"").trim().toLowerCase();return t==="chat"||t==="shared"||t==="shared_chat"?"chat":t==="user_in_chat"||t==="user"||t==="per_user"||t==="member"?"user_in_chat":Wp}function Xp(n){let t=String(n??"").trim().toLowerCase();if(t==="chat"||t==="user_in_chat")return t;let o=new TypeError(`Invalid group session scope: ${String(n)}`);throw o.code="invalid-group-session-scope",o}function E3({kind:n,conversationId:t,senderId:o,groupSessionScope:a=Wp}){let e=String(t??"").trim(),i=String(o??"").trim();if(!e)throw new TypeError("conversationId is required");if(n==="group"){if(Zp(a)==="user_in_chat"){if(!i)throw new TypeError("senderId is required for user_in_chat group sessions");return`group:${e}:user:${i}`}return`group:${e}`}return`direct:${e}`}var rrA=Object.freeze({version:1,workspaces:Object.freeze({})});function qI(n){let t=new Error(n);return t.code=Oi,t}async function ET(n){return Iu(await aBe(n))}async function IBe(n,t){if(n===t)return!0;try{return await ET(n)===await ET(t)}catch{return!1}}function Ut(n){if(typeof n!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(n))throw new TypeError("Invalid bot id");return n}function ha(n,t,o){let a=new Error(t,o);return a.code=n,a}function iy(n){if(typeof n!="string"||!/^[A-Za-z0-9._:@-]{1,128}$/.test(n))throw ha("invalid-target","Invalid target id");return n}function lBe(n){if(!n||typeof n!="object"||Array.isArray(n))throw ha("invalid-target","Invalid target route");try{let t=JSON.stringify(n);if(t===void 0)throw new TypeError("route is not JSON");let o=JSON.parse(t);if(!o||typeof o!="object"||Array.isArray(o))throw new TypeError("route is not an object");return o}catch(t){throw ha("invalid-target","Invalid target route",{cause:t})}}function zI(n,{targetId:t}={}){if(!n||typeof n!="object"||Array.isArray(n))throw ha("invalid-target","Invalid delivery target");let o=t===void 0?new Set(["targetId","name","kind","route"]):new Set(["name","kind","route"]);if(Object.keys(n).some(i=>!o.has(i)))throw ha("invalid-target","Invalid delivery target");let a=iy(t??n.targetId);if(typeof n.kind!="string"||!/^[a-z][a-z0-9-]{0,31}$/.test(n.kind))throw ha("invalid-target","Invalid target kind");let e;if(n.name!==void 0){if(typeof n.name!="string"||!n.name.trim()||n.name.trim().length>80)throw ha("invalid-target","Invalid target name");e=n.name.trim()}return{targetId:a,...e===void 0?{}:{name:e},kind:n.kind,route:lBe(n.route)}}function pBe(n){let t=Object.create(null);if(n===void 0)return t;if(!n||typeof n!="object"||Array.isArray(n))return null;try{for(let[o,a]of Object.entries(n)){if(Ut(o),!a||typeof a!="object"||Array.isArray(a))return null;let e=Object.create(null);for(let[i,A]of Object.entries(a)){let r=zI(A,{targetId:i}),{targetId:s,...g}=r;e[i]=g}t[o]=e}}catch{return null}return t}function dBe(n,t){let o=Object.create(null);if(n===void 0)return o;if(!n||typeof n!="object"||Array.isArray(n)){for(let a of Object.keys(t))o[a]=null;return o}for(let[a,e]of Object.entries(n))try{Ut(a),o[a]=qp(e)}catch{}return o}function hBe(n){if(!n||![1,2].includes(n.version)||!n.workspaces||typeof n.workspaces!="object"||Array.isArray(n.workspaces))return null;let t={};for(let[s,g]of Object.entries(n.workspaces)){if(!/^[A-Za-z0-9_-]{1,128}$/.test(s)||typeof g!="string"||!B3(g))return null;t[s]=Iu(g)}let o={};if(n.agentPresets!==void 0){if(!n.agentPresets||typeof n.agentPresets!="object"||Array.isArray(n.agentPresets))return null;for(let[s,g]of Object.entries(n.agentPresets)){if(!/^[A-Za-z0-9_-]{1,128}$/.test(s))return null;try{let c=Hp(g);if(!c)return null;o[s]=c}catch{return null}}}let a={};if(n.groupSessionScopes!==void 0){if(!n.groupSessionScopes||typeof n.groupSessionScopes!="object"||Array.isArray(n.groupSessionScopes))return null;for(let[s,g]of Object.entries(n.groupSessionScopes)){if(!/^[A-Za-z0-9_-]{1,128}$/.test(s))return null;try{a[s]=Xp(g)}catch{return null}}}let e=Object.create(null);if(n.contextEnhancement&&typeof n.contextEnhancement=="object"&&!Array.isArray(n.contextEnhancement))for(let[s,g]of Object.entries(n.contextEnhancement))/^[A-Za-z0-9_-]{1,128}$/.test(s)&&(e[s]=xp(g));if(n.version===1&&n.deliveryTargets!==void 0)return null;let i=pBe(n.deliveryTargets);if(!i)return null;let A=dBe(n.accessPolicies,t);return{version:n.accessPolicies===void 0?n.version:2,workspaces:t,agentPresets:o,groupSessionScopes:a,contextEnhancement:e,deliveryTargets:i,accessPolicies:A}}function EBe({version:n,workspaces:t,agentPresets:o,groupSessionScopes:a,contextEnhancement:e,deliveryTargets:i,accessPolicies:A}){let r={version:n,workspaces:t};return Object.keys(o).length>0&&(r.agentPresets=o),Object.keys(a).length>0&&(r.groupSessionScopes=a),Object.keys(e).length>0&&(r.contextEnhancement=e),n>=2&&Object.keys(i).length>0&&(r.deliveryTargets=i),n>=2&&Object.keys(A).length>0&&(r.accessPolicies=A),r}async function uBe(n,t){await rBe(cBe(n),{recursive:!0,mode:448});let o=`${n}.tmp`;await gBe(o,`${JSON.stringify(t,null,2)} +`).trim();I&&I!==this.#o&&(this.#o=I,a({type:"text",text:I}));continue}if(i.type==="assistant/message"){let r=eBe(i);r&&r!==this.#o&&(this.#o=r,a({type:"text",text:r}));continue}if(i.type==="tool/call"){let r=Ga(i.data?.name)??w("\u5DE5\u5177"),s=Ga(i.data?.callId)??Ga(i.data?.subCallId);s&&this.#a.set(s,r),this.#s=r,a({type:"tool",name:r,...s?{callId:s}:{}})}else if(i.type==="tool/result"){let r=Ga(i.data?.message?.source?.callId)??Ga(i.data?.callId)??Ga(i.data?.subCallId),s=(r?this.#a.get(r):null)??this.#s,g=ABe(i.data?.error);a({type:"status",text:w("\u6B63\u5728\u6574\u7406\u7ED3\u679C\u2026"),...s?{toolName:s}:{},...g?{error:g}:{}})}}}}}return o}consume(t){return this.consumeAll(t).at(-1)??null}},Dn=class extends Error{constructor(t,o){super(`${t}: ${o?.message??"unknown Harness RPC error"}`),this.name="HarnessRpcError",this.method=t,this.code=o?.code??"internal",this.details=o?.details??{}}},ps=class extends Error{constructor(t,o,{cause:a,status:e}={}){let i=Number.isInteger(e)?`, HTTP ${e}`:"";super(`Harness ${o} transport failed (${t}${i})`,{cause:a}),this.name="HarnessTransportError",this.code=t,this.method=o,Number.isInteger(e)&&(this.status=e)}},hT=class extends Error{constructor(t){super("Harness health RPC was rejected",{cause:t}),this.name="HarnessHealthError",this.code="harness-rpc-rejected",this.method="host.describe"}},Vp=class extends Error{constructor(t,o){super(o),this.name="HarnessInteractionError",this.code=t}},ds=class extends Error{constructor(t,{reason:o,providerCode:a}={}){super(`Harness turn failed (${t})`),this.name="HarnessTurnError",this.code=t,this.promptAccepted=!0,o&&typeof o=="object"&&(this.reason=o),typeof a=="string"&&a&&(this.providerCode=a)}};function l3(n){let t=Ga(n?.kind)??Ga(n);if(t==="error"){let o=n?.error??n?.failure;return new ds("harness-turn-failed",{reason:n,providerCode:Ga(o?.code)??void 0})}return t==="max-tokens"?new ds("model-max-tokens",{reason:n}):t==="blocked"?new ds("turn-blocked",{reason:n}):["interrupted","stopped","cancelled","canceled"].includes(t)?new ds("turn-interrupted",{reason:n}):t==="aborted"?new ds("turn-aborted",{reason:n}):t==="completed"?new ds("model-empty-response",{reason:n}):new ds("harness-turn-failed",{reason:n})}function tBe(n){return n==null?!0:(Ga(n?.kind)??Ga(n))==="completed"}var yr=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g;#l;#n;#h;#d=null;#C;#u;#B;#f;constructor({baseUrl:t,apiProxy:o,interactionScope:a=o,workspace:e,agentPreset:i,autostart:A=!1,dshBin:r="dsh",fetchImpl:s=fetch,createWebSocket:g=m=>new WebSocket(m),interactionReconnectDelayMs:c=500,rpcIdPrefix:I="im",logPrefix:p="dsh-im",commandExecutor:B,controlExecutor:f,sessionMaintenanceExecutor:Q,fileIngressExecutor:y}){if(typeof g!="function")throw new TypeError("createWebSocket must be a function");if(!Number.isFinite(c)||c<0)throw new TypeError("interactionReconnectDelayMs must be a non-negative number");if(typeof I!="string"||!I.trim())throw new TypeError("rpcIdPrefix must be a non-empty string");if(typeof p!="string"||!p.trim())throw new TypeError("logPrefix must be a non-empty string");if(B!==void 0&&typeof B!="function")throw new TypeError("commandExecutor must be a function");if(f!==void 0&&typeof f!="function")throw new TypeError("controlExecutor must be a function");if(Q!==void 0&&typeof Q!="function")throw new TypeError("sessionMaintenanceExecutor must be a function");if(y!==void 0&&typeof y!="function")throw new TypeError("fileIngressExecutor must be a function");if(this.#e=t===void 0?null:new URL(t),this.#A=this.#e?null:o,!this.#e&&(!this.#A||typeof this.#A!="object"))throw new TypeError("HarnessClient requires the current Host apiProxy or an explicit baseUrl");if(this.#A&&(!a||!["object","function"].includes(typeof a)))throw new TypeError("interactionScope must identify the current Host");this.#t=e,this.#r=i??void 0,this.#I=!!(this.#e&&A),this.#o=r,this.#c=s,this.#i=g,this.#a=c,this.#s=I.trim(),this.#p=p.trim(),this.#g=B,this.#l=f,this.#n=Q,this.#h=y,this.#C=p3(this.#e?.origin??a),this.#u=this.#C.ownerships,this.#B=this.#C.claims,this.#f=this.#C.controls}async rpc(t,o={},a=3e4,e={}){let i=e.rpcId??`${this.#s}-${pT()}`,A=AbortSignal.timeout(a),r=e.signal?AbortSignal.any([e.signal,A]):A,s;try{if(this.#A){let[g,c,I]=t.split("."),p={host:"host",workspace:"workspace",session:"sessions",llm:"llm"}[g],B=p&&this.#A[p];if(I!==void 0||!Object.hasOwn(B??{},c)||typeof B[c]!="function")throw new ps("harness-api-not-found",t);s={type:"server-response",...await s3(()=>B[c]({rpcId:i,payload:o},r),r)}}else{let g=await this.#c(new URL(`/api/${t}`,this.#e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({type:"client-request",rpcId:i,method:t,payload:o}),signal:r});if(!g.ok){let c=await qCe(g,this.#e.hostname);throw new ps(c,t,{status:g.status})}try{s=await g.json()}catch(c){throw new ps("harness-response-invalid",t,{cause:c})}}}catch(g){throw e.signal?.aborted||g instanceof ps?g:new ps(A.aborted?"harness-timeout":"harness-connect-failed",t,{cause:g})}if(s?.type!=="server-response"||s?.rpcId!==i)throw new ps("harness-response-invalid",t,{cause:new Error(`Harness returned an invalid response for ${t}`)});if(!s.result||typeof s.result!="object"||typeof s.result.ok!="boolean")throw new ps("harness-response-invalid",t,{cause:new Error(`Harness returned an invalid result for ${t}`)});if(!s.result?.ok)throw new Dn(t,s.result?.error);return s.result.value}async health(t={}){try{return await this.rpc("host.describe",{},5e3,t),!0}catch(o){throw o instanceof Dn?new hT(o):o}}async ensureRunning(t={}){try{return await this.health(t)}catch(e){if(!this.#I)throw e}if(!this.#d||this.#d.exitCode!==null){let e=this.#e.port||(this.#e.protocol==="https:"?"443":"80");this.#d=UCe(this.#o,["web","--host",this.#e.hostname,"--port",e],{cwd:this.#t,env:process.env,stdio:["ignore","inherit","inherit"]}),this.#d.on("error",i=>{console.error(`[${this.#p}] failed to start Harness:`,i.message)})}let o=Date.now()+6e4,a;for(;Date.now(){let r=A&&a.signal?AbortSignal.any([A,a.signal]):A??a.signal;return this.rpc("session.selectModel",{sessionId:t,provider:o.provider,model:o.model,...o.reasoningEffort===void 0?{}:{reasoningEffort:o.reasoningEffort}},3e4,r?{...a,signal:r}:a)},i=this.#n?await this.#n({sessionId:t,operation:e}):await e();if(!i||typeof i!="object"||!dT(i.selected))throw new Error("Harness returned an invalid response for session.selectModel");return i}async isSessionRunning(t,o={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");await this.ensureRunning(o);let a=await this.rpc("session.list",{},3e4,o);if(!a||typeof a!="object"||!Array.isArray(a.items))throw new Error("Harness returned an invalid response for session.list");for(let e of a.items)if(!e||typeof e!="object"||typeof e.sessionId!="string"||!e.sessionId||typeof e.running!="boolean")throw new Error("Harness returned an invalid response for session.list");return a.items.find(e=>e.sessionId===t)?.running??!1}async adoptWorkspaceSession(t,o={}){return o3(this,t,o)}async workspaceId(t={}){let{workspace:o=this.#t,...a}=t,{items:e}=await this.rpc("workspace.list",{},3e4,a),i=e.find(r=>r.path===o);return i?i.workspaceId:(await this.rpc("workspace.create",{path:o},3e4,a)).workspace.workspaceId}async createSession(t={}){let{agentPreset:o,...a}=t;await this.ensureRunning(a);let i={workspaceId:await this.workspaceId(a)},A=o!==void 0?o:this.#r;return A!=null&&(i.agentPreset=A),(await this.rpc("session.create",i,3e4,a)).sessionId}async renameSession(t,o,a={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(typeof o!="string"||!o.trim())throw new TypeError("session title is required");return this.rpc("session.rename",{sessionId:t,title:o},3e4,a)}async executeCommand(t,o,a={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(typeof o!="string"||!o)throw new TypeError("command line is required");if(!this.#g){let e=new Error("Harness command execution is unavailable");throw e.code="commands-unavailable",e}try{return await this.#g(t,o,a)}catch(e){throw e?.failure&&typeof e.failure=="object"?new Dn("commands.execute",e.failure):e}}async readSessionHistory(t,{maxMessages:o=50,beforeSeq:a,timeoutMs:e=1e4,...i}={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(!Number.isSafeInteger(o)||o<1||a!==void 0&&(!Number.isSafeInteger(a)||a<0))throw new TypeError("Invalid history pagination");return this.rpc("session.history",{sessionId:t,maxMessages:o,...a===void 0?{}:{beforeSeq:a}},e,i)}async sessionExists(t,o={}){try{return await this.rpc("session.history",{sessionId:t,maxMessages:1},3e4,o),!0}catch(a){if(a instanceof Dn&&a.code==="session-not-found")return!1;throw a}}async respondInteraction(t,o,a={}){if(typeof t!="string"||!t)throw new TypeError("rpcId is required");if(!o||typeof o!="object"||typeof o.ok!="boolean")throw new TypeError("A Harness RPC result is required");let e=AbortSignal.timeout(a.timeoutMs??3e4),i=a.signal?AbortSignal.any([a.signal,e]):e,A={type:"client-response",rpcId:t,result:o},r;if(this.#A)r=await s3(()=>this.#A.respond(A),i);else{let g=await this.#c(new URL("/api/respond",this.#e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(A),signal:i});if(!g.ok)throw new Error(`Harness transport respond failed: HTTP ${g.status}`);r=await g.json()}if(r?.accepted===!0)return r;if(r?.accepted!==!1||r.reason!=="bad-response"&&r.reason!=="not-pending")throw new Error("Harness returned an invalid interaction response receipt");let s=r.reason;throw new Vp(`interaction-${s}`,`Harness interaction response was rejected (${s})`)}async watchInteractions(t,{signal:o,onInteraction:a,onResolved:e,onOpen:i,ownership:A}={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(!o||typeof o.addEventListener!="function")throw new TypeError("watchInteractions requires an AbortSignal");if(a!==void 0&&typeof a!="function")throw new TypeError("onInteraction must be a function");if(e!==void 0&&typeof e!="function")throw new TypeError("onResolved must be a function");if(i!==void 0&&typeof i!="function")throw new TypeError("onOpen must be a function");for(;!o.aborted;){try{await this.#N(t,{signal:o,onInteraction:a,onResolved:e,onOpen:i,ownership:A})}catch(r){if(o.aborted)return;console.warn(`[${this.#p}] Harness interaction stream disconnected:`,r.message)}if(o.aborted)return;try{await cu(this.#a,o)}catch{if(o.aborted)return;throw new Error("Harness interaction reconnect wait failed")}}}#m(t,o){let a=this.#u.get(t)??new Set;o.order=this.#C.nextOrder,this.#C.nextOrder+=1,a.add(o),this.#u.set(t,a)}#w(t,o){let a=this.#u.get(t);a?.delete(o),a?.size===0&&this.#u.delete(t);for(let[e,i]of this.#B)i.ownership===o&&this.#B.delete(e)}#Q(t){if(!t.control)return;let o=this.#f.get(t.control.owner);o||(o=new Map,this.#f.set(t.control.owner,o));let a=o.get(t.control.key)??new Set;a.add(t),o.set(t.control.key,a)}#y(t){if(!t.control)return;let o=this.#f.get(t.control.owner),a=o?.get(t.control.key);a?.delete(t),a?.size===0&&o.delete(t.control.key),o?.size===0&&this.#f.delete(t.control.owner)}#b(t,o){let a=g3(o);return a?[...this.#f.get(a.owner)?.get(a.key)??[]].filter(i=>i.sessionId===t).sort((i,A)=>i.order-A.order):[]}#E(t,o){return this.#b(t,o).find(a=>a.started&&a.active&&!a.completed&&a.turn!==null)??null}async#k(t,o,a){let e=this.#b(t,o);if(e.length===0)return null;try{let i=await this.rpc("session.history",{sessionId:t,maxMessages:50},3e4,a);this.#M(t,i.events??[])}catch(i){if(!(i instanceof Dn)||i.code!=="session-not-found")throw i;for(let A of e)A.active=!1,A.completed=!0;return null}return this.#E(t,o)}async hasActiveTurn(t,o,a={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");return!!await this.#k(t,o,a)}async stopActiveTurn(t,o,a={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");let e=await this.#k(t,o,a);if(!e)return!1;if(e.stopRequested)return!0;if(this.#E(t,o)!==e)return!1;e.stopRequested=!0;try{if(this.#l){let i=this.#l({sessionId:t,expectedTurn:e.turn,promptRpcId:e.promptRpcId,action:"stop"});if(i&&typeof i.then=="function")throw new TypeError("controlExecutor must return synchronously");if(i!==void 0){if(typeof i!="boolean")throw new TypeError("controlExecutor must return a boolean or undefined");return i||(e.stopRequested=!1),i}}return await this.rpc("session.cancel",{sessionId:t,keepInbox:!0},3e4,a),!0}catch(i){if(this.#E(t,o)===e&&(e.stopRequested=!1),i instanceof Dn&&i.code==="session-not-found")return!1;throw i}}async steerActiveTurn(t,o,a,e={}){if(typeof t!="string"||!t)throw new TypeError("sessionId is required");if(typeof o!="string"||!o.trim())throw new TypeError("Steering text is required");let i=await this.#k(t,a,e);if(!i||i.stopRequested||this.#E(t,a)!==i)return!1;if(this.#l){let A=this.#l({sessionId:t,expectedTurn:i.turn,promptRpcId:i.promptRpcId,action:"steer",text:o});if(A&&typeof A.then=="function")throw new TypeError("controlExecutor must return synchronously");if(A!==void 0){if(typeof A!="boolean")throw new TypeError("controlExecutor must return a boolean or undefined");return A}}return await this.rpc("session.prompt",{sessionId:t,mode:"steer",content:[{type:"text",text:o}],clientTimeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},3e4,e),!0}#M(t,o){for(let a of this.#u.get(t)??[])d3(a,o)}async#D(t,o){let a=await this.rpc("session.history",{sessionId:t,maxMessages:50},3e4,{signal:o});this.#M(t,a.events??[])}#S(t,o,a){let e=this.#B.get(o);if(e&&this.#u.get(t)?.has(e.ownership))return e;let i=[...this.#u.get(t)??[]],A=i.filter(s=>s.active).sort((s,g)=>s.order-g.order);if(A.length>0)return{ownership:A[0],recovered:!1};let r=i.filter(s=>!s.started&&!s.completed).sort((s,g)=>s.order-g.order)[0]??null;return r?{ownership:r,recovered:!0}:null}async#T(t,o,a){if(!this.#h)throw new Go("inbound-file-ingress-unavailable","Harness file ingress is unavailable in this Host process.");let i=(await this.rpc("session.list",{},3e4,{signal:a}))?.items?.find(A=>A?.sessionId===t)?.cwd;return this.#h({sessionId:t,workspace:i,files:o,signal:a})}async ask(t,o,a={}){typeof a=="number"&&(a={timeoutMs:a});let e=a.timeoutMs??6e5,i=a.signal,A=typeof a.onUpdate=="function"?a.onUpdate:null,r=a.progressMode==="all"?"all":"latest",s=typeof a.onArtifact=="function"?a.onArtifact:null,g=typeof a.onInteraction=="function"?a.onInteraction:void 0,c=typeof a.onInteractionResolved=="function"?a.onInteractionResolved:void 0,I=g3(a.control),p=Array.isArray(a.files)?a.files.filter(Boolean):[];await this.ensureRunning({signal:i});let B=await this.rpc("session.history",{sessionId:t,maxMessages:1},3e4,{signal:i}),f=Math.max(-1,...(B.events??[]).map(({event:V})=>V.seq??-1)),Q=`${this.#s}-${pT()}`,y=new zp({promptRpcId:Q,afterSeq:f}),m=g||c?new AbortController:null,T=m?i?AbortSignal.any([i,m.signal]):m.signal:null,_=m||I?{sessionId:t,promptRpcId:Q,active:!1,started:!1,completed:!1,stopRequested:!1,turn:null,openTurn:null,lastSeq:f,reconnect:null,order:-1,toolCalls:new Map,control:I}:null,R=null,L=!1,U=0,F=[],q=!1,z=!1,K=async()=>{if(!s||L||y.turn===null)return U;L=!0;let V=JI.take(t,y.turn,{signal:i});for(let H of V)try{await s(H),U+=1}catch(N){JI.release(H),console.warn(`[${this.#p}] ignored an artifact handoff failure:`,N.message)}return U};_&&(this.#m(t,_),this.#Q(_));let G=JI.openConsumer(t,Q);try{let V=o;if(p.length>0){let J=await this.#T(t,p,i);F.push(J),o=$_(o,J)}if(T){let J,X=new Promise(ie=>{J=ie});R=this.watchInteractions(t,{signal:T,onInteraction:g,onResolved:c,onOpen:J,ownership:_}),R.catch(()=>{}),await Promise.race([X,cu(3e4,T).then(()=>{throw new Error("Harness interaction stream did not open within 30 seconds")})])}let H=typeof o=="string"?[{type:"text",text:o}]:o;if(!Array.isArray(H)||H.length===0)throw new TypeError("Harness prompt content is required");let N=Intl.DateTimeFormat().resolvedOptions().timeZone,k=J=>this.rpc("session.prompt",{sessionId:t,mode:"queue",content:J,clientTimeZone:N},3e4,{rpcId:Q,signal:i});try{await k(H)}catch(J){let X=dY(J)?lY(H):[];if(X.length===0)throw J;let ie;try{ie=await this.#T(t,X,i)}catch(Se){throw i?.aborted?i.reason??Se:(console.warn(`[${this.#p}] unable to restage rejected images as workspace files:`,Se?.message??String(Se)),J)}F.push(ie);let oe=$_([...pY(typeof V=="string"?[{type:"text",text:V}]:V),{type:"text",text:w(cY)}],{files:F.flatMap(Se=>Se?.files??[])});await k(oe)}q=!0;try{let J=Date.now(),X=y.lastSeq;for(;;){await cu(300,i);let ie=await this.rpc("session.history",{sessionId:t,maxMessages:50},3e4,{signal:i}),De=_?.active===!0;_&&(this.#M(t,ie.events??[]),!De&&_.active&&_.reconnect?.());let oe=y.consumeAll(ie.events??[]),Se=y.lastSeq>X;if(X=y.lastSeq,Se&&(J=Date.now()),A){let Re=r==="all"?oe:oe.slice(-1);for(let Ne of Re)try{await A(Ne)}catch(Je){console.warn(`[${this.#p}] ignored a progress update failure:`,Je.message)}}if(y.finished){if(z=!0,!_?.stopRequested&&!tBe(y.reason))throw l3(y.reason);let Re=_?.stopRequested?0:await K();if(y.answer)return y.answer;if(Re>0)return"";throw _?.stopRequested?I3():l3(y.reason)}if(Date.now()-J{})}}async#N(t,{signal:o,onInteraction:a,onResolved:e,onOpen:i,ownership:A}){let r=!1,s=null,g=Promise.resolve(),c=A==null,I=[],p=()=>{},B=m=>{p=m,A&&(A.reconnect=p);try{i?.()}catch(T){console.warn(`[${this.#p}] ignored an interaction open callback failure:`,T.message)}A&&this.#D(t,o).then(()=>{if(!r){c=!0;for(let T of I.splice(0))Q(T)}}).catch(T=>{s??=T,p()})},f=(m,T)=>{m&&(g=g.then(()=>m(T)).catch(_=>{s??=_,p()}))},Q=m=>{let T=m.payload;if(A&&T.type==="session/event"){this.#M(t,[T.event]);return}if(T.type==="question/requested"||T.type==="approval/requested"){let _=T.type==="question/requested"?"question":"approval",R=_==="question"?m.rpcId:T.approvalId,L=`${_}:${R}`;if(A){let F=this.#S(t,L,_);if(F?.ownership!==A)return;this.#B.set(L,F)}let U=_==="approval"&&A&&typeof T.callId=="string"?this.#B.get(L)?.ownership.toolCalls.get(T.callId):void 0;f(a,Object.freeze({kind:_,interactionId:R,rpcId:m.rpcId,sessionId:t,payload:T,recovered:A?this.#B.get(L)?.recovered===!0:!1,...U?{toolCall:U}:{},reconnect:p,respond:(F,q={})=>this.respondInteraction(m.rpcId,F,{...q,signal:q.signal??o})}));return}if(T.type==="question/resolved"||T.type==="approval/resolved"){let _=T.type==="question/resolved"?"question":"approval",R=_==="question"?T.questionRpcId:T.approvalId,L=`${_}:${R}`;if(A){if(this.#B.get(L)?.ownership!==A)return;this.#B.delete(L)}f(e,Object.freeze({kind:_,interactionId:R,sessionId:t,outcome:T.outcome,payload:T}))}},y=m=>{try{let T=m?.payload;if(m?.type!=="server-request"||typeof m.rpcId!="string"||!T||typeof T!="object"||m.method!==T.type)throw new Error("invalid server-request envelope");if(T.sessionId!==t)return;c?Q(m):I.push(m)}catch(T){console.warn(`[${this.#p}] ignored a malformed Harness interaction frame:`,T.message)}};try{await this.#P({signal:o,onOpen:B,onEnvelope:y})}finally{r=!0,A?.reconnect===p&&(A.reconnect=null),o.aborted||await g}if(!o.aborted&&s)throw s}async watchHarnessEvents({signal:t,onSessionEvent:o,onReconnect:a}={}){if(typeof o!="function")throw new TypeError("watchHarnessEvents requires onSessionEvent");if(!t||typeof t.addEventListener!="function")throw new TypeError("watchHarnessEvents requires an AbortSignal");if(a!==void 0&&typeof a!="function")throw new TypeError("onReconnect must be a function");for(;!t.aborted;){try{await this.#P({signal:t,onOpen:()=>{try{a?.()}catch(e){console.warn(`[${this.#p}] mux reconnect hook failed:`,e.message)}},onEnvelope:e=>{try{let i=e?.payload;if(e?.type!=="server-request"||!i||typeof i!="object"||e.method!==i.type||i.type!=="session/event"||typeof i.sessionId!="string"||!i.event||typeof i.event!="object")return;o({sessionId:i.sessionId,event:i.event})}catch(i){console.warn(`[${this.#p}] ignored a malformed global mux frame:`,i.message)}}})}catch(e){if(t.aborted)return;console.warn(`[${this.#p}] Harness event mux disconnected:`,e.message)}if(t.aborted)return;try{await cu(this.#a,t)}catch{if(t.aborted)return;throw new Error("Harness event mux reconnect wait failed")}}}#P(t){return n3({apiProxy:this.#A,baseUrl:this.#e,createWebSocket:this.#i,rpcId:`${this.#s}-${pT()}`,...t,onMalformed:o=>{console.warn(`[${this.#p}] ignored a malformed Harness mux frame:`,o.message)}})}stopManagedProcess(){this.#d?.exitCode===null&&this.#d.kill("SIGTERM")}};var ry=class extends yr{constructor(t){super({...t,rpcIdPrefix:"dingtalk",logPrefix:"dsh-dingtalk"})}};import{mkdir as rBe,readFile as iBe,realpath as aBe,rename as oBe,stat as nBe,unlink as sBe,writeFile as gBe}from"node:fs/promises";import{dirname as cBe,isAbsolute as B3,resolve as Iu}from"node:path";var WtA=Object.freeze(["chat","user_in_chat"]),Wp="user_in_chat";function Zp(n){let t=String(n??"").trim().toLowerCase();return t==="chat"||t==="shared"||t==="shared_chat"?"chat":t==="user_in_chat"||t==="user"||t==="per_user"||t==="member"?"user_in_chat":Wp}function Xp(n){let t=String(n??"").trim().toLowerCase();if(t==="chat"||t==="user_in_chat")return t;let o=new TypeError(`Invalid group session scope: ${String(n)}`);throw o.code="invalid-group-session-scope",o}function E3({kind:n,conversationId:t,senderId:o,groupSessionScope:a=Wp}){let e=String(t??"").trim(),i=String(o??"").trim();if(!e)throw new TypeError("conversationId is required");if(n==="group"){if(Zp(a)==="user_in_chat"){if(!i)throw new TypeError("senderId is required for user_in_chat group sessions");return`group:${e}:user:${i}`}return`group:${e}`}return`direct:${e}`}var orA=Object.freeze({version:1,workspaces:Object.freeze({})});function qI(n){let t=new Error(n);return t.code=Oi,t}async function ET(n){return Iu(await aBe(n))}async function IBe(n,t){if(n===t)return!0;try{return await ET(n)===await ET(t)}catch{return!1}}function Ut(n){if(typeof n!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(n))throw new TypeError("Invalid bot id");return n}function ha(n,t,o){let a=new Error(t,o);return a.code=n,a}function iy(n){if(typeof n!="string"||!/^[A-Za-z0-9._:@-]{1,128}$/.test(n))throw ha("invalid-target","Invalid target id");return n}function lBe(n){if(!n||typeof n!="object"||Array.isArray(n))throw ha("invalid-target","Invalid target route");try{let t=JSON.stringify(n);if(t===void 0)throw new TypeError("route is not JSON");let o=JSON.parse(t);if(!o||typeof o!="object"||Array.isArray(o))throw new TypeError("route is not an object");return o}catch(t){throw ha("invalid-target","Invalid target route",{cause:t})}}function zI(n,{targetId:t}={}){if(!n||typeof n!="object"||Array.isArray(n))throw ha("invalid-target","Invalid delivery target");let o=t===void 0?new Set(["targetId","name","kind","route"]):new Set(["name","kind","route"]);if(Object.keys(n).some(i=>!o.has(i)))throw ha("invalid-target","Invalid delivery target");let a=iy(t??n.targetId);if(typeof n.kind!="string"||!/^[a-z][a-z0-9-]{0,31}$/.test(n.kind))throw ha("invalid-target","Invalid target kind");let e;if(n.name!==void 0){if(typeof n.name!="string"||!n.name.trim()||n.name.trim().length>80)throw ha("invalid-target","Invalid target name");e=n.name.trim()}return{targetId:a,...e===void 0?{}:{name:e},kind:n.kind,route:lBe(n.route)}}function pBe(n){let t=Object.create(null);if(n===void 0)return t;if(!n||typeof n!="object"||Array.isArray(n))return null;try{for(let[o,a]of Object.entries(n)){if(Ut(o),!a||typeof a!="object"||Array.isArray(a))return null;let e=Object.create(null);for(let[i,A]of Object.entries(a)){let r=zI(A,{targetId:i}),{targetId:s,...g}=r;e[i]=g}t[o]=e}}catch{return null}return t}function dBe(n,t){let o=Object.create(null);if(n===void 0)return o;if(!n||typeof n!="object"||Array.isArray(n)){for(let a of Object.keys(t))o[a]=null;return o}for(let[a,e]of Object.entries(n))try{Ut(a),o[a]=qp(e)}catch{}return o}function hBe(n){if(!n||![1,2].includes(n.version)||!n.workspaces||typeof n.workspaces!="object"||Array.isArray(n.workspaces))return null;let t={};for(let[s,g]of Object.entries(n.workspaces)){if(!/^[A-Za-z0-9_-]{1,128}$/.test(s)||typeof g!="string"||!B3(g))return null;t[s]=Iu(g)}let o={};if(n.agentPresets!==void 0){if(!n.agentPresets||typeof n.agentPresets!="object"||Array.isArray(n.agentPresets))return null;for(let[s,g]of Object.entries(n.agentPresets)){if(!/^[A-Za-z0-9_-]{1,128}$/.test(s))return null;try{let c=Hp(g);if(!c)return null;o[s]=c}catch{return null}}}let a={};if(n.groupSessionScopes!==void 0){if(!n.groupSessionScopes||typeof n.groupSessionScopes!="object"||Array.isArray(n.groupSessionScopes))return null;for(let[s,g]of Object.entries(n.groupSessionScopes)){if(!/^[A-Za-z0-9_-]{1,128}$/.test(s))return null;try{a[s]=Xp(g)}catch{return null}}}let e=Object.create(null);if(n.contextEnhancement&&typeof n.contextEnhancement=="object"&&!Array.isArray(n.contextEnhancement))for(let[s,g]of Object.entries(n.contextEnhancement))/^[A-Za-z0-9_-]{1,128}$/.test(s)&&(e[s]=xp(g));if(n.version===1&&n.deliveryTargets!==void 0)return null;let i=pBe(n.deliveryTargets);if(!i)return null;let A=dBe(n.accessPolicies,t);return{version:n.accessPolicies===void 0?n.version:2,workspaces:t,agentPresets:o,groupSessionScopes:a,contextEnhancement:e,deliveryTargets:i,accessPolicies:A}}function EBe({version:n,workspaces:t,agentPresets:o,groupSessionScopes:a,contextEnhancement:e,deliveryTargets:i,accessPolicies:A}){let r={version:n,workspaces:t};return Object.keys(o).length>0&&(r.agentPresets=o),Object.keys(a).length>0&&(r.groupSessionScopes=a),Object.keys(e).length>0&&(r.contextEnhancement=e),n>=2&&Object.keys(i).length>0&&(r.deliveryTargets=i),n>=2&&Object.keys(A).length>0&&(r.accessPolicies=A),r}async function uBe(n,t){await rBe(cBe(n),{recursive:!0,mode:448});let o=`${n}.tmp`;await gBe(o,`${JSON.stringify(t,null,2)} `,{encoding:"utf8",mode:384}),await oBe(o,n)}async function u3(n){if(typeof n!="string"||!n.trim()||!B3(n.trim())){let a=new Error("\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002");throw a.code="workspace-not-absolute",a}let t=Iu(n.trim()),o;try{o=await nBe(t)}catch(a){let e=new Error("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002",{cause:a});throw e.code="workspace-not-found",e}if(!o.isDirectory()){let a=new Error("\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5FC5\u987B\u6307\u5411\u4E00\u4E2A\u76EE\u5F55\u3002");throw a.code="workspace-not-directory",a}return t}var ni=class{#e;#A;#t=1;#r={};#I={};#o={};#c={};#i=Object.create(null);#a=Object.create(null);#s=new Map;#p=1;#g=new Map;#l=1;#n=new Map;#h=new WeakMap;#d=new Set;#C=Promise.resolve();#u=new Map;constructor(t,{defaultWorkspace:o=process.cwd()}={}){if(typeof t!="string"||!t)throw new TypeError("workspace store path is required");this.#e=t,this.#A=Iu(o)}async load(){try{let t=hBe(JSON.parse(await iBe(this.#e,"utf8")));if(!t)throw new Error("dsh-im workspace config is invalid");this.#t=t.version,this.#r=t.workspaces,this.#I=t.agentPresets,this.#o=t.groupSessionScopes,this.#c=t.contextEnhancement,this.#i=t.deliveryTargets,this.#a=t.accessPolicies}catch(t){if(t?.code!=="ENOENT")throw t;this.#t=1,this.#r={},this.#I={},this.#o={},this.#c={},this.#i=Object.create(null),this.#a=Object.create(null)}this.#s.clear(),this.#p=1,this.#g.clear(),this.#l=1,this.#n.clear(),this.#d.clear();for(let t of Object.keys(this.#r))this.#s.set(t,this.#B()),this.#g.set(t,this.#f());return this}has(t){let o=Ut(t);return Object.hasOwn(this.#r,o)&&!this.#n.has(o)}incarnationFor(t){return this.#g.get(Ut(t))??null}workspaceFor(t){return this.#r[Ut(t)]??this.#A}agentPresetFor(t){return this.#I[Ut(t)]??null}groupSessionScopeFor(t){let o=Ut(t);return this.has(o)&&Object.hasOwn(this.#o,o)?Zp(this.#o[o]):Wp}contextEnhancementFor(t){let o=Ut(t);return this.has(o)&&Object.hasOwn(this.#c,o)?this.#c[o]:V_}accessPolicyFor(t){let o=Ut(t);return this.has(o)&&Object.hasOwn(this.#a,o)?this.#a[o]:null}listDeliveryTargets(t){let o=Ut(t);if(!this.has(o))throw ha("unknown-bot","Unknown bot");return Object.entries(this.#i[o]??{}).map(([a,e])=>zI(e,{targetId:a})).sort((a,e)=>a.targetId.localeCompare(e.targetId))}deliveryTargetFor(t,o){let a=Ut(t),e=iy(o);if(!this.has(a))throw ha("unknown-bot","Unknown bot");let i=this.#i[a]?.[e];return i?zI(i,{targetId:e}):null}async createDeliveryTarget(t,o){let a=Ut(t),e=zI(o);return this.#Q(a,async()=>{if(!this.has(a))throw ha("unknown-bot","Unknown bot");if(Object.hasOwn(this.#i[a]??{},e.targetId))throw ha("target-conflict","Target already exists");let{targetId:i,...A}=e,r={...this.#i,[a]:{...this.#i[a]??{},[i]:A}};return await this.#y(this.#c,r,2),this.#i=r,this.#t=2,zI(A,{targetId:i})})}async updateDeliveryTarget(t,o,a){let e=Ut(t),i=iy(o),A=zI(a,{targetId:i});return this.#Q(e,async()=>{if(!this.has(e))throw ha("unknown-bot","Unknown bot");if(!Object.hasOwn(this.#i[e]??{},i))throw ha("unknown-target","Unknown target");let{targetId:r,...s}=A,g={...this.#i,[e]:{...this.#i[e],[i]:s}};return await this.#y(this.#c,g,2),this.#i=g,this.#t=2,zI(s,{targetId:i})})}async deleteDeliveryTarget(t,o){let a=Ut(t),e=iy(o);return this.#Q(a,async()=>{if(!this.has(a))throw ha("unknown-bot","Unknown bot");if(!Object.hasOwn(this.#i[a]??{},e))throw ha("unknown-target","Unknown target");let i={...this.#i[a]};delete i[e];let A={...this.#i};return Object.keys(i).length>0?A[a]=i:delete A[a],await this.#y(this.#c,A,2),this.#i=A,this.#t=2,!0})}generationFor(t){return this.#s.get(Ut(t))??null}async whenIdle(){await this.#C}async whenBotIdle(t){let o=Ut(t);for(;;){let a=this.#u.get(o);if(!a||(await a,this.#u.get(o)===a))return}}async ensure(t,{workspace:o=this.#A,defaultAgentPreset:a,initialAccessPolicy:e}={}){let i=Ut(t),A=Iu(o);return this.#Q(i,async()=>{let r=!this.#r[i],s=e!==void 0&&!Object.hasOwn(this.#a,i);if(r||s){let g=s?fc(e):void 0,c=r?Hp(a):null,I=Object.hasOwn(this.#I,i),p=this.#I[i],B=s?{...this.#a,[i]:g}:this.#a;r&&(this.#r[i]=A,c&&(this.#I[i]=c),this.#s.set(i,this.#B()),this.#g.set(i,this.#f()));let f=s?2:this.#t;try{await this.#y(this.#c,this.#i,f,B)}catch(Q){throw r&&(delete this.#r[i],I?this.#I[i]=p:delete this.#I[i],this.#s.delete(i),this.#g.delete(i)),Q}this.#a=B,this.#t=f}else this.#s.has(i)||this.#s.set(i,this.#B());return this.#r[i]})}async setWorkspace(t,o,{clearSessions:a,incarnation:e}={}){let i=Ut(t);if(!this.has(i)||e!==void 0&&e!==this.incarnationFor(i)){let r=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw r.code="workspace-bot-not-found",r}let A=await u3(o);return this.#Q(i,async()=>{if(!this.has(i)||e!==void 0&&e!==this.incarnationFor(i)){let s=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw s.code="workspace-bot-not-found",s}if(A===this.workspaceFor(i))return A;let r=this.#r[i];this.#s.set(i,this.#B()),await a?.(),this.#r[i]=A;try{await this.#y()}catch(s){throw this.#r[i]=r,s}return A})}async setAgentPreset(t,o,{incarnation:a}={}){let e=Ut(t);if(!this.has(e)||a!==void 0&&a!==this.incarnationFor(e)){let A=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw A.code="workspace-bot-not-found",A}let i=Hp(o);return this.#Q(e,async()=>{if(!this.has(e)||a!==void 0&&a!==this.incarnationFor(e)){let r=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw r.code="workspace-bot-not-found",r}let A=this.#I[e]??null;if(A===i)return i;i?this.#I[e]=i:delete this.#I[e];try{await this.#y()}catch(r){throw A?this.#I[e]=A:delete this.#I[e],r}return i})}async setGroupSessionScope(t,o,{incarnation:a}={}){let e=Ut(t);if(!this.has(e)||a!==void 0&&a!==this.incarnationFor(e)){let A=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw A.code="workspace-bot-not-found",A}let i=Xp(o);return this.#Q(e,async()=>{if(!this.has(e)||a!==void 0&&a!==this.incarnationFor(e)){let r=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw r.code="workspace-bot-not-found",r}let A=Object.hasOwn(this.#o,e)?this.#o[e]:void 0;if(A===i)return i;this.#o[e]=i;try{await this.#y()}catch(r){throw A===void 0?delete this.#o[e]:this.#o[e]=A,r}return i})}async setContextEnhancement(t,o,{incarnation:a}={}){let e=Ut(t),i=a===void 0?this.incarnationFor(e):a,A=jI(o);return this.#Q(e,async()=>{if(!this.has(e)||i!==this.incarnationFor(e)){let s=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw s.code="workspace-bot-not-found",s}let r={...this.#c,[e]:A};return await this.#y(r),this.#c=r,A})}async setAccessPolicy(t,o,{incarnation:a}={}){let e=Ut(t),i=a===void 0?this.incarnationFor(e):a,A=fc(o);return this.#Q(e,async()=>{if(!this.has(e)||i!==this.incarnationFor(e)){let s=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw s.code="workspace-bot-not-found",s}let r={...this.#a,[e]:A};return await this.#y(this.#c,this.#i,2,r),this.#a=r,this.#t=2,A})}async bindWorkspaceSession(t,o,{conversationKey:a,sessionId:e,clearSessions:i,setSession:A,incarnation:r,expectedGeneration:s}={}){let g=Ut(t);if(typeof a!="string"||!a||typeof e!="string"||!e)throw new TypeError("conversationKey and sessionId are required");if(typeof i!="function"||typeof A!="function")throw new TypeError("session state callbacks are required");if(!this.has(g)||r!==void 0&&r!==this.incarnationFor(g)){let I=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw I.code="workspace-bot-not-found",I}let c=await ET(await u3(o));return this.#Q(g,async()=>{if(!this.has(g)||r!==void 0&&r!==this.incarnationFor(g)){let I=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw I.code="workspace-bot-not-found",I}if(s!==void 0&&s!==this.generationFor(g))throw qI("The bot workspace changed before the session binding could be committed.");if(!await IBe(c,this.workspaceFor(g))){let I=this.#r[g];this.#s.set(g,this.#B()),await i(),this.#r[g]=c;try{await this.#y()}catch(p){throw this.#r[g]=I,p}}return await A(a,e),{workspace:c,sessionId:e,generation:this.#s.get(g)}})}async invalidateSessions(t,{clearSessions:o}={}){let a=Ut(t);return this.#Q(a,async()=>{this.#s.set(a,this.#B()),await o?.()})}async beginRemoval(t,{clearSessions:o}={}){let a=Ut(t);return this.#Q(a,async()=>{let e=this.#n.get(a);if(e)return e;let i=Object.freeze({});this.#n.set(a,i),this.#h.set(i,{botId:a,incarnation:this.incarnationFor(a)}),this.#s.set(a,this.#B());try{await o?.()}catch(A){throw this.#n.get(a)===i&&this.#n.delete(a),A}return i})}async abortRemoval(t){let{botId:o}=this.#m(t);return this.#Q(o,async()=>this.#n.get(o)!==t?!1:(this.#n.delete(o),Object.hasOwn(this.#r,o)&&(this.#s.set(o,this.#B()),this.#g.has(o)||this.#g.set(o,this.#f())),!0))}async finishRemoval(t){let{botId:o,incarnation:a}=this.#m(t);return this.#Q(o,async()=>this.#n.get(o)!==t?{removed:!1,persisted:!0,error:null,stale:!0}:this.incarnationFor(o)!==a?(this.#n.delete(o),{removed:!1,persisted:!0,error:null,stale:!0}):(this.#n.delete(o),this.#w(o)))}async retireAfterConfigCommit(t){let o=Ut(t);return this.#Q(o,async()=>(this.#n.delete(o),this.#w(o)))}flushPendingRemoval(t){if(this.#d.has(t))return this.#Q(t,async()=>{this.#d.has(t)&&await this.#b()})}async remove(t){let o=await this.retireAfterConfigCommit(t);if(o.error)throw o.error;return o.removed}async reconcile(t){let o=new Set([...t].map(Ut)),a=new Set([...Object.keys(this.#r),...Object.keys(this.#I),...Object.keys(this.#o),...Object.keys(this.#c),...Object.keys(this.#i),...Object.keys(this.#a),...this.#d]);for(let e of a)o.has(e)||await this.remove(e)}decorateStatus(t){return!t||typeof t!="object"||!Array.isArray(t.bots)?t:{...t,bots:t.bots.map(o=>o?.botId?{...o,workspace:this.workspaceFor(o.botId),agentPreset:this.agentPresetFor(o.botId),groupSessionScope:this.groupSessionScopeFor(o.botId),contextEnhancement:this.contextEnhancementFor(o.botId),accessPolicy:this.accessPolicyFor(o.botId)}:o)}}#B(){let t=this.#p;return this.#p+=1,t}#f(){let t=this.#l;return this.#l+=1,t}#m(t){if(!t||typeof t!="object")throw new TypeError("Invalid workspace removal transaction");let o=this.#h.get(t);if(!o)throw new TypeError("Invalid workspace removal transaction");return o}async#w(t){let o=Object.hasOwn(this.#r,t),a=Object.hasOwn(this.#I,t),e=Object.hasOwn(this.#o,t),i=Object.hasOwn(this.#c,t),A=Object.hasOwn(this.#i,t),r=Object.hasOwn(this.#a,t),s=o||a||e||i||A||r||this.#d.has(t);if(delete this.#r[t],delete this.#I[t],delete this.#o[t],delete this.#c[t],delete this.#i[t],delete this.#a[t],this.#s.delete(t),this.#g.delete(t),!s)return{removed:!1,persisted:!0,error:null,stale:!1};try{return await this.#b(),{removed:o,persisted:!0,error:null,stale:!1}}catch(g){return this.#d.add(t),{removed:o,persisted:!1,error:g,stale:!1}}}async#Q(t,o){let a=this.#C.then(o,o),e=a.then(()=>{},()=>{});return this.#C=e,this.#u.set(t,e),e.finally(()=>{this.#u.get(t)===e&&this.#u.delete(t)}),a}async#y(t=this.#c,o=this.#i,a=this.#t,e=this.#a){await uBe(this.#e,EBe({version:a,workspaces:this.#r,agentPresets:this.#I,groupSessionScopes:this.#o,contextEnhancement:t,deliveryTargets:o,accessPolicies:e})),this.#d.clear()}async#b(){if(Object.keys(this.#r).length>0||Object.keys(this.#I).length>0||Object.keys(this.#o).length>0||Object.keys(this.#c).length>0||Object.keys(this.#i).length>0||Object.keys(this.#a).length>0){await this.#y();return}try{await sBe(this.#e),this.#d.clear()}catch(t){if(t?.code!=="ENOENT")throw t;this.#d.clear()}}};function ed(n){if(!n)return null;let t=typeof n=="function"?n():n;return t&&typeof t.then=="function"?t.then(gs):gs(t)}function f3(){let n=new Error("Agent Preset \u4E0D\u5B58\u5728\u6216\u4E0D\u53EF\u7528\u3002");return n.code="agent-preset-unavailable",n}function $p(n){if(n())return;let t=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw t.code="workspace-bot-not-found",t}function C3(n,t,o){let a=e=>{let i=n.decorateStatus(e);if(!o||!i||typeof i!="object")return i;let A=s=>s?{...i,agentPresetCatalog:s}:i,r=ed(o);return r&&typeof r.then=="function"?r.then(A):A(r)};return t&&typeof t.then=="function"?t.then(a):a(t)}function CBe(n){return Promise.resolve(n.status())}function Yi(n,{workspaces:t,method:o="remove",botIdFromRemoved:a=A=>A?.botId,saveMethod:e="save",botIdFromSave:i=A=>A?.botId}){if(!n||!t||typeof n[o]!="function")throw new TypeError("configStore removal observer dependencies are required");return new Proxy(n,{get(A,r){let s=Reflect.get(A,r,A);return r===o?async(...g)=>{let c=await s.apply(A,g),I=c?a(c,g):null;return I&&await t.retireAfterConfigCommit(I),c}:r===e&&typeof s=="function"?(...g)=>{let c=t.flushPendingRemoval(i(g[0],g));return c?c.then(()=>s.apply(A,g)):s.apply(A,g)}:typeof s=="function"?s.bind(A):s}})}function ji(n,{botId:t,workspaces:o,state:a,agentPresetCatalog:e}={}){if(!n||!o||!a)throw new TypeError("harness, workspaces, and state are required");let i=o.incarnationFor(t),A=()=>o.has(t)&&o.incarnationFor(t)===i,r=async(I=e)=>{let p;try{p=await ed(I)??gs(null)}catch(B){throw $p(A),B}return $p(A),{agentPreset:o.agentPresetFor(t),agentPresetCatalog:p}},s=new Map,g=new Proxy(n,{get(I,p){if(p==="agentPresetSettings")return async(f={})=>{f?.signal?.throwIfAborted(),$p(A);let Q=await r();return f?.signal?.throwIfAborted(),Q};if(p==="updateAgentPreset")return async(f,Q={})=>{Q?.signal?.throwIfAborted(),$p(A);let y=f==="--default"?null:Hp(f),m=null;if(y&&({agentPresetCatalog:m}=await r(),Q?.signal?.throwIfAborted(),!m.items.some(T=>T.id===y)))throw f3();if(await o.setAgentPreset(t,y,{incarnation:i}),$p(A),m)return{agentPreset:o.agentPresetFor(t),agentPresetCatalog:m};try{return await r()}catch(T){if(T?.code==="workspace-bot-not-found")throw T;return $p(A),{agentPreset:o.agentPresetFor(t),agentPresetCatalog:gs(null)}}};if(p==="currentWorkspace")return()=>{if(!A()){let f=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw f.code="workspace-bot-not-found",f}return o.workspaceFor(t)};if(p==="assertWorkspaceScope")return()=>{if(!A()){let f=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw f.code="workspace-bot-not-found",f}};if((p==="listWorkspaces"||p==="listWorkspaceSessions"||p==="listModels")&&typeof I[p]=="function")return async(...f)=>{if(!A()){let y=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw y.code="workspace-bot-not-found",y}let Q=await I[p](...f);if(!A()){let y=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw y.code="workspace-bot-not-found",y}return Q};if(p==="switchWorkspace")return f=>{if(!A()){let Q=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");return Q.code="workspace-bot-not-found",Promise.reject(Q)}return o.setWorkspace(t,f,{clearSessions:()=>a.clearSessions(),incarnation:i})};if(p==="bindWorkspaceSession")return async(f,Q)=>{if(typeof f!="string"||!f||typeof Q!="string"||!Q)throw new TypeError("conversationKey and sessionId are required");if(!A()){let _=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw _.code="workspace-bot-not-found",_}if(typeof I.adoptWorkspaceSession!="function")throw new TypeError("Harness does not support adopting workspace sessions");let y=o.generationFor(t),m=await I.adoptWorkspaceSession(Q);if(!A()){let _=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw _.code="workspace-bot-not-found",_}if(y!==o.generationFor(t))throw qI("The bot workspace changed while the session was being adopted.");if(!m||typeof m!="object"||m.sessionId!==Q||typeof m.workspace!="string")throw new TypeError("Harness returned an invalid adopted workspace session");let T=await o.bindWorkspaceSession(t,m.workspace,{conversationKey:f,sessionId:Q,clearSessions:()=>a.clearSessions(),setSession:(_,R)=>a.setSession(_,R),incarnation:i,expectedGeneration:y});if(!A()){let _=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw _.code="workspace-bot-not-found",_}if(T.generation!==o.generationFor(t))throw qI("The bot workspace changed before the session binding completed.");return s.set(Q,T.generation),{...m,workspace:T.workspace,sessionId:T.sessionId}};if(p==="createSession")return async(f={})=>{if(await o.whenBotIdle(t),!A()){let T=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw T.code="workspace-bot-not-found",T}let Q=o.generationFor(t),y=o.agentPresetFor(t),m=await I.createSession({...f,workspace:o.workspaceFor(t),...y==null?{}:{agentPreset:y}});return s.set(m,Q),m};if(p==="workspaceSession")return f=>{if(typeof f!="string"||!f)throw new TypeError("sessionId is required");let Q=s.get(f)??o.generationFor(t);s.delete(f);let y=()=>A()&&Q===o.generationFor(t),m=async(_,R,L)=>{if(!y())throw qI(`The bot workspace changed before this ${L} started.`);let U=await I[_](f,...R);if(!y())throw qI(`The bot workspace changed while this ${L} was running.`);return U},T=async(_,R,L)=>{if(!y())throw qI(`The bot workspace changed before this ${L} started.`);return I[_](f,...R)};return Object.freeze({sessionId:f,async sessionExists(..._){if(!y())return!1;let R=await I.sessionExists(f,..._);return y()&&R},models(..._){return m("getSessionModels",_,"model listing")},readHistory(..._){return m("readSessionHistory",_,"history read")},...typeof I.renameSession=="function"?{renameTitle(..._){return T("renameSession",_,"title rename")}}:{},selectModel(..._){return m("selectSessionModel",_,"model selection")},isRunning(..._){return m("isSessionRunning",_,"run-state check")},hasActiveTurn(..._){return m("hasActiveTurn",_,"turn ownership check")},stopActiveTurn(..._){return T("stopActiveTurn",_,"turn stop")},steerActiveTurn(..._){return T("steerActiveTurn",_,"turn steering")},ask(..._){if(!y())throw qI("The bot workspace changed before this prompt started.");return I.ask(f,..._)}})};if(p==="sessionExists")return(f,...Q)=>{if(!A())return!1;let y=s.get(f);return y!==void 0&&y!==o.generationFor(t)?(s.delete(f),!1):I.sessionExists(f,...Q)};if(p==="ask")return(f,...Q)=>{let y=s.get(f);if(s.delete(f),!A()||y!==void 0&&y!==o.generationFor(t)){let m=new Error("The bot workspace changed before this prompt started.");throw m.code=Oi,m}return I.ask(f,...Q)};if(p==="executeCommand"&&typeof I.executeCommand=="function")return(f,...Q)=>{let y=s.get(f);if(s.delete(f),!A()||y!==void 0&&y!==o.generationFor(t)){let m=new Error("The bot workspace changed before this command started.");throw m.code=Oi,m}return I.executeCommand(f,...Q)};let B=Reflect.get(I,p,I);return typeof B=="function"?B.bind(I):B}}),c=new Proxy(a,{get(I,p){if(p===h_)return I;if(p==="sessionFor")return(f,...Q)=>{if(!A())return null;let y=I.sessionFor(f,...Q);return y&&!s.has(y)&&s.set(y,o.generationFor(t)),y};if(p==="setSession")return(f,Q,...y)=>{let m=s.get(Q);return!A()||m!==void 0&&m!==o.generationFor(t)?(s.delete(Q),!1):I.setSession(f,Q,...y)};let B=Reflect.get(I,p,I);return typeof B=="function"?B.bind(I):B}});return Object.freeze({harness:g,state:c})}function Ji(n,{workspaces:t,stateFor:o,agentPresetCatalog:a}={}){if(!n||!t||typeof o!="function")throw new TypeError("controller, workspaces, and stateFor are required");let e=new Map,i=(B,f)=>{let y=(e.get(B)??Promise.resolve()).catch(()=>{}).then(f);return e.set(B,y),y.finally(()=>{e.get(B)===y&&e.delete(B)})},A=B=>C3(t,B,a),r=(B,f)=>{let Q=t.incarnationFor(B);return i(B,async()=>{if(!(await n.status())?.bots?.some(T=>T?.botId===B)){let T=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw T.code="workspace-bot-not-found",T}let m=await o(B);return await t.setWorkspace(B,f,{clearSessions:()=>m.clearSessions(),incarnation:Q}),A(await n.status())})},s=(B,f)=>{let Q=t.incarnationFor(B),y=Hp(f);return i(B,async()=>{if(!(await n.status())?.bots?.some(_=>_?.botId===B)){let _=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw _.code="workspace-bot-not-found",_}let T=y&&a?await ed(a):null;if(y&&a&&!T?.items.some(_=>_.id===y))throw f3();return await t.setAgentPreset(B,y,{incarnation:Q}),C3(t,await n.status(),T??a)})},g=(B,f,Q)=>{let y=t.incarnationFor(B),m=jI(f);return i(B,async()=>{let T=await n.status();if(!T?.bots?.some(F=>F?.botId===B)){let F=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw F.code="workspace-bot-not-found",F}let _=await ed(a),R=t.decorateStatus(T),L={...R,bots:R.bots.map(F=>F?.botId===B?{...F,contextEnhancement:m}:F),..._?{agentPresetCatalog:_}:{}},U=Q?await Q(L):L;return await t.setContextEnhancement(B,m,{incarnation:y}),U})},c=(B,f,Q)=>{let y=t.incarnationFor(B),m=fc(f);return i(B,async()=>{let T=await n.status();if(!T?.bots?.some(F=>F?.botId===B)){let F=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw F.code="workspace-bot-not-found",F}let _=await ed(a),R=t.decorateStatus(T),L={...R,bots:R.bots.map(F=>F?.botId===B?{...F,accessPolicy:m}:F),..._?{agentPresetCatalog:_}:{}},U=Q?await Q(L):L;return await t.setAccessPolicy(B,m,{incarnation:y}),U})},I=(B,f,Q)=>{let y=t.incarnationFor(B),m=Xp(f);return i(B,async()=>{let T=await n.status();if(!T?.bots?.some(F=>F?.botId===B)){let F=new Error("\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002");throw F.code="workspace-bot-not-found",F}let _=await ed(a),R=t.decorateStatus(T),L={...R,bots:R.bots.map(F=>F?.botId===B?{...F,groupSessionScope:m}:F),..._?{agentPresetCatalog:_}:{}},U=Q?await Q(L):L;return await t.setGroupSessionScope(B,m,{incarnation:y}),U})},p=(B,f)=>i(B,async()=>{let Q=await t.beginRemoval(B,{clearSessions:async()=>{try{let y=await o(B);if(!y||typeof y.clearSessions!="function")throw new TypeError("bot state does not support session cleanup");await y.clearSessions()}catch(y){console.warn(`[dsh-im] ignored session cleanup failure while deleting bot ${B}:`,y?.message??y)}}});try{let y=await f();return await t.finishRemoval(Q),A(y)}catch(y){let m=await CBe(n).catch(()=>null);throw Array.isArray(m?.bots)&&!m.bots.some(_=>_?.botId===B)?await t.finishRemoval(Q):await t.abortRemoval(Q),y}});return new Proxy(n,{get(B,f){if(f==="updateWorkspace")return r;if(f==="updateAgentPreset")return s;if(f==="updateContextEnhancement")return g;if(f==="updateAccessPolicy")return c;if(f==="updateGroupSessionScope")return I;let Q=Reflect.get(B,f,B);return typeof Q!="function"?Q:f==="deleteBot"?(y,...m)=>p(y,()=>Q.call(B,y,...m)):f==="disconnect"?async(...y)=>{let T=(await B.status())?.bots?.[0]?.botId;return T?p(T,()=>Q.apply(B,y)):A(Q.apply(B,y))}:(...y)=>A(Q.apply(B,y))}})}var Q3=new Set(["weixin","feishu","dingtalk","wecom","qq","slack","telegram","discord","whatsapp"]);function BBe(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function fBe(n){return typeof n=="string"&&n.length>0&&n.length<=512&&n.trim()===n&&!/[\s:\u0000-\u001f\u007f]/u.test(n)}function uT(n,t){let o=`${t}:`;if(!n.startsWith(o))return null;let a=n.slice(o.length);return fBe(a)?a:null}function lu(n,t){for(let[o,a,e]of t){let i=uT(n,o);if(i)return{kind:a,route:{[e]:i}}}return null}function QBe(n){let t=uT(n,"p2p");return t?.startsWith("ou_")?{kind:"user",route:{openId:t}}:lu(n,[["group","group","chatId"]])}function yBe(n){let t=uT(n,"direct");if(t&&/^[A-Za-z0-9_-]{1,128}$/.test(t))return{kind:"conversation",route:{channelId:t}};let o=/^group:([^:]+):(\d{1,20}(?:\.\d{1,20})?)$/.exec(n);return!o||!/^[A-Za-z0-9_-]{1,128}$/.test(o[1])?null:{kind:"thread",route:{channelId:o[1],threadTs:o[2]}}}function mBe(n){let t=/^(direct|group):(-?\d+)(?::([1-9]\d*))?$/.exec(n);if(!t)return null;let o=Number(t[2]);if(!Number.isSafeInteger(o)||t[1]==="direct"&&t[3]!==void 0)return null;if(t[3]===void 0)return{kind:"chat",route:{chatId:t[2]}};let a=Number(t[3]);return!Number.isSafeInteger(a)||a<=0?null:{kind:"topic",route:{chatId:t[2],messageThreadId:a}}}function SBe(n){let t=/^(?:direct|group):(\d{1,32})$/.exec(n);return t?{kind:"channel",route:{channelId:t[1]}}:null}function wBe(n){let t=/^direct:(\d{5,32}@(s\.whatsapp\.net|lid))$/.exec(n);if(t)return{kind:"user",route:{jid:t[1]}};let o=/^group:(\d{5,32}(?:-\d{1,32})?@g\.us)$/.exec(n);return o?{kind:"group",route:{jid:o[1]}}:null}function DBe(n,t){if(!Q3.has(n)||typeof t!="string")return null;switch(n){case"weixin":return lu(t,[["p2p","user","toUserId"]]);case"feishu":return QBe(t);case"dingtalk":return lu(t,[["p2p","user","userId"],["group","group","openConversationId"]]);case"wecom":return lu(t,[["direct","user","chatId"],["group","group","chatId"]]);case"qq":return lu(t,[["c2c","user","userOpenId"],["group","group","groupOpenId"]]);case"slack":return yBe(t);case"telegram":return mBe(t);case"discord":return SBe(t);case"whatsapp":return wBe(t);default:return null}}function y3(n,t){if(!Q3.has(n)||!BBe(t))return[];let o=[],a=new Set;for(let e of Object.keys(t)){let i=DBe(n,e);if(!i)continue;let A=JSON.stringify(i);a.has(A)||(a.add(A),o.push(i))}return o}var OBe=new Set(["weixin","feishu","dingtalk","wecom","qq","slack","telegram","discord","whatsapp"]);function oy(n){return OBe.has(n)}function yc(n){let t=new Error(n);return t.code="invalid-target",t}function bBe(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function CT(n,t,o){if(!bBe(n))throw yc(`${o} must be an object`);if(Object.keys(n).find(e=>!t.includes(e))!==void 0)throw yc(`${o} contains an unknown field`)}function ay(n,t){if(typeof n!="string"||!n||n.trim()!==n)throw yc(`${t} must be a non-empty string without surrounding whitespace`);return n}function MBe(n){if(typeof n!="string"||!n.trim()||n.trim().length>80)throw yc("target.name must contain 1 to 80 characters");return n.trim()}function Qc(n,t){CT(n,t,"route");let o={};for(let a of t)o[a]=ay(n[a],`route.${a}`);return o}function Bg(n,t){if(!t.includes(n))throw yc("target kind is not supported by this channel");return n}function _Be(n,t,o){switch(n){case"weixin":return Bg(t,["user"]),Qc(o,["toUserId"]);case"feishu":return Bg(t,["user","group"]),Qc(o,t==="user"?["openId"]:["chatId"]);case"dingtalk":return Bg(t,["user","group"]),Qc(o,t==="user"?["userId"]:["openConversationId"]);case"wecom":return Bg(t,["user","group"]),Qc(o,["chatId"]);case"qq":return Bg(t,["user","group"]),Qc(o,t==="user"?["userOpenId"]:["groupOpenId"]);case"slack":return Bg(t,["conversation","thread"]),Qc(o,t==="conversation"?["channelId"]:["channelId","threadTs"]);case"telegram":{Bg(t,["chat","topic"]),CT(o,t==="chat"?["chatId"]:["chatId","messageThreadId"],"route");let a=ay(o.chatId,"route.chatId");if(!/^-?\d+$/.test(a))throw yc("route.chatId must be a decimal string");if(t==="chat")return{chatId:a};if(!Number.isSafeInteger(o.messageThreadId)||o.messageThreadId<=0)throw yc("route.messageThreadId must be a positive integer");return{chatId:a,messageThreadId:o.messageThreadId}}case"discord":return Bg(t,["channel"]),Qc(o,["channelId"]);case"whatsapp":{Bg(t,["user","group"]);let a=Qc(o,["jid"]);if(!(t==="user"?/^\d{5,32}@(s\.whatsapp\.net|lid)$/.test(a.jid):/^\d{5,32}(?:-\d{1,32})?@g\.us$/.test(a.jid)))throw yc(`route.jid must be a ${t} WhatsApp JID`);return a}default:throw new TypeError(`Unsupported delivery channel: ${n}`)}}function Ad(n,t,{targetIdRequired:o=!0}={}){if(!oy(n))throw new TypeError(`Unsupported delivery channel: ${n}`);CT(t,o?["targetId","name","kind","route"]:["name","kind","route"],"target");let a={};return o&&(a.targetId=ay(t.targetId,"target.targetId")),t.name!==void 0&&(a.name=MBe(t.name)),a.kind=ay(t.kind,"target.kind"),a.route=_Be(n,a.kind,t.route),a}function qi({channel:n,workspaces:t,coreController:o,stateFor:a}){if(!oy(n))throw new TypeError(`Unsupported delivery channel: ${n}`);if(!t||typeof t!="object")throw new TypeError("delivery adapter requires a workspace store");if(!o||typeof o!="object")throw new TypeError("delivery adapter requires a proactive text controller");if(typeof a!="function")throw new TypeError("delivery adapter requires a bot state getter");return Object.freeze({channel:n,ownsBot:e=>t.has(e),listTargets:e=>t.listDeliveryTargets(e),async listSuggestions(e){let i=await a(e);if(!i||typeof i.snapshot!="function")throw new TypeError("delivery suggestion state cannot be inspected");return y3(n,i.snapshot()?.sessions).map(r=>Ad(n,r,{targetIdRequired:!1}))},createTarget:(e,i)=>t.createDeliveryTarget(e,Ad(n,i)),updateTarget:(e,i,A)=>t.updateDeliveryTarget(e,i,Ad(n,A,{targetIdRequired:!1})),deleteTarget:(e,i)=>t.deleteDeliveryTarget(e,i),async sendText(e,i,A,r={}){let s=Ad(n,i);if(typeof o.sendProactiveText!="function")throw new TypeError("delivery controller cannot send proactive text");return await o.sendProactiveText(e,s,A,r),{sent:!0}}})}var m3=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function TBe(n){if(!Array.isArray(n)||n.length===0)return[...m3];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...m3]}var ny=class{#e;#A;#t;#r;#I;#o;#c;#i=null;#a=null;#s=0;#p=!1;#g=!1;#l;#n;constructor({controller:t,harness:o,logger:a=console,retryDelaysMs:e,healthyIntervalMs:i=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=a,this.#r=TBe(e),this.#I=Number.isFinite(i)&&i>=0?i:15e3,this.#o=A,this.#c=r,this.#l=new Promise(s=>{this.#n=s})}get ready(){return this.#l}start(){return this.#g||this.#p?this:(this.#g=!0,this.#h(0),this)}async close(){this.#p||(this.#p=!0,this.#i!==null&&this.#c(this.#i),this.#i=null,await this.#a?.catch(()=>{}),this.#n?.(null),this.#n=null)}#h(t){this.#p||(this.#i=this.#o(()=>{this.#i=null,this.#d()},t),this.#i?.unref?.())}async#d(){if(this.#p||this.#a)return;let t=this.#C();this.#a=t;try{await t}finally{this.#a===t&&(this.#a=null)}}async#C(){try{if(await this.#A.ensureRunning(),this.#p)return;let t=await this.#e.initialize();if(this.#p)return;this.#n?.(t),this.#n=null;let{configured:o,connected:a}=t.totals;if(a{let A={namespace:"commands",method:"execute",args:{agentId:a,line:e,images:[]},signal:i.signal};try{return await o.invoke(A)}catch(r){if(r?.name!=="TypertGatewayError"||r.code!=="arguments-invalid"||r.endpoint!=="commands/execute"||r.message!=='typert gateway: commands/execute: args fields do not match the descriptor: unexpected "images"')throw r;return i.signal?.throwIfAborted(),o.invoke({...A,args:{agentId:a,line:e}})}}}}import{randomUUID as fT}from"node:crypto";var sy=new WeakMap;function NBe(n){let t=n?.failure;return t&&typeof t=="object"&&typeof t.code=="string"&&typeof t.message=="string"?{code:t.code,message:t.message,details:t.details&&typeof t.details=="object"?t.details:{}}:n?.name==="AbortError"||n?.name==="RemoteInvocationCancelled"?{code:"cancelled",message:n instanceof Error?n.message:"Harness request was cancelled",details:{}}:{code:"internal",message:n instanceof Error?n.message:String(n),details:{}}}function Ho(n,t){return Promise.resolve().then(t).then(o=>({rpcId:n.rpcId,result:{ok:!0,value:o}}),o=>({rpcId:n.rpcId,result:{ok:!1,error:NBe(o)}}))}function S3(n,t,o,a){return{namespace:n,method:t,args:o,...a===void 0?{}:{signal:a}}}function gy(n,t){let o=new Error(n);return o.name="UserQuestionError",o.code=t,o}function RBe(n){if(typeof n?.snapshotEvents=="function"){let o=n.snapshotEvents();if(Array.isArray(o))return o}let t=n?.events;return Array.isArray(t)?t:null}function kBe(n,t){return!n||typeof n!="object"||n.sessionId!==t.sessionId||!n.answer||typeof n.answer!="object"||!Array.isArray(n.answer.answers)||n.answer.answers.length!==t.questions.length?!1:n.answer.answers.every((o,a)=>{let e=t.questions[a];if(!o||typeof o!="object"||o.id!==e.id||!Array.isArray(o.selected)||o.selected.some(r=>typeof r!="string")||new Set(o.selected).size!==o.selected.length||o.custom!==void 0&&typeof o.custom!="string")return!1;let i=o.custom?.trim();if(i!==void 0&&!i||e.multiSelect!==!0&&(i!==void 0&&o.selected.length>0||o.selected.length>1))return!1;let A=new Set(e.options?.map(r=>r.label)??[]);return o.selected.every(r=>A.has(r))})}function vBe(n){if(n?.type==="event"&&n.event&&typeof n.event=="object")return[{event:n.event}];let t=n?.type==="chunks"?n.event:null;if(!t||typeof t!="object")throw new Error("Harness returned an invalid session history record");let{data:o}=t,a=t.type,e=a==="chunkrow/tool-call-chunks"?o?.args:o?.texts;if(!o||!Array.isArray(e)||e.length===0||e.some(A=>typeof A!="string")||!Array.isArray(o.dt)||o.dt.length!==e.length-1)throw new Error("Harness returned an invalid packed session chunk");let i=t.time;return e.map((A,r)=>{r>0&&(i+=o.dt[r-1]);let s;if(a==="chunkrow/text-chunks")s={type:"text-delta",index:o.index,text:A};else if(a==="chunkrow/reasoning-chunks")s={type:"reasoning-delta",index:o.index,text:A};else if(a==="chunkrow/tool-call-chunks")s={type:"tool-call-delta",index:o.index,id:o.id,...Object.hasOwn(o,"name")?{name:o.name}:{},argumentsDelta:A};else throw new Error(`Harness returned an unsupported packed session chunk: ${String(a)}`);return{event:{type:"assistant/chunk",seq:t.seq+r,time:i,data:{turn:o.turn,step:o.step,chunk:s}}}})}function w3(n){if(!Array.isArray(n))throw new Error("Harness returned invalid session history records");return n.flatMap(vBe)}var QT=class{#e=[];#A=null;#t=!1;#r;#I;#o;constructor(t,o){this.#r=t,this.#o=o,this.#I=()=>this.close(),t?.addEventListener("abort",this.#I,{once:!0}),t?.aborted&&this.close()}push(t){if(!this.#t)if(this.#A){let o=this.#A;this.#A=null,o({value:t,done:!1})}else this.#e.push(t)}next(){return this.#e.length>0?Promise.resolve({value:this.#e.shift(),done:!1}):this.#t?Promise.resolve({value:void 0,done:!0}):new Promise(t=>{this.#A=t})}return(){return this.close(),Promise.resolve({value:void 0,done:!0})}close(){if(!this.#t&&(this.#t=!0,this.#r?.removeEventListener("abort",this.#I),this.#o?.(),this.#o=null,this.#A)){let t=this.#A;this.#A=null,t({value:void 0,done:!0})}}[Symbol.asyncIterator](){return this}},yT=class{#e;#A;#t=new Set;#r=new Map;#I=new Map;#o=new Map;#c=[];#i=!1;constructor(t,o,a){this.#e=o,this.#A=a,this.host=Object.freeze({describe:e=>Ho(e,()=>({ready:!0,transport:"typert"}))}),this.workspace=Object.freeze({list:(e,i)=>Ho(e,()=>this.#p(i)),create:(e,i)=>Ho(e,()=>this.#a("workspace","create",{request:e.payload},i))}),this.sessions=Object.freeze({list:(e,i)=>Ho(e,()=>this.#a("session","list",{_request:e.payload},i)),create:(e,i)=>Ho(e,()=>this.#a("session","create",{request:e.payload},i)),history:(e,i)=>Ho(e,()=>this.#l(e.payload,i)),prompt:(e,i)=>Ho(e,()=>this.#a("session","prompt",{request:{requestId:e.rpcId,...e.payload}},i)),rename:(e,i)=>Ho(e,()=>this.#a("session","rename",{request:e.payload},i)),cancel:(e,i)=>Ho(e,()=>this.#a("session","cancel",{request:{sessionId:e.payload.sessionId}},i)),models:(e,i)=>Ho(e,()=>this.#d(e.payload.sessionId,i)),selectModel:(e,i)=>Ho(e,()=>this.#a("session","selectModel",{request:e.payload},i))}),this.llm=Object.freeze({models:(e,i)=>Ho(e,async()=>{let A=await this.#h(i);return{groups:A.groups,failures:A.failures}})}),this.events=Object.freeze({mux:(e,i)=>this.#C(i)}),this.respond=e=>Promise.resolve(this.#y(e)),typeof t?.on=="function"&&(this.#c.push(t.on("session/event",(e,i)=>{let A=e?.id;typeof A!="string"||!i||typeof i!="object"||(Number.isSafeInteger(i.seq)&&this.#n(A,i.seq),this.#u({type:"session/event",sessionId:A,event:i}))},{global:!0})),this.#c.push(t.on("approval/request",(e,i)=>this.#Q(e,i),{global:!0,prepend:!0})),this.#c.push(t.on("user-questions/request",(e,i)=>this.#m(e,i),{global:!0,prepend:!0})))}async#a(t,o,a,e){return this.#e.invoke(S3(t,o,a,e))}async#s(t,o,a,e){let i=new AbortController,A=e?AbortSignal.any([e,i.signal]):i.signal,r;try{r=(await this.#e.stream(S3(t,o,a,A)))[Symbol.asyncIterator]();let g=await r.next();if(g.done)throw new Error(`Harness ${t}.${o} stream ended before its baseline`);return g.value}finally{i.abort(new DOMException("Baseline received","AbortError")),await Promise.resolve(r?.return?.()).catch(()=>{})}}async#p(t){let o=await this.#s("workspace","follow",{},t);if(o?.type!=="baseline"||!o.value||typeof o.value!="object")throw new Error("Harness workspace.follow returned no baseline");return o.value}async#g(t,o,a){let e=await this.#s("session","follow",{request:{address:{kind:"session",sessionId:t},maxMessages:o}},a);if(e?.type!=="snapshot"||!Number.isSafeInteger(e.cursor))throw new Error("Harness session.follow returned no snapshot");return this.#n(t,e.cursor),e}async#l(t,o){let{sessionId:a,maxMessages:e=50,beforeSeq:i}=t,A=this.#o.get(a);if(A===void 0){let s=await this.#g(a,e,o);if(A=this.#o.get(a)??s.cursor,i===void 0&&A===s.cursor)return{events:w3(s.records),hasMore:s.hasMore===!0,...s.projections===void 0?{}:{projections:s.projections}}}let r=await this.#a("session","page",{request:{address:{kind:"session",sessionId:a},throughSeq:A,maxMessages:e,...i===void 0?{}:{beforeSeq:i}}},o);return{events:w3(r.records),hasMore:r.hasMore===!0}}#n(t,o){let a=this.#o.get(t);(a===void 0||o>a)&&this.#o.set(t,o)}#h(t){return this.#a("session","modelCatalog",{},t)}async#d(t,o){let[a,e]=await Promise.all([this.#h(o),this.#a("session","list",{_request:{}},o)]),i=e?.items?.find(s=>s?.sessionId===t);if(!i){let s=new Error(`session "${t}" not found`);throw s.failure={code:"session-not-found",message:s.message,details:{sessionId:t}},s}let A=i.projections?.values?.modelSelection,r=A?.next??A?.lastUsed??a.default;return{current:r,routable:a.routableProviders.includes(r.provider),groups:a.groups,failures:a.failures}}#C(t){let o;o=new QT(t,()=>this.#t.delete(o)),this.#t.add(o);for(let a of this.#r.values())o.push(this.#f(a));for(let a of this.#I.values())o.push(this.#w(a));return o}#u(t,o=fT()){let a={rpcId:o,payload:t};for(let e of this.#t)e.push(a)}#B(t){let o=t?.session,a=o?.id??t?.id,e=RBe(o);return typeof a!="string"||!e?null:h3(this.#A,a,e)?{sessionId:a,events:e}:null}#f(t){return{rpcId:t.rpcId,payload:{type:"question/requested",sessionId:t.sessionId,questions:t.questions}}}#m(t,o){let a=this.#B(t?.agent);return a?t.signal?.aborted?Promise.reject(gy("ask_user_question was aborted before the user answered","ASK_ABORTED")):new Promise((e,i)=>{let A={rpcId:fT(),sessionId:a.sessionId,questions:t.questions,signal:t.signal,settle:(s,g)=>{this.#r.delete(A.rpcId)&&(t.signal?.removeEventListener("abort",r),this.#u({type:"question/resolved",sessionId:A.sessionId,questionRpcId:A.rpcId,outcome:s}),s==="answered"?e(g):i(g))}},r=()=>A.settle("cancelled",gy("ask_user_question was aborted before the user answered","ASK_ABORTED"));this.#r.set(A.rpcId,A),t.signal?.addEventListener("abort",r,{once:!0}),this.#u(this.#f(A).payload,A.rpcId)}):o()}#w(t){return{rpcId:t.rpcId,payload:{type:"approval/requested",sessionId:t.sessionId,approvalId:t.approvalId,toolName:t.toolName,...t.callId===void 0?{}:{callId:t.callId},...t.reason===void 0?{}:{reason:t.reason}}}}#Q(t,o){let a=this.#B(t?.agent);if(!a)return o();if(t.signal?.aborted)return Promise.resolve("cancelled");let e=new Set([...this.#I.values()].map(r=>r.approvalId)),i=new Set,A;for(let r=a.events.length-1;r>=0;r-=1){let s=a.events[r];if(s.type==="approval/decided")i.add(s.data?.id);else if(s.type==="approval/asked"){let g=s.data?.id;if(!g||i.has(g)||e.has(g)||(t.callId??null)!==(s.data?.callId??null))continue;A=g;break}}return A===void 0?o():new Promise(r=>{let s={rpcId:fT(),sessionId:a.sessionId,approvalId:A,toolName:t.toolName,callId:t.callId,reason:t.reason,settle:c=>{this.#I.delete(s.rpcId)&&(t.signal?.removeEventListener("abort",g),this.#u({type:"approval/resolved",sessionId:s.sessionId,approvalId:s.approvalId,outcome:c}),r(c))}},g=()=>s.settle("cancelled");this.#I.set(s.rpcId,s),t.signal?.addEventListener("abort",g,{once:!0}),this.#u(this.#w(s).payload,s.rpcId)})}#y(t){let o=this.#I.get(t?.rpcId);if(o){let i=t?.result?.value;return t?.result?.ok!==!0||!i||typeof i!="object"||i.sessionId!==o.sessionId||i.approvalId!==o.approvalId||i.outcome!=="allowed-once"&&i.outcome!=="rejected"?{accepted:!1,reason:"bad-response"}:(o.settle(i.outcome),{accepted:!0})}let a=this.#r.get(t?.rpcId);if(!a)return{accepted:!1,reason:"not-pending"};if(t?.result?.ok!==!0)return t?.result?.error?.code!=="cancelled"?{accepted:!1,reason:"bad-response"}:(a.settle("cancelled",gy("the user cancelled ask_user_question","ASK_CANCELLED")),{accepted:!0});if(!kBe(t.result.value,a))return{accepted:!1,reason:"bad-response"};let e={answers:t.result.value.answer.answers.map(i=>({id:i.id,selected:[...i.selected],...i.custom===void 0?{}:{custom:i.custom}}))};return a.settle("answered",e),{accepted:!0}}dispose(){if(!this.#i){this.#i=!0;for(let t of[...this.#t])t.close();for(let t of[...this.#I.values()])t.settle("cancelled");for(let t of[...this.#r.values()])t.settle("cancelled",gy("dsh-im interaction adapter was disposed","ASK_ABORTED"));for(let t of this.#c.splice(0).reverse())t?.()}}};function D3(n){let t=n?.root??n;if(!t||!["object","function"].includes(typeof t))throw new TypeError("dsh-im requires a Cordis Host context");let o=sy.get(t);if(o)return o;let a=n?.typertGateway;if(!a||typeof a.invoke!="function"||typeof a.stream!="function")throw new TypeError("dsh-im requires the modern Host Typert gateway");let e=new yT(n,a,t);return sy.set(t,e),typeof n.effect=="function"&&n.effect(()=>()=>{sy.get(t)===e&&sy.delete(t),e.dispose()},"dsh-im: modern Harness compatibility API"),e}function PBe(n,t){return n&&Object.hasOwn(n,t)?n[t]:typeof n?.get=="function"?n.get(t):void 0}function si(n,t={}){return t.harnessBaseUrl!==void 0?{baseUrl:new URL(t.harnessBaseUrl)}:{apiProxy:PBe(n,"apiProxy")??D3(n),interactionScope:n.root??n}}import{randomUUID as GBe}from"node:crypto";function FBe(n){if(typeof n?.get!="function")return;let t;try{t=n.get("agents")}catch{return}if(t!=null){if(typeof t.get!="function")throw new TypeError('dsh-im requires a callable AgentRegistry when ctx.get("agents") is present');return t}}function LBe(n,t,o){if(n?.status!=="running")return!1;let a=n?.session?.events;if(!Array.isArray(a))return!1;let e=null,i=!1;for(let A of a){if(A?.type==="turn/start"){e=A.data?.turn??null,i=!1;continue}if(A?.type==="turn/end"&&A.data?.turn===e){e=null,i=!1;continue}e===t&&A?.type==="user/message"&&A.data?.source?.rpcId===o&&(i=!0)}return e===t&&i}function O3(n){if(!n||typeof n!="object"||Object.isFrozen(n))return n;for(let t of Object.values(n))O3(t);return Object.freeze(n)}function UBe(n){return O3({id:GBe(),role:"user",content:[{type:"text",text:n}],source:{kind:"user"}})}function HBe(n){let t=new Error("Session is busy with an active turn or maintenance task",{cause:n});return t.code="agent-busy",t}function KBe(n){return({sessionId:t,expectedTurn:o,promptRpcId:a,action:e,text:i})=>{let A=n.get(t);if(A){if(!LBe(A,o,a))return!1;if(e==="stop")return A.cancel({kind:"user"},{keepInbox:!0}),!0;if(e==="steer")return typeof i!="string"||!i.trim()?!1:(A.inject(UBe(i)),!0);throw new TypeError(`Unsupported Harness control action: ${String(e)}`)}}}function xBe(n){return({sessionId:t,operation:o})=>{if(typeof o!="function")throw new TypeError("maintenance operation is required");let a=n.get(t);if(!a)return o();try{return a.runMaintenance(e=>{if(n.get(t)!==a){let i=new Error("Session agent changed before maintenance started");throw i.code="agent-unavailable",i}return o(e)})}catch(e){throw HBe(e)}}}function YBe(n){return({sessionId:t,workspace:o,files:a,signal:e})=>{let A=n.get(t)?.session?.header?.cwd,r=typeof A=="string"&&A?A:o;if(typeof r!="string"||!r)throw new Go("inbound-file-workspace-unavailable","The Harness Session workspace is unavailable for inbound files.");return w1({files:a},{workspace:r,signal:e})}}function Vi(n,t={}){let{controlExecutor:o,sessionMaintenanceExecutor:a,fileIngressExecutor:e}=t;if(o!==void 0&&typeof o!="function")throw new TypeError("controlExecutor must be a function");if(a!==void 0&&typeof a!="function")throw new TypeError("sessionMaintenanceExecutor must be a function");if(e!==void 0&&typeof e!="function")throw new TypeError("fileIngressExecutor must be a function");let i=o&&a&&e?void 0:FBe(n);return{controlExecutor:o??(i?KBe(i):void 0),sessionMaintenanceExecutor:a??(i?xBe(i):void 0),fileIngressExecutor:e??YBe(i??{get:()=>{}})}}function b3(n){return n.map(t=>({id:t,canExecuteCommands:!0}))}function fg(n=[]){return ZQ({mode:"open",open:{defaultCanExecuteCommands:!0,commandPermissionOverrides:[]},allowlist:{users:b3(n)}})}function mc(n=[]){return ZQ({mode:"allowlist",open:{defaultCanExecuteCommands:!1,commandPermissionOverrides:[]},allowlist:{users:b3(n)}})}function Qg(n){return[...new Set((Array.isArray(n)?n:[n]).filter(t=>typeof t=="string"||typeof t=="number"||typeof t=="bigint").map(t=>String(t).trim()).filter(Boolean))]}function jBe(n){return Qg(n).map(t=>`${t.replace(/^\+/,"")}@s.whatsapp.net`)}function pr(n,t={}){let o=String(n??"").trim().toLowerCase();if(o==="weixin")return Cg({direct:mc(),group:mc()});if(o==="feishu"){let e=Qg(t.ownerOpenIds??t.ownerOpenId).includes("*")?fg():mc();return Cg({direct:e,group:e})}if(o==="qq"){let a=Qg(t.ownerUserOpenid);return Cg({direct:a.includes("*")?fg():mc(),group:fg()})}if(o==="telegram"){let a=Qg(t.allowedUsers);return(t.accessMode??"compatible")==="private-allowlist"?Cg({direct:mc(a),group:mc()}):Cg({direct:fg(a),group:fg()})}if(o==="whatsapp"){let a=t.accessMode??"self-only",e=jBe(t.allowedNumbers);return a==="open"?Cg({direct:fg(e),group:fg()}):Cg({direct:mc(a==="private-allowlist"?e:[]),group:mc()})}if(["dingtalk","wecom","slack","discord"].includes(o))return Cg({direct:fg(),group:fg()});throw new TypeError(`Unsupported access-policy channel: ${n}`)}function JBe(n,t={}){let o=String(n??"").trim().toLowerCase();if(o==="weixin")return Qg(t.ownerUserId);if(o==="feishu")return Qg(t.ownerOpenIds??t.ownerOpenId).filter(a=>a!=="*");if(o==="dingtalk"){let a=Array.isArray(t.approvedSenders)?t.approvedSenders:[];return Qg(a.map(e=>e?.staffId))}return o==="qq"?Qg(t.ownerUserOpenid).filter(a=>a!=="*"):o==="whatsapp"?Qg(t.accountJid):[]}function Wi(n,t,{channel:o,config:a,equals:e}={}){if(!n||typeof n.accessPolicyFor!="function")throw new TypeError("A workspace store with access policies is required");let i=new Set(JBe(o,a)),A=typeof e=="function"?e:(r,s)=>r===s;return Object.freeze({botId:t,getSettings:()=>n.accessPolicyFor(t),isPrivileged(r,s){if(!["direct","group"].includes(s))return!1;let g=Array.isArray(r)?r:[r];try{return g.some(c=>typeof c=="string"&&[...i].some(I=>A(c.trim(),I)===!0))}catch{return!1}}})}function VBe(n){let t=VI(n.dshHome??process.env.DSH_HOME??pu(zBe(),".dsh")),o=VI(n.dataDir??pu(t,"integrations","dsh-dingtalk"));return{root:o,config:VI(n.configPath??pu(o,"config.json")),bots:VI(n.botsDir??pu(o,"bots")),workspaces:VI(n.workspacesPath??pu(o,"workspaces.json"))}}async function mT(n,t={},o={}){if(!n?.credentials)throw new TypeError("dsh-dingtalk requires ctx.credentials");let a=si(n,t),e=o.ConfigStore??TQ,i=o.DeviceAuth??RQ,A=o.StateStore??WQ,r=o.HarnessClient??ry,s=o.Controller??XE,g=o.Runtime??nu,c=o.createConnectionSupervisor??BT,I=typeof n.logger=="function"?n.logger("dsh-dingtalk"):n.logger??console,p=()=>xi(n),B=VBe(t),f=await new e(B.config).load(),Q=VI(t.workspace??process.cwd()),y=o.WorkspaceStore??ni,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=typeof f.list=="function",_=T?f.list():[];T&&await m.reconcile(_.map(X=>X.botId)),await Promise.all(_.map(X=>m.ensure(X.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("dingtalk",X)})));let R=typeof f.remove=="function"?Yi(f,{workspaces:m}):f,L=o.deviceAuth??new i({baseUrl:t.registrationBaseUrl}),U=new Map,F=X=>VI(B.bots,X,"state.json"),q=async X=>{let ie=U.get(X);return ie||(ie=await new A(F(X)).load(),U.set(X,ie)),ie},z=zi(n,o.commandExecutor),{controlExecutor:K,sessionMaintenanceExecutor:G,fileIngressExecutor:V}=Vi(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),H=new r({...a,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...z?{commandExecutor:z}:{},...K?{controlExecutor:K}:{},...G?{sessionMaintenanceExecutor:G}:{},...V?{fileIngressExecutor:V}:{}}),N=new s({deviceAuth:L,credentials:n.credentials,configStore:R,logger:I,createRuntime:async({botId:X,config:ie,clientSecret:De})=>{let oe=await q(X);await m.ensure(X,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("dingtalk",ie)});let Se=ji(H,{botId:X,workspaces:m,state:oe,agentPresetCatalog:p});return new g({config:ie,clientSecret:De,harness:Se.harness,state:Se.state,contextEnhancement:{botId:X,getSettings:()=>m.contextEnhancementFor(X)},accessPolicy:Wi(m,X,{channel:"dingtalk",config:ie}),groupSessionScope:{getScope:()=>m.groupSessionScopeFor(X)},replyTimeoutMs:t.replyTimeoutMs??6e5,maxMessageChars:t.maxMessageChars??4e3,connectTimeoutMs:t.connectTimeoutMs??15e3,logger:{error:(...Be)=>I.error?.(`[${X}]`,...Be),warn:(...Be)=>I.warn?.(`[${X}]`,...Be),info:(...Be)=>I.info?.(`[${X}]`,...Be),debug:(...Be)=>I.debug?.(`[${X}]`,...Be)}})},deleteState:async({botId:X})=>{let ie=U.get(X);if(U.delete(X),ie&&typeof ie.remove=="function")await ie.remove();else try{await qBe(F(X))}catch(De){if(De?.code!=="ENOENT")throw De}}}),k=Ji(N,{workspaces:m,stateFor:q,agentPresetCatalog:p}),J=c({controller:k,harness:H,logger:I,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:k,deliveryAdapter:qi({channel:"dingtalk",workspaces:m,coreController:N,stateFor:q}),ready:J.ready,async close(){await J.close(),await k.close(),H.stopManagedProcess()}}}import $Be from"qrcode";var Fa="bot.context-enhancement.set";function Zi(n){try{return!n||typeof n!="object"||Array.isArray(n)||Reflect.ownKeys(n).length!==2||!Object.hasOwn(n,"botId")||!Object.hasOwn(n,"config")||typeof n.botId!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(n.botId)?!1:(jI(n.config),!0)}catch{return!1}}var Xi="bot.access-policy.set";function $i(n){try{return!n||typeof n!="object"||Array.isArray(n)||Reflect.ownKeys(n).length!==2||!Object.hasOwn(n,"botId")||!Object.hasOwn(n,"policy")||typeof n.botId!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(n.botId)?!1:(fc(n.policy),!0)}catch{return!1}}var ea="bot.group-session-scope.set";function Aa(n){try{return!n||typeof n!="object"||Array.isArray(n)||Reflect.ownKeys(n).length!==2||!Object.hasOwn(n,"botId")||!Object.hasOwn(n,"groupSessionScope")||typeof n.botId!="string"||!/^[A-Za-z0-9_-]{1,128}$/.test(n.botId)?!1:(Xp(n.groupSessionScope),!0)}catch{return!1}}var WBe=new Set(["loopback","trusted-host"]);function mr(n){if(n===void 0)return"loopback";if(WBe.has(n))return n;throw new TypeError('dsh-im rpcAuthority must be "loopback" or "trusted-host"')}import{isAbsolute as ZBe}from"node:path";var La="bot.workspace.set";function ta(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)&&Object.keys(n).every(t=>["botId","workspace"].includes(t))&&typeof n.botId=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n.botId)&&typeof n.workspace=="string"&&n.workspace.length<=4096&&ZBe(n.workspace.trim())}function ra(n){return["workspace-not-absolute","workspace-not-found","workspace-not-directory","workspace-bot-not-found","agent-preset-invalid","agent-preset-unavailable","context-enhancement-invalid"].includes(n?.code)?{code:n.code,message:n.message}:null}var Ua="bot.preset.set";function XBe(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function ia(n){return XBe(n)&&Object.keys(n).every(t=>["botId","agentPreset"].includes(t))&&typeof n.botId=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n.botId)&&(n.agentPreset===null||typeof n.agentPreset=="string"&&Y_.test(n.agentPreset))}var _3="/dingtalk",Nt=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:La,setAgentPreset:Ua,setContextEnhancement:Fa,setAccessPolicy:Xi,setGroupSessionScope:ea,approveSender:"bot.sender.approve",revokeSender:"bot.sender.revoke"}),T3=Object.freeze(Object.values(Nt)),efe=new Set(["clientSecret","client_secret","deviceCode","device_code","secretRef","staffId","senderStaffId","verificationUrl","verificationUri","userCode"]);function Iy(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function Sc(n,t){return Iy(n)&&Object.keys(n).every(o=>t.includes(o))}function WI(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function M3(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function Afe(n,t){return Iy(t)?n===Nt.status?Sc(t,[])?null:"connection.status does not accept fields.":n===Nt.beginProvisioning?Sc(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[Nt.pollProvisioning,Nt.cancelProvisioning].includes(n)?Sc(t,["attemptId"])&&WI(t.attemptId)?null:`${n} requires an attemptId.`:n===Nt.bindCredentials?Sc(t,["clientId","clientSecret"])&&M3(t.clientId,256)&&M3(t.clientSecret,1024)?null:"bot.bind-credentials requires Client ID and Client Secret.":n===Nt.reconnectBot?Sc(t,["botId","sendTest"])&&WI(t.botId)&&(t.sendTest===void 0||t.sendTest===!0)?null:"bot.reconnect requires a botId and optional sendTest=true.":n===Nt.deleteBot?Sc(t,["botId","confirm"])&&WI(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Nt.setWorkspace?ta(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Nt.setAgentPreset?ia(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Nt.setContextEnhancement?Zi(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===Nt.setAccessPolicy?$i(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===Nt.setGroupSessionScope?Aa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u7FA4\u4F1A\u8BDD\u7B56\u7565\u3002":n===Nt.approveSender?Sc(t,["botId","requestId","confirm"])&&WI(t.botId)&&WI(t.requestId)&&t.confirm===!0?null:"bot.sender.approve requires botId, requestId, and confirm=true.":n===Nt.revokeSender?Sc(t,["botId","senderKey","confirm"])&&WI(t.botId)&&WI(t.senderKey)&&t.confirm===!0?null:"bot.sender.revoke requires botId, senderKey, and confirm=true.":"Unknown DingTalk endpoint.":"Payload must be an object."}function cy(n){return{ok:!1,error:{code:"bad-request",message:n}}}function du(){return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}}function tfe(){return{ok:!1,error:{code:"dingtalk-operation-failed",message:"\u9489\u9489\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}function rfe(n){if(n?.name!=="DingtalkPublicConnectionError"||!Iy(n.publicError))return null;let t=n.publicError,o=typeof t.code=="string"&&/^[a-z][a-z\d-]{1,79}$/.test(t.code)?t.code:null,a=typeof t.message=="string"&&t.message.trim()?t.message.trim().slice(0,240):null,e=typeof t.hint=="string"&&t.hint.trim()?t.hint.trim().slice(0,480):null,i=typeof t.referenceId=="string"&&/^DT-CONN-[A-F0-9]{8}$/.test(t.referenceId)?t.referenceId:null;return o&&a&&e&&i?{code:o,message:a,hint:e,referenceId:i}:null}function td(n){if(Array.isArray(n))return n.map(td);if(!Iy(n))return n;let t={};for(let[o,a]of Object.entries(n))efe.has(o)||(t[o]=td(a));return t}async function ife(n){return $Be.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function ST(n,t){return!n||typeof n.verificationUrl!="string"?td(n):td({...n,qrCodeDataUrl:await t(n.verificationUrl)})}async function On(n,t){let o=structuredClone(n);return o?.provisioning&&(o.provisioning=await ST(o.provisioning,t)),td(o)}function afe(n){for(let t of["status","startProvisioning","registrationStatus","cancelProvisioning","bindCredentials","reconnectBot","deleteBot","approveSender","revokeSender"])if(typeof n?.[t]!="function")throw new TypeError(`A complete DingTalk controller is required (${t})`)}function N3(n,{encodeQr:t=ife}={}){afe(n);let o=new Map,a=e=>{let i=o.get(e);return i||(o.size>=16&&o.delete(o.keys().next().value),i=Promise.resolve().then(()=>t(e)),o.set(e,i)),i};return async(e,i,A)=>{if(A?.aborted)return du();if(!T3.includes(e))return cy("Unknown DingTalk endpoint.");let r=Afe(e,i);if(r)return cy(r);try{let s;if(e===Nt.status)s=await On(await n.status(),a);else if(e===Nt.beginProvisioning){let g=await n.startProvisioning({signal:A});if(A?.aborted)return await n.cancelProvisioning(g.attemptId),du();s=await ST(g,a)}else if(e===Nt.pollProvisioning){let g=await n.registrationStatus(i.attemptId);if(!g)return cy("The provisioning attempt no longer exists.");s=await ST(g,a)}else if(e===Nt.cancelProvisioning){if(s=await n.cancelProvisioning(i.attemptId),!s)return cy("The provisioning attempt no longer exists.");s=td(s)}else if(e===Nt.bindCredentials)s=await On(await n.bindCredentials(i),a);else if(e===Nt.reconnectBot){let g=await n.reconnectBot(i.botId);if(A?.aborted)return du();let c;if(i.sendTest===!0)if(!g?.bots?.some(p=>p?.botId===i.botId&&p?.connected===!0)||typeof n.sendConnectionTest!="function")c=lr(Qr("\u9489\u9489\u673A\u5668\u4EBA"));else try{await n.sendConnectionTest(i.botId),c=lr()}catch(p){c=lr(p)}s=await On({...g,...c?{testMessage:c}:{}},a)}else if(e===Nt.deleteBot)s=await On(await n.deleteBot(i.botId),a);else if(e===Nt.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await On(await n.updateWorkspace(i.botId,i.workspace),a)}else if(e===Nt.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(i.botId,i.config,g=>On(g,a))}else if(e===Nt.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(i.botId,i.policy,g=>On(g,a))}else if(e===Nt.setGroupSessionScope){if(typeof n.updateGroupSessionScope!="function")throw new Error("Group session scope update is unavailable");s=await n.updateGroupSessionScope(i.botId,i.groupSessionScope,g=>On(g,a))}else if(e===Nt.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await On(await n.updateAgentPreset(i.botId,i.agentPreset),a)}else e===Nt.approveSender?s=await On(await n.approveSender(i.botId,i.requestId),a):s=await On(await n.revokeSender(i.botId,i.senderKey),a);return A?.aborted?du():{ok:!0,value:s}}catch(s){let g=ra(s),c=rfe(s);return A?.aborted?du():g?{ok:!1,error:g}:c?{ok:!1,error:c}:tfe()}}}function ly(n,t,o,a){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(_3,N3(t,o),{authority:mr(a)})}async function R3(n,t={}){if(t?.controller)return ly(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await mT(n,t,t.internals),a=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=ly(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await a?.(),await o.close()},"dsh-dingtalk: close bot connections"),e}import{createHash as ofe}from"node:crypto";import{mkdir as nfe,readFile as sfe,rename as gfe,unlink as cfe,writeFile as Ife}from"node:fs/promises";import{dirname as lfe}from"node:path";var wT=Object.freeze({version:1,bots:Object.freeze([])});function yg(n){return typeof n=="string"&&n.trim()?n.trim():null}function k3(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hu(n,{botPrefix:t,tokenRefPrefix:o}){let a=yg(n);if(!a)throw new TypeError("platformId is required");let e=ofe("sha256").update(a).digest("hex").slice(0,24);return{botId:`${t}_${e}`,tokenRef:`${o}_${e.toUpperCase()}`}}function py(n,t){let o=yg(n)??"";return o.length<=10?o?`${o.slice(0,3)}\u2022\u2022\u2022`:t:`${o.slice(0,6)}\u2022\u2022\u2022\u2022${o.slice(-4)}`}var rd=class{#e;#A;#t;#r;#I;#o;#c;#i=wT;#a=Promise.resolve();constructor(t,{channel:o,botPrefix:a,tokenRefPrefix:e,normalizeBotExtension:i=()=>({})}){if(typeof i!="function")throw new TypeError("normalizeBotExtension must be a function");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=new RegExp(`^${k3(a)}_[a-f0-9]{24}$`),this.#c=new RegExp(`^${k3(e)}_[A-F0-9]{24}$`)}async load(){try{let t=this.#p(JSON.parse(await sfe(this.#e,"utf8")));if(!t)throw new Error(`dsh-im ${this.#A} config contains invalid bot data`);this.#i=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#i=wT}return this}list(){return structuredClone(this.#i.bots)}get(t){let o=this.#i.bots.find(a=>a.botId===t);return o?structuredClone(o):null}getByPlatformId(t){let o=this.#i.bots.find(a=>a.platformId===t);return o?structuredClone(o):null}async save(t){let o=this.#s(t);if(!o)throw new Error(`Refusing to persist incomplete ${this.#A} bot data`);return this.#g(a=>{let e=a.find(r=>r.platformId===o.platformId&&r.botId!==o.botId),i=a.find(r=>r.tokenRef===o.tokenRef&&r.botId!==o.botId);if(e||i)throw new Error(`Duplicate ${this.#A} bot identity`);let A=a.findIndex(r=>r.botId===o.botId);return A===-1?a.push(o):a[A]=o,structuredClone(o)})}async remove(t){if(!this.#o.test(t))throw new TypeError(`Invalid ${this.#A} bot id`);return this.#g(o=>{let a=o.findIndex(i=>i.botId===t);if(a===-1)return null;let[e]=o.splice(a,1);return structuredClone(e)})}async clear(){let t=this.#a.then(async()=>{try{await cfe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#i=wT});this.#a=t.then(()=>{},()=>{}),await t}#s(t){if(!t||typeof t!="object")return null;let o=yg(t.platformId),a=yg(t.botId),e=yg(t.tokenRef),i=yg(t.name);if(!o||!a||!e||!i||!this.#o.test(a)||!this.#c.test(e))return null;let A=hu(o,{botPrefix:this.#t,tokenRefPrefix:this.#r});if(A.botId!==a||A.tokenRef!==e)return null;let r=this.#I(t);return!r||typeof r!="object"||Array.isArray(r)?null:Object.freeze({botId:a,platformId:o,tokenRef:e,name:i,username:yg(t.username),createdAt:yg(t.createdAt)??new Date().toISOString(),connectedAt:yg(t.connectedAt),...r})}#p(t){if(!t||t.version!==1||!Array.isArray(t.bots))return null;let o=t.bots.map(A=>this.#s(A));if(o.some(A=>A===null))return null;let a=new Set,e=new Set,i=new Set;for(let A of o){if(a.has(A.botId)||e.has(A.platformId)||i.has(A.tokenRef))return null;a.add(A.botId),e.add(A.platformId),i.add(A.tokenRef)}return Object.freeze({version:1,bots:Object.freeze(o)})}async#g(t){let o,a=this.#a.then(async()=>{let e=[...this.#i.bots];o=t(e);let i=Object.freeze({version:1,bots:Object.freeze(e)});await this.#l(i),this.#i=i});return this.#a=a.then(()=>{},()=>{}),await a,o}async#l(t){await nfe(lfe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await Ife(o,`${JSON.stringify(t,null,2)} `,{encoding:"utf8",mode:384}),await gfe(o,this.#e)}};var v3=Object.freeze({botPrefix:"discord",tokenRefPrefix:"DSH_DISCORD_BOT_TOKEN"});function P3(n){return hu(n,v3)}function G3(n){return py(n,w("Discord\u673A\u5668\u4EBA"))}var dy=class extends rd{constructor(t){super(t,{channel:"Discord",...v3})}};function Eu(n){return typeof n=="string"&&n.trim()?n.trim():null}function uu(n,t){return Object.freeze({code:n,message:t})}var id=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s=new Map;#p=new Map;#g=new Map;#l=0;#n=!1;constructor({descriptor:t,credentials:o,configStore:a,inspectToken:e,deriveIdentity:i,maskPlatformId:A,createRuntime:r,deleteState:s=async()=>{},logger:g=console}){if(!t?.key||!t?.label||!t?.connectionLabel)throw new TypeError("TokenBotController requires a channel descriptor");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError(`${t.label} requires the DSH credential provider`);if(!a||typeof a.list!="function"||typeof a.save!="function"||typeof a.remove!="function")throw new TypeError(`${t.label} requires a config store`);if(typeof e!="function"||typeof i!="function"||typeof A!="function"||typeof r!="function")throw new TypeError(`${t.label} controller dependencies are incomplete`);this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g}async initialize(){if(this.#n)return this.status();for(let t of this.#t.list())await this.#B(t.botId,async()=>{if(this.#n||this.#s.get(t.botId)?.status?.ready)return;let o=await this.#C(t.tokenRef);if(!o){this.#p.set(t.botId,uu("missing-token",w("{label}\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002",{label:this.#e.label})));return}try{await this.#h(t,o),this.#p.delete(t.botId)}catch(a){this.#p.set(t.botId,uu("connection-failed",w("{label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002",{label:this.#e.label}))),this.#a.warn?.(`[dsh-im:${this.#e.key}] bot ${t.botId} failed to initialize:`,a)}finally{this.#f()}});return this.status()}async bindCredentials({token:t}={}){if(this.#n)throw new Error(`${this.#e.label} controller is closed`);let o=Eu(t);if(!o)throw new TypeError(`${this.#e.label} Bot Token is required`);let a=await this.#r(o),e=Eu(a?.platformId),i=Eu(a?.name);if(!e||!i)throw new Error(`${this.#e.label} returned an invalid bot identity`);let A=this.#I(e);return await this.#B(A.botId,async()=>{if(this.#n)throw new Error(`${this.#e.label} controller is closed`);let r=this.#t.getByPlatformId(e),s=await this.#A.resolve(A.tokenRef).catch(()=>{}),g={botId:A.botId,platformId:e,tokenRef:A.tokenRef,name:i,username:Eu(a.username),createdAt:r?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};await this.#A.set(A.tokenRef,o);try{await this.#t.save(g)}catch(c){throw await this.#u(A.tokenRef,s),c}try{await this.#h(g,o),this.#p.delete(A.botId)}catch(c){this.#p.set(A.botId,uu("connection-failed",w("{label}\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002",{label:this.#e.label}))),this.#a.warn?.(`[dsh-im:${this.#e.key}] bot ${A.botId} credential connection failed:`,c)}this.#f()}),this.status()}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error(`Unknown ${this.#e.label} bot`);return await this.#B(t,async()=>{let a=await this.#C(o.tokenRef);if(!a)throw new Error(`${this.#e.label} bot token is missing`);try{await this.#h(o,a),this.#p.delete(t)}catch(e){throw this.#p.set(t,uu("connection-failed",w("{label}\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{label:this.#e.label}))),e}finally{this.#f()}}),this.status()}async updateBotConfig(t,o){if(this.#n)throw new Error(`${this.#e.label} controller is closed`);if(typeof o!="function")throw new TypeError("Bot config update must be a function");return await this.#B(t,async()=>{if(this.#n)throw new Error(`${this.#e.label} controller is closed`);let a=this.#t.get(t);if(!a)throw new Error(`Unknown ${this.#e.label} bot`);let e=await this.#C(a.tokenRef);if(!e)throw new Error(`${this.#e.label} bot token is missing`);if(this.#n)throw new Error(`${this.#e.label} controller is closed`);let i=o(a),A=await this.#t.save(i);try{await this.#h(A,e),this.#p.delete(t)}catch(r){throw this.#p.set(t,uu("connection-failed",w("{label}\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{label:this.#e.label}))),r}finally{this.#f()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error(`Unknown ${this.#e.label} bot`);return this.#B(t,async()=>{let a=this.#s.get(t);if(!a?.status?.ready||typeof a.sendConnectionTest!="function"){let i=new Error(w("{label}\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5",{label:this.#e.label}));throw i.code="test-target-unavailable",i}let e=w("{name}\uFF08{id}\uFF09",{name:o.name,id:this.#o(o.platformId)});return await a.sendConnectionTest(Ui(e,w("{label}\u673A\u5668\u4EBA",{label:this.#e.label}))),{sent:!0}})}async sendProactiveText(t,o,a,e={}){if(!this.#t.get(t))throw new Error(`Unknown ${this.#e.label} bot`);return this.#B(t,async()=>{let A=this.#s.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("{label}\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5",{label:this.#e.label}));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,a,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error(`Unknown ${this.#e.label} bot`);return await this.#B(t,async()=>{let a=await this.#A.resolve(o.tokenRef).catch(()=>{});await this.#d(t);try{await this.#A.unset(o.tokenRef),await this.#t.remove(t)}catch(e){throw a?.value&&(await this.#A.set(o.tokenRef,a.value).catch(()=>{}),await this.#h(o,a.value).catch(()=>{})),new Error(`Unable to remove the ${this.#e.label} bot safely.`,{cause:e})}await this.#i({botId:t,config:o}).catch(e=>{this.#a.warn?.(`[dsh-im:${this.#e.key}] bot ${t} state cleanup failed:`,e)}),this.#p.delete(t),this.#f()}),this.status()}status(){let t=this.#t.list().map(a=>{let e=this.#s.get(a.botId)?.status??null,i=e?.ready===!0&&e.connectionState==="connected"&&e.harnessReachable===!0,A=i?"connected":e?.connectionState==="connecting"?"connecting":this.#p.has(a.botId)||e?.connectionState==="failed"?"error":"offline";return{botId:a.botId,state:A,connected:i,configured:!0,bot:{name:a.name,username:a.username,idMasked:this.#o(a.platformId)},health:{status:i?"healthy":A==="error"?"error":"offline",summary:i?w("{label}{connectionLabel}\u8FD0\u884C\u6B63\u5E38",{label:this.#e.label,connectionLabel:w(this.#e.connectionLabel)}):A==="error"?w("{label}\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5",{label:this.#e.label}):w("{label}\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF",{label:this.#e.label}),lastCheckedAt:e?.lastCheckedAt??null,lastConnectedAt:e?.lastConnectedAt??null},stats:{messagesReceived:e?.messagesReceived??0,messagesReplied:e?.messagesReplied??0},lastMessageError:ti(e?.lastMessageError),error:structuredClone(this.#p.get(a.botId)??null)}}),o=t.filter(a=>a.connected).length;return{schemaVersion:1,revision:this.#l,state:t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o}}}async close(){this.#n||(this.#n=!0,await Promise.allSettled([...this.#g.values()]),await Promise.allSettled([...this.#s.keys()].map(t=>this.#d(t))))}async#h(t,o){if(this.#n)throw new Error(`${this.#e.label} controller is closed`);if(await this.#d(t.botId),this.#n)throw new Error(`${this.#e.label} controller is closed`);let a=await this.#c({botId:t.botId,config:t,token:o});if(!a||typeof a.start!="function"||typeof a.stop!="function")throw new TypeError(`createRuntime returned an invalid ${this.#e.label} runtime`);this.#s.set(t.botId,a);try{await a.start()}catch(e){throw await a.stop().catch(()=>{}),this.#s.delete(t.botId),e}}async#d(t){let o=this.#s.get(t);this.#s.delete(t),await o?.stop().catch(a=>{this.#a.warn?.(`[dsh-im:${this.#e.key}] bot ${t} failed to stop cleanly:`,a)})}async#C(t){let o=await this.#A.resolve(t).catch(()=>{});return Eu(o?.value)}async#u(t,o){o?.value?await this.#A.set(t,o.value).catch(()=>{}):await this.#A.unset(t).catch(()=>{})}#B(t,o){let i=(this.#g.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#g.get(t)===i&&this.#g.delete(t)});return this.#g.set(t,i),i}#f(){this.#l+=1}};import{createHash as pfe}from"node:crypto";var dfe="https://discord.com/api/v10/",hfe=12e4,Efe=new Set([50001,50013]),ufe=new Set([40005]);function hs(n){return typeof n=="string"&&n.trim()?n.trim():null}function F3(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}function DT(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function Cfe(n,t){if(!Number.isInteger(n)||n<1)throw new TypeError(`${t} must be a positive integer`);return n}function U3(n,t){return t?.providerCode!==void 0&&(n.providerCode=t.providerCode),t?.retry_after!==void 0&&(n.retry_after=t.retry_after,n.retryAfter=t.retry_after),Number.isInteger(t?.status)&&(n.status=t.status),n}function Bfe(n){let t=Number(n?.providerCode),o=Number(n?.status),a=hs(n?.message)??"",e="artifact-provider-rejected",i="Discord rejected the attachment.";o===401||o===403||Efe.has(t)?(e="artifact-permission-required",i="Discord denied permission to send the attachment."):o===413||ufe.has(t)||/(?:request|attachment|file).{0,24}too large/i.test(a)?(e="artifact-too-large",i="The attachment exceeds Discord's size limit."):o===429?(e="artifact-rate-limited",i="Discord rate-limited attachment delivery."):o>=500&&(e="artifact-delivery-uncertain",i="Discord attachment delivery result is uncertain.");let A=new Error(i,{cause:n});return A.code=e,U3(A,n)}function ffe(n){let t=new Error("Discord attachment delivery result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",U3(t,n)}function Qfe(n,t){return new Promise((o,a)=>{if(t?.aborted){a(t.reason??new DOMException("Aborted","AbortError"));return}let e=setTimeout(o,n);e?.unref?.(),t?.addEventListener("abort",()=>{clearTimeout(e),a(t.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function gi(n,t){let o=hs(n);if(!o||!/^\d{5,30}$/.test(o))throw new TypeError(`Invalid Discord ${t}`);return o}function L3(n){let t=hs(n);if(!t)throw new TypeError("A Discord reaction emoji is required");return t}function yfe(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]{20,}$/.test(n.trim())}var Cu=class{#e;#A;#t;#r;constructor({token:t,fetchImpl:o=fetch,baseUrl:a=dfe,fileUploadTimeoutMs:e=hfe}){if(!yfe(t))throw new TypeError("Discord Bot Token is invalid");if(typeof o!="function")throw new TypeError("DiscordApi requires fetch");this.#e=t.trim(),this.#A=o,this.#t=new URL(a),this.#r=Cfe(e,"fileUploadTimeoutMs")}getCurrentUser(t={}){return this.#I("users/@me",{...t,method:"GET"})}getGatewayBot(t={}){return this.#I("gateway/bot",{...t,method:"GET"})}getChannel({channelId:t,signal:o}={}){return this.#I(`channels/${gi(t,"channel id")}`,{method:"GET",signal:o})}getMessage({channelId:t,messageId:o,signal:a}={}){return this.#I(`channels/${gi(t,"channel id")}/messages/${gi(o,"message id")}`,{method:"GET",signal:a})}startThreadFromMessage({channelId:t,messageId:o,name:a,signal:e}={}){let i=hs(a);if(!i||[...i].length>100)throw new TypeError("Discord thread name must contain 1-100 characters");if(e?.aborted)throw DT(e);return this.#I(`channels/${gi(t,"channel id")}/messages/${gi(o,"message id")}/threads`,{method:"POST",signal:e,body:{name:i}})}createMessage({channelId:t,content:o,replyToMessageId:a,signal:e}){return this.#I(`channels/${gi(t,"channel id")}/messages`,{method:"POST",signal:e,body:{content:o,allowed_mentions:{parse:[],replied_user:!1},...a?{message_reference:{message_id:gi(a,"message id"),channel_id:gi(t,"channel id"),fail_if_not_exists:!1}}:{}}})}async createFileMessage({channelId:t,file:o,replyToMessageId:a,signal:e}){if(!o||typeof o!="object"||typeof o.fileName!="string"||!o.fileName||!Buffer.isBuffer(o.bytes))throw new TypeError("A Discord attachment is required");let i=hs(o.deliveryKey)??hs(o.artifactId),A=i?pfe("sha256").update(i).digest("hex").slice(0,25):void 0,r=new FormData;r.append("payload_json",JSON.stringify({allowed_mentions:{parse:[],replied_user:!1},attachments:[{id:0,filename:o.fileName}],...A?{nonce:A,enforce_nonce:!0}:{},...a?{message_reference:{message_id:gi(a,"message id"),channel_id:gi(t,"channel id"),fail_if_not_exists:!1}}:{}})),r.append("files[0]",new Blob([o.bytes],{type:o.mediaType??"application/octet-stream"}),o.fileName);let s=gi(t,"channel id");if(e?.aborted)throw DT(e);let g=F3(e,this.#r);try{return await this.#I(`channels/${s}/messages`,{method:"POST",signal:g,timeoutMs:this.#r,body:r,multipart:!0})}catch(c){throw e?.aborted?DT(e):c?.code?.startsWith?.("discord-")?Bfe(c):ffe(c)}}editMessage({channelId:t,messageId:o,content:a,signal:e}){return this.#I(`channels/${gi(t,"channel id")}/messages/${gi(o,"message id")}`,{method:"PATCH",signal:e,body:{content:a,allowed_mentions:{parse:[],replied_user:!1}}})}sendTyping({channelId:t,signal:o}){return this.#I(`channels/${gi(t,"channel id")}/typing`,{method:"POST",signal:o,expectBody:!1})}async addOwnReaction({channelId:t,messageId:o,emoji:a,signal:e}={}){let i=L3(a);return await this.#I(`channels/${gi(t,"channel id")}/messages/${gi(o,"message id")}/reactions/${encodeURIComponent(i)}/@me`,{method:"PUT",signal:e,expectBody:!1,retry:!1}),i}removeOwnReaction({channelId:t,messageId:o,emoji:a,signal:e}={}){let i=L3(a);return this.#I(`channels/${gi(t,"channel id")}/messages/${gi(o,"message id")}/reactions/${encodeURIComponent(i)}/@me`,{method:"DELETE",signal:e,expectBody:!1,retry:!1})}async#I(t,{method:o,body:a,signal:e,timeoutMs:i=15e3,expectBody:A=!0,retry:r=!0,multipart:s=!1}){let g;try{g=await this.#A(new URL(t,this.#t),{method:o,headers:{authorization:`Bot ${this.#e}`,...s?{}:{"content-type":"application/json"},"user-agent":"DeepSeek-Harness-dsh-im (https://github.com/xmanrui/dsh-im, 1.1.0)"},...a===void 0?{}:{body:s?a:JSON.stringify(a)},signal:F3(e,i),redirect:"error"})}catch(I){throw I?.name==="AbortError"||I?.name==="TimeoutError"?I:new Error(`Discord ${o} transport failed`)}let c=null;if(A||g.status===429||!g.ok)try{c=await g.json()}catch{if(A){let I=new Error(`Discord ${o} returned invalid JSON`);throw I.status=g?.status,I}}if(g.status===429&&r){let I=Math.min(1e4,Math.max(50,Number(c?.retry_after)*1e3||1e3));return await Qfe(I,e),this.#I(t,{method:o,body:a,signal:e,timeoutMs:i,expectBody:A,retry:!1,multipart:s})}if(!g.ok){let I=new Error(hs(c?.message)??`Discord API failed with HTTP ${g.status}`);I.code=`discord-${g.status}`,I.status=g.status,(Number.isInteger(c?.code)||typeof c?.code=="string")&&(I.providerCode=c.code);let p=Number(c?.retry_after);throw Number.isFinite(p)&&p>=0&&(I.retry_after=p,I.retryAfter=p),I}return A?c:null}};async function H3(n,t={}){let a=await new Cu({token:n,...t}).getCurrentUser();if(!a?.id||a?.bot!==!0)throw new Error("Discord token does not belong to a bot");return{platformId:String(a.id),name:hs(a.global_name)??hs(a.username)??w("Discord\u673A\u5668\u4EBA"),username:hs(a.username)}}var mfe=Object.freeze({success(){},error(){},clear(){},settled:()=>Promise.resolve()});function K3(n,t){!n||typeof n!="object"||(n[t]=(n[t]??0)+1)}async function Sfe(n,t){let o=AbortSignal.timeout(t),a,e=new Promise((i,A)=>{a=()=>A(o.reason??new DOMException("Timed out","TimeoutError")),o.addEventListener("abort",a,{once:!0})});try{return await Promise.race([n(o),e])}finally{o.removeEventListener("abort",a)}}function hy({adapter:n,target:t,reactions:o,status:a,logger:e=console,label:i="channel",timeoutMs:A=2e3}={}){if(!t||typeof n?.addReaction!="function"||typeof n?.removeReaction!="function"||typeof o?.processing!="string"||!o.processing||!Number.isSafeInteger(A)||A<=0)return mfe;let r=null,s=!1,g=async(B,f)=>{try{let Q=await Sfe(f,A);return K3(a,B==="add"?"reactionsAdded":"reactionsRemoved"),{ok:!0,value:Q}}catch(Q){return K3(a,"reactionErrors"),e.warn?.(`[dsh-im:${i}] status reaction ${B} failed:`,Q?.message??Q?.name??String(Q)),{ok:!1,value:null}}},c=async B=>{if(r!==null){let Q=r;r=null,await g("remove",y=>n.removeReaction(t,Q,{signal:y}))}if(typeof B!="string"||!B)return;let f=await g("add",Q=>n.addReaction(t,B,{signal:Q}));f.ok&&f.value!==void 0&&f.value!==null&&(r=f.value)},I=c(o.processing),p=B=>{s||(s=!0,I=I.then(()=>c(B),()=>c(B)),I.catch(()=>{}))};return Object.freeze({success:()=>p(o.success),error:()=>p(o.error),clear:()=>p(null),settled:()=>I})}var x3="\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002",wfe="\u4EFB\u52A1\u5DF2\u5B8C\u6210\u3002";function Ea(n){return typeof n=="string"?n.trim():""}function Dfe(n,t,o){return t.actor===o&&(n.kind!=="group"||n.addressed===!0)&&!kt(n)&&!bt(n)&&!!Ea(n.content)}function Ofe(n,t,o){let a=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim().slice(0,255)||w("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u7684\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:a});case"artifact-permission-required":return o?.key==="slack"?w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 Slack \u5E94\u7528\u7F3A\u5C11 files:write \u6743\u9650\u3002\u8BF7\u66F4\u65B0 Manifest\u3001\u91CD\u65B0\u5B89\u88C5\u5E94\u7528\u5E76\u91CD\u65B0\u8FDE\u63A5\u673A\u5668\u4EBA\u540E\u91CD\u8BD5\u3002",{name:a}):o?.key==="discord"?w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u673A\u5668\u4EBA\u7F3A\u5C11 Discord \u7684 Send Messages\u3001Attach Files \u6216 Read Message History \u6743\u9650\u3002",{name:a}):o?.key==="telegram"?w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46 Telegram \u4E0D\u5141\u8BB8\u673A\u5668\u4EBA\u5728\u5F53\u524D\u804A\u5929\u53D1\u9001\u6587\u6863\uFF0C\u8BF7\u68C0\u67E5\u804A\u5929\u6743\u9650\u3002",{name:a}):w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u673A\u5668\u4EBA\u6CA1\u6709\u6587\u4EF6\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u6E20\u9053\u6743\u9650\u3002",{name:a});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u6E20\u9053\u5927\u5C0F\u4E0A\u9650\uFF0C\u672A\u53D1\u9001\u3002",{name:a});case"artifact-empty":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u672A\u53D1\u9001\u3002",{name:a});case"artifact-invalid":case"artifact-changed":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:a});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5F53\u524D\u6E20\u9053\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:a});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002",{name:a});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5F53\u524D\u6E20\u9053\u6682\u65F6\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:a})}}function co(){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null,reactionsAdded:0,reactionsRemoved:0,reactionErrors:0}}var Es=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g=new Map;#l=new Map;#n=new Map;#h=new Map;#d=new Set;#C=new Set;#u;#B=new va;constructor({descriptor:t,bot:o,harness:a,state:e,contextEnhancement:i,accessPolicy:A,groupSessionScope:r=Wp,status:s=co(),logger:g=console,replyTimeoutMs:c=6e5,signal:I}){if(!t?.key||!t?.label)throw new TypeError("A channel descriptor is required");if(!o||typeof o.sendText!="function")throw new TypeError("A bot client is required");if(!a||!e)throw new TypeError("Harness client and state store are required");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g,this.#s=c,this.#p=I,this.#u=new _a({label:t.key,logger:g})}get status(){return structuredClone(this.#i)}#f(){let t=this.#c;return t&&typeof t=="object"&&typeof t.getScope=="function"?Zp(t.getScope()):Zp(t)}accept(t,{contextSnapshot:o,accessDecision:a}={}){if(this.#p?.aborted)return Promise.resolve();let e=Ea(t?.conversationId),i=t?.kind==="group"?"group":"direct",A={...t,kind:i,conversationId:e},r=Ea(A.messageId),s=Ea(A.senderId);if(!r||!s||!e||A.senderIsBot===!0||this.#r.hasSeen(r)||this.#h.has(r))return Promise.resolve();if(i==="group"&&A.addressed!==!0)return this.#i.messagesRejected+=1,this.#i.lastRejectedAt=new Date().toISOString(),this.#h.set(r,null),this.#w(A,r,null);if(this.#o||a){let I=kt(A),p=bt(A),B=a??Mi(this.#o,{conversationType:i,senderIds:[s,Ea(A.senderAlternateId),...Array.isArray(A.senderAliasIds)?A.senderAliasIds:[]].filter(Boolean),text:A.content,hasImages:I,hasFiles:p});if(!B.allowed)return this.#i.messagesRejected+=1,this.#i.lastRejectedAt=new Date().toISOString(),this.#h.set(r,null),this.#w(A,r,B.reason==="command-not-allowed"?w(go):B.reason==="sender-not-allowed"&&(A.kind!=="group"||A.addressed===!0)?w("\u4F60\u4E0D\u5728\u5F53\u524D\u673A\u5668\u4EBA\u7684\u8BBF\u95EE\u767D\u540D\u5355\u4E2D\u3002"):null,{recordReceived:B.reason==="command-not-allowed"||B.reason==="sender-not-allowed"})}this.#h.set(r,o===void 0?ai(this.#I,t?.kind):o);let g=hy({adapter:this.#A,target:A.kind==="direct"||A.addressed===!0?A.reactionTarget:null,reactions:this.#e.reactions,status:this.#i,logger:this.#a,label:this.#e.key});A.statusReaction=g;let c=this.#m(A,r,s);return c.then(()=>g.success(),()=>g.error()),c}#m(t,o,a){t.kind==="direct"&&bo(this.#r,t.connectionTestTarget??t.replyTarget);let e=E3({kind:t.kind,conversationId:t.conversationId,senderId:a,groupSessionScope:this.#f()}),i=this.#l.get(e),A=Ea(t.content),r=Pa(A);if(r&&t.kind==="group"&&t.addressed===!0)return this.#w(t,o,cs());if(r&&t.kind==="direct"){if(/^\/batch$/iu.test(A)&&(this.#g.has(e)||i||this.#u.hasPending(e)))return this.#w(t,o,Po());let p=this.#B.handle(e,A,{plainText:!!A&&t.plainText!==!1&&!kt(t)&&!bt(t)&&!Hr(t)});if(p.handled)return p.kind==="submit"?this.#Q({...t,content:p.prompt,batchSubmission:{token:p.token}},o,a,e):this.#w(t,o,p.message)}else if(t.kind==="direct"&&this.#B.status(e).phase==="collecting"){let I=this.#B.handle(e,A,{plainText:!!A&&t.plainText!==!1&&!kt(t)&&!bt(t)&&!Hr(t)});if(I.handled)return this.#w(t,o,I.message)}let g=t.kind==="direct"&&this.#B.status(e).phase==="collecting"?null:Ki(A)?oo:bt(t)?null:la(A)?Ra:pa(A)?no:da(A)?ka:null;if(g&&(t.kind!=="group"||t.addressed===!0)){let I;return I=this.#y(t,o,e,g).finally(()=>{this.#h.delete(o),this.#C.delete(I)}),this.#C.add(I),I}let c=this.#u.claimReply({key:e,actor:a,messageId:o,text:kt(t)||bt(t)?"":t.content,addressed:t.kind!=="group"||t.addressed===!0,hasPendingQuestion:!!i,questionCompletion:i?.submitting||i?.claimedReplyMessageId?i.queue:null,isQuestionPending:()=>this.#l.has(e),send:I=>this.#A.sendText(t.replyTarget,I)});if(c){let I;return I=c.process(async()=>this.#r.hasSeen(o)?!1:(await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString(),!0)).finally(()=>{this.#h.delete(o),this.#d.delete(I)}),this.#d.add(I),I}if(i&&i.actor!==a)return this.#Q(t,o,a,e);if(i?.submitting||i?.claimedReplyMessageId)return this.#Q(t,o,a,e);if(i){Dfe(t,i,a)&&(i.claimedReplyMessageId=o);let p=(i.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#k(t,o,a,e,i)).finally(()=>{this.#h.delete(o),i.claimedReplyMessageId===o&&(i.claimedReplyMessageId=null),i.queue===p&&(i.queue=null)});return i.queue=p,p}return this.#Q(t,o,a,e)}#w(t,o,a,{recordReceived:e=!0}={}){let i;return i=(async()=>{this.#r.hasSeen(o)||(await this.#r.markSeen(o),e&&(this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString()),a&&await this.#A.sendText(t.replyTarget,a),this.#i.lastError=null)})().catch(async A=>{if(this.#p?.aborted){t.statusReaction?.clear();return}t.statusReaction?.error(),this.#i.lastError=A?.message??String(A);let r=rt(this.#i,A);this.#a.error?.(`[dsh-im:${this.#e.key}] failed to process a batch input message [${r.referenceId}]:`,A)}).finally(()=>{this.#h.delete(o),this.#C.delete(i)}),this.#C.add(i),i}#Q(t,o,a,e,{releaseMessageId:i=!0,alreadyRecorded:A=!1}={}){let s=(this.#g.get(e)??Promise.resolve()).catch(()=>{}).then(()=>this.#E(t,o,a,e,{alreadyRecorded:A})).finally(()=>{i&&this.#h.delete(o),this.#g.get(e)===s&&this.#g.delete(e)});return this.#g.set(e,s),s}async waitForIdle(){await Promise.allSettled([...this.#g.values(),...[...this.#l.values()].flatMap(t=>t.queue?[t.queue]:[]),...this.#d,...this.#C])}async#y(t,o,a,e){if(this.#r.hasSeen(o))return;await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString();let i=t.replyTarget;try{let A=await e(Ea(t.content),this.#t,this.#r,a,{signal:this.#p,isDirect:t.kind==="direct",hasImages:kt(t),hasFiles:bt(t),pendingInteraction:this.#l.has(a)||this.#u.hasPending(a),control:{owner:this,key:a}});A?.stopped&&await Promise.allSettled([this.#G(a),this.#u.closeRoute(a)]);for(let r of A?.messages??[A?.message])r&&await this.#A.sendText(i,r);this.#i.lastError=null}catch(A){if(A?.code==="turn-stopped"||this.#p?.aborted){t.statusReaction?.clear();return}t.statusReaction?.error(),this.#i.lastError=A?.message??String(A);let r=rt(this.#i,A);this.#a.error?.(`[dsh-im:${this.#e.key}] failed to process a command [${r.referenceId}]:`,A),await this.#A.sendText(i,ut(r)).catch(()=>{})}}sendConnectionTest(t){return Ec({state:this.#r,text:t,channelLabel:w("{label}\u673A\u5668\u4EBA",{label:this.#e.label}),send:(o,a)=>this.#A.sendText(o,a)})}sendProactiveText(t,o,{signal:a}={}){return a?.throwIfAborted(),this.#A.sendText(t,o)}async#b(t,o,a=[],e){let i=await Lo({artifacts:a,baseReceipt:e,deliveryId:o,channelKey:this.#e.key,signal:this.#p,sendImage:typeof this.#A.sendImage=="function"?A=>this.#A.sendImage(t,A):void 0,sendFile:typeof this.#A.sendFile=="function"?A=>this.#A.sendFile(t,A):void 0,onFailure:(A,r)=>rt(this.#i,r,{userMessage:Ofe(A?.fileName,r,this.#e),reason:r?.code}),sendFailureNotice:(A,r,s)=>this.#A.sendText(t,ut(s)),logger:this.#a});return this.#i.artifactsSent=(this.#i.artifactsSent??0)+i.artifactsSent,this.#i.artifactSendErrors=(this.#i.artifactSendErrors??0)+i.artifactSendErrors,{receipt:i.receipt,userVisible:i.userVisible,artifactSendErrors:i.artifactSendErrors}}async#E(t,o,a,e,{alreadyRecorded:i=!1}={}){if(!i){if(this.#r.hasSeen(o))return;await this.#r.markSeen(o),this.#i.messagesReceived+=1,this.#i.lastMessageAt=new Date().toISOString()}let A=t.replyTarget,r=Ea(t.content),s=t.batchSubmission,g=null,c=!1;try{if(this.#p?.throwIfAborted(),t.kind==="group"&&t.addressed!==!0){this.#i.messagesRejected+=1,this.#i.lastRejectedAt=new Date().toISOString();return}let I=kt(t),p=bt(t),B=Hr(t);if(!r&&!I&&!p&&!B){await this.#A.sendText(A,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u548C\u6587\u4EF6\u6D88\u606F\u3002"));return}let f=r.toLowerCase();if(!I&&!p&&f==="/help"){await this.#A.sendText(A,[w("{label}\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002",{label:this.#e.label}),"",w("\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u6216\u6587\u4EF6\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002"),w("/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD"),w("/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587"),w("/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09"),w("/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A"),w("/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"),w("/ws\u3001/wsl\u3001/workspaces \u5DE5\u4F5C\u533A\u547D\u4EE4\u522B\u540D"),w("/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"),w("/sessionlist --limit N \u4EC5\u5217\u51FA\u5F53\u524D\u5DE5\u4F5C\u533A\u524D N \u4E2A\u4F1A\u8BDD"),w("/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD"),w("/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B"),w("/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7"),w("/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7"),w("/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B"),w("\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]"),w("/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset"),w("/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset"),w("\u7EAF\u6570\u5B57 ID\uFF1A/preset id:"),w("/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"),w("/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1"),w("/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1"),w("/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09"),w("/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21"),w("/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21"),w("/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001"),w("/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C"),w("/help \u663E\u793A\u672C\u5E2E\u52A9")].join(` `));return}if(!I&&!p&&f==="/status"){await this.#t.ensureRunning({signal:this.#p}),await this.#A.sendText(A,w("{label}\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002",{label:this.#e.label}));return}let Q=!I&&!p?await Ro(r,this.#t,e):null;if(Q){for(let N of Q.messages??[Q.message])await this.#A.sendText(A,N);return}if(!I&&!p&&f==="/new"){await this.#r.clearSession(e),await this.#A.sendText(A,w("\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"));return}let y=!I&&!p?await Na(r,this.#t,this.#r,e,{signal:this.#p}):null;if(y){await this.#A.sendText(A,y.message);return}await this.#A.sendTyping?.(A).catch(N=>{this.#a.warn?.(`[dsh-im:${this.#e.key}] typing indicator failed:`,N)});let m=!1;if(typeof this.#A.openDeliveryStream=="function")try{g=await this.#A.openDeliveryStream(A),c=!0}catch(N){this.#a.warn?.(`[dsh-im:${this.#e.key}] unable to start a semantic reply stream; using final delivery:`,N)}else if(typeof this.#A.openStream=="function")try{g=await this.#A.openStream(A)}catch(N){this.#a.warn?.(`[dsh-im:${this.#e.key}] unable to start a streamed reply; using text:`,N)}let T=I||B?await Uo(t,{signal:this.#p}):void 0,_=this.#h.get(o),R=!1;if(_){let N=T??r,k=t.contextSource?.();T=vo(N,_,()=>({channel:this.#e.key,senderId:a,senderName:k?.senderName,conversationTitle:k?.conversationTitle,chatId:k?.chatId??t.conversationId,threadId:k?.threadId})),R=T!==N}let{answer:L,artifacts:U=[]}=await Ta({harness:this.#t,state:this.#r,key:e,text:r,content:T,contextEnhanced:R,createOptions:this.#p?{signal:this.#p}:void 0,existsOptions:this.#p?{signal:this.#p}:void 0,askOptions:{timeoutMs:this.#s,signal:this.#p,control:{owner:this,key:e},onUpdate:g?async N=>{let k=N.type==="text"?N.text:N.type==="tool"?w("\u6B63\u5728\u4F7F\u7528{name}\u2026",{name:N.name}):N.text;if(k){let J=N.type==="text"?"markdown":"plain";await g.update(c?ls(k,J):k)}}:void 0,onInteraction:N=>this.#M(N,{key:e,actor:a,target:A,requiresMention:t.kind==="group"&&t.requiresMention!==!1}),onInteractionResolved:N=>this.#D(N),files:t.files}});s&&this.#B.complete(e,s.token);let F=!Ea(L)&&U.length>0,q=F?w(wfe):L,z=F?"plain":"markdown",K=null,G=null;if(g)try{let N=await g.finish(c?ls(q,z):q);m=!0,G=tr({deliveryId:o,presentation:N?.presentation??g.presentation??`${this.#e.key}-stream`,providerMessageIds:[...Ur(g),...Ur(N)],deliveryOutcome:N?.deliveryOutcome,reason:N?.reason})}catch(N){g.cancel?.(),this.#a.warn?.(`[dsh-im:${this.#e.key}] streamed reply finalization failed; using text:`,N)}if(!m)try{let N=typeof this.#A.sendDelivery=="function"?await this.#A.sendDelivery(A,ls(q,z)):await this.#A.sendText(A,q);G=tr({deliveryId:o,presentation:N?.presentation??`${this.#e.key}-text`,providerMessageIds:Ur(N),deliveryOutcome:N?.deliveryOutcome,reason:N?.reason})}catch(N){K=Hi(N)}let V=G?.deliveryOutcome==="unknown";G?.deliveryOutcome==="failed"?K=Hi(new Error(`Final text delivery failed (${G.reason??"unknown"})`),{uncertain:!1}):V&&(K=Hi(new Error(`Final text delivery outcome is unknown (${G.reason??"unknown"})`)));let H=await this.#b(A,o,U,G);if(K&&(!H.userVisible||V))throw K.deliveryReceipt=H.receipt,K;return K&&H.artifactSendErrors===0&&rt(this.#i,K),H.userVisible&&(this.#i.messagesReplied+=1,this.#i.lastReplyAt=new Date().toISOString(),this.#i.lastError=null,!K&&H.artifactSendErrors===0&&Mo(this.#i)),H.receipt}catch(I){let p=I?.code==="turn-stopped";s&&p&&this.#B.complete(e,s.token);let B=s&&!p?this.#B.fail(e,s.token):null;if(p){if(t.statusReaction?.clear(),g)try{await g.finish(w("\u5DF2\u505C\u6B62\u3002"))}catch{g.cancel?.()}return}if(this.#p?.aborted){t.statusReaction?.clear(),g?.cancel?.();return}t.statusReaction?.error(),this.#i.lastError=I?.message??String(I);let f=async _=>{let R=typeof g?.fail=="function"?"fail":typeof g?.finish=="function"?"finish":null;if(!R)return!1;try{let L=await g[R](_);return R==="fail"?!!L&&L.deliveryOutcome!=="failed":L!==!1&&L?.deliveryOutcome!=="failed"}catch(L){return this.#a.warn?.(`[dsh-im:${this.#e.key}] unable to finalize the failed stream:`,L),!1}},Q=No(I),y=Fo(I),m=rt(this.#i,I,{userMessage:y??Q,reason:ao(I)?.reason}),T=B?.retained?`${ut(m)} @@ -253,14 +253,14 @@ ${i}`:i;return Cy({limit:o?1800:1900,create:async i=>{let A=await this.#e.create `),questions:o}}function _Qe(n,t){return new Promise((o,a)=>{if(n.controller.signal.aborted)return a(n.controller.signal.reason??Id());let e=()=>{n.approvals.delete(t),a(n.controller.signal.reason??Id())};n.controller.signal.addEventListener("abort",e,{once:!0}),n.approvals.set(t,{resolve(i){n.controller.signal.removeEventListener("abort",e),n.approvals.delete(t),o(i)}})})}var My=class{#e;#A;#t;#r;#I;#o=new Map;#c=new Set;#i=new Set;#a=!1;#s={running:0,completed:0,failed:0,lastJobId:null,lastJobAt:null};constructor({config:t,transport:o,createHarness:a,logger:e=console,sleepImpl:i=SQe}){if(!t||!o||typeof a!="function")throw new TypeError("OfficeJobExecutor requires config, transport, and createHarness");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i}get status(){return structuredClone(this.#s)}offer(t){return this.#a||!gj.test(t)||this.#o.has(t)||this.#c.has(t)||this.#i.has(t)?!1:(this.#c.add(t),this.#p(),!0)}handleEvent(t){let o=aa(t?.data?.jobId,80);if(!gj.test(o))return!1;if(t.type==="job.available")return this.offer(o);if(t.type==="job.cancel")return this.cancel(o);if(t.type==="approval.reply"){let a=this.#o.get(o),e=aa(t.data?.approvalId,180),i=a?.approvals.get(e);return i?(i.resolve({decision:t.data?.decision==="approved"?"approved":"rejected",answer:aa(t.data?.answer)}),!0):!1}return!1}cancel(t){this.#c.delete(t);let o=this.#o.get(t);return o?(o.cancelled=!0,o.controller.abort(Id()),o.sessionId&&o.harness&&o.harness.rpc("session.cancel",{sessionId:o.sessionId,keepInbox:!0},1e4).catch(()=>{}),!0):!1}async close(){this.#a=!0,this.#c.clear();for(let t of this.#o.values())t.controller.abort(Id());await Promise.allSettled([...this.#o.values()].map(t=>t.task))}#p(){for(;!this.#a&&this.#o.size0;){let t=this.#c.values().next().value;this.#c.delete(t);let o={controller:new AbortController,approvals:new Map,harness:null,sessionId:null,leaseToken:null,cancelled:!1,lastProgressAt:0,lastProgress:"",task:null};o.task=this.#g(t,o).finally(()=>{this.#o.delete(t),this.#s.running=this.#o.size,this.#p()}),this.#o.set(t,o),this.#s.running=this.#o.size,o.task.catch(a=>this.#r.warn?.("[dsh-im:office] Job task ended:",a.message))}}async#g(t,o){let a=o.controller.signal,e=null;try{let A=(await this.#A.getJob(t,{signal:a}))?.job;if(!A||A.id!==t)throw new Error("Office returned an invalid Job payload");let r=await this.#A.acceptJob(t,{signal:a});if(!aa(r?.leaseToken,200))throw new Error("Office returned an invalid Job lease");o.leaseToken=r.leaseToken,e=this.#l(t,o);let s=this.#e.workspaces[A.workspaceAlias],g=this.#e.instructionPresets[A.instructionPreset];if(!s||!g){let I=new Error(w("Office Job \u5F15\u7528\u4E86\u672C\u673A\u672A\u914D\u7F6E\u7684 Workspace/Preset alias\u3002"));throw I.code="office-job-alias-invalid",I}o.harness=this.#t({workspace:s}),await this.#h(t,o,{kind:"status",message:w("\u5DF2\u9886\u53D6 Job\uFF0C\u51C6\u5907 Workspace alias\uFF1A{alias}",{alias:A.workspaceAlias})},!0),o.sessionId=await o.harness.createSession({signal:a,workspace:s}),await this.#h(t,o,{kind:"status",message:w("Harness Session \u5DF2\u521B\u5EFA\u3002"),sessionId:o.sessionId},!0);let c=await o.harness.ask(o.sessionId,bQe(A,g),{timeoutMs:30*6e4,signal:a,onUpdate:I=>this.#n(t,o,I),onInteraction:I=>this.#d(t,o,I),onInteractionResolved:I=>{let p=aa(I?.interactionId,180);o.approvals.get(p)?.resolve({decision:"rejected",answer:""})}});if(a.aborted)throw a.reason??Id();await this.#A.completeJob(t,o.leaseToken,{resultMarkdown:c,sessionId:o.sessionId},{signal:a}),this.#s.completed+=1,this.#C(t)}catch(i){if(!o.cancelled&&o.leaseToken&&(await this.#A.failJob(t,o.leaseToken,{error:OQe(i),...o.sessionId?{sessionId:o.sessionId}:{}}).catch(()=>{}),this.#s.failed+=1),i?.code==="office-job-conflict"||i?.code==="office-hook-unavailable"){this.#C(t);return}!o.cancelled&&!a.aborted&&this.#r.warn?.(`[dsh-im:office] Job ${t} failed:`,i.message)}finally{o.controller.abort(Id()),await e?.catch(()=>{}),this.#s.lastJobId=t,this.#s.lastJobAt=new Date().toISOString()}}async#l(t,o){for(;!o.controller.signal.aborted;){try{await this.#I(wQe,void 0,{signal:o.controller.signal})}catch{return}try{await this.#A.renewJob(t,o.leaseToken,{signal:o.controller.signal})}catch(a){if(o.controller.signal.aborted)return;o.cancelled=!0,o.controller.abort(a),o.sessionId&&o.harness&&o.harness.rpc("session.cancel",{sessionId:o.sessionId,keepInbox:!0},1e4).catch(()=>{});return}try{let e=(await this.#A.getJob(t,{signal:o.controller.signal}))?.job?.approval;e&&(e.status==="approved"||e.status==="rejected")&&o.approvals.get(e.id)?.resolve({decision:e.status,answer:aa(e.answer)})}catch(a){if(o.controller.signal.aborted)return;this.#r.warn?.(`[dsh-im:office] Job ${t} approval poll failed; will retry after the next renewal:`,a.message)}}}async#n(t,o,a){let e=a?.type==="tool"?w("\u6B63\u5728\u4F7F\u7528 {tool}\u2026",{tool:aa(a.name,160)||w("Harness \u5DE5\u5177")}):aa(a?.text,4e3);if(!e)return;let i=`${a.type}:${e}`;if(i===o.lastProgress)return;let A=Date.now();a.type==="text"&&A-o.lastProgressAt<1e3||(o.lastProgress=i,o.lastProgressAt=A,await this.#h(t,o,{kind:a.type==="tool"?"tool":a.type==="text"?"text":"status",message:e,...o.sessionId?{sessionId:o.sessionId}:{}}))}#h(t,o,a,e=!1){let i=this.#A.progressJob(t,o.leaseToken,a,{signal:o.controller.signal});return e?i:i.catch(A=>{this.#r.debug?.("[dsh-im:office] ignored a progress delivery failure:",A.message)})}async#d(t,o,a){let e=MQe(a);if(!e){a?.kind==="approval"&&typeof a.respond=="function"&&await a.respond({ok:!0,value:{sessionId:a.sessionId,approvalId:a.payload?.approvalId,outcome:"rejected"}});return}let i=_Qe(o,e.id);try{await this.#A.requestApproval(t,o.leaseToken,e,{signal:o.controller.signal});let A=await i;if(e.kind==="approval"){await a.respond({ok:!0,value:{sessionId:a.sessionId,approvalId:a.payload.approvalId,outcome:A.decision==="approved"?"allowed-once":"rejected"}});return}if(A.decision!=="approved"){await a.respond({ok:!1,error:{code:"cancelled",message:"The AI Office user rejected this question.",details:{}}});return}let r=aa(A.answer).split(/\r?\n/);await a.respond({ok:!0,value:{sessionId:a.sessionId,answer:{answers:e.questions.map((s,g)=>Ma(s,r[g]||r[0]||""))}}})}catch(A){throw o.approvals.delete(e.id),A}}#C(t){this.#i.add(t),!(this.#i.size<=DQe)&&this.#i.delete(this.#i.values().next().value)}};var cj=Object.freeze([1e3,3e3,1e4,3e4]);function NQe(n){let t=typeof n?.code=="string"?n.code:"office-connection-failed",o={"invalid-device-token":w("AI Office \u62D2\u7EDD\u4E86 Device Token\u3002"),"office-hook-unavailable":w("AI Office Connector Hook \u5C1A\u672A\u5C31\u7EEA\u3002"),"office-protocol-mismatch":w("AI Office Connector \u534F\u8BAE\u7248\u672C\u4E0D\u517C\u5BB9\u3002"),"office-transport-failed":w("\u672C\u673A\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE AI Office\u3002")};return{code:t,message:o[t]??w("AI Office \u8FDE\u63A5\u5DF2\u4E2D\u65AD\u3002")}}var ld=class{#e;#A;#t;#r;#I;#o=null;#c=null;#i;#a;constructor({config:t,token:o,logger:a=console,transport:e,createHarness:i,jobExecutor:A,sleepImpl:r=TQe}){this.#e=t,this.#A=o,this.#t=a,this.#I=r,this.#r=e??new by({baseUrl:t.baseUrl,deviceId:t.deviceId,token:o}),this.#i={state:"idle",connected:!1,startedAt:null,lastHeartbeatAt:null,lastEventAt:null,lastEventId:null,lastEventType:null,reconnects:0,jobsOffered:0,error:null},this.#a=A??(i?new My({config:t,transport:this.#r,createHarness:i,logger:a}):null)}get status(){return structuredClone({...this.#i,...this.#a?{jobs:this.#a.status}:{}})}capabilities(){return{protocolVersion:nd,deviceId:this.#e.deviceId,workspaces:Object.keys(this.#e.workspaces),instructionPresets:Object.keys(this.#e.instructionPresets),maxConcurrency:this.#e.maxConcurrency}}async testConnection(t){return await this.#r.heartbeat({...this.capabilities(),probe:!0},{signal:t}),{ok:!0}}start(){return this.#c?this.status:(this.#o=new AbortController,this.#i.startedAt=new Date().toISOString(),this.#i.state="connecting",this.#c=this.#s(this.#o.signal).finally(()=>{this.#c=null}),this.#c.catch(t=>{this.#o?.signal.aborted||this.#t.error?.("[dsh-im:office] connector stopped:",t)}),this.status)}async#s(t){let o=0;for(;!t.aborted;){let a=new AbortController,e=AbortSignal.any([t,a.signal]);try{let i=await this.#r.heartbeat(this.capabilities(),{signal:e});this.#g(i?.jobs),this.#i.lastHeartbeatAt=new Date().toISOString();let A=!1,r=this.#p(e,()=>{A&&!e.aborted&&(o=0)}),s=this.#r.stream({signal:e,lastEventId:this.#i.lastEventId,onOpen:()=>{this.#i.connected=!0,this.#i.state="connected",this.#i.error=null,A=!0},onEvent:async g=>{this.#i.lastEventAt=new Date().toISOString(),this.#i.lastEventId=g.id??this.#i.lastEventId,this.#i.lastEventType=g.type,g.type==="job.available"&&(this.#i.jobsOffered+=1),this.#a?.handleEvent(g)}});await Promise.race([s,r])}catch(i){if(t.aborted)break;a.abort(),this.#i.connected=!1,this.#i.state="reconnecting",this.#i.error=NQe(i),this.#i.reconnects+=1;let A=cj[Math.min(o,cj.length-1)];o+=1;try{await this.#I(A,void 0,{signal:t})}catch{break}}finally{a.abort()}}this.#i.connected=!1,this.#i.state="idle"}async#p(t,o){for(;!t.aborted;){await this.#I(this.#e.heartbeatSeconds*1e3,void 0,{signal:t});let a=await this.#r.heartbeat(this.capabilities(),{signal:t});this.#g(a?.jobs),this.#i.lastHeartbeatAt=new Date().toISOString(),o?.()}}#g(t){if(Array.isArray(t))for(let o of t)typeof o?.id=="string"&&this.#a?.offer(o.id)&&(this.#i.jobsOffered+=1)}async stop(){let t=this.#c;return this.#o?.abort(),this.#o=null,t&&await t.catch(()=>{}),await this.#a?.close(),this.#i.connected=!1,this.#i.state="idle",this.status}};function LT(n){return typeof n=="string"&&n.trim()?n.trim():null}function kQe(n,t){return`DSH_OFFICE_DEVICE_TOKEN_${RQe("sha256").update(`${n} ${t}`).digest("hex").slice(0,24).toUpperCase()}`}var _y=class{#e;#A;#t;#r;#I=null;#o=Promise.resolve();constructor({credentials:t,configStore:o,logger:a=console,createRuntime:e}){if(!t?.resolve||!t?.set||!t?.unset)throw new TypeError("AI Office requires the Harness credential provider");if(!o?.get||!o?.save||!o?.clear)throw new TypeError("AI Office requires a config store");this.#e=t,this.#A=o,this.#t=a,this.#r=e??(i=>new ld(i))}async initialize(){let t=this.#A.get();if(t){let o=await this.#e.resolve(t.deviceTokenRef).catch(()=>{});o?.value&&await this.#i(t,o.value)}return this.status()}async configure(t={}){return this.#s(async()=>{let o=this.#A.get(),a=LT(t.baseUrl),e=LT(t.deviceId);if(!a||!e)throw new TypeError("Office URL and Device ID are required");let i=yu(a).origin,A=kQe(i,e),r=LT(t.deviceToken),s=await this.#e.resolve(A).catch(()=>{}),g=r??s?.value;if(!g||g.length<32)throw new TypeError("Device Token must contain at least 32 characters");let c=new Date().toISOString(),I=Dy({version:1,baseUrl:i,deviceId:e,deviceTokenRef:A,maxConcurrency:t.maxConcurrency,heartbeatSeconds:t.heartbeatSeconds,workspaces:t.workspaces,instructionPresets:t.instructionPresets,createdAt:o?.createdAt??c,updatedAt:c});if(!I)throw new TypeError("AI Office connector configuration is invalid");await this.#e.set(A,g);try{await this.#A.save(I)}catch(p){throw s?.value?await this.#e.set(A,s.value).catch(()=>{}):await this.#e.unset(A).catch(()=>{}),p}return o?.deviceTokenRef&&o.deviceTokenRef!==A&&await this.#e.unset(o.deviceTokenRef).catch(()=>{}),await this.#i(I,g),this.status()})}async reconnect(){return this.#s(async()=>{let t=this.#A.get();if(!t)throw new Error("AI Office connector is not configured");return await this.#i(t),this.status()})}async test(){let t=this.#A.get();if(!t)throw new Error("AI Office connector is not configured");let o=await this.#c(t),a=this.#r({config:t,token:o,logger:this.#t});try{await a.testConnection(AbortSignal.timeout(1e4))}finally{await a.stop().catch(()=>{})}return{tested:!0,snapshot:await this.status()}}async remove(){return this.#s(async()=>{let t=this.#A.get();return await this.#a(),t?.deviceTokenRef&&await this.#e.unset(t.deviceTokenRef).catch(()=>{}),await this.#A.clear(),this.status()})}async status(){let t=this.#A.get();if(!t)return{schemaVersion:1,configured:!1,connected:!1,state:"unconfigured"};let o=await this.#e.resolve(t.deviceTokenRef).catch(()=>{}),a=this.#I?.status??null;return{schemaVersion:1,configured:!0,connected:a?.connected===!0,state:a?.state??(o?.value?"idle":"missing-token"),config:{protocolVersion:t.protocolVersion,baseUrl:t.baseUrl,deviceId:t.deviceId,maxConcurrency:t.maxConcurrency,heartbeatSeconds:t.heartbeatSeconds,workspaces:t.workspaces,instructionPresets:t.instructionPresets,hooks:wy(t.baseUrl)},health:a,tokenConfigured:!!o?.value}}async close(){await this.#o.catch(()=>{}),await this.#a()}async#c(t){let o=await this.#e.resolve(t.deviceTokenRef).catch(()=>{});if(!o?.value)throw new Error("AI Office Device Token is missing");return o.value}async#i(t,o){await this.#a();let a=o??await this.#c(t),e=this.#r({config:t,token:a,logger:this.#t});this.#I=e,e.start()}async#a(){let t=this.#I;this.#I=null,t&&await t.stop()}#s(t){let o=this.#o.then(t,t);return this.#o=o.then(()=>{},()=>{}),o}};function PQe(n={}){let t=HT(n.dshHome??process.env.DSH_HOME??UT(vQe(),".dsh")),o=HT(n.dataDir??UT(t,"integrations","dsh-office"));return{root:o,config:HT(n.configPath??UT(o,"config.json"))}}async function Ij(n,t={},o={}){let a=si(n,t),e=o.ConfigStore??Oy,i=o.Controller??_y,A=o.Runtime??ld,r=o.HarnessClient??yr,s=PQe(t),g=await new e(s.config).load(),c=typeof n.logger=="function"?n.logger("dsh-im:office"):n.logger??console,I=o.createHarness??(({workspace:B})=>new r({...a,workspace:B,autostart:!1,dshBin:t.dshBin??"dsh",rpcIdPrefix:"office",logPrefix:"dsh-im:office"})),p=new i({credentials:n.credentials,configStore:g,logger:c,createRuntime:B=>new A({...B,createHarness:I,...o.transport?{transport:o.transport}:{}})});return await p.initialize(),{controller:p,close:()=>p.close(),paths:s}}function KT(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function mu(n,t){return KT(n)&&Object.keys(n).every(o=>t.includes(o))}function GQe(n){return mu(n,["baseUrl","deviceId","deviceToken","maxConcurrency","heartbeatSeconds","workspaces","instructionPresets"])&&typeof n.baseUrl=="string"&&typeof n.deviceId=="string"&&(n.deviceToken===void 0||typeof n.deviceToken=="string")&&KT(n.workspaces)&&KT(n.instructionPresets)}function FQe(n){for(let t of["status","configure","reconnect","test","remove"])if(typeof n?.[t]!="function")throw new TypeError(`AI Office controller requires ${t}()`);return async(t,o,a)=>{if(a?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};try{let e;if(t===sd.status&&mu(o,[]))e=await n.status();else if(t===sd.configure&&GQe(o))e=await n.configure(o);else if(t===sd.reconnect&&mu(o,[]))e=await n.reconnect();else if(t===sd.test&&mu(o,[]))e=await n.test();else if(t===sd.remove&&mu(o,["confirm"])&&o.confirm===!0)e=await n.remove();else return{ok:!1,error:{code:"bad-request",message:"Invalid AI Office connector request."}};return{ok:!0,value:e}}catch(e){let i=e?.code==="invalid-device-token"?"invalid-device-token":e?.code==="office-hook-unavailable"?"office-hook-unavailable":"office-operation-failed",A=i==="invalid-device-token"?"AI Office Device Token \u65E0\u6548\u3002":i==="office-hook-unavailable"?"AI Office Hook \u5C1A\u672A\u4E0A\u7EBF\u6216\u5730\u5740\u4E0D\u6B63\u786E\u3002":e instanceof TypeError?e.message:"AI Office \u8FDE\u63A5\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002";return{ok:!1,error:{code:i,message:A}}}}}function xT(n,t,o){return n.connection.rpc.handle(nj,FQe(t),{authority:mr(o)})}async function lj(n,t={}){if(t.controller)return xT(n,t.controller,t.rpcAuthority);let o=await Ij(n,t,t.internals??{}),a=xT(n,o.controller,t.rpcAuthority);return n.effect(()=>async()=>o.close(),"dsh-im: close AI Office connector"),a}var LQe=new Set(["starting","qr_ready","polling","slow_down","domain_switched"]);function UQe(n){let t=n?.client_id??n?.appId,o=n?.client_secret??n?.appSecret;if(typeof t!="string"||t.length===0||typeof o!="string"||o.length===0)throw new TypeError("Feishu registration returned invalid credentials");return{appId:t,appSecret:o,userInfo:n?.user_info??n?.userInfo}}async function HQe(n){return typeof n.status!="function"?{}:await n.status()}function KQe(n){return n?.connected===!0?!0:n?.ready===!0&&n?.feishuLongConnectionState==="connected"&&n?.harnessReachable===!0}var Ty=class{#e;#A;#t;#r;#I=!1;#o=null;constructor({createProvisioningManager:t,credentialStore:o,connectionManager:a,registrationOptions:e={}}={}){if(typeof t!="function")throw new TypeError("createProvisioningManager is required");if(!o||typeof o.save!="function"||typeof o.clear!="function")throw new TypeError("credentialStore.save/clear are required");if(!a||typeof a.connect!="function"||typeof a.disconnect!="function")throw new TypeError("connectionManager.connect/disconnect are required");if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError("registrationOptions must be an object");if(this.#e=o,this.#A=a,this.#t=structuredClone(e),this.#r=t({onCredentials:i=>this.#c(i)}),!this.#r||typeof this.#r.start!="function"||typeof this.#r.status!="function"||typeof this.#r.cancel!="function")throw new TypeError("The provisioning manager must implement start/status/cancel")}async startRegistration(){return this.#o=null,await this.#r.start(structuredClone(this.#t)),this.status()}async cancelRegistration(){return await this.#r.cancel(),this.status()}async disconnect(){await this.#r.cancel(),await this.#A.disconnect();try{await this.#e.clear(),this.#I=!1,this.#o=null}catch{this.#o={code:"credential_removal_failed",message:"Unable to remove the Feishu credentials."}}return this.status()}async status(){let t=await this.#r.status(),o=await HQe(this.#A),a=KQe(o),e=this.#I;if(typeof this.#e.configured=="function")try{e=await this.#e.configured()}catch{e=this.#I}let i="unconfigured";return a?i="connected":LQe.has(t?.state)?i="registering":t?.state==="saving"?i="connecting":this.#o||t?.state==="error"?i="error":e&&(i="disconnected"),{phase:i,connected:a,configured:e,registration:t,connection:o,error:this.#o??t?.error??null}}async close(){await this.#r.cancel(),await this.#A.disconnect()}async#c(t){let o=UQe(t);try{await this.#e.save(o),this.#I=!0,await this.#A.connect(o),this.#o=null}catch{throw this.#o={code:"connection_failed",message:"The bot was created, but its connection could not be started."},new Error("Unable to activate the Feishu connection.")}}};function YT(n){return new Ty(n)}import{homedir as SGe}from"node:os";import{join as nh,resolve as Yc}from"node:path";import{unlink as wGe}from"node:fs/promises";var UP={};Lr(UP,{AESCipher:()=>vC,AccessTokenError:()=>$d,Aily:()=>EP,AppType:()=>Os,CAppTicket:()=>kC,CTenantAccessToken:()=>MC,CardActionHandler:()=>lP,Client:()=>pS,ClientAssertionError:()=>na,DefaultCache:()=>cS,Domain:()=>bs,EventDispatcher:()=>hS,LarkChannel:()=>QS,LarkChannelError:()=>Ht,LoggerLevel:()=>Eo,LoggerProxy:()=>Uc,WSClient:()=>uS,adaptDefault:()=>NRe,adaptExpress:()=>RRe,adaptKoa:()=>kRe,adaptKoaRouter:()=>vRe,createLarkChannel:()=>Bve,defaultHttpInstance:()=>eh,defaultLogger:()=>Pg,generateChallenge:()=>GC,internalCache:()=>PC,messageCard:()=>GRe,normalize:()=>$6,normalizeBotAdded:()=>Z6,normalizeCardAction:()=>W6,normalizeComment:()=>X6,normalizeReaction:()=>MP,registerApp:()=>zRe,withAll:()=>DRe,withHelpDeskCredential:()=>bRe,withTenantKey:()=>ORe,withTenantToken:()=>MRe,withUserAccessToken:()=>_Re});function Su(n,t){return function(){return n.apply(t,arguments)}}var{toString:xQe}=Object.prototype,{getPrototypeOf:pd}=Object,{iterator:Du,toStringTag:hj}=Symbol,Ry=(({hasOwnProperty:n})=>(t,o)=>n.call(t,o))(Object.prototype),wu=(n,t)=>{let o=n,a=[];for(;o!=null&&o!==Object.prototype;){if(a.indexOf(o)!==-1)return!1;if(a.push(o),Ry(o,t))return!0;o=pd(o)}return!1},YQe=(n,t)=>n!=null&&wu(n,t)?n[t]:void 0,JT=(n=>t=>{let o=xQe.call(t);return n[o]||(n[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Ko=n=>(n=n.toLowerCase(),t=>JT(t)===n),ky=n=>t=>typeof t===n,{isArray:el}=Array,Al=ky("undefined");function dd(n){return n!==null&&!Al(n)&&n.constructor!==null&&!Al(n.constructor)&&Ha(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}var Ej=Ko("ArrayBuffer");function jQe(n){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(n):t=n&&n.buffer&&Ej(n.buffer),t}var JQe=ky("string"),Ha=ky("function"),uj=ky("number"),hd=n=>n!==null&&typeof n=="object",qQe=n=>n===!0||n===!1,Ny=n=>{if(!hd(n))return!1;let t=pd(n);return(t===null||t===Object.prototype||pd(t)===null)&&!wu(n,hj)&&!wu(n,Du)},zQe=n=>{if(!hd(n)||dd(n))return!1;try{return Object.keys(n).length===0&&Object.getPrototypeOf(n)===Object.prototype}catch{return!1}},VQe=Ko("Date"),WQe=Ko("File"),ZQe=n=>!!(n&&typeof n.uri<"u"),XQe=n=>n&&typeof n.getParts<"u",$Qe=Ko("Blob"),eye=Ko("FileList"),Aye=Ko("Set"),tye=n=>hd(n)&&Ha(n.pipe);function rye(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}var pj=rye(),dj=typeof pj.FormData<"u"?pj.FormData:void 0,iye=n=>{if(!n)return!1;if(dj&&n instanceof dj)return!0;let t=pd(n);if(!t||t===Object.prototype||!Ha(n.append))return!1;let o=JT(n);return o==="formdata"||o==="object"&&Ha(n.toString)&&n.toString()==="[object FormData]"},aye=Ko("URLSearchParams"),[oye,nye,sye,gye]=["ReadableStream","Request","Response","Headers"].map(Ko),cye=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ou(n,t,{allOwnKeys:o=!1}={}){if(n===null||typeof n>"u")return;let a,e;if(typeof n!="object"&&(n=[n]),el(n))for(a=0,e=n.length;a0;)if(e=o[a],t===e.toLowerCase())return e;return null}var $I=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Bj=n=>!Al(n)&&n!==$I;function jT(...n){let{caseless:t,skipUndefined:o}=Bj(this)&&this||{},a={},e=(i,A)=>{if(A==="__proto__"||A==="constructor"||A==="prototype")return;let r=t&&typeof A=="string"&&Cj(a,A)||A,s=Ry(a,r)?a[r]:void 0;Ny(s)&&Ny(i)?a[r]=jT(s,i):Ny(i)?a[r]=jT({},i):el(i)?a[r]=i.slice():(!o||!Al(i))&&(a[r]=i)};for(let i=0,A=n.length;i(Ou(t,(e,i)=>{o&&Ha(e)?Object.defineProperty(n,i,{__proto__:null,value:Su(e,o),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(n,i,{__proto__:null,value:e,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:a}),n),lye=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),pye=(n,t,o,a)=>{n.prototype=Object.create(t.prototype,a),Object.defineProperty(n.prototype,"constructor",{__proto__:null,value:n,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(n,"super",{__proto__:null,value:t.prototype}),o&&Object.assign(n.prototype,o)},dye=(n,t,o,a)=>{let e,i,A,r={};if(t=t||{},n==null)return t;do{for(e=Object.getOwnPropertyNames(n),i=e.length;i-- >0;)A=e[i],(!a||a(A,n,t))&&!r[A]&&(t[A]=n[A],r[A]=!0);n=o!==!1&&pd(n)}while(n&&(!o||o(n,t))&&n!==Object.prototype);return t},hye=(n,t,o)=>{n=String(n),(o===void 0||o>n.length)&&(o=n.length),o-=t.length;let a=n.indexOf(t,o);return a!==-1&&a===o},Eye=n=>{if(!n)return null;if(el(n))return n;let t=n.length;if(!uj(t))return null;let o=new Array(t);for(;t-- >0;)o[t]=n[t];return o},uye=(n=>t=>n&&t instanceof n)(typeof Uint8Array<"u"&&pd(Uint8Array)),Cye=(n,t)=>{let a=(n&&n[Du]).call(n),e;for(;(e=a.next())&&!e.done;){let i=e.value;t.call(n,i[0],i[1])}},Bye=(n,t)=>{let o,a=[];for(;(o=n.exec(t))!==null;)a.push(o);return a},fye=Ko("HTMLFormElement"),Qye=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,a,e){return a.toUpperCase()+e}),{propertyIsEnumerable:yye}=Object.prototype,mye=Ko("RegExp"),fj=(n,t)=>{let o=Object.getOwnPropertyDescriptors(n),a={};Ou(o,(e,i)=>{let A;(A=t(e,i,n))!==!1&&(a[i]=A||e)}),Object.defineProperties(n,a)},Sye=n=>{fj(n,(t,o)=>{if(Ha(n)&&["arguments","caller","callee"].includes(o))return!1;let a=n[o];if(Ha(a)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},wye=(n,t)=>{let o={},a=e=>{e.forEach(i=>{o[i]=!0})};return el(n)?a(n):a(String(n).split(t)),o},Dye=()=>{},Oye=(n,t)=>n!=null&&Number.isFinite(n=+n)?n:t;function bye(n){return!!(n&&Ha(n.append)&&n[hj]==="FormData"&&n[Du])}var Mye=n=>{let t=new WeakSet,o=a=>{if(hd(a)){if(t.has(a))return;if(dd(a))return a;if(!("toJSON"in a)){t.add(a);let e;if(Aye(a)){e=[];for(let i of a){let A=o(i);!Al(A)&&e.push(A)}}else e=el(a)?[]:{},Ou(a,(i,A)=>{let r=o(i);!Al(r)&&(e[A]=r)});return t.delete(a),e}}return a};return o(n)},_ye=Ko("AsyncFunction"),Tye=n=>n&&(hd(n)||Ha(n))&&Ha(n.then)&&Ha(n.catch),Qj=((n,t)=>n?setImmediate:t?((o,a)=>($I.addEventListener("message",({source:e,data:i})=>{e===$I&&i===o&&a.length&&a.shift()()},!1),e=>{a.push(e),$I.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",Ha($I.postMessage)),Nye=typeof queueMicrotask<"u"?queueMicrotask.bind($I):typeof process<"u"&&process.nextTick||Qj,yj=n=>n!=null&&Ha(n[Du]),Rye=n=>n!=null&&wu(n,Du)&&yj(n),Z={isArray:el,isArrayBuffer:Ej,isBuffer:dd,isFormData:iye,isArrayBufferView:jQe,isString:JQe,isNumber:uj,isBoolean:qQe,isObject:hd,isPlainObject:Ny,isEmptyObject:zQe,isReadableStream:oye,isRequest:nye,isResponse:sye,isHeaders:gye,isUndefined:Al,isDate:VQe,isFile:WQe,isReactNativeBlob:ZQe,isReactNative:XQe,isBlob:$Qe,isRegExp:mye,isFunction:Ha,isStream:tye,isURLSearchParams:aye,isTypedArray:uye,isFileList:eye,forEach:Ou,merge:jT,extend:Iye,trim:cye,stripBOM:lye,inherits:pye,toFlatObject:dye,kindOf:JT,kindOfTest:Ko,endsWith:hye,toArray:Eye,forEachEntry:Cye,matchAll:Bye,isHTMLForm:fye,hasOwnProperty:Ry,hasOwnProp:Ry,hasOwnInPrototypeChain:wu,getSafeProp:YQe,reduceDescriptors:fj,freezeMethods:Sye,toObjectSet:wye,toCamelCase:Qye,noop:Dye,toFiniteNumber:Oye,findKey:Cj,global:$I,isContextDefined:Bj,isSpecCompliantForm:bye,toJSONObject:Mye,isAsyncFn:_ye,isThenable:Tye,setImmediate:Qj,asap:Nye,isIterable:yj,isSafeIterable:Rye};var kye=Z.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),mj=n=>{let t={},o,a,e;return n&&n.split(` `).forEach(function(A){e=A.indexOf(":"),o=A.substring(0,e).trim().toLowerCase(),a=A.substring(e+1).trim();let r=Z.hasOwnProp(t,o);!o||r&&Z.hasOwnProp(kye,o)||(o==="set-cookie"?r?t[o].push(a):t[o]=[a]:t[o]=r?t[o]+", "+a:a)}),t};function vye(n){let t=0,o=n.length;for(;tt;){let a=n.charCodeAt(o-1);if(a!==9&&a!==32)break;o-=1}return t===0&&o===n.length?n:n.slice(t,o)}var Pye=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Gye=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function qT(n,t){return Z.isArray(n)?n.map(o=>qT(o,t)):vye(String(n).replace(t,""))}var Sj=n=>qT(n,Pye),Fye=n=>qT(n,Gye);function Ed(n){let t=Object.create(null);return Z.forEach(n.toJSON(),(o,a)=>{t[a]=Fye(o)}),t}var wj=Symbol("internals");function bu(n){return n&&String(n).trim().toLowerCase()}function vy(n){return n===!1||n==null?n:Z.isArray(n)?n.map(vy):Sj(String(n))}function Lye(n){let t=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,a;for(;a=o.exec(n);)t[a[1]]=a[2];return t}var Uye=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function zT(n){let t=0,o=n.length;for(;tt;){let a=n.charCodeAt(o-1);if(a!==9&&a!==32)break;o-=1}return t===0&&o===n.length?n:n.slice(t,o)}function Hye(n){let t=n.length-1;if(t<1||n.charCodeAt(0)!==34||n.charCodeAt(t)!==34)return n;let o="";for(let a=1;a=t))return n;o+=n[a]}return o}function Kye(n){let t=Object.create(null),o=String(n),a=0,e=!1,i=!1;function A(r){let s=zT(o.slice(a,r)),g=s.indexOf("=");if(g<1)return;let c=zT(s.slice(0,g));if(!Uye.test(c))return;let I=c.toLowerCase();if(I==="__proto__"||I==="constructor"||I==="prototype")return;let p=zT(s.slice(g+1));t[I]=Hye(p)}for(let r=0;r/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function VT(n,t,o,a,e){if(Z.isFunction(a))return a.call(this,t,o);if(e&&(t=o),!!Z.isString(t)){if(Z.isString(a))return t.indexOf(a)!==-1;if(Z.isRegExp(a))return a.test(t)}}function Yye(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,o,a)=>o.toUpperCase()+a)}function jye(n,t){let o=Z.toCamelCase(" "+t);["get","set","has"].forEach(a=>{Object.defineProperty(n,a+o,{__proto__:null,value:function(e,i,A){return this[a].call(this,t,e,i,A)},configurable:!0})})}var ud=class{constructor(t){t&&this.set(t)}set(t,o,a){let e=this;function i(r,s,g){let c=bu(s);if(!c)return;let I=Z.findKey(e,c);(!I||e[I]===void 0||g===!0||g===void 0&&e[I]!==!1)&&(e[I||s]=vy(r))}let A=(r,s)=>Z.forEach(r,(g,c)=>i(g,c,s));if(Z.isPlainObject(t)||t instanceof this.constructor)A(t,o);else if(Z.isString(t)&&(t=t.trim())&&!xye(t))A(mj(t),o);else if(Z.isObject(t)&&Z.isSafeIterable(t)){let r=Object.create(null),s,g;for(let c of t){if(!Z.isArray(c))throw new TypeError("Object iterator must return a key-value pair");g=c[0],Z.hasOwnProp(r,g)?(s=r[g],r[g]=Z.isArray(s)?[...s,c[1]]:[s,c[1]]):r[g]=c[1]}A(r,o)}else t!=null&&i(o,t,a);return this}get(t,o){if(t=bu(t),t){let a=Z.findKey(this,t);if(a){let e=this[a];if(!o)return e;if(o===!0)return Lye(e);if(Z.isFunction(o))return o.call(this,e,a);if(Z.isRegExp(o))return o.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,o){if(t=bu(t),t){let a=Z.findKey(this,t);return!!(a&&this[a]!==void 0&&(!o||VT(this,this[a],a,o)))}return!1}delete(t,o){let a=this,e=!1;function i(A){if(A=bu(A),A){let r=Z.findKey(a,A);r&&(!o||VT(a,a[r],r,o))&&(delete a[r],e=!0)}}return Z.isArray(t)?t.forEach(i):i(t),e}clear(t){let o=Object.keys(this),a=o.length,e=!1;for(;a--;){let i=o[a];(!t||VT(this,this[i],i,t,!0))&&(delete this[i],e=!0)}return e}normalize(t){let o=this,a={};return Z.forEach(this,(e,i)=>{let A=Z.findKey(a,i);if(A){o[A]=vy(e),delete o[i];return}let r=t?Yye(i):String(i).trim();r!==i&&delete o[i],o[r]=vy(e),a[r]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let o=Object.create(null);return Z.forEach(this,(a,e)=>{a!=null&&a!==!1&&(o[e]=t&&Z.isArray(a)?a.join(", "):a)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,o])=>t+": "+o).join(` -`)}getSetCookie(){let t=this.get("set-cookie");return Z.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return Kye(t)}static concat(t,...o){let a=new this(t);return o.forEach(e=>a.set(e)),a}static accessor(t){let a=(this[wj]=this[wj]={accessors:{}}).accessors,e=this.prototype;function i(A){let r=bu(A);a[r]||(jye(e,A),a[r]=!0)}return Z.isArray(t)?t.forEach(i):i(t),this}};ud.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Z.reduceDescriptors(ud.prototype,({value:n},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(a){this[o]=a}}});Z.freezeMethods(ud);var Yt=ud;var Mu="[REDACTED ****]";function Jye(n){if(Z.hasOwnProp(n,"toJSON"))return!0;let t=Object.getPrototypeOf(n);for(;t&&t!==Object.prototype;){if(Z.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function qye(n,t){let o=new Set(t.map(i=>String(i).toLowerCase())),a=[],e=i=>{if(i===null||typeof i!="object"||Z.isBuffer(i))return i;if(a.indexOf(i)!==-1)return;i instanceof Yt&&(i=i.toJSON()),a.push(i);let A;if(Z.isArray(i))A=[],i.forEach((r,s)=>{let g=e(r);Z.isUndefined(g)||(A[s]=g)});else{if(!Z.isPlainObject(i)&&Jye(i))return a.pop(),i;A=Object.create(null);for(let[r,s]of Object.entries(i)){let g=o.has(r.toLowerCase())?Mu:e(s);Z.isUndefined(g)||(A[r]=g)}}return a.pop(),A};return e(n)}function Dj(n){try{return String(n)}catch{return""}}function zye(n){return n.errors.map(o=>{try{return o&&o.message?Dj(o.message):Dj(o)}catch{return""}}).filter(Boolean).join("; ")||n.name||"AggregateError"}var _i=class n extends Error{static from(t,o,a,e,i,A){let r=t.message;!r&&Z.isArray(t.errors)&&t.errors.length&&(r=zye(t));let s=new n(r,o||t.code,a,e,i);return Object.defineProperty(s,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),A&&Object.assign(s,A),s}constructor(t,o,a,e,i){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,o&&(this.code=o),a&&(this.config=a),e&&(this.request=e),i&&(this.response=i,this.status=i.status)}toJSON(){let t=this.config,o=t&&Z.hasOwnProp(t,"redact")?t.redact:void 0,a=Z.isArray(o)&&o.length>0?qye(t,o):Z.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a,code:this.code,status:this.status}}};_i.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";_i.ERR_BAD_OPTION="ERR_BAD_OPTION";_i.ECONNABORTED="ECONNABORTED";_i.ETIMEDOUT="ETIMEDOUT";_i.ECONNREFUSED="ECONNREFUSED";_i.ERR_NETWORK="ERR_NETWORK";_i.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";_i.ERR_DEPRECATED="ERR_DEPRECATED";_i.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";_i.ERR_BAD_REQUEST="ERR_BAD_REQUEST";_i.ERR_CANCELED="ERR_CANCELED";_i.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";_i.ERR_INVALID_URL="ERR_INVALID_URL";_i.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var Oe=_i;var bq=ze(Oq(),1),jy=bq.default;var Jy={isBufferAvailable(){return typeof Buffer<"u"},from(n){return Buffer.from(n)}};var B0=100;function C0(n){return Z.isPlainObject(n)||Z.isArray(n)}function Mq(n){return Z.endsWith(n,"[]")?n.slice(0,-2):n}function u0(n,t,o){return n?n.concat(t).map(function(e,i){return e=Mq(e),!o&&i?"["+e+"]":e}).join(o?".":""):t}function RSe(n){return Z.isArray(n)&&!n.some(C0)}var kSe=Z.toFlatObject(Z,{},null,function(t){return/^is[A-Z]/.test(t)});function vSe(n,t,o){if(!Z.isObject(n))throw new TypeError("target must be an object");t=t||new(jy||FormData),o=Z.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,_){return!Z.isUndefined(_[T])});let a=o.metaTokens,e=o.visitor||f,i=o.dots,A=o.indexes,r=o.Blob||typeof Blob<"u"&&Blob,s=o.maxDepth===void 0?B0:o.maxDepth,g=r&&Z.isSpecCompliantForm(t),c=[];if(!Z.isFunction(e))throw new TypeError("visitor must be a function");function I(m){if(m===null)return"";if(Z.isDate(m))return m.toISOString();if(Z.isBoolean(m))return m.toString();if(!g&&Z.isBlob(m))throw new Oe("Blob is not supported. Use a Buffer instead.");if(Z.isArrayBuffer(m)||Z.isTypedArray(m)){if(g&&typeof r=="function")return new r([m]);if(Jy&&Jy.isBufferAvailable())return Jy.from(m);throw new Oe("Blob is not supported. Use a Buffer instead.",Oe.ERR_NOT_SUPPORT)}return m}function p(m){if(m>s)throw new Oe("Object is too deeply nested ("+m+" levels). Max depth: "+s,Oe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function B(m,T){if(s===1/0)return JSON.stringify(m);let _=[];return JSON.stringify(m,function(L,U){if(!Z.isObject(U))return U;for(;_.length&&_[_.length-1]!==this;)_.pop();return _.push(U),p(T+_.length-1),U})}function f(m,T,_){let R=m;if(Z.isReactNative(t)&&Z.isReactNativeBlob(m))return t.append(u0(_,T,i),I(m)),!1;if(m&&!_&&typeof m=="object"){if(Z.endsWith(T,"{}"))T=a?T:T.slice(0,-2),m=B(m,1);else if(Z.isArray(m)&&RSe(m)||(Z.isFileList(m)||Z.endsWith(T,"[]"))&&(R=Z.toArray(m)))return T=Mq(T),R.forEach(function(U,F){!(Z.isUndefined(U)||U===null)&&t.append(A===!0?u0([T],F,i):A===null?T:T+"[]",I(U))}),!1}return C0(m)?!0:(t.append(u0(_,T,i),I(m)),!1)}let Q=Object.assign(kSe,{defaultVisitor:f,convertValue:I,isVisitable:C0});function y(m,T,_=0){if(!Z.isUndefined(m)){if(p(_),c.indexOf(m)!==-1)throw new Error("Circular reference detected in "+T.join("."));c.push(m),Z.forEach(m,function(L,U){(!(Z.isUndefined(L)||L===null)&&e.call(t,L,Z.isString(U)?U.trim():U,T,Q))===!0&&y(L,T?T.concat(U):[U],_+1)}),c.pop()}}if(!Z.isObject(n))throw new TypeError("data must be an object");return y(n),t}var Oc=vSe;function _q(n){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(n).replace(/[!'()~]|%20/g,function(a){return t[a]})}function Tq(n,t){this._pairs=[],n&&Oc(n,this,t)}var Nq=Tq.prototype;Nq.append=function(t,o){this._pairs.push([t,o])};Nq.toString=function(t){let o=t?a=>t.call(this,a,_q):_q;return this._pairs.map(function(e){return o(e[0])+"="+o(e[1])},"").join("&")};var Rq=Tq;function PSe(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function rl(n,t,o){if(!t)return n;n=n||"";let a=Z.isFunction(o)?{serialize:o}:o,e=Z.getSafeProp(a,"encode")||PSe,i=Z.getSafeProp(a,"serialize"),A;if(i?A=i(t,a):A=Z.isURLSearchParams(t)?t.toString():new Rq(t,a).toString(e),A){let r=n.indexOf("#");r!==-1&&(n=n.slice(0,r)),n+=(n.indexOf("?")===-1?"?":"&")+A}return n}var f0=class{constructor(){this.handlers=[]}use(t,o,a){return this.handlers.push({fulfilled:t,rejected:o,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Z.forEach(this.handlers,function(a){a!==null&&t(a)})}},Q0=f0;var bc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0};import FSe from"crypto";import GSe from"url";var kq=GSe.URLSearchParams;var y0="abcdefghijklmnopqrstuvwxyz",vq="0123456789",Pq={DIGIT:vq,ALPHA:y0,ALPHA_DIGIT:y0+y0.toUpperCase()+vq},LSe=(n=16,t=Pq.ALPHA_DIGIT)=>{let o="",{length:a}=t,e=new Uint32Array(n);FSe.randomFillSync(e);for(let i=0;iS0,hasStandardBrowserEnv:()=>USe,hasStandardBrowserWebWorkerEnv:()=>HSe,navigator:()=>m0,origin:()=>KSe});var S0=typeof window<"u"&&typeof document<"u",m0=typeof navigator=="object"&&navigator||void 0,USe=S0&&(!m0||["ReactNative","NativeScript","NS"].indexOf(m0.product)<0),HSe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",KSe=S0&&window.location.href||"http://localhost";var Qt={...w0,...Gq};function D0(n,t){return Oc(n,new Qt.classes.URLSearchParams,{visitor:function(o,a,e,i){return Qt.isNode&&Z.isBuffer(o)?(this.append(a,o.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}var Fq=B0;function Lq(n){if(n>Fq)throw new Oe("FormData field is too deeply nested ("+n+" levels). Max depth: "+Fq,Oe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function xSe(n){let t=[],o=/[^.[\]]+|\[([^.[\]]*)]/g,a;for(;(a=o.exec(n))!==null;)Lq(t.length),t.push(a[0]==="[]"?"":a[1]||a[0]);return t}function YSe(n){let t={},o=Object.keys(n),a,e=o.length,i;for(a=0;a=o.length;return A=!A&&Z.isArray(e)?e.length:A,s?(Z.hasOwnProp(e,A)?e[A]=Z.isArray(e[A])?e[A].concat(a):[e[A],a]:e[A]=a,!r):((!Z.hasOwnProp(e,A)||!Z.isObject(e[A]))&&(e[A]=[]),t(o,a,e[A],i)&&Z.isArray(e[A])&&(e[A]=YSe(e[A])),!r)}if(Z.isFormData(n)&&Z.isFunction(n.entries)){let o={};return Z.forEachEntry(n,(a,e)=>{t(xSe(a),e,o,0)}),o}return null}var qy=jSe;var yd=(n,t)=>n!=null&&Z.hasOwnProp(n,t)?n[t]:void 0;function JSe(n,t,o){if(Z.isString(n))try{return(t||JSON.parse)(n),Z.trim(n)}catch(a){if(a.name!=="SyntaxError")throw a}return(o||JSON.stringify)(n)}var O0={transitional:bc,adapter:["xhr","http","fetch"],transformRequest:[function(t,o){let a=o.getContentType()||"",e=a.indexOf("application/json")>-1,i=Z.isObject(t);if(i&&Z.isHTMLForm(t)&&(t=new FormData(t)),Z.isFormData(t))return e?JSON.stringify(qy(t)):t;if(Z.isArrayBuffer(t)||Z.isBuffer(t)||Z.isStream(t)||Z.isFile(t)||Z.isBlob(t)||Z.isReadableStream(t))return t;if(Z.isArrayBufferView(t))return t.buffer;if(Z.isURLSearchParams(t))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let r;if(i){let s=yd(this,"formSerializer");if(a.indexOf("application/x-www-form-urlencoded")>-1)return D0(t,s).toString();if((r=Z.isFileList(t))||a.indexOf("multipart/form-data")>-1){let g=yd(this,"env"),c=g&&g.FormData;return Oc(r?{"files[]":t}:t,c&&new c,s)}}return i||e?(o.setContentType("application/json",!1),JSe(t)):t}],transformResponse:[function(t){let o=yd(this,"transitional")||O0.transitional,a=o&&o.forcedJSONParsing,e=yd(this,"responseType"),i=e==="json";if(Z.isResponse(t)||Z.isReadableStream(t))return t;if(t&&Z.isString(t)&&(a&&!e||i)){let r=!(o&&o.silentJSONParsing)&&i;try{return JSON.parse(t,yd(this,"parseReviver"))}catch(s){if(r)throw s.name==="SyntaxError"?Oe.from(s,Oe.ERR_BAD_RESPONSE,this,null,yd(this,"response")):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Qt.classes.FormData,Blob:Qt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch","query"],n=>{O0.headers[n]={}});var md=O0;function vu(n,t){let o=this||md,a=t||o,e=Yt.from(a.headers),i=a.data;return Z.forEach(n,function(r){i=r.call(o,i,e.normalize(),t?t.status:void 0)}),e.normalize(),i}function Pu(n){return!!(n&&n.__CANCEL__)}var b0=class extends Oe{constructor(t,o,a){super(t??"canceled",Oe.ERR_CANCELED,o,a),this.name="CanceledError",this.__CANCEL__=!0}},Io=b0;function Bs(n,t,o){let a=o.config.validateStatus;!o.status||!a||a(o.status)?n(o):t(new Oe("Request failed with status code "+o.status,o.status>=400&&o.status<500?Oe.ERR_BAD_REQUEST:Oe.ERR_BAD_RESPONSE,o.config,o.request,o))}function M0(n){return typeof n!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function _0(n,t){if(!t)return n;let o=n.length;for(;o>0&&n.charCodeAt(o-1)===47;)o--;return n.slice(0,o)+"/"+t.replace(/^\/+/,"")}var qSe=/^https?:(?!\/\/)/i,zSe=/[\t\n\r]/g;function VSe(n){let t=0;for(;t`${o}${a}${Mu}`)}function XSe(n){let t=n.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Mu}@`),o=t.indexOf("#"),e=(o===-1?t:t.slice(0,o)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Mu}`);return o===-1?e:`${e}#${ZSe(t.slice(o+1))}`}function Uq(n,t){if(typeof n=="string"){let o=WSe(n);if(qSe.test(o))throw new Oe(`Invalid URL ${JSON.stringify(XSe(o))}: missing "//" after protocol`,Oe.ERR_INVALID_URL,t)}}function il(n,t,o,a){Uq(t,a);let e=!M0(t);return n&&(e||o===!1)?(Uq(n,a),_0(n,t)):t}var $Se={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function ewe(n){try{return new URL(n)}catch{return null}}function Hq(n){var t=(typeof n=="string"?ewe(n):n)||{},o=t.protocol,a=t.host,e=t.port;if(typeof a!="string"||!a||typeof o!="string"||(o=o.split(":",1)[0],a=a.replace(/:\d*$/,""),e=parseInt(e)||$Se[o]||0,!Awe(a,e)))return"";var i=T0(o+"_proxy")||T0("all_proxy");return i&&i.indexOf("://")===-1&&(i=o+"://"+i),i}function Awe(n,t){var o=T0("no_proxy").toLowerCase();return o?o==="*"?!1:o.split(/[,\s]/).every(function(a){if(!a)return!0;var e=a.match(/^(.+):(\d+)$/),i=e?e[1]:a,A=e?parseInt(e[2]):0;return A&&A!==t?!0:/^[.*]/.test(i)?(i.charAt(0)==="*"&&(i=i.slice(1)),!n.endsWith(i)):n!==i}):!0}function T0(n){return process.env[n.toLowerCase()]||process.env[n.toUpperCase()]||""}var IN=ze(H0(),1),F4=ze(g4(),1);import P4 from"http";import G4 from"https";import _De from"http2";import TDe from"util";import{resolve as D4}from"path";import xo from"zlib";var mg="1.19.0";function ju(n){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(n);return t&&t[1]||""}var ADe=/^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;function eN(n,t,o){let a=o&&o.Blob||Qt.classes.Blob,e=ju(n);if(t===void 0&&a&&(t=!0),e==="data"){n=e.length?n.slice(e.length+1):n;let i=ADe.exec(n);if(!i)throw new Oe("Invalid URL",Oe.ERR_INVALID_URL);let A=i[1],r=i[2],s=i[3]?"base64":"utf8",g=i[4],c="";A?c=r?A+r:A:r&&(c="text/plain"+r);let I=s==="base64"?Buffer.from(g,"base64"):Buffer.from(decodeURIComponent(g),s);if(t){if(!a)throw new Oe("Blob is not supported",Oe.ERR_NOT_SUPPORT);return new a([I],{type:c})}return I}throw new Oe("Unsupported protocol "+e,Oe.ERR_NOT_SUPPORT)}import _n from"stream";var tDe=["content-type","content-length"];function Ju(n,t,o){if(o!=="content-only"){n.set(t);return}Object.entries(t||{}).forEach(([a,e])=>{tDe.includes(a.toLowerCase())&&n.set(a,e)})}import rDe from"stream";var AN=Symbol("internals"),tN=class extends rDe.Transform{constructor(t){t=Z.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(a,e)=>!Z.isUndefined(e[a])),super({readableHighWaterMark:t.chunkSize});let o=this[AN]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",a=>{a==="progress"&&(o.isCaptured||(o.isCaptured=!0))})}_read(t){let o=this[AN];return o.onReadCallback&&o.onReadCallback(),super._read(t)}_transform(t,o,a){let e=this[AN],i=e.maxRate,A=this.readableHighWaterMark,r=e.timeWindow,s=1e3/r,g=i/s,c=e.minChunkSize!==!1?Math.max(e.minChunkSize,g*.01):0,I=(B,f)=>{let Q=Buffer.byteLength(B);e.bytesSeen+=Q,e.bytes+=Q,e.isCaptured&&this.emit("progress",e.bytesSeen),this.push(B)?process.nextTick(f):e.onReadCallback=()=>{e.onReadCallback=null,process.nextTick(f)}},p=(B,f)=>{let Q=Buffer.byteLength(B),y=null,m=A,T,_=0;if(i){let R=Date.now();(!e.ts||(_=R-e.ts)>=r)&&(e.ts=R,T=g-e.bytes,e.bytes=T<0?-T:0,_=0),T=g-e.bytes}if(i){if(T<=0)return setTimeout(()=>{f(null,B)},r-_);Tm&&Q-m>c&&(y=B.subarray(m),B=B.subarray(0,m)),I(B,y?()=>{process.nextTick(f,null,y)}:f)};p(t,function B(f,Q){if(f)return a(f);Q?p(Q,B):a(null)})}},rN=tN;import{EventEmitter as NDe}from"events";import aDe from"util";import{Readable as oDe}from"stream";var{asyncIterator:c4}=Symbol,iDe=async function*(n){n.stream?yield*n.stream():n.arrayBuffer?yield await n.arrayBuffer():n[c4]?yield*n[c4]():yield n},$y=iDe;var nDe=Qt.ALPHABET.ALPHA_DIGIT+"-_",qu=typeof TextEncoder=="function"?new TextEncoder:new aDe.TextEncoder,gl=`\r -`,sDe=qu.encode(gl),gDe=2,iN=class{constructor(t,o){let{escapeName:a}=this.constructor,e=Z.isString(o),i=`Content-Disposition: form-data; name="${a(t)}"${!e&&o.name?`; filename="${a(o.name)}"`:""}${gl}`;if(e)o=qu.encode(String(o).replace(/\r?\n|\r\n?/g,gl));else{let A=String(o.type||"application/octet-stream").replace(/[\r\n]/g,"");i+=`Content-Type: ${A}${gl}`}this.headers=qu.encode(i+gl),this.contentLength=e?o.byteLength:o.size,this.size=this.headers.byteLength+this.contentLength+gDe,this.name=t,this.value=o}async*encode(){yield this.headers;let{value:t}=this;Z.isTypedArray(t)?yield t:yield*$y(t),yield sDe}static escapeName(t){return String(t).replace(/[\r\n"]/g,o=>({"\r":"%0D","\n":"%0A",'"':"%22"})[o])}},cDe=(n,t,o)=>{let{tag:a="form-data-boundary",size:e=25,boundary:i=a+"-"+Qt.generateString(e,nDe)}=o||{};if(!Z.isFormData(n))throw new TypeError("FormData instance required");if(i.length<1||i.length>70)throw new Error("boundary must be 1-70 characters long");let A=qu.encode("--"+i+gl),r=qu.encode("--"+i+"--"+gl),s=r.byteLength,g=Array.from(n.entries()).map(([I,p])=>{let B=new iN(I,p);return s+=B.size,B});s+=A.byteLength*g.length,s=Z.toFiniteNumber(s);let c={"Content-Type":`multipart/form-data; boundary=${i}`};return Number.isFinite(s)&&(c["Content-Length"]=s),t&&t(c),oDe.from((async function*(){for(let I of g)yield A,yield*I.encode();yield r})())},I4=cDe;import IDe from"stream";var aN=class extends IDe.Transform{__transform(t,o,a){this.push(t),a()}_transform(t,o,a){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,o)}this.__transform(t,o,a)}},l4=aN;import lDe from"http2";import pDe from"util";var oN=class{constructor(){this.sessions=Object.create(null)}getSession(t,o){o=Object.assign({sessionTimeout:1e3},o);let a=this.sessions[t];if(a){let I=a.length;for(let p=0;p{if(i)return;i=!0,A&&(clearTimeout(A),A=null);let I=a,p=I.length,B=p;for(;B--;)if(I[B][0]===e){p===1?delete this.sessions[t]:I.splice(B,1),e.closed||e.close();return}},s=e.request,{sessionTimeout:g}=o;if(g!=null){let I=0;e.request=function(){let p=s.apply(this,arguments);return I++,A&&(clearTimeout(A),A=null),p.once("close",()=>{--I||(A=setTimeout(()=>{A=null,r()},g))}),p}}e.once("close",r);let c=[e,o];return a?a.push(c):a=this.sessions[t]=[c],e}},p4=oN;var dDe=(n,t)=>Z.isAsyncFn(n)?function(...o){let a=o.pop();n.apply(this,o).then(e=>{try{t?a(null,...t(e)):a(null,e)}catch(i){a(i)}},a)}:n,d4=dDe;var hDe=new Set(["localhost","0.0.0.0"]),u4=n=>{let t=n.split(".");return t.length!==4||t[0]!=="127"?!1:t.every(o=>/^\d+$/.test(o)&&Number(o)>=0&&Number(o)<=255)},nN=n=>{if(/^0[xX][0-9a-fA-F]+$/.test(n)){let t=parseInt(n.slice(2),16);return Number.isFinite(t)?t:null}if(n.length>1&&/^0[0-7]+$/.test(n)){let t=parseInt(n,8);return Number.isFinite(t)?t:null}if(n.length>1&&/^0[0-9]+$/.test(n))return null;if(/^[0-9]+$/.test(n)){let t=parseInt(n,10);return Number.isFinite(t)?t:null}return null},EDe=n=>{if(typeof n!="string"||!n||n.indexOf(":")!==-1)return n;let t=n;if(t.charAt(0)==="["&&t.charAt(t.length-1)==="]"&&(t=t.slice(1,-1)),t=t.replace(/\.+$/,""),!/^[0-9.xXa-fA-F]+$/.test(t))return n;let o=t.split(".");if(o.some(c=>c===""))return n;if(o.length===4){let c=o.map(nN);return c.some(I=>I===null||I<0||I>255)?n:c.join(".")}if(o.length>4||o.length===1)return n;let a=o.slice(0,-1),e=o[o.length-1],i=4-a.length,A=nN(e);if(A===null)return n;let r=(1<<8*i)-1;if(A<0||A>r)return n;let s=new Array(i).fill(0);for(let c=i-1,I=A;c>=0;c--,I>>=8)s[c]=I&255;let g=a.map(nN);return g.some(c=>c===null||c<0||c>255)?n:[...g,...s].join(".")},sN=n=>/^0{1,4}$/.test(n),uDe=n=>{if(n==="::")return!0;let t=n.indexOf("::");if(t!==-1){if(t!==n.lastIndexOf("::"))return!1;let a=n.slice(0,t),e=n.slice(t+2),i=a?a.split(":"):[],A=e?e.split(":"):[];return i.length+A.length<8&&i.every(sN)&&A.every(sN)}let o=n.split(":");return o.length===8&&o.every(sN)},CDe=n=>{if(n==="::1")return!0;let t=n.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return u4(t[1]);let o=n.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(o){let e=parseInt(o[1],16);return e>=32512&&e<=32767}let a=n.split(":");if(a.length===8){for(let e=0;e<7;e++)if(!/^0+$/.test(a[e]))return!1;return/^0*1$/.test(a[7])}return!1},h4=n=>n?hDe.has(n)||u4(n)||uDe(n)?!0:CDe(n):!1,BDe={http:80,https:443,ws:80,wss:443,ftp:21},fDe=n=>{let t=n,o=0;if(t.charAt(0)==="["){let i=t.indexOf("]");if(i!==-1){let A=t.slice(1,i),r=t.slice(i+1);return r.charAt(0)===":"&&/^\d+$/.test(r.slice(1))&&(o=Number.parseInt(r.slice(1),10)),[A,o]}}let a=t.indexOf(":"),e=t.lastIndexOf(":");return a!==-1&&a===e&&/^\d+$/.test(t.slice(e+1))&&(o=Number.parseInt(t.slice(e+1),10),t=t.slice(0,e)),[t,o]},QDe=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i,yDe=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i,mDe=n=>{if(typeof n!="string"||n.indexOf(":")===-1)return n;let t=n.match(QDe);if(t)return t[1];let o=n.match(yDe);if(o){let a=parseInt(o[1],16),e=parseInt(o[2],16);return`${a>>8}.${a&255}.${e>>8}.${e&255}`}return n},E4=n=>{if(!n)return n;n.charAt(0)==="["&&n.charAt(n.length-1)==="]"&&(n=n.slice(1,-1));let t=n.replace(/\.+$/,""),o=EDe(t);return o!==t?o:mDe(t)};function gN(n){let t;try{t=new URL(n)}catch{return!1}let o=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!o)return!1;if(o==="*")return!0;let a=Number.parseInt(t.port,10)||BDe[t.protocol.split(":",1)[0]]||0,e=E4(t.hostname.toLowerCase());return o.split(/[\s,]+/).some(i=>{if(!i)return!1;if(i==="*")return!0;let[A,r]=fDe(i);return A=E4(A),!A||r&&r!==a?!1:(A.charAt(0)==="*"&&(A=A.slice(1)),A.charAt(0)==="."?e.endsWith(A):e===A||h4(e)&&h4(A))})}function SDe(n,t){n=n||10;let o=new Array(n),a=new Array(n),e=0,i=0,A;return t=t!==void 0?t:1e3,function(s){let g=Date.now(),c=a[i];A||(A=g),o[e]=s,a[e]=g;let I=i,p=0;for(;I!==e;)p+=o[I++],I=I%n;if(e=(e+1)%n,e===i&&(i=(i+1)%n),g-A{o=c,e=null,i&&(clearTimeout(i),i=null),n(...g)};return[(...g)=>{let c=Date.now(),I=c-o;I>=a?A(g,c):(e=g,i||(i=setTimeout(()=>{i=null,A(e)},a-I)))},()=>e&&A(e)]}var B4=wDe;var Sg=(n,t,o=3)=>{let a=0,e=C4(50,250);return B4(i=>{if(!i||typeof i.loaded!="number")return;let A=i.loaded,r=i.lengthComputable?i.total:void 0,s=Math.max(0,r!=null?Math.min(A,r):A),g=Math.max(0,s-a),c=e(g);a=Math.max(a,s);let I={loaded:s,total:r,progress:r?s/r:void 0,bytes:g,rate:c||void 0,estimated:c&&r?(r-s)/c:void 0,event:i,lengthComputable:r!=null,[t?"download":"upload"]:!0};n(I)},o)},bd=(n,t)=>{let o=n!=null;return[a=>t[0]({lengthComputable:o,total:n,loaded:a}),t[1]]},Md=(n,t=Z.asap)=>(...o)=>t(()=>n(...o));var f4=n=>n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102,y4=(n,t,o)=>t+2n<=57?n-48:(n&223)-55,DDe=n=>n>=65&&n<=90||n>=97&&n<=122||n>=48&&n<=57||n===43||n===47||n===45||n===95,ODe=n=>n===9||n===10||n===12||n===13||n===32,bDe=n=>{let t=Math.floor(n/4),o=n%4;return t*3+(o===2?1:o===3?2:0)},m4=n=>{let t=n.length,o=0;return t>0&&n.charCodeAt(t-1)===61&&(o++,t>1&&n.charCodeAt(t-2)===61&&o++),Math.floor((t-o)*3/4)},MDe=n=>{let t=n.length,o=0,a=0,e=!1;for(let i=0;i0){e=!0;continue}o++}}return e||a>2||a>0&&(o+a)%4!==0||o%4===1?m4(n):bDe(o)},S4=(n,t)=>{if(!n||typeof n!="string"||!n.startsWith("data:"))return 0;let o=n.indexOf(",");if(o<0)return 0;let a=n.slice(5,o),e=n.slice(o+1);if(/;base64/i.test(a))return t(e);let A=0;for(let r=0,s=e.length;r=55296&&g<=56319&&r+1=56320&&c<=57343?(A+=4,r++):A+=3}else A+=3}return A};function cN(n){let t=typeof n=="string"?n.indexOf("#"):-1;return S4(t===-1?n:n.slice(0,t),MDe)}function w4(n){return S4(n,m4)}var O4={flush:xo.constants.Z_SYNC_FLUSH,finishFlush:xo.constants.Z_SYNC_FLUSH},RDe={flush:xo.constants.BROTLI_OPERATION_FLUSH,finishFlush:xo.constants.BROTLI_OPERATION_FLUSH},kDe={flush:xo.constants.ZSTD_e_flush,finishFlush:xo.constants.ZSTD_e_flush},L4=Z.isFunction(xo.createBrotliDecompress),U4=Z.isFunction(xo.createZstdDecompress),H4="gzip, compress, deflate"+(L4?", br":""),vDe=H4+(U4?", zstd":""),b4=typeof process<"u"&&process.nextTick?process.nextTick.bind(process):Z.asap,{http:PDe,https:GDe}=F4.default,lN=/https:?/,M4=Symbol("axios.http.socketListener"),em=Symbol("axios.http.currentReq"),K4=Symbol("axios.http.installedTunnel"),FDe=new Map,_4=new WeakMap,T4={22:21,24:5};function LDe(n=process.versions&&process.versions.node){if(!n)return!1;let[t,o]=n.split(".").map(a=>Number(a));return!Number.isInteger(t)||!Number.isInteger(o)?!1:t>24?!0:T4[t]!=null&&o>=T4[t]}function UDe(n,t=process.versions&&process.versions.node){if(!LDe(t))return!1;let o=n&&n.options;return!!(o&&Z.hasOwnProp(o,"proxyEnv")&&o.proxyEnv!=null)}function HDe(n,t,o){return lN.test(n.protocol)?o||G4.globalAgent:t||P4.globalAgent}function KDe(n,t){let o=n.protocol+"//"+n.hostname+":"+(n.port||"")+"#"+(n.auth||""),a=t?_4.get(t)||_4.set(t,new Map).get(t):FDe,e=a.get(o);if(e)return e;let i=t&&t.options?{...t.options,...n}:n;if(e=new IN.default(i),t&&t.options){let A={...t.options},r=e.callback;e.callback=function(g,c){return r.call(this,g,{...A,...c})}}return e[K4]=!0,a.set(o,e),e}var N4=Qt.protocols.map(n=>n+":"),R4=n=>{if(!Z.isString(n))return n;try{return decodeURIComponent(n)}catch{return n}},k4=(n,[t,o])=>(n.on("end",o).on("error",o),t),xDe=new p4;function YDe(n,t,o){n.beforeRedirects.proxy&&n.beforeRedirects.proxy(n),n.beforeRedirects.auth&&n.beforeRedirects.auth(n),n.beforeRedirects.sensitiveHeaders&&n.beforeRedirects.sensitiveHeaders(n,o),n.beforeRedirects.config&&n.beforeRedirects.config(n,t,o)}function jDe(n,t){n&&Object.keys(n).forEach(o=>{t.has(o.toLowerCase())&&delete n[o]})}function JDe(n,t){if(!t)return!1;try{return new URL(t.url).origin===new URL(n.href).origin}catch{return!1}}function x4(n,t,o,a,e,i){let A=t,r=HDe(n,i,e);if(!A&&A!==!1&&!UDe(r)){let s=Hq(o);s&&(gN(o)||(A=new URL(s)))}if(a&&n.headers)for(let s of Object.keys(n.headers))s.toLowerCase()==="proxy-authorization"&&delete n.headers[s];if(a&&n.agent&&n.agent[K4]&&(n.agent=void 0),A){let s=A instanceof URL,g=f=>s||Z.hasOwnProp(A,f)?A[f]:void 0,c=g("username"),I=g("password"),p=Z.hasOwnProp(A,"auth")?A.auth:void 0;if(c&&(p=(c||"")+":"+(I||"")),p){let f=typeof p=="object",Q=f&&Z.hasOwnProp(p,"username")?p.username:void 0,y=f&&Z.hasOwnProp(p,"password")?p.password:void 0;if(!!(Q||y))p=(Q||"")+":"+(y||"");else if(f)throw new Oe("Invalid proxy authorization",Oe.ERR_BAD_OPTION,{proxy:A})}if(lN.test(n.protocol)){if(!(e instanceof IN.default)){let f=g("hostname")||g("host"),Q=g("port"),y=g("protocol"),m=y?y.includes(":")?y:`${y}:`:"http:",T=f&&f.includes(":")&&!f.startsWith("[")?`[${f}]`:f,_=new URL(`${m}//${T}${Q?":"+Q:""}`),R={protocol:_.protocol,hostname:_.hostname.replace(/^\[|\]$/g,""),port:_.port,auth:p&&typeof p=="string"?p:void 0};_.protocol==="https:"&&(R.ALPNProtocols=["http/1.1"]);let L=KDe(R,e);n.agent=L,n.agents&&(n.agents.https=L)}}else{if(p){let m=Buffer.from(p,"utf8").toString("base64");n.headers["Proxy-Authorization"]="Basic "+m}let f=!1;for(let m of Object.keys(n.headers))if(m.toLowerCase()==="host"){f=!0;break}f||(n.headers.host=n.hostname+(n.port?":"+n.port:""));let Q=g("hostname")||g("host");n.hostname=Q,n.host=Q,n.port=g("port"),n.path=o;let y=g("protocol");y&&(n.protocol=y.includes(":")?y:`${y}:`)}}n.beforeRedirects.proxy=function(g){x4(g,t,g.href,!0,e,i)}}var qDe=typeof process<"u"&&Z.kindOf(process)==="process",zDe=n=>new Promise((t,o)=>{let a,e,i=(s,g)=>{e||(e=!0,a&&a(s,g))},A=s=>{i(s),t(s)},r=s=>{i(s,!0),o(s)};n(A,r,s=>a=s).catch(r)}),VDe=({address:n,family:t})=>{if(!Z.isString(n))throw TypeError("address must be a string");return{address:n,family:t||(n.indexOf(".")<0?6:4)}},v4=(n,t)=>VDe(Z.isObject(n)?n:{address:n,family:t}),WDe={request(n,t){let o=n.protocol+"//"+n.hostname+":"+(n.port||(n.protocol==="https:"?443:80)),{http2Options:a,headers:e}=n,i=xDe.getSession(o,a),{HTTP2_HEADER_SCHEME:A,HTTP2_HEADER_METHOD:r,HTTP2_HEADER_PATH:s,HTTP2_HEADER_STATUS:g}=_De.constants,c={[A]:n.protocol.replace(":",""),[r]:n.method,[s]:n.path};Z.forEach(e,(p,B)=>{B.charAt(0)!==":"&&(c[B]=p)});let I=i.request(c);return I.once("response",p=>{let B=I;p=Object.assign({},p);let f=p[g];delete p[g],B.headers=p,B.statusCode=+f,t(B)}),I}},Y4=qDe&&function(t){return zDe(async function(a,e,i){let A=Ce=>Z.getSafeProp(t,Ce),r=A("transitional")||bc,s=A("data"),g=A("lookup"),c=A("family"),I=A("httpVersion");I===void 0&&(I=1);let p=A("http2Options"),B=A("httpAgent"),f=A("httpsAgent"),Q=A("proxy"),y=A("responseType"),m=A("responseEncoding"),T=A("socketPath"),_=A("method").toUpperCase(),R=A("maxRedirects"),L=A("maxBodyLength"),U=A("maxContentLength"),F=A("decompress"),q,z=!1,K,G;if(I=+I,Number.isNaN(I))throw TypeError(`Invalid protocol version: '${t.httpVersion}' is not a number`);if(I!==1&&I!==2)throw TypeError(`Unsupported protocol version '${I}'`);let V=I===2;if(g){let Ce=d4(g,ke=>Z.isArray(ke)?ke:[ke]);g=(ke,Ue,MA)=>{Ce(ke,Ue,(Ke,_A,ot)=>{if(Ke)return MA(Ke);let wA=Z.isArray(_A)?_A.map(ht=>v4(ht)):[v4(_A,ot)];Ue.all?MA(Ke,wA):MA(Ke,wA[0].address,wA[0].family)})}}let H=new NDe;function N(Ce){try{H.emit("abort",!Ce||Ce.type?new Io(null,t,K):Ce)}catch{}}function k(){G&&(clearTimeout(G),G=null)}function J(){let Ce=A("timeout"),ke=Ce?"timeout of "+Ce+"ms exceeded":"timeout exceeded",Ue=A("timeoutErrorMessage");return Ue&&(ke=Ue),new Oe(ke,r.clarifyTimeoutError?Oe.ETIMEDOUT:Oe.ECONNABORTED,t,K)}H.once("abort",e);let X=()=>{k(),t.cancelToken&&t.cancelToken.unsubscribe(N),t.signal&&t.signal.removeEventListener("abort",N),H.removeAllListeners()};(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(N),t.signal&&(t.signal.aborted?N():t.signal.addEventListener("abort",N))),i((Ce,ke)=>{if(q=!0,k(),ke){z=!0,X();return}let{data:Ue}=Ce;if(Ue instanceof _n.Readable||Ue instanceof _n.Duplex){let MA=_n.finished(Ue,()=>{MA(),X()})}else X()});let ie=il(A("baseURL"),A("url"),A("allowAbsoluteUrls"),t),De=T?"http://localhost":Qt.hasBrowserEnv?Qt.origin:void 0,oe=new URL(ie,De),Se=oe.protocol||N4[0];if(Se==="data:"){if(U>-1){let ke=String(A("url")||ie||"");if(w4(ke)>U)return e(new Oe("maxContentLength size of "+U+" exceeded",Oe.ERR_BAD_RESPONSE,t))}let Ce;if(_!=="GET")return Bs(a,e,{status:405,statusText:"method not allowed",headers:{},config:t});try{Ce=eN(A("url"),y==="blob",{Blob:t.env&&t.env.Blob})}catch(ke){throw Oe.from(ke,Oe.ERR_BAD_REQUEST,t)}return y==="text"?(Ce=Ce.toString(m),(!m||m==="utf8")&&(Ce=Z.stripBOM(Ce))):y==="stream"&&(Ce=_n.Readable.from(Ce)),Bs(a,e,{data:Ce,status:200,statusText:"OK",headers:new Yt,config:t})}if(N4.indexOf(Se)===-1)return e(new Oe("Unsupported protocol "+Se,Oe.ERR_BAD_REQUEST,t));let Be=Yt.from(t.headers).normalize();Be.set("User-Agent","axios/"+mg,!1);let{onUploadProgress:Re,onDownloadProgress:Ne}=t,Je=t.maxRate,ve,tA;if(Z.isSpecCompliantForm(s)){let Ce=Be.getContentType(/boundary=([-_\w\d]{10,70})/i);s=I4(s,ke=>{Be.set(ke)},{tag:`axios-${mg}-boundary`,boundary:Ce&&Ce[1]||void 0})}else if(Z.isFormData(s)&&Z.isFunction(s.getHeaders)&&s.getHeaders!==Object.prototype.getHeaders){if(Ju(Be,s.getHeaders(),A("formDataHeaderPolicy")),!Be.hasContentLength())try{let Ce=await TDe.promisify(s.getLength).call(s);Number.isFinite(Ce)&&Ce>=0&&Be.setContentLength(Ce)}catch{}}else if(Z.isBlob(s)||Z.isFile(s))s.size&&Be.setContentType(s.type||"application/octet-stream"),Be.setContentLength(s.size||0),s=_n.Readable.from($y(s));else if(s&&!Z.isStream(s)){if(!Buffer.isBuffer(s))if(Z.isArrayBuffer(s))s=Buffer.from(new Uint8Array(s));else if(Z.isString(s))s=Buffer.from(s,"utf-8");else return e(new Oe("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Oe.ERR_BAD_REQUEST,t));if(Be.setContentLength(s.length,!1),L>-1&&s.length>L)return e(new Oe("Request body larger than maxBodyLength limit",Oe.ERR_BAD_REQUEST,t))}let fe=Z.toFiniteNumber(Be.getContentLength());Z.isArray(Je)?(ve=Je[0],tA=Je[1]):ve=tA=Je,s&&(Re||ve)&&(Z.isStream(s)||(s=_n.Readable.from(s,{objectMode:!1})),s=_n.pipeline([s,new rN({maxRate:Z.toFiniteNumber(ve)})],Z.noop),Re&&s.on("progress",k4(s,bd(fe,Sg(Md(Re,b4),!1,3)))));let Ie,Xe=A("auth");if(Xe){let Ce=Z.getSafeProp(Xe,"username")||"",ke=Z.getSafeProp(Xe,"password")||"";Ie=Ce+":"+ke}if(!Ie&&(oe.username||oe.password)){let Ce=R4(oe.username),ke=R4(oe.password);Ie=Ce+":"+ke}Ie&&Be.delete("authorization");let je;try{je=rl(oe.pathname+oe.search,A("params"),A("paramsSerializer")).replace(/^\?/,"")}catch(Ce){return e(Oe.from(Ce,Oe.ERR_BAD_REQUEST,t,null,null,{url:A("url"),exists:!0}))}Be.set("Accept-Encoding",Z.hasOwnProp(r,"advertiseZstdAcceptEncoding")&&r.advertiseZstdAcceptEncoding===!0?vDe:H4,!1);let be=Object.assign(Object.create(null),{path:je,method:_,headers:Ed(Be),agents:{http:B,https:f},auth:Ie,protocol:Se,family:c,beforeRedirect:YDe,beforeRedirects:Object.create(null),http2Options:p});if(!Z.isUndefined(g)&&(be.lookup=g),T){if(typeof T!="string")return e(new Oe("socketPath must be a string",Oe.ERR_BAD_OPTION_VALUE,t));let Ce=A("allowedSocketPaths");if(Ce!=null){let ke=Array.isArray(Ce)?Ce:[Ce],Ue=D4(T);if(!ke.some(Ke=>typeof Ke=="string"&&D4(Ke)===Ue))return e(new Oe(`socketPath "${T}" is not permitted by allowedSocketPaths`,Oe.ERR_BAD_OPTION_VALUE,t))}be.socketPath=T}else be.hostname=oe.hostname.startsWith("[")?oe.hostname.slice(1,-1):oe.hostname,be.port=oe.port,x4(be,Q,Se+"//"+oe.hostname+(oe.port?":"+oe.port:"")+be.path,!1,f,B);let uA,EA=!1,aA=!1,Ze=lN.test(be.protocol);if(be.agent==null&&(be.agent=Ze?f:B),V)uA=WDe;else{let Ce=A("transport");if(Ce)uA=Ce;else if(R===0)uA=Ze?G4:P4,EA=!0;else{aA=!0,be.sensitiveHeaders=[],R&&(be.maxRedirects=R);let ke=A("beforeRedirect");if(ke&&(be.beforeRedirects.config=ke),Ie){let MA=oe.origin,Ke=Ie;be.beforeRedirects.auth=function(ot){try{new URL(ot.href).origin===MA&&(ot.auth=Ke)}catch{}}}let Ue=A("sensitiveHeaders");if(Ue!=null){if(!Z.isArray(Ue))return e(new Oe("sensitiveHeaders must be an array of strings",Oe.ERR_BAD_OPTION_VALUE,t));let MA=new Set;for(let Ke of Ue){if(!Z.isString(Ke))return e(new Oe("sensitiveHeaders must be an array of strings",Oe.ERR_BAD_OPTION_VALUE,t));MA.add(Ke.toLowerCase())}MA.size&&(be.sensitiveHeaders=Array.from(MA),be.beforeRedirects.sensitiveHeaders=function(_A,ot){JDe(_A,ot)||jDe(_A.headers,MA)})}uA=Ze?GDe:PDe}}L>-1?be.maxBodyLength=L:be.maxBodyLength=1/0,be.insecureHTTPParser=!!A("insecureHTTPParser"),K=uA.request(be,function(ke){if(k(),K.destroyed)return;let Ue=[ke],MA=Z.toFiniteNumber(ke.headers["content-length"]);if(Ne||tA){let wA=new rN({maxRate:Z.toFiniteNumber(tA)});Ne&&wA.on("progress",k4(wA,bd(MA,Sg(Md(Ne,b4),!0,3)))),Ue.push(wA)}let Ke=ke,_A=ke.req||K;if(F!==!1&&ke.headers["content-encoding"])switch((_==="HEAD"||ke.statusCode===204)&&delete ke.headers["content-encoding"],(ke.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Ue.push(xo.createUnzip(O4)),delete ke.headers["content-encoding"];break;case"deflate":Ue.push(new l4),Ue.push(xo.createUnzip(O4)),delete ke.headers["content-encoding"];break;case"br":L4&&(Ue.push(xo.createBrotliDecompress(RDe)),delete ke.headers["content-encoding"]);break;case"zstd":U4&&(Ue.push(xo.createZstdDecompress(kDe)),delete ke.headers["content-encoding"]);break}Ke=Ue.length>1?_n.pipeline(Ue,Z.noop):Ue[0];let ot={status:ke.statusCode,statusText:ke.statusMessage,headers:new Yt(ke.headers),config:t,request:_A};if(y==="stream"){if(U>-1){let wA=U,ht=Ke;async function*fr(){let UA=0;for await(let pe of ht){if(UA+=pe.length,UA>wA)throw new Oe("maxContentLength size of "+wA+" exceeded",Oe.ERR_BAD_RESPONSE,t,_A);yield pe}}Ke=_n.Readable.from(fr(),{objectMode:!1})}ot.data=Ke,Bs(a,e,ot)}else{let wA=[],ht=0;Ke.on("data",function(UA){wA.push(UA),ht+=UA.length,U>-1&&ht>U&&(z=!0,Ke.destroy(),N(new Oe("maxContentLength size of "+U+" exceeded",Oe.ERR_BAD_RESPONSE,t,_A)))}),Ke.on("aborted",function(){if(z)return;let UA=new Oe("stream has been aborted",Oe.ERR_BAD_RESPONSE,t,_A,ot);Ke.destroy(UA),e(UA)}),Ke.on("error",function(UA){z||e(Oe.from(UA,null,t,_A,ot))}),Ke.on("end",function(){try{let UA=wA.length===1?wA[0]:Buffer.concat(wA);y!=="arraybuffer"&&(UA=UA.toString(m),(!m||m==="utf8")&&(UA=Z.stripBOM(UA))),ot.data=UA}catch(UA){return e(Oe.from(UA,null,t,ot.request,ot))}Bs(a,e,ot)})}H.once("abort",wA=>{Ke.destroyed||(Ke.emit("error",wA),Ke.destroy())})}),H.once("abort",Ce=>{K.close?K.close():K.destroy(Ce)}),K.on("error",function(ke){e(Oe.from(ke,null,t,K))});let bA=new Set;if(K.on("socket",function(ke){typeof ke.setKeepAlive=="function"&&ke.setKeepAlive(!0,1e3*60),ke[M4]||(ke.on("error",function(MA){let Ke=ke[em];Ke&&!Ke.destroyed&&Ke.destroy(MA)}),ke[M4]=!0),ke[em]=K,bA.add(ke)}),K.once("close",function(){k();for(let ke of bA)ke[em]===K&&(ke[em]=null);bA.clear()}),A("timeout")){let Ce=parseInt(A("timeout"),10);if(Number.isNaN(Ce)){N(new Oe("error trying to parse `config.timeout` to int",Oe.ERR_BAD_OPTION_VALUE,t,K));return}let ke=function(){q||N(J())};EA&&Ce>0&&(G=setTimeout(ke,Ce)),K.setTimeout(Ce,ke)}else K.setTimeout(0);if(Z.isStream(s)){let Ce=!1,ke=!1;s.on("end",()=>{Ce=!0}),s.once("error",MA=>{ke=!0,K.destroy(MA)}),s.on("close",()=>{!Ce&&!ke&&N(new Io("Request stream has been aborted",t,K))});let Ue=s;if(L>-1&&!aA){let MA=L,Ke=0;Ue=_n.pipeline([s,new _n.Transform({transform(_A,ot,wA){if(Ke+=_A.length,Ke>MA)return wA(new Oe("Request body larger than maxBodyLength limit",Oe.ERR_BAD_REQUEST,t,K));wA(null,_A)}})],Z.noop),Ue.on("error",_A=>{K.destroyed||K.destroy(_A)})}Ue.pipe(K)}else s&&K.write(s),K.end()})};var j4=Qt.hasStandardBrowserEnv?((n,t)=>o=>(o=new URL(o,Qt.origin),n.protocol===o.protocol&&n.host===o.host&&(t||n.port===o.port)))(new URL(Qt.origin),Qt.navigator&&/(msie|trident)/i.test(Qt.navigator.userAgent)):()=>!0;var J4=Qt.hasStandardBrowserEnv?{write(n,t,o,a,e,i,A){if(typeof document>"u")return;let r=[`${n}=${encodeURIComponent(t)}`];Z.isNumber(o)&&r.push(`expires=${new Date(o).toUTCString()}`),Z.isString(a)&&r.push(`path=${a}`),Z.isString(e)&&r.push(`domain=${e}`),i===!0&&r.push("secure"),Z.isString(A)&&r.push(`SameSite=${A}`),document.cookie=r.join("; ")},read(n){if(typeof document>"u")return null;let t=document.cookie.split(";");for(let o=0;on instanceof Yt?{...n}:n,ZDe=n=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(n).concat(Object.getOwnPropertySymbols(n).filter(t=>Object.getOwnPropertyDescriptor(n,t).enumerable)):Object.keys(n);function Tn(n,t){n=n||{},t=t||{};let o=Object.create(null);Object.defineProperty(o,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function a(c,I,p,B){return Z.isPlainObject(c)&&Z.isPlainObject(I)?Z.merge.call({caseless:B},c,I):Z.isPlainObject(I)?Z.merge({},I):Z.isArray(I)?I.slice():I}function e(c,I,p,B){if(Z.isUndefined(I)){if(!Z.isUndefined(c))return a(void 0,c,p,B)}else return a(c,I,p,B)}function i(c,I){if(!Z.isUndefined(I))return a(void 0,I)}function A(c,I){if(Z.isUndefined(I)){if(!Z.isUndefined(c))return a(void 0,c)}else return a(void 0,I)}function r(c){let I=Z.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Z.isUndefined(I))if(Z.isPlainObject(I)){if(Z.hasOwnProp(I,c))return I[c]}else return;let p=Z.hasOwnProp(n,"transitional")?n.transitional:void 0;if(Z.isPlainObject(p)&&Z.hasOwnProp(p,c))return p[c]}function s(c,I,p){if(Z.hasOwnProp(t,p))return a(c,I);if(Z.hasOwnProp(n,p))return a(void 0,c)}let g={url:i,method:i,data:i,baseURL:A,transformRequest:A,transformResponse:A,paramsSerializer:A,timeout:A,timeoutMessage:A,withCredentials:A,withXSRFToken:A,adapter:A,responseType:A,xsrfCookieName:A,xsrfHeaderName:A,onUploadProgress:A,onDownloadProgress:A,decompress:A,maxContentLength:A,maxBodyLength:A,beforeRedirect:A,transport:A,httpAgent:A,httpsAgent:A,cancelToken:A,socketPath:A,allowedSocketPaths:A,responseEncoding:A,validateStatus:s,headers:(c,I,p)=>e(q4(c),q4(I),p,!0)};return Z.forEach(ZDe({...n,...t}),function(I){if(I==="__proto__"||I==="constructor"||I==="prototype")return;let p=Z.hasOwnProp(g,I)?g[I]:e,B=Z.hasOwnProp(n,I)?n[I]:void 0,f=Z.hasOwnProp(t,I)?t[I]:void 0,Q=p(B,f,I);Z.isUndefined(Q)&&p!==s||(o[I]=Q)}),Z.hasOwnProp(t,"validateStatus")&&Z.isUndefined(t.validateStatus)&&r("validateStatusUndefinedResolves")===!1&&(Z.hasOwnProp(n,"validateStatus")?o.validateStatus=a(void 0,n.validateStatus):delete o.validateStatus),o}var XDe=n=>encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(t,o)=>String.fromCharCode(parseInt(o,16)));function $De(n){let t=Tn({},n),o=p=>Z.hasOwnProp(t,p)?t[p]:void 0,a=o("data"),e=o("withXSRFToken"),i=o("xsrfHeaderName"),A=o("xsrfCookieName"),r=o("headers"),s=o("auth"),g=o("baseURL"),c=o("allowAbsoluteUrls"),I=o("url");if(t.headers=r=Yt.from(r),t.url=rl(il(g,I,c,t),o("params"),o("paramsSerializer")),s){let p=Z.getSafeProp(s,"username")||"",B=Z.getSafeProp(s,"password")||"";try{r.set("Authorization","Basic "+btoa(p+":"+(B?XDe(B):"")))}catch(f){throw Oe.from(f,Oe.ERR_BAD_OPTION_VALUE,n)}}if(Z.isFormData(a)&&(Qt.hasStandardBrowserEnv||Qt.hasStandardBrowserWebWorkerEnv||Z.isReactNative(a)?r.setContentType(void 0):Z.isFunction(a.getHeaders)&&Ju(r,a.getHeaders(),o("formDataHeaderPolicy"))),Qt.hasStandardBrowserEnv&&(Z.isFunction(e)&&(e=e(t)),e===!0||e==null&&j4(t.url))){let B=i&&A&&J4.read(A);B&&r.set(i,B)}return t}var Am=$De;var eOe=typeof XMLHttpRequest<"u",z4=eOe&&function(n){return new Promise(function(o,a){let e=Am(n),i=e.data,A=Yt.from(e.headers).normalize(),{responseType:r,onUploadProgress:s,onDownloadProgress:g}=e,c,I,p,B,f;function Q(){B&&B(),f&&f(),e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}let y=new XMLHttpRequest;y.open(e.method.toUpperCase(),e.url,!0),y.timeout=e.timeout;function m(){if(!y)return;let _=Yt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),L={data:!r||r==="text"||r==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:_,config:n,request:y};Bs(function(F){o(F),Q()},function(F){a(F),Q()},L),y=null}"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.startsWith("file:"))||setTimeout(m)},y.onabort=function(){y&&(a(new Oe("Request aborted",Oe.ECONNABORTED,n,y)),Q(),y=null)},y.onerror=function(R){let L=R&&R.message?R.message:"Network Error",U=new Oe(L,Oe.ERR_NETWORK,n,y);U.event=R||null,a(U),Q(),y=null},y.ontimeout=function(){let R=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",L=e.transitional||bc;e.timeoutErrorMessage&&(R=e.timeoutErrorMessage),a(new Oe(R,L.clarifyTimeoutError?Oe.ETIMEDOUT:Oe.ECONNABORTED,n,y)),Q(),y=null},i===void 0&&A.setContentType(null),"setRequestHeader"in y&&Z.forEach(Ed(A),function(R,L){y.setRequestHeader(L,R)}),Z.isUndefined(e.withCredentials)||(y.withCredentials=!!e.withCredentials),r&&r!=="json"&&(y.responseType=e.responseType),g&&([p,f]=Sg(g,!0),y.addEventListener("progress",p)),s&&y.upload&&([I,B]=Sg(s),y.upload.addEventListener("progress",I),y.upload.addEventListener("loadend",B)),(e.cancelToken||e.signal)&&(c=_=>{y&&(a(!_||_.type?new Io(null,n,y):_),y.abort(),Q(),y=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));let T=ju(e.url);if(T&&!Qt.protocols.includes(T)){a(new Oe("Unsupported protocol "+T+":",Oe.ERR_BAD_REQUEST,n)),Q();return}y.send(i||null)})};var AOe=(n,t)=>{if(n=n?n.filter(Boolean):[],!t&&!n.length)return;let o=new AbortController,a=!1,e=function(s){if(!a){a=!0,A();let g=s instanceof Error?s:this.reason;o.abort(g instanceof Oe?g:new Io(g instanceof Error?g.message:g))}},i=t&&setTimeout(()=>{i=null,e(new Oe(`timeout of ${t}ms exceeded`,Oe.ETIMEDOUT))},t),A=()=>{n&&(i&&clearTimeout(i),i=null,n.forEach(s=>{s.unsubscribe?s.unsubscribe(e):s.removeEventListener("abort",e)}),n=null)};n.forEach(s=>{if(!a){if(s.aborted){e.call(s);return}s.addEventListener("abort",e,{once:!0})}});let{signal:r}=o;return r.unsubscribe=()=>Z.asap(A),r},V4=AOe;var tOe=function*(n,t){let o=n.byteLength;if(!t||o{let e=rOe(n,t),i=0,A,r=s=>{A||(A=!0,a&&a(s))};return new ReadableStream({async pull(s){try{let{done:g,value:c}=await e.next();if(g){r(),s.close();return}let I=c.byteLength;if(o){let p=i+=I;o(p)}s.enqueue(new Uint8Array(c))}catch(g){throw r(g),g}},cancel(s){return r(s),e.return()}},{highWaterMark:2})};var W4=64*1024,{isFunction:tm}=Z,aOe=n=>encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(t,o)=>String.fromCharCode(parseInt(o,16))),Z4=n=>{if(!Z.isString(n))return n;try{return decodeURIComponent(n)}catch{return n}},X4=(n,...t)=>{try{return!!n(...t)}catch{return!1}},oOe=n=>{let t=n.indexOf("://"),o=n;return t!==-1&&(o=o.slice(t+3)),o.includes("@")||o.includes(":")},nOe=n=>{let t=Z.global!==void 0&&Z.global!==null?Z.global:globalThis,{ReadableStream:o,TextEncoder:a}=t;n=Z.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},n);let{fetch:e,Request:i,Response:A}=n,r=e?tm(e):typeof fetch=="function",s=tm(i),g=tm(A);if(!r)return!1;let c=r&&tm(o),I=r&&(typeof a=="function"?(m=>T=>m.encode(T))(new a):async m=>new Uint8Array(await new i(m).arrayBuffer())),p=s&&c&&X4(()=>{let m=!1,T=new i(Qt.origin,{body:new o,method:"POST",get duplex(){return m=!0,"half"}}),_=T.headers.has("Content-Type");return T.body!=null&&T.body.cancel(),m&&!_}),B=g&&c&&X4(()=>Z.isReadableStream(new A("").body)),f={stream:B&&(m=>m.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!f[m]&&(f[m]=(T,_)=>{let R=T&&T[m];if(R)return R.call(T);throw new Oe(`Response type '${m}' is not supported`,Oe.ERR_NOT_SUPPORT,_)})});let Q=async m=>{if(m==null)return 0;if(Z.isBlob(m))return m.size;if(Z.isSpecCompliantForm(m))return(await new i(Qt.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(Z.isArrayBufferView(m)||Z.isArrayBuffer(m))return m.byteLength;if(Z.isURLSearchParams(m)&&(m=m+""),Z.isString(m))return(await I(m)).byteLength},y=async(m,T)=>{let _=Z.toFiniteNumber(m.getContentLength());return _??Q(T)};return async m=>{let{url:T,method:_,data:R,signal:L,cancelToken:U,timeout:F,onDownloadProgress:q,onUploadProgress:z,responseType:K,headers:G,withCredentials:V="same-origin",fetchOptions:H,maxContentLength:N,maxBodyLength:k}=Am(m),J=Z.isNumber(N)&&N>-1,X=Z.isNumber(k)&&k>-1,ie=ve=>Z.hasOwnProp(m,ve)?m[ve]:void 0,De=e||fetch;K=K?(K+"").toLowerCase():"text";let oe=V4([L,U&&U.toAbortSignal()],F),Se=null,Be=oe&&oe.unsubscribe&&(()=>{oe.unsubscribe()}),Re,Ne=null,Je=()=>new Oe("Request body larger than maxBodyLength limit",Oe.ERR_BAD_REQUEST,m,Se);try{let ve,tA=ie("auth");if(tA){let Ze=Z.getSafeProp(tA,"username")||"",bA=Z.getSafeProp(tA,"password")||"";ve={username:Ze,password:bA}}if(oOe(T)){let Ze=new URL(T,Qt.origin);if(!ve&&(Ze.username||Ze.password)){let bA=Z4(Ze.username),Ce=Z4(Ze.password);ve={username:bA,password:Ce}}(Ze.username||Ze.password)&&(Ze.username="",Ze.password="",T=Ze.href)}if(ve&&(G.delete("authorization"),G.set("Authorization","Basic "+btoa(aOe((ve.username||"")+":"+(ve.password||""))))),J&&typeof T=="string"&&T.startsWith("data:")&&cN(T)>N)throw new Oe("maxContentLength size of "+N+" exceeded",Oe.ERR_BAD_RESPONSE,m,Se);if(X&&_!=="get"&&_!=="head"){let Ze=await Q(R);if(typeof Ze=="number"&&isFinite(Ze)&&(Re=Ze,Ze>k))throw Je()}let fe=X&&(Z.isReadableStream(R)||Z.isStream(R)),Ie=(Ze,bA,Ce)=>pN(Ze,W4,ke=>{if(X&&ke>k)throw Ne=Je();bA&&bA(ke)},Ce);if(p&&_!=="get"&&_!=="head"&&(z||fe)){if(Re=Re??await y(G,R),Re!==0||fe){let Ze=new i(T,{method:"POST",body:R,duplex:"half"}),bA;if(Z.isFormData(R)&&(bA=Ze.headers.get("content-type"))&&G.setContentType(bA),Ze.body){let[Ce,ke]=z&&bd(Re,Sg(Md(z)))||[];R=Ie(Ze.body,Ce,ke)}}}else if(fe&&!s&&c&&_!=="get"&&_!=="head")R=Ie(R);else if(fe&&s&&!p&&_!=="get"&&_!=="head")throw new Oe("Stream request bodies are not supported by the current fetch implementation",Oe.ERR_NOT_SUPPORT,m,Se);Z.isString(V)||(V=V?"include":"omit");let Xe=s&&"credentials"in i.prototype;if(Z.isFormData(R)){let Ze=G.getContentType();Ze&&/^multipart\/form-data/i.test(Ze)&&!/boundary=/i.test(Ze)&&G.delete("content-type")}G.set("User-Agent","axios/"+mg,!1);let je={...H,signal:oe,method:_.toUpperCase(),headers:Ed(G.normalize()),body:R,duplex:"half",credentials:Xe?V:void 0};Se=s&&new i(T,je);let be=await(s?De(Se,H):De(T,je)),uA=Yt.from(be.headers);if(J){let Ze=Z.toFiniteNumber(uA.getContentLength());if(Ze!=null&&Ze>N)throw new Oe("maxContentLength size of "+N+" exceeded",Oe.ERR_BAD_RESPONSE,m,Se)}let EA=B&&(K==="stream"||K==="response");if(B&&be.body&&(q||J||EA&&Be)){let Ze={};["status","statusText","headers"].forEach(Ke=>{Ze[Ke]=be[Ke]});let bA=Z.toFiniteNumber(uA.getContentLength()),[Ce,ke]=q&&bd(bA,Sg(Md(q),!0))||[],Ue=0,MA=Ke=>{if(J&&(Ue=Ke,Ue>N))throw new Oe("maxContentLength size of "+N+" exceeded",Oe.ERR_BAD_RESPONSE,m,Se);Ce&&Ce(Ke)};be=new A(pN(be.body,W4,MA,()=>{ke&&ke(),Be&&Be()}),Ze)}K=K||"text";let aA=await f[Z.findKey(f,K)||"text"](be,m);if(J&&!B&&!EA){let Ze;if(aA!=null&&(typeof aA.byteLength=="number"?Ze=aA.byteLength:typeof aA.size=="number"?Ze=aA.size:typeof aA=="string"&&(Ze=typeof a=="function"?new a().encode(aA).byteLength:aA.length)),typeof Ze=="number"&&Ze>N)throw new Oe("maxContentLength size of "+N+" exceeded",Oe.ERR_BAD_RESPONSE,m,Se)}return!EA&&Be&&Be(),await new Promise((Ze,bA)=>{Bs(Ze,bA,{data:aA,headers:Yt.from(be.headers),status:be.status,statusText:be.statusText,config:m,request:Se})})}catch(ve){if(Be&&Be(),oe&&oe.aborted&&oe.reason instanceof Oe){let tA=oe.reason;throw tA.config=m,Se&&(tA.request=Se),ve!==tA&&Object.defineProperty(tA,"cause",{__proto__:null,value:ve,writable:!0,enumerable:!1,configurable:!0}),tA}if(Ne)throw Se&&!Ne.request&&(Ne.request=Se),Ne;if(ve instanceof Oe)throw Se&&!ve.request&&(ve.request=Se),ve;if(ve&&ve.name==="TypeError"&&/Load failed|fetch/i.test(ve.message)){let tA=new Oe("Network Error",Oe.ERR_NETWORK,m,Se,ve&&ve.response);throw Object.defineProperty(tA,"cause",{__proto__:null,value:ve.cause||ve,writable:!0,enumerable:!1,configurable:!0}),tA}throw Oe.from(ve,ve&&ve.code,m,Se,ve&&ve.response)}}},sOe=new Map,dN=n=>{let t=n&&n.env||{},{fetch:o,Request:a,Response:e}=t,i=[a,e,o],A=i.length,r=A,s,g,c=sOe;for(;r--;)s=i[r],g=c.get(s),g===void 0&&c.set(s,g=r?new Map:nOe(t)),c=g;return g},EIA=dN();var hN={http:Y4,xhr:z4,fetch:{get:dN}};Z.forEach(hN,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(n,"adapterName",{__proto__:null,value:t})}});var $4=n=>`- ${n}`,cOe=n=>Z.isFunction(n)||n===null||n===!1;function IOe(n,t){n=Z.isArray(n)?n:[n];let{length:o}=n,a,e,i={};for(let A=0;A`adapter ${s} `+(g===!1?"is not supported by the environment":"is not available in the build")),r=o?A.length>1?`since : +`)}getSetCookie(){let t=this.get("set-cookie");return Z.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return Kye(t)}static concat(t,...o){let a=new this(t);return o.forEach(e=>a.set(e)),a}static accessor(t){let a=(this[wj]=this[wj]={accessors:{}}).accessors,e=this.prototype;function i(A){let r=bu(A);a[r]||(jye(e,A),a[r]=!0)}return Z.isArray(t)?t.forEach(i):i(t),this}};ud.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Z.reduceDescriptors(ud.prototype,({value:n},t)=>{let o=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(a){this[o]=a}}});Z.freezeMethods(ud);var Yt=ud;var Mu="[REDACTED ****]";function Jye(n){if(Z.hasOwnProp(n,"toJSON"))return!0;let t=Object.getPrototypeOf(n);for(;t&&t!==Object.prototype;){if(Z.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function qye(n,t){let o=new Set(t.map(i=>String(i).toLowerCase())),a=[],e=i=>{if(i===null||typeof i!="object"||Z.isBuffer(i))return i;if(a.indexOf(i)!==-1)return;i instanceof Yt&&(i=i.toJSON()),a.push(i);let A;if(Z.isArray(i))A=[],i.forEach((r,s)=>{let g=e(r);Z.isUndefined(g)||(A[s]=g)});else{if(!Z.isPlainObject(i)&&Jye(i))return a.pop(),i;A=Object.create(null);for(let[r,s]of Object.entries(i)){let g=o.has(r.toLowerCase())?Mu:e(s);Z.isUndefined(g)||(A[r]=g)}}return a.pop(),A};return e(n)}function Dj(n){try{return String(n)}catch{return""}}function zye(n){return n.errors.map(o=>{try{return o&&o.message?Dj(o.message):Dj(o)}catch{return""}}).filter(Boolean).join("; ")||n.name||"AggregateError"}var _i=class n extends Error{static from(t,o,a,e,i,A){let r=t.message;!r&&Z.isArray(t.errors)&&t.errors.length&&(r=zye(t));let s=new n(r,o||t.code,a,e,i);return Object.defineProperty(s,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),A&&Object.assign(s,A),s}constructor(t,o,a,e,i){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,o&&(this.code=o),a&&(this.config=a),e&&(this.request=e),i&&(this.response=i,this.status=i.status)}toJSON(){let t=this.config,o=t&&Z.hasOwnProp(t,"redact")?t.redact:void 0,a=Z.isArray(o)&&o.length>0?qye(t,o):Z.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a,code:this.code,status:this.status}}};_i.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";_i.ERR_BAD_OPTION="ERR_BAD_OPTION";_i.ECONNABORTED="ECONNABORTED";_i.ETIMEDOUT="ETIMEDOUT";_i.ECONNREFUSED="ECONNREFUSED";_i.ERR_NETWORK="ERR_NETWORK";_i.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";_i.ERR_DEPRECATED="ERR_DEPRECATED";_i.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";_i.ERR_BAD_REQUEST="ERR_BAD_REQUEST";_i.ERR_CANCELED="ERR_CANCELED";_i.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";_i.ERR_INVALID_URL="ERR_INVALID_URL";_i.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";var Oe=_i;var bq=ze(Oq(),1),jy=bq.default;var Jy={isBufferAvailable(){return typeof Buffer<"u"},from(n){return Buffer.from(n)}};var B0=100;function C0(n){return Z.isPlainObject(n)||Z.isArray(n)}function Mq(n){return Z.endsWith(n,"[]")?n.slice(0,-2):n}function u0(n,t,o){return n?n.concat(t).map(function(e,i){return e=Mq(e),!o&&i?"["+e+"]":e}).join(o?".":""):t}function RSe(n){return Z.isArray(n)&&!n.some(C0)}var kSe=Z.toFlatObject(Z,{},null,function(t){return/^is[A-Z]/.test(t)});function vSe(n,t,o){if(!Z.isObject(n))throw new TypeError("target must be an object");t=t||new(jy||FormData),o=Z.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,_){return!Z.isUndefined(_[T])});let a=o.metaTokens,e=o.visitor||f,i=o.dots,A=o.indexes,r=o.Blob||typeof Blob<"u"&&Blob,s=o.maxDepth===void 0?B0:o.maxDepth,g=r&&Z.isSpecCompliantForm(t),c=[];if(!Z.isFunction(e))throw new TypeError("visitor must be a function");function I(m){if(m===null)return"";if(Z.isDate(m))return m.toISOString();if(Z.isBoolean(m))return m.toString();if(!g&&Z.isBlob(m))throw new Oe("Blob is not supported. Use a Buffer instead.");if(Z.isArrayBuffer(m)||Z.isTypedArray(m)){if(g&&typeof r=="function")return new r([m]);if(Jy&&Jy.isBufferAvailable())return Jy.from(m);throw new Oe("Blob is not supported. Use a Buffer instead.",Oe.ERR_NOT_SUPPORT)}return m}function p(m){if(m>s)throw new Oe("Object is too deeply nested ("+m+" levels). Max depth: "+s,Oe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function B(m,T){if(s===1/0)return JSON.stringify(m);let _=[];return JSON.stringify(m,function(L,U){if(!Z.isObject(U))return U;for(;_.length&&_[_.length-1]!==this;)_.pop();return _.push(U),p(T+_.length-1),U})}function f(m,T,_){let R=m;if(Z.isReactNative(t)&&Z.isReactNativeBlob(m))return t.append(u0(_,T,i),I(m)),!1;if(m&&!_&&typeof m=="object"){if(Z.endsWith(T,"{}"))T=a?T:T.slice(0,-2),m=B(m,1);else if(Z.isArray(m)&&RSe(m)||(Z.isFileList(m)||Z.endsWith(T,"[]"))&&(R=Z.toArray(m)))return T=Mq(T),R.forEach(function(U,F){!(Z.isUndefined(U)||U===null)&&t.append(A===!0?u0([T],F,i):A===null?T:T+"[]",I(U))}),!1}return C0(m)?!0:(t.append(u0(_,T,i),I(m)),!1)}let Q=Object.assign(kSe,{defaultVisitor:f,convertValue:I,isVisitable:C0});function y(m,T,_=0){if(!Z.isUndefined(m)){if(p(_),c.indexOf(m)!==-1)throw new Error("Circular reference detected in "+T.join("."));c.push(m),Z.forEach(m,function(L,U){(!(Z.isUndefined(L)||L===null)&&e.call(t,L,Z.isString(U)?U.trim():U,T,Q))===!0&&y(L,T?T.concat(U):[U],_+1)}),c.pop()}}if(!Z.isObject(n))throw new TypeError("data must be an object");return y(n),t}var Oc=vSe;function _q(n){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(n).replace(/[!'()~]|%20/g,function(a){return t[a]})}function Tq(n,t){this._pairs=[],n&&Oc(n,this,t)}var Nq=Tq.prototype;Nq.append=function(t,o){this._pairs.push([t,o])};Nq.toString=function(t){let o=t?a=>t.call(this,a,_q):_q;return this._pairs.map(function(e){return o(e[0])+"="+o(e[1])},"").join("&")};var Rq=Tq;function PSe(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function rl(n,t,o){if(!t)return n;n=n||"";let a=Z.isFunction(o)?{serialize:o}:o,e=Z.getSafeProp(a,"encode")||PSe,i=Z.getSafeProp(a,"serialize"),A;if(i?A=i(t,a):A=Z.isURLSearchParams(t)?t.toString():new Rq(t,a).toString(e),A){let r=n.indexOf("#");r!==-1&&(n=n.slice(0,r)),n+=(n.indexOf("?")===-1?"?":"&")+A}return n}var f0=class{constructor(){this.handlers=[]}use(t,o,a){return this.handlers.push({fulfilled:t,rejected:o,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Z.forEach(this.handlers,function(a){a!==null&&t(a)})}},Q0=f0;var bc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0};import FSe from"crypto";import GSe from"url";var kq=GSe.URLSearchParams;var y0="abcdefghijklmnopqrstuvwxyz",vq="0123456789",Pq={DIGIT:vq,ALPHA:y0,ALPHA_DIGIT:y0+y0.toUpperCase()+vq},LSe=(n=16,t=Pq.ALPHA_DIGIT)=>{let o="",{length:a}=t,e=new Uint32Array(n);FSe.randomFillSync(e);for(let i=0;iS0,hasStandardBrowserEnv:()=>USe,hasStandardBrowserWebWorkerEnv:()=>HSe,navigator:()=>m0,origin:()=>KSe});var S0=typeof window<"u"&&typeof document<"u",m0=typeof navigator=="object"&&navigator||void 0,USe=S0&&(!m0||["ReactNative","NativeScript","NS"].indexOf(m0.product)<0),HSe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",KSe=S0&&window.location.href||"http://localhost";var yt={...w0,...Gq};function D0(n,t){return Oc(n,new yt.classes.URLSearchParams,{visitor:function(o,a,e,i){return yt.isNode&&Z.isBuffer(o)?(this.append(a,o.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}var Fq=B0;function Lq(n){if(n>Fq)throw new Oe("FormData field is too deeply nested ("+n+" levels). Max depth: "+Fq,Oe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function xSe(n){let t=[],o=/[^.[\]]+|\[([^.[\]]*)]/g,a;for(;(a=o.exec(n))!==null;)Lq(t.length),t.push(a[0]==="[]"?"":a[1]||a[0]);return t}function YSe(n){let t={},o=Object.keys(n),a,e=o.length,i;for(a=0;a=o.length;return A=!A&&Z.isArray(e)?e.length:A,s?(Z.hasOwnProp(e,A)?e[A]=Z.isArray(e[A])?e[A].concat(a):[e[A],a]:e[A]=a,!r):((!Z.hasOwnProp(e,A)||!Z.isObject(e[A]))&&(e[A]=[]),t(o,a,e[A],i)&&Z.isArray(e[A])&&(e[A]=YSe(e[A])),!r)}if(Z.isFormData(n)&&Z.isFunction(n.entries)){let o={};return Z.forEachEntry(n,(a,e)=>{t(xSe(a),e,o,0)}),o}return null}var qy=jSe;var yd=(n,t)=>n!=null&&Z.hasOwnProp(n,t)?n[t]:void 0;function JSe(n,t,o){if(Z.isString(n))try{return(t||JSON.parse)(n),Z.trim(n)}catch(a){if(a.name!=="SyntaxError")throw a}return(o||JSON.stringify)(n)}var O0={transitional:bc,adapter:["xhr","http","fetch"],transformRequest:[function(t,o){let a=o.getContentType()||"",e=a.indexOf("application/json")>-1,i=Z.isObject(t);if(i&&Z.isHTMLForm(t)&&(t=new FormData(t)),Z.isFormData(t))return e?JSON.stringify(qy(t)):t;if(Z.isArrayBuffer(t)||Z.isBuffer(t)||Z.isStream(t)||Z.isFile(t)||Z.isBlob(t)||Z.isReadableStream(t))return t;if(Z.isArrayBufferView(t))return t.buffer;if(Z.isURLSearchParams(t))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let r;if(i){let s=yd(this,"formSerializer");if(a.indexOf("application/x-www-form-urlencoded")>-1)return D0(t,s).toString();if((r=Z.isFileList(t))||a.indexOf("multipart/form-data")>-1){let g=yd(this,"env"),c=g&&g.FormData;return Oc(r?{"files[]":t}:t,c&&new c,s)}}return i||e?(o.setContentType("application/json",!1),JSe(t)):t}],transformResponse:[function(t){let o=yd(this,"transitional")||O0.transitional,a=o&&o.forcedJSONParsing,e=yd(this,"responseType"),i=e==="json";if(Z.isResponse(t)||Z.isReadableStream(t))return t;if(t&&Z.isString(t)&&(a&&!e||i)){let r=!(o&&o.silentJSONParsing)&&i;try{return JSON.parse(t,yd(this,"parseReviver"))}catch(s){if(r)throw s.name==="SyntaxError"?Oe.from(s,Oe.ERR_BAD_RESPONSE,this,null,yd(this,"response")):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yt.classes.FormData,Blob:yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Z.forEach(["delete","get","head","post","put","patch","query"],n=>{O0.headers[n]={}});var md=O0;function vu(n,t){let o=this||md,a=t||o,e=Yt.from(a.headers),i=a.data;return Z.forEach(n,function(r){i=r.call(o,i,e.normalize(),t?t.status:void 0)}),e.normalize(),i}function Pu(n){return!!(n&&n.__CANCEL__)}var b0=class extends Oe{constructor(t,o,a){super(t??"canceled",Oe.ERR_CANCELED,o,a),this.name="CanceledError",this.__CANCEL__=!0}},Io=b0;function Bs(n,t,o){let a=o.config.validateStatus;!o.status||!a||a(o.status)?n(o):t(new Oe("Request failed with status code "+o.status,o.status>=400&&o.status<500?Oe.ERR_BAD_REQUEST:Oe.ERR_BAD_RESPONSE,o.config,o.request,o))}function M0(n){return typeof n!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function _0(n,t){if(!t)return n;let o=n.length;for(;o>0&&n.charCodeAt(o-1)===47;)o--;return n.slice(0,o)+"/"+t.replace(/^\/+/,"")}var qSe=/^https?:(?!\/\/)/i,zSe=/[\t\n\r]/g;function VSe(n){let t=0;for(;t`${o}${a}${Mu}`)}function XSe(n){let t=n.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${Mu}@`),o=t.indexOf("#"),e=(o===-1?t:t.slice(0,o)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${Mu}`);return o===-1?e:`${e}#${ZSe(t.slice(o+1))}`}function Uq(n,t){if(typeof n=="string"){let o=WSe(n);if(qSe.test(o))throw new Oe(`Invalid URL ${JSON.stringify(XSe(o))}: missing "//" after protocol`,Oe.ERR_INVALID_URL,t)}}function il(n,t,o,a){Uq(t,a);let e=!M0(t);return n&&(e||o===!1)?(Uq(n,a),_0(n,t)):t}var $Se={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443};function ewe(n){try{return new URL(n)}catch{return null}}function Hq(n){var t=(typeof n=="string"?ewe(n):n)||{},o=t.protocol,a=t.host,e=t.port;if(typeof a!="string"||!a||typeof o!="string"||(o=o.split(":",1)[0],a=a.replace(/:\d*$/,""),e=parseInt(e)||$Se[o]||0,!Awe(a,e)))return"";var i=T0(o+"_proxy")||T0("all_proxy");return i&&i.indexOf("://")===-1&&(i=o+"://"+i),i}function Awe(n,t){var o=T0("no_proxy").toLowerCase();return o?o==="*"?!1:o.split(/[,\s]/).every(function(a){if(!a)return!0;var e=a.match(/^(.+):(\d+)$/),i=e?e[1]:a,A=e?parseInt(e[2]):0;return A&&A!==t?!0:/^[.*]/.test(i)?(i.charAt(0)==="*"&&(i=i.slice(1)),!n.endsWith(i)):n!==i}):!0}function T0(n){return process.env[n.toLowerCase()]||process.env[n.toUpperCase()]||""}var IN=ze(H0(),1),F4=ze(g4(),1);import P4 from"http";import G4 from"https";import _De from"http2";import TDe from"util";import{resolve as D4}from"path";import xo from"zlib";var mg="1.19.0";function ju(n){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(n);return t&&t[1]||""}var ADe=/^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;function eN(n,t,o){let a=o&&o.Blob||yt.classes.Blob,e=ju(n);if(t===void 0&&a&&(t=!0),e==="data"){n=e.length?n.slice(e.length+1):n;let i=ADe.exec(n);if(!i)throw new Oe("Invalid URL",Oe.ERR_INVALID_URL);let A=i[1],r=i[2],s=i[3]?"base64":"utf8",g=i[4],c="";A?c=r?A+r:A:r&&(c="text/plain"+r);let I=s==="base64"?Buffer.from(g,"base64"):Buffer.from(decodeURIComponent(g),s);if(t){if(!a)throw new Oe("Blob is not supported",Oe.ERR_NOT_SUPPORT);return new a([I],{type:c})}return I}throw new Oe("Unsupported protocol "+e,Oe.ERR_NOT_SUPPORT)}import _n from"stream";var tDe=["content-type","content-length"];function Ju(n,t,o){if(o!=="content-only"){n.set(t);return}Object.entries(t||{}).forEach(([a,e])=>{tDe.includes(a.toLowerCase())&&n.set(a,e)})}import rDe from"stream";var AN=Symbol("internals"),tN=class extends rDe.Transform{constructor(t){t=Z.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(a,e)=>!Z.isUndefined(e[a])),super({readableHighWaterMark:t.chunkSize});let o=this[AN]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",a=>{a==="progress"&&(o.isCaptured||(o.isCaptured=!0))})}_read(t){let o=this[AN];return o.onReadCallback&&o.onReadCallback(),super._read(t)}_transform(t,o,a){let e=this[AN],i=e.maxRate,A=this.readableHighWaterMark,r=e.timeWindow,s=1e3/r,g=i/s,c=e.minChunkSize!==!1?Math.max(e.minChunkSize,g*.01):0,I=(B,f)=>{let Q=Buffer.byteLength(B);e.bytesSeen+=Q,e.bytes+=Q,e.isCaptured&&this.emit("progress",e.bytesSeen),this.push(B)?process.nextTick(f):e.onReadCallback=()=>{e.onReadCallback=null,process.nextTick(f)}},p=(B,f)=>{let Q=Buffer.byteLength(B),y=null,m=A,T,_=0;if(i){let R=Date.now();(!e.ts||(_=R-e.ts)>=r)&&(e.ts=R,T=g-e.bytes,e.bytes=T<0?-T:0,_=0),T=g-e.bytes}if(i){if(T<=0)return setTimeout(()=>{f(null,B)},r-_);Tm&&Q-m>c&&(y=B.subarray(m),B=B.subarray(0,m)),I(B,y?()=>{process.nextTick(f,null,y)}:f)};p(t,function B(f,Q){if(f)return a(f);Q?p(Q,B):a(null)})}},rN=tN;import{EventEmitter as NDe}from"events";import aDe from"util";import{Readable as oDe}from"stream";var{asyncIterator:c4}=Symbol,iDe=async function*(n){n.stream?yield*n.stream():n.arrayBuffer?yield await n.arrayBuffer():n[c4]?yield*n[c4]():yield n},$y=iDe;var nDe=yt.ALPHABET.ALPHA_DIGIT+"-_",qu=typeof TextEncoder=="function"?new TextEncoder:new aDe.TextEncoder,gl=`\r +`,sDe=qu.encode(gl),gDe=2,iN=class{constructor(t,o){let{escapeName:a}=this.constructor,e=Z.isString(o),i=`Content-Disposition: form-data; name="${a(t)}"${!e&&o.name?`; filename="${a(o.name)}"`:""}${gl}`;if(e)o=qu.encode(String(o).replace(/\r?\n|\r\n?/g,gl));else{let A=String(o.type||"application/octet-stream").replace(/[\r\n]/g,"");i+=`Content-Type: ${A}${gl}`}this.headers=qu.encode(i+gl),this.contentLength=e?o.byteLength:o.size,this.size=this.headers.byteLength+this.contentLength+gDe,this.name=t,this.value=o}async*encode(){yield this.headers;let{value:t}=this;Z.isTypedArray(t)?yield t:yield*$y(t),yield sDe}static escapeName(t){return String(t).replace(/[\r\n"]/g,o=>({"\r":"%0D","\n":"%0A",'"':"%22"})[o])}},cDe=(n,t,o)=>{let{tag:a="form-data-boundary",size:e=25,boundary:i=a+"-"+yt.generateString(e,nDe)}=o||{};if(!Z.isFormData(n))throw new TypeError("FormData instance required");if(i.length<1||i.length>70)throw new Error("boundary must be 1-70 characters long");let A=qu.encode("--"+i+gl),r=qu.encode("--"+i+"--"+gl),s=r.byteLength,g=Array.from(n.entries()).map(([I,p])=>{let B=new iN(I,p);return s+=B.size,B});s+=A.byteLength*g.length,s=Z.toFiniteNumber(s);let c={"Content-Type":`multipart/form-data; boundary=${i}`};return Number.isFinite(s)&&(c["Content-Length"]=s),t&&t(c),oDe.from((async function*(){for(let I of g)yield A,yield*I.encode();yield r})())},I4=cDe;import IDe from"stream";var aN=class extends IDe.Transform{__transform(t,o,a){this.push(t),a()}_transform(t,o,a){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,o)}this.__transform(t,o,a)}},l4=aN;import lDe from"http2";import pDe from"util";var oN=class{constructor(){this.sessions=Object.create(null)}getSession(t,o){o=Object.assign({sessionTimeout:1e3},o);let a=this.sessions[t];if(a){let I=a.length;for(let p=0;p{if(i)return;i=!0,A&&(clearTimeout(A),A=null);let I=a,p=I.length,B=p;for(;B--;)if(I[B][0]===e){p===1?delete this.sessions[t]:I.splice(B,1),e.closed||e.close();return}},s=e.request,{sessionTimeout:g}=o;if(g!=null){let I=0;e.request=function(){let p=s.apply(this,arguments);return I++,A&&(clearTimeout(A),A=null),p.once("close",()=>{--I||(A=setTimeout(()=>{A=null,r()},g))}),p}}e.once("close",r);let c=[e,o];return a?a.push(c):a=this.sessions[t]=[c],e}},p4=oN;var dDe=(n,t)=>Z.isAsyncFn(n)?function(...o){let a=o.pop();n.apply(this,o).then(e=>{try{t?a(null,...t(e)):a(null,e)}catch(i){a(i)}},a)}:n,d4=dDe;var hDe=new Set(["localhost","0.0.0.0"]),u4=n=>{let t=n.split(".");return t.length!==4||t[0]!=="127"?!1:t.every(o=>/^\d+$/.test(o)&&Number(o)>=0&&Number(o)<=255)},nN=n=>{if(/^0[xX][0-9a-fA-F]+$/.test(n)){let t=parseInt(n.slice(2),16);return Number.isFinite(t)?t:null}if(n.length>1&&/^0[0-7]+$/.test(n)){let t=parseInt(n,8);return Number.isFinite(t)?t:null}if(n.length>1&&/^0[0-9]+$/.test(n))return null;if(/^[0-9]+$/.test(n)){let t=parseInt(n,10);return Number.isFinite(t)?t:null}return null},EDe=n=>{if(typeof n!="string"||!n||n.indexOf(":")!==-1)return n;let t=n;if(t.charAt(0)==="["&&t.charAt(t.length-1)==="]"&&(t=t.slice(1,-1)),t=t.replace(/\.+$/,""),!/^[0-9.xXa-fA-F]+$/.test(t))return n;let o=t.split(".");if(o.some(c=>c===""))return n;if(o.length===4){let c=o.map(nN);return c.some(I=>I===null||I<0||I>255)?n:c.join(".")}if(o.length>4||o.length===1)return n;let a=o.slice(0,-1),e=o[o.length-1],i=4-a.length,A=nN(e);if(A===null)return n;let r=(1<<8*i)-1;if(A<0||A>r)return n;let s=new Array(i).fill(0);for(let c=i-1,I=A;c>=0;c--,I>>=8)s[c]=I&255;let g=a.map(nN);return g.some(c=>c===null||c<0||c>255)?n:[...g,...s].join(".")},sN=n=>/^0{1,4}$/.test(n),uDe=n=>{if(n==="::")return!0;let t=n.indexOf("::");if(t!==-1){if(t!==n.lastIndexOf("::"))return!1;let a=n.slice(0,t),e=n.slice(t+2),i=a?a.split(":"):[],A=e?e.split(":"):[];return i.length+A.length<8&&i.every(sN)&&A.every(sN)}let o=n.split(":");return o.length===8&&o.every(sN)},CDe=n=>{if(n==="::1")return!0;let t=n.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(t)return u4(t[1]);let o=n.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(o){let e=parseInt(o[1],16);return e>=32512&&e<=32767}let a=n.split(":");if(a.length===8){for(let e=0;e<7;e++)if(!/^0+$/.test(a[e]))return!1;return/^0*1$/.test(a[7])}return!1},h4=n=>n?hDe.has(n)||u4(n)||uDe(n)?!0:CDe(n):!1,BDe={http:80,https:443,ws:80,wss:443,ftp:21},fDe=n=>{let t=n,o=0;if(t.charAt(0)==="["){let i=t.indexOf("]");if(i!==-1){let A=t.slice(1,i),r=t.slice(i+1);return r.charAt(0)===":"&&/^\d+$/.test(r.slice(1))&&(o=Number.parseInt(r.slice(1),10)),[A,o]}}let a=t.indexOf(":"),e=t.lastIndexOf(":");return a!==-1&&a===e&&/^\d+$/.test(t.slice(e+1))&&(o=Number.parseInt(t.slice(e+1),10),t=t.slice(0,e)),[t,o]},QDe=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i,yDe=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i,mDe=n=>{if(typeof n!="string"||n.indexOf(":")===-1)return n;let t=n.match(QDe);if(t)return t[1];let o=n.match(yDe);if(o){let a=parseInt(o[1],16),e=parseInt(o[2],16);return`${a>>8}.${a&255}.${e>>8}.${e&255}`}return n},E4=n=>{if(!n)return n;n.charAt(0)==="["&&n.charAt(n.length-1)==="]"&&(n=n.slice(1,-1));let t=n.replace(/\.+$/,""),o=EDe(t);return o!==t?o:mDe(t)};function gN(n){let t;try{t=new URL(n)}catch{return!1}let o=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!o)return!1;if(o==="*")return!0;let a=Number.parseInt(t.port,10)||BDe[t.protocol.split(":",1)[0]]||0,e=E4(t.hostname.toLowerCase());return o.split(/[\s,]+/).some(i=>{if(!i)return!1;if(i==="*")return!0;let[A,r]=fDe(i);return A=E4(A),!A||r&&r!==a?!1:(A.charAt(0)==="*"&&(A=A.slice(1)),A.charAt(0)==="."?e.endsWith(A):e===A||h4(e)&&h4(A))})}function SDe(n,t){n=n||10;let o=new Array(n),a=new Array(n),e=0,i=0,A;return t=t!==void 0?t:1e3,function(s){let g=Date.now(),c=a[i];A||(A=g),o[e]=s,a[e]=g;let I=i,p=0;for(;I!==e;)p+=o[I++],I=I%n;if(e=(e+1)%n,e===i&&(i=(i+1)%n),g-A{o=c,e=null,i&&(clearTimeout(i),i=null),n(...g)};return[(...g)=>{let c=Date.now(),I=c-o;I>=a?A(g,c):(e=g,i||(i=setTimeout(()=>{i=null,A(e)},a-I)))},()=>e&&A(e)]}var B4=wDe;var Sg=(n,t,o=3)=>{let a=0,e=C4(50,250);return B4(i=>{if(!i||typeof i.loaded!="number")return;let A=i.loaded,r=i.lengthComputable?i.total:void 0,s=Math.max(0,r!=null?Math.min(A,r):A),g=Math.max(0,s-a),c=e(g);a=Math.max(a,s);let I={loaded:s,total:r,progress:r?s/r:void 0,bytes:g,rate:c||void 0,estimated:c&&r?(r-s)/c:void 0,event:i,lengthComputable:r!=null,[t?"download":"upload"]:!0};n(I)},o)},bd=(n,t)=>{let o=n!=null;return[a=>t[0]({lengthComputable:o,total:n,loaded:a}),t[1]]},Md=(n,t=Z.asap)=>(...o)=>t(()=>n(...o));var f4=n=>n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102,y4=(n,t,o)=>t+2n<=57?n-48:(n&223)-55,DDe=n=>n>=65&&n<=90||n>=97&&n<=122||n>=48&&n<=57||n===43||n===47||n===45||n===95,ODe=n=>n===9||n===10||n===12||n===13||n===32,bDe=n=>{let t=Math.floor(n/4),o=n%4;return t*3+(o===2?1:o===3?2:0)},m4=n=>{let t=n.length,o=0;return t>0&&n.charCodeAt(t-1)===61&&(o++,t>1&&n.charCodeAt(t-2)===61&&o++),Math.floor((t-o)*3/4)},MDe=n=>{let t=n.length,o=0,a=0,e=!1;for(let i=0;i0){e=!0;continue}o++}}return e||a>2||a>0&&(o+a)%4!==0||o%4===1?m4(n):bDe(o)},S4=(n,t)=>{if(!n||typeof n!="string"||!n.startsWith("data:"))return 0;let o=n.indexOf(",");if(o<0)return 0;let a=n.slice(5,o),e=n.slice(o+1);if(/;base64/i.test(a))return t(e);let A=0;for(let r=0,s=e.length;r=55296&&g<=56319&&r+1=56320&&c<=57343?(A+=4,r++):A+=3}else A+=3}return A};function cN(n){let t=typeof n=="string"?n.indexOf("#"):-1;return S4(t===-1?n:n.slice(0,t),MDe)}function w4(n){return S4(n,m4)}var O4={flush:xo.constants.Z_SYNC_FLUSH,finishFlush:xo.constants.Z_SYNC_FLUSH},RDe={flush:xo.constants.BROTLI_OPERATION_FLUSH,finishFlush:xo.constants.BROTLI_OPERATION_FLUSH},kDe={flush:xo.constants.ZSTD_e_flush,finishFlush:xo.constants.ZSTD_e_flush},L4=Z.isFunction(xo.createBrotliDecompress),U4=Z.isFunction(xo.createZstdDecompress),H4="gzip, compress, deflate"+(L4?", br":""),vDe=H4+(U4?", zstd":""),b4=typeof process<"u"&&process.nextTick?process.nextTick.bind(process):Z.asap,{http:PDe,https:GDe}=F4.default,lN=/https:?/,M4=Symbol("axios.http.socketListener"),em=Symbol("axios.http.currentReq"),K4=Symbol("axios.http.installedTunnel"),FDe=new Map,_4=new WeakMap,T4={22:21,24:5};function LDe(n=process.versions&&process.versions.node){if(!n)return!1;let[t,o]=n.split(".").map(a=>Number(a));return!Number.isInteger(t)||!Number.isInteger(o)?!1:t>24?!0:T4[t]!=null&&o>=T4[t]}function UDe(n,t=process.versions&&process.versions.node){if(!LDe(t))return!1;let o=n&&n.options;return!!(o&&Z.hasOwnProp(o,"proxyEnv")&&o.proxyEnv!=null)}function HDe(n,t,o){return lN.test(n.protocol)?o||G4.globalAgent:t||P4.globalAgent}function KDe(n,t){let o=n.protocol+"//"+n.hostname+":"+(n.port||"")+"#"+(n.auth||""),a=t?_4.get(t)||_4.set(t,new Map).get(t):FDe,e=a.get(o);if(e)return e;let i=t&&t.options?{...t.options,...n}:n;if(e=new IN.default(i),t&&t.options){let A={...t.options},r=e.callback;e.callback=function(g,c){return r.call(this,g,{...A,...c})}}return e[K4]=!0,a.set(o,e),e}var N4=yt.protocols.map(n=>n+":"),R4=n=>{if(!Z.isString(n))return n;try{return decodeURIComponent(n)}catch{return n}},k4=(n,[t,o])=>(n.on("end",o).on("error",o),t),xDe=new p4;function YDe(n,t,o){n.beforeRedirects.proxy&&n.beforeRedirects.proxy(n),n.beforeRedirects.auth&&n.beforeRedirects.auth(n),n.beforeRedirects.sensitiveHeaders&&n.beforeRedirects.sensitiveHeaders(n,o),n.beforeRedirects.config&&n.beforeRedirects.config(n,t,o)}function jDe(n,t){n&&Object.keys(n).forEach(o=>{t.has(o.toLowerCase())&&delete n[o]})}function JDe(n,t){if(!t)return!1;try{return new URL(t.url).origin===new URL(n.href).origin}catch{return!1}}function x4(n,t,o,a,e,i){let A=t,r=HDe(n,i,e);if(!A&&A!==!1&&!UDe(r)){let s=Hq(o);s&&(gN(o)||(A=new URL(s)))}if(a&&n.headers)for(let s of Object.keys(n.headers))s.toLowerCase()==="proxy-authorization"&&delete n.headers[s];if(a&&n.agent&&n.agent[K4]&&(n.agent=void 0),A){let s=A instanceof URL,g=f=>s||Z.hasOwnProp(A,f)?A[f]:void 0,c=g("username"),I=g("password"),p=Z.hasOwnProp(A,"auth")?A.auth:void 0;if(c&&(p=(c||"")+":"+(I||"")),p){let f=typeof p=="object",Q=f&&Z.hasOwnProp(p,"username")?p.username:void 0,y=f&&Z.hasOwnProp(p,"password")?p.password:void 0;if(!!(Q||y))p=(Q||"")+":"+(y||"");else if(f)throw new Oe("Invalid proxy authorization",Oe.ERR_BAD_OPTION,{proxy:A})}if(lN.test(n.protocol)){if(!(e instanceof IN.default)){let f=g("hostname")||g("host"),Q=g("port"),y=g("protocol"),m=y?y.includes(":")?y:`${y}:`:"http:",T=f&&f.includes(":")&&!f.startsWith("[")?`[${f}]`:f,_=new URL(`${m}//${T}${Q?":"+Q:""}`),R={protocol:_.protocol,hostname:_.hostname.replace(/^\[|\]$/g,""),port:_.port,auth:p&&typeof p=="string"?p:void 0};_.protocol==="https:"&&(R.ALPNProtocols=["http/1.1"]);let L=KDe(R,e);n.agent=L,n.agents&&(n.agents.https=L)}}else{if(p){let m=Buffer.from(p,"utf8").toString("base64");n.headers["Proxy-Authorization"]="Basic "+m}let f=!1;for(let m of Object.keys(n.headers))if(m.toLowerCase()==="host"){f=!0;break}f||(n.headers.host=n.hostname+(n.port?":"+n.port:""));let Q=g("hostname")||g("host");n.hostname=Q,n.host=Q,n.port=g("port"),n.path=o;let y=g("protocol");y&&(n.protocol=y.includes(":")?y:`${y}:`)}}n.beforeRedirects.proxy=function(g){x4(g,t,g.href,!0,e,i)}}var qDe=typeof process<"u"&&Z.kindOf(process)==="process",zDe=n=>new Promise((t,o)=>{let a,e,i=(s,g)=>{e||(e=!0,a&&a(s,g))},A=s=>{i(s),t(s)},r=s=>{i(s,!0),o(s)};n(A,r,s=>a=s).catch(r)}),VDe=({address:n,family:t})=>{if(!Z.isString(n))throw TypeError("address must be a string");return{address:n,family:t||(n.indexOf(".")<0?6:4)}},v4=(n,t)=>VDe(Z.isObject(n)?n:{address:n,family:t}),WDe={request(n,t){let o=n.protocol+"//"+n.hostname+":"+(n.port||(n.protocol==="https:"?443:80)),{http2Options:a,headers:e}=n,i=xDe.getSession(o,a),{HTTP2_HEADER_SCHEME:A,HTTP2_HEADER_METHOD:r,HTTP2_HEADER_PATH:s,HTTP2_HEADER_STATUS:g}=_De.constants,c={[A]:n.protocol.replace(":",""),[r]:n.method,[s]:n.path};Z.forEach(e,(p,B)=>{B.charAt(0)!==":"&&(c[B]=p)});let I=i.request(c);return I.once("response",p=>{let B=I;p=Object.assign({},p);let f=p[g];delete p[g],B.headers=p,B.statusCode=+f,t(B)}),I}},Y4=qDe&&function(t){return zDe(async function(a,e,i){let A=Ce=>Z.getSafeProp(t,Ce),r=A("transitional")||bc,s=A("data"),g=A("lookup"),c=A("family"),I=A("httpVersion");I===void 0&&(I=1);let p=A("http2Options"),B=A("httpAgent"),f=A("httpsAgent"),Q=A("proxy"),y=A("responseType"),m=A("responseEncoding"),T=A("socketPath"),_=A("method").toUpperCase(),R=A("maxRedirects"),L=A("maxBodyLength"),U=A("maxContentLength"),F=A("decompress"),q,z=!1,K,G;if(I=+I,Number.isNaN(I))throw TypeError(`Invalid protocol version: '${t.httpVersion}' is not a number`);if(I!==1&&I!==2)throw TypeError(`Unsupported protocol version '${I}'`);let V=I===2;if(g){let Ce=d4(g,ke=>Z.isArray(ke)?ke:[ke]);g=(ke,Ue,MA)=>{Ce(ke,Ue,(Ke,_A,ot)=>{if(Ke)return MA(Ke);let wA=Z.isArray(_A)?_A.map(ht=>v4(ht)):[v4(_A,ot)];Ue.all?MA(Ke,wA):MA(Ke,wA[0].address,wA[0].family)})}}let H=new NDe;function N(Ce){try{H.emit("abort",!Ce||Ce.type?new Io(null,t,K):Ce)}catch{}}function k(){G&&(clearTimeout(G),G=null)}function J(){let Ce=A("timeout"),ke=Ce?"timeout of "+Ce+"ms exceeded":"timeout exceeded",Ue=A("timeoutErrorMessage");return Ue&&(ke=Ue),new Oe(ke,r.clarifyTimeoutError?Oe.ETIMEDOUT:Oe.ECONNABORTED,t,K)}H.once("abort",e);let X=()=>{k(),t.cancelToken&&t.cancelToken.unsubscribe(N),t.signal&&t.signal.removeEventListener("abort",N),H.removeAllListeners()};(t.cancelToken||t.signal)&&(t.cancelToken&&t.cancelToken.subscribe(N),t.signal&&(t.signal.aborted?N():t.signal.addEventListener("abort",N))),i((Ce,ke)=>{if(q=!0,k(),ke){z=!0,X();return}let{data:Ue}=Ce;if(Ue instanceof _n.Readable||Ue instanceof _n.Duplex){let MA=_n.finished(Ue,()=>{MA(),X()})}else X()});let ie=il(A("baseURL"),A("url"),A("allowAbsoluteUrls"),t),De=T?"http://localhost":yt.hasBrowserEnv?yt.origin:void 0,oe=new URL(ie,De),Se=oe.protocol||N4[0];if(Se==="data:"){if(U>-1){let ke=String(A("url")||ie||"");if(w4(ke)>U)return e(new Oe("maxContentLength size of "+U+" exceeded",Oe.ERR_BAD_RESPONSE,t))}let Ce;if(_!=="GET")return Bs(a,e,{status:405,statusText:"method not allowed",headers:{},config:t});try{Ce=eN(A("url"),y==="blob",{Blob:t.env&&t.env.Blob})}catch(ke){throw Oe.from(ke,Oe.ERR_BAD_REQUEST,t)}return y==="text"?(Ce=Ce.toString(m),(!m||m==="utf8")&&(Ce=Z.stripBOM(Ce))):y==="stream"&&(Ce=_n.Readable.from(Ce)),Bs(a,e,{data:Ce,status:200,statusText:"OK",headers:new Yt,config:t})}if(N4.indexOf(Se)===-1)return e(new Oe("Unsupported protocol "+Se,Oe.ERR_BAD_REQUEST,t));let Be=Yt.from(t.headers).normalize();Be.set("User-Agent","axios/"+mg,!1);let{onUploadProgress:Re,onDownloadProgress:Ne}=t,Je=t.maxRate,ve,tA;if(Z.isSpecCompliantForm(s)){let Ce=Be.getContentType(/boundary=([-_\w\d]{10,70})/i);s=I4(s,ke=>{Be.set(ke)},{tag:`axios-${mg}-boundary`,boundary:Ce&&Ce[1]||void 0})}else if(Z.isFormData(s)&&Z.isFunction(s.getHeaders)&&s.getHeaders!==Object.prototype.getHeaders){if(Ju(Be,s.getHeaders(),A("formDataHeaderPolicy")),!Be.hasContentLength())try{let Ce=await TDe.promisify(s.getLength).call(s);Number.isFinite(Ce)&&Ce>=0&&Be.setContentLength(Ce)}catch{}}else if(Z.isBlob(s)||Z.isFile(s))s.size&&Be.setContentType(s.type||"application/octet-stream"),Be.setContentLength(s.size||0),s=_n.Readable.from($y(s));else if(s&&!Z.isStream(s)){if(!Buffer.isBuffer(s))if(Z.isArrayBuffer(s))s=Buffer.from(new Uint8Array(s));else if(Z.isString(s))s=Buffer.from(s,"utf-8");else return e(new Oe("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",Oe.ERR_BAD_REQUEST,t));if(Be.setContentLength(s.length,!1),L>-1&&s.length>L)return e(new Oe("Request body larger than maxBodyLength limit",Oe.ERR_BAD_REQUEST,t))}let fe=Z.toFiniteNumber(Be.getContentLength());Z.isArray(Je)?(ve=Je[0],tA=Je[1]):ve=tA=Je,s&&(Re||ve)&&(Z.isStream(s)||(s=_n.Readable.from(s,{objectMode:!1})),s=_n.pipeline([s,new rN({maxRate:Z.toFiniteNumber(ve)})],Z.noop),Re&&s.on("progress",k4(s,bd(fe,Sg(Md(Re,b4),!1,3)))));let Ie,Xe=A("auth");if(Xe){let Ce=Z.getSafeProp(Xe,"username")||"",ke=Z.getSafeProp(Xe,"password")||"";Ie=Ce+":"+ke}if(!Ie&&(oe.username||oe.password)){let Ce=R4(oe.username),ke=R4(oe.password);Ie=Ce+":"+ke}Ie&&Be.delete("authorization");let je;try{je=rl(oe.pathname+oe.search,A("params"),A("paramsSerializer")).replace(/^\?/,"")}catch(Ce){return e(Oe.from(Ce,Oe.ERR_BAD_REQUEST,t,null,null,{url:A("url"),exists:!0}))}Be.set("Accept-Encoding",Z.hasOwnProp(r,"advertiseZstdAcceptEncoding")&&r.advertiseZstdAcceptEncoding===!0?vDe:H4,!1);let be=Object.assign(Object.create(null),{path:je,method:_,headers:Ed(Be),agents:{http:B,https:f},auth:Ie,protocol:Se,family:c,beforeRedirect:YDe,beforeRedirects:Object.create(null),http2Options:p});if(!Z.isUndefined(g)&&(be.lookup=g),T){if(typeof T!="string")return e(new Oe("socketPath must be a string",Oe.ERR_BAD_OPTION_VALUE,t));let Ce=A("allowedSocketPaths");if(Ce!=null){let ke=Array.isArray(Ce)?Ce:[Ce],Ue=D4(T);if(!ke.some(Ke=>typeof Ke=="string"&&D4(Ke)===Ue))return e(new Oe(`socketPath "${T}" is not permitted by allowedSocketPaths`,Oe.ERR_BAD_OPTION_VALUE,t))}be.socketPath=T}else be.hostname=oe.hostname.startsWith("[")?oe.hostname.slice(1,-1):oe.hostname,be.port=oe.port,x4(be,Q,Se+"//"+oe.hostname+(oe.port?":"+oe.port:"")+be.path,!1,f,B);let uA,EA=!1,aA=!1,Ze=lN.test(be.protocol);if(be.agent==null&&(be.agent=Ze?f:B),V)uA=WDe;else{let Ce=A("transport");if(Ce)uA=Ce;else if(R===0)uA=Ze?G4:P4,EA=!0;else{aA=!0,be.sensitiveHeaders=[],R&&(be.maxRedirects=R);let ke=A("beforeRedirect");if(ke&&(be.beforeRedirects.config=ke),Ie){let MA=oe.origin,Ke=Ie;be.beforeRedirects.auth=function(ot){try{new URL(ot.href).origin===MA&&(ot.auth=Ke)}catch{}}}let Ue=A("sensitiveHeaders");if(Ue!=null){if(!Z.isArray(Ue))return e(new Oe("sensitiveHeaders must be an array of strings",Oe.ERR_BAD_OPTION_VALUE,t));let MA=new Set;for(let Ke of Ue){if(!Z.isString(Ke))return e(new Oe("sensitiveHeaders must be an array of strings",Oe.ERR_BAD_OPTION_VALUE,t));MA.add(Ke.toLowerCase())}MA.size&&(be.sensitiveHeaders=Array.from(MA),be.beforeRedirects.sensitiveHeaders=function(_A,ot){JDe(_A,ot)||jDe(_A.headers,MA)})}uA=Ze?GDe:PDe}}L>-1?be.maxBodyLength=L:be.maxBodyLength=1/0,be.insecureHTTPParser=!!A("insecureHTTPParser"),K=uA.request(be,function(ke){if(k(),K.destroyed)return;let Ue=[ke],MA=Z.toFiniteNumber(ke.headers["content-length"]);if(Ne||tA){let wA=new rN({maxRate:Z.toFiniteNumber(tA)});Ne&&wA.on("progress",k4(wA,bd(MA,Sg(Md(Ne,b4),!0,3)))),Ue.push(wA)}let Ke=ke,_A=ke.req||K;if(F!==!1&&ke.headers["content-encoding"])switch((_==="HEAD"||ke.statusCode===204)&&delete ke.headers["content-encoding"],(ke.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Ue.push(xo.createUnzip(O4)),delete ke.headers["content-encoding"];break;case"deflate":Ue.push(new l4),Ue.push(xo.createUnzip(O4)),delete ke.headers["content-encoding"];break;case"br":L4&&(Ue.push(xo.createBrotliDecompress(RDe)),delete ke.headers["content-encoding"]);break;case"zstd":U4&&(Ue.push(xo.createZstdDecompress(kDe)),delete ke.headers["content-encoding"]);break}Ke=Ue.length>1?_n.pipeline(Ue,Z.noop):Ue[0];let ot={status:ke.statusCode,statusText:ke.statusMessage,headers:new Yt(ke.headers),config:t,request:_A};if(y==="stream"){if(U>-1){let wA=U,ht=Ke;async function*fr(){let UA=0;for await(let pe of ht){if(UA+=pe.length,UA>wA)throw new Oe("maxContentLength size of "+wA+" exceeded",Oe.ERR_BAD_RESPONSE,t,_A);yield pe}}Ke=_n.Readable.from(fr(),{objectMode:!1})}ot.data=Ke,Bs(a,e,ot)}else{let wA=[],ht=0;Ke.on("data",function(UA){wA.push(UA),ht+=UA.length,U>-1&&ht>U&&(z=!0,Ke.destroy(),N(new Oe("maxContentLength size of "+U+" exceeded",Oe.ERR_BAD_RESPONSE,t,_A)))}),Ke.on("aborted",function(){if(z)return;let UA=new Oe("stream has been aborted",Oe.ERR_BAD_RESPONSE,t,_A,ot);Ke.destroy(UA),e(UA)}),Ke.on("error",function(UA){z||e(Oe.from(UA,null,t,_A,ot))}),Ke.on("end",function(){try{let UA=wA.length===1?wA[0]:Buffer.concat(wA);y!=="arraybuffer"&&(UA=UA.toString(m),(!m||m==="utf8")&&(UA=Z.stripBOM(UA))),ot.data=UA}catch(UA){return e(Oe.from(UA,null,t,ot.request,ot))}Bs(a,e,ot)})}H.once("abort",wA=>{Ke.destroyed||(Ke.emit("error",wA),Ke.destroy())})}),H.once("abort",Ce=>{K.close?K.close():K.destroy(Ce)}),K.on("error",function(ke){e(Oe.from(ke,null,t,K))});let bA=new Set;if(K.on("socket",function(ke){typeof ke.setKeepAlive=="function"&&ke.setKeepAlive(!0,1e3*60),ke[M4]||(ke.on("error",function(MA){let Ke=ke[em];Ke&&!Ke.destroyed&&Ke.destroy(MA)}),ke[M4]=!0),ke[em]=K,bA.add(ke)}),K.once("close",function(){k();for(let ke of bA)ke[em]===K&&(ke[em]=null);bA.clear()}),A("timeout")){let Ce=parseInt(A("timeout"),10);if(Number.isNaN(Ce)){N(new Oe("error trying to parse `config.timeout` to int",Oe.ERR_BAD_OPTION_VALUE,t,K));return}let ke=function(){q||N(J())};EA&&Ce>0&&(G=setTimeout(ke,Ce)),K.setTimeout(Ce,ke)}else K.setTimeout(0);if(Z.isStream(s)){let Ce=!1,ke=!1;s.on("end",()=>{Ce=!0}),s.once("error",MA=>{ke=!0,K.destroy(MA)}),s.on("close",()=>{!Ce&&!ke&&N(new Io("Request stream has been aborted",t,K))});let Ue=s;if(L>-1&&!aA){let MA=L,Ke=0;Ue=_n.pipeline([s,new _n.Transform({transform(_A,ot,wA){if(Ke+=_A.length,Ke>MA)return wA(new Oe("Request body larger than maxBodyLength limit",Oe.ERR_BAD_REQUEST,t,K));wA(null,_A)}})],Z.noop),Ue.on("error",_A=>{K.destroyed||K.destroy(_A)})}Ue.pipe(K)}else s&&K.write(s),K.end()})};var j4=yt.hasStandardBrowserEnv?((n,t)=>o=>(o=new URL(o,yt.origin),n.protocol===o.protocol&&n.host===o.host&&(t||n.port===o.port)))(new URL(yt.origin),yt.navigator&&/(msie|trident)/i.test(yt.navigator.userAgent)):()=>!0;var J4=yt.hasStandardBrowserEnv?{write(n,t,o,a,e,i,A){if(typeof document>"u")return;let r=[`${n}=${encodeURIComponent(t)}`];Z.isNumber(o)&&r.push(`expires=${new Date(o).toUTCString()}`),Z.isString(a)&&r.push(`path=${a}`),Z.isString(e)&&r.push(`domain=${e}`),i===!0&&r.push("secure"),Z.isString(A)&&r.push(`SameSite=${A}`),document.cookie=r.join("; ")},read(n){if(typeof document>"u")return null;let t=document.cookie.split(";");for(let o=0;on instanceof Yt?{...n}:n,ZDe=n=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(n).concat(Object.getOwnPropertySymbols(n).filter(t=>Object.getOwnPropertyDescriptor(n,t).enumerable)):Object.keys(n);function Tn(n,t){n=n||{},t=t||{};let o=Object.create(null);Object.defineProperty(o,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function a(c,I,p,B){return Z.isPlainObject(c)&&Z.isPlainObject(I)?Z.merge.call({caseless:B},c,I):Z.isPlainObject(I)?Z.merge({},I):Z.isArray(I)?I.slice():I}function e(c,I,p,B){if(Z.isUndefined(I)){if(!Z.isUndefined(c))return a(void 0,c,p,B)}else return a(c,I,p,B)}function i(c,I){if(!Z.isUndefined(I))return a(void 0,I)}function A(c,I){if(Z.isUndefined(I)){if(!Z.isUndefined(c))return a(void 0,c)}else return a(void 0,I)}function r(c){let I=Z.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!Z.isUndefined(I))if(Z.isPlainObject(I)){if(Z.hasOwnProp(I,c))return I[c]}else return;let p=Z.hasOwnProp(n,"transitional")?n.transitional:void 0;if(Z.isPlainObject(p)&&Z.hasOwnProp(p,c))return p[c]}function s(c,I,p){if(Z.hasOwnProp(t,p))return a(c,I);if(Z.hasOwnProp(n,p))return a(void 0,c)}let g={url:i,method:i,data:i,baseURL:A,transformRequest:A,transformResponse:A,paramsSerializer:A,timeout:A,timeoutMessage:A,withCredentials:A,withXSRFToken:A,adapter:A,responseType:A,xsrfCookieName:A,xsrfHeaderName:A,onUploadProgress:A,onDownloadProgress:A,decompress:A,maxContentLength:A,maxBodyLength:A,beforeRedirect:A,transport:A,httpAgent:A,httpsAgent:A,cancelToken:A,socketPath:A,allowedSocketPaths:A,responseEncoding:A,validateStatus:s,headers:(c,I,p)=>e(q4(c),q4(I),p,!0)};return Z.forEach(ZDe({...n,...t}),function(I){if(I==="__proto__"||I==="constructor"||I==="prototype")return;let p=Z.hasOwnProp(g,I)?g[I]:e,B=Z.hasOwnProp(n,I)?n[I]:void 0,f=Z.hasOwnProp(t,I)?t[I]:void 0,Q=p(B,f,I);Z.isUndefined(Q)&&p!==s||(o[I]=Q)}),Z.hasOwnProp(t,"validateStatus")&&Z.isUndefined(t.validateStatus)&&r("validateStatusUndefinedResolves")===!1&&(Z.hasOwnProp(n,"validateStatus")?o.validateStatus=a(void 0,n.validateStatus):delete o.validateStatus),o}var XDe=n=>encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(t,o)=>String.fromCharCode(parseInt(o,16)));function $De(n){let t=Tn({},n),o=p=>Z.hasOwnProp(t,p)?t[p]:void 0,a=o("data"),e=o("withXSRFToken"),i=o("xsrfHeaderName"),A=o("xsrfCookieName"),r=o("headers"),s=o("auth"),g=o("baseURL"),c=o("allowAbsoluteUrls"),I=o("url");if(t.headers=r=Yt.from(r),t.url=rl(il(g,I,c,t),o("params"),o("paramsSerializer")),s){let p=Z.getSafeProp(s,"username")||"",B=Z.getSafeProp(s,"password")||"";try{r.set("Authorization","Basic "+btoa(p+":"+(B?XDe(B):"")))}catch(f){throw Oe.from(f,Oe.ERR_BAD_OPTION_VALUE,n)}}if(Z.isFormData(a)&&(yt.hasStandardBrowserEnv||yt.hasStandardBrowserWebWorkerEnv||Z.isReactNative(a)?r.setContentType(void 0):Z.isFunction(a.getHeaders)&&Ju(r,a.getHeaders(),o("formDataHeaderPolicy"))),yt.hasStandardBrowserEnv&&(Z.isFunction(e)&&(e=e(t)),e===!0||e==null&&j4(t.url))){let B=i&&A&&J4.read(A);B&&r.set(i,B)}return t}var Am=$De;var eOe=typeof XMLHttpRequest<"u",z4=eOe&&function(n){return new Promise(function(o,a){let e=Am(n),i=e.data,A=Yt.from(e.headers).normalize(),{responseType:r,onUploadProgress:s,onDownloadProgress:g}=e,c,I,p,B,f;function Q(){B&&B(),f&&f(),e.cancelToken&&e.cancelToken.unsubscribe(c),e.signal&&e.signal.removeEventListener("abort",c)}let y=new XMLHttpRequest;y.open(e.method.toUpperCase(),e.url,!0),y.timeout=e.timeout;function m(){if(!y)return;let _=Yt.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),L={data:!r||r==="text"||r==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:_,config:n,request:y};Bs(function(F){o(F),Q()},function(F){a(F),Q()},L),y=null}"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.startsWith("file:"))||setTimeout(m)},y.onabort=function(){y&&(a(new Oe("Request aborted",Oe.ECONNABORTED,n,y)),Q(),y=null)},y.onerror=function(R){let L=R&&R.message?R.message:"Network Error",U=new Oe(L,Oe.ERR_NETWORK,n,y);U.event=R||null,a(U),Q(),y=null},y.ontimeout=function(){let R=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",L=e.transitional||bc;e.timeoutErrorMessage&&(R=e.timeoutErrorMessage),a(new Oe(R,L.clarifyTimeoutError?Oe.ETIMEDOUT:Oe.ECONNABORTED,n,y)),Q(),y=null},i===void 0&&A.setContentType(null),"setRequestHeader"in y&&Z.forEach(Ed(A),function(R,L){y.setRequestHeader(L,R)}),Z.isUndefined(e.withCredentials)||(y.withCredentials=!!e.withCredentials),r&&r!=="json"&&(y.responseType=e.responseType),g&&([p,f]=Sg(g,!0),y.addEventListener("progress",p)),s&&y.upload&&([I,B]=Sg(s),y.upload.addEventListener("progress",I),y.upload.addEventListener("loadend",B)),(e.cancelToken||e.signal)&&(c=_=>{y&&(a(!_||_.type?new Io(null,n,y):_),y.abort(),Q(),y=null)},e.cancelToken&&e.cancelToken.subscribe(c),e.signal&&(e.signal.aborted?c():e.signal.addEventListener("abort",c)));let T=ju(e.url);if(T&&!yt.protocols.includes(T)){a(new Oe("Unsupported protocol "+T+":",Oe.ERR_BAD_REQUEST,n)),Q();return}y.send(i||null)})};var AOe=(n,t)=>{if(n=n?n.filter(Boolean):[],!t&&!n.length)return;let o=new AbortController,a=!1,e=function(s){if(!a){a=!0,A();let g=s instanceof Error?s:this.reason;o.abort(g instanceof Oe?g:new Io(g instanceof Error?g.message:g))}},i=t&&setTimeout(()=>{i=null,e(new Oe(`timeout of ${t}ms exceeded`,Oe.ETIMEDOUT))},t),A=()=>{n&&(i&&clearTimeout(i),i=null,n.forEach(s=>{s.unsubscribe?s.unsubscribe(e):s.removeEventListener("abort",e)}),n=null)};n.forEach(s=>{if(!a){if(s.aborted){e.call(s);return}s.addEventListener("abort",e,{once:!0})}});let{signal:r}=o;return r.unsubscribe=()=>Z.asap(A),r},V4=AOe;var tOe=function*(n,t){let o=n.byteLength;if(!t||o{let e=rOe(n,t),i=0,A,r=s=>{A||(A=!0,a&&a(s))};return new ReadableStream({async pull(s){try{let{done:g,value:c}=await e.next();if(g){r(),s.close();return}let I=c.byteLength;if(o){let p=i+=I;o(p)}s.enqueue(new Uint8Array(c))}catch(g){throw r(g),g}},cancel(s){return r(s),e.return()}},{highWaterMark:2})};var W4=64*1024,{isFunction:tm}=Z,aOe=n=>encodeURIComponent(n).replace(/%([0-9A-F]{2})/gi,(t,o)=>String.fromCharCode(parseInt(o,16))),Z4=n=>{if(!Z.isString(n))return n;try{return decodeURIComponent(n)}catch{return n}},X4=(n,...t)=>{try{return!!n(...t)}catch{return!1}},oOe=n=>{let t=n.indexOf("://"),o=n;return t!==-1&&(o=o.slice(t+3)),o.includes("@")||o.includes(":")},nOe=n=>{let t=Z.global!==void 0&&Z.global!==null?Z.global:globalThis,{ReadableStream:o,TextEncoder:a}=t;n=Z.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},n);let{fetch:e,Request:i,Response:A}=n,r=e?tm(e):typeof fetch=="function",s=tm(i),g=tm(A);if(!r)return!1;let c=r&&tm(o),I=r&&(typeof a=="function"?(m=>T=>m.encode(T))(new a):async m=>new Uint8Array(await new i(m).arrayBuffer())),p=s&&c&&X4(()=>{let m=!1,T=new i(yt.origin,{body:new o,method:"POST",get duplex(){return m=!0,"half"}}),_=T.headers.has("Content-Type");return T.body!=null&&T.body.cancel(),m&&!_}),B=g&&c&&X4(()=>Z.isReadableStream(new A("").body)),f={stream:B&&(m=>m.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!f[m]&&(f[m]=(T,_)=>{let R=T&&T[m];if(R)return R.call(T);throw new Oe(`Response type '${m}' is not supported`,Oe.ERR_NOT_SUPPORT,_)})});let Q=async m=>{if(m==null)return 0;if(Z.isBlob(m))return m.size;if(Z.isSpecCompliantForm(m))return(await new i(yt.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(Z.isArrayBufferView(m)||Z.isArrayBuffer(m))return m.byteLength;if(Z.isURLSearchParams(m)&&(m=m+""),Z.isString(m))return(await I(m)).byteLength},y=async(m,T)=>{let _=Z.toFiniteNumber(m.getContentLength());return _??Q(T)};return async m=>{let{url:T,method:_,data:R,signal:L,cancelToken:U,timeout:F,onDownloadProgress:q,onUploadProgress:z,responseType:K,headers:G,withCredentials:V="same-origin",fetchOptions:H,maxContentLength:N,maxBodyLength:k}=Am(m),J=Z.isNumber(N)&&N>-1,X=Z.isNumber(k)&&k>-1,ie=ve=>Z.hasOwnProp(m,ve)?m[ve]:void 0,De=e||fetch;K=K?(K+"").toLowerCase():"text";let oe=V4([L,U&&U.toAbortSignal()],F),Se=null,Be=oe&&oe.unsubscribe&&(()=>{oe.unsubscribe()}),Re,Ne=null,Je=()=>new Oe("Request body larger than maxBodyLength limit",Oe.ERR_BAD_REQUEST,m,Se);try{let ve,tA=ie("auth");if(tA){let Ze=Z.getSafeProp(tA,"username")||"",bA=Z.getSafeProp(tA,"password")||"";ve={username:Ze,password:bA}}if(oOe(T)){let Ze=new URL(T,yt.origin);if(!ve&&(Ze.username||Ze.password)){let bA=Z4(Ze.username),Ce=Z4(Ze.password);ve={username:bA,password:Ce}}(Ze.username||Ze.password)&&(Ze.username="",Ze.password="",T=Ze.href)}if(ve&&(G.delete("authorization"),G.set("Authorization","Basic "+btoa(aOe((ve.username||"")+":"+(ve.password||""))))),J&&typeof T=="string"&&T.startsWith("data:")&&cN(T)>N)throw new Oe("maxContentLength size of "+N+" exceeded",Oe.ERR_BAD_RESPONSE,m,Se);if(X&&_!=="get"&&_!=="head"){let Ze=await Q(R);if(typeof Ze=="number"&&isFinite(Ze)&&(Re=Ze,Ze>k))throw Je()}let fe=X&&(Z.isReadableStream(R)||Z.isStream(R)),Ie=(Ze,bA,Ce)=>pN(Ze,W4,ke=>{if(X&&ke>k)throw Ne=Je();bA&&bA(ke)},Ce);if(p&&_!=="get"&&_!=="head"&&(z||fe)){if(Re=Re??await y(G,R),Re!==0||fe){let Ze=new i(T,{method:"POST",body:R,duplex:"half"}),bA;if(Z.isFormData(R)&&(bA=Ze.headers.get("content-type"))&&G.setContentType(bA),Ze.body){let[Ce,ke]=z&&bd(Re,Sg(Md(z)))||[];R=Ie(Ze.body,Ce,ke)}}}else if(fe&&!s&&c&&_!=="get"&&_!=="head")R=Ie(R);else if(fe&&s&&!p&&_!=="get"&&_!=="head")throw new Oe("Stream request bodies are not supported by the current fetch implementation",Oe.ERR_NOT_SUPPORT,m,Se);Z.isString(V)||(V=V?"include":"omit");let Xe=s&&"credentials"in i.prototype;if(Z.isFormData(R)){let Ze=G.getContentType();Ze&&/^multipart\/form-data/i.test(Ze)&&!/boundary=/i.test(Ze)&&G.delete("content-type")}G.set("User-Agent","axios/"+mg,!1);let je={...H,signal:oe,method:_.toUpperCase(),headers:Ed(G.normalize()),body:R,duplex:"half",credentials:Xe?V:void 0};Se=s&&new i(T,je);let be=await(s?De(Se,H):De(T,je)),uA=Yt.from(be.headers);if(J){let Ze=Z.toFiniteNumber(uA.getContentLength());if(Ze!=null&&Ze>N)throw new Oe("maxContentLength size of "+N+" exceeded",Oe.ERR_BAD_RESPONSE,m,Se)}let EA=B&&(K==="stream"||K==="response");if(B&&be.body&&(q||J||EA&&Be)){let Ze={};["status","statusText","headers"].forEach(Ke=>{Ze[Ke]=be[Ke]});let bA=Z.toFiniteNumber(uA.getContentLength()),[Ce,ke]=q&&bd(bA,Sg(Md(q),!0))||[],Ue=0,MA=Ke=>{if(J&&(Ue=Ke,Ue>N))throw new Oe("maxContentLength size of "+N+" exceeded",Oe.ERR_BAD_RESPONSE,m,Se);Ce&&Ce(Ke)};be=new A(pN(be.body,W4,MA,()=>{ke&&ke(),Be&&Be()}),Ze)}K=K||"text";let aA=await f[Z.findKey(f,K)||"text"](be,m);if(J&&!B&&!EA){let Ze;if(aA!=null&&(typeof aA.byteLength=="number"?Ze=aA.byteLength:typeof aA.size=="number"?Ze=aA.size:typeof aA=="string"&&(Ze=typeof a=="function"?new a().encode(aA).byteLength:aA.length)),typeof Ze=="number"&&Ze>N)throw new Oe("maxContentLength size of "+N+" exceeded",Oe.ERR_BAD_RESPONSE,m,Se)}return!EA&&Be&&Be(),await new Promise((Ze,bA)=>{Bs(Ze,bA,{data:aA,headers:Yt.from(be.headers),status:be.status,statusText:be.statusText,config:m,request:Se})})}catch(ve){if(Be&&Be(),oe&&oe.aborted&&oe.reason instanceof Oe){let tA=oe.reason;throw tA.config=m,Se&&(tA.request=Se),ve!==tA&&Object.defineProperty(tA,"cause",{__proto__:null,value:ve,writable:!0,enumerable:!1,configurable:!0}),tA}if(Ne)throw Se&&!Ne.request&&(Ne.request=Se),Ne;if(ve instanceof Oe)throw Se&&!ve.request&&(ve.request=Se),ve;if(ve&&ve.name==="TypeError"&&/Load failed|fetch/i.test(ve.message)){let tA=new Oe("Network Error",Oe.ERR_NETWORK,m,Se,ve&&ve.response);throw Object.defineProperty(tA,"cause",{__proto__:null,value:ve.cause||ve,writable:!0,enumerable:!1,configurable:!0}),tA}throw Oe.from(ve,ve&&ve.code,m,Se,ve&&ve.response)}}},sOe=new Map,dN=n=>{let t=n&&n.env||{},{fetch:o,Request:a,Response:e}=t,i=[a,e,o],A=i.length,r=A,s,g,c=sOe;for(;r--;)s=i[r],g=c.get(s),g===void 0&&c.set(s,g=r?new Map:nOe(t)),c=g;return g},BIA=dN();var hN={http:Y4,xhr:z4,fetch:{get:dN}};Z.forEach(hN,(n,t)=>{if(n){try{Object.defineProperty(n,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(n,"adapterName",{__proto__:null,value:t})}});var $4=n=>`- ${n}`,cOe=n=>Z.isFunction(n)||n===null||n===!1;function IOe(n,t){n=Z.isArray(n)?n:[n];let{length:o}=n,a,e,i={};for(let A=0;A`adapter ${s} `+(g===!1?"is not supported by the environment":"is not available in the build")),r=o?A.length>1?`since : `+A.map($4).join(` `):" "+$4(A[0]):"as no adapter specified";throw new Oe("There is no suitable adapter to dispatch the request "+r,Oe.ERR_NOT_SUPPORT)}return e}var rm={getAdapter:IOe,adapters:hN};function EN(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Io(null,n)}function zu(n){return EN(n),n.headers=Yt.from(n.headers),n.data=vu.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),rm.getAdapter(n.adapter||md.adapter,n)(n).then(function(a){EN(n),n.response=a;try{a.data=vu.call(n,n.transformResponse,a)}finally{delete n.response}return a.headers=Yt.from(a.headers),a},function(a){if(!Pu(a)&&(EN(n),a&&a.response)){n.response=a.response;try{a.response.data=vu.call(n,n.transformResponse,a.response)}finally{delete n.response}a.response.headers=Yt.from(a.response.headers)}return Promise.reject(a)})}var im={};["object","boolean","number","function","string","symbol"].forEach((n,t)=>{im[n]=function(a){return typeof a===n||"a"+(t<1?"n ":" ")+n}});var e8={};im.transitional=function(t,o,a){function e(i,A){return"[Axios v"+mg+"] Transitional option '"+i+"'"+A+(a?". "+a:"")}return(i,A,r)=>{if(t===!1)throw new Oe(e(A," has been removed"+(o?" in "+o:"")),Oe.ERR_DEPRECATED);return o&&!e8[A]&&(e8[A]=!0,console.warn(e(A," has been deprecated since v"+o+" and will be removed in the near future"))),t?t(i,A,r):!0}};im.spelling=function(t){return(o,a)=>(console.warn(`${a} is likely a misspelling of ${t}`),!0)};function lOe(n,t,o){if(typeof n!="object"||n===null)throw new Oe("options must be an object",Oe.ERR_BAD_OPTION_VALUE);let a=Object.keys(n),e=a.length;for(;e-- >0;){let i=a[e],A=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(A){let r=n[i],s=r===void 0||A(r,i,n);if(s!==!0)throw new Oe("option "+i+" must be "+s,Oe.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new Oe("Unknown option "+i,Oe.ERR_BAD_OPTION)}}var Vu={assertOptions:lOe,validators:im};var oa=Vu.validators,_d=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Q0,response:new Q0}}async request(t,o){try{return await this._request(t,o)}catch(a){if(a instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;let i=(()=>{if(!e.stack)return"";let A=e.stack.indexOf(` `);return A===-1?"":e.stack.slice(A+1)})();try{if(!a.stack)a.stack=i;else if(i){let A=i.indexOf(` `),r=A===-1?-1:i.indexOf(` `,A+1),s=r===-1?"":i.slice(r+1);String(a.stack).endsWith(s)||(a.stack+=` -`+i)}}catch{}}throw a}}_request(t,o){typeof t=="string"?(o=o||{},o.url=t):o=t||{},o=Tn(this.defaults,o);let{transitional:a,paramsSerializer:e,headers:i}=o;a!==void 0&&Vu.assertOptions(a,{silentJSONParsing:oa.transitional(oa.boolean),forcedJSONParsing:oa.transitional(oa.boolean),clarifyTimeoutError:oa.transitional(oa.boolean),legacyInterceptorReqResOrdering:oa.transitional(oa.boolean),advertiseZstdAcceptEncoding:oa.transitional(oa.boolean),validateStatusUndefinedResolves:oa.transitional(oa.boolean)},!1),e!=null&&(Z.isFunction(e)?o.paramsSerializer={serialize:e}:Vu.assertOptions(e,{encode:oa.function,serialize:oa.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),Vu.assertOptions(o,{baseUrl:oa.spelling("baseURL"),withXsrfToken:oa.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let A=i&&Z.merge(i.common,i[o.method]);i&&Z.forEach(["delete","get","head","post","put","patch","query","common"],f=>{delete i[f]}),o.headers=Yt.concat(A,i);let r=[],s=!0;this.interceptors.request.forEach(function(Q){if(typeof Q.runWhen=="function"&&Q.runWhen(o)===!1)return;s=s&&Q.synchronous;let y=o.transitional||bc;y&&y.legacyInterceptorReqResOrdering?r.unshift(Q.fulfilled,Q.rejected):r.push(Q.fulfilled,Q.rejected)});let g=[];this.interceptors.response.forEach(function(Q){g.push(Q.fulfilled,Q.rejected)});let c,I=0,p;if(!s){let f=[zu.bind(this),void 0];for(f.unshift(...r),f.push(...g),p=f.length,c=Promise.resolve(o);Izu.call(this,B)))}catch(m){c=Promise.reject(m)}break}}if(!c)try{c=zu.call(this,B)}catch(f){c=Promise.reject(f)}for(I=0,p=g.length;I{if(!a._listeners)return;let i=a._listeners.length;for(;i-- >0;)a._listeners[i](e);a._listeners=null}),this.promise.then=e=>{let i,A=new Promise(r=>{a.subscribe(r),i=r}).then(e);return A.cancel=function(){a.unsubscribe(i)},A},t(function(i,A,r){a.reason||(a.reason=new Io(i,A,r),o(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let o=this._listeners.indexOf(t);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){let t=new AbortController,o=a=>{t.abort(a)};return this.subscribe(o),t.signal.unsubscribe=()=>this.unsubscribe(o),t.signal}static source(){let t;return{token:new n(function(e){t=e}),cancel:t}}},A8=uN;function CN(n){return function(o){return n.apply(null,o)}}function BN(n){return Z.isObject(n)&&n.isAxiosError===!0}var fN={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(fN).forEach(([n,t])=>{fN[t]=n});var t8=fN;function r8(n){let t=new Wu(n),o=Su(Wu.prototype.request,t);return Z.extend(o,Wu.prototype,t,{allOwnKeys:!0}),Z.extend(o,t,null,{allOwnKeys:!0}),o.create=function(e){return r8(Tn(n,e))},o}var Rr=r8(md);Rr.Axios=Wu;Rr.CanceledError=Io;Rr.CancelToken=A8;Rr.isCancel=Pu;Rr.VERSION=mg;Rr.toFormData=Oc;Rr.AxiosError=Oe;Rr.Cancel=Rr.CanceledError;Rr.all=function(t){return Promise.all(t)};Rr.spread=CN;Rr.isAxiosError=BN;Rr.mergeConfig=Tn;Rr.AxiosHeaders=Yt;Rr.formToJSON=n=>qy(Z.isHTMLForm(n)?new FormData(n):n);Rr.getAdapter=rm.getAdapter;Rr.HttpStatusCode=t8;Rr.default=Rr;var am=Rr;var{Axios:plA,AxiosError:QN,CanceledError:dlA,isCancel:hlA,CancelToken:ElA,VERSION:ulA,all:ClA,Cancel:BlA,isAxiosError:flA,spread:QlA,toFormData:ylA,AxiosHeaders:mlA,HttpStatusCode:SlA,formToJSON:wlA,getAdapter:DlA,mergeConfig:OlA,create:blA}=am;var E=ze(W8()),b=ze(X8()),M=ze(vz()),N6=ze(cV());import it from"fs";import _C from"path";import nS from"crypto";import cRe from"querystring";var zNe=ze(aW(),1),VNe=ze(Jm(),1),WNe=ze(Yd(),1),ZNe=ze(bR(),1),XNe=ze(TR(),1),$Ne=ze(GR(),1),dW=ze(Wm(),1),eRe=ze(pW(),1);var Jo=dW.default;import{gzipSync as IRe}from"zlib";import lRe from"http";import pRe from"https";import{promises as dRe}from"dns";import{isIP as R6}from"net";function Y(n,t){var o={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&t.indexOf(a)<0&&(o[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,a=Object.getOwnPropertySymbols(n);e=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(n){return this instanceof S?(this.v=n,this):new S(n)}function j(n,t,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(n,t||[]),e,i=[];return e={},A("next"),A("throw"),A("return"),e[Symbol.asyncIterator]=function(){return this},e;function A(p){a[p]&&(e[p]=function(B){return new Promise(function(f,Q){i.push([p,B,f,Q])>1||r(p,B)})})}function r(p,B){try{s(a[p](B))}catch(f){I(i[0][3],f)}}function s(p){p.value instanceof S?Promise.resolve(p.value.v).then(g,c):I(i[0][2],p)}function g(p){r("next",p)}function c(p){r("throw",p)}function I(p,B){p(B),i.shift(),i.length&&r(i[0][0],i[0][1])}}function p6(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],o;return t?t.call(n):(n=typeof l6=="function"?l6(n):n[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(i){o[i]=n[i]&&function(A){return new Promise(function(r,s){A=n[i](A),e(r,s,A.done,A.value)})}}function e(i,A,r,s){Promise.resolve(s).then(function(g){i({value:g,done:r})},A)}}var rS;function hRe(){if(rS!==void 0)return rS;let n=[_C.resolve(__dirname,"..","package.json"),_C.resolve(__dirname,"..","..","package.json")];for(let t of n)try{let o=JSON.parse(it.readFileSync(t,"utf-8"));if(o.name==="@larksuiteoapi/node-sdk"&&typeof o.version=="string")return rS=o.version,o.version}catch{}return rS="unknown","unknown"}function d6(n){return n.replace(/[^a-zA-Z0-9._-]/g,"_").slice(0,64)}function _P(n,t){let o=`oapi-node-sdk/${hRe()}`;if(n){let a=d6(n);a&&(o+=` source/${a}`)}if(t?.extraTags)for(let a of t.extraTags){let e=d6(a);e&&(o+=` ${e}`)}return o}var eh=am.create(),ERe=_P();eh.interceptors.request.use(n=>(n.headers&&!n.headers["User-Agent"]&&(n.headers["User-Agent"]=ERe),n),void 0,{synchronous:!0});eh.interceptors.response.use(n=>n.config.$return_headers?{data:n.data,headers:n.headers}:n.data);var Os;(function(n){n[n.SelfBuild=0]="SelfBuild",n[n.ISV=1]="ISV"})(Os||(Os={}));var bs;(function(n){n[n.Feishu=0]="Feishu",n[n.Lark=1]="Lark"})(bs||(bs={}));var Eo;(function(n){n[n.fatal=0]="fatal",n[n.error=1]="error",n[n.warn=2]="warn",n[n.info=3]="info",n[n.debug=4]="debug",n[n.trace=5]="trace"})(Eo||(Eo={}));var sS=Symbol("event-type"),gS=Symbol("tenant-key"),kC=Symbol("app-ticket"),MC=Symbol("tenant-access-token"),k6=Symbol("with-helpdesk-authorization"),v6=Symbol("with-user-access-token"),uRe=Symbol("user-access-token"),h6=Symbol("aily-session-record"),CRe=n=>Buffer.from(n).toString("base64"),cS=class{constructor(){this.values=new Map}getCacheKey(t,o){return o?`${o}/${t.toString()}`:t}get(t,o){return h(this,void 0,void 0,function*(){let a=this.getCacheKey(t,o?.namespace),e=this.values.get(a);if(e){let{value:i,expiredTime:A}=e;if(!A||A-new Date().getTime()>0)return i}})}set(t,o,a,e){return h(this,void 0,void 0,function*(){let i=this.getCacheKey(t,e?.namespace);return this.values.set(i,{value:o,expiredTime:a}),!0})}},PC=new cS,vC=class{constructor(t){let o=nS.createHash("sha256");o.update(t),this.key=o.digest()}decrypt(t){let o=Buffer.from(t,"base64"),a=nS.createDecipheriv("aes-256-cbc",this.key,o.slice(0,16)),e=a.update(o.slice(16).toString("hex"),"hex","utf8");return e+=a.final("utf8"),e}},P6=n=>{switch(n){case bs.Feishu:return"https://open.feishu.cn";case bs.Lark:return"https://open.larksuite.com";default:return n}},u=(n,t={})=>n.replace(/:([^/]+)/g,(o,a)=>{if(t[a]!==void 0)return t[a];throw new Error(`request miss ${a} path argument`)}),IS=(n,t)=>h(void 0,void 0,void 0,function*(){(typeof n=="function"?n():n)&&(yield t())}),BRe=n=>n?n.replace(/^\//,""):"",iS=(n,t=[])=>{let o={};return n&&t.forEach(a=>{Object.prototype.hasOwnProperty.call(n,a)&&(o[a]=n[a])}),o},C=n=>{var t;if(n instanceof QN){let{message:o,response:a,request:e,config:i}=iS(n,["message","response","request","config"]),r=[{message:o,config:iS(i,["data","url","params","method"]),request:iS(e,["protocol","host","path","method"]),response:iS(a,["data","status","statusText"])}],s=(t=n?.response)===null||t===void 0?void 0:t.data;return s&&(typeof s=="object"?r.push(Object.assign(Object.assign({},s),s.error?s.error:{})):r.push(s)),r}return[n]},Ak=class{constructor(){this.acs={accessRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},device:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/devices`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},accessRecordAccessPhoto:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/access_records/:access_record_id/access_photo`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},user:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userFace:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"PUT",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},ruleExternal:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deviceBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external/device_bind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},visitor:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/visitors/:visitor_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/visitors`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{accessRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},device:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/devices`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},accessRecordAccessPhoto:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/access_records/:access_record_id/access_photo`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},user:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userFace:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"PUT",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},ruleExternal:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deviceBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external/device_bind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},visitor:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/visitors/:visitor_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/visitors`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},tk=class extends Ak{constructor(){super(...arguments),this.admin={badgeGrant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},badge:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},password:{reset:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/password/reset`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},badgeImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badge_images`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},auditInfo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},adminUserStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/admin_user_stats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},adminDeptStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/admin_dept_stats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{badgeGrant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},badge:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},password:{reset:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/password/reset`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},badgeImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badge_images`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},auditInfo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},adminUserStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/admin_user_stats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},adminDeptStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/admin_dept_stats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},rk=class extends tk{constructor(){super(...arguments),this.aily_rag={}}},ik=class extends rk{constructor(){super(...arguments),this.aily={v1:{ailySession:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appDataAssetTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_asset_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_asset_tags`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appSkill:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),start:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills/:skill_id/start`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills/:skill_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appKnowledge:{ask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/knowledges/ask`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appDataAsset:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadFile:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/upload_file`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},ailySessionRun:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs/:run_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs/:run_id/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ailySessionAilyMessage:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages/:aily_message_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentAgentVisibility:{check:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/agent_visibility/check`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentAgentAttachment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/attachments`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},tenantAppStat:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/app_stats`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/app_stats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentAgentChat:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/chats/:agent_chat_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/chats`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentAgentChatSession:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions/:agent_chat_session_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions/:agent_chat_session_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentAgentArtifact:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/artifacts/:agent_artifact_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},ak=class extends ik{constructor(){super(...arguments),this.apaas={v1:{approvalTask:{addAssignee:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/add_assignee`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),agree:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/agree`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transfer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/transfer`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reject:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/reject`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationObjectRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationObject:{oqlQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/oql_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationFunction:{invoke:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/functions/:function_api_name/invoke`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationRoleMember:{batchRemoveAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member/batch_remove_authorization`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreateAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member/batch_create_authorization`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationRecordPermissionMember:{batchCreateAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/record_permissions/:record_permission_api_name/member/batch_create_authorization`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchRemoveAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/record_permissions/:record_permission_api_name/member/batch_remove_authorization`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationEnvironmentVariable:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/environment_variables/:environment_variable_api_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/environment_variables/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userTask:{expediting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/expediting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),chatGroup:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/chat_group`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),rollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/rollback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),rollbackPoints:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/rollback_points`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/user_task/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationFlow:{execute:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/flows/:flow_id/execute`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approvalInstance:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/approval_instances/:approval_instance_id/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationAuditLog:{auditLogList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/audit_log_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),dataChangeLogsList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/data_change_logs_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),dataChangeLogDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/data_change_log_detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},seatAssignment:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/seat_assignments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/seat_assignments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},seatActivity:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/seat_activities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/seat_activities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},app:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/apps`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/apps`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workspaceTable:{recordsBatchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records_batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recordsDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recordsPatch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recordsGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recordsPost:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),tableGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workspace:{sqlCommands:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/sql_commands`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workspaceView:{viewsGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/views/:view_name/records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workspaceEnum:{enumGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/enums/:enum_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/enums`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tenantAppMetrics:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/tenant_app_metrics/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},ok=class extends ak{constructor(){super(...arguments),this.application={applicationAppUsage:{overview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/overview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),messagePushOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/message_push_overview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),departmentOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/department_overview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationFeedback:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appRecommendRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},application:{contactsRangeConfiguration:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range_configuration`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),underauditlistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),underauditlist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationAppVersion:{contactsRangeSuggest:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationVisibility:{checkWhiteBlackList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationContactsRange:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationCollaborators:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationOwner:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/owner`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationManagement:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/management`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},scope:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/scopes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/scopes/apply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appBadge:{set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/app_badge/set`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v5:{application:{favouriteWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v5/applications/favourite`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),favourite:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v5/applications/favourite`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recommendWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v5/applications/recommend`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),recommend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v5/applications/recommend`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v6:{applicationAppUsage:{overview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/overview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),messagePushOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/message_push_overview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),departmentOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/department_overview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationFeedback:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appRecommendRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},application:{contactsRangeConfiguration:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range_configuration`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),underauditlistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),underauditlist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationAppVersion:{contactsRangeSuggest:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationVisibility:{checkWhiteBlackList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationContactsRange:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationCollaborators:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationOwner:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/owner`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationManagement:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/management`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},scope:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/scopes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/scopes/apply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appBadge:{set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/app_badge/set`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v7:{applicationBase:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v7/applications/:app_id/base`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationPublish:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v7/applications/:app_id/publish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appAvatarUpload:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v7/app_avatar/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},applicationConfig:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v7/applications/:app_id/config`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationAbility:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v7/applications/:app_id/ability`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},nk=class extends ok{constructor(){super(...arguments),this.approval={instance:{specifiedRollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/specified_rollback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/add_sign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/search_cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/preview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/remind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/add_cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/recall`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),detail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),initiatedWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),initiated:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},task:{transfer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/transfer`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reject:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/reject`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),resubmit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/resubmit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),approve:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/approve`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),refuse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/refuse`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),pass:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/pass`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/add_sign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),rollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/rollback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approval:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals/:approval_code`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},instanceComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/:comment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalInstance:{check:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_instances/check`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_instances`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalApproval:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_approvals/:approval_code`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_approvals`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},district:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v4:{instance:{specifiedRollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/specified_rollback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/add_sign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/search_cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/preview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/remind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/add_cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/recall`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),detail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),initiatedWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),initiated:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},task:{transfer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/transfer`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reject:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/reject`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),resubmit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/resubmit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),approve:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/approve`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),refuse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/refuse`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),pass:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/pass`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/add_sign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),rollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/rollback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approval:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals/:approval_code`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},instanceComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/:comment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalInstance:{check:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_instances/check`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_instances`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalApproval:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_approvals/:approval_code`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_approvals`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},district:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},sk=class extends nk{constructor(){super(...arguments),this.attendance_machine={}}},gk=class extends sk{constructor(){super(...arguments),this.attendance={file:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/files/:file_id/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/files/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},group:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/:group_id/list_user`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userDailyShift:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreateTemp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create_temp`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userTaskRemedy:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_task_remedys`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryUserAllowedRemedys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},shift:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userStatsField:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_fields/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userStatsView:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_views/:user_stats_view_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_views/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approvalInfo:{process:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/approval_infos/process`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userSetting:{modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_settings/modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_settings/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userStatsData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_datas/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},archiveRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),userStatsFieldsQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule/user_stats_fields_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule/del_report`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule/upload_report`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leaveEmployExpireRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/leave_employ_expire_records/:leave_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leaveAccrualRecord:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/leave_accrual_record/:leave_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userFlow:{batchDel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/batch_del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/:user_flow_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userApproval:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_approvals`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_approvals/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userTask:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_tasks/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{file:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/files/:file_id/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/files/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},group:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/:group_id/list_user`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userDailyShift:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreateTemp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create_temp`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userTaskRemedy:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_task_remedys`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryUserAllowedRemedys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},shift:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userStatsField:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_fields/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userStatsView:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_views/:user_stats_view_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_views/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approvalInfo:{process:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/approval_infos/process`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userSetting:{modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_settings/modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_settings/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userStatsData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_datas/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},archiveRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),userStatsFieldsQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule/user_stats_fields_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule/del_report`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule/upload_report`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leaveEmployExpireRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/leave_employ_expire_records/:leave_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leaveAccrualRecord:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/leave_accrual_record/:leave_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userFlow:{batchDel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/batch_del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/:user_flow_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userApproval:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_approvals`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_approvals/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userTask:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_tasks/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},ck=class extends gk{constructor(){super(...arguments),this.audio_video_ai={}}},Ik=class extends ck{constructor(){super(...arguments),this.auth={appAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/app_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/app_access_token/internal`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tenantAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/tenant_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTicket:{resend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v3:{appAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/app_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/app_access_token/internal`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tenantAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/tenant_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTicket:{resend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},lk=class extends Ik{constructor(){super(...arguments),this.authen={userInfo:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/user_info`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},accessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},refreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/refresh_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},oidcAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/oidc/access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},oidcRefreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/oidc/refresh_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{userInfo:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/user_info`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},accessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},refreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/refresh_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},oidcAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/oidc/access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},oidcRefreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/oidc/refresh_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},pk=class extends lk{constructor(){super(...arguments),this.authz={}}},dk=class extends pk{constructor(){super(...arguments),this.aweme_ecosystem={}}},hk=class extends dk{constructor(){super(...arguments),this.baike={entity:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/match`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),highlight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/highlight`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),extract:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/extract`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},classification:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},file:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/files/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/files/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},draft:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/drafts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/drafts/:draft_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{entity:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/match`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),highlight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/highlight`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),extract:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/extract`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},classification:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},file:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/files/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/files/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},draft:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/drafts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/drafts/:draft_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Ek=class extends hk{constructor(){super(...arguments),this.base={v2:{appRole:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/base/v2/apps/:app_token/roles/:role_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},uk=class extends Ek{constructor(){super(...arguments),this.bitable={appTable:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appDashboard:{copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},app:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableRecord:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appRoleMember:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableView:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableForm:{upgrade:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/upgrade`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableFieldGroup:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/field_groups`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableFormField:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appWorkflow:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows/:workflow_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appBlockWorkflow:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/block_workflows`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{appTable:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appDashboard:{copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},app:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableRecord:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appRoleMember:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableView:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableForm:{upgrade:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/upgrade`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableFieldGroup:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/field_groups`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableFormField:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appWorkflow:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows/:workflow_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appBlockWorkflow:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/block_workflows`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Ck=class extends uk{constructor(){super(...arguments),this.block={entity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/block/v2/entities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/block/v2/entities/:block_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/block/v2/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v2:{entity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/block/v2/entities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/block/v2/entities/:block_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/block/v2/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Bk=class extends Ck{constructor(){super(...arguments),this.board={v1:{whiteboardNode:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createPlantuml:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes/plantuml`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},whiteboard:{downloadAsImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/download_as_image`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),theme:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/theme`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateTheme:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/update_theme`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},fk=class extends Bk{constructor(){super(...arguments),this.bot={v4:{bot:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bot/v4/bot/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bot/v4/bot/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Qk=class extends fk{constructor(){super(...arguments),this.c360={}}},yk=class extends Qk{constructor(){super(...arguments),this.calendar={exchangeBinding:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/exchange_bindings`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendar:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),primarys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/primarys`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),primary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/primary`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarAcl:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/reply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),instances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/instances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),instanceView:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/instance_view`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventAttendee:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},setting:{generateCaldavConf:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/settings/generate_caldav_conf`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},timeoffEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/timeoff_events/:timeoff_event_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/timeoff_events`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventMeetingMinute:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_minute`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventMeetingChat:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},freebusy:{batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/freebusy/batch`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/freebusy/list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventAttendeeChatMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v4:{exchangeBinding:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/exchange_bindings`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendar:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),primarys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/primarys`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),primary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/primary`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarAcl:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/reply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),instances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/instances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),instanceView:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/instance_view`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventAttendee:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},setting:{generateCaldavConf:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/settings/generate_caldav_conf`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},timeoffEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/timeoff_events/:timeoff_event_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/timeoff_events`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventMeetingMinute:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_minute`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventMeetingChat:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},freebusy:{batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/freebusy/batch`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/freebusy/list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventAttendeeChatMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},mk=class extends yk{constructor(){super(...arguments),this.cardkit={v1:{card:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),settings:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/settings`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),idConvert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/id_convert`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},cardElement:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),content:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id/content`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Sk=class extends mk{constructor(){super(...arguments),this.ccm_unified_resource={}}},wk=class extends Sk{constructor(){super(...arguments),this.collab_plugins={}}},Dk=class extends wk{constructor(){super(...arguments),this.comment_sdk={}}},Ok=class extends Dk{constructor(){super(...arguments),this.compensation={v1:{indicator:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/indicators`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/indicators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},socialPlan:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/social_plans/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/social_plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/social_plans`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},item:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/items`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/items`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},plan:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/plans`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},socialInsurance:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/social_insurances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},itemCategory:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/item_categories`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/item_categories`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},changeReason:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/change_reasons`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/change_reasons`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},archive:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/archives`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/archives/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},recurringPayment:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/recurring_payment/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/recurring_payment/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},socialArchive:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/social_archive/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},socialArchiveAdjustRecord:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/social_archive_adjust_record/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},lumpSumPayment:{batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryDetailWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query_detail`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query_detail`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},bk=class extends Ok{constructor(){super(...arguments),this.contact={group:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),memberBelong:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/member_belong`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),simplelistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},unit:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/list_department`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unbindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/unbind_department`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),bindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/bind_department`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},groupMember:{simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/simplelist`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),add:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/add`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchAdd:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_add`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateDepartmentId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id/update_department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unbindDepartmentChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/unbind_department_chat`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),parentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),parent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),childrenWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),children:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/batch`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobLevel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFamily:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},user:{updateUserId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id/update_user_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),resurrect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id/resurrect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/batch_get_id`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),findByDepartmentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),findByDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),basicBatch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/basic_batch`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/batch`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeeTypeEnum:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},functionalRoleMember:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/:member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),scopes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/scopes`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},functionalRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobTitle:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_titles/:job_title_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workCity:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/work_cities/:work_city_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},scope:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customAttr:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v3:{group:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),memberBelong:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/member_belong`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),simplelistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},unit:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/list_department`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unbindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/unbind_department`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),bindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/bind_department`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},groupMember:{simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/simplelist`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),add:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/add`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchAdd:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_add`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateDepartmentId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id/update_department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unbindDepartmentChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/unbind_department_chat`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),parentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),parent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),childrenWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),children:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/batch`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobLevel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFamily:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},user:{updateUserId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id/update_user_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),resurrect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id/resurrect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/batch_get_id`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),findByDepartmentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),findByDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),basicBatch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/basic_batch`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/batch`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeeTypeEnum:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},functionalRoleMember:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/:member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),scopes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/scopes`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},functionalRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobTitle:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_titles/:job_title_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workCity:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/work_cities/:work_city_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},scope:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customAttr:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Mk=class extends bk{constructor(){super(...arguments),this.content_check={}}},_k=class extends Mk{constructor(){super(...arguments),this.contract={}}},Tk=class extends _k{constructor(){super(...arguments),this.corehr={contract:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},company:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeeType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},nationalIdType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},subregion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subregions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subregions/:subregion_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},countryRegion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/country_regions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/country_regions/:country_region_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},subdivision:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subdivisions/:subdivision_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subdivisions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},preHire:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},person:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobLevel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFamily:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},job:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobChange:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_changes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workingHoursType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},location:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/files/:id`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},processFormVariableData:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/processes/:process_id/form_variable_data`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},commonDataId:{convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/common_data/id/convert`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leaveGrantingRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leave_granting_records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leave:{leaveTypes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/leave_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),workCalendar:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),workCalendarDate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar_date`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),calendarByScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/calendar_by_scope`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leaveBalances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/leave_balances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leaveRequestHistory:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/leave_request_history`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offboarding:{submit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/submit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},securityGroup:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/security_groups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/security_groups/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customField:{listObjectApiName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/custom_fields/list_object_api_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/custom_fields/get_by_param`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/custom_fields/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},commonDataMetaData:{editEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/edit_enum_option`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/add_enum_option`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},authorization:{updateRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/update_role_assign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/remove_role_assign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/add_role_assign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/get_by_param`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},assignedUser:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/assigned_users/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobData:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},currency:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/currencies`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/currencies/:currency_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},transferReason:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/transfer_reasons/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},transferType:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/transfer_types/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},compensationStandard:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/compensation_standards/match`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{contract:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},company:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeeType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},nationalIdType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},subregion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subregions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subregions/:subregion_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},countryRegion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/country_regions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/country_regions/:country_region_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},subdivision:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subdivisions/:subdivision_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subdivisions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},preHire:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},person:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobLevel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFamily:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},job:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobChange:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_changes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workingHoursType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},location:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/files/:id`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},processFormVariableData:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/processes/:process_id/form_variable_data`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},commonDataId:{convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/common_data/id/convert`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leaveGrantingRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leave_granting_records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leave:{leaveTypes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/leave_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),workCalendar:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),workCalendarDate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar_date`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),calendarByScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/calendar_by_scope`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leaveBalances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/leave_balances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leaveRequestHistory:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/leave_request_history`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offboarding:{submit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/submit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},securityGroup:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/security_groups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/security_groups/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customField:{listObjectApiName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/custom_fields/list_object_api_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/custom_fields/get_by_param`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/custom_fields/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},commonDataMetaData:{editEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/edit_enum_option`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/add_enum_option`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},authorization:{updateRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/update_role_assign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/remove_role_assign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/add_role_assign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/get_by_param`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},assignedUser:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/assigned_users/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobData:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},currency:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/currencies`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/currencies/:currency_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},transferReason:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/transfer_reasons/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},transferType:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/transfer_types/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},compensationStandard:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/compensation_standards/match`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{costCenter:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/query_multi_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),tree:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/tree`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoCountryRegionSubdivision:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/country_region_subdivisions/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/country_region_subdivisions/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},probation:{submit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/submit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),withdraw:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/withdraw`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),enableDisableAssessment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/enable_disable_assessment`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),edit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/edit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},probationAssessment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/assessments/:assessment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/assessments/:assessment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/assessments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customOrg:{deleteOrg:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/delete_org`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/active`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/:org_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateRule:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/update_rule`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},preHire:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transitTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id/transit_task`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),withdrawOnboarding:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/withdraw_onboarding`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),restoreFlowInstance:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/restore_flow_instance`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transformOnboardingTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/transform_onboarding_task`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),complete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id/complete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobGrade:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_grades/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_grades/:job_grade_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_grades/:job_grade_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_grades`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_grades/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_grades/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},position:{active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions/active`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delPosition:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions/del_position`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions/:position_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeesBp:{batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/bps/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},bp:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/bps`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/bps`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/bps/get_by_department`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeesAdditionalJob:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/:additional_job_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/:additional_job_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/batch`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/batch`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoNationality:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/nationalities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/nationalities/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoCountryRegion:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/country_regions/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/country_regions/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoCity:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/cities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/cities/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoDistrict:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/districts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/districts/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoBank:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/banks/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/banks/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoCurrency:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/currencies/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/currencies/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeeCustomOrg:{del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_org/del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createEmpCustomOrg:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_org/create_emp_custom_org`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),editEmpCustomOrg:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_org/edit_emp_custom_org`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),employmentCustomOrgRecord:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_org/employment_custom_org_record`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),querybyid:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_org/querybyid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},signatureFile:{listByBizId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files/list_by_biz_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files/:signature_file_id/download`,A),method:"POST",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),terminate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files/terminate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},signatureNode:{listByFileId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_nodes/list_by_file_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},company:{active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/companies/active`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/companies/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/companies/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/companies/query_multi_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/companies/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},department:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryOperationLogsWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryOperationLogs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/:department_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/:department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/query_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/query_multi_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),parents:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/parents`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),tree:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/tree`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},draft:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/drafts/:draft_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approvalGroups:{openQueryPositionChangeListByIds:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_position_change_list_by_ids`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/approval_groups/:process_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),openQueryJobChangeListByIds:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_job_change_list_by_ids`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),openQueryDepartmentChangeListByIds:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_department_change_list_by_ids`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},location:{active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/active`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/query_multi_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/:location_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},locationAddress:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses/:address_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses/:address_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoLanguage:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/languages/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/languages/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoTimeZone:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/time_zones/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/time_zones/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reportDetailRow:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/report_detail_row/batchDelete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchSave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/report_detail_row/batchSave`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workforcePlanDetailRow:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/workforce_plan_detail_row/batchDelete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchSave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/workforce_plan_detail_row/batchSave`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offboarding:{submitV2:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/offboardings/submit_v2`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),edit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/offboardings/edit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),revoke:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/offboardings/revoke`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoBankBranch:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/bank_branchs/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/bank_branchs/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},enum:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/enums/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},process:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),flowVariableData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes/:process_id/flow_variable_data`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes/:process_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processApprover:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes/:process_id/approvers/:approver_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processWithdraw:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/process_withdraw/:process_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approver:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/approvers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/approvers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processTransfer:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes/:process_id/transfer`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processExtra:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes/:process_id/extra`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobLevel:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_levels/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_levels/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_levels/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFamily:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_families/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_families/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_families/query_multi_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_families/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},job:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/jobs/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/jobs/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/jobs/query_multi_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/jobs/:job_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/jobs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/jobs/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeesInternationalAssignment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/international_assignments/:international_assignment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/international_assignments/:international_assignment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processFormVariableData:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes/:process_id/form_variable_data`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},pathway:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pathways`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pathways/:pathway_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pathways/:pathway_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pathways/active`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pathways/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processStart:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/process_start`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},costAllocation:{batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_allocations/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_allocations/update_version`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_allocations/create_version`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_allocations/remove_version`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},costCenterVersion:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions/:version_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions/:version_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processQueryFlowDataTemplate:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/query_flow_data_template`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},defaultCostCenter:{createVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/default_cost_centers/create_version`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/default_cost_centers/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/default_cost_centers/remove_version`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/default_cost_centers/update_version`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processRevoke:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/process_revoke/:process_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},signatureTemplateInfoWithThumbnail:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_template_info_with_thumbnails`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_template_info_with_thumbnails`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobChange:{revoke:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_changes/:job_change_id/revoke`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_changes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_changes/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_changes/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},contract:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/contracts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/contracts/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workforcePlanDetail:{batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/workforce_plan_details/batch`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchV2:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/workforce_plan_details/batch_v2`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employee:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},signatureTemplate:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_templates/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeesJobData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/job_datas/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/job_datas/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},person:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/persons/:person_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/persons`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workforcePlan:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/workforce_plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/workforce_plans`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Nk=class extends Tk{constructor(){super(...arguments),this.data_cube={}}},Rk=class extends Nk{constructor(){super(...arguments),this.device={}}},kk=class extends Rk{constructor(){super(...arguments),this.directory={v1:{employee:{resurrect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/:employee_id/resurrect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),regular:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/:employee_id/regular`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),toBeResigned:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/:employee_id/to_be_resigned`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/:employee_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/:employee_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),filter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/filter`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},collaborationTenant:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_tenants`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_tenants`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},collaborationRule:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_rules`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_rules`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},collborationShareEntity:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/share_entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/share_entities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},department:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/departments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/departments/:department_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/departments/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/departments/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/departments/:department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),filter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/departments/filter`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},vk=class extends kk{constructor(){super(...arguments),this.docs_ai={}}},Pk=class extends vk{constructor(){super(...arguments),this.docs_tool={}}},Gk=class extends Pk{constructor(){super(...arguments),this.docs={v1:{content:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docs/v1/content`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Fk=class extends Gk{constructor(){super(...arguments),this.document_ai={v1:{businessCard:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/business_card/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},contract:{fieldExtraction:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/contract/field_extraction`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},businessLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/business_license/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},drivingLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/driving_license/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},vehicleLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/vehicle_license/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},foodManageLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/food_manage_license/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},foodProduceLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/food_produce_license/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},hkmMainlandTravelPermit:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},chinesePassport:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/chinese_passport/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},twMainlandTravelPermit:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},healthCertificate:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/health_certificate/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},vehicleInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/vehicle_invoice/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},resume:{parse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/resume/parse`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},bankCard:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/bank_card/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},trainInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/train_invoice/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},taxiInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/taxi_invoice/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},vatInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/vat_invoice/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},idCard:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/id_card/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})}}}}},Lk=class extends Fk{constructor(){super(...arguments),this.docx={document:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),rawContent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/raw_content`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/blocks/convert`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncementBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},documentBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncement:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncementBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},documentBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},documentBlockDescendant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/descendant`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{document:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),rawContent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/raw_content`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/blocks/convert`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncementBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},documentBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncement:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncementBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},documentBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},documentBlockDescendant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/descendant`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Uk=class extends Lk{constructor(){super(...arguments),this.drive={file:{createFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/create_folder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/move`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createShortcut:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/create_shortcut`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_part`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),taskCheck:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/task_check`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deleteSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/delete_subscribe`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/get_subscribe`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_prepare`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_finish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_all`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meta:{batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/metas/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileSubscription:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},exportTask:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/export_tasks/file/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/export_tasks/:ticket`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/export_tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileVersion:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileViewRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileStatistics:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/statistics`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionPublicPassword:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},media:{batchGetTmpDownloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_part`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_finish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_all`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_prepare`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},importTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/import_tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},user:{subscriptionStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/user/subscription_status`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeSubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/user/remove_subscription`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/user/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileCommentReply:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionPublic:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionMember:{batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transferOwner:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/transfer_owner`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),auth:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/auth`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{file:{createFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/create_folder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/move`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createShortcut:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/create_shortcut`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_part`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),taskCheck:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/task_check`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deleteSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/delete_subscribe`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/get_subscribe`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_prepare`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_finish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_all`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meta:{batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/metas/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileSubscription:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},exportTask:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/export_tasks/file/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/export_tasks/:ticket`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/export_tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileVersion:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileViewRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileStatistics:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/statistics`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionPublicPassword:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},media:{batchGetTmpDownloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_part`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_finish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_all`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_prepare`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},importTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/import_tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},user:{subscriptionStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/user/subscription_status`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeSubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/user/remove_subscription`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/user/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileCommentReply:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionPublic:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionMember:{batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transferOwner:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/transfer_owner`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),auth:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/auth`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{fileLike:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v2/files/:file_token/likes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v2/files/:file_token/likes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},commentReaction:{updateReaction:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v2/files/:file_token/comments/reaction`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionPublic:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v2/permissions/:token/public`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v2/permissions/:token/public`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Hk=class extends Uk{constructor(){super(...arguments),this.ea_symphony={}}},Kk=class extends Hk{constructor(){super(...arguments),this.edu={}}},xk=class extends Kk{constructor(){super(...arguments),this.ehr={attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/ehr/v1/attachments/:token`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},employee:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/ehr/v1/attachments/:token`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},employee:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Yk=class extends xk{constructor(){super(...arguments),this.elearning={}}},jk=class extends Yk{constructor(){super(...arguments),this.event={outboundIp:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},connection:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/event/v1/connection`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{outboundIp:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},connection:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/event/v1/connection`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Jk=class extends jk{constructor(){super(...arguments),this.exam={}}},qk=class extends Jk{constructor(){super(...arguments),this.face_detection={}}},zk=class extends qk{constructor(){super(...arguments),this.financial_access_platform={}}},Vk=class extends zk{constructor(){super(...arguments),this.grounding={}}},Wk=class extends Vk{constructor(){super(...arguments),this.gtm_ai={}}},Zk=class extends Wk{constructor(){super(...arguments),this.helpdesk={agent:{agentEmail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_emails`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSchedule:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSkill:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSkillRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skill_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},category:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},event:{subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/events/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/events/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},faq:{faqImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id/image/:image_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSchedules:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ticket:{customizedFields:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/customized_fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),ticketImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_images`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),startService:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/start_service`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),answerUserQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ticketCustomizedField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},notification:{cancelApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancelSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),executeSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/execute_send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/preview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),submitApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ticketMessage:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},botMessage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{agent:{agentEmail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_emails`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSchedule:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSkill:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSkillRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skill_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},category:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},event:{subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/events/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/events/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},faq:{faqImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id/image/:image_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSchedules:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ticket:{customizedFields:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/customized_fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),ticketImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_images`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),startService:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/start_service`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),answerUserQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ticketCustomizedField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},notification:{cancelApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancelSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),executeSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/execute_send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/preview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),submitApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ticketMessage:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},botMessage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Xk=class extends Zk{constructor(){super(...arguments),this.hire={websiteChannel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRoundType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_round_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerCustomField:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_custom_fields/:offer_custom_field_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteDelivery:{createByAttachment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_attachment`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createByResume:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_resume`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRecordAttachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records/attachments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talent:{batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/batch_get_id`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),onboardStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/onboard_status`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/add_to_folder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),tag:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/tag`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/remove_to_folder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/combined_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/combined_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalInterviewAssessment:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interview_assessments/:external_interview_assessment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interview_assessments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},referralWebsiteJobPost:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts/:job_post_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},job:{config:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/config`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),close:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/close`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateConfig:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/update_config`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),open:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/open`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recruiter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/recruiter`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/combined_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/combined_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/get_detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},location:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/locations/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalReferralReward:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_referral_rewards`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_referral_rewards/:external_referral_reward_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},note:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerApprovalTemplate:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_approval_templates`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},website:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},examMarkingTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},referral:{getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referrals/get_by_application`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referrals/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},exam:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/exams`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobRequirementSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirement_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoAccountCustomField:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentExternalInfo:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},questionnaire:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/questionnaires`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoExamPaper:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exam_papers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offer:{internOfferStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id/intern_offer_status`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),offerStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id/offer_status`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoBackgroundCheck:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_checks/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_result`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_progress`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agency:{protect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/protect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/:agency_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),protectSearch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/protection_period/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),operateAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/operate_agency_account`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/get_agency_account`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentPool:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchChangeTalentPool:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/batch_change_talent_pool`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),moveTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/talent_relationship`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},diversityInclusion:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/diversity_inclusions/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoExam:{loginInfo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/login_info`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/update_result`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},terminationReason:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobManager:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/:manager_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobPublishRecord:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_publish_records/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteJobPost:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/:job_post_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobType:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalApplication:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoBackgroundCheckCustomField:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},application:{transferStage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_stage`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recover:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/recover`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),terminate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/terminate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transferOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_onboard`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),offer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/offer`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancelOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/cancel_onboard`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/get_detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},registrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},role:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/roles/:role_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records/:interview_record_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewer:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviewers/:interviewer_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentFolder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interview:{getByTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviews/get_by_talent`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviews`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},referralAccount:{enable:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/enable`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),withdraw:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/withdraw`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deactivate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/deactivate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reconciliation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/reconciliation`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getAccountAssets:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/get_account_assets`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ehrImportTask:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteDeliveryTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/delivery_tasks/:delivery_task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentObject:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_objects/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFunction:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},advertisement:{publish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/advertisements/:advertisement_id/publish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerSchema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_schemas/:offer_schema_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id/preview`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/attachments`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},applicationInterview:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/interviews`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteSiteUser:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/site_users`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tripartiteAgreement:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoBackgroundCheckPackage:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_packages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},resumeSource:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerApplicationForm:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_application_forms`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_application_forms/:offer_application_form_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentOperationLog:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_operation_logs/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userRole:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalInterview:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalBackgroundCheck:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},todo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalOffer:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentBlocklist:{changeTalentBlock:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_blocklist/change_talent_block`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},portalApplySchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRegistrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobRequirement:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listById:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},backgroundCheckOrder:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/background_check_orders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/background_check_orders/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employee:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/employees/get_by_application`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},subject:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/subjects`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewFeedbackForm:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},evaluationTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},evaluation:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobProcess:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_processes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},minutes:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/minutes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},test:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{websiteChannel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRoundType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_round_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerCustomField:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_custom_fields/:offer_custom_field_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteDelivery:{createByAttachment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_attachment`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createByResume:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_resume`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRecordAttachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records/attachments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talent:{batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/batch_get_id`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),onboardStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/onboard_status`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/add_to_folder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),tag:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/tag`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/remove_to_folder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/combined_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/combined_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalInterviewAssessment:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interview_assessments/:external_interview_assessment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interview_assessments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},referralWebsiteJobPost:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts/:job_post_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},job:{config:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/config`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),close:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/close`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateConfig:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/update_config`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),open:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/open`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recruiter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/recruiter`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/combined_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/combined_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/get_detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},location:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/locations/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalReferralReward:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_referral_rewards`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_referral_rewards/:external_referral_reward_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},note:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerApprovalTemplate:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_approval_templates`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},website:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},examMarkingTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},referral:{getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referrals/get_by_application`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referrals/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},exam:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/exams`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobRequirementSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirement_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoAccountCustomField:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentExternalInfo:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},questionnaire:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/questionnaires`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoExamPaper:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exam_papers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offer:{internOfferStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id/intern_offer_status`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),offerStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id/offer_status`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoBackgroundCheck:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_checks/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_result`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_progress`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agency:{protect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/protect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/:agency_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),protectSearch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/protection_period/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),operateAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/operate_agency_account`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/get_agency_account`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentPool:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchChangeTalentPool:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/batch_change_talent_pool`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),moveTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/talent_relationship`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},diversityInclusion:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/diversity_inclusions/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoExam:{loginInfo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/login_info`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/update_result`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},terminationReason:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobManager:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/:manager_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobPublishRecord:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_publish_records/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteJobPost:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/:job_post_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobType:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalApplication:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoBackgroundCheckCustomField:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},application:{transferStage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_stage`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recover:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/recover`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),terminate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/terminate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transferOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_onboard`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),offer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/offer`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancelOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/cancel_onboard`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/get_detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},registrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},role:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/roles/:role_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records/:interview_record_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewer:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviewers/:interviewer_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentFolder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interview:{getByTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviews/get_by_talent`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviews`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},referralAccount:{enable:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/enable`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),withdraw:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/withdraw`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deactivate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/deactivate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reconciliation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/reconciliation`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getAccountAssets:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/get_account_assets`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ehrImportTask:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteDeliveryTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/delivery_tasks/:delivery_task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentObject:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_objects/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFunction:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},advertisement:{publish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/advertisements/:advertisement_id/publish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerSchema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_schemas/:offer_schema_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id/preview`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/attachments`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},applicationInterview:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/interviews`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteSiteUser:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/site_users`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tripartiteAgreement:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoBackgroundCheckPackage:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_packages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},resumeSource:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerApplicationForm:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_application_forms`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_application_forms/:offer_application_form_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentOperationLog:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_operation_logs/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userRole:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalInterview:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalBackgroundCheck:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},todo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalOffer:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentBlocklist:{changeTalentBlock:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_blocklist/change_talent_block`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},portalApplySchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRegistrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobRequirement:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listById:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},backgroundCheckOrder:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/background_check_orders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/background_check_orders/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employee:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/employees/get_by_application`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},subject:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/subjects`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewFeedbackForm:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},evaluationTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},evaluation:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobProcess:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_processes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},minutes:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/minutes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},test:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{talent:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v2/talents/:talent_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v2/interview_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v2/interview_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v2/interview_records/:interview_record_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},$k=class extends Xk{constructor(){super(...arguments),this.human_authentication={identity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/human_authentication/v1/identities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{identity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/human_authentication/v1/identities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},ev=class extends $k{constructor(){super(...arguments),this.im={message:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),pushFollowUp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/push_follow_up`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),urgentApp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_app`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),urgentPhone:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_phone`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),urgentSms:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_sms`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mergeForward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/merge_forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),readUsers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/read_users`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),replyByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=i,g=Y(i,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:c,params:e,headers:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(C(I)),I})}),createByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=i,g=Y(i,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:c,params:e,headers:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(C(I)),I})}),updateByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=i,g=Y(i,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:c,params:e,headers:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(C(I)),I})})},batchMessage:{readUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/read_user`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/get_progress`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatMembers:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),isInChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/is_in_chat`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),meJoin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/me_join`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},pin:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins/:message_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chat:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),link:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/link`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatModeration:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatTab:{listTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sortTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deleteTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatTopNotice:{deleteTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),putTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncement:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatMenuTree:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sort:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree/sort`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatManagers:{deleteManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/delete_managers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/add_managers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatMenuItem:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},image:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/images/:image_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/images`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},messageReaction:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions/:reaction_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/reactions/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/files/:file_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/files`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},messageResource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/resources/:file_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},thread:{forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/threads/:thread_id/forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{message:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),pushFollowUp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/push_follow_up`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),urgentApp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_app`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),urgentPhone:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_phone`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),urgentSms:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_sms`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mergeForward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/merge_forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),readUsers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/read_users`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),replyByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=i,g=Y(i,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:c,params:e,headers:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(C(I)),I})}),createByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=i,g=Y(i,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:c,params:e,headers:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(C(I)),I})}),updateByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=i,g=Y(i,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:c,params:e,headers:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(C(I)),I})})},batchMessage:{readUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/read_user`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/get_progress`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatMembers:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),isInChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/is_in_chat`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),meJoin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/me_join`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},pin:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins/:message_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chat:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),link:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/link`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatModeration:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatTab:{listTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sortTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deleteTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatTopNotice:{deleteTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),putTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncement:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatMenuTree:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sort:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree/sort`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatManagers:{deleteManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/delete_managers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/add_managers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatMenuItem:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},image:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/images/:image_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/images`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},messageReaction:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions/:reaction_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/reactions/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/files/:file_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/files`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},messageResource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/resources/:file_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},thread:{forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/threads/:thread_id/forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{bizEntityTagRelation:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},urlPreview:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/url_previews/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appFeedCardBatch:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/app_feed_card/batch`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/app_feed_card/batch`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},feedCard:{botTimeSentive:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/feed_cards/bot_time_sentive`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/feed_cards/:feed_card_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tag:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/tags`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/tags/:tag_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatButton:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/chat_button`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appFeedCard:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/app_feed_card`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chat:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/chats/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/chats/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Av=class extends ev{constructor(){super(...arguments),this.inline_platform={}}},tv=class extends Av{constructor(){super(...arguments),this.laps={}}},rv=class extends tv{constructor(){super(...arguments),this.lingo={v1:{file:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/files/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/files/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},entity:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/match`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),highlight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/highlight`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},repo:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/repos`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},classification:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/classifications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/classifications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},draft:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/drafts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/drafts/:draft_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},iv=class extends rv{constructor(){super(...arguments),this.llpp={}}},av=class extends iv{constructor(){super(...arguments),this.mail={mailgroupMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroupPermissionMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroup:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},publicMailboxMember:{clear:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroupAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},publicMailboxAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),accessibleMailboxes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/accessible_mailboxes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),profile:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/profile`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxAlias:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroupManager:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},publicMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeToRecycleBin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/remove_to_recycle_bin`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},user:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/users/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxMessage:{getByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/get_by_card`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sendStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/send_status`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/modify`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listThreadMessage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxThread:{batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxEvent:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscription`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxMailContact:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxLabel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxDraft:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancelScheduledSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/cancel_scheduled_send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id/send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxRule:{reorder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/reorder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxSetting:{sendAs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/send_as`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getSignatures:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/signatures`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxSentMessage:{getRecallDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxTemplate:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxTemplateAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id/attachments/download_url`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},multiEntity:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/multi_entity/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxFolder:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxMessageAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/attachments/download_url`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{mailgroupMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroupPermissionMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroup:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},publicMailboxMember:{clear:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroupAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},publicMailboxAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),accessibleMailboxes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/accessible_mailboxes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),profile:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/profile`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxAlias:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroupManager:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},publicMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeToRecycleBin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/remove_to_recycle_bin`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},user:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/users/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxMessage:{getByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/get_by_card`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sendStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/send_status`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/modify`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listThreadMessage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxThread:{batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxEvent:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscription`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxMailContact:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxLabel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxDraft:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancelScheduledSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/cancel_scheduled_send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id/send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxRule:{reorder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/reorder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxSetting:{sendAs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/send_as`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getSignatures:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/signatures`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxSentMessage:{getRecallDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxTemplate:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxTemplateAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id/attachments/download_url`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},multiEntity:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/multi_entity/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxFolder:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxMessageAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/attachments/download_url`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},ov=class extends av{constructor(){super(...arguments),this.mcp={}}},nv=class extends ov{constructor(){super(...arguments),this.mdm={userAuthDataRelation:{unbind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/unbind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),bind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/bind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{userAuthDataRelation:{unbind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/unbind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),bind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/bind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v3:{countryRegion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mdm/v3/country_regions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},batchCountryRegion:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mdm/v3/batch_country_region`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},sv=class extends nv{constructor(){super(...arguments),this.meeting_room={}}},gv=class extends sv{constructor(){super(...arguments),this.mindnote={}}},cv=class extends gv{constructor(){super(...arguments),this.minutes={v1:{minuteTranscript:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/transcript`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},minuteStatistics:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/statistics`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},minuteMedia:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/media`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},minute:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),artifacts:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/artifacts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Iv=class extends cv{constructor(){super(...arguments),this.moments={post:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/moments/v1/posts/:post_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{post:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/moments/v1/posts/:post_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},lv=class extends Iv{constructor(){super(...arguments),this.myai_ai_extension={}}},pv=class extends lv{constructor(){super(...arguments),this.myai_assistant={}}},dv=class extends pv{constructor(){super(...arguments),this.myai_base_ai={}}},hv=class extends dv{constructor(){super(...arguments),this.myai_ccm_extension={}}},Ev=class extends hv{constructor(){super(...arguments),this.myai_data={}}},uv=class extends Ev{constructor(){super(...arguments),this.myai_im_extension={}}},Cv=class extends uv{constructor(){super(...arguments),this.myai_mail={}}},Bv=class extends Cv{constructor(){super(...arguments),this.myai_memory_reflection={}}},fv=class extends Bv{constructor(){super(...arguments),this.myai_scenario_summary={}}},Qv=class extends fv{constructor(){super(...arguments),this.myai_slides={}}},yv=class extends Qv{constructor(){super(...arguments),this.myai_url_extension={}}},mv=class extends yv{constructor(){super(...arguments),this.myai={}}},Sv=class extends mv{constructor(){super(...arguments),this.okr={review:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/reviews/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},periodRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/period_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},progressRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},period:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/periods`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/periods`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/periods/:period_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okr:{batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/okrs/batch_get`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userOkr:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/users/:user_id/okrs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},image:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/images/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},v1:{review:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/reviews/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},periodRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/period_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},progressRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},period:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/periods`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/periods`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/periods/:period_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okr:{batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/okrs/batch_get`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userOkr:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/users/:user_id/okrs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},image:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/images/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})}},v2:{okrAlignment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/alignments/:alignment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/alignments/:alignment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrObjective:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),keyResultsPosition:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results_position`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),keyResultsWeight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results_weight`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrKeyResult:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrObjectiveAlignment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrCategory:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/categories`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/categories`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrCycle:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),objectivesWeight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives_weight`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),objectivesPosition:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives_position`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrObjectiveKeyResult:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrKeyResultIndicator:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/indicators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrObjectiveIndicator:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/indicators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrCycleObjective:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrIndicator:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/indicators/:indicator_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrObjectiveProgress:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/progresses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/progresses`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrKeyResultProgress:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/progresses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/progresses`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},wv=class extends Sv{constructor(){super(...arguments),this.optical_char_recognition={image:{basicRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/optical_char_recognition/v1/image/basic_recognize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{image:{basicRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/optical_char_recognition/v1/image/basic_recognize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Dv=class extends wv{constructor(){super(...arguments),this.partner_ai={}}},Ov=class extends Dv{constructor(){super(...arguments),this.passport={session:{logout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/passport/v1/sessions/logout`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/passport/v1/sessions/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},password:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/passport/v1/password`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{session:{logout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/passport/v1/sessions/logout`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/passport/v1/sessions/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},password:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/passport/v1/password`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},bv=class extends Ov{constructor(){super(...arguments),this.payroll={v1:{datasourceRecord:{save:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/datasource_records/save`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/datasource_records/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/datasource_records/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},paymentDetail:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/payment_detail/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},paymentActivity:{archive:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/payment_activitys/archive`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/payment_activitys`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/payment_activitys`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},costAllocationPlan:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/cost_allocation_plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/cost_allocation_plans`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},paymentActivityDetail:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/payment_activity_details`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},datasource:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/datasources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/datasources`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},costAllocationDetail:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/cost_allocation_details`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/cost_allocation_details`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},costAllocationReport:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/cost_allocation_reports`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/cost_allocation_reports`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},paygroup:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/paygroups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/paygroups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},acctItem:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/acct_items`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/acct_items`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Mv=class extends bv{constructor(){super(...arguments),this.people_admin={}}},_v=class extends Mv{constructor(){super(...arguments),this.people_ai={}}},Tv=class extends _v{constructor(){super(...arguments),this.people_bytedance={}}},Nv=class extends Tv{constructor(){super(...arguments),this.performance={v1:{reviewData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v1/review_datas/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},stageTask:{findByUserList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v1/stage_tasks/find_by_user_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),findByPage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v1/stage_tasks/find_by_page`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},semester:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v1/semesters`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{reviewee:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/reviewees/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},additionalInformationsBatch:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/additional_informations/batch`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},metricDetail:{import:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_details/import`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_details/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},question:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/questions/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/questions/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},indicator:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/indicators/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/indicators/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},activity:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/activity/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},metricTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_tags`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},metricField:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_fields/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},metricLib:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_libs/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reviewData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/review_datas/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},metricTemplate:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_templates/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userInfo:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/user_info/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reviewTemplate:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/review_templates/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/review_templates/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userGroupUserRel:{write:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/user_group_user_rels/write`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},additionalInformation:{import:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/additional_informations/import`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/additional_informations/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/additional_informations/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Rv=class extends Nv{constructor(){super(...arguments),this.personal_settings={systemStatus:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchClose:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchOpen:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{systemStatus:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchClose:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchOpen:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},kv=class extends Rv{constructor(){super(...arguments),this.profile={}}},vv=class extends kv{constructor(){super(...arguments),this.report={rule:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/report/v1/rules/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ruleView:{remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/report/v1/rules/:rule_id/views/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},task:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/report/v1/tasks/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{rule:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/report/v1/rules/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ruleView:{remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/report/v1/rules/:rule_id/views/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},task:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/report/v1/tasks/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Pv=class extends vv{constructor(){super(...arguments),this.rule_engine={}}},Gv=class extends Pv{constructor(){super(...arguments),this.saasbi={}}},Fv=class extends Gv{constructor(){super(...arguments),this.scim={}}},Lv=class extends Fv{constructor(){super(...arguments),this.search_in_app={}}},Uv=class extends Lv{constructor(){super(...arguments),this.search={dataSource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},schema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},dataSourceItem:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},app:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/app`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},docWiki:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v2:{dataSource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},schema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},dataSourceItem:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},app:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/app`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},docWiki:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Hv=class extends Uv{constructor(){super(...arguments),this.security_and_compliance={openapiLog:{listData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/openapi_logs/list_data`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMigration:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/:user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},multiGeoEntityTenant:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/multi_geo_entity/tenant`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{openapiLog:{listData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/openapi_logs/list_data`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMigration:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/:user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},multiGeoEntityTenant:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/multi_geo_entity/tenant`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{deviceApplyRecord:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_apply_records/:device_apply_record_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},deviceRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mine:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records/mine`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Kv=class extends Hv{constructor(){super(...arguments),this.security_plugin={}}},xv=class extends Kv{constructor(){super(...arguments),this.sheet_ai={}}},Yv=class extends xv{constructor(){super(...arguments),this.sheets={spreadsheet:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheet:{replace:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),moveDimension:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),find:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFilter:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFilterView:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFilterViewCondition:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFloatImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v3:{spreadsheet:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheet:{replace:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),moveDimension:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),find:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFilter:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFilterView:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFilterViewCondition:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFloatImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},jv=class extends Yv{constructor(){super(...arguments),this.slides_ai={}}},Jv=class extends jv{constructor(){super(...arguments),this.slides={}}},qv=class extends Jv{constructor(){super(...arguments),this.spark={v1:{appTable:{deleteTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),postTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patchTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdateTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records_batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTableDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTableList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTableRecordList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appEnum:{getEnumDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/enums/:enum_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getEnumList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/enums`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appView:{getViewRecordList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/views/:view_name/records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appStorage:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage`,A),method:"GET",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadInitialize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/initialize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/part`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadComplete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/complete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},app:{icon:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/icon`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadHtmlCodeAndRelease:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/upload_and_release_html_code`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),getAppVisibility:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/access-scope`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateAppVisibility:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/access-scope`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sqlCommands:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/sql_commands`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},directoryUser:{idConvert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/directory/user/id_convert`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},zv=class extends qv{constructor(){super(...arguments),this.speech_to_text={speech:{fileRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/speech_to_text/v1/speech/file_recognize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),streamRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/speech_to_text/v1/speech/stream_recognize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{speech:{fileRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/speech_to_text/v1/speech/file_recognize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),streamRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/speech_to_text/v1/speech/stream_recognize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Vv=class extends zv{constructor(){super(...arguments),this.subscriptions={}}},Wv=class extends Vv{constructor(){super(...arguments),this.task={task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDeleteFollower:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_follower`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDeleteCollaborator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uncomplete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/uncomplete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),complete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/complete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskComment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskCollaborator:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskFollower:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers/:follower_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskReminder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDeleteFollower:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_follower`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDeleteCollaborator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uncomplete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/uncomplete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),complete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/complete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskComment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskCollaborator:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskFollower:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers/:follower_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskReminder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{task:{tasklists:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/tasklists`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addDependencies:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_dependencies`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeDependencies:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_dependencies`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setAncestorTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/set_ancestor_task`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addReminders:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_reminders`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeReminders:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_reminders`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeTasklist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_tasklist`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addTasklist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_tasklist`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},comment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/comments/:comment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/comments/:comment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/comments/:comment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},section:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections/:section_guid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),tasksWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections/:section_guid/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),tasks:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections/:section_guid/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections/:section_guid`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections/:section_guid`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tasklist:{tasks:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/add_members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/remove_members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customField:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),add:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/add`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tasklistActivitySubscription:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/attachments/:attachment_guid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/attachments/:attachment_guid`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/attachments/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/attachments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/attachments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customFieldOption:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/options/:option_guid`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/options`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskV2:{taskSubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/task_v2/task_subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listRelatedTaskWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/task_v2/list_related_task`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),listRelatedTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/task_v2/list_related_task`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskSubtask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Zv=class extends Wv{constructor(){super(...arguments),this.tenant={tenant:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/tenant/v2/tenant/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tenantProductAssignInfo:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/tenant/v2/tenant/assign_info_list/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v2:{tenant:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/tenant/v2/tenant/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tenantProductAssignInfo:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/tenant/v2/tenant/assign_info_list/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Xv=class extends Zv{constructor(){super(...arguments),this.translation={text:{translate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/translation/v1/text/translate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),detect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/translation/v1/text/detect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{text:{translate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/translation/v1/text/translate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),detect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/translation/v1/text/detect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},$v=class extends Xv{constructor(){super(...arguments),this.trust_layer={}}},eP=class extends $v{constructor(){super(...arguments),this.trust_party={v1:{collaborationTenantCollaborationUser:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/collaboration_users/:target_user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},collaborationTenantCollaborationDepartment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/collaboration_departments/:target_department_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},collaborationTenant:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),visibleOrganization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/visible_organization`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},AP=class extends eP{constructor(){super(...arguments),this.unified_kms_log={}}},tP=class extends AP{constructor(){super(...arguments),this.unified_kms={}}},rP=class extends tP{constructor(){super(...arguments),this.vault={}}},iP=class extends rP{constructor(){super(...arguments),this.vc={material:{uploadMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/materials/upload_meta`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/materials/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),pullMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/materials/pull_meta`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meetingRecording:{start:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/start`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),stop:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/stop`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setPermission:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},roomConfig:{del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setCheckboardAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/set_checkboard_access_code`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setRoomAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/set_room_access_code`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/set`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserve:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/apply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiVcMeeting:{getCommonReply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_common_reply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),doOperation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/do_operation`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTodoTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_todo_task`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),seedAiPullData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/seed_ai_pull_data`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),docBasedSuggestQuestion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/doc_based_suggest_question`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),callback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/callback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sectionSummary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/section_summary`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getRecap:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_recap`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchStepSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_step_summary_stream`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchSectionSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_section_summary_stream`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchRecapStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_recap_stream`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meeting:{end:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/end`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),kickout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/kickout`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setHost:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/set_host`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),invite:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/invite`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),changeName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/change_name`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listByNoWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),listByNo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiRoom:{joinOfflineMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/join_offline_meeting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reserveInstantEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/reserve_instant_event`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),helpSceneType:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/help_scene_type`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),joinMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),checkInSchedule:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/check_in_schedule`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),exit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/exit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),autoReleaseEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_release_event`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),autoWelcome:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_welcome`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),roomCalling:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/room_calling`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),joinMeetingNumber:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting_number`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leaveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/leave_meeting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiMm:{mediaParse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_parse`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),extensionBoarding:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/extension_boarding`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),querySuggestContext:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/query_suggest_context`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mediaBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_bind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiSip:{createEventCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_sip/create_event_card`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},alert:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiVc:{cardCallback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/card_callback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),startAnalysis:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/start_analysis`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/set_meeting_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),meetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/meeting_analyze`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchMeetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_analyze`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},report:{getDaily:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reports/get_daily`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTopUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reports/get_top_user`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},room:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},resourceReservationList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},participantQualityList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},roomLevel:{mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},scopeConfig:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),accessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/scope_config/access_code`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfigForm:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfigAdmin:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfigDisableInform:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfig:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reserveScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/reserve_scope`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},export:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/:task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),resourceReservationList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/resource_reservation_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),participantQualityList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/participant_quality_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),participantList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/participant_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),meetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/meeting_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meetingList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},participantList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meetingPullSubtitle:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},note:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unifiedNoteTranscriptWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),unifiedNoteTranscript:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/:note_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},recording:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/recordings/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/recordings/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},bot:{realtimeEndpoint:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/realtime/endpoint`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/leave`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),message:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),userActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/user_active_meeting`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),join:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/join`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),eventsWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),events:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{material:{uploadMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/materials/upload_meta`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/materials/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),pullMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/materials/pull_meta`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meetingRecording:{start:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/start`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),stop:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/stop`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setPermission:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},roomConfig:{del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setCheckboardAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/set_checkboard_access_code`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setRoomAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/set_room_access_code`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/set`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserve:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/apply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiVcMeeting:{getCommonReply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_common_reply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),doOperation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/do_operation`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTodoTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_todo_task`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),seedAiPullData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/seed_ai_pull_data`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),docBasedSuggestQuestion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/doc_based_suggest_question`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),callback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/callback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sectionSummary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/section_summary`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getRecap:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_recap`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchStepSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_step_summary_stream`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchSectionSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_section_summary_stream`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchRecapStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_recap_stream`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meeting:{end:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/end`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),kickout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/kickout`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setHost:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/set_host`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),invite:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/invite`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),changeName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/change_name`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listByNoWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),listByNo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiRoom:{joinOfflineMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/join_offline_meeting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reserveInstantEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/reserve_instant_event`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),helpSceneType:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/help_scene_type`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),joinMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),checkInSchedule:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/check_in_schedule`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),exit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/exit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),autoReleaseEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_release_event`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),autoWelcome:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_welcome`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),roomCalling:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/room_calling`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),joinMeetingNumber:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting_number`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leaveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/leave_meeting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiMm:{mediaParse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_parse`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),extensionBoarding:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/extension_boarding`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),querySuggestContext:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/query_suggest_context`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mediaBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_bind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiSip:{createEventCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_sip/create_event_card`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},alert:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiVc:{cardCallback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/card_callback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),startAnalysis:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/start_analysis`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/set_meeting_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),meetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/meeting_analyze`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchMeetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_analyze`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},report:{getDaily:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reports/get_daily`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTopUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reports/get_top_user`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},room:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},resourceReservationList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},participantQualityList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},roomLevel:{mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},scopeConfig:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),accessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/scope_config/access_code`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfigForm:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfigAdmin:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfigDisableInform:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfig:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reserveScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/reserve_scope`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},export:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/:task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),resourceReservationList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/resource_reservation_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),participantQualityList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/participant_quality_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),participantList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/participant_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),meetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/meeting_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meetingList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},participantList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meetingPullSubtitle:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},note:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unifiedNoteTranscriptWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),unifiedNoteTranscript:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/:note_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},recording:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/recordings/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/recordings/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},bot:{realtimeEndpoint:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/realtime/endpoint`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/leave`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),message:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),userActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/user_active_meeting`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),join:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/join`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),eventsWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),events:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},aP=class extends iP{constructor(){super(...arguments),this.verification={v1:{verification:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/verification/v1/verification`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},oP=class extends aP{constructor(){super(...arguments),this.wiki={spaceSetting:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/setting`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spaceNode:{updateTitle:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),moveDocsToWiki:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spaceMember:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},space:{getNode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/get_node`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/tasks/:task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{node:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v1/nodes/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v1/nodes/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{spaceSetting:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/setting`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spaceNode:{updateTitle:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),moveDocsToWiki:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spaceMember:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},space:{getNode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/get_node`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/tasks/:task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},nP=class extends oP{constructor(){super(...arguments),this.workplace={workplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/workplace/v1/workplace_access_data/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workplaceBlockAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/workplace/v1/workplace_block_access_data/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customWorkplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/workplace/v1/custom_workplace_access_data/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{workplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/workplace/v1/workplace_access_data/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workplaceBlockAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/workplace/v1/workplace_block_access_data/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customWorkplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/workplace/v1/custom_workplace_access_data/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Pg={error:(...n)=>{console.log("[error]:",...n)},warn:(...n)=>{console.warn("[warn]:",...n)},info:(...n)=>{console.info("[info]:",...n)},debug:(...n)=>{console.debug("[debug]:",...n)},trace:(...n)=>{console.trace("[trace]:",...n)}},Uc=class{constructor(t,o){this.level=t,this.logger=o}error(...t){this.level>=Eo.error&&this.logger.error(t)}warn(...t){this.level>=Eo.warn&&this.logger.warn(t)}info(...t){this.level>=Eo.info&&this.logger.info(t)}debug(...t){this.level>=Eo.debug&&this.logger.debug(t)}trace(...t){this.level>=Eo.trace&&this.logger.trace(t)}},sP=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.cache=t.cache,this.domain=t.domain,this.logger=t.logger,this.appType=t.appType,this.httpInstance=t.httpInstance,this.logger.debug("app ticket manager is ready"),this.checkAppTicket()}checkAppTicket(){var t;return h(this,void 0,void 0,function*(){this.appType===Os.ISV&&((yield(t=this.cache)===null||t===void 0?void 0:t.get(kC,{namespace:this.appId}))||this.requestAppTicket())})}requestAppTicket(){return h(this,void 0,void 0,function*(){this.logger.debug("request app ticket"),yield this.httpInstance.post(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,{app_id:this.appId,app_secret:this.appSecret}).catch(t=>{this.logger.error(t)})})}getAppTicket(){var t;return h(this,void 0,void 0,function*(){let o=yield(t=this.cache)===null||t===void 0?void 0:t.get(kC,{namespace:this.appId});if(o)return this.logger.debug("use cache app ticket"),o;yield this.requestAppTicket()})}},lS="/oauth/v3/token",fRe="urn:ietf:params:oauth:grant-type:jwt-bearer",G6="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",QRe="authorization_code",yRe="refresh_token",TP="X-Target-Service",F6=7100,NP=7101,L6=7102,RP=7104,mRe=Object.freeze({"open.feishu.cn":"https://accounts.feishu.cn","open.larksuite.com":"https://accounts.larksuite.com"}),na=class extends Error{constructor(t,o){super(o),this.name="ClientAssertionError",this.code=t,this.msg=o}},$d=class extends Error{constructor(t,o,a,e){super(e||a||"access token request failed"),this.name="AccessTokenError",this.statusCode=t,this.code=o,this.error=a,this.errorDescription=e}},kP=n=>n.includes("://")?n:`https://${n}`;function vP(n){let t=new URL(kP(n));if(!t.host)throw new Error(`invalid url: ${n}`);return t.host}function PP(n){if(n.oauthBaseUrl)return kP(n.oauthBaseUrl).replace(/\/+$/,"");let t=vP(n.domain),o=mRe[t];if(o)return o;throw new Error("oauthBaseUrl is not configured. When domain is a non-default value (neither open.feishu.cn nor open.larksuite.com), set oauthBaseUrl explicitly.")}function U6(n){return vP(PP(n))}function GP(n,t){let o=new URL(kP(n.targetService));if(o.protocol!=="https:")throw new Error("targetService must use https");if(o.username||o.password)throw new Error("targetService must not contain userinfo");let e=`${n.targetPrefix||""}${t}`.replace(/\/{2,}/g,"/");if(/(^|\/)\.\.(\/|$)/.test(e))throw new Error("targetPrefix must not contain path traversal");return`${o.protocol}//${o.host}${e}`}function SRe(n,t){var o,a;let e=(o=t?.code)!==null&&o!==void 0?o:"unknown",i=(a=t?.msg)!==null&&a!==void 0?a:"no message";return`failed to get ${n}, code: ${e}, msg: ${i}`}var gP=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.cache=t.cache,this.domain=t.domain,this.logger=t.logger,this.appType=t.appType,this.httpInstance=t.httpInstance,this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.appTicketManager=new sP({appId:this.appId,appSecret:this.appSecret,cache:this.cache,domain:this.domain,logger:this.logger,appType:this.appType,httpInstance:this.httpInstance}),this.logger.debug("token manager is ready")}requestToken(t,o,a){return h(this,void 0,void 0,function*(){let e=yield this.httpInstance.post(t,o).catch(i=>{throw this.logger.error(i),i});if(!e||!e[a])throw new Error(SRe(a,e));return e})}getCustomTenantAccessToken(){var t,o;return h(this,void 0,void 0,function*(){if(this.clientAssertionProvider)return this.getTenantTokenByClientAssertion();let a=yield(t=this.cache)===null||t===void 0?void 0:t.get(MC,{namespace:this.appId});if(a)return this.logger.debug("use cache token"),a;this.logger.debug("request token");let{tenant_access_token:e,expire:i}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,{app_id:this.appId,app_secret:this.appSecret},"tenant_access_token");return yield(o=this.cache)===null||o===void 0?void 0:o.set(MC,e,new Date().getTime()+i*1e3-180*1e3,{namespace:this.appId}),e})}getTenantTokenByClientAssertion(){var t,o,a,e,i,A,r,s;return h(this,void 0,void 0,function*(){let g=PP({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),c=U6({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),I=yield(t=this.cache)===null||t===void 0?void 0:t.get(MC,{namespace:this.appId});if(I)return this.logger.debug("use cache token"),I;let p;try{p=yield this.clientAssertionProvider.retrieveToken(c)}catch(T){throw new na(L6,T?.message||"client assertion provider failed")}if(!p||!p.value)throw new na(NP,"client assertion token is empty");let B=`${g}${lS}`,f={};p.targetInfo&&(B=GP(p.targetInfo,lS),f[TP]=c),this.logger.debug("request token (client assertion)");let Q;try{Q=yield this.httpInstance.request({method:"post",url:B,headers:f,data:{grant_type:fRe,client_assertion_type:G6,client_assertion:p.value,client_id:this.appId}})}catch(T){throw this.logger.error(T),new na(((a=(o=T?.response)===null||o===void 0?void 0:o.data)===null||a===void 0?void 0:a.code)||0,((i=(e=T?.response)===null||e===void 0?void 0:e.data)===null||i===void 0?void 0:i.error_description)||((r=(A=T?.response)===null||A===void 0?void 0:A.data)===null||r===void 0?void 0:r.error)||"client assertion token exchange failed")}let y=Q?.access_token;if(!y)throw new na(Q?.code||0,Q?.error_description||Q?.error||"oauth token response missing access token");let m=Number(Q?.expires_in)||0;return yield(s=this.cache)===null||s===void 0?void 0:s.set(MC,y,new Date().getTime()+Math.max(m-180,0)*1e3,{namespace:this.appId}),y})}getMarketTenantAccessToken(t){var o;return h(this,void 0,void 0,function*(){if(this.clientAssertionProvider)throw new na(F6,"ClientAssertion mode is not supported for ISV apps");if(!t){this.logger.error("market app request need tenant key");return}let a=yield(o=this.cache)===null||o===void 0?void 0:o.get(`larkMarketAccessToken${t}`,{namespace:this.appId});if(a)return this.logger.debug("use cache token"),a;this.logger.debug("get app ticket");let e=yield this.appTicketManager.getAppTicket();if(!e){this.logger.warn("no app ticket");return}this.logger.debug("get app access token");let{app_access_token:i}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/app_access_token`,{app_id:this.appId,app_secret:this.appSecret,app_ticket:e},"app_access_token");this.logger.debug("get tenant access token");let{tenant_access_token:A,expire:r}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/tenant_access_token`,{app_access_token:i,tenant_key:t},"tenant_access_token");return yield this.cache.set(`larkMarketAccessToken${t}`,A,new Date().getTime()+r*1e3-180*1e3,{namespace:this.appId}),A})}getTenantAccessToken(t){return h(this,void 0,void 0,function*(){return IS(this.appType===Os.SelfBuild,()=>h(this,void 0,void 0,function*(){this.logger.debug("get custom app token")})),IS(this.appType===Os.ISV,()=>h(this,void 0,void 0,function*(){this.logger.debug("get market app token ")})),this.appType===Os.SelfBuild?yield this.getCustomTenantAccessToken():yield this.getMarketTenantAccessToken(t?.[gS])})}},H6=(n,t)=>{let o=Object.assign({},n);for(let[a,e]of Object.entries(t))e!==void 0&&(o[a]=e);return o},cP=class{constructor(t){this.client=t.client}getCacheKey(t,o){return`${o?.namespace||this.client.appId}/${uRe.toString()}/${t}`}calibrateTime(t){return new Date().getTime()+(t||0)*1e3-180*1e3}initWithCode(t,o){return h(this,void 0,void 0,function*(){let a={};for(let[e,i]of Object.entries(t)){let A=yield this.client.authen.oidcAccessToken.create({data:{grant_type:"authorization_code",code:i}});if(A.code!==0){this.client.logger.error("init user access token error",e,A.msg||A.message);continue}if(!A.data){this.client.logger.error("user access code expired",e,i);continue}a[e]={code:i,token:A.data.access_token,refreshToken:A.data.refresh_token,expiredTime:this.calibrateTime(A.data.expires_in)}}return yield this.update(a,{namespace:o?.namespace}),a})}update(t,o){return h(this,void 0,void 0,function*(){for(let[a,e]of Object.entries(t)){let i=this.getCacheKey(a,{namespace:o?.namespace}),A=(yield this.client.cache.get(i))||{},{code:r,token:s,refreshToken:g,expiredTime:c}=e,I=H6(A,{code:r,token:s,refreshToken:g,expiredTime:c});yield this.client.cache.set(i,I,1/0)}})}get(t,o){return h(this,void 0,void 0,function*(){let a=this.getCacheKey(t,{namespace:o?.namespace}),e=yield this.client.cache.get(a);if(!e){this.client.logger.error("user access token needs to be initialized or updated first");return}let{token:i,code:A,refreshToken:r,expiredTime:s}=e;if(i&&s&&s-new Date().getTime()>0)return i;if(r){let g=yield this.client.authen.oidcRefreshAccessToken.create({data:{grant_type:"refresh_token",refresh_token:r}});if(g.code===0&&g.data)return yield this.update({[t]:{token:g.data.access_token,refreshToken:g.data.refresh_token,expiredTime:this.calibrateTime(g.data.expires_in)}}),g.data.access_token;this.client.logger.error("get user access token by refresh token failed.",g.msg);return}if(A){let g=yield this.client.authen.oidcAccessToken.create({data:{grant_type:"authorization_code",code:A}});g.code===0&&g.data?yield this.update({[t]:{token:g.data.access_token,refreshToken:g.data.refresh_token,expiredTime:this.calibrateTime(g.data.expires_in)}}):this.client.logger.error("get user access token by code failed.",g.msg)}})}},Zd=n=>n===""||n===0||n===null||n===void 0?void 0:n,wRe=n=>{if(!n||n.error)return!0;let{code:t}=n;return t!==void 0&&t!==0&&t!=="0"&&t!==""},IP=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.domain=t.domain,this.httpInstance=t.httpInstance,this.logger=t.logger}retrieveByAuthorizationCode(t){return h(this,void 0,void 0,function*(){return this.doRequest({grant_type:QRe,code:t.code,redirect_uri:t.redirectUri,code_verifier:t.codeVerifier,scope:t.scope},t.headers)})}refresh(t){return h(this,void 0,void 0,function*(){return this.doRequest({grant_type:yRe,refresh_token:t.refreshToken,scope:t.scope},t.headers)})}doRequest(t,o){return h(this,void 0,void 0,function*(){let a=PP({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),e=U6({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),i={client_id:this.appId};for(let[I,p]of Object.entries(t))p!=null&&(i[I]=p);let A=`${a}${lS}`,r=Object.assign({},o||{});if(this.clientAssertionProvider){let I;try{I=yield this.clientAssertionProvider.retrieveToken(e)}catch(p){throw new na(L6,p?.message||"client assertion provider failed")}if(!I||!I.value)throw new na(NP,"client assertion token is empty");i.client_assertion_type=G6,i.client_assertion=I.value,I.targetInfo&&(A=GP(I.targetInfo,lS),r[TP]=e)}else if(this.appSecret)i.client_secret=this.appSecret;else throw new na(RP,"appSecret and clientAssertionProvider cannot both be empty for accessToken APIs");let s=200,g;try{g=yield this.httpInstance.request({method:"post",url:A,headers:r,data:i})}catch(I){if(this.logger.error(I),I?.response)s=I.response.status,g=I.response.data;else throw new $d(0,0,"",I?.message||"oauth token request failed")}if(s!==200||wRe(g))throw new $d(s,g?.code||0,g?.error||"",g?.error_description||g?.msg||"");let c=Zd(g?.access_token);if(!c)throw new $d(s,g?.code||0,g?.error||"",g?.error_description||"oauth token response missing access_token");return{accessToken:c,tokenType:Zd(g.token_type),expiresIn:Zd(g.expires_in),refreshToken:Zd(g.refresh_token),refreshTokenExpiresIn:Zd(g.refresh_token_expires_in),scope:Zd(g.scope)}})}},pS=class extends nP{constructor(t){if(super(),this.appId="",this.appSecret="",this.helpDeskId="",this.helpDeskToken="",this.appType=Os.SelfBuild,this.logger=new Uc(t.loggerLevel||Eo.info,t.logger||Pg),this.appId=t.appId,this.appSecret=t.appSecret||"",this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.disableTokenCache=t.disableTokenCache,this.userAgent=_P(t.source,{extraTags:t.extraUaTags}),IS(!this.appId,()=>this.logger.error("appId is needed")),this.helpDeskId=t.helpDeskId,this.helpDeskToken=t.helpDeskToken,this.appType=t?.appType||Os.SelfBuild,!this.appSecret&&!this.clientAssertionProvider)throw new na(RP,"appSecret or clientAssertionProvider is required");if(this.clientAssertionProvider&&this.appType===Os.ISV)throw new na(F6,"ClientAssertion mode is not supported for ISV apps");this.domain=P6(t.domain||bs.Feishu),this.logger.debug(`use domain url: ${this.domain}`),this.cache=t.cache||PC,this.httpInstance=t.httpInstance||eh,this.tokenManager=new gP({appId:this.appId,appSecret:this.appSecret,cache:this.cache,domain:this.domain,logger:this.logger,appType:this.appType,httpInstance:this.httpInstance,clientAssertionProvider:this.clientAssertionProvider,oauthBaseUrl:this.oauthBaseUrl}),this.userAccessToken=new cP({client:this}),this.accessToken=new IP({appId:this.appId,appSecret:this.appSecret,clientAssertionProvider:this.clientAssertionProvider,oauthBaseUrl:this.oauthBaseUrl,domain:this.domain,httpInstance:this.httpInstance,logger:this.logger}),this.logger.info("client ready")}formatPayload(t,o){var a,e,i;return h(this,void 0,void 0,function*(){let A=["lark","params","data","headers","path"].reduce((g,c)=>(g[c]=o?.[c]||{},g),{}),r=(a=A?.lark)===null||a===void 0?void 0:a[v6];if(r)this.logger.debug("use passed token"),A.headers.Authorization=`Bearer ${r}`;else if(!this.disableTokenCache){let g=yield this.tokenManager.getTenantAccessToken({[gS]:(e=A?.lark)===null||e===void 0?void 0:e[gS]});g?A.headers.Authorization=`Bearer ${g}`:this.logger.warn("failed to obtain token")}if((i=A?.lark)===null||i===void 0?void 0:i[k6]){this.logger.debug("generate help desk credential");let g=CRe(`${this.helpDeskId}:${this.helpDeskToken}`);A.headers["X-Lark-Helpdesk-Authorization"]=`Bearer ${g}`}return{params:Object.assign(Object.assign({},t?.params||{}),A.params),headers:Object.assign(Object.assign({"User-Agent":this.userAgent},t?.headers||{}),A.headers),data:Object.assign(Object.assign({},t?.data||{}),A.data),path:Object.assign(Object.assign({},t?.path||{}),A.path)}})}request(t,o){var a;return h(this,void 0,void 0,function*(){let{data:e,params:i,headers:A,url:r}=t,s=Y(t,["data","params","headers","url"]),g=yield this.formatPayload({data:e,params:i,headers:A},o),c=((a=t.method)===null||a===void 0?void 0:a.toLowerCase())==="get"&&Object.keys(g.data).length===0?void 0:g.data;return this.logger.trace(`send request [${t.method}]: ${t.url}`),yield this.httpInstance.request(Object.assign(Object.assign({},s),{url:/^http/.test(r)?r:`${this.domain}/${BRe(r)}`,headers:g.headers,data:c,params:g.params})).catch(p=>{throw this.logger.error(p),p})})}},DRe=n=>n.reduce((t,o)=>(0,N6.default)(t,o),{}),ORe=n=>({lark:{[gS]:n}}),bRe=()=>({lark:{[k6]:!0}}),MRe=n=>({headers:{Authorization:`Bearer ${n}`}}),_Re=n=>({lark:{[v6]:n}}),dS=class{constructor(t){let{encryptKey:o,verificationToken:a,logger:e}=t;this.verificationToken=a,this.encryptKey=o,this.logger=e,o&&(this.aesCipher=new vC(o))}parse(t){var o,a;let e=(()=>{var r;let s=t||{},{encrypt:g}=s,c=Y(s,["encrypt"]);if(g)try{return Object.assign(Object.assign({},JSON.parse((r=this.aesCipher)===null||r===void 0?void 0:r.decrypt(g))),c)}catch{return this.logger.error("parse encrypt data failed"),{}}return c})();if("schema"in e){let{header:r,event:s}=e,g=Y(e,["header","event"]);return Object.assign(Object.assign(Object.assign({[sS]:(o=e?.header)===null||o===void 0?void 0:o.event_type},g),r),s)}let{event:i}=e,A=Y(e,["event"]);return Object.assign(Object.assign({[sS]:(a=e?.event)===null||a===void 0?void 0:a.type},i),A)}checkIsCardEventValidated(t){if("encrypt"in t||"schema"in t)return this.checkIsEventValidated(t);let{"x-lark-request-timestamp":o,"x-lark-request-nonce":a,"x-lark-signature":e}=t.headers;return this.verificationToken?nS.createHash("sha1").update(o+a+this.verificationToken+JSON.stringify(t)).digest("hex")===e:!0}checkIsEventValidated(t){if(!this.encryptKey)return!0;let{"x-lark-request-timestamp":o,"x-lark-request-nonce":a,"x-lark-signature":e}=t.headers,i=o+a+this.encryptKey+JSON.stringify(t);return nS.createHash("sha256").update(i).digest("hex")===e}},TRe="app_ticket",hS=class{constructor(t){this.verificationToken="",this.encryptKey="",this.handles=new Map;let{encryptKey:o,verificationToken:a}=t;this.encryptKey=o||"",this.verificationToken=a||"",this.logger=new Uc(t.loggerLevel||Eo.info,t.logger||Pg),this.requestHandle=new dS({encryptKey:o,verificationToken:a,logger:this.logger}),this.cache=t.cache||PC,this.registerAppTicketHandle(),this.logger.info("event-dispatch is ready")}registerAppTicketHandle(){this.register({app_ticket:t=>h(this,void 0,void 0,function*(){let{app_ticket:o,app_id:a}=t;o?(yield this.cache.set(kC,o,void 0,{namespace:a}),this.logger.debug("set app ticket")):this.logger.warn("response not include app ticket")})})}register(t){return Object.keys(t).forEach(o=>{this.handles.has(o)&&o!==TRe&&this.logger.error(`this ${o} handle is registered`),this.handles.set(o,t[o]),this.logger.debug(`register ${o} handle`)}),this}invoke(t,o){var a,e;return h(this,void 0,void 0,function*(){if(o?.needCheck!==!1&&!(!((a=this.requestHandle)===null||a===void 0)&&a.checkIsEventValidated(t))){this.logger.warn("verification failed event");return}let A=(e=this.requestHandle)===null||e===void 0?void 0:e.parse(t),r=A[sS];if(this.handles.has(r)){let s=yield this.handles.get(r)(A);return this.logger.debug(`execute ${r} handle`),s}return this.logger.warn(`no ${r} handle`),`no ${r} event handle`})}},lP=class{constructor(t,o){this.verificationToken="",this.encryptKey="",this.handles=new Map;let{verificationToken:a,encryptKey:e}=t;this.encryptKey=e||"",this.verificationToken=a||"",this.cardHandler=o,this.logger=new Uc(t.loggerLevel||Eo.info,t.logger||Pg),this.requestHandle=new dS({encryptKey:e,verificationToken:a,logger:this.logger}),this.cache=t.cache||PC,this.registerAppTicketHandle(),this.logger.info("card-action-handle is ready")}registerAppTicketHandle(){this.register({app_ticket:t=>h(this,void 0,void 0,function*(){let{app_ticket:o,app_id:a}=t;o?(yield this.cache.set(kC,o,void 0,{namespace:a}),this.logger.debug("set app ticket")):this.logger.warn("response not include app ticket")})})}register(t){return Object.keys(t).forEach(o=>{this.handles.set(o,t[o]),this.logger.debug(`register ${o} handle`)}),this}invoke(t){var o,a;return h(this,void 0,void 0,function*(){if(!(!((o=this.requestHandle)===null||o===void 0)&&o.checkIsCardEventValidated(t))){this.logger.warn("verification failed event");return}let e=(a=this.requestHandle)===null||a===void 0?void 0:a.parse(t),i=e[sS];if(this.handles.has(i))try{return yield this.handles.get(i)(e)}catch(A){this.logger.error(A);return}try{let A=yield this.cardHandler(e);return this.logger.debug("execute card handle"),A}catch(A){this.logger.error(A)}})}},yS=n=>new Promise(t=>{let o="";n.on("data",a=>{o+=a}),n.on("end",()=>{try{let a=JSON.parse(o);t(a)}catch{t("")}})}),GC=(n,t)=>{if("encrypt"in n&&!t.encryptKey)throw new Error("auto-challenge need encryptKey, please check for missing in dispatcher");let o="encrypt"in n?JSON.parse(new vC(t.encryptKey).decrypt(n.encrypt)):n;return{isChallenge:o.type==="url_verification",challenge:{challenge:o.challenge}}},NRe=(n,t,o)=>(a,e)=>h(void 0,void 0,void 0,function*(){if(a.url!==n)return;let i=Object.assign(Object.create({headers:a.headers}),yield yS(a));if(o?.autoChallenge||!1){let{isChallenge:s,challenge:g}=GC(i,{encryptKey:t.encryptKey});if(s){e.end(JSON.stringify(g));return}}let r=yield t.invoke(i);e.end(JSON.stringify(r))}),RRe=(n,t)=>(o,a)=>h(void 0,void 0,void 0,function*(){let e=yield h(void 0,void 0,void 0,function*(){return o.body?o.body:o.complete?((t?.logger||Pg).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield yS(o)}),i=Object.assign(Object.create({headers:o.headers}),e);if(t?.autoChallenge||!1){let{isChallenge:s,challenge:g}=GC(i,{encryptKey:n.encryptKey});if(s){a.json(g);return}}let r=yield n.invoke(i);a.json(r)}),kRe=(n,t,o)=>(a,e)=>h(void 0,void 0,void 0,function*(){let{originalUrl:i,req:A,request:r}=a;if(i===n){let s=yield h(void 0,void 0,void 0,function*(){return r.body?r.body:A.complete?((o?.logger||Pg).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield yS(A)}),g=Object.assign(Object.create({headers:A.headers}),s);if(o?.autoChallenge||!1){let{isChallenge:p,challenge:B}=GC(g,{encryptKey:t.encryptKey});if(p){a.body=B,yield e();return}}let I=yield t.invoke(g);a.body=JSON.stringify(I)}yield e()}),vRe=(n,t)=>(o,a)=>h(void 0,void 0,void 0,function*(){let{req:e,request:i}=o,A=yield h(void 0,void 0,void 0,function*(){return i.body?i.body:e.complete?((t?.logger||Pg).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield yS(e)}),r=Object.assign(Object.create({headers:e.headers}),A);if(t?.autoChallenge||!1){let{isChallenge:c,challenge:I}=GC(r,{encryptKey:n.encryptKey});if(c){o.body=I,yield a();return}}let g=yield n.invoke(r);o.body=JSON.stringify(g),yield a()}),PRe=n=>{let{title:t,content:o}=n;return JSON.stringify({config:{wide_screen_mode:!0},elements:[{tag:"markdown",content:o}],header:{template:"blue",title:{content:t,tag:"plain_text"}}})},GRe=Object.freeze({__proto__:null,defaultCard:PRe}),vg=tS();vg.util.Long=void 0;vg.configure();var Lc=vg.Reader,E6=vg.Writer,HA=vg.util,Vo=vg.roots.default||(vg.roots.default={}),K6=Vo.pbbp2=(()=>{let n={};return n.Header=(function(){function t(o){if(o)for(let a=Object.keys(o),e=0;e>>3){case 1:{A.key=a.string();break}case 2:{A.value=a.string();break}default:a.skipType(r&7);break}}if(!A.hasOwnProperty("key"))throw HA.ProtocolError("missing required 'key'",{instance:A});if(!A.hasOwnProperty("value"))throw HA.ProtocolError("missing required 'value'",{instance:A});return A},t.decodeDelimited=function(a){return a instanceof Lc||(a=new Lc(a)),this.decode(a,a.uint32())},t.verify=function(a){return typeof a!="object"||a===null?"object expected":HA.isString(a.key)?HA.isString(a.value)?null:"value: string expected":"key: string expected"},t.fromObject=function(a){if(a instanceof Vo.pbbp2.Header)return a;let e=new Vo.pbbp2.Header;return a.key!=null&&(e.key=String(a.key)),a.value!=null&&(e.value=String(a.value)),e},t.toObject=function(a,e){e||(e={});let i={};return e.defaults&&(i.key="",i.value=""),a.key!=null&&a.hasOwnProperty("key")&&(i.key=a.key),a.value!=null&&a.hasOwnProperty("value")&&(i.value=a.value),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,vg.util.toJSONOptions)},t.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/pbbp2.Header"},t})(),n.Frame=(function(){function t(o){if(this.headers=[],o)for(let a=Object.keys(o),e=0;e>>3){case 1:{A.SeqID=a.uint64();break}case 2:{A.LogID=a.uint64();break}case 3:{A.service=a.int32();break}case 4:{A.method=a.int32();break}case 5:{A.headers&&A.headers.length||(A.headers=[]),A.headers.push(Vo.pbbp2.Header.decode(a,a.uint32()));break}case 6:{A.payloadEncoding=a.string();break}case 7:{A.payloadType=a.string();break}case 8:{A.payload=a.bytes();break}case 9:{A.LogIDNew=a.string();break}default:a.skipType(r&7);break}}if(!A.hasOwnProperty("SeqID"))throw HA.ProtocolError("missing required 'SeqID'",{instance:A});if(!A.hasOwnProperty("LogID"))throw HA.ProtocolError("missing required 'LogID'",{instance:A});if(!A.hasOwnProperty("service"))throw HA.ProtocolError("missing required 'service'",{instance:A});if(!A.hasOwnProperty("method"))throw HA.ProtocolError("missing required 'method'",{instance:A});return A},t.decodeDelimited=function(a){return a instanceof Lc||(a=new Lc(a)),this.decode(a,a.uint32())},t.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(!HA.isInteger(a.SeqID)&&!(a.SeqID&&HA.isInteger(a.SeqID.low)&&HA.isInteger(a.SeqID.high)))return"SeqID: integer|Long expected";if(!HA.isInteger(a.LogID)&&!(a.LogID&&HA.isInteger(a.LogID.low)&&HA.isInteger(a.LogID.high)))return"LogID: integer|Long expected";if(!HA.isInteger(a.service))return"service: integer expected";if(!HA.isInteger(a.method))return"method: integer expected";if(a.headers!=null&&a.hasOwnProperty("headers")){if(!Array.isArray(a.headers))return"headers: array expected";for(let e=0;e>>0,a.SeqID.high>>>0).toNumber(!0))),a.LogID!=null&&(HA.Long?(e.LogID=HA.Long.fromValue(a.LogID)).unsigned=!0:typeof a.LogID=="string"?e.LogID=parseInt(a.LogID,10):typeof a.LogID=="number"?e.LogID=a.LogID:typeof a.LogID=="object"&&(e.LogID=new HA.LongBits(a.LogID.low>>>0,a.LogID.high>>>0).toNumber(!0))),a.service!=null&&(e.service=a.service|0),a.method!=null&&(e.method=a.method|0),a.headers){if(!Array.isArray(a.headers))throw TypeError(".pbbp2.Frame.headers: array expected");e.headers=[];for(let i=0;i=0&&(e.payload=a.payload)),a.LogIDNew!=null&&(e.LogIDNew=String(a.LogIDNew)),e},t.toObject=function(a,e){e||(e={});let i={};if((e.arrays||e.defaults)&&(i.headers=[]),e.defaults){if(HA.Long){let A=new HA.Long(0,0,!0);i.SeqID=e.longs===String?A.toString():e.longs===Number?A.toNumber():A}else i.SeqID=e.longs===String?"0":0;if(HA.Long){let A=new HA.Long(0,0,!0);i.LogID=e.longs===String?A.toString():e.longs===Number?A.toNumber():A}else i.LogID=e.longs===String?"0":0;i.service=0,i.method=0,i.payloadEncoding="",i.payloadType="",e.bytes===String?i.payload="":(i.payload=[],e.bytes!==Array&&(i.payload=HA.newBuffer(i.payload))),i.LogIDNew=""}if(a.SeqID!=null&&a.hasOwnProperty("SeqID")&&(typeof a.SeqID=="number"?i.SeqID=e.longs===String?String(a.SeqID):a.SeqID:i.SeqID=e.longs===String?HA.Long.prototype.toString.call(a.SeqID):e.longs===Number?new HA.LongBits(a.SeqID.low>>>0,a.SeqID.high>>>0).toNumber(!0):a.SeqID),a.LogID!=null&&a.hasOwnProperty("LogID")&&(typeof a.LogID=="number"?i.LogID=e.longs===String?String(a.LogID):a.LogID:i.LogID=e.longs===String?HA.Long.prototype.toString.call(a.LogID):e.longs===Number?new HA.LongBits(a.LogID.low>>>0,a.LogID.high>>>0).toNumber(!0):a.LogID),a.service!=null&&a.hasOwnProperty("service")&&(i.service=a.service),a.method!=null&&a.hasOwnProperty("method")&&(i.method=a.method),a.headers&&a.headers.length){i.headers=[];for(let A=0;AK6.Frame.decode(n),pP=class{constructor(){this.client={appId:"",appSecret:"",domain:bs.Feishu},this.ws={connectUrl:"",pingInterval:120*1e3,reconnectCount:-1,reconnectInterval:120*1e3,reconnectNonce:30*1e3,deviceId:"",serviceId:"",autoReconnect:!0},this.wsInstance=null}updateClient(t){Object.assign(this.client,t)}updateWs(t){Object.assign(this.ws,t)}getClient(t){return t===void 0?this.client:this.client[t]}getWS(t){return t===void 0?this.ws:this.ws[t]}get wsConfigUrl(){return`${this.getClient("domain")}/callback/ws/endpoint`}setWSInstance(t){this.wsInstance=t}getWSInstance(){return this.wsInstance}},dP=class{constructor(t){this.cache=new Map,this.logger=t.logger,this.clearAtInterval()}mergeData(t){let{message_id:o,sum:a,seq:e,trace_id:i,data:A}=t,r=this.cache.get(o);if(r)r.buffer[e]=A;else{let g=new Array(a).fill(void 0);g[e]=A,this.cache.set(o,{buffer:g,trace_id:i,message_id:o,create_time:Date.now()})}let s=this.cache.get(o);if(s?.buffer.every(g=>!!g)){let g=s.buffer.reduce((p,B)=>{let f=new Uint8Array(p.byteLength+B.byteLength);return f.set(p,0),f.set(B,p.length),f},new Uint8Array([])),c=new TextDecoder("utf-8").decode(g),I=JSON.parse(c);return this.deleteCache(o),I}return null}deleteCache(t){this.cache.delete(t)}clearAtInterval(){if(this.timer)return;let t=1e4;this.timer=setInterval(()=>{let o=Date.now();this.cache.forEach((a,e)=>{var i;let{create_time:A,trace_id:r,message_id:s}=a;o-A>t&&((i=this.logger)===null||i===void 0||i.debug(`${s} event data is deleted as expired, trace_id: ${r}`),this.deleteCache(e))})},t),typeof this.timer.unref=="function"&&this.timer.unref()}destroy(){this.timer&&(clearInterval(this.timer),this.timer=void 0),this.cache.clear()}},TC;(function(n){n[n.ok=0]="ok",n[n.system_busy=1]="system_busy",n[n.forbidden=403]="forbidden",n[n.auth_failed=514]="auth_failed",n[n.internal_error=1000040343]="internal_error",n[n.exceed_conn_limit=1000040350]="exceed_conn_limit"})(TC||(TC={}));var NC;(function(n){n[n.control=0]="control",n[n.data=1]="data"})(NC||(NC={}));var RC;(function(n){n.type="type",n.message_id="message_id",n.sum="sum",n.seq="seq",n.trace_id="trace_id",n.biz_rt="biz_rt",n.handshake_status="handshake-status",n.handshake_msg="handshake-msg",n.handshake_autherrcode="handshake-autherrcode"})(RC||(RC={}));var Xd;(function(n){n.event="event",n.card="card",n.ping="ping",n.pong="pong"})(Xd||(Xd={}));var ES;(function(n){n[n.ok=200]="ok",n[n.internal_server_error=500]="internal_server_error"})(ES||(ES={}));var uS=class{constructor(t){var o;this.wsConfig=new pP,this.reconnectGeneration=0,this.pendingWsInstance=null,this.isConnecting=!1,this.reconnectInfo={lastConnectTime:0,nextConnectTime:0},this.hasEverConnected=!1,this.terminalError=!1,this.currentReconnectAttempts=0;let{appId:a,appSecret:e,clientAssertionProvider:i,agent:A,domain:r=bs.Feishu,httpInstance:s=eh,loggerLevel:g=Eo.info,logger:c=Pg,autoReconnect:I=!0,source:p,extraUaTags:B,onReady:f,onError:Q,onReconnecting:y,onReconnected:m,handshakeTimeoutMs:T,wsConfig:_}=t;if(this.userAgent=_P(p,{extraTags:B}),this.logger=new Uc(g,c),IS(!a,()=>this.logger.error("appId is needed")),!e&&!i)throw new na(RP,"appSecret or clientAssertionProvider is required");this.agent=A,this.dataCache=new dP({logger:this.logger}),this.httpInstance=s,this.wsConfig.updateClient({appId:a,appSecret:e||"",clientAssertionProvider:i,domain:P6(r)}),this.wsConfig.updateWs({autoReconnect:I}),this.onReady=f,this.onError=Q,this.onReconnecting=y,this.onReconnected=m,this.handshakeTimeoutMs=T,this.pingTimeoutSec=(o=_?.pingTimeout)!==null&&o!==void 0?o:0}armLiveness(){this.pingTimeoutSec&&(this.livenessTimer&&clearTimeout(this.livenessTimer),this.livenessTimer=setTimeout(()=>{var t;this.livenessTimer=void 0,this.logger.warn("[ws]",`no pong/inbound within ${this.pingTimeoutSec}s of last ping, terminating to trigger reconnect`);try{(t=this.wsConfig.getWSInstance())===null||t===void 0||t.terminate()}catch{}},this.pingTimeoutSec*1e3))}clearLiveness(){this.livenessTimer&&(clearTimeout(this.livenessTimer),this.livenessTimer=void 0)}safeInvoke(t,o,...a){if(o)try{o(...a)}catch(e){this.logger.error(`[ws] ${t} callback threw`,e)}}pullConnectConfig(){return h(this,void 0,void 0,function*(){let{appId:t,appSecret:o,clientAssertionProvider:a,domain:e}=this.wsConfig.getClient(),i="/callback/ws/endpoint",A=this.wsConfig.wsConfigUrl,r={locale:"zh","User-Agent":this.userAgent},s={AppID:t};try{if(a){let Q=vP(e),y=yield a.retrieveToken(Q);if(!y||!y.value)throw new na(NP,"client assertion token is empty");s.AppSecret="",s.ClientAssertion=y.value,y.targetInfo&&(A=GP(y.targetInfo,i),r[TP]=Q)}else s.AppSecret=o;let{code:g,data:{URL:c,ClientConfig:I},msg:p}=yield this.httpInstance.request({method:"post",url:A,data:s,headers:r,timeout:15e3});if(g!==TC.ok){let Q=g===TC.system_busy?"system busy":p;return this.logger.error("[ws]",`code: ${g}, ${Q}`),g===TC.internal_error?{ok:!1,retryable:!0}:{ok:!1,retryable:!1,error:`pullConnectConfig failed: code=${g}, msg=${Q}`}}let{device_id:B,service_id:f}=cRe.parse(c);return this.wsConfig.updateWs({connectUrl:c,deviceId:B,serviceId:f,pingInterval:I.PingInterval*1e3,reconnectCount:I.ReconnectCount,reconnectInterval:I.ReconnectInterval*1e3,reconnectNonce:I.ReconnectNonce*1e3}),this.logger.debug("[ws]",`get connect config success, ws url: ${c}`),{ok:!0}}catch(g){return this.logger.error("[ws]",g?.message||"system busy"),g instanceof na?{ok:!1,retryable:!1,error:g.message}:{ok:!1,retryable:!0}}})}connect(){let t=this.wsConfig.getWS("connectUrl"),o;try{let{agent:a}=this;o=new Jo(t,{agent:a})}catch{this.logger.error("[ws]","new WebSocket error")}return o?(this.pendingWsInstance=o,new Promise(a=>{let e=!1,i,A=r=>{e||(e=!0,i&&clearTimeout(i),this.pendingWsInstance===o&&(this.pendingWsInstance=null),a(r))};this.handshakeTimeoutMs&&this.handshakeTimeoutMs>0&&(i=setTimeout(()=>{this.logger.error("[ws]",`handshake timeout after ${this.handshakeTimeoutMs}ms`),o.removeAllListeners("open");try{o.terminate()}catch{}A(!1)},this.handshakeTimeoutMs)),o.on("open",()=>{this.logger.debug("[ws]","ws connect success"),this.wsConfig.setWSInstance(o),this.pingLoop(),A(!0)}),o.on("error",()=>{this.logger.error("[ws]","ws connect failed"),A(!1)})})):Promise.resolve(!1)}reConnect(t=!1){return h(this,void 0,void 0,function*(){if(this.isConnecting&&!t){this.logger.debug("[ws]","repeat connection");return}this.isConnecting=!0;let o=++this.reconnectGeneration,a=()=>h(this,void 0,void 0,function*(){if(o!==this.reconnectGeneration)return{ok:!1,retryable:!1,cancelled:!0};this.reconnectInfo.lastConnectTime=Date.now();let c=yield this.pullConnectConfig();if(o!==this.reconnectGeneration)return{ok:!1,retryable:!1,cancelled:!0};if(!c.ok)return c;let I=yield this.connect();return o!==this.reconnectGeneration?{ok:!1,retryable:!1,cancelled:!0}:I?(this.communicate(),{ok:!0}):{ok:!1,retryable:!0}});this.pingInterval&&clearTimeout(this.pingInterval),this.reconnectInterval&&clearTimeout(this.reconnectInterval);let e=this.wsConfig.getWSInstance();if(t){e&&e?.terminate();let c={ok:!1,retryable:!0};try{c=yield a()}finally{o===this.reconnectGeneration&&(this.isConnecting=!1)}if(o!==this.reconnectGeneration||c.cancelled)return;if(c.ok)this.hasEverConnected=!0,this.safeInvoke("onReady",this.onReady);else if(c.retryable)this.logger.error("[ws]","connect failed"),yield this.reConnect();else{this.hasEverConnected=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(c.error));return}this.logger.info("[ws]","ws client ready");return}let{autoReconnect:i,reconnectNonce:A,reconnectCount:r,reconnectInterval:s}=this.wsConfig.getWS();if(!i){this.hasEverConnected||(this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error("WebSocket connect failed and autoReconnect is disabled")));return}this.logger.info("[ws]","reconnect"),this.hasEverConnected&&this.safeInvoke("onReconnecting",this.onReconnecting),e&&e?.terminate(),this.wsConfig.setWSInstance(null);let g=A?A*Math.random():0;this.reconnectInterval=setTimeout(()=>h(this,void 0,void 0,function*(){(function c(I){return h(this,void 0,void 0,function*(){if(o!==this.reconnectGeneration)return;I++,this.currentReconnectAttempts=I;let p=yield a();if(o===this.reconnectGeneration){if(p.ok){this.logger.debug("[ws]","reconnect success"),this.currentReconnectAttempts=0,this.hasEverConnected?this.safeInvoke("onReconnected",this.onReconnected):(this.hasEverConnected=!0,this.safeInvoke("onReady",this.onReady)),this.isConnecting=!1;return}if(!p.retryable){this.isConnecting=!1,this.hasEverConnected=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(p.error));return}if(this.logger.info("ws",`unable to connect to the server after trying ${I} times")`),r>=0&&I>=r){this.isConnecting=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(`WebSocket reconnect exhausted after ${I} attempts`));return}this.reconnectInterval=setTimeout(()=>{c.bind(this)(I)},s),this.reconnectInfo.nextConnectTime=Date.now()+s}})}).bind(this)(0)}),g),this.reconnectInfo.nextConnectTime=Date.now()+g})}pingLoop(){let{serviceId:t,pingInterval:o}=this.wsConfig.getWS(),a=this.wsConfig.getWSInstance();if(a?.readyState===Jo.OPEN){let e={headers:[{key:RC.type,value:Xd.ping}],service:Number(t),method:NC.control,SeqID:0,LogID:0};this.sendMessage(e),this.armLiveness(),this.logger.trace("[ws]","ping success")}this.pingInterval=setTimeout(this.pingLoop.bind(this),o)}communicate(){let t=this.wsConfig.getWSInstance();t?.on("message",o=>h(this,void 0,void 0,function*(){this.clearLiveness();let a=FRe(o),{method:e}=a;e===NC.control&&(yield this.handleControlData(a)),e===NC.data&&(yield this.handleEventData(a))})),t?.on("error",o=>{this.logger.error("[ws]","ws error")}),t?.on("close",()=>{this.logger.debug("[ws]","client closed"),this.clearLiveness(),this.reConnect()})}handleControlData(t){var o;return h(this,void 0,void 0,function*(){let a=(o=t.headers.find(i=>i.key===RC.type))===null||o===void 0?void 0:o.value,e=t.payload;if(a!==Xd.ping&&a===Xd.pong&&e){this.logger.trace("[ws]","receive pong");let i=new TextDecoder("utf-8").decode(e),{PingInterval:A,ReconnectCount:r,ReconnectInterval:s,ReconnectNonce:g}=JSON.parse(i);this.wsConfig.updateWs({pingInterval:A*1e3,reconnectCount:r,reconnectInterval:s*1e3,reconnectNonce:g*1e3}),this.logger.trace("[ws]","update wsConfig with pong data")}})}handleEventData(t){var o;return h(this,void 0,void 0,function*(){let a=t.headers.reduce((f,Q)=>(f[Q.key]=Q.value,f),{}),{message_id:e,sum:i,seq:A,type:r,trace_id:s}=a,g=t.payload;if(r!==Xd.event)return;let c=this.dataCache.mergeData({message_id:e,sum:Number(i),seq:Number(A),trace_id:s,data:g});if(!c)return;this.logger.debug("[ws]",`receive message, message_type: ${r}; message_id: ${e}; trace_id: ${s}; data: ${c.data}`);let I={code:ES.ok},p=Date.now();try{let f=yield(o=this.eventDispatcher)===null||o===void 0?void 0:o.invoke(c,{needCheck:!1});f&&(I.data=Buffer.from(JSON.stringify(f)).toString("base64"))}catch(f){I.code=ES.internal_server_error,this.logger.error("[ws]",`invoke event failed, message_type: ${r}; message_id: ${e}; trace_id: ${s}; error: ${f}`)}let B=Date.now();this.sendMessage(Object.assign(Object.assign({},t),{headers:[...t.headers,{key:RC.biz_rt,value:String(p-B)}],payload:new TextEncoder().encode(JSON.stringify(I))}))})}sendMessage(t){var o;let a=this.wsConfig.getWSInstance();if(a?.readyState===Jo.OPEN){let e=K6.Frame.encode(t).finish();(o=this.wsConfig.getWSInstance())===null||o===void 0||o.send(e,i=>{i&&this.logger.error("[ws]","send data failed")})}}getReconnectInfo(){return this.reconnectInfo}getConnectionStatus(){return{state:this.computeState(),lastConnectTime:this.reconnectInfo.lastConnectTime||void 0,nextConnectTime:this.reconnectInfo.nextConnectTime||void 0,reconnectAttempts:this.currentReconnectAttempts}}computeState(){var t;return this.terminalError?"failed":this.isConnecting&&!this.hasEverConnected?"connecting":this.isConnecting&&this.hasEverConnected?"reconnecting":((t=this.wsConfig.getWSInstance())===null||t===void 0?void 0:t.readyState)===Jo.OPEN?"connected":"idle"}close(t={}){let{force:o=!1}=t;this.reconnectGeneration++,this.pingInterval&&(clearTimeout(this.pingInterval),this.pingInterval=void 0),this.reconnectInterval&&(clearTimeout(this.reconnectInterval),this.reconnectInterval=void 0),this.clearLiveness(),this.dataCache.destroy(),this.isConnecting=!1,this.currentReconnectAttempts=0;let a=this.pendingWsInstance;if(a){this.pendingWsInstance=null,a.removeAllListeners("open");try{o?a.terminate():a.close()}catch{}}let e=this.wsConfig.getWSInstance();e&&(e.removeAllListeners(),o?e.terminate():e.close(),this.wsConfig.setWSInstance(null)),this.logger.info("[ws]",`ws client closed manually${o?" (force)":""}`)}start(t){return h(this,void 0,void 0,function*(){let{appId:o}=this.wsConfig.getClient();if(!/^cli_[0-9a-fA-F]{16}$/.test(o)){this.logger.error("[ws]",`invalid appId: ${o}`);return}let{eventDispatcher:a}=t;if(!a){this.logger.warn("[ws]","client need to start with a eventDispatcher");return}let e=this.wsConfig.getWSInstance();if(this.terminalError&&(this.isConnecting=!1),this.isConnecting||e&&e.readyState!==Jo.CLOSED){this.logger.debug("[ws]","start ignored because client is already connecting or connected");return}this.terminalError=!1,this.currentReconnectAttempts=0,this.dataCache.clearAtInterval(),this.logger.info("[ws]",`receive events or callbacks through persistent connection only available in self-build & Feishu app, Configured in: +`+i)}}catch{}}throw a}}_request(t,o){typeof t=="string"?(o=o||{},o.url=t):o=t||{},o=Tn(this.defaults,o);let{transitional:a,paramsSerializer:e,headers:i}=o;a!==void 0&&Vu.assertOptions(a,{silentJSONParsing:oa.transitional(oa.boolean),forcedJSONParsing:oa.transitional(oa.boolean),clarifyTimeoutError:oa.transitional(oa.boolean),legacyInterceptorReqResOrdering:oa.transitional(oa.boolean),advertiseZstdAcceptEncoding:oa.transitional(oa.boolean),validateStatusUndefinedResolves:oa.transitional(oa.boolean)},!1),e!=null&&(Z.isFunction(e)?o.paramsSerializer={serialize:e}:Vu.assertOptions(e,{encode:oa.function,serialize:oa.function},!0)),o.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?o.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:o.allowAbsoluteUrls=!0),Vu.assertOptions(o,{baseUrl:oa.spelling("baseURL"),withXsrfToken:oa.spelling("withXSRFToken")},!0),o.method=(o.method||this.defaults.method||"get").toLowerCase();let A=i&&Z.merge(i.common,i[o.method]);i&&Z.forEach(["delete","get","head","post","put","patch","query","common"],f=>{delete i[f]}),o.headers=Yt.concat(A,i);let r=[],s=!0;this.interceptors.request.forEach(function(Q){if(typeof Q.runWhen=="function"&&Q.runWhen(o)===!1)return;s=s&&Q.synchronous;let y=o.transitional||bc;y&&y.legacyInterceptorReqResOrdering?r.unshift(Q.fulfilled,Q.rejected):r.push(Q.fulfilled,Q.rejected)});let g=[];this.interceptors.response.forEach(function(Q){g.push(Q.fulfilled,Q.rejected)});let c,I=0,p;if(!s){let f=[zu.bind(this),void 0];for(f.unshift(...r),f.push(...g),p=f.length,c=Promise.resolve(o);Izu.call(this,B)))}catch(m){c=Promise.reject(m)}break}}if(!c)try{c=zu.call(this,B)}catch(f){c=Promise.reject(f)}for(I=0,p=g.length;I{if(!a._listeners)return;let i=a._listeners.length;for(;i-- >0;)a._listeners[i](e);a._listeners=null}),this.promise.then=e=>{let i,A=new Promise(r=>{a.subscribe(r),i=r}).then(e);return A.cancel=function(){a.unsubscribe(i)},A},t(function(i,A,r){a.reason||(a.reason=new Io(i,A,r),o(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let o=this._listeners.indexOf(t);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){let t=new AbortController,o=a=>{t.abort(a)};return this.subscribe(o),t.signal.unsubscribe=()=>this.unsubscribe(o),t.signal}static source(){let t;return{token:new n(function(e){t=e}),cancel:t}}},A8=uN;function CN(n){return function(o){return n.apply(null,o)}}function BN(n){return Z.isObject(n)&&n.isAxiosError===!0}var fN={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(fN).forEach(([n,t])=>{fN[t]=n});var t8=fN;function r8(n){let t=new Wu(n),o=Su(Wu.prototype.request,t);return Z.extend(o,Wu.prototype,t,{allOwnKeys:!0}),Z.extend(o,t,null,{allOwnKeys:!0}),o.create=function(e){return r8(Tn(n,e))},o}var Rr=r8(md);Rr.Axios=Wu;Rr.CanceledError=Io;Rr.CancelToken=A8;Rr.isCancel=Pu;Rr.VERSION=mg;Rr.toFormData=Oc;Rr.AxiosError=Oe;Rr.Cancel=Rr.CanceledError;Rr.all=function(t){return Promise.all(t)};Rr.spread=CN;Rr.isAxiosError=BN;Rr.mergeConfig=Tn;Rr.AxiosHeaders=Yt;Rr.formToJSON=n=>qy(Z.isHTMLForm(n)?new FormData(n):n);Rr.getAdapter=rm.getAdapter;Rr.HttpStatusCode=t8;Rr.default=Rr;var am=Rr;var{Axios:ElA,AxiosError:QN,CanceledError:ulA,isCancel:ClA,CancelToken:BlA,VERSION:flA,all:QlA,Cancel:ylA,isAxiosError:mlA,spread:SlA,toFormData:wlA,AxiosHeaders:DlA,HttpStatusCode:OlA,formToJSON:blA,getAdapter:MlA,mergeConfig:_lA,create:TlA}=am;var E=ze(W8()),b=ze(X8()),M=ze(vz()),N6=ze(cV());import it from"fs";import _C from"path";import nS from"crypto";import cRe from"querystring";var zNe=ze(aW(),1),VNe=ze(Jm(),1),WNe=ze(Yd(),1),ZNe=ze(bR(),1),XNe=ze(TR(),1),$Ne=ze(GR(),1),dW=ze(Wm(),1),eRe=ze(pW(),1);var Jo=dW.default;import{gzipSync as IRe}from"zlib";import lRe from"http";import pRe from"https";import{promises as dRe}from"dns";import{isIP as R6}from"net";function Y(n,t){var o={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&t.indexOf(a)<0&&(o[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var e=0,a=Object.getOwnPropertySymbols(n);e=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function S(n){return this instanceof S?(this.v=n,this):new S(n)}function j(n,t,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(n,t||[]),e,i=[];return e={},A("next"),A("throw"),A("return"),e[Symbol.asyncIterator]=function(){return this},e;function A(p){a[p]&&(e[p]=function(B){return new Promise(function(f,Q){i.push([p,B,f,Q])>1||r(p,B)})})}function r(p,B){try{s(a[p](B))}catch(f){I(i[0][3],f)}}function s(p){p.value instanceof S?Promise.resolve(p.value.v).then(g,c):I(i[0][2],p)}function g(p){r("next",p)}function c(p){r("throw",p)}function I(p,B){p(B),i.shift(),i.length&&r(i[0][0],i[0][1])}}function p6(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],o;return t?t.call(n):(n=typeof l6=="function"?l6(n):n[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(i){o[i]=n[i]&&function(A){return new Promise(function(r,s){A=n[i](A),e(r,s,A.done,A.value)})}}function e(i,A,r,s){Promise.resolve(s).then(function(g){i({value:g,done:r})},A)}}var rS;function hRe(){if(rS!==void 0)return rS;let n=[_C.resolve(__dirname,"..","package.json"),_C.resolve(__dirname,"..","..","package.json")];for(let t of n)try{let o=JSON.parse(it.readFileSync(t,"utf-8"));if(o.name==="@larksuiteoapi/node-sdk"&&typeof o.version=="string")return rS=o.version,o.version}catch{}return rS="unknown","unknown"}function d6(n){return n.replace(/[^a-zA-Z0-9._-]/g,"_").slice(0,64)}function _P(n,t){let o=`oapi-node-sdk/${hRe()}`;if(n){let a=d6(n);a&&(o+=` source/${a}`)}if(t?.extraTags)for(let a of t.extraTags){let e=d6(a);e&&(o+=` ${e}`)}return o}var eh=am.create(),ERe=_P();eh.interceptors.request.use(n=>(n.headers&&!n.headers["User-Agent"]&&(n.headers["User-Agent"]=ERe),n),void 0,{synchronous:!0});eh.interceptors.response.use(n=>n.config.$return_headers?{data:n.data,headers:n.headers}:n.data);var Os;(function(n){n[n.SelfBuild=0]="SelfBuild",n[n.ISV=1]="ISV"})(Os||(Os={}));var bs;(function(n){n[n.Feishu=0]="Feishu",n[n.Lark=1]="Lark"})(bs||(bs={}));var Eo;(function(n){n[n.fatal=0]="fatal",n[n.error=1]="error",n[n.warn=2]="warn",n[n.info=3]="info",n[n.debug=4]="debug",n[n.trace=5]="trace"})(Eo||(Eo={}));var sS=Symbol("event-type"),gS=Symbol("tenant-key"),kC=Symbol("app-ticket"),MC=Symbol("tenant-access-token"),k6=Symbol("with-helpdesk-authorization"),v6=Symbol("with-user-access-token"),uRe=Symbol("user-access-token"),h6=Symbol("aily-session-record"),CRe=n=>Buffer.from(n).toString("base64"),cS=class{constructor(){this.values=new Map}getCacheKey(t,o){return o?`${o}/${t.toString()}`:t}get(t,o){return h(this,void 0,void 0,function*(){let a=this.getCacheKey(t,o?.namespace),e=this.values.get(a);if(e){let{value:i,expiredTime:A}=e;if(!A||A-new Date().getTime()>0)return i}})}set(t,o,a,e){return h(this,void 0,void 0,function*(){let i=this.getCacheKey(t,e?.namespace);return this.values.set(i,{value:o,expiredTime:a}),!0})}},PC=new cS,vC=class{constructor(t){let o=nS.createHash("sha256");o.update(t),this.key=o.digest()}decrypt(t){let o=Buffer.from(t,"base64"),a=nS.createDecipheriv("aes-256-cbc",this.key,o.slice(0,16)),e=a.update(o.slice(16).toString("hex"),"hex","utf8");return e+=a.final("utf8"),e}},P6=n=>{switch(n){case bs.Feishu:return"https://open.feishu.cn";case bs.Lark:return"https://open.larksuite.com";default:return n}},u=(n,t={})=>n.replace(/:([^/]+)/g,(o,a)=>{if(t[a]!==void 0)return t[a];throw new Error(`request miss ${a} path argument`)}),IS=(n,t)=>h(void 0,void 0,void 0,function*(){(typeof n=="function"?n():n)&&(yield t())}),BRe=n=>n?n.replace(/^\//,""):"",iS=(n,t=[])=>{let o={};return n&&t.forEach(a=>{Object.prototype.hasOwnProperty.call(n,a)&&(o[a]=n[a])}),o},C=n=>{var t;if(n instanceof QN){let{message:o,response:a,request:e,config:i}=iS(n,["message","response","request","config"]),r=[{message:o,config:iS(i,["data","url","params","method"]),request:iS(e,["protocol","host","path","method"]),response:iS(a,["data","status","statusText"])}],s=(t=n?.response)===null||t===void 0?void 0:t.data;return s&&(typeof s=="object"?r.push(Object.assign(Object.assign({},s),s.error?s.error:{})):r.push(s)),r}return[n]},Ak=class{constructor(){this.acs={accessRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},device:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/devices`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},accessRecordAccessPhoto:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/access_records/:access_record_id/access_photo`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},user:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userFace:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"PUT",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},ruleExternal:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deviceBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external/device_bind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},visitor:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/visitors/:visitor_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/visitors`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{accessRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/access_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},device:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/devices`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},accessRecordAccessPhoto:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/access_records/:access_record_id/access_photo`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},user:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userFace:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/users/:user_id/face`,A),method:"PUT",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},ruleExternal:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deviceBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external/device_bind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/rule_external`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},visitor:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/visitors/:visitor_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/acs/v1/visitors`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},tk=class extends Ak{constructor(){super(...arguments),this.admin={badgeGrant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},badge:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},password:{reset:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/password/reset`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},badgeImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badge_images`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},auditInfo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},adminUserStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/admin_user_stats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},adminDeptStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/admin_dept_stats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{badgeGrant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants/:grant_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id/grants`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},badge:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges/:badge_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badges`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},password:{reset:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/password/reset`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},badgeImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/badge_images`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},auditInfo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/audit_infos`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},adminUserStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/admin_user_stats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},adminDeptStat:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/admin/v1/admin_dept_stats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},rk=class extends tk{constructor(){super(...arguments),this.aily_rag={}}},ik=class extends rk{constructor(){super(...arguments),this.aily={v1:{ailySession:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appDataAssetTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_asset_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_asset_tags`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appSkill:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),start:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills/:skill_id/start`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/skills/:skill_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appKnowledge:{ask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/knowledges/ask`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appDataAsset:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadFile:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/upload_file`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},ailySessionRun:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs/:run_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs/:run_id/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/runs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ailySessionAilyMessage:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages/:aily_message_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/sessions/:aily_session_id/messages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentAgentVisibility:{check:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/agent_visibility/check`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentAgentAttachment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/attachments`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},tenantAppStat:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/app_stats`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/app_stats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentAgentChat:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/chats/:agent_chat_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/chats`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentAgentChatSession:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions/:agent_chat_session_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions/:agent_chat_session_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/sessions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentAgentArtifact:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/aily/v1/agents/:agent_id/artifacts/:agent_artifact_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},ak=class extends ik{constructor(){super(...arguments),this.apaas={v1:{approvalTask:{addAssignee:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/add_assignee`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),agree:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/agree`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transfer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/transfer`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reject:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/approval_tasks/:approval_task_id/reject`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationObjectRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/:id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/:object_api_name/records/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationObject:{oqlQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/oql_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/objects/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationFunction:{invoke:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/functions/:function_api_name/invoke`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationRoleMember:{batchRemoveAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member/batch_remove_authorization`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreateAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/roles/:role_api_name/member/batch_create_authorization`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationRecordPermissionMember:{batchCreateAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/record_permissions/:record_permission_api_name/member/batch_create_authorization`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchRemoveAuthorization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/record_permissions/:record_permission_api_name/member/batch_remove_authorization`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationEnvironmentVariable:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/environment_variables/:environment_variable_api_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/environment_variables/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userTask:{expediting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/expediting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),chatGroup:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/chat_group`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),rollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/rollback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),rollbackPoints:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/user_tasks/:task_id/rollback_points`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/user_task/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationFlow:{execute:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/flows/:flow_id/execute`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approvalInstance:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/approval_instances/:approval_instance_id/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationAuditLog:{auditLogList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/audit_log_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),dataChangeLogsList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/data_change_logs_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),dataChangeLogDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/applications/:namespace/audit_log/data_change_log_detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},seatAssignment:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/seat_assignments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/seat_assignments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},seatActivity:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/seat_activities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/seat_activities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},app:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/apps`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/apps`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workspaceTable:{recordsBatchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records_batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recordsDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recordsPatch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recordsGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recordsPost:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name/records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),tableGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/tables/:table_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workspace:{sqlCommands:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/sql_commands`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workspaceView:{viewsGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/views/:view_name/records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workspaceEnum:{enumGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/enums/:enum_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/workspaces/:workspace_id/enums`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tenantAppMetrics:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/apaas/v1/tenant_app_metrics/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},ok=class extends ak{constructor(){super(...arguments),this.application={applicationAppUsage:{overview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/overview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),messagePushOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/message_push_overview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),departmentOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/department_overview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationFeedback:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appRecommendRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},application:{contactsRangeConfiguration:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range_configuration`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),underauditlistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),underauditlist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationAppVersion:{contactsRangeSuggest:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationVisibility:{checkWhiteBlackList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationContactsRange:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationCollaborators:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationOwner:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/owner`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationManagement:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/management`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},scope:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/scopes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/scopes/apply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appBadge:{set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/app_badge/set`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v5:{application:{favouriteWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v5/applications/favourite`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),favourite:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v5/applications/favourite`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recommendWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v5/applications/recommend`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),recommend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v5/applications/recommend`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v6:{applicationAppUsage:{overview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/overview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),messagePushOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/message_push_overview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),departmentOverview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_usage/department_overview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationFeedback:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/feedbacks/:feedback_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appRecommendRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/app_recommend_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},application:{contactsRangeConfiguration:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range_configuration`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),underauditlistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),underauditlist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/underauditlist`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationAppVersion:{contactsRangeSuggest:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id/contacts_range_suggest`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions/:version_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/app_versions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationVisibility:{checkWhiteBlackList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility/check_white_black_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationContactsRange:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationCollaborators:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/collaborators`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationOwner:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/owner`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationManagement:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/applications/:app_id/management`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},scope:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/scopes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/scopes/apply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appBadge:{set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v6/app_badge/set`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v7:{applicationBase:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v7/applications/:app_id/base`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationPublish:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v7/applications/:app_id/publish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appAvatarUpload:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v7/app_avatar/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},applicationConfig:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v7/applications/:app_id/config`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},applicationAbility:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/application/v7/applications/:app_id/ability`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},nk=class extends ok{constructor(){super(...arguments),this.approval={instance:{specifiedRollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/specified_rollback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/add_sign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/search_cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/preview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/remind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/add_cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/recall`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),detail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),initiatedWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),initiated:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},task:{transfer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/transfer`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reject:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/reject`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),resubmit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/resubmit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),approve:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/approve`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),refuse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/refuse`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),pass:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/pass`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/add_sign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),rollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/rollback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approval:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals/:approval_code`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},instanceComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/:comment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalInstance:{check:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_instances/check`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_instances`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalApproval:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_approvals/:approval_code`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_approvals`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},district:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v4:{instance:{specifiedRollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/specified_rollback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/add_sign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/search_cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/preview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/remind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addCc:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/add_cc`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/recall`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),detail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),initiatedWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),initiated:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/initiated`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/subscription`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},task:{transfer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/transfer`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reject:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/reject`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),resubmit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/resubmit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),approve:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/approve`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),refuse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/refuse`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),pass:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/pass`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addSign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/add_sign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),rollback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/rollback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/tasks/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approval:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals/:approval_code/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/approvals/:approval_code`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},instanceComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/:comment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/instances/:instance_id/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalInstance:{check:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_instances/check`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_instances`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalApproval:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_approvals/:approval_code`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/external_approvals`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},district:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/approval/v4/districts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},sk=class extends nk{constructor(){super(...arguments),this.attendance_machine={}}},gk=class extends sk{constructor(){super(...arguments),this.attendance={file:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/files/:file_id/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/files/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},group:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/:group_id/list_user`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userDailyShift:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreateTemp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create_temp`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userTaskRemedy:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_task_remedys`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryUserAllowedRemedys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},shift:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userStatsField:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_fields/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userStatsView:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_views/:user_stats_view_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_views/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approvalInfo:{process:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/approval_infos/process`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userSetting:{modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_settings/modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_settings/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userStatsData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_datas/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},archiveRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),userStatsFieldsQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule/user_stats_fields_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule/del_report`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule/upload_report`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leaveEmployExpireRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/leave_employ_expire_records/:leave_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leaveAccrualRecord:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/leave_accrual_record/:leave_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userFlow:{batchDel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/batch_del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/:user_flow_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userApproval:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_approvals`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_approvals/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userTask:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_tasks/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{file:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/files/:file_id/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/files/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},group:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/:group_id/list_user`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/groups/:group_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userDailyShift:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreateTemp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_daily_shifts/batch_create_temp`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userTaskRemedy:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_task_remedys`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryUserAllowedRemedys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query_user_allowed_remedys`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_task_remedys/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},shift:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts/:shift_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/shifts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userStatsField:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_fields/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userStatsView:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_views/:user_stats_view_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_views/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approvalInfo:{process:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/approval_infos/process`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userSetting:{modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_settings/modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_settings/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userStatsData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_stats_datas/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},archiveRule:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),userStatsFieldsQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule/user_stats_fields_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule/del_report`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadReport:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/archive_rule/upload_report`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leaveEmployExpireRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/leave_employ_expire_records/:leave_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leaveAccrualRecord:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/leave_accrual_record/:leave_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userFlow:{batchDel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/batch_del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_flows/:user_flow_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userApproval:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_approvals`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_approvals/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userTask:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/attendance/v1/user_tasks/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},ck=class extends gk{constructor(){super(...arguments),this.audio_video_ai={}}},Ik=class extends ck{constructor(){super(...arguments),this.auth={appAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/app_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/app_access_token/internal`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tenantAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/tenant_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTicket:{resend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v3:{appAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/app_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/app_access_token/internal`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tenantAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/tenant_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),internal:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTicket:{resend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},lk=class extends Ik{constructor(){super(...arguments),this.authen={userInfo:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/user_info`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},accessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},refreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/refresh_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},oidcAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/oidc/access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},oidcRefreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/oidc/refresh_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{userInfo:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/user_info`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},accessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},refreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/refresh_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},oidcAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/oidc/access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},oidcRefreshAccessToken:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/authen/v1/oidc/refresh_access_token`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},pk=class extends lk{constructor(){super(...arguments),this.authz={}}},dk=class extends pk{constructor(){super(...arguments),this.aweme_ecosystem={}}},hk=class extends dk{constructor(){super(...arguments),this.baike={entity:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/match`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),highlight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/highlight`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),extract:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/extract`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},classification:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},file:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/files/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/files/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},draft:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/drafts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/drafts/:draft_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{entity:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/match`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),highlight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/highlight`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),extract:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/extract`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/entities/:entity_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},classification:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/classifications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},file:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/files/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/files/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},draft:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/drafts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/baike/v1/drafts/:draft_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Ek=class extends hk{constructor(){super(...arguments),this.base={v2:{appRole:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/base/v2/apps/:app_token/roles/:role_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},uk=class extends Ek{constructor(){super(...arguments),this.bitable={appTable:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appDashboard:{copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},app:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableRecord:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appRoleMember:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableView:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableForm:{upgrade:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/upgrade`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableFieldGroup:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/field_groups`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableFormField:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appWorkflow:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows/:workflow_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appBlockWorkflow:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/block_workflows`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{appTable:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appDashboard:{copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards/:block_id/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/dashboards`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},app:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableRecord:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records/:record_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appRoleMember:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles/:role_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableView:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views/:view_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/views`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableForm:{upgrade:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/upgrade`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableFieldGroup:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/field_groups`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableFormField:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields/:field_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/forms/:form_id/fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appWorkflow:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows/:workflow_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/workflows`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appTableField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields/:field_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id/fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appBlockWorkflow:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bitable/v1/apps/:app_token/block_workflows`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Ck=class extends uk{constructor(){super(...arguments),this.block={entity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/block/v2/entities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/block/v2/entities/:block_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/block/v2/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v2:{entity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/block/v2/entities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/block/v2/entities/:block_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/block/v2/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Bk=class extends Ck{constructor(){super(...arguments),this.board={v1:{whiteboardNode:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createPlantuml:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes/plantuml`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/nodes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},whiteboard:{downloadAsImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/download_as_image`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),theme:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/theme`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateTheme:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/board/v1/whiteboards/:whiteboard_id/update_theme`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},fk=class extends Bk{constructor(){super(...arguments),this.bot={v4:{bot:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/bot/v4/bot/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/bot/v4/bot/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Qk=class extends fk{constructor(){super(...arguments),this.c360={}}},yk=class extends Qk{constructor(){super(...arguments),this.calendar={exchangeBinding:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/exchange_bindings`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendar:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),primarys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/primarys`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),primary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/primary`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarAcl:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/reply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),instances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/instances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),instanceView:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/instance_view`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventAttendee:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},setting:{generateCaldavConf:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/settings/generate_caldav_conf`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},timeoffEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/timeoff_events/:timeoff_event_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/timeoff_events`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventMeetingMinute:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_minute`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventMeetingChat:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},freebusy:{batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/freebusy/batch`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/freebusy/list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventAttendeeChatMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v4:{exchangeBinding:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/exchange_bindings/:exchange_binding_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/exchange_bindings`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendar:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),primarys:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/primarys`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),primary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/primary`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarAcl:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls/:acl_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/acls`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/reply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),instances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/instances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),instanceView:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/instance_view`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventAttendee:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},setting:{generateCaldavConf:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/settings/generate_caldav_conf`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},timeoffEvent:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/timeoff_events/:timeoff_event_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/timeoff_events`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventMeetingMinute:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_minute`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventMeetingChat:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/meeting_chat`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},freebusy:{batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/freebusy/batch`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/freebusy/list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},calendarEventAttendeeChatMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/calendar/v4/calendars/:calendar_id/events/:event_id/attendees/:attendee_id/chat_members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},mk=class extends yk{constructor(){super(...arguments),this.cardkit={v1:{card:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),settings:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/settings`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),idConvert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/id_convert`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},cardElement:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),content:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id/content`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements/:element_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/cardkit/v1/cards/:card_id/elements`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Sk=class extends mk{constructor(){super(...arguments),this.ccm_unified_resource={}}},wk=class extends Sk{constructor(){super(...arguments),this.collab_plugins={}}},Dk=class extends wk{constructor(){super(...arguments),this.comment_sdk={}}},Ok=class extends Dk{constructor(){super(...arguments),this.compensation={v1:{indicator:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/indicators`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/indicators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},socialPlan:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/social_plans/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/social_plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/social_plans`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},item:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/items`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/items`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},plan:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/plans`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},socialInsurance:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/social_insurances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},itemCategory:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/item_categories`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/item_categories`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},changeReason:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/change_reasons`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/change_reasons`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},archive:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/archives`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/archives/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},recurringPayment:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/recurring_payment/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/recurring_payment/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/recurring_payment/batch_remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},socialArchive:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/social_archive/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},socialArchiveAdjustRecord:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/social_archive_adjust_record/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},lumpSumPayment:{batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryDetailWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query_detail`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/compensation/v1/lump_sum_payment/query_detail`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},bk=class extends Ok{constructor(){super(...arguments),this.contact={group:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),memberBelong:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/member_belong`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),simplelistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},unit:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/list_department`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unbindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/unbind_department`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),bindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/bind_department`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},groupMember:{simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/simplelist`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),add:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/add`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchAdd:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_add`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateDepartmentId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id/update_department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unbindDepartmentChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/unbind_department_chat`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),parentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),parent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),childrenWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),children:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/batch`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobLevel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFamily:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},user:{updateUserId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id/update_user_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),resurrect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id/resurrect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/batch_get_id`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),findByDepartmentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),findByDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),basicBatch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/basic_batch`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/batch`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeeTypeEnum:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},functionalRoleMember:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/:member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),scopes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/scopes`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},functionalRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobTitle:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_titles/:job_title_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workCity:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/work_cities/:work_city_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},scope:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customAttr:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v3:{group:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),memberBelong:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/member_belong`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),simplelistWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/simplelist`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},unit:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/list_department`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unbindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/unbind_department`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/:unit_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),bindDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit/bind_department`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/unit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},groupMember:{simplelist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/simplelist`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),add:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/add`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchRemove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchAdd:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/group/:group_id/member/batch_add`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateDepartmentId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id/update_department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unbindDepartmentChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/unbind_department_chat`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),parentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),parent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/parent`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),childrenWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),children:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id/children`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/batch`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/departments/:department_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobLevel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_levels/:job_level_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFamily:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_families/:job_family_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},user:{updateUserId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id/update_user_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),resurrect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id/resurrect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/batch_get_id`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),findByDepartmentWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),findByDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/find_by_department`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/:user_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),basicBatch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/basic_batch`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/users/batch`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeeTypeEnum:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/employee_type_enums/:enum_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},functionalRoleMember:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/:member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_delete`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),scopes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/scopes`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},functionalRole:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/functional_roles/:role_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobTitle:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_titles/:job_title_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/job_titles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workCity:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/work_cities/:work_city_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/work_cities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},scope:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/scopes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customAttr:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/contact/v3/custom_attrs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Mk=class extends bk{constructor(){super(...arguments),this.content_check={}}},_k=class extends Mk{constructor(){super(...arguments),this.contract={}}},Tk=class extends _k{constructor(){super(...arguments),this.corehr={contract:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},company:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeeType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},nationalIdType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},subregion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subregions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subregions/:subregion_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},countryRegion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/country_regions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/country_regions/:country_region_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},subdivision:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subdivisions/:subdivision_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subdivisions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},preHire:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},person:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobLevel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFamily:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},job:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobChange:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_changes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workingHoursType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},location:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/files/:id`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},processFormVariableData:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/processes/:process_id/form_variable_data`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},commonDataId:{convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/common_data/id/convert`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leaveGrantingRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leave_granting_records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leave:{leaveTypes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/leave_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),workCalendar:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),workCalendarDate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar_date`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),calendarByScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/calendar_by_scope`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leaveBalances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/leave_balances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leaveRequestHistory:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/leave_request_history`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offboarding:{submit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/submit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},securityGroup:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/security_groups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/security_groups/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customField:{listObjectApiName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/custom_fields/list_object_api_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/custom_fields/get_by_param`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/custom_fields/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},commonDataMetaData:{editEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/edit_enum_option`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/add_enum_option`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},authorization:{updateRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/update_role_assign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/remove_role_assign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/add_role_assign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/get_by_param`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},assignedUser:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/assigned_users/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobData:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},currency:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/currencies`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/currencies/:currency_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},transferReason:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/transfer_reasons/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},transferType:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/transfer_types/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},compensationStandard:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/compensation_standards/match`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{contract:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts/:contract_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/contracts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},company:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies/:company_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/companies`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeeType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employee_types/:employee_type_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},nationalIdType:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types/:national_id_type_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/national_id_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},subregion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subregions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subregions/:subregion_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},countryRegion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/country_regions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/country_regions/:country_region_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},subdivision:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subdivisions/:subdivision_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/subdivisions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},preHire:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/pre_hires/:pre_hire_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},person:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons/:person_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/persons`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/employments/:employment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobLevel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_levels/:job_level_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFamily:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_families/:job_family_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},job:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs/:job_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/jobs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobChange:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_changes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workingHoursType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/working_hours_types/:working_hours_type_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},department:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments/:department_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/departments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},location:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/locations/:location_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/files/:id`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},processFormVariableData:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/processes/:process_id/form_variable_data`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},commonDataId:{convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/common_data/id/convert`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leaveGrantingRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leave_granting_records/:leave_granting_record_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leave_granting_records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},leave:{leaveTypes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/leave_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),workCalendar:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),workCalendarDate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/work_calendar_date`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),calendarByScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/calendar_by_scope`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leaveBalances:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/leave_balances`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leaveRequestHistory:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/leaves/leave_request_history`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offboarding:{submit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/submit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/offboardings/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},securityGroup:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/security_groups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/security_groups/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customField:{listObjectApiName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/custom_fields/list_object_api_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/custom_fields/get_by_param`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/custom_fields/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},commonDataMetaData:{editEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/edit_enum_option`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addEnumOption:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/common_data/meta_data/add_enum_option`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},authorization:{updateRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/update_role_assign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/remove_role_assign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addRoleAssign:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/add_role_assign`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByParam:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/get_by_param`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/authorizations/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},assignedUser:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/assigned_users/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobData:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas/:job_data_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/job_datas`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},currency:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/currencies`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/currencies/:currency_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},transferReason:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/transfer_reasons/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},transferType:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/transfer_types/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},compensationStandard:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v1/compensation_standards/match`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{costCenter:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/query_multi_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),tree:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/tree`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoCountryRegionSubdivision:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/country_region_subdivisions/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/country_region_subdivisions/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},probation:{submit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/submit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),withdraw:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/withdraw`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),enableDisableAssessment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/enable_disable_assessment`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),edit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/edit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},probationAssessment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/assessments/:assessment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/assessments/:assessment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/probation/assessments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customOrg:{deleteOrg:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/delete_org`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/active`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/:org_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateRule:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/update_rule`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_orgs/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},preHire:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transitTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id/transit_task`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),withdrawOnboarding:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/withdraw_onboarding`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),restoreFlowInstance:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/restore_flow_instance`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transformOnboardingTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/transform_onboarding_task`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),complete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id/complete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/:pre_hire_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pre_hires/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobGrade:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_grades/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_grades/:job_grade_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_grades/:job_grade_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_grades`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_grades/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_grades/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},position:{active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions/active`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delPosition:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions/del_position`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/positions/:position_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeesBp:{batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/bps/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},bp:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/bps`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/bps`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByDepartment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/bps/get_by_department`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeesAdditionalJob:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/:additional_job_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/:additional_job_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/batch`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/additional_jobs/batch`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoNationality:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/nationalities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/nationalities/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoCountryRegion:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/country_regions/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/country_regions/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoCity:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/cities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/cities/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoDistrict:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/districts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/districts/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoBank:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/banks/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/banks/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoCurrency:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/currencies/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/currencies/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeeCustomOrg:{del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_org/del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createEmpCustomOrg:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_org/create_emp_custom_org`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),editEmpCustomOrg:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_org/edit_emp_custom_org`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),employmentCustomOrgRecord:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_org/employment_custom_org_record`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),querybyid:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/custom_org/querybyid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},signatureFile:{listByBizId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files/list_by_biz_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files/:signature_file_id/download`,A),method:"POST",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),terminate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files/terminate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_files`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},signatureNode:{listByFileId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_nodes/list_by_file_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},company:{active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/companies/active`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/companies/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/companies/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/companies/query_multi_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/companies/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},department:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryOperationLogsWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryOperationLogs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/:department_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/:department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/query_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/query_multi_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),parents:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/parents`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),tree:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/departments/tree`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},draft:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/drafts/:draft_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approvalGroups:{openQueryPositionChangeListByIds:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_position_change_list_by_ids`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/approval_groups/:process_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),openQueryJobChangeListByIds:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_job_change_list_by_ids`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),openQueryDepartmentChangeListByIds:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/approval_groups/open_query_department_change_list_by_ids`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},location:{active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/active`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/query_multi_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/:location_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},locationAddress:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses/:address_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses/:address_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/locations/:location_id/addresses`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoLanguage:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/languages/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/languages/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoTimeZone:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/time_zones/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/time_zones/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reportDetailRow:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/report_detail_row/batchDelete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchSave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/report_detail_row/batchSave`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workforcePlanDetailRow:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/workforce_plan_detail_row/batchDelete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchSave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/workforce_plan_detail_row/batchSave`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offboarding:{submitV2:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/offboardings/submit_v2`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),edit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/offboardings/edit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),revoke:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/offboardings/revoke`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},basicInfoBankBranch:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/bank_branchs/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/basic_info/bank_branchs/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},enum:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/enums/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},process:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),flowVariableData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes/:process_id/flow_variable_data`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes/:process_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processApprover:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes/:process_id/approvers/:approver_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processWithdraw:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/process_withdraw/:process_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},approver:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/approvers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/approvers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processTransfer:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes/:process_id/transfer`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processExtra:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes/:process_id/extra`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobLevel:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_levels/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_levels/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_levels/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFamily:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_families/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_families/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_families/query_multi_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_families/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},job:{queryRecentChangeWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/jobs/query_recent_change`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),queryRecentChange:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/jobs/query_recent_change`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryMultiTimeline:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/jobs/query_multi_timeline`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/jobs/:job_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/jobs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/jobs/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeesInternationalAssignment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/international_assignments/:international_assignment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/international_assignments/:international_assignment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/international_assignments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processFormVariableData:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/processes/:process_id/form_variable_data`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},pathway:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pathways`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pathways/:pathway_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pathways/:pathway_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),active:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pathways/active`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/pathways/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processStart:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/process_start`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},costAllocation:{batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_allocations/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_allocations/update_version`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_allocations/create_version`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_allocations/remove_version`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},costCenterVersion:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions/:version_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/cost_centers/:cost_center_id/versions/:version_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processQueryFlowDataTemplate:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/query_flow_data_template`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},defaultCostCenter:{createVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/default_cost_centers/create_version`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/default_cost_centers/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/default_cost_centers/remove_version`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateVersion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/default_cost_centers/update_version`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},processRevoke:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/process_revoke/:process_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},signatureTemplateInfoWithThumbnail:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_template_info_with_thumbnails`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_template_info_with_thumbnails`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobChange:{revoke:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_changes/:job_change_id/revoke`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_changes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_changes/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/job_changes/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},contract:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/contracts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/contracts/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workforcePlanDetail:{batch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/workforce_plan_details/batch`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchV2:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/workforce_plan_details/batch_v2`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employee:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},signatureTemplate:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/signature_templates/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employeesJobData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/job_datas/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/employees/job_datas/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},person:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/persons/:person_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/persons`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workforcePlan:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/workforce_plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/corehr/v2/workforce_plans`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Nk=class extends Tk{constructor(){super(...arguments),this.data_cube={}}},Rk=class extends Nk{constructor(){super(...arguments),this.device={}}},kk=class extends Rk{constructor(){super(...arguments),this.directory={v1:{employee:{resurrect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/:employee_id/resurrect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),regular:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/:employee_id/regular`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),toBeResigned:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/:employee_id/to_be_resigned`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/:employee_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/:employee_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),filter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/filter`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/employees/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},collaborationTenant:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_tenants`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_tenants`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},collaborationRule:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_rules`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_rules`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},collborationShareEntity:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/share_entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/share_entities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},department:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/departments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/departments/:department_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/departments/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/departments/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/departments/:department_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),filter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/directory/v1/departments/filter`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},vk=class extends kk{constructor(){super(...arguments),this.docs_ai={}}},Pk=class extends vk{constructor(){super(...arguments),this.docs_tool={}}},Gk=class extends Pk{constructor(){super(...arguments),this.docs={v1:{content:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docs/v1/content`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Fk=class extends Gk{constructor(){super(...arguments),this.document_ai={v1:{businessCard:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/business_card/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},contract:{fieldExtraction:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/contract/field_extraction`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},businessLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/business_license/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},drivingLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/driving_license/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},vehicleLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/vehicle_license/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},foodManageLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/food_manage_license/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},foodProduceLicense:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/food_produce_license/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},hkmMainlandTravelPermit:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/hkm_mainland_travel_permit/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},chinesePassport:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/chinese_passport/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},twMainlandTravelPermit:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/tw_mainland_travel_permit/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},healthCertificate:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/health_certificate/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},vehicleInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/vehicle_invoice/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},resume:{parse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/resume/parse`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},bankCard:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/bank_card/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},trainInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/train_invoice/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},taxiInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/taxi_invoice/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},vatInvoice:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/vat_invoice/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},idCard:{recognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/document_ai/v1/id_card/recognize`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})}}}}},Lk=class extends Fk{constructor(){super(...arguments),this.docx={document:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),rawContent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/raw_content`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/blocks/convert`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncementBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},documentBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncement:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncementBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},documentBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},documentBlockDescendant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/descendant`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{document:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),rawContent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/raw_content`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),convert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/blocks/convert`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncementBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id/children`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},documentBlockChildren:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/children`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncement:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncementBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/chats/:chat_id/announcement/blocks/:block_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},documentBlock:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},documentBlockDescendant:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/docx/v1/documents/:document_id/blocks/:block_id/descendant`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Uk=class extends Lk{constructor(){super(...arguments),this.drive={file:{createFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/create_folder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/move`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createShortcut:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/create_shortcut`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_part`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),taskCheck:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/task_check`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deleteSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/delete_subscribe`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/get_subscribe`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_prepare`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_finish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_all`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meta:{batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/metas/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileSubscription:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},exportTask:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/export_tasks/file/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/export_tasks/:ticket`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/export_tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileVersion:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileViewRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileStatistics:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/statistics`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionPublicPassword:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},media:{batchGetTmpDownloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_part`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_finish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_all`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_prepare`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},importTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/import_tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},user:{subscriptionStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/user/subscription_status`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeSubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/user/remove_subscription`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/user/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileCommentReply:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionPublic:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionMember:{batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transferOwner:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/transfer_owner`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),auth:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/auth`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{file:{createFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/create_folder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/move`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createShortcut:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/create_shortcut`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_part`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),taskCheck:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/task_check`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deleteSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/delete_subscribe`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getSubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/get_subscribe`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_prepare`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_finish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/upload_all`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meta:{batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/metas/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileSubscription:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions/:subscription_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/subscriptions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},exportTask:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/export_tasks/file/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/export_tasks/:ticket`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/export_tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileVersion:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileViewRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/view_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileStatistics:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/statistics`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionPublicPassword:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public/password`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileComment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},media:{batchGetTmpDownloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_part`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadFinish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_finish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadAll:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_all`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadPrepare:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/medias/upload_prepare`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},importTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/import_tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},user:{subscriptionStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/user/subscription_status`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeSubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/user/remove_subscription`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/user/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},fileCommentReply:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies/:reply_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionPublic:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/public`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionMember:{batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transferOwner:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/transfer_owner`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),auth:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members/auth`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v1/permissions/:token/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{fileLike:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v2/files/:file_token/likes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v2/files/:file_token/likes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},commentReaction:{updateReaction:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v2/files/:file_token/comments/reaction`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},permissionPublic:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v2/permissions/:token/public`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/drive/v2/permissions/:token/public`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Hk=class extends Uk{constructor(){super(...arguments),this.ea_symphony={}}},Kk=class extends Hk{constructor(){super(...arguments),this.edu={}}},xk=class extends Kk{constructor(){super(...arguments),this.ehr={attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/ehr/v1/attachments/:token`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},employee:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/ehr/v1/attachments/:token`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},employee:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/ehr/v1/employees`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Yk=class extends xk{constructor(){super(...arguments),this.elearning={}}},jk=class extends Yk{constructor(){super(...arguments),this.event={outboundIp:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},connection:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/event/v1/connection`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{outboundIp:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/event/v1/outbound_ip`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},connection:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/event/v1/connection`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Jk=class extends jk{constructor(){super(...arguments),this.exam={}}},qk=class extends Jk{constructor(){super(...arguments),this.face_detection={}}},zk=class extends qk{constructor(){super(...arguments),this.financial_access_platform={}}},Vk=class extends zk{constructor(){super(...arguments),this.grounding={}}},Wk=class extends Vk{constructor(){super(...arguments),this.gtm_ai={}}},Zk=class extends Wk{constructor(){super(...arguments),this.helpdesk={agent:{agentEmail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_emails`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSchedule:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSkill:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSkillRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skill_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},category:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},event:{subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/events/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/events/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},faq:{faqImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id/image/:image_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSchedules:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ticket:{customizedFields:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/customized_fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),ticketImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_images`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),startService:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/start_service`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),answerUserQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ticketCustomizedField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},notification:{cancelApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancelSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),executeSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/execute_send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/preview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),submitApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ticketMessage:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},botMessage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{agent:{agentEmail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_emails`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSchedule:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_schedules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSkill:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills/:agent_skill_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skills`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSkillRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agent_skill_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},category:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/categories/:id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},event:{subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/events/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/events/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},faq:{faqImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id/image/:image_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/faqs/:id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agentSchedules:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/agents/:agent_id/schedules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ticket:{customizedFields:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/customized_fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),ticketImage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_images`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),startService:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/start_service`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),answerUserQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/answer_user_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ticketCustomizedField:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields/:ticket_customized_field_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/ticket_customized_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},notification:{cancelApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_approve`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancelSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/cancel_send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),executeSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/execute_send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/preview`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),submitApprove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id/submit_approve`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/notifications/:notification_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ticketMessage:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/tickets/:ticket_id/messages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},botMessage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/helpdesk/v1/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Xk=class extends Zk{constructor(){super(...arguments),this.hire={websiteChannel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRoundType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_round_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerCustomField:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_custom_fields/:offer_custom_field_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteDelivery:{createByAttachment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_attachment`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createByResume:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_resume`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRecordAttachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records/attachments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talent:{batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/batch_get_id`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),onboardStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/onboard_status`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/add_to_folder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),tag:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/tag`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/remove_to_folder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/combined_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/combined_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalInterviewAssessment:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interview_assessments/:external_interview_assessment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interview_assessments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},referralWebsiteJobPost:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts/:job_post_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},job:{config:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/config`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),close:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/close`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateConfig:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/update_config`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),open:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/open`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recruiter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/recruiter`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/combined_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/combined_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/get_detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},location:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/locations/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalReferralReward:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_referral_rewards`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_referral_rewards/:external_referral_reward_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},note:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerApprovalTemplate:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_approval_templates`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},website:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},examMarkingTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},referral:{getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referrals/get_by_application`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referrals/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},exam:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/exams`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobRequirementSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirement_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoAccountCustomField:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentExternalInfo:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},questionnaire:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/questionnaires`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoExamPaper:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exam_papers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offer:{internOfferStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id/intern_offer_status`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),offerStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id/offer_status`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoBackgroundCheck:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_checks/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_result`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_progress`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agency:{protect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/protect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/:agency_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),protectSearch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/protection_period/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),operateAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/operate_agency_account`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/get_agency_account`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentPool:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchChangeTalentPool:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/batch_change_talent_pool`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),moveTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/talent_relationship`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},diversityInclusion:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/diversity_inclusions/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoExam:{loginInfo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/login_info`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/update_result`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},terminationReason:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobManager:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/:manager_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobPublishRecord:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_publish_records/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteJobPost:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/:job_post_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobType:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalApplication:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoBackgroundCheckCustomField:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},application:{transferStage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_stage`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recover:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/recover`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),terminate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/terminate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transferOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_onboard`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),offer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/offer`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancelOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/cancel_onboard`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/get_detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},registrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},role:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/roles/:role_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records/:interview_record_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewer:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviewers/:interviewer_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentFolder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interview:{getByTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviews/get_by_talent`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviews`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},referralAccount:{enable:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/enable`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),withdraw:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/withdraw`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deactivate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/deactivate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reconciliation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/reconciliation`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getAccountAssets:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/get_account_assets`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ehrImportTask:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteDeliveryTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/delivery_tasks/:delivery_task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentObject:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_objects/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFunction:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},advertisement:{publish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/advertisements/:advertisement_id/publish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerSchema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_schemas/:offer_schema_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id/preview`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/attachments`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},applicationInterview:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/interviews`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteSiteUser:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/site_users`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tripartiteAgreement:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoBackgroundCheckPackage:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_packages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},resumeSource:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerApplicationForm:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_application_forms`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_application_forms/:offer_application_form_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentOperationLog:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_operation_logs/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userRole:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalInterview:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalBackgroundCheck:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},todo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalOffer:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentBlocklist:{changeTalentBlock:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_blocklist/change_talent_block`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},portalApplySchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRegistrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobRequirement:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listById:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},backgroundCheckOrder:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/background_check_orders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/background_check_orders/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employee:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/employees/get_by_application`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},subject:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/subjects`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewFeedbackForm:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},evaluationTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},evaluation:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobProcess:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_processes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},minutes:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/minutes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},test:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{websiteChannel:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels/:channel_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/channels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRoundType:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_round_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerCustomField:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_custom_fields/:offer_custom_field_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteDelivery:{createByAttachment:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_attachment`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),createByResume:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/deliveries/create_by_resume`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRecordAttachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records/attachments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talent:{batchGetId:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/batch_get_id`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),onboardStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/onboard_status`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/add_to_folder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),tag:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/tag`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeToFolder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/remove_to_folder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/combined_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/combined_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalInterviewAssessment:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interview_assessments/:external_interview_assessment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interview_assessments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},referralWebsiteJobPost:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts/:job_post_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_websites/job_posts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},job:{config:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/config`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),close:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/close`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateConfig:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/update_config`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),open:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/open`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recruiter:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/recruiter`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/combined_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),combinedCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/combined_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/get_detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},location:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/locations/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/locations`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalReferralReward:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_referral_rewards`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_referral_rewards/:external_referral_reward_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},note:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/notes/:note_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerApprovalTemplate:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_approval_templates`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},website:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},examMarkingTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/exam_marking_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},referral:{getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referrals/get_by_application`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referrals/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},exam:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/exams`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobRequirementSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirement_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoAccountCustomField:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_account_custom_fields/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentExternalInfo:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talents/:talent_id/external_info`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},questionnaire:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/questionnaires`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoExamPaper:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exam_papers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exam_papers/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offer:{internOfferStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id/intern_offer_status`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),offerStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id/offer_status`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offers/:offer_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoBackgroundCheck:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_checks/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_result`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_checks/update_progress`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},agency:{protect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/protect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/:agency_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),protectSearch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/protection_period/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),operateAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/operate_agency_account`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getAgencyAccount:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/agencies/get_agency_account`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentPool:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchChangeTalentPool:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/batch_change_talent_pool`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),moveTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_pools/:talent_pool_id/talent_relationship`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},diversityInclusion:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/diversity_inclusions/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoExam:{loginInfo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/login_info`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateResult:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_exams/:exam_id/update_result`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},terminationReason:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/termination_reasons`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobManager:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/jobs/:job_id/managers/:manager_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobPublishRecord:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_publish_records/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteJobPost:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/job_posts/:job_post_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobType:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_types`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalApplication:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_applications/:external_application_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoBackgroundCheckCustomField:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_custom_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},application:{transferStage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_stage`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recover:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/recover`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),terminate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/terminate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),transferOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/transfer_onboard`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),offer:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/offer`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancelOnboard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/cancel_onboard`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/get_detail`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},registrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/registration_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},role:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/roles/:role_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRecord:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records/:interview_record_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewer:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviewers/:interviewer_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviewers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentFolder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_folders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interview:{getByTalent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviews/get_by_talent`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interviews`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},referralAccount:{enable:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/enable`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),withdraw:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/withdraw`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deactivate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/:referral_account_id/deactivate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reconciliation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/reconciliation`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getAccountAssets:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/referral_account/get_account_assets`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ehrImportTask:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/ehr_import_tasks/:ehr_import_task_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteDeliveryTask:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/delivery_tasks/:delivery_task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentObject:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_objects/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobSchema:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobFunction:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_functions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},advertisement:{publish:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/advertisements/:advertisement_id/publish`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerSchema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_schemas/:offer_schema_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),preview:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/attachments/:attachment_id/preview`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/attachments`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},applicationInterview:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/applications/:application_id/interviews`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},websiteSiteUser:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/websites/:website_id/site_users`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tripartiteAgreement:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tripartite_agreements/:tripartite_agreement_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ecoBackgroundCheckPackage:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_packages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/eco_background_check_packages/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},resumeSource:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/resume_sources`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},offerApplicationForm:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_application_forms`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/offer_application_forms/:offer_application_form_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_tags`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentOperationLog:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_operation_logs/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userRole:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/user_roles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalInterview:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_interviews/:external_interview_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalBackgroundCheck:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/:external_background_check_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_background_checks/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},todo:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/todos`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},externalOffer:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQueryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers/:external_offer_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/external_offers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},talentBlocklist:{changeTalentBlock:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/talent_blocklist/change_talent_block`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},portalApplySchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/portal_apply_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRegistrationSchema:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_registration_schemas`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobRequirement:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listById:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_requirements/:job_requirement_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},backgroundCheckOrder:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/background_check_orders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/background_check_orders/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},employee:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getByApplication:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/employees/get_by_application`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/employees/:employee_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},subject:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/subjects`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewFeedbackForm:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_feedback_forms`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},evaluationTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluation_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},evaluation:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/evaluations`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewTask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/interview_tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},jobProcess:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/job_processes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},minutes:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/minutes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},test:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v1/tests/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{talent:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v2/talents/:talent_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},interviewRecord:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v2/interview_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v2/interview_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/hire/v2/interview_records/:interview_record_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},$k=class extends Xk{constructor(){super(...arguments),this.human_authentication={identity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/human_authentication/v1/identities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{identity:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/human_authentication/v1/identities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},ev=class extends $k{constructor(){super(...arguments),this.im={message:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),pushFollowUp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/push_follow_up`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),urgentApp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_app`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),urgentPhone:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_phone`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),urgentSms:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_sms`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mergeForward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/merge_forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),readUsers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/read_users`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),replyByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=i,g=Y(i,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:c,params:e,headers:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(C(I)),I})}),createByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=i,g=Y(i,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:c,params:e,headers:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(C(I)),I})}),updateByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=i,g=Y(i,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:c,params:e,headers:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(C(I)),I})})},batchMessage:{readUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/read_user`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/get_progress`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatMembers:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),isInChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/is_in_chat`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),meJoin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/me_join`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},pin:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins/:message_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chat:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),link:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/link`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatModeration:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatTab:{listTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sortTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deleteTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatTopNotice:{deleteTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),putTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncement:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatMenuTree:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sort:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree/sort`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatManagers:{deleteManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/delete_managers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/add_managers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatMenuItem:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},image:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/images/:image_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/images`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},messageReaction:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions/:reaction_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/reactions/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/files/:file_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/files`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},messageResource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/resources/:file_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},thread:{forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/threads/:thread_id/forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{message:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),pushFollowUp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/push_follow_up`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),urgentApp:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_app`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),urgentPhone:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_phone`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),urgentSms:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/urgent_sms`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mergeForward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/merge_forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),readUsers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/read_users`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),replyByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=i,g=Y(i,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reply`,A),method:"POST",data:c,params:e,headers:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(C(I)),I})}),createByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=i,g=Y(i,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages`,A),method:"POST",data:c,params:e,headers:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(C(I)),I})}),updateByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),{template_id:r,template_variable:s}=i,g=Y(i,["template_id","template_variable"]),c=Object.assign({msg_type:"interactive",content:JSON.stringify({type:"template",data:{template_id:r,template_variable:s}})},g);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id`,A),method:"PUT",data:c,params:e,headers:a,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{throw this.logger.error(C(I)),I})})},batchMessage:{readUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/read_user`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getProgress:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/batch_messages/:batch_message_id/get_progress`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatMembers:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),isInChat:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/is_in_chat`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),meJoin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members/me_join`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},pin:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins/:message_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/pins`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chat:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),link:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/link`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatModeration:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/moderation`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatTab:{listTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/list_tabs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sortTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/sort_tabs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),deleteTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/delete_tabs`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateTabs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs/update_tabs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/chat_tabs`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatTopNotice:{deleteTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/delete_top_notice`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),putTopNotice:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/top_notice/put_top_notice`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatAnnouncement:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/announcement`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatMenuTree:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sort:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree/sort`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatManagers:{deleteManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/delete_managers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addManagers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/managers/add_managers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatMenuItem:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},image:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/images/:image_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/images`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},messageReaction:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions/:reaction_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchQuery:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/reactions/batch_query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/reactions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},file:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/files/:file_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/files`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},messageResource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/messages/:message_id/resources/:file_key`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},thread:{forward:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v1/threads/:thread_id/forward`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{bizEntityTagRelation:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/biz_entity_tag_relation`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},urlPreview:{batchUpdate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/url_previews/batch_update`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appFeedCardBatch:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/app_feed_card/batch`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/app_feed_card/batch`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},feedCard:{botTimeSentive:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/feed_cards/bot_time_sentive`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/feed_cards/:feed_card_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tag:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/tags`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/tags/:tag_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chatButton:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/chat_button`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appFeedCard:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/app_feed_card`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},chat:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/chats/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/im/v2/chats/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Av=class extends ev{constructor(){super(...arguments),this.inline_platform={}}},tv=class extends Av{constructor(){super(...arguments),this.laps={}}},rv=class extends tv{constructor(){super(...arguments),this.lingo={v1:{file:{download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/files/:file_token/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/files/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},entity:{match:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/match`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),highlight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/highlight`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/entities/:entity_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},repo:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/repos`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},classification:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/classifications`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/classifications`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},draft:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/drafts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/lingo/v1/drafts/:draft_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},iv=class extends rv{constructor(){super(...arguments),this.llpp={}}},av=class extends iv{constructor(){super(...arguments),this.mail={mailgroupMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroupPermissionMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroup:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},publicMailboxMember:{clear:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroupAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},publicMailboxAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),accessibleMailboxes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/accessible_mailboxes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),profile:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/profile`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxAlias:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroupManager:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},publicMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeToRecycleBin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/remove_to_recycle_bin`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},user:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/users/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxMessage:{getByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/get_by_card`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sendStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/send_status`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/modify`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listThreadMessage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxThread:{batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxEvent:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscription`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxMailContact:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxLabel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxDraft:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancelScheduledSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/cancel_scheduled_send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id/send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxRule:{reorder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/reorder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxSetting:{sendAs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/send_as`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getSignatures:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/signatures`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxSentMessage:{getRecallDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxTemplate:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxTemplateAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id/attachments/download_url`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},multiEntity:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/multi_entity/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxFolder:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxMessageAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/attachments/download_url`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{mailgroupMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/:member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroupPermissionMember:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/:permission_member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroup:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},publicMailboxMember:{clear:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/clear`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroupAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases/:alias_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/aliases`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},publicMailboxAlias:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/aliases`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),accessibleMailboxes:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/accessible_mailboxes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),profile:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/profile`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxAlias:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases/:alias_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/aliases`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},mailgroupManager:{batchDelete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_delete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchCreate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers/batch_create`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/managers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},publicMailbox:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeToRecycleBin:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/remove_to_recycle_bin`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/public_mailboxes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},user:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/users/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxMessage:{getByCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/get_by_card`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sendStatus:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/send_status`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/modify`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listThreadMessage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/batch_get`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxThread:{batchModify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchTrash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/batch_trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),modify:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/modify`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),trash:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id/trash`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/threads/:thread_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxEvent:{unsubscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/unsubscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscribe:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscribe`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/event/subscription`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxMailContact:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts/:mail_contact_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/mail_contacts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxLabel:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/labels/:label_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxDraft:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),cancelScheduledSend:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/cancel_scheduled_send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),send:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id/send`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/drafts/:draft_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxRule:{reorder:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/reorder`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/rules/:rule_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxSetting:{sendAs:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/send_as`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getSignatures:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/settings/signatures`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxSentMessage:{getRecallDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),recall:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/recall`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxTemplate:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxTemplateAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/templates/:template_id/attachments/download_url`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},multiEntity:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/multi_entity/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxFolder:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders/:folder_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/folders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMailboxMessageAttachment:{downloadUrl:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mail/v1/user_mailboxes/:user_mailbox_id/messages/:message_id/attachments/download_url`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},ov=class extends av{constructor(){super(...arguments),this.mcp={}}},nv=class extends ov{constructor(){super(...arguments),this.mdm={userAuthDataRelation:{unbind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/unbind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),bind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/bind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{userAuthDataRelation:{unbind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/unbind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),bind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mdm/v1/user_auth_data_relations/bind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v3:{countryRegion:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mdm/v3/country_regions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},batchCountryRegion:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/mdm/v3/batch_country_region`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},sv=class extends nv{constructor(){super(...arguments),this.meeting_room={}}},gv=class extends sv{constructor(){super(...arguments),this.mindnote={}}},cv=class extends gv{constructor(){super(...arguments),this.minutes={v1:{minuteTranscript:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/transcript`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}})},minuteStatistics:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/statistics`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},minuteMedia:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/media`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},minute:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),artifacts:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/minutes/v1/minutes/:minute_token/artifacts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Iv=class extends cv{constructor(){super(...arguments),this.moments={post:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/moments/v1/posts/:post_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{post:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/moments/v1/posts/:post_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},lv=class extends Iv{constructor(){super(...arguments),this.myai_ai_extension={}}},pv=class extends lv{constructor(){super(...arguments),this.myai_assistant={}}},dv=class extends pv{constructor(){super(...arguments),this.myai_base_ai={}}},hv=class extends dv{constructor(){super(...arguments),this.myai_ccm_extension={}}},Ev=class extends hv{constructor(){super(...arguments),this.myai_data={}}},uv=class extends Ev{constructor(){super(...arguments),this.myai_im_extension={}}},Cv=class extends uv{constructor(){super(...arguments),this.myai_mail={}}},Bv=class extends Cv{constructor(){super(...arguments),this.myai_memory_reflection={}}},fv=class extends Bv{constructor(){super(...arguments),this.myai_scenario_summary={}}},Qv=class extends fv{constructor(){super(...arguments),this.myai_slides={}}},yv=class extends Qv{constructor(){super(...arguments),this.myai_url_extension={}}},mv=class extends yv{constructor(){super(...arguments),this.myai={}}},Sv=class extends mv{constructor(){super(...arguments),this.okr={review:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/reviews/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},periodRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/period_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},progressRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},period:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/periods`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/periods`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/periods/:period_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okr:{batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/okrs/batch_get`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userOkr:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/users/:user_id/okrs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},image:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/images/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})},v1:{review:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/reviews/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},periodRule:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/period_rules`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},progressRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records/:progress_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/progress_records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},period:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/periods`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/periods`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/periods/:period_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okr:{batchGet:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/okrs/batch_get`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userOkr:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/users/:user_id/okrs`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},image:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v1/images/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null})}},v2:{okrAlignment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/alignments/:alignment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/alignments/:alignment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrObjective:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),keyResultsPosition:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results_position`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),keyResultsWeight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results_weight`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrKeyResult:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrObjectiveAlignment:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/alignments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrCategory:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/categories`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/categories`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrCycle:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),objectivesWeight:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives_weight`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),objectivesPosition:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives_position`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrObjectiveKeyResult:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/key_results`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrKeyResultIndicator:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/indicators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrObjectiveIndicator:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/indicators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrCycleObjective:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/cycles/:cycle_id/objectives`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrIndicator:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/indicators/:indicator_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrObjectiveProgress:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/progresses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/objectives/:objective_id/progresses`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},okrKeyResultProgress:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/progresses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/okr/v2/key_results/:key_result_id/progresses`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},wv=class extends Sv{constructor(){super(...arguments),this.optical_char_recognition={image:{basicRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/optical_char_recognition/v1/image/basic_recognize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{image:{basicRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/optical_char_recognition/v1/image/basic_recognize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Dv=class extends wv{constructor(){super(...arguments),this.partner_ai={}}},Ov=class extends Dv{constructor(){super(...arguments),this.passport={session:{logout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/passport/v1/sessions/logout`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/passport/v1/sessions/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},password:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/passport/v1/password`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{session:{logout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/passport/v1/sessions/logout`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/passport/v1/sessions/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},password:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/passport/v1/password`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},bv=class extends Ov{constructor(){super(...arguments),this.payroll={v1:{datasourceRecord:{save:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/datasource_records/save`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/datasource_records/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/datasource_records/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},paymentDetail:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/payment_detail/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},paymentActivity:{archive:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/payment_activitys/archive`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/payment_activitys`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/payment_activitys`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},costAllocationPlan:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/cost_allocation_plans`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/cost_allocation_plans`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},paymentActivityDetail:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/payment_activity_details`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},datasource:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/datasources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/datasources`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},costAllocationDetail:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/cost_allocation_details`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/cost_allocation_details`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},costAllocationReport:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/cost_allocation_reports`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/cost_allocation_reports`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},paygroup:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/paygroups`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/paygroups`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},acctItem:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/acct_items`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/payroll/v1/acct_items`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Mv=class extends bv{constructor(){super(...arguments),this.people_admin={}}},_v=class extends Mv{constructor(){super(...arguments),this.people_ai={}}},Tv=class extends _v{constructor(){super(...arguments),this.people_bytedance={}}},Nv=class extends Tv{constructor(){super(...arguments),this.performance={v1:{reviewData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v1/review_datas/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},stageTask:{findByUserList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v1/stage_tasks/find_by_user_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),findByPage:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v1/stage_tasks/find_by_page`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},semester:{list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v1/semesters`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{reviewee:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/reviewees/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},additionalInformationsBatch:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/additional_informations/batch`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},metricDetail:{import:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_details/import`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_details/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},question:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/questions/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/questions/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},indicator:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/indicators/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/indicators/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},activity:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/activity/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},metricTag:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_tags`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_tags`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},metricField:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_fields/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},metricLib:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_libs/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reviewData:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/review_datas/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},metricTemplate:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/metric_templates/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userInfo:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/user_info/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reviewTemplate:{queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/review_templates/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/review_templates/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userGroupUserRel:{write:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/user_group_user_rels/write`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},additionalInformation:{import:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/additional_informations/import`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),queryWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/additional_informations/query`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/performance/v2/additional_informations/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Rv=class extends Nv{constructor(){super(...arguments),this.personal_settings={systemStatus:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchClose:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchOpen:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{systemStatus:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchClose:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_close`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchOpen:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/personal_settings/v1/system_statuses/:system_status_id/batch_open`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},kv=class extends Rv{constructor(){super(...arguments),this.profile={}}},vv=class extends kv{constructor(){super(...arguments),this.report={rule:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/report/v1/rules/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ruleView:{remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/report/v1/rules/:rule_id/views/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},task:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/report/v1/tasks/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{rule:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/report/v1/rules/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},ruleView:{remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/report/v1/rules/:rule_id/views/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},task:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/report/v1/tasks/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Pv=class extends vv{constructor(){super(...arguments),this.rule_engine={}}},Gv=class extends Pv{constructor(){super(...arguments),this.saasbi={}}},Fv=class extends Gv{constructor(){super(...arguments),this.scim={}}},Lv=class extends Fv{constructor(){super(...arguments),this.search_in_app={}}},Uv=class extends Lv{constructor(){super(...arguments),this.search={dataSource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},schema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},dataSourceItem:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},app:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/app`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},docWiki:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v2:{dataSource:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},message:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},schema:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/schemas/:schema_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},dataSourceItem:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/data_sources/:data_source_id/items/:item_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},app:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/app`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},docWiki:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/search/v2/doc_wiki/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Hv=class extends Uv{constructor(){super(...arguments),this.security_and_compliance={openapiLog:{listData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/openapi_logs/list_data`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMigration:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/:user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},multiGeoEntityTenant:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/multi_geo_entity/tenant`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{openapiLog:{listData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/openapi_logs/list_data`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},userMigration:{cancel:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/cancel`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/:user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/user_migrations`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},multiGeoEntityTenant:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v1/multi_geo_entity/tenant`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{deviceApplyRecord:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_apply_records/:device_apply_record_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},deviceRecord:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mine:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records/mine`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records/:device_record_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/security_and_compliance/v2/device_records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Kv=class extends Hv{constructor(){super(...arguments),this.security_plugin={}}},xv=class extends Kv{constructor(){super(...arguments),this.sheet_ai={}}},Yv=class extends xv{constructor(){super(...arguments),this.sheets={spreadsheet:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheet:{replace:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),moveDimension:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),find:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFilter:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFilterView:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFilterViewCondition:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFloatImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v3:{spreadsheet:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheet:{replace:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/replace`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),moveDimension:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/move_dimension`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),find:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/find`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFilter:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFilterView:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFilterViewCondition:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/filter_views/:filter_view_id/conditions/:condition_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spreadsheetSheetFloatImage:{create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/:float_image_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/sheets/v3/spreadsheets/:spreadsheet_token/sheets/:sheet_id/float_images/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},jv=class extends Yv{constructor(){super(...arguments),this.slides_ai={}}},Jv=class extends jv{constructor(){super(...arguments),this.slides={}}},qv=class extends Jv{constructor(){super(...arguments),this.spark={v1:{appTable:{deleteTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),postTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patchTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchUpdateTableRecords:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records_batch_update`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTableDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTableList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTableRecordList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/tables/:table_name/records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appEnum:{getEnumDetail:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/enums/:enum_name`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getEnumList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/enums`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appView:{getViewRecordList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/views/:view_name/records`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},appStorage:{upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage`,A),method:"GET",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadInitialize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/initialize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uploadPart:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/part`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadComplete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/storage/upload/complete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},app:{icon:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/icon`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),uploadHtmlCodeAndRelease:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/upload_and_release_html_code`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),getAppVisibility:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/access-scope`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),updateAppVisibility:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/access-scope`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sqlCommands:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id/sql_commands`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps/:app_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/apps`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},directoryUser:{idConvert:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/spark/v1/directory/user/id_convert`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},zv=class extends qv{constructor(){super(...arguments),this.speech_to_text={speech:{fileRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/speech_to_text/v1/speech/file_recognize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),streamRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/speech_to_text/v1/speech/stream_recognize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{speech:{fileRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/speech_to_text/v1/speech/file_recognize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),streamRecognize:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/speech_to_text/v1/speech/stream_recognize`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Vv=class extends zv{constructor(){super(...arguments),this.subscriptions={}}},Wv=class extends Vv{constructor(){super(...arguments),this.task={task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDeleteFollower:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_follower`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDeleteCollaborator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uncomplete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/uncomplete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),complete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/complete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskComment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskCollaborator:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskFollower:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers/:follower_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskReminder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDeleteFollower:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_follower`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),batchDeleteCollaborator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/batch_delete_collaborator`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),uncomplete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/uncomplete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),complete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/complete`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskComment:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments/:comment_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskCollaborator:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators/:collaborator_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/collaborators`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskFollower:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/followers/:follower_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskReminder:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v1/tasks/:task_id/reminders/:reminder_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{task:{tasklists:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/tasklists`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addDependencies:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_dependencies`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeDependencies:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_dependencies`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setAncestorTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/set_ancestor_task`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addReminders:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_reminders`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeReminders:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_reminders`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeTasklist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/remove_tasklist`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addTasklist:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/add_tasklist`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},comment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/comments/:comment_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/comments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/comments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/comments/:comment_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/comments/:comment_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/comments`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},section:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections/:section_guid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),tasksWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections/:section_guid/tasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),tasks:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections/:section_guid/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections/:section_guid`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections/:section_guid`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/sections`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tasklist:{tasks:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/tasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),addMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/add_members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),removeMembers:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/remove_members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customField:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),add:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/add`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tasklistActivitySubscription:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasklists/:tasklist_guid/activity_subscriptions/:activity_subscription_guid`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},attachment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/attachments/:attachment_guid`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/attachments/:attachment_guid`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),upload:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/attachments/upload`,A),method:"POST",data:i,params:e,headers:Object.assign(Object.assign({},a),{"Content-Type":"multipart/form-data"}),paramsSerializer:s=>(0,E.stringify)(s,{arrayFormat:"repeat"})}).catch(s=>{throw this.logger.error(C(s)),s});return r?.data||null}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/attachments`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/attachments`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customFieldOption:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/options/:option_guid`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/custom_fields/:custom_field_guid/options`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskV2:{taskSubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/task_v2/task_subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listRelatedTaskWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/task_v2/list_related_task`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),listRelatedTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/task_v2/list_related_task`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},taskSubtask:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/task/v2/tasks/:task_guid/subtasks`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Zv=class extends Wv{constructor(){super(...arguments),this.tenant={tenant:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/tenant/v2/tenant/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tenantProductAssignInfo:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/tenant/v2/tenant/assign_info_list/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v2:{tenant:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/tenant/v2/tenant/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},tenantProductAssignInfo:{query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/tenant/v2/tenant/assign_info_list/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Xv=class extends Zv{constructor(){super(...arguments),this.translation={text:{translate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/translation/v1/text/translate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),detect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/translation/v1/text/detect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{text:{translate:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/translation/v1/text/translate`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),detect:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/translation/v1/text/detect`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},$v=class extends Xv{constructor(){super(...arguments),this.trust_layer={}}},eP=class extends $v{constructor(){super(...arguments),this.trust_party={v1:{collaborationTenantCollaborationUser:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/collaboration_users/:target_user_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},collaborationTenantCollaborationDepartment:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/collaboration_departments/:target_department_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},collaborationTenant:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),visibleOrganization:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/trust_party/v1/collaboration_tenants/:target_tenant_key/visible_organization`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},AP=class extends eP{constructor(){super(...arguments),this.unified_kms_log={}}},tP=class extends AP{constructor(){super(...arguments),this.unified_kms={}}},rP=class extends tP{constructor(){super(...arguments),this.vault={}}},iP=class extends rP{constructor(){super(...arguments),this.vc={material:{uploadMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/materials/upload_meta`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/materials/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),pullMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/materials/pull_meta`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meetingRecording:{start:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/start`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),stop:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/stop`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setPermission:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},roomConfig:{del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setCheckboardAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/set_checkboard_access_code`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setRoomAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/set_room_access_code`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/set`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserve:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/apply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiVcMeeting:{getCommonReply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_common_reply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),doOperation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/do_operation`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTodoTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_todo_task`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),seedAiPullData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/seed_ai_pull_data`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),docBasedSuggestQuestion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/doc_based_suggest_question`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),callback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/callback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sectionSummary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/section_summary`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getRecap:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_recap`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchStepSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_step_summary_stream`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchSectionSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_section_summary_stream`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchRecapStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_recap_stream`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meeting:{end:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/end`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),kickout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/kickout`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setHost:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/set_host`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),invite:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/invite`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),changeName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/change_name`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listByNoWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),listByNo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiRoom:{joinOfflineMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/join_offline_meeting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reserveInstantEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/reserve_instant_event`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),helpSceneType:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/help_scene_type`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),joinMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),checkInSchedule:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/check_in_schedule`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),exit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/exit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),autoReleaseEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_release_event`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),autoWelcome:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_welcome`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),roomCalling:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/room_calling`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),joinMeetingNumber:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting_number`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leaveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/leave_meeting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiMm:{mediaParse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_parse`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),extensionBoarding:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/extension_boarding`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),querySuggestContext:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/query_suggest_context`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mediaBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_bind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiSip:{createEventCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_sip/create_event_card`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},alert:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiVc:{cardCallback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/card_callback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),startAnalysis:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/start_analysis`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/set_meeting_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),meetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/meeting_analyze`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchMeetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_analyze`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},report:{getDaily:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reports/get_daily`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTopUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reports/get_top_user`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},room:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},resourceReservationList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},participantQualityList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},roomLevel:{mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},scopeConfig:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),accessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/scope_config/access_code`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfigForm:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfigAdmin:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfigDisableInform:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfig:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reserveScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/reserve_scope`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},export:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/:task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),resourceReservationList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/resource_reservation_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),participantQualityList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/participant_quality_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),participantList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/participant_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),meetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/meeting_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meetingList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},participantList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meetingPullSubtitle:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},note:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unifiedNoteTranscriptWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),unifiedNoteTranscript:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/:note_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},recording:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/recordings/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/recordings/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},bot:{realtimeEndpoint:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/realtime/endpoint`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/leave`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),message:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),userActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/user_active_meeting`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),join:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/join`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),eventsWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),events:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{material:{uploadMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/materials/upload_meta`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),remove:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/materials/remove`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),pullMeta:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/materials/pull_meta`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meetingRecording:{start:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/start`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),stop:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/stop`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setPermission:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording/set_permission`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/recording`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},roomConfig:{del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setCheckboardAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/set_checkboard_access_code`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setRoomAccessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/set_room_access_code`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/query`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),set:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_configs/set`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserve:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),apply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/apply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserves/:reserve_id/get_active_meeting`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiVcMeeting:{getCommonReply:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_common_reply`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),doOperation:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/do_operation`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTodoTask:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_todo_task`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),seedAiPullData:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/seed_ai_pull_data`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),docBasedSuggestQuestion:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/doc_based_suggest_question`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),callback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/callback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),sectionSummary:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/section_summary`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getRecap:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/get_recap`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchStepSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_step_summary_stream`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchSectionSummaryStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_section_summary_stream`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchRecapStream:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc_meeting/fetch_recap_stream`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meeting:{end:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/end`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),kickout:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/kickout`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setHost:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/set_host`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),invite:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/invite`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),changeName:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/change_name`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listByNoWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),listByNo:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/list_by_no`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiRoom:{joinOfflineMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/join_offline_meeting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reserveInstantEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/reserve_instant_event`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),helpSceneType:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/help_scene_type`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),joinMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),checkInSchedule:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/check_in_schedule`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),exit:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/exit`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),autoReleaseEvent:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_release_event`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),autoWelcome:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/auto_welcome`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),roomCalling:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/room_calling`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),joinMeetingNumber:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/join_meeting_number`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leaveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_room/leave_meeting`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiMm:{mediaParse:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_parse`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),extensionBoarding:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/extension_boarding`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),querySuggestContext:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/query_suggest_context`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mediaBind:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/media_bind`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),query:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_mm/query`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiSip:{createEventCard:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_sip/create_event_card`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},alert:{listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/alerts`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},myAiVc:{cardCallback:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/card_callback`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),startAnalysis:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/start_analysis`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),setMeetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/set_meeting_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),meetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/meeting_analyze`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),fetchMeetingAnalyze:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/my_ai_vc/fetch_meeting_analyze`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},report:{getDaily:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reports/get_daily`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),getTopUser:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reports/get_top_user`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},room:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/rooms/:room_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},resourceReservationList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/resource_reservation_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},participantQualityList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_quality_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},roomLevel:{mget:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/mget`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/search`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),del:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/del`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels/:room_level_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/room_levels`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},scopeConfig:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/scope_config`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),accessCode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/scope_config/access_code`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfigForm:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/form`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfigAdmin:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/admin`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfigDisableInform:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id/disable_inform`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},reserveConfig:{patch:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/:reserve_config_id`,A),method:"PATCH",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),reserveScope:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/reserve_configs/reserve_scope`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},export:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/:task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),download:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/download`,A),method:"GET",headers:a,data:i,params:e,responseType:"stream",paramsSerializer:g=>(0,E.stringify)(g,{arrayFormat:"repeat"}),$return_headers:!0}).catch(g=>{throw this.logger.error(C(g)),g}),s=()=>{let g="The stream has already been consumed";if(!r.data.readable)throw this.logger.error(g),new Error(g)};return{writeFile:g=>h(this,void 0,void 0,function*(){return s(),new Promise((c,I)=>{let p=it.createWriteStream(g);p.on("finish",()=>{c(g)}),p.on("error",B=>{I(B)}),r.data.pipe(p)})}),getReadableStream:()=>(s(),r.data),headers:r.headers}}),resourceReservationList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/resource_reservation_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),participantQualityList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/participant_quality_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),participantList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/participant_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),meetingList:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/exports/meeting_list`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meetingList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meeting_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},participantList:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/participant_list`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},meetingPullSubtitle:{getWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/meetings/:meeting_id/pull_subtitle`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},note:{subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),unifiedNoteTranscriptWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),unifiedNoteTranscript:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/:note_id/unified_note_transcript`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/notes/:note_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},recording:{unsubscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/recordings/unsubscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),subscription:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/recordings/subscription`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},bot:{realtimeEndpoint:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/realtime/endpoint`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),leave:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/leave`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),message:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/message`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),userActiveMeeting:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/user_active_meeting`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),join:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/join`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),eventsWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),events:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/vc/v1/bots/events`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},aP=class extends iP{constructor(){super(...arguments),this.verification={v1:{verification:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/verification/v1/verification`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},oP=class extends aP{constructor(){super(...arguments),this.wiki={spaceSetting:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/setting`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spaceNode:{updateTitle:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),moveDocsToWiki:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spaceMember:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},space:{getNode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/get_node`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/tasks/:task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{node:{searchWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v1/nodes/search`,A),method:"POST",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v1/nodes/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}},v2:{spaceSetting:{update:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/setting`,A),method:"PUT",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spaceNode:{updateTitle:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/update_title`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),moveDocsToWiki:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/move_docs_to_wiki`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),copy:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/copy`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),move:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes/:node_token/move`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/nodes`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},spaceMember:{delete:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members/:member_id`,A),method:"DELETE",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id/members`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},space:{getNode:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/get_node`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),create:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces/:space_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})}),listWithIterator:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o),r=g=>h(this,void 0,void 0,function*(){return yield this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",headers:(0,M.default)(g.headers,b.default),params:(0,M.default)(g.params,b.default),data:i,paramsSerializer:I=>(0,E.stringify)(I,{arrayFormat:"repeat"})}).catch(I=>{this.logger.error(C(I))})});return{[Symbol.asyncIterator](){return j(this,arguments,function*(){let c=!0,I;for(;c;)try{let p=yield S(r({headers:a,params:Object.assign(Object.assign({},e),{page_token:I}),data:i})),B=p?.data||{},{has_more:f,page_token:Q,next_page_token:y}=B,m=Y(B,["has_more","page_token","next_page_token"]);yield yield S(m),c=!!f,I=Q||y}catch{yield yield S(null);break}})}}}),list:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/spaces`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},task:{get:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/wiki/v2/tasks/:task_id`,A),method:"GET",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},nP=class extends oP{constructor(){super(...arguments),this.workplace={workplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/workplace/v1/workplace_access_data/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workplaceBlockAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/workplace/v1/workplace_block_access_data/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customWorkplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/workplace/v1/custom_workplace_access_data/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},v1:{workplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/workplace/v1/workplace_access_data/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},workplaceBlockAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/workplace/v1/workplace_block_access_data/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})},customWorkplaceAccessData:{search:(t,o)=>h(this,void 0,void 0,function*(){let{headers:a,params:e,data:i,path:A}=yield this.formatPayload(t,o);return this.httpInstance.request({url:u(`${this.domain}/open-apis/workplace/v1/custom_workplace_access_data/search`,A),method:"POST",data:i,params:e,headers:a,paramsSerializer:r=>(0,E.stringify)(r,{arrayFormat:"repeat"})}).catch(r=>{throw this.logger.error(C(r)),r})})}}}}},Pg={error:(...n)=>{console.log("[error]:",...n)},warn:(...n)=>{console.warn("[warn]:",...n)},info:(...n)=>{console.info("[info]:",...n)},debug:(...n)=>{console.debug("[debug]:",...n)},trace:(...n)=>{console.trace("[trace]:",...n)}},Uc=class{constructor(t,o){this.level=t,this.logger=o}error(...t){this.level>=Eo.error&&this.logger.error(t)}warn(...t){this.level>=Eo.warn&&this.logger.warn(t)}info(...t){this.level>=Eo.info&&this.logger.info(t)}debug(...t){this.level>=Eo.debug&&this.logger.debug(t)}trace(...t){this.level>=Eo.trace&&this.logger.trace(t)}},sP=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.cache=t.cache,this.domain=t.domain,this.logger=t.logger,this.appType=t.appType,this.httpInstance=t.httpInstance,this.logger.debug("app ticket manager is ready"),this.checkAppTicket()}checkAppTicket(){var t;return h(this,void 0,void 0,function*(){this.appType===Os.ISV&&((yield(t=this.cache)===null||t===void 0?void 0:t.get(kC,{namespace:this.appId}))||this.requestAppTicket())})}requestAppTicket(){return h(this,void 0,void 0,function*(){this.logger.debug("request app ticket"),yield this.httpInstance.post(`${this.domain}/open-apis/auth/v3/app_ticket/resend`,{app_id:this.appId,app_secret:this.appSecret}).catch(t=>{this.logger.error(t)})})}getAppTicket(){var t;return h(this,void 0,void 0,function*(){let o=yield(t=this.cache)===null||t===void 0?void 0:t.get(kC,{namespace:this.appId});if(o)return this.logger.debug("use cache app ticket"),o;yield this.requestAppTicket()})}},lS="/oauth/v3/token",fRe="urn:ietf:params:oauth:grant-type:jwt-bearer",G6="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",QRe="authorization_code",yRe="refresh_token",TP="X-Target-Service",F6=7100,NP=7101,L6=7102,RP=7104,mRe=Object.freeze({"open.feishu.cn":"https://accounts.feishu.cn","open.larksuite.com":"https://accounts.larksuite.com"}),na=class extends Error{constructor(t,o){super(o),this.name="ClientAssertionError",this.code=t,this.msg=o}},$d=class extends Error{constructor(t,o,a,e){super(e||a||"access token request failed"),this.name="AccessTokenError",this.statusCode=t,this.code=o,this.error=a,this.errorDescription=e}},kP=n=>n.includes("://")?n:`https://${n}`;function vP(n){let t=new URL(kP(n));if(!t.host)throw new Error(`invalid url: ${n}`);return t.host}function PP(n){if(n.oauthBaseUrl)return kP(n.oauthBaseUrl).replace(/\/+$/,"");let t=vP(n.domain),o=mRe[t];if(o)return o;throw new Error("oauthBaseUrl is not configured. When domain is a non-default value (neither open.feishu.cn nor open.larksuite.com), set oauthBaseUrl explicitly.")}function U6(n){return vP(PP(n))}function GP(n,t){let o=new URL(kP(n.targetService));if(o.protocol!=="https:")throw new Error("targetService must use https");if(o.username||o.password)throw new Error("targetService must not contain userinfo");let e=`${n.targetPrefix||""}${t}`.replace(/\/{2,}/g,"/");if(/(^|\/)\.\.(\/|$)/.test(e))throw new Error("targetPrefix must not contain path traversal");return`${o.protocol}//${o.host}${e}`}function SRe(n,t){var o,a;let e=(o=t?.code)!==null&&o!==void 0?o:"unknown",i=(a=t?.msg)!==null&&a!==void 0?a:"no message";return`failed to get ${n}, code: ${e}, msg: ${i}`}var gP=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.cache=t.cache,this.domain=t.domain,this.logger=t.logger,this.appType=t.appType,this.httpInstance=t.httpInstance,this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.appTicketManager=new sP({appId:this.appId,appSecret:this.appSecret,cache:this.cache,domain:this.domain,logger:this.logger,appType:this.appType,httpInstance:this.httpInstance}),this.logger.debug("token manager is ready")}requestToken(t,o,a){return h(this,void 0,void 0,function*(){let e=yield this.httpInstance.post(t,o).catch(i=>{throw this.logger.error(i),i});if(!e||!e[a])throw new Error(SRe(a,e));return e})}getCustomTenantAccessToken(){var t,o;return h(this,void 0,void 0,function*(){if(this.clientAssertionProvider)return this.getTenantTokenByClientAssertion();let a=yield(t=this.cache)===null||t===void 0?void 0:t.get(MC,{namespace:this.appId});if(a)return this.logger.debug("use cache token"),a;this.logger.debug("request token");let{tenant_access_token:e,expire:i}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/tenant_access_token/internal`,{app_id:this.appId,app_secret:this.appSecret},"tenant_access_token");return yield(o=this.cache)===null||o===void 0?void 0:o.set(MC,e,new Date().getTime()+i*1e3-180*1e3,{namespace:this.appId}),e})}getTenantTokenByClientAssertion(){var t,o,a,e,i,A,r,s;return h(this,void 0,void 0,function*(){let g=PP({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),c=U6({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),I=yield(t=this.cache)===null||t===void 0?void 0:t.get(MC,{namespace:this.appId});if(I)return this.logger.debug("use cache token"),I;let p;try{p=yield this.clientAssertionProvider.retrieveToken(c)}catch(T){throw new na(L6,T?.message||"client assertion provider failed")}if(!p||!p.value)throw new na(NP,"client assertion token is empty");let B=`${g}${lS}`,f={};p.targetInfo&&(B=GP(p.targetInfo,lS),f[TP]=c),this.logger.debug("request token (client assertion)");let Q;try{Q=yield this.httpInstance.request({method:"post",url:B,headers:f,data:{grant_type:fRe,client_assertion_type:G6,client_assertion:p.value,client_id:this.appId}})}catch(T){throw this.logger.error(T),new na(((a=(o=T?.response)===null||o===void 0?void 0:o.data)===null||a===void 0?void 0:a.code)||0,((i=(e=T?.response)===null||e===void 0?void 0:e.data)===null||i===void 0?void 0:i.error_description)||((r=(A=T?.response)===null||A===void 0?void 0:A.data)===null||r===void 0?void 0:r.error)||"client assertion token exchange failed")}let y=Q?.access_token;if(!y)throw new na(Q?.code||0,Q?.error_description||Q?.error||"oauth token response missing access token");let m=Number(Q?.expires_in)||0;return yield(s=this.cache)===null||s===void 0?void 0:s.set(MC,y,new Date().getTime()+Math.max(m-180,0)*1e3,{namespace:this.appId}),y})}getMarketTenantAccessToken(t){var o;return h(this,void 0,void 0,function*(){if(this.clientAssertionProvider)throw new na(F6,"ClientAssertion mode is not supported for ISV apps");if(!t){this.logger.error("market app request need tenant key");return}let a=yield(o=this.cache)===null||o===void 0?void 0:o.get(`larkMarketAccessToken${t}`,{namespace:this.appId});if(a)return this.logger.debug("use cache token"),a;this.logger.debug("get app ticket");let e=yield this.appTicketManager.getAppTicket();if(!e){this.logger.warn("no app ticket");return}this.logger.debug("get app access token");let{app_access_token:i}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/app_access_token`,{app_id:this.appId,app_secret:this.appSecret,app_ticket:e},"app_access_token");this.logger.debug("get tenant access token");let{tenant_access_token:A,expire:r}=yield this.requestToken(`${this.domain}/open-apis/auth/v3/tenant_access_token`,{app_access_token:i,tenant_key:t},"tenant_access_token");return yield this.cache.set(`larkMarketAccessToken${t}`,A,new Date().getTime()+r*1e3-180*1e3,{namespace:this.appId}),A})}getTenantAccessToken(t){return h(this,void 0,void 0,function*(){return IS(this.appType===Os.SelfBuild,()=>h(this,void 0,void 0,function*(){this.logger.debug("get custom app token")})),IS(this.appType===Os.ISV,()=>h(this,void 0,void 0,function*(){this.logger.debug("get market app token ")})),this.appType===Os.SelfBuild?yield this.getCustomTenantAccessToken():yield this.getMarketTenantAccessToken(t?.[gS])})}},H6=(n,t)=>{let o=Object.assign({},n);for(let[a,e]of Object.entries(t))e!==void 0&&(o[a]=e);return o},cP=class{constructor(t){this.client=t.client}getCacheKey(t,o){return`${o?.namespace||this.client.appId}/${uRe.toString()}/${t}`}calibrateTime(t){return new Date().getTime()+(t||0)*1e3-180*1e3}initWithCode(t,o){return h(this,void 0,void 0,function*(){let a={};for(let[e,i]of Object.entries(t)){let A=yield this.client.authen.oidcAccessToken.create({data:{grant_type:"authorization_code",code:i}});if(A.code!==0){this.client.logger.error("init user access token error",e,A.msg||A.message);continue}if(!A.data){this.client.logger.error("user access code expired",e,i);continue}a[e]={code:i,token:A.data.access_token,refreshToken:A.data.refresh_token,expiredTime:this.calibrateTime(A.data.expires_in)}}return yield this.update(a,{namespace:o?.namespace}),a})}update(t,o){return h(this,void 0,void 0,function*(){for(let[a,e]of Object.entries(t)){let i=this.getCacheKey(a,{namespace:o?.namespace}),A=(yield this.client.cache.get(i))||{},{code:r,token:s,refreshToken:g,expiredTime:c}=e,I=H6(A,{code:r,token:s,refreshToken:g,expiredTime:c});yield this.client.cache.set(i,I,1/0)}})}get(t,o){return h(this,void 0,void 0,function*(){let a=this.getCacheKey(t,{namespace:o?.namespace}),e=yield this.client.cache.get(a);if(!e){this.client.logger.error("user access token needs to be initialized or updated first");return}let{token:i,code:A,refreshToken:r,expiredTime:s}=e;if(i&&s&&s-new Date().getTime()>0)return i;if(r){let g=yield this.client.authen.oidcRefreshAccessToken.create({data:{grant_type:"refresh_token",refresh_token:r}});if(g.code===0&&g.data)return yield this.update({[t]:{token:g.data.access_token,refreshToken:g.data.refresh_token,expiredTime:this.calibrateTime(g.data.expires_in)}}),g.data.access_token;this.client.logger.error("get user access token by refresh token failed.",g.msg);return}if(A){let g=yield this.client.authen.oidcAccessToken.create({data:{grant_type:"authorization_code",code:A}});g.code===0&&g.data?yield this.update({[t]:{token:g.data.access_token,refreshToken:g.data.refresh_token,expiredTime:this.calibrateTime(g.data.expires_in)}}):this.client.logger.error("get user access token by code failed.",g.msg)}})}},Zd=n=>n===""||n===0||n===null||n===void 0?void 0:n,wRe=n=>{if(!n||n.error)return!0;let{code:t}=n;return t!==void 0&&t!==0&&t!=="0"&&t!==""},IP=class{constructor(t){this.appId=t.appId,this.appSecret=t.appSecret,this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.domain=t.domain,this.httpInstance=t.httpInstance,this.logger=t.logger}retrieveByAuthorizationCode(t){return h(this,void 0,void 0,function*(){return this.doRequest({grant_type:QRe,code:t.code,redirect_uri:t.redirectUri,code_verifier:t.codeVerifier,scope:t.scope},t.headers)})}refresh(t){return h(this,void 0,void 0,function*(){return this.doRequest({grant_type:yRe,refresh_token:t.refreshToken,scope:t.scope},t.headers)})}doRequest(t,o){return h(this,void 0,void 0,function*(){let a=PP({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),e=U6({oauthBaseUrl:this.oauthBaseUrl,domain:this.domain}),i={client_id:this.appId};for(let[I,p]of Object.entries(t))p!=null&&(i[I]=p);let A=`${a}${lS}`,r=Object.assign({},o||{});if(this.clientAssertionProvider){let I;try{I=yield this.clientAssertionProvider.retrieveToken(e)}catch(p){throw new na(L6,p?.message||"client assertion provider failed")}if(!I||!I.value)throw new na(NP,"client assertion token is empty");i.client_assertion_type=G6,i.client_assertion=I.value,I.targetInfo&&(A=GP(I.targetInfo,lS),r[TP]=e)}else if(this.appSecret)i.client_secret=this.appSecret;else throw new na(RP,"appSecret and clientAssertionProvider cannot both be empty for accessToken APIs");let s=200,g;try{g=yield this.httpInstance.request({method:"post",url:A,headers:r,data:i})}catch(I){if(this.logger.error(I),I?.response)s=I.response.status,g=I.response.data;else throw new $d(0,0,"",I?.message||"oauth token request failed")}if(s!==200||wRe(g))throw new $d(s,g?.code||0,g?.error||"",g?.error_description||g?.msg||"");let c=Zd(g?.access_token);if(!c)throw new $d(s,g?.code||0,g?.error||"",g?.error_description||"oauth token response missing access_token");return{accessToken:c,tokenType:Zd(g.token_type),expiresIn:Zd(g.expires_in),refreshToken:Zd(g.refresh_token),refreshTokenExpiresIn:Zd(g.refresh_token_expires_in),scope:Zd(g.scope)}})}},pS=class extends nP{constructor(t){if(super(),this.appId="",this.appSecret="",this.helpDeskId="",this.helpDeskToken="",this.appType=Os.SelfBuild,this.logger=new Uc(t.loggerLevel||Eo.info,t.logger||Pg),this.appId=t.appId,this.appSecret=t.appSecret||"",this.clientAssertionProvider=t.clientAssertionProvider,this.oauthBaseUrl=t.oauthBaseUrl,this.disableTokenCache=t.disableTokenCache,this.userAgent=_P(t.source,{extraTags:t.extraUaTags}),IS(!this.appId,()=>this.logger.error("appId is needed")),this.helpDeskId=t.helpDeskId,this.helpDeskToken=t.helpDeskToken,this.appType=t?.appType||Os.SelfBuild,!this.appSecret&&!this.clientAssertionProvider)throw new na(RP,"appSecret or clientAssertionProvider is required");if(this.clientAssertionProvider&&this.appType===Os.ISV)throw new na(F6,"ClientAssertion mode is not supported for ISV apps");this.domain=P6(t.domain||bs.Feishu),this.logger.debug(`use domain url: ${this.domain}`),this.cache=t.cache||PC,this.httpInstance=t.httpInstance||eh,this.tokenManager=new gP({appId:this.appId,appSecret:this.appSecret,cache:this.cache,domain:this.domain,logger:this.logger,appType:this.appType,httpInstance:this.httpInstance,clientAssertionProvider:this.clientAssertionProvider,oauthBaseUrl:this.oauthBaseUrl}),this.userAccessToken=new cP({client:this}),this.accessToken=new IP({appId:this.appId,appSecret:this.appSecret,clientAssertionProvider:this.clientAssertionProvider,oauthBaseUrl:this.oauthBaseUrl,domain:this.domain,httpInstance:this.httpInstance,logger:this.logger}),this.logger.info("client ready")}formatPayload(t,o){var a,e,i;return h(this,void 0,void 0,function*(){let A=["lark","params","data","headers","path"].reduce((g,c)=>(g[c]=o?.[c]||{},g),{}),r=(a=A?.lark)===null||a===void 0?void 0:a[v6];if(r)this.logger.debug("use passed token"),A.headers.Authorization=`Bearer ${r}`;else if(!this.disableTokenCache){let g=yield this.tokenManager.getTenantAccessToken({[gS]:(e=A?.lark)===null||e===void 0?void 0:e[gS]});g?A.headers.Authorization=`Bearer ${g}`:this.logger.warn("failed to obtain token")}if((i=A?.lark)===null||i===void 0?void 0:i[k6]){this.logger.debug("generate help desk credential");let g=CRe(`${this.helpDeskId}:${this.helpDeskToken}`);A.headers["X-Lark-Helpdesk-Authorization"]=`Bearer ${g}`}return{params:Object.assign(Object.assign({},t?.params||{}),A.params),headers:Object.assign(Object.assign({"User-Agent":this.userAgent},t?.headers||{}),A.headers),data:Object.assign(Object.assign({},t?.data||{}),A.data),path:Object.assign(Object.assign({},t?.path||{}),A.path)}})}request(t,o){var a;return h(this,void 0,void 0,function*(){let{data:e,params:i,headers:A,url:r}=t,s=Y(t,["data","params","headers","url"]),g=yield this.formatPayload({data:e,params:i,headers:A},o),c=((a=t.method)===null||a===void 0?void 0:a.toLowerCase())==="get"&&Object.keys(g.data).length===0?void 0:g.data;return this.logger.trace(`send request [${t.method}]: ${t.url}`),yield this.httpInstance.request(Object.assign(Object.assign({},s),{url:/^http/.test(r)?r:`${this.domain}/${BRe(r)}`,headers:g.headers,data:c,params:g.params})).catch(p=>{throw this.logger.error(p),p})})}},DRe=n=>n.reduce((t,o)=>(0,N6.default)(t,o),{}),ORe=n=>({lark:{[gS]:n}}),bRe=()=>({lark:{[k6]:!0}}),MRe=n=>({headers:{Authorization:`Bearer ${n}`}}),_Re=n=>({lark:{[v6]:n}}),dS=class{constructor(t){let{encryptKey:o,verificationToken:a,logger:e}=t;this.verificationToken=a,this.encryptKey=o,this.logger=e,o&&(this.aesCipher=new vC(o))}parse(t){var o,a;let e=(()=>{var r;let s=t||{},{encrypt:g}=s,c=Y(s,["encrypt"]);if(g)try{return Object.assign(Object.assign({},JSON.parse((r=this.aesCipher)===null||r===void 0?void 0:r.decrypt(g))),c)}catch{return this.logger.error("parse encrypt data failed"),{}}return c})();if("schema"in e){let{header:r,event:s}=e,g=Y(e,["header","event"]);return Object.assign(Object.assign(Object.assign({[sS]:(o=e?.header)===null||o===void 0?void 0:o.event_type},g),r),s)}let{event:i}=e,A=Y(e,["event"]);return Object.assign(Object.assign({[sS]:(a=e?.event)===null||a===void 0?void 0:a.type},i),A)}checkIsCardEventValidated(t){if("encrypt"in t||"schema"in t)return this.checkIsEventValidated(t);let{"x-lark-request-timestamp":o,"x-lark-request-nonce":a,"x-lark-signature":e}=t.headers;return this.verificationToken?nS.createHash("sha1").update(o+a+this.verificationToken+JSON.stringify(t)).digest("hex")===e:!0}checkIsEventValidated(t){if(!this.encryptKey)return!0;let{"x-lark-request-timestamp":o,"x-lark-request-nonce":a,"x-lark-signature":e}=t.headers,i=o+a+this.encryptKey+JSON.stringify(t);return nS.createHash("sha256").update(i).digest("hex")===e}},TRe="app_ticket",hS=class{constructor(t){this.verificationToken="",this.encryptKey="",this.handles=new Map;let{encryptKey:o,verificationToken:a}=t;this.encryptKey=o||"",this.verificationToken=a||"",this.logger=new Uc(t.loggerLevel||Eo.info,t.logger||Pg),this.requestHandle=new dS({encryptKey:o,verificationToken:a,logger:this.logger}),this.cache=t.cache||PC,this.registerAppTicketHandle(),this.logger.info("event-dispatch is ready")}registerAppTicketHandle(){this.register({app_ticket:t=>h(this,void 0,void 0,function*(){let{app_ticket:o,app_id:a}=t;o?(yield this.cache.set(kC,o,void 0,{namespace:a}),this.logger.debug("set app ticket")):this.logger.warn("response not include app ticket")})})}register(t){return Object.keys(t).forEach(o=>{this.handles.has(o)&&o!==TRe&&this.logger.error(`this ${o} handle is registered`),this.handles.set(o,t[o]),this.logger.debug(`register ${o} handle`)}),this}invoke(t,o){var a,e;return h(this,void 0,void 0,function*(){if(o?.needCheck!==!1&&!(!((a=this.requestHandle)===null||a===void 0)&&a.checkIsEventValidated(t))){this.logger.warn("verification failed event");return}let A=(e=this.requestHandle)===null||e===void 0?void 0:e.parse(t),r=A[sS];if(this.handles.has(r)){let s=yield this.handles.get(r)(A);return this.logger.debug(`execute ${r} handle`),s}return this.logger.warn(`no ${r} handle`),`no ${r} event handle`})}},lP=class{constructor(t,o){this.verificationToken="",this.encryptKey="",this.handles=new Map;let{verificationToken:a,encryptKey:e}=t;this.encryptKey=e||"",this.verificationToken=a||"",this.cardHandler=o,this.logger=new Uc(t.loggerLevel||Eo.info,t.logger||Pg),this.requestHandle=new dS({encryptKey:e,verificationToken:a,logger:this.logger}),this.cache=t.cache||PC,this.registerAppTicketHandle(),this.logger.info("card-action-handle is ready")}registerAppTicketHandle(){this.register({app_ticket:t=>h(this,void 0,void 0,function*(){let{app_ticket:o,app_id:a}=t;o?(yield this.cache.set(kC,o,void 0,{namespace:a}),this.logger.debug("set app ticket")):this.logger.warn("response not include app ticket")})})}register(t){return Object.keys(t).forEach(o=>{this.handles.set(o,t[o]),this.logger.debug(`register ${o} handle`)}),this}invoke(t){var o,a;return h(this,void 0,void 0,function*(){if(!(!((o=this.requestHandle)===null||o===void 0)&&o.checkIsCardEventValidated(t))){this.logger.warn("verification failed event");return}let e=(a=this.requestHandle)===null||a===void 0?void 0:a.parse(t),i=e[sS];if(this.handles.has(i))try{return yield this.handles.get(i)(e)}catch(A){this.logger.error(A);return}try{let A=yield this.cardHandler(e);return this.logger.debug("execute card handle"),A}catch(A){this.logger.error(A)}})}},yS=n=>new Promise(t=>{let o="";n.on("data",a=>{o+=a}),n.on("end",()=>{try{let a=JSON.parse(o);t(a)}catch{t("")}})}),GC=(n,t)=>{if("encrypt"in n&&!t.encryptKey)throw new Error("auto-challenge need encryptKey, please check for missing in dispatcher");let o="encrypt"in n?JSON.parse(new vC(t.encryptKey).decrypt(n.encrypt)):n;return{isChallenge:o.type==="url_verification",challenge:{challenge:o.challenge}}},NRe=(n,t,o)=>(a,e)=>h(void 0,void 0,void 0,function*(){if(a.url!==n)return;let i=Object.assign(Object.create({headers:a.headers}),yield yS(a));if(o?.autoChallenge||!1){let{isChallenge:s,challenge:g}=GC(i,{encryptKey:t.encryptKey});if(s){e.end(JSON.stringify(g));return}}let r=yield t.invoke(i);e.end(JSON.stringify(r))}),RRe=(n,t)=>(o,a)=>h(void 0,void 0,void 0,function*(){let e=yield h(void 0,void 0,void 0,function*(){return o.body?o.body:o.complete?((t?.logger||Pg).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield yS(o)}),i=Object.assign(Object.create({headers:o.headers}),e);if(t?.autoChallenge||!1){let{isChallenge:s,challenge:g}=GC(i,{encryptKey:n.encryptKey});if(s){a.json(g);return}}let r=yield n.invoke(i);a.json(r)}),kRe=(n,t,o)=>(a,e)=>h(void 0,void 0,void 0,function*(){let{originalUrl:i,req:A,request:r}=a;if(i===n){let s=yield h(void 0,void 0,void 0,function*(){return r.body?r.body:A.complete?((o?.logger||Pg).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield yS(A)}),g=Object.assign(Object.create({headers:A.headers}),s);if(o?.autoChallenge||!1){let{isChallenge:p,challenge:B}=GC(g,{encryptKey:t.encryptKey});if(p){a.body=B,yield e();return}}let I=yield t.invoke(g);a.body=JSON.stringify(I)}yield e()}),vRe=(n,t)=>(o,a)=>h(void 0,void 0,void 0,function*(){let{req:e,request:i}=o,A=yield h(void 0,void 0,void 0,function*(){return i.body?i.body:e.complete?((t?.logger||Pg).error("unable to obtain request body, if parsed it in other middleware, please manually set in ctx.request.body"),null):yield yS(e)}),r=Object.assign(Object.create({headers:e.headers}),A);if(t?.autoChallenge||!1){let{isChallenge:c,challenge:I}=GC(r,{encryptKey:n.encryptKey});if(c){o.body=I,yield a();return}}let g=yield n.invoke(r);o.body=JSON.stringify(g),yield a()}),PRe=n=>{let{title:t,content:o}=n;return JSON.stringify({config:{wide_screen_mode:!0},elements:[{tag:"markdown",content:o}],header:{template:"blue",title:{content:t,tag:"plain_text"}}})},GRe=Object.freeze({__proto__:null,defaultCard:PRe}),vg=tS();vg.util.Long=void 0;vg.configure();var Lc=vg.Reader,E6=vg.Writer,HA=vg.util,Vo=vg.roots.default||(vg.roots.default={}),K6=Vo.pbbp2=(()=>{let n={};return n.Header=(function(){function t(o){if(o)for(let a=Object.keys(o),e=0;e>>3){case 1:{A.key=a.string();break}case 2:{A.value=a.string();break}default:a.skipType(r&7);break}}if(!A.hasOwnProperty("key"))throw HA.ProtocolError("missing required 'key'",{instance:A});if(!A.hasOwnProperty("value"))throw HA.ProtocolError("missing required 'value'",{instance:A});return A},t.decodeDelimited=function(a){return a instanceof Lc||(a=new Lc(a)),this.decode(a,a.uint32())},t.verify=function(a){return typeof a!="object"||a===null?"object expected":HA.isString(a.key)?HA.isString(a.value)?null:"value: string expected":"key: string expected"},t.fromObject=function(a){if(a instanceof Vo.pbbp2.Header)return a;let e=new Vo.pbbp2.Header;return a.key!=null&&(e.key=String(a.key)),a.value!=null&&(e.value=String(a.value)),e},t.toObject=function(a,e){e||(e={});let i={};return e.defaults&&(i.key="",i.value=""),a.key!=null&&a.hasOwnProperty("key")&&(i.key=a.key),a.value!=null&&a.hasOwnProperty("value")&&(i.value=a.value),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,vg.util.toJSONOptions)},t.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/pbbp2.Header"},t})(),n.Frame=(function(){function t(o){if(this.headers=[],o)for(let a=Object.keys(o),e=0;e>>3){case 1:{A.SeqID=a.uint64();break}case 2:{A.LogID=a.uint64();break}case 3:{A.service=a.int32();break}case 4:{A.method=a.int32();break}case 5:{A.headers&&A.headers.length||(A.headers=[]),A.headers.push(Vo.pbbp2.Header.decode(a,a.uint32()));break}case 6:{A.payloadEncoding=a.string();break}case 7:{A.payloadType=a.string();break}case 8:{A.payload=a.bytes();break}case 9:{A.LogIDNew=a.string();break}default:a.skipType(r&7);break}}if(!A.hasOwnProperty("SeqID"))throw HA.ProtocolError("missing required 'SeqID'",{instance:A});if(!A.hasOwnProperty("LogID"))throw HA.ProtocolError("missing required 'LogID'",{instance:A});if(!A.hasOwnProperty("service"))throw HA.ProtocolError("missing required 'service'",{instance:A});if(!A.hasOwnProperty("method"))throw HA.ProtocolError("missing required 'method'",{instance:A});return A},t.decodeDelimited=function(a){return a instanceof Lc||(a=new Lc(a)),this.decode(a,a.uint32())},t.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(!HA.isInteger(a.SeqID)&&!(a.SeqID&&HA.isInteger(a.SeqID.low)&&HA.isInteger(a.SeqID.high)))return"SeqID: integer|Long expected";if(!HA.isInteger(a.LogID)&&!(a.LogID&&HA.isInteger(a.LogID.low)&&HA.isInteger(a.LogID.high)))return"LogID: integer|Long expected";if(!HA.isInteger(a.service))return"service: integer expected";if(!HA.isInteger(a.method))return"method: integer expected";if(a.headers!=null&&a.hasOwnProperty("headers")){if(!Array.isArray(a.headers))return"headers: array expected";for(let e=0;e>>0,a.SeqID.high>>>0).toNumber(!0))),a.LogID!=null&&(HA.Long?(e.LogID=HA.Long.fromValue(a.LogID)).unsigned=!0:typeof a.LogID=="string"?e.LogID=parseInt(a.LogID,10):typeof a.LogID=="number"?e.LogID=a.LogID:typeof a.LogID=="object"&&(e.LogID=new HA.LongBits(a.LogID.low>>>0,a.LogID.high>>>0).toNumber(!0))),a.service!=null&&(e.service=a.service|0),a.method!=null&&(e.method=a.method|0),a.headers){if(!Array.isArray(a.headers))throw TypeError(".pbbp2.Frame.headers: array expected");e.headers=[];for(let i=0;i=0&&(e.payload=a.payload)),a.LogIDNew!=null&&(e.LogIDNew=String(a.LogIDNew)),e},t.toObject=function(a,e){e||(e={});let i={};if((e.arrays||e.defaults)&&(i.headers=[]),e.defaults){if(HA.Long){let A=new HA.Long(0,0,!0);i.SeqID=e.longs===String?A.toString():e.longs===Number?A.toNumber():A}else i.SeqID=e.longs===String?"0":0;if(HA.Long){let A=new HA.Long(0,0,!0);i.LogID=e.longs===String?A.toString():e.longs===Number?A.toNumber():A}else i.LogID=e.longs===String?"0":0;i.service=0,i.method=0,i.payloadEncoding="",i.payloadType="",e.bytes===String?i.payload="":(i.payload=[],e.bytes!==Array&&(i.payload=HA.newBuffer(i.payload))),i.LogIDNew=""}if(a.SeqID!=null&&a.hasOwnProperty("SeqID")&&(typeof a.SeqID=="number"?i.SeqID=e.longs===String?String(a.SeqID):a.SeqID:i.SeqID=e.longs===String?HA.Long.prototype.toString.call(a.SeqID):e.longs===Number?new HA.LongBits(a.SeqID.low>>>0,a.SeqID.high>>>0).toNumber(!0):a.SeqID),a.LogID!=null&&a.hasOwnProperty("LogID")&&(typeof a.LogID=="number"?i.LogID=e.longs===String?String(a.LogID):a.LogID:i.LogID=e.longs===String?HA.Long.prototype.toString.call(a.LogID):e.longs===Number?new HA.LongBits(a.LogID.low>>>0,a.LogID.high>>>0).toNumber(!0):a.LogID),a.service!=null&&a.hasOwnProperty("service")&&(i.service=a.service),a.method!=null&&a.hasOwnProperty("method")&&(i.method=a.method),a.headers&&a.headers.length){i.headers=[];for(let A=0;AK6.Frame.decode(n),pP=class{constructor(){this.client={appId:"",appSecret:"",domain:bs.Feishu},this.ws={connectUrl:"",pingInterval:120*1e3,reconnectCount:-1,reconnectInterval:120*1e3,reconnectNonce:30*1e3,deviceId:"",serviceId:"",autoReconnect:!0},this.wsInstance=null}updateClient(t){Object.assign(this.client,t)}updateWs(t){Object.assign(this.ws,t)}getClient(t){return t===void 0?this.client:this.client[t]}getWS(t){return t===void 0?this.ws:this.ws[t]}get wsConfigUrl(){return`${this.getClient("domain")}/callback/ws/endpoint`}setWSInstance(t){this.wsInstance=t}getWSInstance(){return this.wsInstance}},dP=class{constructor(t){this.cache=new Map,this.logger=t.logger,this.clearAtInterval()}mergeData(t){let{message_id:o,sum:a,seq:e,trace_id:i,data:A}=t,r=this.cache.get(o);if(r)r.buffer[e]=A;else{let g=new Array(a).fill(void 0);g[e]=A,this.cache.set(o,{buffer:g,trace_id:i,message_id:o,create_time:Date.now()})}let s=this.cache.get(o);if(s?.buffer.every(g=>!!g)){let g=s.buffer.reduce((p,B)=>{let f=new Uint8Array(p.byteLength+B.byteLength);return f.set(p,0),f.set(B,p.length),f},new Uint8Array([])),c=new TextDecoder("utf-8").decode(g),I=JSON.parse(c);return this.deleteCache(o),I}return null}deleteCache(t){this.cache.delete(t)}clearAtInterval(){if(this.timer)return;let t=1e4;this.timer=setInterval(()=>{let o=Date.now();this.cache.forEach((a,e)=>{var i;let{create_time:A,trace_id:r,message_id:s}=a;o-A>t&&((i=this.logger)===null||i===void 0||i.debug(`${s} event data is deleted as expired, trace_id: ${r}`),this.deleteCache(e))})},t),typeof this.timer.unref=="function"&&this.timer.unref()}destroy(){this.timer&&(clearInterval(this.timer),this.timer=void 0),this.cache.clear()}},TC;(function(n){n[n.ok=0]="ok",n[n.system_busy=1]="system_busy",n[n.forbidden=403]="forbidden",n[n.auth_failed=514]="auth_failed",n[n.internal_error=1000040343]="internal_error",n[n.exceed_conn_limit=1000040350]="exceed_conn_limit"})(TC||(TC={}));var NC;(function(n){n[n.control=0]="control",n[n.data=1]="data"})(NC||(NC={}));var RC;(function(n){n.type="type",n.message_id="message_id",n.sum="sum",n.seq="seq",n.trace_id="trace_id",n.biz_rt="biz_rt",n.handshake_status="handshake-status",n.handshake_msg="handshake-msg",n.handshake_autherrcode="handshake-autherrcode"})(RC||(RC={}));var Xd;(function(n){n.event="event",n.card="card",n.ping="ping",n.pong="pong"})(Xd||(Xd={}));var ES;(function(n){n[n.ok=200]="ok",n[n.internal_server_error=500]="internal_server_error"})(ES||(ES={}));var uS=class{constructor(t){var o;this.wsConfig=new pP,this.reconnectGeneration=0,this.pendingWsInstance=null,this.isConnecting=!1,this.reconnectInfo={lastConnectTime:0,nextConnectTime:0},this.hasEverConnected=!1,this.terminalError=!1,this.currentReconnectAttempts=0;let{appId:a,appSecret:e,clientAssertionProvider:i,agent:A,domain:r=bs.Feishu,httpInstance:s=eh,loggerLevel:g=Eo.info,logger:c=Pg,autoReconnect:I=!0,source:p,extraUaTags:B,onReady:f,onError:Q,onReconnecting:y,onReconnected:m,handshakeTimeoutMs:T,wsConfig:_}=t;if(this.userAgent=_P(p,{extraTags:B}),this.logger=new Uc(g,c),IS(!a,()=>this.logger.error("appId is needed")),!e&&!i)throw new na(RP,"appSecret or clientAssertionProvider is required");this.agent=A,this.dataCache=new dP({logger:this.logger}),this.httpInstance=s,this.wsConfig.updateClient({appId:a,appSecret:e||"",clientAssertionProvider:i,domain:P6(r)}),this.wsConfig.updateWs({autoReconnect:I}),this.onReady=f,this.onError=Q,this.onReconnecting=y,this.onReconnected=m,this.handshakeTimeoutMs=T,this.pingTimeoutSec=(o=_?.pingTimeout)!==null&&o!==void 0?o:0}armLiveness(){this.pingTimeoutSec&&(this.livenessTimer&&clearTimeout(this.livenessTimer),this.livenessTimer=setTimeout(()=>{var t;this.livenessTimer=void 0,this.logger.warn("[ws]",`no pong/inbound within ${this.pingTimeoutSec}s of last ping, terminating to trigger reconnect`);try{(t=this.wsConfig.getWSInstance())===null||t===void 0||t.terminate()}catch{}},this.pingTimeoutSec*1e3))}clearLiveness(){this.livenessTimer&&(clearTimeout(this.livenessTimer),this.livenessTimer=void 0)}safeInvoke(t,o,...a){if(o)try{o(...a)}catch(e){this.logger.error(`[ws] ${t} callback threw`,e)}}pullConnectConfig(){return h(this,void 0,void 0,function*(){let{appId:t,appSecret:o,clientAssertionProvider:a,domain:e}=this.wsConfig.getClient(),i="/callback/ws/endpoint",A=this.wsConfig.wsConfigUrl,r={locale:"zh","User-Agent":this.userAgent},s={AppID:t};try{if(a){let Q=vP(e),y=yield a.retrieveToken(Q);if(!y||!y.value)throw new na(NP,"client assertion token is empty");s.AppSecret="",s.ClientAssertion=y.value,y.targetInfo&&(A=GP(y.targetInfo,i),r[TP]=Q)}else s.AppSecret=o;let{code:g,data:{URL:c,ClientConfig:I},msg:p}=yield this.httpInstance.request({method:"post",url:A,data:s,headers:r,timeout:15e3});if(g!==TC.ok){let Q=g===TC.system_busy?"system busy":p;return this.logger.error("[ws]",`code: ${g}, ${Q}`),g===TC.internal_error?{ok:!1,retryable:!0}:{ok:!1,retryable:!1,error:`pullConnectConfig failed: code=${g}, msg=${Q}`}}let{device_id:B,service_id:f}=cRe.parse(c);return this.wsConfig.updateWs({connectUrl:c,deviceId:B,serviceId:f,pingInterval:I.PingInterval*1e3,reconnectCount:I.ReconnectCount,reconnectInterval:I.ReconnectInterval*1e3,reconnectNonce:I.ReconnectNonce*1e3}),this.logger.debug("[ws]",`get connect config success, ws url: ${c}`),{ok:!0}}catch(g){return this.logger.error("[ws]",g?.message||"system busy"),g instanceof na?{ok:!1,retryable:!1,error:g.message}:{ok:!1,retryable:!0}}})}connect(){let t=this.wsConfig.getWS("connectUrl"),o;try{let{agent:a}=this;o=new Jo(t,{agent:a})}catch{this.logger.error("[ws]","new WebSocket error")}return o?(this.pendingWsInstance=o,new Promise(a=>{let e=!1,i,A=r=>{e||(e=!0,i&&clearTimeout(i),this.pendingWsInstance===o&&(this.pendingWsInstance=null),a(r))};this.handshakeTimeoutMs&&this.handshakeTimeoutMs>0&&(i=setTimeout(()=>{this.logger.error("[ws]",`handshake timeout after ${this.handshakeTimeoutMs}ms`),o.removeAllListeners("open");try{o.terminate()}catch{}A(!1)},this.handshakeTimeoutMs)),o.on("open",()=>{this.logger.debug("[ws]","ws connect success"),this.wsConfig.setWSInstance(o),this.pingLoop(),A(!0)}),o.on("error",()=>{this.logger.error("[ws]","ws connect failed"),A(!1)})})):Promise.resolve(!1)}reConnect(t=!1){return h(this,void 0,void 0,function*(){if(this.isConnecting&&!t){this.logger.debug("[ws]","repeat connection");return}this.isConnecting=!0;let o=++this.reconnectGeneration,a=()=>h(this,void 0,void 0,function*(){if(o!==this.reconnectGeneration)return{ok:!1,retryable:!1,cancelled:!0};this.reconnectInfo.lastConnectTime=Date.now();let c=yield this.pullConnectConfig();if(o!==this.reconnectGeneration)return{ok:!1,retryable:!1,cancelled:!0};if(!c.ok)return c;let I=yield this.connect();return o!==this.reconnectGeneration?{ok:!1,retryable:!1,cancelled:!0}:I?(this.communicate(),{ok:!0}):{ok:!1,retryable:!0}});this.pingInterval&&clearTimeout(this.pingInterval),this.reconnectInterval&&clearTimeout(this.reconnectInterval);let e=this.wsConfig.getWSInstance();if(t){e&&e?.terminate();let c={ok:!1,retryable:!0};try{c=yield a()}finally{o===this.reconnectGeneration&&(this.isConnecting=!1)}if(o!==this.reconnectGeneration||c.cancelled)return;if(c.ok)this.hasEverConnected=!0,this.safeInvoke("onReady",this.onReady);else if(c.retryable)this.logger.error("[ws]","connect failed"),yield this.reConnect();else{this.hasEverConnected=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(c.error));return}this.logger.info("[ws]","ws client ready");return}let{autoReconnect:i,reconnectNonce:A,reconnectCount:r,reconnectInterval:s}=this.wsConfig.getWS();if(!i){this.hasEverConnected||(this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error("WebSocket connect failed and autoReconnect is disabled")));return}this.logger.info("[ws]","reconnect"),this.hasEverConnected&&this.safeInvoke("onReconnecting",this.onReconnecting),e&&e?.terminate(),this.wsConfig.setWSInstance(null);let g=A?A*Math.random():0;this.reconnectInterval=setTimeout(()=>h(this,void 0,void 0,function*(){(function c(I){return h(this,void 0,void 0,function*(){if(o!==this.reconnectGeneration)return;I++,this.currentReconnectAttempts=I;let p=yield a();if(o===this.reconnectGeneration){if(p.ok){this.logger.debug("[ws]","reconnect success"),this.currentReconnectAttempts=0,this.hasEverConnected?this.safeInvoke("onReconnected",this.onReconnected):(this.hasEverConnected=!0,this.safeInvoke("onReady",this.onReady)),this.isConnecting=!1;return}if(!p.retryable){this.isConnecting=!1,this.hasEverConnected=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(p.error));return}if(this.logger.info("ws",`unable to connect to the server after trying ${I} times")`),r>=0&&I>=r){this.isConnecting=!1,this.terminalError=!0,this.safeInvoke("onError",this.onError,new Error(`WebSocket reconnect exhausted after ${I} attempts`));return}this.reconnectInterval=setTimeout(()=>{c.bind(this)(I)},s),this.reconnectInfo.nextConnectTime=Date.now()+s}})}).bind(this)(0)}),g),this.reconnectInfo.nextConnectTime=Date.now()+g})}pingLoop(){let{serviceId:t,pingInterval:o}=this.wsConfig.getWS(),a=this.wsConfig.getWSInstance();if(a?.readyState===Jo.OPEN){let e={headers:[{key:RC.type,value:Xd.ping}],service:Number(t),method:NC.control,SeqID:0,LogID:0};this.sendMessage(e),this.armLiveness(),this.logger.trace("[ws]","ping success")}this.pingInterval=setTimeout(this.pingLoop.bind(this),o)}communicate(){let t=this.wsConfig.getWSInstance();t?.on("message",o=>h(this,void 0,void 0,function*(){this.clearLiveness();let a=FRe(o),{method:e}=a;e===NC.control&&(yield this.handleControlData(a)),e===NC.data&&(yield this.handleEventData(a))})),t?.on("error",o=>{this.logger.error("[ws]","ws error")}),t?.on("close",()=>{this.logger.debug("[ws]","client closed"),this.clearLiveness(),this.reConnect()})}handleControlData(t){var o;return h(this,void 0,void 0,function*(){let a=(o=t.headers.find(i=>i.key===RC.type))===null||o===void 0?void 0:o.value,e=t.payload;if(a!==Xd.ping&&a===Xd.pong&&e){this.logger.trace("[ws]","receive pong");let i=new TextDecoder("utf-8").decode(e),{PingInterval:A,ReconnectCount:r,ReconnectInterval:s,ReconnectNonce:g}=JSON.parse(i);this.wsConfig.updateWs({pingInterval:A*1e3,reconnectCount:r,reconnectInterval:s*1e3,reconnectNonce:g*1e3}),this.logger.trace("[ws]","update wsConfig with pong data")}})}handleEventData(t){var o;return h(this,void 0,void 0,function*(){let a=t.headers.reduce((f,Q)=>(f[Q.key]=Q.value,f),{}),{message_id:e,sum:i,seq:A,type:r,trace_id:s}=a,g=t.payload;if(r!==Xd.event)return;let c=this.dataCache.mergeData({message_id:e,sum:Number(i),seq:Number(A),trace_id:s,data:g});if(!c)return;this.logger.debug("[ws]",`receive message, message_type: ${r}; message_id: ${e}; trace_id: ${s}; data: ${c.data}`);let I={code:ES.ok},p=Date.now();try{let f=yield(o=this.eventDispatcher)===null||o===void 0?void 0:o.invoke(c,{needCheck:!1});f&&(I.data=Buffer.from(JSON.stringify(f)).toString("base64"))}catch(f){I.code=ES.internal_server_error,this.logger.error("[ws]",`invoke event failed, message_type: ${r}; message_id: ${e}; trace_id: ${s}; error: ${f}`)}let B=Date.now();this.sendMessage(Object.assign(Object.assign({},t),{headers:[...t.headers,{key:RC.biz_rt,value:String(p-B)}],payload:new TextEncoder().encode(JSON.stringify(I))}))})}sendMessage(t){var o;let a=this.wsConfig.getWSInstance();if(a?.readyState===Jo.OPEN){let e=K6.Frame.encode(t).finish();(o=this.wsConfig.getWSInstance())===null||o===void 0||o.send(e,i=>{i&&this.logger.error("[ws]","send data failed")})}}getReconnectInfo(){return this.reconnectInfo}getConnectionStatus(){return{state:this.computeState(),lastConnectTime:this.reconnectInfo.lastConnectTime||void 0,nextConnectTime:this.reconnectInfo.nextConnectTime||void 0,reconnectAttempts:this.currentReconnectAttempts}}computeState(){var t;return this.terminalError?"failed":this.isConnecting&&!this.hasEverConnected?"connecting":this.isConnecting&&this.hasEverConnected?"reconnecting":((t=this.wsConfig.getWSInstance())===null||t===void 0?void 0:t.readyState)===Jo.OPEN?"connected":"idle"}close(t={}){let{force:o=!1}=t;this.reconnectGeneration++,this.pingInterval&&(clearTimeout(this.pingInterval),this.pingInterval=void 0),this.reconnectInterval&&(clearTimeout(this.reconnectInterval),this.reconnectInterval=void 0),this.clearLiveness(),this.dataCache.destroy(),this.isConnecting=!1,this.currentReconnectAttempts=0;let a=this.pendingWsInstance;if(a){this.pendingWsInstance=null,a.removeAllListeners("open");try{o?a.terminate():a.close()}catch{}}let e=this.wsConfig.getWSInstance();e&&(e.removeAllListeners(),o?e.terminate():e.close(),this.wsConfig.setWSInstance(null)),this.logger.info("[ws]",`ws client closed manually${o?" (force)":""}`)}start(t){return h(this,void 0,void 0,function*(){let{appId:o}=this.wsConfig.getClient();if(!/^cli_[0-9a-fA-F]{16}$/.test(o)){this.logger.error("[ws]",`invalid appId: ${o}`);return}let{eventDispatcher:a}=t;if(!a){this.logger.warn("[ws]","client need to start with a eventDispatcher");return}let e=this.wsConfig.getWSInstance();if(this.terminalError&&(this.isConnecting=!1),this.isConnecting||e&&e.readyState!==Jo.CLOSED){this.logger.debug("[ws]","start ignored because client is already connecting or connected");return}this.terminalError=!1,this.currentReconnectAttempts=0,this.dataCache.clearAtInterval(),this.logger.info("[ws]",`receive events or callbacks through persistent connection only available in self-build & Feishu app, Configured in: Developer Console(\u5F00\u53D1\u8005\u540E\u53F0) -> Events and Callbacks(\u4E8B\u4EF6\u4E0E\u56DE\u8C03) @@ -342,7 +342,7 @@ ${i.join(` `)}function Nve(n){let t=_ve(n);if(!t)return"";let o={remaining:o5},a=xP(t.header),e=[Ms(a?.title,{inline:!0,budget:o}),Ms(a?.subtitle,{inline:!0,budget:o})].filter(Boolean).join(` `)||vt(t.title)||"",i=xP(t.body),A=Array.isArray(i?.elements)?i.elements:Array.isArray(t.elements)?t.elements:null,r=Ms(A,{budget:o});return[e,r].filter(Boolean).join(` `)}function s5(n,t=SS(n)){if(n?.message?.message_type!=="post"||!t)return null;let o=[],a=vt(KP(t.title,n));a&&o.push(a);let e=[];for(let i of Array.isArray(t.content)?t.content:[]){if(!Array.isArray(i))continue;let A="";for(let s of i){let g=String(s?.tag??"").toLowerCase();if(g==="img"){let c=vt(s?.image_key);c&&e.push(c)}else(g==="text"||g==="a"||g==="link")&&typeof s?.text=="string"&&(A+=s.text)}let r=vt(KP(A,n));r&&o.push(r)}return{text:o.join(` -`),imageKeys:e}}function Rve(n,t){return typeof n?.get=="function"?n.get(t):n?.[t]??n?.[t.toLowerCase()]??null}function kve(n){let t=Rve(n,"content-length");if(t==null||t==="")return null;let o=Number(t);return Number.isFinite(o)&&o>=0?o:null}async function vve(n,{signal:t,maxBytes:o}){if(!n||typeof n[Symbol.asyncIterator]!="function")throw new Error("Feishu image download returned no readable stream");t?.throwIfAborted();let a=()=>n.destroy?.(t.reason??new DOMException("Feishu image download aborted","AbortError"));t?.addEventListener("abort",a,{once:!0});let e=[],i=0;try{for await(let A of n){t?.throwIfAborted();let r=Buffer.from(A);if(i+=r.length,i>o)throw n.destroy?.(),new ft("image-too-large",`Feishu image exceeds ${o} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));e.push(r)}return t?.throwIfAborted(),Buffer.concat(e,i)}finally{t?.removeEventListener("abort",a)}}async function Pve(n,{signal:t}){if(!n||typeof n[Symbol.asyncIterator]!="function")throw new Error("Feishu file download returned no readable stream");t?.throwIfAborted();let o=()=>n.destroy?.(t.reason??new DOMException("Feishu file download aborted","AbortError"));t?.addEventListener("abort",o,{once:!0});let a=[],e=0;try{for await(let i of n){t?.throwIfAborted();let A=Buffer.from(i);e+=A.length,a.push(A)}return t?.throwIfAborted(),Buffer.concat(a,e)}finally{t?.removeEventListener("abort",o)}}function th(n){if(!n||typeof n!="object")return null;let t=n.code??n.error?.code;return Number.isSafeInteger(Number(t))?Number(t):null}async function Gve(n,t){if(!n||typeof n[Symbol.asyncIterator]!="function")return null;t?.throwIfAborted();let o=AbortSignal.timeout(Dve),a=t?AbortSignal.any([t,o]):o,e=()=>n.destroy?.(a.reason);a.addEventListener("abort",e,{once:!0});let i=[],A=0;try{for await(let r of n){let s=Buffer.from(r);if(A+=s.length,A>wve)return n.destroy?.(),null;i.push(s)}return Buffer.concat(i,A).toString("utf8")}catch{return t?.throwIfAborted(),null}finally{a.removeEventListener("abort",e)}}async function g5(n,t){let o=[n],a=new Set;for(;o.length>0&&a.size<8;){let e=o.shift();if(!e||typeof e!="object"&&typeof e!="function"||a.has(e))continue;a.add(e);let i=th(e),A=e.response?.data??e.data;if(i===Ah)return A?.destroy?.(),i;if(A&&typeof A[Symbol.asyncIterator]=="function"){let r=await Gve(A,t);try{let s=th(JSON.parse(r));if(s===Ah)return s}catch{}}else{let r=th(A);if(r===Ah)return r}o.push(e.cause)}return null}async function Fve(n,t){return await g5(n,t)!==Ah?n:new ft("feishu-image-permission-required","Feishu image download requires the im:message:readonly tenant scope",w(Mve),{cause:n})}function Lve(n,t,o){return{async load({signal:a,maxBytes:e}){a?.throwIfAborted();let i;try{i=await t?.im?.v1?.messageResource?.get?.({path:{message_id:n.message.message_id,file_key:o},params:{type:"image"}})}catch(r){throw await Fve(r,a)}a?.throwIfAborted();let A=kve(i?.headers);if(A!==null&&A>e)throw i?.getReadableStream?.().destroy?.(),new ft("image-too-large",`Feishu image declares ${A} bytes; the limit is ${e}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return vve(i?.getReadableStream?.(),{signal:a,maxBytes:e})}}}function Uve(n,t,o){let a=vt(o?.file_key);return a?{name:vt(o?.file_name)??"file",async load({signal:e}={}){e?.throwIfAborted();let i=await t?.im?.v1?.messageResource?.get?.({path:{message_id:n.message.message_id,file_key:a},params:{type:"file"}});return e?.throwIfAborted(),Pve(i?.getReadableStream?.(),{signal:e})}}:null}function Hve(n){let t=vt(n?.message?.parent_id);if(t)return t;let o=vt(n?.message?.root_id),a=vt(n?.message?.message_id);return o&&o!==a?o:null}function Kve(n,t,o){return n==="post"?(o?.imageKeys??[]).map(()=>({kind:"image"})):n==="image"?[{kind:"image"}]:n==="file"?[{kind:"file",...vt(t?.file_name)?{name:vt(t.file_name)}:{}}]:n==="audio"?[{kind:"audio"}]:n==="media"?[{kind:"video",...vt(t?.file_name)?{name:vt(t.file_name)}:{}}]:n==="sticker"?[{kind:"other"}]:[]}function xve(n,t){let o=Hve(n);if(!o)return null;let a=vt(n?.message?.chat_id);return{messageId:o,async load({signal:e}={}){e?.throwIfAborted();let i;try{i=await t?.im?.v1?.message?.get?.({path:{message_id:o},params:{with_sender_name:!0,card_msg_content_type:Sve}})}catch(Q){if(e?.throwIfAborted(),await g5(Q,e)===Ah)return{messageId:o,unavailableReason:"permission-denied"};throw Q}if(e?.throwIfAborted(),th(i)===Ah)return{messageId:o,unavailableReason:"permission-denied"};if(th(i)!==null&&th(i)!==0)return{messageId:o,unavailableReason:"not-delivered"};let A=i?.data?.items?.find?.(Q=>vt(Q?.message_id)===o);if(!A)return{messageId:o,unavailableReason:"not-found"};if(A.deleted)return{messageId:o,unavailableReason:"deleted"};let r=vt(A.chat_id);if(!a||!r||r!==a)return{messageId:o,unavailableReason:"not-found"};let s=vt(A.msg_type)??"",g={message:{message_id:o,message_type:s,content:A.body?.content,mentions:A.mentions??[]}},c=SS(g),I=s5(g,c),p=wS(g,t),B=s==="interactive"?Nve(c):p.content,f=Kve(s,c,I);return{messageId:o,...vt(A.sender?.id)?{authorId:vt(A.sender.id)}:{},...vt(A.sender?.sender_name)?{authorName:vt(A.sender.sender_name)}:{},...B?{content:B}:{},attachments:f,...s==="interactive"&&!B&&f.length===0?{unavailableReason:"unsupported"}:{}}}}}function wS(n,t){let o=n?.message?.message_type,a=SS(n),e=s5(n,a),i=o==="image"?vt(a?.image_key):null,A=i?[i]:e?.imageKeys??[],r=o==="file"?Uve(n,t,a):null,s=xve(n,t);return{content:o==="text"?rh(n)??"":e?.text??"",images:A.map(g=>Lve(n,t,g)),files:r?[r]:[],...s?{replyTo:s}:{}}}function c5(n,t=9e3){if(n.length<=t)return[n];let o=[],a=n;for(;a.length>t;){let e=a.lastIndexOf(` +`),imageKeys:e}}function Rve(n,t){return typeof n?.get=="function"?n.get(t):n?.[t]??n?.[t.toLowerCase()]??null}function kve(n){let t=Rve(n,"content-length");if(t==null||t==="")return null;let o=Number(t);return Number.isFinite(o)&&o>=0?o:null}async function vve(n,{signal:t,maxBytes:o}){if(!n||typeof n[Symbol.asyncIterator]!="function")throw new Error("Feishu image download returned no readable stream");t?.throwIfAborted();let a=()=>n.destroy?.(t.reason??new DOMException("Feishu image download aborted","AbortError"));t?.addEventListener("abort",a,{once:!0});let e=[],i=0;try{for await(let A of n){t?.throwIfAborted();let r=Buffer.from(A);if(i+=r.length,i>o)throw n.destroy?.(),new Qt("image-too-large",`Feishu image exceeds ${o} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));e.push(r)}return t?.throwIfAborted(),Buffer.concat(e,i)}finally{t?.removeEventListener("abort",a)}}async function Pve(n,{signal:t}){if(!n||typeof n[Symbol.asyncIterator]!="function")throw new Error("Feishu file download returned no readable stream");t?.throwIfAborted();let o=()=>n.destroy?.(t.reason??new DOMException("Feishu file download aborted","AbortError"));t?.addEventListener("abort",o,{once:!0});let a=[],e=0;try{for await(let i of n){t?.throwIfAborted();let A=Buffer.from(i);e+=A.length,a.push(A)}return t?.throwIfAborted(),Buffer.concat(a,e)}finally{t?.removeEventListener("abort",o)}}function th(n){if(!n||typeof n!="object")return null;let t=n.code??n.error?.code;return Number.isSafeInteger(Number(t))?Number(t):null}async function Gve(n,t){if(!n||typeof n[Symbol.asyncIterator]!="function")return null;t?.throwIfAborted();let o=AbortSignal.timeout(Dve),a=t?AbortSignal.any([t,o]):o,e=()=>n.destroy?.(a.reason);a.addEventListener("abort",e,{once:!0});let i=[],A=0;try{for await(let r of n){let s=Buffer.from(r);if(A+=s.length,A>wve)return n.destroy?.(),null;i.push(s)}return Buffer.concat(i,A).toString("utf8")}catch{return t?.throwIfAborted(),null}finally{a.removeEventListener("abort",e)}}async function g5(n,t){let o=[n],a=new Set;for(;o.length>0&&a.size<8;){let e=o.shift();if(!e||typeof e!="object"&&typeof e!="function"||a.has(e))continue;a.add(e);let i=th(e),A=e.response?.data??e.data;if(i===Ah)return A?.destroy?.(),i;if(A&&typeof A[Symbol.asyncIterator]=="function"){let r=await Gve(A,t);try{let s=th(JSON.parse(r));if(s===Ah)return s}catch{}}else{let r=th(A);if(r===Ah)return r}o.push(e.cause)}return null}async function Fve(n,t){return await g5(n,t)!==Ah?n:new Qt("feishu-image-permission-required","Feishu image download requires the im:message:readonly tenant scope",w(Mve),{cause:n})}function Lve(n,t,o){return{async load({signal:a,maxBytes:e}){a?.throwIfAborted();let i;try{i=await t?.im?.v1?.messageResource?.get?.({path:{message_id:n.message.message_id,file_key:o},params:{type:"image"}})}catch(r){throw await Fve(r,a)}a?.throwIfAborted();let A=kve(i?.headers);if(A!==null&&A>e)throw i?.getReadableStream?.().destroy?.(),new Qt("image-too-large",`Feishu image declares ${A} bytes; the limit is ${e}`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return vve(i?.getReadableStream?.(),{signal:a,maxBytes:e})}}}function Uve(n,t,o){let a=vt(o?.file_key);return a?{name:vt(o?.file_name)??"file",async load({signal:e}={}){e?.throwIfAborted();let i=await t?.im?.v1?.messageResource?.get?.({path:{message_id:n.message.message_id,file_key:a},params:{type:"file"}});return e?.throwIfAborted(),Pve(i?.getReadableStream?.(),{signal:e})}}:null}function Hve(n){let t=vt(n?.message?.parent_id);if(t)return t;let o=vt(n?.message?.root_id),a=vt(n?.message?.message_id);return o&&o!==a?o:null}function Kve(n,t,o){return n==="post"?(o?.imageKeys??[]).map(()=>({kind:"image"})):n==="image"?[{kind:"image"}]:n==="file"?[{kind:"file",...vt(t?.file_name)?{name:vt(t.file_name)}:{}}]:n==="audio"?[{kind:"audio"}]:n==="media"?[{kind:"video",...vt(t?.file_name)?{name:vt(t.file_name)}:{}}]:n==="sticker"?[{kind:"other"}]:[]}function xve(n,t){let o=Hve(n);if(!o)return null;let a=vt(n?.message?.chat_id);return{messageId:o,async load({signal:e}={}){e?.throwIfAborted();let i;try{i=await t?.im?.v1?.message?.get?.({path:{message_id:o},params:{with_sender_name:!0,card_msg_content_type:Sve}})}catch(Q){if(e?.throwIfAborted(),await g5(Q,e)===Ah)return{messageId:o,unavailableReason:"permission-denied"};throw Q}if(e?.throwIfAborted(),th(i)===Ah)return{messageId:o,unavailableReason:"permission-denied"};if(th(i)!==null&&th(i)!==0)return{messageId:o,unavailableReason:"not-delivered"};let A=i?.data?.items?.find?.(Q=>vt(Q?.message_id)===o);if(!A)return{messageId:o,unavailableReason:"not-found"};if(A.deleted)return{messageId:o,unavailableReason:"deleted"};let r=vt(A.chat_id);if(!a||!r||r!==a)return{messageId:o,unavailableReason:"not-found"};let s=vt(A.msg_type)??"",g={message:{message_id:o,message_type:s,content:A.body?.content,mentions:A.mentions??[]}},c=SS(g),I=s5(g,c),p=wS(g,t),B=s==="interactive"?Nve(c):p.content,f=Kve(s,c,I);return{messageId:o,...vt(A.sender?.id)?{authorId:vt(A.sender.id)}:{},...vt(A.sender?.sender_name)?{authorName:vt(A.sender.sender_name)}:{},...B?{content:B}:{},attachments:f,...s==="interactive"&&!B&&f.length===0?{unavailableReason:"unsupported"}:{}}}}}function wS(n,t){let o=n?.message?.message_type,a=SS(n),e=s5(n,a),i=o==="image"?vt(a?.image_key):null,A=i?[i]:e?.imageKeys??[],r=o==="file"?Uve(n,t,a):null,s=xve(n,t);return{content:o==="text"?rh(n)??"":e?.text??"",images:A.map(g=>Lve(n,t,g)),files:r?[r]:[],...s?{replyTo:s}:{}}}function c5(n,t=9e3){if(n.length<=t)return[n];let o=[],a=n;for(;a.length>t;){let e=a.lastIndexOf(` `,t);ea.value===t);return o>=0?o+1:0}function LC(n){return String(n??"").replace(/[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+/gu," ").replace(/\s+/gu," ").trim()||w("\u6682\u65E0\u6807\u9898")}function Ja(n,t){return JSON.stringify({schema:"2.0",header:{title:bS(n),template:"blue"},body:{elements:t}})}function Ol(){return vn(w("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu")}function p5(n){let{workspaces:t=[],currentWorkspace:o=null,currentSession:a=null,sessions:e=[],archiveVisible:i=!1,presetCatalog:A=null,modelCatalog:r=null}=n||{},s=a?.id??null,g=a?.title??n?.currentSessionTitle??null,c=(Array.isArray(e)?e:[]).slice(0,20),I=c.length>0,p=Array.isArray(t)&&t.length>0,B=[];B.push({tag:"div",text:et(w("**\u8BBE\u7F6E**"))});let f=null;if(I){let k=c.map(J=>({text:{tag:"plain_text",content:`${J.id===s?"\u2713 ":""}${LC(J.title)}`},value:J.id}));f={tag:"select_static",name:"session_pick",placeholder:{tag:"plain_text",content:s?w("\u5207\u6362\u4F1A\u8BDD"):w("\u9009\u62E9\u4F1A\u8BDD\uFF08\u5F53\u524D\u672A\u7ED1\u5B9A\uFF09")},initial_index:ih(k,s),options:k,behaviors:[{type:"callback",value:{action:"session_pick"}}]}}let Q=null;if(p){let k=t.slice(0,20).map(J=>({text:{tag:"plain_text",content:`${J===o?"\u2713 ":""}${J}`},value:J}));Q={tag:"select_static",name:"workspace_pick",placeholder:{tag:"plain_text",content:w("\u5207\u6362\u5DE5\u4F5C\u533A")},initial_index:ih(k,o),options:k,behaviors:[{type:"callback",value:{action:"workspace_pick"}}]}}let y=Array.isArray(A?.items)?A.items:[],m=A?._currentId??null,T=m===null,_=null;if(y.length>=1){let k=y.slice(0,30).map(X=>({text:{tag:"plain_text",content:`${X.id===m?"\u2713 ":""}${X.label}`},value:X.id})),J=T?DS:m;k.unshift({text:{tag:"plain_text",content:`${T?"\u2713 ":""}${w("\u8DDF\u968F\u9ED8\u8BA4")}`},value:DS}),_={tag:"select_static",name:"preset_pick",placeholder:{tag:"plain_text",content:w("\u5207\u6362\u9884\u8BBE")},initial_index:ih(k,J),options:k,behaviors:[{type:"callback",value:{action:"preset_pick"}}]}}let R=Array.isArray(r?.groups)?r.groups:[],L=r?.current,U=L?`${L.provider}/${L.model}`:null,F=[];for(let k of R)for(let J of k.models||[])F.push({id:`${k.id}/${J.id}`,name:`${k.name} - ${J.name}`});let q=null;if(F.length>1){let k=F.slice(0,30).map(J=>({text:{tag:"plain_text",content:`${J.id===U?"\u2713 ":""}${J.name}`},value:J.id}));q={tag:"select_static",name:"model_pick",placeholder:{tag:"plain_text",content:w("\u5207\u6362\u6A21\u578B")},initial_index:ih(k,U),options:k,behaviors:[{type:"callback",value:{action:"model_pick"}}]}}function z(k){return{tag:"column",width:"weighted",weight:.1,vertical_align:"center",elements:[{tag:"div",text:{tag:"plain_text",content:k}}]}}function K(k){return{tag:"column",width:"weighted",weight:1,elements:[k]}}let G=[];f&&G.push(f),Q&&G.push(Q),G.length===2?B.push({tag:"column_set",flex_mode:"none",columns:[z("\u{1F4AC}"),K(G[0]),z("\u{1F4C2}"),K(G[1])]}):G[0]&&B.push(G[0]),I||B.push({tag:"div",text:et(w("\u5F53\u524D\u5DE5\u4F5C\u533A\u6682\u65E0\u53EF\u7528\u4F1A\u8BDD\u3002"))});let V=[],H=vn(w("\u{1F916} \u5207\u6362\u9884\u8BBE"),"presets"),N=vn(w("\u{1F9E0} \u5207\u6362\u6A21\u578B"),"models");return _?V.push(_):V.push(H),q?V.push(q):V.push(N),B.push({tag:"column_set",flex_mode:"none",columns:[z("\u{1F916}"),K(V[0]),z("\u{1F9E0}"),K(V[1])]}),B.push(Kc(w("\u{1F195} \u65B0\u4F1A\u8BDD"),"new",w("\u{1F4CB} \u4F1A\u8BDD/\u5173\u6CE8"),"sessions")),!I&&!p&&B.push(vn(w("\u{1F5C2} \u5DE5\u4F5C\u533A\u5217\u8868"),"workspaces")),B.push({tag:"hr"}),B.push({tag:"div",text:et(w("**\u4EFB\u52A1\u63A7\u5236**"))}),B.push(Kc(w("\u23F9 \u505C\u6B62"),"stop",w("\u{1F4D0} \u538B\u7F29"),"compact")),B.push({tag:"hr"}),B.push({tag:"column_set",flex_mode:"none",columns:[{tag:"column",width:"weighted",weight:1,elements:[{tag:"div",text:et(w("**\u8865\u5145\u6307\u4EE4**"))},{tag:"select_static",name:"steer_pick",placeholder:{tag:"plain_text",content:w("\u9009\u62E9\u8865\u5145\u6307\u4EE4")},initial_index:0,options:[...S5.map(k=>({text:{tag:"plain_text",content:w(k)},value:w(k)})),{text:{tag:"plain_text",content:w("\u270F\uFE0F \u66F4\u591A / \u81EA\u5B9A\u4E49\u2026")},value:"custom"}],behaviors:[{type:"callback",value:{action:"steer_pick"}}]}]},{tag:"column",width:"weighted",weight:1,elements:[{tag:"div",text:et(w("\u{1F5C4} \u5F52\u6863\uFF1A{state}",{state:i?w("\u5DF2\u663E\u793A"):w("\u5DF2\u9690\u85CF")}))},vn(w("\u5207\u6362\u5F52\u6863\u663E\u793A"),"archive_toggle")]}]}),B.push({tag:"hr"}),B.push(Kc(w("\u{1F4CA} \u72B6\u6001"),"status",w("\u{1F4D6} \u5E2E\u52A9"),"help")),B.push({tag:"div",text:et(w(`**\u6570\u5B57\u515C\u5E95** **1**\u5DE5\u4F5C\u533A\u5217\u8868 \xB7 **2**\u65B0\u4F1A\u8BDD \xB7 **3**\u4F1A\u8BDD\u5217\u8868 \xB7 **4**\u72B6\u6001 **5**\u{1F527}\u8865\u5168\u6743\u9650 \xB7 **6**\u5E2E\u52A9`))}),Ja(w("\u{1F916} \u52A9\u624B\u4E2D\u5FC3"),B)}function d5(n){let{items:t,defaultId:o}=n,a=n._currentId,e=t.find(s=>s.id===a),i=t.find(s=>s.id===o),A=a===null?w("\u8DDF\u968F Host \u9ED8\u8BA4{default}",{default:i?`\uFF08${i.label}\uFF09`:""}):e?`${e.label}\uFF08${e.id}\uFF09`:w("{id}\uFF08\u5DF2\u4E0D\u53EF\u7528\uFF09",{id:a}),r=[{tag:"div",text:et(w("**\u5F53\u524D**\uFF1A{value}",{value:A}))},{tag:"div",text:et(w("**Host \u9ED8\u8BA4**\uFF1A{value}",{value:i?`${i.label}\uFF08${i.id}\uFF09`:w("\u672A\u8BBE\u7F6E")}))},{tag:"hr"}];if(t.length>=1){let s=t.map(g=>({text:{tag:"plain_text",content:`${g.label}\uFF08${g.id}\uFF09${g.id===a?" \u2713":""}`},value:g.id}));r.push({tag:"select_static",name:"preset_pick",placeholder:{tag:"plain_text",content:w("\u9009\u62E9\u9884\u8BBE")},initial_index:a===null?0:ih(s,a),options:s,behaviors:[{type:"callback",value:{action:"preset_pick"}}]},{tag:"hr"},Kc(w("\u{1F504} \u8DDF\u968F\u9ED8\u8BA4"),"preset_default",w("\u{1F519} \u8FD4\u56DE\u83DC\u5355"),"back_to_menu"))}else r.push({tag:"div",text:et(w("\u5F53\u524D\u6CA1\u6709\u53EF\u9009\u62E9\u7684\u9884\u8BBE\u3002"))},Ol());return Ja(w("\u{1F916} \u9884\u8BBE\u5217\u8868"),r)}function h5(n){let{groups:t,current:o}=n,a=o?`${o.provider}/${o.model}`:null,e=[{tag:"div",text:et(w("**\u5F53\u524D\u6A21\u578B**\uFF1A{model}",{model:a||w("\u672A\u8BBE\u7F6E")}))},{tag:"hr"}],i=0;for(let A of t)i+=A.models.length;if(i===0)e.push({tag:"div",text:et(w("\u5F53\u524D\u6CA1\u6709\u53EF\u7528\u6A21\u578B\u3002"))},Ol());else{for(let r of t){let s=r.models.map(g=>{let c=`${r.id}/${g.id}`;return`${c}${c===a?" \u2713":""}`});e.push({tag:"div",text:et(`**${r.name}** @@ -380,7 +380,7 @@ ${w("\u2935\uFE0F \u6700\u7EC8\u7ED3\u679C\u89C1\u4E0B\u65B9")}`),await this.#i( When conversationType is group, reply more seriously. When conversationType is direct, make the reply humorous and funny.`,"\u4EC5\u4F9D\u636E\u5F53\u524D\u6D88\u606F\u7684 \u4E2D\u5B9E\u9645\u63D0\u4F9B\u7684\u5B57\u6BB5\u7406\u89E3\u6765\u6E90\uFF1B\u6CA1\u6709\u63D0\u4F9B\u7684\u5B57\u6BB5\u4E0D\u8981\u731C\u6D4B\u6216\u8865\u5168\u3002\n\u5F53\u524D\u6D88\u606F\u6765\u81EA\u7FA4\u804A\uFF0C\u8BF7\u4F7F\u7528\u4E25\u8083\u3001\u514B\u5236\u3001\u7B80\u6D01\u7684\u8868\u8FBE\u65B9\u5F0F\u3002":`Understand the source only from fields actually present in for the current message; do not guess or fill in missing fields. This message is from a group chat. Use a serious, restrained, and concise style.`,"\u4EC5\u4F9D\u636E\u5F53\u524D\u6D88\u606F\u7684 \u4E2D\u5B9E\u9645\u63D0\u4F9B\u7684\u5B57\u6BB5\u7406\u89E3\u6765\u6E90\uFF1B\u6CA1\u6709\u63D0\u4F9B\u7684\u5B57\u6BB5\u4E0D\u8981\u731C\u6D4B\u6216\u8865\u5168\u3002\n\u5F53\u524D\u6D88\u606F\u6765\u81EA\u79C1\u804A\uFF0C\u53EF\u4EE5\u4F7F\u7528\u66F4\u8F7B\u677E\u3001\u5E7D\u9ED8\u3001\u8BE6\u7EC6\u7684\u8868\u8FBE\u65B9\u5F0F\u3002":`Understand the source only from fields actually present in for the current message; do not guess or fill in missing fields. This message is from a direct chat. You may use a lighter, more humorous, and detailed style.`,\u586B\u5165\u793A\u4F8B:"Use example",\u6E05\u7A7A:"Clear","\u9009\u62E9\u5728\u54EA\u4E9B\u4F1A\u8BDD\u4E2D\u542F\u7528\u3001\u63D0\u4F9B\u54EA\u4E9B\u6765\u6E90\u5B57\u6BB5\uFF0C\u4EE5\u53CA\u5982\u4F55\u4F7F\u7528\u8FD9\u4E9B\u4FE1\u606F\u3002\u4EC5\u4F7F\u7528\u5DF2\u6709\u6D88\u606F\u5143\u6570\u636E\uFF0C\u4E0D\u67E5\u8BE2\u5E73\u53F0 API\u3002":"Choose which conversations to enhance, which source fields to include, and how to use them. Only existing message metadata is used; no platform APIs are queried.","\u589E\u5F3A\u63D0\u793A\u8BCD\u4E2D\u8BF7\u4F7F\u7528\u5B57\u6BB5\u540D\uFF08\u5982 senderId\u3001conversationType\uFF09\u5F15\u7528\u8FD9\u4E9B\u4FE1\u606F\u3002\u53EA\u53D1\u9001\u52FE\u9009\u4E14\u5F53\u524D\u6D88\u606F\u4E2D\u53EF\u7528\u7684\u5B57\u6BB5\uFF0C\u4E0D\u4F1A\u989D\u5916\u67E5\u8BE2\u6216\u8865\u5168\u3002":"Reference these values by field name (such as senderId or conversationType) in the guidance. Only selected fields available in the current message are sent; no extra lookups are made.","\u589E\u5F3A\u63D0\u793A\u8BCD\u4E2D\u8BF7\u4F7F\u7528\u5B57\u6BB5\u540D\uFF08\u5982 senderId\u3001conversationType\uFF09\u5F15\u7528\u8FD9\u4E9B\u4FE1\u606F\u3002\u53EA\u53D1\u9001\u5F53\u524D\u4F1A\u8BDD\u4E2D\u52FE\u9009\u4E14\u53EF\u7528\u7684\u5B57\u6BB5\uFF0C\u4E0D\u4F1A\u989D\u5916\u67E5\u8BE2\u6216\u8865\u5168\u3002":"Reference these values by field name (such as senderId or conversationType) in the guidance. Only fields selected and available in the current conversation are sent; no extra lookups are made.","\u7528\u4E8E\u544A\u8BC9\u6A21\u578B\u5982\u4F55\u4F7F\u7528\u5F53\u524D\u7FA4\u804A\u6D88\u606F\u7684 \u6765\u6E90\u5B57\u6BB5\u3002\u53EA\u586B\u5199\u6B63\u6587\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u6DFB\u52A0 \u6210\u5BF9\u6807\u7B7E\u3002":"Tell the model how to use fields for the current group message. Enter only the body; the plugin adds paired tags.","\u7528\u4E8E\u544A\u8BC9\u6A21\u578B\u5982\u4F55\u4F7F\u7528\u5F53\u524D\u79C1\u804A\u6D88\u606F\u7684 \u6765\u6E90\u5B57\u6BB5\u3002\u53EA\u586B\u5199\u6B63\u6587\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u6DFB\u52A0 \u6210\u5BF9\u6807\u7B7E\u3002":"Tell the model how to use fields for the current direct message. Enter only the body; the plugin adds paired tags.","\u4EC5\u5728\u7FA4\u804A\u5F00\u5173\u5F00\u542F\u65F6\u4F7F\u7528\u3002\u6E05\u7A7A\u5E76\u4FDD\u5B58\u540E\u4E0D\u518D\u9644\u52A0\u7FA4\u804A\u589E\u5F3A\u63D0\u793A\u8BCD\uFF1B\u6240\u9009\u6765\u6E90\u5B57\u6BB5\u4ECD\u6309\u5F53\u524D\u573A\u666F\u8BBE\u7F6E\u53D1\u9001\u3002":"Used only when group enhancement is enabled. Clear and save to omit group guidance; selected source fields still follow the group settings.","\u4EC5\u5728\u79C1\u804A\u5F00\u5173\u5F00\u542F\u65F6\u4F7F\u7528\u3002\u6E05\u7A7A\u5E76\u4FDD\u5B58\u540E\u4E0D\u518D\u9644\u52A0\u79C1\u804A\u589E\u5F3A\u63D0\u793A\u8BCD\uFF1B\u6240\u9009\u6765\u6E90\u5B57\u6BB5\u4ECD\u6309\u5F53\u524D\u573A\u666F\u8BBE\u7F6E\u53D1\u9001\u3002":"Used only when direct enhancement is enabled. Clear and save to omit direct guidance; selected source fields still follow the direct settings.","\u53EA\u9700\u586B\u5199\u6B63\u6587\uFF0C\u63D2\u4EF6\u81EA\u52A8\u6DFB\u52A0 \u6210\u5BF9\u6807\u7B7E\u3002\u6E05\u7A7A\u5E76\u4FDD\u5B58\u540E\uFF0C\u4E0D\u518D\u9644\u52A0\u589E\u5F3A\u63D0\u793A\u8BCD\uFF0C\u5DF2\u9009\u6765\u6E90\u5B57\u6BB5\u4ECD\u6309\u5F00\u5173\u8BBE\u7F6E\u53D1\u9001\u3002":"Enter only the body; the plugin adds paired tags. Clear and save to omit guidance. Selected source fields still follow the conversation switches.","\u53D1\u9001\u8005\u6807\u8BC6\u53EF\u80FD\u5305\u542B\u5E73\u53F0\u7528\u6237 ID \u6216\u7535\u8BDD\u53F7\u7801\u5F62\u5F0F\u7684\u6807\u8BC6\u3002\u5173\u95ED\u5F00\u5173\u4E0D\u4F1A\u5220\u9664\u5DF2\u7ECF\u5199\u5165\u4F1A\u8BDD\u5386\u53F2\u7684\u4FE1\u606F\u3002":"Sender IDs may contain platform user IDs or phone-number-like identifiers. Turning this off does not remove information already saved in conversation history.","\u4E0A\u4E0B\u6587\u589E\u5F3A\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not save context enhancement. Try again.","\u8BF7\u63D0\u4EA4\u5B8C\u6574\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":"Submit the complete context enhancement settings.","\u7FA4\u804A\u548C\u79C1\u804A\u5F00\u5173\u5FC5\u987B\u662F\u5E03\u5C14\u503C\u3002":"Group and direct switches must be booleans.","\u6765\u6E90\u5B57\u6BB5\u53EA\u80FD\u9009\u62E9\u5DF2\u5B9A\u4E49\u7684\u516B\u4E2A\u5B57\u6BB5\u3002":"Source fields must be chosen from the eight defined fields.","\u4FDD\u5B58\u4E2D\u2026":"Saving\u2026",\u672A\u8BBE\u7F6E:"Not set","\u5DE5\u4F5C\u533A\u4FEE\u6539\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not update the workspace. Try again.","\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":"Enter an absolute workspace path.","\u5DE5\u4F5C\u533A\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84\u3002":"The workspace must be an absolute path.","\u5DE5\u4F5C\u533A\u8DEF\u5F84\u4E0D\u5B58\u5728\u3002":"The workspace path does not exist.","\u5DE5\u4F5C\u533A\u8DEF\u5F84\u5FC5\u987B\u6307\u5411\u4E00\u4E2A\u76EE\u5F55\u3002":"The workspace path must point to a directory.","\u627E\u4E0D\u5230\u8981\u4FEE\u6539\u7684\u673A\u5668\u4EBA\u3002":"The bot could not be found.","Agent Preset":"Agent Preset","\u67E5\u770B Agent Preset \u8BF4\u660E":"View Agent Preset help","\u8DDF\u968F Host \u9ED8\u8BA4":"Follow the Host default","\uFF08\u5DF2\u4E0D\u53EF\u7528\uFF09":" (unavailable)","\u53EA\u5F71\u54CD\u65B0\u5EFA\u4F1A\u8BDD\uFF1B\u82E5\u5F53\u524D\u804A\u5929\u5DF2\u6709\u4F1A\u8BDD\uFF0C\u5148\u53D1\u9001 /new\uFF0C\u518D\u53D1\u9001\u666E\u901A\u6D88\u606F\u751F\u6548\u3002":"This affects only new sessions. If the current chat already has a session, send /new, then send a regular message to apply it.","\u5F53\u524D Agent Preset \u5DF2\u4E0D\u53EF\u7528\uFF0C\u8BF7\u9009\u62E9\u5176\u4ED6 Preset \u6216\u8DDF\u968F Host \u9ED8\u8BA4\u3002":"The current Agent Preset is unavailable. Choose another preset or follow the Host default.","Agent Preset \u4FEE\u6539\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not update the Agent Preset. Try again.","\u8BF7\u9009\u62E9 Agent Preset\u3002":"Choose an Agent Preset.","Agent Preset \u65E0\u6548\u3002":"The Agent Preset is invalid.","Agent Preset \u4E0D\u5B58\u5728\u6216\u4E0D\u53EF\u7528\u3002":"The Agent Preset does not exist or is unavailable.",\u5C1A\u672A\u68C0\u67E5:"Not checked yet",\u521A\u521A:"Just now",\u68C0\u67E5\u8FDE\u63A5:"Check connection","\u68C0\u67E5\u4E2D\u2026":"Checking\u2026","\u8FDE\u63A5\u68C0\u67E5\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Connection check failed. Try again later.","\u673A\u5668\u4EBA\u5DF2\u4FDD\u5B58\uFF0C\u4F46\u8FDE\u63A5\u672A\u5C31\u7EEA":"The bot was saved, but the connection is not ready",\u67E5\u770B\u5DF2\u4FDD\u5B58\u7684\u673A\u5668\u4EBA:"View saved bot","\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u8BF7\u5230\u5BF9\u5E94\u673A\u5668\u4EBA\u4F1A\u8BDD\u4E2D\u786E\u8BA4\u3002":"Test message sent. Check the matching bot conversation.","\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\u3002\u673A\u5668\u4EBA\u5C1A\u672A\u6536\u5230\u53EF\u7528\u4E8E\u6D4B\u8BD5\u7684\u79C1\u804A\u6D88\u606F\u3002":"Connection check completed. The bot has not received a direct message it can use for testing.","\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u4F46\u6D4B\u8BD5\u6D88\u606F\u53D1\u9001\u5931\u8D25\u3002":"Connection check completed, but the test message could not be sent.","\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u8BF7\u5230\u98DE\u4E66\u4F1A\u8BDD\u4E2D\u786E\u8BA4\u3002":"Test message sent. Check the Feishu conversation.","\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u8BF7\u5230 WhatsApp \u81EA\u804A\u4F1A\u8BDD\u4E2D\u786E\u8BA4\u3002":"Test message sent. Check the WhatsApp self-chat.","\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u4F46\u5F53\u524D\u6CA1\u6709\u53EF\u7528\u7684 WhatsApp \u81EA\u804A\u76EE\u6807\u3002":"Connection check completed, but no WhatsApp self-chat target is available.","\u9489\u9489\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\u3002":"DingTalk connection check completed and the test message was sent.","\u9489\u9489\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u4F46\u6D4B\u8BD5\u6D88\u606F\u53D1\u9001\u5931\u8D25\u3002":"DingTalk connection check completed, but the test message could not be sent.","\u5FAE\u4FE1\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\u3002":"WeChat connection check completed and the test message was sent.","\u5FAE\u4FE1\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u4F46\u6D4B\u8BD5\u6D88\u606F\u53D1\u9001\u5931\u8D25\u3002":"WeChat connection check completed, but the test message could not be sent.","\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\u3002":"WeCom connection check completed and the test message was sent.","\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u68C0\u67E5\u5B8C\u6210\uFF0C\u4F46\u6D4B\u8BD5\u6D88\u606F\u53D1\u9001\u5931\u8D25\u3002":"WeCom connection check completed, but the test message could not be sent.",\u91CD\u8BD5\u8FDE\u63A5:"Reconnect","\u91CD\u8BD5\u4E2D\u2026":"Retrying\u2026",\u79FB\u9664\u63A5\u5165:"Remove connection",\u786E\u8BA4\u79FB\u9664\u63A5\u5165:"Remove connection",\u786E\u8BA4\u79FB\u9664:"Remove","\u6B63\u5728\u79FB\u9664\u2026":"Removing\u2026",\u4FDD\u7559\u673A\u5668\u4EBA:"Keep bot",\u4FDD\u7559\u8D26\u53F7:"Keep account",\u53D6\u6D88:"Cancel",\u5173\u95ED:"Close",\u7ACB\u5373\u91CD\u8BD5:"Retry now",\u91CD\u65B0\u8BFB\u53D6:"Reload",\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801:"Generate a new QR code",\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u540E\u7EE7\u7EED:"Generate a new QR code",\u5237\u65B0\u4E8C\u7EF4\u7801:"Refresh QR code","\u5237\u65B0\u4E2D\u2026":"Refreshing\u2026",\u6362\u4E00\u4E2A\u4E8C\u7EF4\u7801:"Get another QR code",\u7EE7\u7EED\u8FDE\u63A5:"Continue connecting",\u7ED1\u5B9A\u5E76\u8FDE\u63A5:"Connect","\u6B63\u5728\u7ED1\u5B9A\u2026":"Connecting\u2026",\u9A8C\u8BC1\u5E76\u8FDE\u63A5:"Verify and connect","\u6B63\u5728\u9A8C\u8BC1\u5E76\u8FDE\u63A5\u2026":"Verifying and connecting\u2026","\u6B63\u5728\u9A8C\u8BC1\u2026":"Verifying\u2026","\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5":"The operation failed. Try again later.",\u8BF7\u7A0D\u540E\u91CD\u8BD5:"Try again later.",\u5F53\u524D\u4E8C\u7EF4\u7801\u6709\u6548\u65F6\u95F4:"QR code expires in",\u4E8C\u7EF4\u7801\u6709\u6548\u65F6\u95F4:"QR code expires in",\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F:"QR code expired",\u4E8C\u7EF4\u7801\u5DF2\u5931\u6548:"QR code expired","\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\n\u8BF7\u91CD\u65B0\u751F\u6210":`QR code expired -Generate a new one`,"\u4E8C\u7EF4\u7801\u56FE\u7247\u6B63\u5728\u751F\u6210\u2026":"Generating QR code\u2026","\u4E8C\u7EF4\u7801\u6B63\u5728\u751F\u6210\u2026":"Generating QR code\u2026","\u4E8C\u7EF4\u7801\u6B63\u5728\u81EA\u52A8\u5237\u65B0\u2026":"Refreshing QR code\u2026","\u4E8C\u7EF4\u7801\u672A\u5C31\u7EEA\uFF0C\u8BF7\u6253\u5F00\u6388\u6743\u94FE\u63A5":"The QR code is not ready. Open the authorization link.","\u4E8C\u7EF4\u7801\u56FE\u7247\u672A\u5C31\u7EEA\uFF0C\u8BF7\u4F7F\u7528\u5907\u7528\u94FE\u63A5\u3002":"The QR code is not ready. Use the alternate link.","\u4E8C\u7EF4\u7801\u56FE\u7247\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002":"The QR code is not ready. Generate a new one.",\u7B49\u5F85\u5237\u65B0:"Waiting to refresh",\u6B63\u5728\u5237\u65B0\u4E8C\u7EF4\u7801:"Refreshing QR code",\u6253\u5F00\u5907\u7528\u94FE\u63A5:"Open alternate link",\u751F\u6210\u4E8C\u7EF4\u7801:"Generate QR code",\u751F\u6210\u5FAE\u4FE1\u4E8C\u7EF4\u7801:"Generate WeChat QR code",\u751F\u6210\u98DE\u4E66\u4E8C\u7EF4\u7801:"Generate Feishu QR code",\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801:"Generate DingTalk QR code",\u751F\u6210\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801:"Generate WeCom QR code","\u751F\u6210 QQ \u4E8C\u7EF4\u7801":"Generate QQ QR code","\u6B63\u5728\u751F\u6210\u4E8C\u7EF4\u7801\u2026":"Generating QR code\u2026",\u6B63\u5728\u51C6\u5907\u6388\u6743\u4E8C\u7EF4\u7801:"Preparing authorization QR code",\u6B63\u5728\u51C6\u5907\u6743\u9650\u6388\u6743\u4E8C\u7EF4\u7801:"Preparing permission authorization QR code",\u6B63\u5728\u51C6\u5907\u5FAE\u4FE1\u4E8C\u7EF4\u7801:"Preparing WeChat QR code",\u6B63\u5728\u6DFB\u52A0\u65B0\u673A\u5668\u4EBA:"Adding a new bot","\u6B63\u5728\u7533\u8BF7\u9489\u9489\u6388\u6743\u4E8C\u7EF4\u7801\u2026":"Requesting DingTalk authorization QR code\u2026","\u6B63\u5728\u7533\u8BF7\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u2026":"Requesting WeCom QR code\u2026","\u6B63\u5728\u7533\u8BF7 QQ \u4E8C\u7EF4\u7801\u2026":"Requesting QQ QR code\u2026","\u6B63\u5728\u751F\u6210 WhatsApp \u4E8C\u7EF4\u7801":"Generating WhatsApp QR code","\u626B\u7801\uFF0C\u521B\u5EFA\u7B2C\u4E00\u4E2A\u98DE\u4E66\u5165\u53E3":"Scan to create your first Feishu bot","\u626B\u7801\u53EA\u4F1A\u65B0\u589E\u4E00\u4E2A\u673A\u5668\u4EBA\uFF0C\u5DF2\u63A5\u5165\u7684\u673A\u5668\u4EBA\u4F1A\u7EE7\u7EED\u6B63\u5E38\u6536\u53D1\u6D88\u606F\u3002":"Scanning adds one bot. Existing bots will continue to send and receive messages.","\u65E0\u9700\u624B\u52A8\u586B\u5199 App ID\u3002\u4EE5\u540E\u8FD8\u53EF\u4EE5\u7EE7\u7EED\u6DFB\u52A0\u673A\u5668\u4EBA\uFF0C\u5206\u522B\u670D\u52A1\u4E0D\u540C\u56E2\u961F\u6216\u98DE\u4E66\u79DF\u6237\u3002":"No App ID is required. You can add more bots later for different teams or Feishu tenants.",\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u521B\u5EFA\u673A\u5668\u4EBA:"Scan with Feishu to create a bot",\u5237\u65B0\u4E8C\u7EF4\u7801\u540E\u7EE7\u7EED:"Refresh the QR code to continue","\u6253\u5F00\u98DE\u4E66\u79FB\u52A8\u7AEF\uFF0C\u4F7F\u7528\u626B\u4E00\u626B\u8BFB\u53D6\u4E8C\u7EF4\u7801":"Open Feishu on your phone and scan the QR code","\u6838\u5BF9\u5E94\u7528\u540D\u79F0\u4E0E\u6743\u9650\u8303\u56F4\uFF0C\u5E76\u786E\u8BA4\u521B\u5EFA":"Review the app name and permissions, then confirm","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u65B0\u673A\u5668\u4EBA\u7684\u957F\u8FDE\u63A5\u5C31\u7EEA":"Keep this page open until the bot connection is ready",\u5728\u98DE\u4E66\u4E2D\u6253\u5F00:"Open in Feishu",\u53D6\u6D88\u6DFB\u52A0:"Cancel",\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u8865\u5168\u6743\u9650:"Scan with Feishu to complete permissions",\u4F7F\u7528\u98DE\u4E66\u786E\u8BA4\u7FA4\u6D88\u606F\u6743\u9650:"Confirm group-message permission with Feishu","\u626B\u7801\u4F1A\u66F4\u65B0\u73B0\u6709\u98DE\u4E66\u5E94\u7528\uFF0C\u53EA\u589E\u91CF\u5F00\u901A\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF1B\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u53D7\u5F71\u54CD\u3002":"Scanning updates the existing Feishu app with only the \u201CRead all messages in associated group chat\u201D scope. It does not create a new app. After confirmation, \u201CRespond to all group messages\u201D is enabled automatically; other bots are unaffected.","\u6838\u5BF9\u73B0\u6709\u5E94\u7528\uFF0C\u5E76\u786E\u8BA4\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650":"Review the existing app and confirm the \u201CRead all messages in associated group chat\u201D permission","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6743\u9650\u751F\u6548\u5E76\u81EA\u52A8\u5207\u6362\u54CD\u5E94\u65B9\u5F0F":"Keep this page open while the permission takes effect and the response mode switches automatically",\u53D6\u6D88\u6388\u6743:"Cancel authorization","\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u542F\u7528\u5168\u90E8\u6D88\u606F\u6A21\u5F0F":"Confirmed. Enabling all-message mode","\u6743\u9650\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u4FDD\u5B58\u8BBE\u7F6E\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"The permission update was submitted. Saving the setting and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.","\u6743\u9650\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u542F\u7528\u5168\u90E8\u6D88\u606F\u6A21\u5F0F\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"The permission update was submitted. Enabling all-message mode and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.","\u6B63\u5728\u4E3A\u73B0\u6709\u98DE\u4E66\u5E94\u7528\u7533\u8BF7\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002":"Requesting a group-message permission QR code for the existing Feishu app\u2026",\u7FA4\u6D88\u606F\u6743\u9650\u6CA1\u6709\u5F00\u901A\u5B8C\u6210:"Group-message permission was not granted","\u626B\u7801\u4F1A\u66F4\u65B0\u73B0\u6709\u98DE\u4E66\u5E94\u7528\uFF0C\u589E\u91CF\u8865\u5145\u5F53\u524D\u7F3A\u5C11\u7684\u5361\u7247\u6309\u94AE\u56DE\u8C03\u3001\u8BFB\u53D6\u7528\u6237\u6D88\u606F\u5185\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\u3001\u4E0A\u4F20\u673A\u5668\u4EBA\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:resource\uFF0C\u4EE5\u53CA\u539F\u751F\u547D\u4EE4\u9762\u677F\u6240\u9700\u7684 application:app_slash_command:read / write\uFF1B\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002\u786E\u8BA4\u9875\u53EA\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u9879\uFF0C\u5B8C\u6210\u540E\u6B64\u673A\u5668\u4EBA\u4F1A\u77ED\u6682\u91CD\u8FDE\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u53D7\u5F71\u54CD\u3002":"Scanning updates the existing Feishu app with the missing card-button callback, im:message:readonly for reading images or files in user messages (shown by Feishu as \u201CRead direct and group messages\u201D), im:resource for uploading images or files sent by the bot, and application:app_slash_command:read / write for the native command panel. It does not create a new app. The confirmation page shows only missing items; this bot reconnects briefly afterward, while other bots are unaffected.","\u6838\u5BF9\u73B0\u6709\u5E94\u7528\u540D\u79F0\uFF0C\u5E76\u786E\u8BA4\u53EA\u65B0\u589E\u5F53\u524D\u7F3A\u5C11\u7684\u4E0A\u8FF0\u914D\u7F6E":"Review the existing app name and confirm that only the missing items described above are added","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6743\u9650\u4E0E\u56DE\u8C03\u8865\u5168\u5B8C\u6210":"Keep this page open until permissions and the callback are complete",\u53D6\u6D88\u8865\u5168:"Cancel setup","\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u5B8C\u6210\u6743\u9650\u4E0E\u56DE\u8C03\u914D\u7F6E":"Confirmed. Completing permissions and callback setup",\u6B63\u5728\u51C6\u5907\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801:"Preparing the permission-completion QR code","\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u4FDD\u5B58\u6743\u9650\u3001\u9A8C\u8BC1\u5361\u7247\u56DE\u8C03\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"The update was submitted. Saving permissions, verifying the card callback, and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.","\u6B63\u5728\u4E3A\u73B0\u6709\u98DE\u4E66\u5E94\u7528\u7533\u8BF7\u4E00\u6B21\u6027\u66F4\u65B0\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002":"Requesting a one-time update QR code for the existing Feishu app\u2026",\u6743\u9650\u4E0E\u56DE\u8C03\u6CA1\u6709\u8865\u5168\u5B8C\u6210:"Permissions and callback setup did not finish",\u8865\u5168\u6743\u9650:"Complete permissions",\u8865\u5168\u8303\u56F4:"Completion scope","\u589E\u91CF\u6DFB\u52A0\u5F53\u524D\u7F3A\u5C11\u7684\u5361\u7247\u56DE\u8C03 card.action.trigger\u3001\u8BFB\u53D6\u6D88\u606F\u5185\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\u3001\u4E0A\u4F20\u673A\u5668\u4EBA\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:resource\uFF0C\u4EE5\u53CA\u539F\u751F\u547D\u4EE4\u9762\u677F\u6240\u9700\u7684 application:app_slash_command:read / write\uFF1B\u786E\u8BA4\u9875\u53EA\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u9879\uFF0C\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002":"Adds the missing card callback card.action.trigger, im:message:readonly for reading images or files in messages (shown by Feishu as \u201CRead direct and group messages\u201D), im:resource for uploading images or files sent by the bot, and application:app_slash_command:read / write for the native command panel. The confirmation page shows only missing items; no new app is created.","\u7B49\u5F85\u626B\u7801\u2026":"Waiting for scan\u2026",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u5339\u914D\u7684\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801:"Feishu returned a permission-completion QR code for a different bot",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u5339\u914D\u7684\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801:"Feishu returned a group-message permission QR code for a different bot","\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u4FEE\u590D\u4FE1\u606F\u7F3A\u5C11 botId":"Feishu repair status is missing the bot ID","\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u5E94\u7528\u66F4\u65B0\u4FE1\u606F\u7F3A\u5C11 botId":"Feishu app-update status is missing the bot ID",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u5339\u914D\u7684\u6CE8\u518C\u8FDB\u5EA6:"Feishu returned registration progress for a different operation",\u6B64\u673A\u5668\u4EBA:"this bot","\u7528\u4E8E\u4E3A${botName}\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801":"One-time QR code for granting group-message permission to ${botName}","\u6B63\u5728\u4E3A\u300C${botName}\u300D\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650":"Granting group-message permission to \u201C${botName}\u201D",'${botName ?? "\u673A\u5668\u4EBA"}\u7684\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u3002':'Permission-completion QR code generated for ${botName ?? "bot"}. Scan it with Feishu.','${botName ?? "\u673A\u5668\u4EBA"}\u7684\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u98DE\u4E66\u786E\u8BA4\u3002':'Group-message permission QR code generated for ${botName ?? "bot"}. Confirm it with Feishu.',"${targetBotName}\u5DF2\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\uFF0C\u5E76\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\u3002":"${targetBotName} now has group-message permission and \u201CRespond to all group messages\u201D is enabled.","${targetBot.bot.name}\u5DF2\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\uFF0C\u5E76\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\u3002":"${targetBot.bot.name} now has group-message permission and \u201CRespond to all group messages\u201D is enabled.","${targetBot.bot.name}\u5DF2\u8FDE\u63A5\uFF0C\u53EF\u4EE5\u5728\u98DE\u4E66\u4E2D\u5F00\u59CB\u804A\u5929\u3002":"${targetBot.bot.name} is connected and ready to chat in Feishu.","\u5DF2\u53D6\u6D88\u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03\u3002":"Completing permissions and the callback was cancelled.","\u5DF2\u53D6\u6D88\u7FA4\u6D88\u606F\u6743\u9650\u6388\u6743\u3002":"Group-message permission authorization was cancelled.","\u6743\u9650\u4E0E\u56DE\u8C03\u5DF2\u66F4\u65B0\uFF0C\u4F46\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u673A\u5668\u4EBA\u8FDE\u63A5\u72B6\u6001":"Permissions and the callback were updated, but the bot connection could not be confirmed yet","\u7FA4\u6D88\u606F\u6743\u9650\u5DF2\u66F4\u65B0\uFF0C\u4F46\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u673A\u5668\u4EBA\u8FDE\u63A5\u72B6\u6001":"The group-message permission was updated, but the bot connection could not be confirmed yet",\u98DE\u4E66\u6743\u9650\u4E0E\u56DE\u8C03\u8865\u5168\u5931\u8D25:"Could not complete Feishu permissions and callback setup",\u98DE\u4E66\u7FA4\u6D88\u606F\u6743\u9650\u5F00\u901A\u5931\u8D25:"Could not grant the Feishu group-message permission","\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u98DE\u4E66\u6388\u6743\u64CD\u4F5C\uFF0C\u518D\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\u3002":"Finish the current Feishu authorization before granting group-message permission.","\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u8FDE\u63A5\u65B0\u673A\u5668\u4EBA":"Confirmed. Connecting the new bot","\u6B63\u5728\u5B89\u5168\u4FDD\u5B58\u51ED\u636E\u5E76\u68C0\u67E5\u65B0\u673A\u5668\u4EBA\u7684\u6D88\u606F\u901A\u9053\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"Saving credentials and checking the new bot connection. Existing bots will not be interrupted.","\u6B63\u5728\u5411\u98DE\u4E66\u7533\u8BF7\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002":"Requesting a one-time authorization QR code from Feishu\u2026",\u65B0\u673A\u5668\u4EBA\u6CA1\u6709\u6DFB\u52A0\u5B8C\u6210:"The new bot was not added","\u65B0\u98DE\u4E66\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5\uFF0C\u53EF\u4EE5\u5F00\u59CB\u804A\u5929\u3002":"The new Feishu bot is connected and ready to chat.",\u98DE\u4E66\u5E94\u7528\u521B\u5EFA\u5931\u8D25:"Could not create the Feishu app","\u673A\u5668\u4EBA\u5DF2\u7ECF\u521B\u5EFA\uFF0C\u4F46\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u8FDE\u63A5\u72B6\u6001":"The bot was created, but its connection could not be confirmed yet",\u673A\u5668\u4EBA\u4ECD\u672A\u8FDE\u63A5:"The bot is still offline",\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5:"The bot is not connected yet",\u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38:"Persistent connection is healthy",\u957F\u8FDE\u63A5:"Persistent connection",\u5E94\u7528\u6807\u8BC6\u5DF2\u5B89\u5168\u4FDD\u5B58:"App identifier stored securely",\u673A\u5668\u4EBA\u6807\u8BC6\u5DF2\u5B89\u5168\u4FDD\u5B58:"Bot identifier stored securely",\u5DF2\u5B89\u5168\u4FDD\u5B58:"Stored securely",\u5DF2\u63A5\u5165\u7684\u5FAE\u4FE1\u8D26\u53F7:"Connected WeChat accounts",\u5DF2\u63A5\u5165\u7684\u673A\u5668\u4EBA:"Connected bots",\u5DF2\u63A5\u5165\u7684\u9489\u9489\u673A\u5668\u4EBA:"Connected DingTalk bots",\u5DF2\u7ED1\u5B9A\u7684\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connected WeCom bots","\u5DF2\u7ED1\u5B9A\u7684 QQ \u673A\u5668\u4EBA":"Connected QQ bots","\u5DF2\u63A5\u5165\u7684 WhatsApp \u673A\u5668\u4EBA":"Connected WhatsApp accounts",\u4F7F\u7528\u624B\u673A\u5FAE\u4FE1\u626B\u63CF\u4E8C\u7EF4\u7801:"Scan with WeChat on your phone","\u626B\u4E00\u6B21\u7801\uFF0C\u5C31\u80FD\u5728\u5FAE\u4FE1\u91CC\u4F7F\u7528 Harness":"Scan once to use Harness in WeChat",\u6253\u5F00\u624B\u673A\u5FAE\u4FE1\u5E76\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801:"Open WeChat on your phone and scan the QR code",\u5728\u5FAE\u4FE1\u4E2D\u786E\u8BA4\u8FDE\u63A5\u8BE5\u673A\u5668\u4EBA:"Confirm the bot connection in WeChat","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u673A\u5668\u4EBA\u81EA\u52A8\u8FDE\u63A5":"Keep this page open while the bot connects",\u7B49\u5F85\u5FAE\u4FE1\u626B\u7801:"Waiting for WeChat scan",\u9700\u8981\u914D\u5BF9\u7801:"Pairing code required",\u8F93\u5165\u624B\u673A\u5FAE\u4FE1\u663E\u793A\u7684\u6570\u5B57:"Enter the number shown in WeChat",\u5FAE\u4FE1\u914D\u5BF9\u7801:"WeChat pairing code","\u5DF2\u626B\u7801\uFF0C\u8BF7\u5728\u624B\u673A\u4E0A\u786E\u8BA4":"Scanned. Confirm on your phone","\u914D\u5BF9\u7801\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u7B49\u5F85\u5FAE\u4FE1\u786E\u8BA4\u3002":"Pairing code submitted. Waiting for WeChat confirmation.","\u8FD9\u662F\u5FAE\u4FE1\u9644\u52A0\u7684\u5B89\u5168\u786E\u8BA4\u6B65\u9AA4\u3002\u914D\u5BF9\u7801\u53EA\u7528\u4E8E\u672C\u6B21\u626B\u7801\u8F6E\u8BE2\uFF0C\u4E0D\u4F1A\u5199\u5165\u914D\u7F6E\u6216\u65E5\u5FD7\u3002":"This is an additional WeChat confirmation step. The pairing code is used only for this connection and is never stored.","\u6B63\u5728\u4FDD\u5B58\u51ED\u636E\u5E76\u9A8C\u8BC1 Harness \u4E0E\u5FAE\u4FE1\u957F\u8F6E\u8BE2\u3002":"Saving credentials and verifying the WeChat connection.","\u5FAE\u4FE1\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u542F\u52A8\u6D88\u606F\u8FDE\u63A5":"Confirmed in WeChat. Starting the message connection","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u8BFB\u53D6\u73B0\u6709\u767B\u5F55\u51ED\u636E\u3002\u8BF7\u68C0\u67E5 DSH \u51ED\u636E\u5B58\u50A8\u3002":"WeChat was authorized, but the existing login credential could not be read. Check the DSH credential store.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u767B\u5F55\u51ED\u636E\u65E0\u6CD5\u5199\u5165 DSH \u51ED\u636E\u5B58\u50A8\u3002\u8BF7\u68C0\u67E5\u51ED\u636E\u5B58\u50A8\u662F\u5426\u53EF\u5199\u3002":"WeChat was authorized, but the login credential could not be written to the DSH credential store. Check that the store is writable.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u8D26\u53F7\u914D\u7F6E\u65E0\u6CD5\u5199\u5165\u672C\u673A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u76EE\u5F55\u6743\u9650\u3002":"WeChat was authorized, but the account configuration could not be saved locally. Check the DSH_HOME directory permissions.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u521D\u59CB\u5316\u8D26\u53F7\u72B6\u6001\u6216\u5DE5\u4F5C\u533A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u548C\u5DE5\u4F5C\u533A\u76EE\u5F55\u3002":"WeChat was authorized, but the account state or workspace could not be initialized. Check DSH_HOME and the workspace directory.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u63D2\u4EF6\u65E0\u6CD5\u8FDE\u63A5\u672C\u673A Harness\u3002\u8BF7\u68C0\u67E5 dsh web \u5730\u5740\u548C\u7AEF\u53E3\u3002":"WeChat was authorized, but the plugin could not connect to the local Harness. Check the dsh web address and port.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8D85\u65F6\u3002\u8BF7\u786E\u8BA4 dsh web \u672A\u963B\u585E\u3002":"WeChat was authorized, but the Harness health check timed out. Confirm that dsh web is not blocked.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u672C\u673A\u5065\u5EB7\u68C0\u67E5\u3002\u8BF7\u68C0\u67E5 Host \u4FE1\u4EFB\u914D\u7F6E\u3002":"WeChat was authorized, but Harness denied the local health check. Check the Host trust configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u627E\u4E0D\u5230 Harness \u5065\u5EB7\u68C0\u67E5\u63A5\u53E3\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but the Harness health endpoint was not found. Confirm that Harness and the plugin are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8FD4\u56DE\u670D\u52A1\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check returned a service error. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but Harness returned an unrecognized response. Confirm that Harness and the plugin are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u5065\u5EB7\u68C0\u67E5\u8BF7\u6C42\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but Harness rejected the health-check request. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check failed unexpectedly. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u521D\u59CB\u5316\u5931\u8D25\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u540E\u91CD\u8BD5\u3002":"WeChat was authorized, but the message connection could not be initialized. Check the dsh web logs and try again.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6FC0\u6D3B\u8FC7\u7A0B\u4E2D\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but an unknown error occurred during activation. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u7ED1\u5B9A\uFF0C\u53EF\u4EE5\u5F00\u59CB\u5411\u5DF2\u7ED1\u5B9A\u7684\u673A\u5668\u4EBA\u53D1\u6D88\u606F\u3002":"WeChat is connected and ready for messages.","\u8FD9\u4E2A\u5FAE\u4FE1\u8D26\u53F7\u5DF2\u7ECF\u7ED1\u5B9A\u5E76\u4FDD\u6301\u5728\u7EBF\u3002":"This WeChat account is connected and online.","\u5FAE\u4FE1\u8D26\u53F7\u53CA\u672C\u673A\u51ED\u636E\u5DF2\u79FB\u9664\u3002":"The WeChat account and local credentials were removed.","\u5DF2\u53D6\u6D88\u5FAE\u4FE1\u7ED1\u5B9A\u3002":"WeChat setup was cancelled.","\u6B63\u5728\u8054\u7CFB\u817E\u8BAF\u5FAE\u4FE1 iLink \u670D\u52A1\u3002":"Contacting the WeChat iLink service.","iLink \u957F\u8F6E\u8BE2":"iLink long polling","\u626B\u4E00\u6B21\u7801\uFF0C\u81EA\u52A8\u521B\u5EFA\u5E76\u8FDE\u63A5\u673A\u5668\u4EBA":"Scan once to create and connect a bot","\u4F7F\u7528\u9489\u9489 App \u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743":"Authorize the bot with the DingTalk app","\u4F7F\u7528\u5DF2\u52A0\u5165\u4F01\u4E1A/\u7EC4\u7EC7\u7684\u9489\u9489\u8D26\u53F7\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Scan the QR code with a DingTalk account that belongs to an organization","\u5728\u6388\u6743\u9875\u70B9\u51FB\u201C\u4E00\u952E\u521B\u5EFA\u65B0\u673A\u5668\u4EBA\u201D":"Select \u201CCreate new bot\u201D on the authorization page","\u8BF7\u52FF\u5173\u95ED\u672C\u9875\uFF0C\u9489\u9489\u5B8C\u6210\u6388\u6743\u540E\u5C06\u81EA\u52A8\u7EE7\u7EED\u3002":"Keep this page open. Setup will continue after DingTalk authorization.",\u7B49\u5F85\u9489\u9489\u626B\u7801\u6388\u6743:"Waiting for DingTalk authorization","\u6388\u6743\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u521B\u5EFA\u9489\u9489\u673A\u5668\u4EBA":"Authorized. Creating the DingTalk bot",\u6B63\u5728\u786E\u8BA4\u9489\u9489\u6388\u6743:"Confirming DingTalk authorization","\u6B63\u5728\u68C0\u67E5\u9489\u9489 Stream \u957F\u8FDE\u63A5\uFF0C\u6210\u529F\u540E\u4F1A\u81EA\u52A8\u663E\u793A\u4E3A\u5728\u7EBF\u3002":"Checking the DingTalk Stream connection. It will appear online when ready.","\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0C\u53EF\u4EE5\u5F00\u59CB\u53D1\u9001\u6D88\u606F\u3002":"The DingTalk bot is connected and ready for messages.","\u8FD9\u4E2A\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u7ECF\u63A5\u5165\u5E76\u4FDD\u6301\u5728\u7EBF\u3002":"This DingTalk bot is connected and online.","Stream \u957F\u8FDE\u63A5":"Stream persistent connection","\u4F7F\u7528\u4F01\u4E1A\u5FAE\u4FE1 App \u626B\u7801\u521B\u5EFA\u667A\u80FD\u673A\u5668\u4EBA":"Scan with WeCom to create an AI bot","\u4F7F\u7528\u4F01\u4E1A\u5FAE\u4FE1 App \u5B8C\u6210\u667A\u80FD\u673A\u5668\u4EBA\u6388\u6743":"Authorize the AI bot with WeCom","\u6253\u5F00\u4F01\u4E1A\u5FAE\u4FE1 App\uFF0C\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Open WeCom and scan the QR code",\u5728\u817E\u8BAF\u6388\u6743\u9875\u9762\u786E\u8BA4\u521B\u5EFA\u667A\u80FD\u673A\u5668\u4EBA:"Confirm bot creation on the Tencent authorization page",\u8FD4\u56DE\u8FD9\u91CC\u7B49\u5F85\u8FDE\u63A5\u5B8C\u6210:"Return here and wait for the connection to complete","\u7B49\u5F85\u4F01\u4E1A\u5FAE\u4FE1 App \u626B\u7801":"Waiting for WeCom scan","\u4F01\u4E1A\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u6B63\u5728\u8FDE\u63A5\u673A\u5668\u4EBA":"Authorized in WeCom. Connecting the bot","\u51ED\u636E\u6B63\u5728\u5199\u5165\u672C\u673A\uFF0C\u5E76\u542F\u52A8\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u6D88\u606F\u8FDE\u63A5\u3002":"Saving credentials locally and starting the WeCom WebSocket connection.","WebSocket \u957F\u8FDE\u63A5":"WebSocket persistent connection","\u4F7F\u7528\u624B\u673A QQ \u626B\u7801\u521B\u5EFA\u5E76\u7ED1\u5B9A\u673A\u5668\u4EBA":"Scan with mobile QQ to create and connect a bot","\u4F7F\u7528\u624B\u673A QQ \u5B8C\u6210\u673A\u5668\u4EBA\u7ED1\u5B9A":"Complete bot setup with mobile QQ","\u6253\u5F00\u624B\u673A QQ\uFF0C\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Open mobile QQ and scan the QR code",\u5728\u817E\u8BAF\u6388\u6743\u9875\u9762\u786E\u8BA4\u521B\u5EFA\u6216\u7ED1\u5B9A\u673A\u5668\u4EBA:"Confirm bot creation or connection on the Tencent authorization page","\u7B49\u5F85\u624B\u673A QQ \u626B\u7801":"Waiting for mobile QQ scan","QQ \u5DF2\u6388\u6743\uFF0C\u6B63\u5728\u8FDE\u63A5\u673A\u5668\u4EBA":"Authorized in QQ. Connecting the bot","\u51ED\u636E\u6B63\u5728\u5199\u5165\u672C\u673A\uFF0C\u5E76\u542F\u52A8 QQ WebSocket \u6D88\u606F\u8FDE\u63A5\u3002":"Saving credentials locally and starting the QQ WebSocket connection.","\u4F7F\u7528\u624B\u673A WhatsApp \u626B\u63CF\u4E8C\u7EF4\u7801\u5373\u53EF\u63A5\u5165\u3002":"Scan the QR code with WhatsApp to connect.","\u7528\u624B\u673A WhatsApp \u626B\u63CF\u4E8C\u7EF4\u7801":"Scan with WhatsApp on your phone","\u6253\u5F00 WhatsApp \u2192 \u8BBE\u7F6E \u2192 \u5DF2\u5173\u8054\u8BBE\u5907":"Open WhatsApp \u2192 Settings \u2192 Linked devices","\u70B9\u51FB\u201C\u5173\u8054\u8BBE\u5907\u201D\u5E76\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Select \u201CLink a device\u201D and scan the QR code","\u7B49\u5F85 WhatsApp \u626B\u7801":"Waiting for WhatsApp scan","\u5DF2\u626B\u7801\uFF0C\u6B63\u5728\u8FDE\u63A5 WhatsApp":"Scanned. Connecting WhatsApp","\u6B63\u5728\u5EFA\u7ACB\u5B89\u5168\u7684\u5173\u8054\u8BBE\u5907\u4F1A\u8BDD\u3002":"Creating a secure linked-device session.","\u5173\u8054\u8BBE\u5907\u6B63\u5728\u63A5\u5165 DeepSeek Harness\u3002":"Linking the device to DeepSeek Harness.","WhatsApp Web \u5173\u8054\u8BBE\u5907\u8FD0\u884C\u6B63\u5E38":"WhatsApp linked device is healthy","\u67E5\u770B WhatsApp \u8BBF\u95EE\u6A21\u5F0F\u8BF4\u660E":"View WhatsApp access mode details","WhatsApp \u8BBF\u95EE\u6A21\u5F0F":"WhatsApp access mode",\u4EC5\u81EA\u5DF1\u6A21\u5F0F:"Only me",\u6307\u5B9A\u8054\u7CFB\u4EBA\u6A21\u5F0F:"Selected contacts",\u5F00\u653E\u54CD\u5E94\u6A21\u5F0F:"Open responses","\u4EC5\u81EA\u5DF1\u6A21\u5F0F\uFF08\u9ED8\u8BA4\uFF09":"Only me (default)","\u5DF2\u751F\u6548\uFF1A":"Active: ","\u53EA\u54CD\u5E94\u5DF2\u7ED1\u5B9A WhatsApp \u8D26\u53F7\u7684\u81EA\u804A\u6D88\u606F\u3002":"Only respond to self-chat messages from the linked WhatsApp account.","\u54CD\u5E94\u81EA\u804A\u548C\u767D\u540D\u5355\u8054\u7CFB\u4EBA\u7684\u79C1\u804A\uFF0C\u5FFD\u7565\u7FA4\u804A\u3002":"Respond to self-chat and allowlisted direct messages; ignore group messages.","\u54CD\u5E94\u6240\u6709\u79C1\u804A\u3001\u5DF2\u7ED1\u5B9A\u8D26\u53F7\u81EA\u5DF1\u53D1\u51FA\u7684\u7FA4\u804A\u6D88\u606F\uFF0C\u4EE5\u53CA\u5176\u4ED6\u7FA4\u6210\u5458\u7684\u63D0\u53CA\u6216\u56DE\u590D\u3002":"Respond to all direct messages, group messages sent by the linked account, and mentions or replies from other group members.","\u5141\u8BB8\u79C1\u804A\u7684 WhatsApp \u7535\u8BDD\u53F7\u7801":"WhatsApp phone numbers allowed to send direct messages",\u6BCF\u884C\u4E00\u4E2A\u542B\u56FD\u5BB6\u6216\u5730\u533A\u4EE3\u7801\u7684\u53F7\u7801:"One number with country or region code per line","\u53EF\u4EE5\u5305\u542B\u5F00\u5934\u7684 +\uFF0C\u4FDD\u5B58\u65F6\u4F1A\u81EA\u52A8\u79FB\u9664\u3002":"A leading + is allowed and removed when saved.","\u4EC5\u6307\u5B9A\u8054\u7CFB\u4EBA\u6A21\u5F0F\u4F7F\u7528\u767D\u540D\u5355\uFF0C\u5207\u6362\u6A21\u5F0F\u65F6\u4F1A\u4FDD\u7559\u3002":"Only Selected contacts uses the allowlist; it is retained when modes change.","\u767D\u540D\u5355\u4E3A\u7A7A\uFF1B\u4FDD\u5B58\u540E\u5C06\u53EA\u63A5\u53D7\u81EA\u804A\u6D88\u606F\u3002":"The allowlist is empty; only self-chat messages will be accepted after saving.","\u7535\u8BDD\u53F7\u7801\u5FC5\u987B\u5305\u542B\u56FD\u5BB6\u6216\u5730\u533A\u4EE3\u7801\uFF0C\u6BCF\u884C\u4E00\u4E2A\u3002":"Each phone number must include a country or region code on its own line.","WhatsApp \u8BBF\u95EE\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"WhatsApp access settings are currently unavailable.","WhatsApp \u8BBF\u95EE\u8BBE\u7F6E\u4FDD\u5B58\u5931\u8D25\u3002":"Could not save WhatsApp access settings.","Bot API \u957F\u8F6E\u8BE2":"Bot API long polling"," Gateway \u957F\u8FDE\u63A5":" Gateway persistent connection","Gateway \u957F\u8FDE\u63A5":"Gateway persistent connection"," Socket Mode \u957F\u8FDE\u63A5":" Socket Mode persistent connection","Socket Mode \u957F\u8FDE\u63A5":"Socket Mode persistent connection","\u63A5\u5165 Telegram \u673A\u5668\u4EBA":"Connect a Telegram bot","\u5148\u901A\u8FC7 @BotFather \u83B7\u53D6 Bot Token\uFF0C\u518D\u5728\u8FD9\u91CC\u5B8C\u6210\u63A5\u5165\u3002":"Get a Bot Token from @BotFather, then connect it here.","\u586B\u5199 @BotFather \u751F\u6210\u7684 Bot Token":"Enter the Bot Token from @BotFather",\u8BBF\u95EE\u6A21\u5F0F:"Access mode","Telegram \u8BBF\u95EE\u6A21\u5F0F":"Telegram access mode","\u67E5\u770B Telegram \u8BBF\u95EE\u6A21\u5F0F\u8BF4\u660E":"View Telegram access mode details","\u7FA4\u804A\u5168\u90E8\u5FFD\u7565\uFF0C\u79C1\u804A\u4EC5\u5141\u8BB8\u767D\u540D\u5355\u7528\u6237\u3002":"All group messages are ignored; only allowlisted users may send DMs.","\u4FDD\u6301\u539F\u6709\u884C\u4E3A\uFF1A\u79C1\u804A\u76F4\u63A5\u54CD\u5E94\uFF0C\u7FA4\u804A\u5728\u88AB\u63D0\u53CA\u6216\u56DE\u590D\u65F6\u54CD\u5E94\u3002":"Keep the original behavior: respond to DMs and to group mentions or replies.",\u5B89\u5168\u6A21\u5F0F:"Safe mode",\u517C\u5BB9\u6A21\u5F0F:"Compatible mode","\u5DF2\u751F\u6548\uFF1A\u5B89\u5168\u6A21\u5F0F":"Active: Safe mode","\u5DF2\u751F\u6548\uFF1A\u517C\u5BB9\u6A21\u5F0F":"Active: Compatible mode",\u6A21\u5F0F:"Mode","\u517C\u5BB9\u6A21\u5F0F\uFF08\u9ED8\u8BA4\uFF09":"Compatible mode (default)","\u5B89\u5168\u6A21\u5F0F\uFF08\u79C1\u804A\u767D\u540D\u5355\uFF09":"Safe mode (private-chat allowlist)","\u5141\u8BB8\u79C1\u804A\u7684 Telegram User ID":"Telegram User IDs allowed to send DMs","\u6BCF\u884C\u4E00\u4E2A\u6570\u5B57 User ID":"One numeric User ID per line","\u767D\u540D\u5355\u4EC5\u5C5E\u4E8E\u5F53\u524D\u673A\u5668\u4EBA\u3002":"This allowlist belongs only to the current bot.","\u517C\u5BB9\u6A21\u5F0F\u4E0B\u6682\u4E0D\u4F7F\u7528\u767D\u540D\u5355\uFF0C\u5207\u6362\u6A21\u5F0F\u65F6\u4F1A\u4FDD\u7559\u3002":"Compatible mode does not enforce the allowlist; it is retained when modes change.","\u767D\u540D\u5355\u4E3A\u7A7A\uFF1B\u4FDD\u5B58\u540E\u8BE5\u673A\u5668\u4EBA\u4F1A\u62D2\u7EDD\u6240\u6709\u5165\u7AD9\u6D88\u606F\u3002":"The allowlist is empty; this bot will reject all inbound messages after saving.","\u6B63\u5728\u4FDD\u5B58\u2026":"Saving\u2026",\u4FDD\u5B58\u8BBF\u95EE\u8BBE\u7F6E:"Save access settings","User ID \u5FC5\u987B\u662F 1\u201316 \u4F4D\u6B63\u6574\u6570\uFF0C\u6BCF\u884C\u4E00\u4E2A\u3002":"Each User ID must be a 1\u201316 digit positive integer on its own line.","Telegram \u8BBF\u95EE\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"Telegram access settings are currently unavailable.","Telegram \u8BBF\u95EE\u8BBE\u7F6E\u4FDD\u5B58\u5931\u8D25\u3002":"Could not save Telegram access settings.","\u63A5\u5165 Discord \u673A\u5668\u4EBA":"Connect a Discord bot","\u5148\u5728 Developer Portal \u521B\u5EFA Bot \u5E76\u9080\u8BF7\u5230\u670D\u52A1\u5668\uFF0C\u518D\u5728\u8FD9\u91CC\u5B8C\u6210\u63A5\u5165\u3002":"Create a bot in the Developer Portal and invite it to your server, then connect it here.","\u586B\u5199 Discord Developer Portal \u7684 Bot Token":"Enter the Bot Token from the Discord Developer Portal","\u63A5\u5165 Slack \u673A\u5668\u4EBA":"Connect a Slack bot","\u5148\u7528 Manifest \u521B\u5EFA\u5E76\u914D\u7F6E Slack App":"Create and configure a Slack app with the manifest","\u590D\u5236\u914D\u7F6E\u540E\uFF0C\u5728 Slack \u9009\u62E9 From a manifest\uFF1B\u521B\u5EFA\u5B8C\u6210\u540E\u751F\u6210 connections:write App Token\uFF0C\u5E76\u5C06\u5E94\u7528\u5B89\u88C5\u5230\u5DE5\u4F5C\u533A\u3002":"Copy the manifest and choose \u201CFrom a manifest\u201D in Slack. Then create a connections:write App Token and install the app to your workspace.","\u590D\u5236 Manifest":"Copy manifest","\u5DF2\u590D\u5236 Manifest":"Manifest copied","\u6253\u5F00 Slack \u521B\u5EFA\u9875":"Open Slack app creation","Bot Token \u6765\u81EA OAuth & Permissions\uFF1BApp Token \u6765\u81EA Basic Information\uFF0C\u5E76\u4E14\u5FC5\u987B\u5305\u542B connections:write\u3002":"Get the Bot Token from OAuth & Permissions and the App Token from Basic Information. The App Token must include connections:write.","\u4F7F\u7528\u5B98\u65B9 App Manifest \u5FEB\u901F\u914D\u7F6E\u673A\u5668\u4EBA\uFF0C\u518D\u586B\u5199 Bot Token \u4E0E App Token \u5EFA\u7ACB\u672C\u5730 Socket Mode \u8FDE\u63A5\u3002":"Configure the bot with the official app manifest, then enter the Bot Token and App Token to start a local Socket Mode connection.","Slack \u5DE5\u4F5C\u533A":"Slack workspace","Bot Token \u4E0E App Token":"Bot Token and App Token","\u586B\u5199 Bot Token":"Enter Bot Token",\u624B\u52A8\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA:"Connect Feishu bot manually",\u624B\u52A8\u63A5\u5165\u9489\u9489\u673A\u5668\u4EBA:"Connect DingTalk bot manually",\u624B\u52A8\u63A5\u5165\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connect WeCom bot manually",\u624B\u52A8\u63A5\u5165QQ\u673A\u5668\u4EBA:"Connect QQ bot manually","\u586B\u5199\u98DE\u4E66\u5F00\u653E\u5E73\u53F0 App ID":"Enter the Feishu Open Platform App ID","\u586B\u5199\u98DE\u4E66\u5F00\u653E\u5E73\u53F0 App Secret":"Enter the Feishu Open Platform App Secret","\u586B\u5199\u9489\u9489\u5E94\u7528 Client ID":"Enter the DingTalk Client ID","\u586B\u5199\u9489\u9489\u5E94\u7528 Client Secret":"Enter the DingTalk Client Secret","\u586B\u5199\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA Bot ID":"Enter the WeCom AI Bot ID","\u586B\u5199\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA Secret":"Enter the WeCom AI Bot Secret","\u586B\u5199 QQ \u5F00\u653E\u5E73\u53F0 AppID":"Enter the QQ Open Platform AppID","\u586B\u5199 QQ \u5F00\u653E\u5E73\u53F0 AppSecret":"Enter the QQ Open Platform AppSecret",\u626B\u7801\u63A5\u5165\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connect WeChat bot by QR code",\u626B\u7801\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA:"Connect Feishu bot by QR code",\u626B\u7801\u63A5\u5165\u9489\u9489\u673A\u5668\u4EBA:"Connect DingTalk bot by QR code",\u626B\u7801\u63A5\u5165\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connect WeCom bot by QR code","\u626B\u7801\u63A5\u5165 QQ \u673A\u5668\u4EBA":"Connect QQ bot by QR code","\u626B\u7801\u63A5\u5165 WhatsApp \u673A\u5668\u4EBA":"Connect WhatsApp by QR code","\u626B\u7801\u7ED1\u5B9A WhatsApp \u673A\u5668\u4EBA":"Connect WhatsApp by QR code","\u4F7F\u7528 App ID \u548C App Secret \u7ED1\u5B9A\u98DE\u4E66\u673A\u5668\u4EBA":"Connect a Feishu bot with App ID and App Secret","\u4F7F\u7528 Client ID \u548C Client Secret \u7ED1\u5B9A\u9489\u9489\u673A\u5668\u4EBA":"Connect a DingTalk bot with Client ID and Client Secret","\u4F7F\u7528 Bot ID \u548C Secret \u7ED1\u5B9A\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA":"Connect a WeCom bot with Bot ID and Secret","\u4F7F\u7528 AppID \u548C AppSecret \u7ED1\u5B9A QQ \u673A\u5668\u4EBA":"Connect a QQ bot with AppID and AppSecret","\u4F7F\u7528 Manifest \u548C\u53CC Token \u63A5\u5165 Slack \u673A\u5668\u4EBA":"Connect a Slack bot with a manifest and two tokens","\u4F7F\u7528 Bot Token \u63A5\u5165 Telegram \u673A\u5668\u4EBA":"Connect a Telegram bot with a Bot Token","\u4F7F\u7528 Bot Token \u63A5\u5165 Discord \u673A\u5668\u4EBA":"Connect a Discord bot with a Bot Token",\u53D6\u6D88\u7ED1\u5B9A:"Cancel setup",\u53D6\u6D88\u63A5\u5165:"Cancel setup","\u4E8C\u7EF4\u7801\u7531\u817E\u8BAF\u5FAE\u4FE1 iLink \u670D\u52A1\u7B7E\u53D1\u3002\u7528\u624B\u673A\u5FAE\u4FE1\u626B\u63CF\u5E76\u786E\u8BA4\u540E\uFF0C\u8D26\u53F7\u51ED\u636E\u4F1A\u76F4\u63A5\u5199\u5165 Harness Host\uFF0C\u6D4F\u89C8\u5668\u4E0D\u4F1A\u6536\u5230 bot_token\u3002":"The QR code is issued by Tencent WeChat iLink. After you scan and confirm, account credentials are written directly to the Harness Host and are never exposed to the browser.","\u626B\u7801\u8D26\u53F7\u5FC5\u987B\u5DF2\u52A0\u5165\u4F01\u4E1A/\u7EC4\u7EC7\u3002\u5982\u679C\u9489\u9489\u63D0\u793A\u5C1A\u672A\u52A0\u5165\u7EC4\u7EC7\uFF0C\u8BF7\u5728\u63D0\u793A\u9875\u521B\u5EFA\u7EC4\u7EC7\uFF0C\u6216\u6362\u7528\u5DF2\u52A0\u5165\u7EC4\u7EC7\u7684\u8D26\u53F7\u3002":"The DingTalk account must belong to an organization. If prompted, create an organization or use an account that already belongs to one.","\u8BF7\u5728\u624B\u673A\u4E0A\u6838\u5BF9\u5E76\u786E\u8BA4\u6388\u6743\u3002\u90E8\u5206\u8D26\u53F7\u4F1A\u989D\u5916\u663E\u793A\u4E00\u4E2A\u914D\u5BF9\u6570\u5B57\uFF0C\u9875\u9762\u4F1A\u5728\u9700\u8981\u65F6\u63D0\u793A\u8F93\u5165\u3002":"Review and confirm authorization on your phone. Some accounts may also require a pairing number.","\u6388\u6743\u7531\u9489\u9489\u5B98\u65B9\u9875\u9762\u5B8C\u6210\u3002\u626B\u7801\u8D26\u53F7\u5FC5\u987B\u5DF2\u52A0\u5165\u4E00\u4E2A\u4F01\u4E1A/\u7EC4\u7EC7\u5E76\u6709\u6743\u521B\u5EFA\u673A\u5668\u4EBA\uFF1B\u521B\u5EFA\u6210\u529F\u540E\uFF0C\u5E94\u7528\u51ED\u636E\u4F1A\u76F4\u63A5\u5199\u5165 Harness Host\u3002":"Authorization is completed on DingTalk\u2019s official page. The account must belong to an organization and be allowed to create bots. Credentials are written directly to the Harness Host.","\u626B\u7801\u7531\u817E\u8BAF\u5B98\u65B9\u9875\u9762\u5B8C\u6210\uFF0C\u4E0D\u9700\u8981\u624B\u52A8\u586B\u5199 AppID \u6216 AppSecret\u3002\u626B\u7801\u6210\u529F\u540E\uFF0C\u673A\u5668\u4EBA\u4F1A\u81EA\u52A8\u8FDE\u63A5 DeepSeek Harness\u3002":"Scanning is completed on Tencent\u2019s official page. No AppID or AppSecret is required, and the bot connects automatically.","\u626B\u7801\u7531\u817E\u8BAF\u5B98\u65B9\u9875\u9762\u5B8C\u6210\uFF0C\u4E0D\u9700\u8981\u624B\u52A8\u586B\u5199 Bot ID \u6216 Secret\u3002\u521B\u5EFA\u6210\u529F\u540E\uFF0C\u673A\u5668\u4EBA\u4F1A\u81EA\u52A8\u8FDE\u63A5 DeepSeek Harness\u3002":"Scanning is completed on Tencent\u2019s official page. No Bot ID or Secret is required, and the bot connects automatically.","\u817E\u8BAF\u9875\u9762\u4F1A\u521B\u5EFA\u6216\u7ED1\u5B9A\u4E00\u4E2A QQ \u673A\u5668\u4EBA\uFF0C\u5E76\u628A\u8FDE\u63A5\u51ED\u636E\u5B89\u5168\u4EA4\u7ED9\u672C\u673A Harness Host\u3002":"Tencent will create or connect a QQ bot and securely deliver its credentials to the local Harness Host.","\u4F01\u4E1A\u5FAE\u4FE1\u5B98\u65B9\u9875\u9762\u4F1A\u521B\u5EFA\u4E00\u4E2A\u667A\u80FD\u673A\u5668\u4EBA\uFF0C\u5E76\u628A\u8FDE\u63A5\u51ED\u636E\u5B89\u5168\u4EA4\u7ED9\u672C\u673A Harness Host\u3002":"WeCom will create an AI bot and securely deliver its credentials to the local Harness Host.","\u4ECE\u6B64 Harness \u79FB\u9664\u8FD9\u4E2A\u5FAE\u4FE1\u8D26\u53F7\uFF1F":"Remove this WeChat account from Harness?","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684 bot_token\u3001\u8D26\u53F7\u914D\u7F6E\u548C\u4F1A\u8BDD\u6620\u5C04\u3002\u5176\u4ED6\u5FAE\u4FE1\u8D26\u53F7\u4E0D\u53D7\u5F71\u54CD\u3002":"This stops the message connection and removes the locally stored bot_token, account configuration, and session mappings. Other WeChat accounts are not affected.","\u6B64\u64CD\u4F5C\u4F1A\u505C\u6B62\u8FD9\u4E2A\u673A\u5668\u4EBA\u7684\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u4FDD\u5B58\u5728\u672C\u673A\u7684\u63A5\u5165\u914D\u7F6E\u548C\u51ED\u636E\u3002\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u5E94\u7528\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E5F\u4E0D\u53D7\u5F71\u54CD\u3002":"This stops the bot connection and removes the locally stored configuration and credentials. The app in Feishu Open Platform is not deleted, and other bots are not affected.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684\u5E94\u7528\u51ED\u636E\u3001\u673A\u5668\u4EBA\u914D\u7F6E\u53CA\u4F1A\u8BDD\u6620\u5C04\u3002\u9489\u9489\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u673A\u5668\u4EBA\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\u3002":"This stops the message connection and removes the locally stored app credentials, bot configuration, and session mappings. The bot in DingTalk Open Platform is not deleted.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684\u5E94\u7528\u51ED\u636E\u3001\u673A\u5668\u4EBA\u914D\u7F6E\u53CA\u4F1A\u8BDD\u6620\u5C04\u3002\u4F01\u4E1A\u5FAE\u4FE1\u5E73\u53F0\u4E2D\u7684\u673A\u5668\u4EBA\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\u3002":"This stops the message connection and removes the locally stored app credentials, bot configuration, and session mappings. The bot in WeCom is not deleted.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684\u5E94\u7528\u51ED\u636E\u3001\u673A\u5668\u4EBA\u914D\u7F6E\u53CA\u4F1A\u8BDD\u6620\u5C04\u3002\u817E\u8BAF\u5E73\u53F0\u4E2D\u7684\u673A\u5668\u4EBA\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\u3002":"This stops the message connection and removes the locally stored app credentials, bot configuration, and session mappings. The bot on Tencent\u2019s platform is not deleted.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684 WhatsApp \u5173\u8054\u8BBE\u5907\u548C\u4F1A\u8BDD\u6620\u5C04\u3002":"This stops the message connection and removes the locally stored WhatsApp linked device and session mappings.",\u6B63\u5728\u8BFB\u53D6\u98DE\u4E66\u673A\u5668\u4EBA\u5217\u8868:"Loading Feishu bots","\u6B63\u5728\u8BFB\u53D6\u98DE\u4E66\u8FDE\u63A5\u72B6\u6001\u2026":"Loading Feishu connection status\u2026","\u6B63\u5728\u8BFB\u53D6\u5FAE\u4FE1\u8FDE\u63A5\u72B6\u6001\u2026":"Loading WeChat connection status\u2026","\u6B63\u5728\u8BFB\u53D6\u9489\u9489\u8FDE\u63A5\u72B6\u6001\u2026":"Loading DingTalk connection status\u2026","\u901A\u8FC7\u626B\u7801\u628A\u9489\u9489\u673A\u5668\u4EBA\u63A5\u5165 DeepSeek Harness":"Connect a DingTalk bot to DeepSeek Harness by QR code",\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6:"DingTalk did not return QR setup progress",\u9489\u9489\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1:"DingTalk did not return a valid setup attempt","\u9489\u9489 Stream \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"DingTalk Stream connection is healthy",\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868:"DingTalk did not return a valid bot list","${totals.connected} / ${totals.configured} \u5728\u7EBF":"${totals.connected} / ${totals.configured} online","\u7528\u4E8E\u628A\u9489\u9489\u673A\u5668\u4EBA\u63A5\u5165 DeepSeek Harness \u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for connecting a DingTalk bot to DeepSeek Harness","\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\\n\u8BF7\u91CD\u65B0\u751F\u6210":"QR code expired\\nGenerate a new one","\u673A\u5668\u4EBA\u5DF2\u521B\u5EFA\uFF0C\u6B63\u5728\u5EFA\u7ACB\u6D88\u606F\u8FDE\u63A5":"Bot created. Starting the message connection",\u9489\u9489\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u5B89\u5168\u7684\u4E8C\u7EF4\u7801:"DingTalk did not return a secure QR code","\u9489\u9489\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u9489\u9489 App \u626B\u63CF\u3002":"DingTalk QR code generated. Scan it with the DingTalk app.","\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u5DF2\u7ED1\u5B9A\u3002":"DingTalk bot credentials connected.","\u5DF2\u53D6\u6D88\u9489\u9489\u673A\u5668\u4EBA\u63A5\u5165\u3002":"DingTalk bot setup cancelled.","\u9489\u9489\u673A\u5668\u4EBA\u53CA\u672C\u673A\u51ED\u636E\u5DF2\u79FB\u9664\u3002":"DingTalk bot and local credentials removed.",\u98DE\u4E66\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u4E8C\u7EF4\u7801\u4FE1\u606F:"Feishu did not return QR code information",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u4E8C\u7EF4\u7801\u4FE1\u606F\u4E0D\u5B8C\u6574:"Feishu returned incomplete QR code information",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u673A\u5668\u4EBA\u72B6\u6001:"Feishu returned an invalid bot status","\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u673A\u5668\u4EBA\u7F3A\u5C11 botId":"The Feishu bot is missing botId",\u98DE\u4E66\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u8FDE\u63A5\u72B6\u6001:"Feishu did not return connection status",\u98DE\u4E66\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u521B\u5EFA\u8FDB\u5EA6:"Feishu did not return creation progress",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u672A\u77E5\u7684\u521B\u5EFA\u72B6\u6001:"Feishu returned an unknown creation status","\u5DF2\u63A5\u5165 ${totals.configured} \u4E2A\u673A\u5668\u4EBA\uFF0C\u5176\u4E2D ${totals.connected} \u4E2A\u5728\u7EBF":"${totals.connected} of ${totals.configured} bots online",\u5C1A\u672A\u63A5\u5165\u673A\u5668\u4EBA:"No bot connected yet","\u7528\u4E8E\u65B0\u589E DeepSeek Harness \u98DE\u4E66\u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801":"One-time authorization QR code for adding a Feishu bot to DeepSeek Harness",\u8BF7\u5237\u65B0\u540E\u91CD\u65B0\u626B\u7801:"Refresh and scan again",'${connected ? "\u68C0\u67E5\u8FDE\u63A5" : "\u91CD\u8BD5\u8FDE\u63A5"}${bot.name}':'${connected ? "Check connection" : "Reconnect"} ${bot.name}',\u65E0\u6CD5\u8BFB\u53D6\u98DE\u4E66\u673A\u5668\u4EBA:"Could not load Feishu bots","\u6388\u6743\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u3002":"Authorization QR code generated. Scan it with Feishu.","\u98DE\u4E66\u673A\u5668\u4EBA\u51ED\u636E\u5DF2\u7ED1\u5B9A\u3002":"Feishu bot credentials connected.","\u5DF2\u53D6\u6D88\u6DFB\u52A0\u673A\u5668\u4EBA\u3002":"Adding the bot was cancelled.","${newBot.bot.name}\u5DF2\u8FDE\u63A5\uFF0C\u53EF\u4EE5\u5728\u98DE\u4E66\u4E2D\u5F00\u59CB\u804A\u5929\u3002":"${newBot.bot.name} is connected and ready to chat in Feishu.","${bot.name}\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u67E5\u770B\u673A\u5668\u4EBA\u72B6\u6001\u3002":"${bot.name} operation failed. Check the bot status.","${bot.name}\u5DF2\u4ECE\u6B64 DeepSeek Harness \u79FB\u9664\uFF1B\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u5E94\u7528\u672A\u88AB\u5220\u9664\u3002":"${bot.name} was removed from this DeepSeek Harness. The app in Feishu Open Platform was not deleted.",\u65E0\u6CD5\u8BFB\u53D6\u8FDE\u63A5\u72B6\u6001:"Could not load connection status","QQ \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6":"QQ did not return QR setup progress","QQ \u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1":"QQ did not return a valid setup attempt","QQ WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"QQ WebSocket connection is healthy","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The QQ connection is not ready; the plugin will retry automatically.","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The QQ connection is not ready; the plugin will retry automatically","QQ \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF":"The QQ connection is currently offline","QQ \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868":"QQ did not return a valid bot list","\u5C1A\u672A\u7ED1\u5B9A QQ \u673A\u5668\u4EBA":"No QQ bot connected yet","\u7528\u4E8E\u7ED1\u5B9A QQ \u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for connecting a QQ bot","${channel}${connectionSummary}\u8FD0\u884C\u6B63\u5E38":"${channel}${connectionSummary} is healthy","${channel} \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868":"${channel} did not return a valid bot list","\u4F7F\u7528 Bot Token \u63A5\u5165 ${channel} \u673A\u5668\u4EBA":"Connect a ${channel} bot with a Bot Token","${model.totals.connected} / ${model.totals.configured} \u5728\u7EBF":"${model.totals.connected}/${model.totals.configured} online"," Bot API \u957F\u8F6E\u8BE2":" Bot API long polling",\u4F01\u4E1A\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6:"WeCom did not return QR setup progress",\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1:"WeCom did not return a valid setup attempt","\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"WeCom WebSocket connection is healthy",\u4F01\u4E1A\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868:"WeCom did not return a valid bot list",\u5C1A\u672A\u7ED1\u5B9A\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"No WeCom bot connected yet",\u7528\u4E8E\u7ED1\u5B9A\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801:"One-time QR code for connecting a WeCom bot",\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1:"WeChat did not return a valid setup attempt",\u5FAE\u4FE1\u7ED1\u5B9A\u6CA1\u6709\u5B8C\u6210:"WeChat setup did not complete",\u5FAE\u4FE1\u8FDE\u63A5\u6B63\u5E38:"WeChat connection is healthy",\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA:"WeChat connection is not ready","\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u56FE\u7247\uFF0C\u8BF7\u7528 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\uFF0C\u518D\u7528 /model <\u5E8F\u53F7> \u5207\u6362\u540E\u91CD\u53D1\u3002":"The current model does not support images. Use /models to list models, then /model to switch and resend.","\u56FE\u7247\u8D85\u8FC7\u5BBF\u4E3B\u5141\u8BB8\u7684\u5927\u5C0F\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image exceeds the Host size limit. Compress it and try again.","\u56FE\u7247\u5206\u8FA8\u7387\u8FC7\u9AD8\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image resolution is too high. Compress it and try again.","\u56FE\u7247\u5185\u5BB9\u65E0\u6548\u6216\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The image is invalid or unsupported. Send it again.","\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The image could not be read. Send it again.","\u56FE\u7247\u683C\u5F0F\u4E0E\u5B9E\u9645\u5185\u5BB9\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The declared image format does not match its content. Send it again.","\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u6570\u91CF\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u540E\u91CD\u8BD5\u3002":"The message exceeds the Host image-count limit. Remove some images and try again.","\u56FE\u7247\u603B\u5927\u5C0F\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The images exceed the Host total-size limit. Remove or compress some images and try again.","\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u53D1\u751F\u4E86\u91CD\u5B9A\u5411\uFF0C\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u3002":"The image download redirected and cannot be read.","\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image exceeds 5 MB. Compress it and try again.","\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The images are too large in total. Remove or compress some images and try again.","\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002":"The image download failed. Send it again.","\u6682\u4E0D\u652F\u6301\u8BE5\u56FE\u7247\u683C\u5F0F\uFF0C\u8BF7\u53D1\u9001 JPEG\u3001PNG\u3001WebP \u6216 GIF \u56FE\u7247\u3002":"This image format is unsupported. Send a JPEG, PNG, WebP, or GIF image.","\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Message processing failed. Try again later.",\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u8D26\u53F7\u5217\u8868:"WeChat did not return a valid account list",\u5C1A\u672A\u7ED1\u5B9A\u5FAE\u4FE1:"No WeChat account connected yet","\u7528\u4E8E\u628A\u5FAE\u4FE1\u673A\u5668\u4EBA\u7ED1\u5B9A\u5230 DeepSeek Harness \u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for connecting a WeChat bot to DeepSeek Harness","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6D88\u606F\u957F\u8F6E\u8BE2\u53D8\u4E3A\u5728\u7EBF":"Keep this page open until long polling is online","\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u624B\u673A\u5FAE\u4FE1\u626B\u63CF\u3002":"WeChat QR code generated. Scan it with WeChat on your phone.","\u79FB\u9664\u5931\u8D25\uFF1A${presentError(error).message}":"Removal failed: ${presentError(error).message}",\u65E0\u6CD5\u8BFB\u53D6\u5FAE\u4FE1\u72B6\u6001:"Could not load WeChat status","WhatsApp \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u8FDB\u5EA6":"WhatsApp did not return QR setup progress","WhatsApp \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u626B\u7801\u4EFB\u52A1":"WhatsApp did not return a valid setup attempt","WhatsApp \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868":"WhatsApp did not return a valid account list","\u7528\u4E8E\u5173\u8054 WhatsApp \u8BBE\u5907\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for linking a WhatsApp device",\u7528\u6237:"User","\u5FAE\u4FE1\u7528\u6237 ID":"WeChat user ID","\u586B\u5199\u63A5\u6536\u6D88\u606F\u7684\u7528\u6237 ID":"Enter the recipient user ID",\u79C1\u804A:"Direct message",\u7FA4\u804A:"Group","\u7FA4 Chat ID":"Group Chat ID","\u7528\u6237 ID":"User ID","\u586B\u5199\u9489\u9489\u7528\u6237 ID":"Enter the DingTalk user ID","\u7FA4 Open Conversation ID":"Group Open Conversation ID","\u586B\u5199\u4F01\u4E1A\u5FAE\u4FE1\u7528\u6237 ID":"Enter the WeCom user ID","\u586B\u5199\u7FA4 chatid":"Enter the group chatid",\u5355\u804A:"Direct message","\u7528\u6237 Open ID":"User Open ID","\u586B\u5199 user_openid":"Enter the user_openid","\u7FA4 Open ID":"Group Open ID","\u586B\u5199 group_openid":"Enter the group_openid",\u4F1A\u8BDD:"Conversation",\u7EBF\u7A0B:"Thread","Thread \u65F6\u95F4\u6233":"Thread timestamp",\u804A\u5929:"Chat",\u8BDD\u9898:"Topic",\u9891\u9053\u6216\u79C1\u4FE1:"Channel or DM","\u586B\u5199\u53EF\u53D1\u6D88\u606F\u7684 Channel ID":"Enter a Channel ID the bot can message","\u7528\u6237 JID":"User JID","\u7FA4 JID":"Group JID","\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Request failed. Try again later.","\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u81EA\u52A8\u590D\u5236\uFF0C\u8BF7\u624B\u52A8\u9009\u62E9\u590D\u5236\u3002":"Automatic copy is unavailable. Select and copy the value manually.","\u76EE\u6807\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002":"Could not save the target. Check it and try again.","\u65E0\u6CD5\u751F\u6210\u672A\u5360\u7528\u7684 Target ID\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not generate an unused Target ID. Try again.",\u7F16\u8F91\u6295\u9012\u76EE\u6807:"Edit delivery target",\u65B0\u5EFA\u6295\u9012\u76EE\u6807:"New delivery target","\u5DF2\u4ECE\u4F1A\u8BDD\u81EA\u52A8\u586B\u5165\u76EE\u6807\u4FE1\u606F\uFF1B\u786E\u8BA4\u540E\u518D\u4FDD\u5B58\u3002":"Target details were filled from the conversation. Review them before saving.","\u8BF7\u624B\u52A8\u586B\u5199\u4ECE\u5BF9\u5E94\u5E73\u53F0\u53D6\u5F97\u7684\u539F\u751F\u6807\u8BC6\u3002":"Enter the native identifier from the platform manually.","\u4F8B\u5982 daily-report":"For example, daily-report","\u4F7F\u7528\u5927\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u70B9\u3001\u4E0B\u5212\u7EBF\u3001\u5192\u53F7\u3001@ \u6216\u8FDE\u5B57\u7B26\u3002":"Use letters, numbers, dots, underscores, colons, @, or hyphens.","\u663E\u793A\u540D\u79F0\uFF08\u53EF\u9009\uFF09":"Display name (optional)","\u4F8B\u5982 \u6BCF\u65E5\u6C47\u62A5\u7FA4":"For example, Daily reports",\u76EE\u6807\u7C7B\u578B:"Target type",\u4FDD\u5B58\u76EE\u6807:"Save target",\u8BF7\u5148\u5B8C\u6210\u6295\u9012\u76EE\u6807\u8BFB\u53D6:"Wait for delivery targets to finish loading",\u4ECE\u5DF2\u804A\u8FC7\u7684\u4F1A\u8BDD\u9009\u62E9:"Choose from conversations",\u5DF2\u804A\u4F1A\u8BDD:"Conversation",\u4ECE\u4F1A\u8BDD\u9009\u62E9targetID:"Select a targetID from conversations","\u9009\u62E9\u540E\u4F1A\u81EA\u52A8\u586B\u5199\u76EE\u6807\u4FE1\u606F\u548C\u8C03\u7528\u522B\u540D\uFF0C\u786E\u8BA4\u540E\u518D\u4FDD\u5B58\u3002":"Selecting a conversation fills the target details and call alias. Review them before saving.","\u6B63\u5728\u5237\u65B0\u2026":"Refreshing\u2026",\u5237\u65B0:"Refresh","\u6B63\u5728\u8BFB\u53D6\u5DF2\u804A\u4F1A\u8BDD\u2026":"Loading known conversations\u2026","\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u804A\u4F1A\u8BDD\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not load known conversations. Try again later.",\u8FD8\u6CA1\u6709\u53EF\u9009\u62E9\u7684\u4F1A\u8BDD:"No conversations to choose from","\u5148\u5728\u5BF9\u5E94\u5E73\u53F0\u4E0E\u673A\u5668\u4EBA\u804A\u4E00\u6761\u6D88\u606F\uFF0C\u518D\u5237\u65B0\u3002":"Send the bot a message on the platform, then refresh.",\u5DF2\u6DFB\u52A0:"Added","\u624B\u52A8\u586B\u5199\uFF08\u9AD8\u7EA7\uFF09":"Enter manually (advanced)","\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u8BF7\u5230\u76EE\u6807\u4F1A\u8BDD\u786E\u8BA4\u3002":"Test message sent. Confirm it in the target conversation.","\u6D4B\u8BD5\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Test delivery failed. Try again later.",\u5DF2\u590D\u5236\u8C03\u7528\u53C2\u6570:"Call parameters copied","\u590D\u5236\u5931\u8D25\u3002":"Copy failed.","\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not delete the target. Try again later.",\u590D\u5236\u8C03\u7528\u53C2\u6570:"Copy call parameters",\u673A\u5668\u4EBA\u79BB\u7EBF\u65F6\u4E0D\u53EF\u53D1\u9001\u6D4B\u8BD5\u6D88\u606F:"Test delivery is unavailable while the bot is offline",\u6D4B\u8BD5\u6295\u9012\u76EE\u6807:"Test delivery target",\u6D4B\u8BD5:"Test",\u7F16\u8F91:"Edit",\u5220\u9664:"Delete","\u5220\u9664 ":"Delete ","\uFF1F\u4F7F\u7528\u8FD9\u4E2A targetId \u7684\u5916\u90E8\u8C03\u7528\u5C06\u8FD4\u56DE unknown-target\u3002":"? External calls using this targetId will return unknown-target.","\u6B63\u5728\u5220\u9664\u2026":"Deleting\u2026",\u786E\u8BA4\u5220\u9664:"Delete target","\u6295\u9012\u76EE\u6807\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"Delivery target settings are unavailable.","\u65E0\u6CD5\u8BFB\u53D6\u6295\u9012\u76EE\u6807\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not load delivery targets. Try again later.","\u2190 \u8FD4\u56DE\u673A\u5668\u4EBA\u5217\u8868":"\u2190 Back to bots",\u4F7F\u7528\u6587\u6863:"User guide",\u6253\u5F00\u4E3B\u52A8\u6295\u9012\u4F7F\u7528\u6587\u6863:"Open the proactive delivery guide","\u5F53\u524D\u6E20\u9053\u6682\u4E0D\u652F\u6301\u6295\u9012\u76EE\u6807\u3002":"Delivery targets are not supported for this channel.","\u5DF2\u590D\u5236 Bot ID":"Bot ID copied",\u590D\u5236:"Copy",\u6295\u9012\u76EE\u6807:"Delivery targets","\u673A\u5668\u4EBA\u5F53\u524D\u79BB\u7EBF\uFF1B\u4ECD\u53EF\u914D\u7F6E\u76EE\u6807\uFF0C\u6062\u590D\u8FDE\u63A5\u540E\u518D\u6D4B\u8BD5\u3002":"The bot is offline. You can still configure targets and test them after reconnection.",\u65B0\u5EFA\u76EE\u6807:"New target","\u6B63\u5728\u8BFB\u53D6\u6295\u9012\u76EE\u6807\u2026":"Loading delivery targets\u2026",\u5C1A\u672A\u914D\u7F6E\u6295\u9012\u76EE\u6807:"No delivery targets yet","\u70B9\u51FB\u201C\u65B0\u5EFA\u76EE\u6807\u201D\u53EF\u4ECE\u5DF2\u804A\u8FC7\u7684\u4F1A\u8BDD\u9009\u62E9\uFF0C\u4E5F\u53EF\u624B\u52A8\u586B\u5199\u3002":"Select New target to choose a conversation or enter the details manually."});var MhA=Object.freeze(Object.fromEntries(Object.keys(zGe).map(n=>[n,n==="$locale"?"zh":n])));var _hA=Object.freeze(["aria-label","alt","placeholder","title"]);var VGe=Object.freeze({defaultId:"",items:Object.freeze([])}),khA=gh.createContext(VGe);var EG="/feishu",EZ=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",beginCallbackRepair:"bot.callback-repair.begin",beginGroupMessagePermission:"bot.group-message-permission.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",disconnectBot:"bot.disconnect",deleteBot:"bot.delete",setWorkspace:"bot.workspace.set",setAgentPreset:"bot.preset.set",setContextEnhancement:"bot.context-enhancement.set",setAccessPolicy:"bot.access-policy.set",setGroupResponseMode:"bot.group-response-mode.set",testConnection:"connection.test",disconnect:"connection.disconnect"}),YhA=Object.freeze({PROVISION:"provision",CALLBACK_REPAIR:"callback_repair",GROUP_MESSAGE_PERMISSION:"group_message_permission"});var wt=Object.freeze({...EZ,setAccessPolicy:Xi,setGroupSessionScope:ea});var Ml=Object.freeze({reconnectBot:"bot.reconnect",disconnectBot:"bot.disconnect",deleteBot:"bot.delete"}),QZ=Object.freeze([...new Set([...Object.values(wt),...Object.values(Ml)])]),ZGe=new Set(["idle","starting","qr_ready","polling","slow_down","domain_switched","saving","succeeded","expired","cancelled","error"]),XGe=new Set(["provision","callback_repair","group_message_permission"]),yZ="callback_repair",CG="group_message_permission",rw=new Set([yZ,CG]),$Ge=new Set(["accounts.feishu.cn","accounts.larksuite.com","open.feishu.cn","open.larksuite.com"]),eFe=/^[A-Za-z0-9_-]{1,128}$/,AFe=/^cli_[A-Za-z0-9_-]+$/,uZ=Object.freeze({abort:"Registration was cancelled.",access_denied:"Registration was denied.",expired_token:"The registration QR code expired.",invalid_credentials:"Feishu returned invalid app credentials.",credentials_callback_failed:"Unable to activate the Feishu connection.",registration_failed:"Unable to register the Feishu app.",connection_failed:"The bot was created, but its connection could not be started.",credential_removal_failed:"Unable to remove the Feishu credentials.",state_cleanup_failed:"Unable to remove the bot session data. Please retry.",deletion_pending:"Bot deletion is incomplete. Retry removal to finish cleanup.",missing_credentials:"The bot credentials are missing. Delete it and scan again.",repair_app_mismatch:"The authorized Feishu app does not match the selected bot.",repair_owner_missing:"Feishu did not return the authorizing account identity.",repair_domain_mismatch:"The authorized Feishu tenant does not match the selected bot.",repair_owner_mismatch:"The authorizing Feishu account is not an owner of the selected bot.",repair_credentials_invalid:"Feishu returned credentials that could not be verified for the selected bot.",repair_bot_mismatch:"The verified Feishu bot does not match the selected bot.",repair_target_changed:"The selected bot changed while repair was in progress. Start the repair again.",credential_update_failed:"Unable to store the repaired Feishu credentials.",credential_state_unknown:"The repaired Feishu credentials could not be confirmed after saving.",repair_connection_failed:"The callback update was accepted, but the selected bot could not reconnect.",group_message_permission_required:"Authorize access to all group messages before enabling this mode.",group_message_permission_save_failed:"Feishu granted the permission, but all-message mode could not be saved.",group_message_permission_connection_failed:"Feishu granted the permission, but the selected bot could not reconnect.",card_action_probe_unavailable:"The selected bot is not connected, so its card button cannot be verified.",card_action_probe_send_failed:"The callback update was accepted, but the verification card could not be sent.",card_action_probe_timeout:"Feishu accepted the update, but the card button was not verified in time. Start the repair again and click the test button within two minutes.",card_action_probe_failed:"Feishu accepted the update, but the card button verification failed."}),tFe=Object.freeze({idle:"pending",starting:"pending",qr_ready:"pending",polling:"pending",slow_down:"pending",domain_switched:"pending",saving:"connecting",succeeded:"connected",expired:"expired",cancelled:"failed",error:"failed"});function rFe(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;let t=Object.getPrototypeOf(n);return t===Object.prototype||t===null}function Wo(n,t){return rFe(n)&&Reflect.ownKeys(n).every(o=>typeof o=="string"&&t.has(o))}function $C(n){return Number.isFinite(n)?n:void 0}function Fn(n){return typeof n=="string"&&eFe.test(n)}function CZ(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function fG(n){if(!n||typeof n!="object")return null;let t=typeof n.code=="string"&&Object.hasOwn(uZ,n.code)?n.code:"registration_failed";return{code:t,message:uZ[t]}}function Ts(n){if(!n||typeof n!="object")return{state:"idle",attempt:0};let t=ZGe.has(n.state)?n.state:"error",o=Fn(n.attempt)?n.attempt:$C(n.attempt)??0,a={state:t,attempt:o};a.operation=XGe.has(n.operation)?n.operation:"provision";let e=$C(n.updatedAt),i=$C(n.expiresAt),A=$C(n.remainingSeconds),r=$C(n.pollIntervalSeconds);e!==void 0&&(a.updatedAt=e),typeof n.qrCodeUrl=="string"&&n.qrCodeUrl.length>0&&(a.qrCodeUrl=n.qrCodeUrl),i!==void 0&&(a.expiresAt=i),A!==void 0&&(a.remainingSeconds=A),r!==void 0&&(a.pollIntervalSeconds=r),Fn(n.botId)&&(a.botId=n.botId);let s=fG(n.error);return s&&(a.error=s),a}function iFe(n,t,o){if(!(typeof n!="string"||n.length===0))try{let a=new URL(n);if(a.protocol!=="https:"||!$Ge.has(a.hostname)||a.port||a.username||a.password)return;if(rw.has(t)){let e=a.searchParams.getAll("clientID"),i=a.searchParams.getAll("tp"),A=a.searchParams.getAll("addons"),r=[...a.searchParams.values()].some(s=>s.includes("{{")||s.includes("}}"));if(e.length!==1||i.length!==1||i[0]!=="sdk"||!AFe.test(e[0]??"")||a.hostname!==o||a.searchParams.has("createOnly")||A.length!==1||!A[0]?.trim()||r)return}return a.toString()}catch{return}}function iw(n){let t=n&&typeof n=="object"?n:{};return{connected:t.connected===!0||t.ready===!0&&t.feishuLongConnectionState==="connected"&&t.harnessReachable===!0,ready:t.ready===!0,harnessReachable:t.harnessReachable===!0}}function mZ(n){let t=n&&typeof n=="object"?n:{},o={name:typeof t.name=="string"&&t.name.length>0?t.name:"\u98DE\u4E66\u673A\u5668\u4EBA"};return typeof t.avatarUrl=="string"&&(o.avatarUrl=t.avatarUrl),typeof t.appIdMasked=="string"&&(o.appIdMasked=t.appIdMasked),typeof t.tenantName=="string"&&(o.tenantName=t.tenantName),(t.domain==="feishu"||t.domain==="lark")&&(o.domain=t.domain),(typeof t.activated=="boolean"||typeof t.activated=="number")&&(o.activated=t.activated),o}function SZ(n,t){return t?{status:"healthy",summary:"\u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38",lastCheckedAt:Date.now()}:n?.configured===!0?{status:"offline",summary:"\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5",lastCheckedAt:Date.now()}:{status:"offline",summary:"\u5C1A\u672A\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA",lastCheckedAt:Date.now()}}function wZ(n,t,o){return o?"connected":n?.phase==="error"||t.state==="error"?"error":n?.phase==="connecting"||t.state==="saving"?"connecting":n?.phase==="registering"||["starting","qr_ready","polling","slow_down","domain_switched"].includes(t.state)?"provisioning":"disconnected"}async function DZ(n){return WGe.toDataURL(n,{errorCorrectionLevel:"M",margin:1,width:320,type:"image/png"})}async function aFe(n,t,o){let a=iFe(n.qrCodeUrl,n.operation,o),e={attemptId:String(n.attempt),operation:n.operation,...n.botId?{botId:n.botId}:{},expiresAt:n.expiresAt??Date.now()+5*6e4,pollIntervalMs:Math.max(800,Math.min(1e4,(n.pollIntervalSeconds??1.8)*1e3))};if(a)return{...e,verificationUrl:a,qrCodeDataUrl:await t(a)};if(n.state==="saving"&&rw.has(n.operation)&&n.botId)return{...e,submitted:!0}}function oFe(n){let t=n&&typeof n=="object"?n:{};if(!Fn(t.botId))return null;let o=iw(t.connection),a=t.connected===!0||o.connected,e={state:"idle"},i={botId:t.botId,state:wZ(t,e,a),connected:a,configured:t.configured===!0,agentPreset:dg(t.agentPreset),contextEnhancement:xp(t.contextEnhancement),accessPolicy:qp(t.accessPolicy),groupResponseMode:uo(t.groupResponseMode),groupMessagePermissionGranted:t.groupMessagePermissionGranted===!0,bot:mZ(t.bot),health:SZ(t,a)};typeof t.workspace=="string"&&t.workspace&&(i.workspace=t.workspace);let A=ti(t.lastMessageError);A&&(i.lastMessageError=A);let r=fG(t.error);return r&&(i.error=r),i}async function di(n,{encodeQr:t=DZ}={}){let o=n&&typeof n=="object"?n:{},a=Ts(o.registration),e=iw(o.connection),i=o.connected===!0||e.connected,r=(rw.has(a.operation)&&a.botId&&Array.isArray(o.bots)?o.bots.find(p=>p?.botId===a.botId):void 0)?.bot?.domain==="lark"?"open.larksuite.com":"open.feishu.cn",s=await aFe(a,t,r),g=fG(o.error)??a.error??null,c=Array.isArray(o.bots)?o.bots.map(oFe).filter(Boolean):[],I={schemaVersion:o.schemaVersion===2?2:1,revision:Number.isSafeInteger(o.revision)&&o.revision>=0?o.revision:0,state:wZ(o,a,i),connected:i,configured:o.configured===!0,bot:mZ(o.bot),health:SZ(o,i),bots:c,agentPresetCatalog:gs(o.agentPresetCatalog),totals:{configured:c.length||(o.configured===!0?1:0),connected:c.length?c.filter(p=>p.connected).length:i?1:0}};return s&&(I.provisioning=s),g&&(I.error=g),I}function Aw(n){return{ok:!1,error:{code:"bad-request",message:n,details:{issues:[]}}}}function tw(){return{ok:!1,error:{code:"cancelled",message:"The Feishu request was cancelled.",details:{}}}}function nFe(){return{ok:!1,error:{code:"internal",message:"The Feishu integration operation failed.",details:{}}}}function sFe(n,t){return n===wt.status?Wo(t,new Set)?null:"This endpoint accepts an empty payload only.":n===wt.testConnection?Wo(t,new Set)?null:"This endpoint accepts an empty payload only.":n===wt.beginProvisioning?Wo(t,new Set(["locale","replaceAttemptId"]))?t.locale!==void 0&&t.locale!=="zh-CN"?"The provisioning locale must be zh-CN.":t.replaceAttemptId!==void 0&&!Fn(t.replaceAttemptId)?"replaceAttemptId must be a valid opaque id.":null:"Provisioning accepts locale and replaceAttemptId only.":n===wt.beginCallbackRepair?Wo(t,new Set(["botId"]))&&Fn(t.botId)?null:"Callback repair requires a single valid botId.":n===wt.beginGroupMessagePermission?Wo(t,new Set(["botId"]))&&Fn(t.botId)?null:"Group message permission update requires a single valid botId.":n===wt.bindCredentials?Wo(t,new Set(["appId","appSecret"]))&&CZ(t.appId,256)&&CZ(t.appSecret,1024)?null:"Credential binding requires App ID and App Secret.":n===wt.pollProvisioning||n===wt.cancelProvisioning?Wo(t,new Set(["attemptId"]))&&Fn(t.attemptId)?null:"A single valid attemptId is required.":n===wt.disconnect?Wo(t,new Set(["removeCredentials"]))&&t.removeCredentials===!0?null:"Disconnect requires removeCredentials=true.":n===Ml.reconnectBot?Wo(t,new Set(["botId","sendTest"]))&&Fn(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"A valid botId and optional sendTest flag are required.":n===Ml.disconnectBot?Wo(t,new Set(["botId"]))&&Fn(t.botId)?null:"A single valid botId is required.":n===Ml.deleteBot?Wo(t,new Set(["botId","confirm"]))&&Fn(t.botId)&&t.confirm===!0?null:"Deleting a bot requires a valid botId and confirm=true.":n===wt.setWorkspace?ta(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===wt.setAgentPreset?ia(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===wt.setContextEnhancement?Zi(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===wt.setAccessPolicy?$i(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===wt.setGroupSessionScope?Aa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u7FA4\u4F1A\u8BDD\u7B56\u7565\u3002":n===wt.setGroupResponseMode?Wo(t,new Set(["botId","groupResponseMode"]))&&Fn(t.botId)&&TS(t.groupResponseMode)?null:"\u8BF7\u9009\u62E9\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F\u3002":"Unknown Feishu endpoint."}function gFe(n,t){return new Promise((o,a)=>{if(t?.aborted){a(t.reason??new Error("aborted"));return}let e=setTimeout(i,n);e.unref?.();function i(){t?.removeEventListener("abort",A),o()}function A(){clearTimeout(e),a(t.reason??new Error("aborted"))}t?.addEventListener("abort",A,{once:!0})})}async function BG(n,t){return typeof n.registrationStatus=="function"?n.registrationStatus(t):n.status()}async function uG(n,t,o,a){let e=t,i=Date.now()+15e3;for(;;){let A=Ts(e?.registration);if(A.qrCodeUrl)return e;if(["error","expired","cancelled"].includes(A.state))throw new Error("Provisioning stopped before the QR code was ready.");if(Date.now()>=i)throw new Error("Provisioning QR code timed out.");if(await gFe(50,a),e=await BG(n,o),!e)throw new Error("The provisioning attempt is no longer active.")}}function BZ(n,t){return String(Ts(n?.registration).attempt)===t}function fZ(n){let t=Ts(n?.registration);return t.state==="succeeded"?t.botId&&(n?.connected===!0||iw(n?.connection).connected)?"connected":"connecting":tFe[t.state]??"failed"}function cFe(n){if(!n||typeof n.status!="function"||typeof n.startRegistration!="function"||typeof n.cancelRegistration!="function"||typeof n.disconnect!="function")throw new TypeError("A Feishu controller with status/start/cancel/disconnect is required")}function OZ(n,{encodeQr:t=DZ}={}){cFe(n);let o=new Map,a=new Map,e=i=>{let A=o.get(i);return A||(o.size>=32&&o.delete(o.keys().next().value),A=Promise.resolve().then(()=>t(i)),o.set(i,A)),A};return async(i,A,r)=>{if(r?.aborted)return tw();if(!QZ.includes(i))return Aw("Unknown Feishu endpoint.");let s=sFe(i,A);if(s)return Aw(s);try{let g;if(i===wt.status)g=await di(await n.status(),{encodeQr:e});else if(i===wt.beginProvisioning){A.replaceAttemptId&&await n.cancelRegistration(A.replaceAttemptId);let c=await n.startRegistration({locale:A.locale}),I=String(Ts(c?.registration).attempt),p=await uG(n,c,I,r);if(g=(await di(p,{encodeQr:e})).provisioning,!g)throw new Error("Provisioning did not produce a QR code.");a.set(I,g.verificationUrl)}else if(i===wt.beginCallbackRepair){if(typeof n.startCallbackRepair!="function")throw new Error("Feishu callback repair is unavailable.");let c=await n.startCallbackRepair(A.botId),I=String(Ts(c?.registration).attempt),p=await uG(n,c,I,r);if(g=(await di(p,{encodeQr:e})).provisioning,!g||g.operation!==yZ||g.botId!==A.botId)throw new Error("Callback repair did not produce a safe QR code.");a.set(I,g.verificationUrl)}else if(i===wt.beginGroupMessagePermission){if(typeof n.startGroupMessagePermission!="function")throw new Error("Feishu group message permission update is unavailable.");let c=await n.startGroupMessagePermission(A.botId),I=String(Ts(c?.registration).attempt),p=await uG(n,c,I,r);if(g=(await di(p,{encodeQr:e})).provisioning,!g||g.operation!==CG||g.botId!==A.botId)throw new Error("Group message permission update did not produce a safe QR code.");a.set(I,g.verificationUrl)}else if(i===wt.pollProvisioning){let c=await BG(n,A.attemptId);if(!c||!BZ(c,A.attemptId))return Aw("The provisioning attempt is no longer active.");let I=Ts(c.registration),p=await di(c,{encodeQr:e});if(g={status:fZ(c),operation:I.operation,...I.botId?{botId:I.botId}:{},...p.provisioning?{provisioning:p.provisioning}:{},...I.botId&&p.connected?{connection:p}:{},...p.error?{message:p.error.message}:{}},["connected","expired","failed"].includes(g.status)){let B=a.get(A.attemptId);B&&o.delete(B),a.delete(A.attemptId)}}else if(i===wt.cancelProvisioning){let c=await BG(n,A.attemptId);if(!c||!BZ(c,A.attemptId))return Aw("The provisioning attempt is no longer active.");let I=typeof n.registrationStatus=="function",p=Ts(c.registration),B;!I&&p.state==="saving"?B=await n.disconnect():B=await n.cancelRegistration(A.attemptId);let f=Ts(B?.registration);if(rw.has(p.operation)&&p.state==="saving"&&["saving","succeeded"].includes(f.state)&&(g={status:fZ(B),operation:f.operation,...f.botId?{botId:f.botId}:{},message:p.operation===CG?"The permission update was already submitted and is still being applied.":"Callback repair was already submitted and is still being verified."}),g?.status!=="connecting"){let Q=a.get(A.attemptId);Q&&o.delete(Q),a.delete(A.attemptId),g??={status:"failed",operation:p.operation,...p.botId?{botId:p.botId}:{},message:"Registration was cancelled."}}}else if(i===wt.bindCredentials){if(typeof n.bindCredentials!="function")throw new Error("Credential binding is unavailable");g=await di(await n.bindCredentials(A),{encodeQr:e})}else if(i===wt.testConnection){let c=await n.status(),p=c?.connected===!0||iw(c?.connection).connected||typeof n.reconnect!="function"?c:await n.reconnect();g=await di(p,{encodeQr:e})}else if(i===wt.disconnect)g=await di(await n.disconnect(),{encodeQr:e});else if(i===Ml.reconnectBot){if(typeof n.reconnectBot!="function")throw new Error("Multi-bot reconnect is unavailable");let c=await n.reconnectBot(A.botId);if(r?.aborted)return tw();if(g=await di(c,{encodeQr:e}),A.sendTest===!0){let I=null;if(!(c?.bots?.some(B=>B?.botId===A.botId&&B.connected===!0)===!0))I=new Error("Feishu bot is not connected"),I.code="test-target-unavailable";else try{if(typeof n.sendConnectionTest!="function"){let B=new Error("Connection test is unavailable");throw B.code="test-target-unavailable",B}await n.sendConnectionTest(A.botId)}catch(B){I=B}g={...g,testMessage:lr(I)}}}else if(i===Ml.disconnectBot){if(typeof n.disconnectBot!="function")throw new Error("Multi-bot disconnect is unavailable");g=await di(await n.disconnectBot(A.botId),{encodeQr:e})}else if(i===wt.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");g=await di(await n.updateWorkspace(A.botId,A.workspace),{encodeQr:e})}else if(i===wt.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");g=await n.updateContextEnhancement(A.botId,A.config,c=>di(c,{encodeQr:e}))}else if(i===wt.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");g=await n.updateAccessPolicy(A.botId,A.policy,c=>di(c,{encodeQr:e}))}else if(i===wt.setGroupSessionScope){if(typeof n.updateGroupSessionScope!="function")throw new Error("Group session scope update is unavailable");g=await n.updateGroupSessionScope(A.botId,A.groupSessionScope,c=>di(c,{encodeQr:e}))}else if(i===wt.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");g=await di(await n.updateAgentPreset(A.botId,A.agentPreset),{encodeQr:e})}else if(i===wt.setGroupResponseMode){if(typeof n.updateGroupResponseMode!="function")throw new Error("Group response mode update is unavailable");g=await di(await n.updateGroupResponseMode(A.botId,A.groupResponseMode),{encodeQr:e})}else{if(typeof n.deleteBot!="function")throw new Error("Multi-bot delete is unavailable");g=await di(await n.deleteBot(A.botId),{encodeQr:e})}return r?.aborted?tw():{ok:!0,value:g}}catch(g){let c=ra(g);return r?.aborted?tw():c?{ok:!1,error:{...c,details:{}}}:nFe()}}}function aw(n,t,o,a){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(EG,OZ(t,o),{authority:mr(a)})}function IFe(n,t){if(t?.controller)return t.controller;if(typeof t?.createController=="function")return t.createController();if(typeof t?.createProvisioningManager=="function")return YT(t)}async function bZ(n,t={}){let o=IFe(n,t);if(o)return aw(n,o,t.rpcOptions,t.rpcAuthority);let a=await sG(n,t),e=t.deliveryService&&a.deliveryAdapter?t.deliveryService.registerAdapter(a.deliveryAdapter):void 0,i=aw(n,a.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await e?.(),await a.close()},"dsh-feishu: close controller and live connection"),i}import{unlink as gLe}from"node:fs/promises";import{homedir as cLe}from"node:os";import{join as rB,resolve as Rl}from"node:path";import{createHash as lFe}from"node:crypto";import{mkdir as pFe,readFile as dFe,rename as hFe,unlink as EFe,writeFile as uFe}from"node:fs/promises";import{dirname as CFe}from"node:path";var QG=Object.freeze({version:1,bots:Object.freeze([])});function jc(n){return typeof n=="string"&&n.trim()?n.trim():null}function MZ(n){let t=jc(n);return t&&/^qq_[a-f0-9]{24}$/.test(t)?t:null}function BFe(n){let t=jc(n);return t&&/^DSH_QQBOT_APP_SECRET_[A-F0-9]{24}$/.test(t)?t:null}function nw(n){let t=jc(n);if(!t)throw new TypeError("appId is required");let o=lFe("sha256").update(t).digest("hex").slice(0,24);return{botId:`qq_${o}`,secretRef:`DSH_QQBOT_APP_SECRET_${o.toUpperCase()}`}}function yG(n){let t=jc(n)??"";return t.length<=10?t?`${t.slice(0,3)}\u2022\u2022\u2022`:w("QQ\u673A\u5668\u4EBA"):`${t.slice(0,6)}\u2022\u2022\u2022\u2022${t.slice(-4)}`}function _Z(n){if(!n||typeof n!="object")return null;let t=jc(n.appId),o=jc(n.ownerUserOpenid),a=MZ(n.botId),e=BFe(n.secretRef);if(!t||!o||!a||!e)return null;let i=nw(t);return i.botId!==a||i.secretRef!==e?null:Object.freeze({botId:a,appId:t,secretRef:e,ownerUserOpenid:o,createdAt:jc(n.createdAt)??new Date().toISOString(),connectedAt:jc(n.connectedAt)})}function fFe(n){if(!n||n.version!==1||!Array.isArray(n.bots))return null;let t=n.bots.map(_Z);if(t.some(i=>i===null))return null;let o=new Set,a=new Set,e=new Set;for(let i of t){if(o.has(i.botId)||a.has(i.appId)||e.has(i.secretRef))return null;o.add(i.botId),a.add(i.appId),e.add(i.secretRef)}return Object.freeze({version:1,bots:Object.freeze(t)})}var ow=class{#e;#A=QG;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=fFe(JSON.parse(await dFe(this.#e,"utf8")));if(!t)throw new Error("dsh-im QQ config contains invalid bot data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=QG}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(a=>a.botId===t);return o?structuredClone(o):null}getByAppId(t){let o=this.#A.bots.find(a=>a.appId===t);return o?structuredClone(o):null}async save(t){let o=_Z(t);if(!o)throw new Error("Refusing to persist incomplete QQ bot data");return this.#r(a=>{let e=a.find(r=>r.appId===o.appId&&r.botId!==o.botId),i=a.find(r=>r.secretRef===o.secretRef&&r.botId!==o.botId);if(e||i)throw new Error("Duplicate QQ bot identity");let A=a.findIndex(r=>r.botId===o.botId);return A===-1?a.push(o):a[A]=o,structuredClone(o)})}async remove(t){if(!MZ(t))throw new TypeError("Invalid QQ bot id");return this.#r(o=>{let a=o.findIndex(i=>i.botId===t);if(a===-1)return null;let[e]=o.splice(a,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await EFe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=QG});this.#t=t.then(()=>{},()=>{}),await t}async#r(t){let o,a=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let i=Object.freeze({version:1,bots:Object.freeze(e)});await this.#I(i),this.#A=i});return this.#t=a.then(()=>{},()=>{}),await a,o}async#I(t){await pFe(CFe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await uFe(o,`${JSON.stringify(t,null,2)} +Generate a new one`,"\u4E8C\u7EF4\u7801\u56FE\u7247\u6B63\u5728\u751F\u6210\u2026":"Generating QR code\u2026","\u4E8C\u7EF4\u7801\u6B63\u5728\u751F\u6210\u2026":"Generating QR code\u2026","\u4E8C\u7EF4\u7801\u6B63\u5728\u81EA\u52A8\u5237\u65B0\u2026":"Refreshing QR code\u2026","\u4E8C\u7EF4\u7801\u672A\u5C31\u7EEA\uFF0C\u8BF7\u6253\u5F00\u6388\u6743\u94FE\u63A5":"The QR code is not ready. Open the authorization link.","\u4E8C\u7EF4\u7801\u56FE\u7247\u672A\u5C31\u7EEA\uFF0C\u8BF7\u4F7F\u7528\u5907\u7528\u94FE\u63A5\u3002":"The QR code is not ready. Use the alternate link.","\u4E8C\u7EF4\u7801\u56FE\u7247\u672A\u5C31\u7EEA\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002":"The QR code is not ready. Generate a new one.",\u7B49\u5F85\u5237\u65B0:"Waiting to refresh",\u6B63\u5728\u5237\u65B0\u4E8C\u7EF4\u7801:"Refreshing QR code",\u6253\u5F00\u5907\u7528\u94FE\u63A5:"Open alternate link",\u751F\u6210\u4E8C\u7EF4\u7801:"Generate QR code",\u751F\u6210\u5FAE\u4FE1\u4E8C\u7EF4\u7801:"Generate WeChat QR code",\u751F\u6210\u98DE\u4E66\u4E8C\u7EF4\u7801:"Generate Feishu QR code",\u751F\u6210\u9489\u9489\u4E8C\u7EF4\u7801:"Generate DingTalk QR code",\u751F\u6210\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801:"Generate WeCom QR code","\u751F\u6210 QQ \u4E8C\u7EF4\u7801":"Generate QQ QR code","\u6B63\u5728\u751F\u6210\u4E8C\u7EF4\u7801\u2026":"Generating QR code\u2026",\u6B63\u5728\u51C6\u5907\u6388\u6743\u4E8C\u7EF4\u7801:"Preparing authorization QR code",\u6B63\u5728\u51C6\u5907\u6743\u9650\u6388\u6743\u4E8C\u7EF4\u7801:"Preparing permission authorization QR code",\u6B63\u5728\u51C6\u5907\u5FAE\u4FE1\u4E8C\u7EF4\u7801:"Preparing WeChat QR code",\u6B63\u5728\u6DFB\u52A0\u65B0\u673A\u5668\u4EBA:"Adding a new bot","\u6B63\u5728\u7533\u8BF7\u9489\u9489\u6388\u6743\u4E8C\u7EF4\u7801\u2026":"Requesting DingTalk authorization QR code\u2026","\u6B63\u5728\u7533\u8BF7\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u2026":"Requesting WeCom QR code\u2026","\u6B63\u5728\u7533\u8BF7 QQ \u4E8C\u7EF4\u7801\u2026":"Requesting QQ QR code\u2026","\u6B63\u5728\u751F\u6210 WhatsApp \u4E8C\u7EF4\u7801":"Generating WhatsApp QR code","\u626B\u7801\uFF0C\u521B\u5EFA\u7B2C\u4E00\u4E2A\u98DE\u4E66\u5165\u53E3":"Scan to create your first Feishu bot","\u626B\u7801\u53EA\u4F1A\u65B0\u589E\u4E00\u4E2A\u673A\u5668\u4EBA\uFF0C\u5DF2\u63A5\u5165\u7684\u673A\u5668\u4EBA\u4F1A\u7EE7\u7EED\u6B63\u5E38\u6536\u53D1\u6D88\u606F\u3002":"Scanning adds one bot. Existing bots will continue to send and receive messages.","\u65E0\u9700\u624B\u52A8\u586B\u5199 App ID\u3002\u4EE5\u540E\u8FD8\u53EF\u4EE5\u7EE7\u7EED\u6DFB\u52A0\u673A\u5668\u4EBA\uFF0C\u5206\u522B\u670D\u52A1\u4E0D\u540C\u56E2\u961F\u6216\u98DE\u4E66\u79DF\u6237\u3002":"No App ID is required. You can add more bots later for different teams or Feishu tenants.",\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u521B\u5EFA\u673A\u5668\u4EBA:"Scan with Feishu to create a bot",\u5237\u65B0\u4E8C\u7EF4\u7801\u540E\u7EE7\u7EED:"Refresh the QR code to continue","\u6253\u5F00\u98DE\u4E66\u79FB\u52A8\u7AEF\uFF0C\u4F7F\u7528\u626B\u4E00\u626B\u8BFB\u53D6\u4E8C\u7EF4\u7801":"Open Feishu on your phone and scan the QR code","\u6838\u5BF9\u5E94\u7528\u540D\u79F0\u4E0E\u6743\u9650\u8303\u56F4\uFF0C\u5E76\u786E\u8BA4\u521B\u5EFA":"Review the app name and permissions, then confirm","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u65B0\u673A\u5668\u4EBA\u7684\u957F\u8FDE\u63A5\u5C31\u7EEA":"Keep this page open until the bot connection is ready",\u5728\u98DE\u4E66\u4E2D\u6253\u5F00:"Open in Feishu",\u53D6\u6D88\u6DFB\u52A0:"Cancel",\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u8865\u5168\u6743\u9650:"Scan with Feishu to complete permissions",\u4F7F\u7528\u98DE\u4E66\u786E\u8BA4\u7FA4\u6D88\u606F\u6743\u9650:"Confirm group-message permission with Feishu","\u626B\u7801\u4F1A\u66F4\u65B0\u73B0\u6709\u98DE\u4E66\u5E94\u7528\uFF0C\u53EA\u589E\u91CF\u5F00\u901A\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650\uFF1B\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u53D7\u5F71\u54CD\u3002":"Scanning updates the existing Feishu app with only the \u201CRead all messages in associated group chat\u201D scope. It does not create a new app. After confirmation, \u201CRespond to all group messages\u201D is enabled automatically; other bots are unaffected.","\u6838\u5BF9\u73B0\u6709\u5E94\u7528\uFF0C\u5E76\u786E\u8BA4\u201C\u83B7\u53D6\u7FA4\u7EC4\u4E2D\u6240\u6709\u6D88\u606F\u201D\u6743\u9650":"Review the existing app and confirm the \u201CRead all messages in associated group chat\u201D permission","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6743\u9650\u751F\u6548\u5E76\u81EA\u52A8\u5207\u6362\u54CD\u5E94\u65B9\u5F0F":"Keep this page open while the permission takes effect and the response mode switches automatically",\u53D6\u6D88\u6388\u6743:"Cancel authorization","\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u542F\u7528\u5168\u90E8\u6D88\u606F\u6A21\u5F0F":"Confirmed. Enabling all-message mode","\u6743\u9650\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u4FDD\u5B58\u8BBE\u7F6E\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"The permission update was submitted. Saving the setting and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.","\u6743\u9650\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u542F\u7528\u5168\u90E8\u6D88\u606F\u6A21\u5F0F\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"The permission update was submitted. Enabling all-message mode and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.","\u6B63\u5728\u4E3A\u73B0\u6709\u98DE\u4E66\u5E94\u7528\u7533\u8BF7\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002":"Requesting a group-message permission QR code for the existing Feishu app\u2026",\u7FA4\u6D88\u606F\u6743\u9650\u6CA1\u6709\u5F00\u901A\u5B8C\u6210:"Group-message permission was not granted","\u626B\u7801\u4F1A\u66F4\u65B0\u73B0\u6709\u98DE\u4E66\u5E94\u7528\uFF0C\u589E\u91CF\u8865\u5145\u5F53\u524D\u7F3A\u5C11\u7684\u5361\u7247\u6309\u94AE\u56DE\u8C03\u3001\u8BFB\u53D6\u7528\u6237\u6D88\u606F\u5185\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\u3001\u4E0A\u4F20\u673A\u5668\u4EBA\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:resource\uFF0C\u4EE5\u53CA\u539F\u751F\u547D\u4EE4\u9762\u677F\u6240\u9700\u7684 application:app_slash_command:read / write\uFF1B\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002\u786E\u8BA4\u9875\u53EA\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u9879\uFF0C\u5B8C\u6210\u540E\u6B64\u673A\u5668\u4EBA\u4F1A\u77ED\u6682\u91CD\u8FDE\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u53D7\u5F71\u54CD\u3002":"Scanning updates the existing Feishu app with the missing card-button callback, im:message:readonly for reading images or files in user messages (shown by Feishu as \u201CRead direct and group messages\u201D), im:resource for uploading images or files sent by the bot, and application:app_slash_command:read / write for the native command panel. It does not create a new app. The confirmation page shows only missing items; this bot reconnects briefly afterward, while other bots are unaffected.","\u6838\u5BF9\u73B0\u6709\u5E94\u7528\u540D\u79F0\uFF0C\u5E76\u786E\u8BA4\u53EA\u65B0\u589E\u5F53\u524D\u7F3A\u5C11\u7684\u4E0A\u8FF0\u914D\u7F6E":"Review the existing app name and confirm that only the missing items described above are added","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6743\u9650\u4E0E\u56DE\u8C03\u8865\u5168\u5B8C\u6210":"Keep this page open until permissions and the callback are complete",\u53D6\u6D88\u8865\u5168:"Cancel setup","\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u5B8C\u6210\u6743\u9650\u4E0E\u56DE\u8C03\u914D\u7F6E":"Confirmed. Completing permissions and callback setup",\u6B63\u5728\u51C6\u5907\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801:"Preparing the permission-completion QR code","\u914D\u7F6E\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u4FDD\u5B58\u6743\u9650\u3001\u9A8C\u8BC1\u5361\u7247\u56DE\u8C03\u5E76\u91CD\u8FDE\u6B64\u673A\u5668\u4EBA\uFF1B\u6B64\u9636\u6BB5\u65E0\u6CD5\u53D6\u6D88\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"The update was submitted. Saving permissions, verifying the card callback, and reconnecting this bot. This stage cannot be cancelled; other bots will not be interrupted.","\u6B63\u5728\u4E3A\u73B0\u6709\u98DE\u4E66\u5E94\u7528\u7533\u8BF7\u4E00\u6B21\u6027\u66F4\u65B0\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002":"Requesting a one-time update QR code for the existing Feishu app\u2026",\u6743\u9650\u4E0E\u56DE\u8C03\u6CA1\u6709\u8865\u5168\u5B8C\u6210:"Permissions and callback setup did not finish",\u8865\u5168\u6743\u9650:"Complete permissions",\u8865\u5168\u8303\u56F4:"Completion scope","\u589E\u91CF\u6DFB\u52A0\u5F53\u524D\u7F3A\u5C11\u7684\u5361\u7247\u56DE\u8C03 card.action.trigger\u3001\u8BFB\u53D6\u6D88\u606F\u5185\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:message:readonly\uFF08\u98DE\u4E66\u663E\u793A\u4E3A\u201C\u83B7\u53D6\u5355\u804A\u3001\u7FA4\u7EC4\u6D88\u606F\u201D\uFF09\u3001\u4E0A\u4F20\u673A\u5668\u4EBA\u56FE\u7247\u6216\u6587\u4EF6\u6240\u9700\u7684 im:resource\uFF0C\u4EE5\u53CA\u539F\u751F\u547D\u4EE4\u9762\u677F\u6240\u9700\u7684 application:app_slash_command:read / write\uFF1B\u786E\u8BA4\u9875\u53EA\u663E\u793A\u5F53\u524D\u7F3A\u5C11\u9879\uFF0C\u4E0D\u4F1A\u521B\u5EFA\u65B0\u5E94\u7528\u3002":"Adds the missing card callback card.action.trigger, im:message:readonly for reading images or files in messages (shown by Feishu as \u201CRead direct and group messages\u201D), im:resource for uploading images or files sent by the bot, and application:app_slash_command:read / write for the native command panel. The confirmation page shows only missing items; no new app is created.","\u7B49\u5F85\u626B\u7801\u2026":"Waiting for scan\u2026",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u5339\u914D\u7684\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801:"Feishu returned a permission-completion QR code for a different bot",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u5339\u914D\u7684\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801:"Feishu returned a group-message permission QR code for a different bot","\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u4FEE\u590D\u4FE1\u606F\u7F3A\u5C11 botId":"Feishu repair status is missing the bot ID","\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u5E94\u7528\u66F4\u65B0\u4FE1\u606F\u7F3A\u5C11 botId":"Feishu app-update status is missing the bot ID",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u5339\u914D\u7684\u6CE8\u518C\u8FDB\u5EA6:"Feishu returned registration progress for a different operation",\u6B64\u673A\u5668\u4EBA:"this bot","\u7528\u4E8E\u4E3A${botName}\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801":"One-time QR code for granting group-message permission to ${botName}","\u6B63\u5728\u4E3A\u300C${botName}\u300D\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650":"Granting group-message permission to \u201C${botName}\u201D",'${botName ?? "\u673A\u5668\u4EBA"}\u7684\u6743\u9650\u8865\u5168\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u3002':'Permission-completion QR code generated for ${botName ?? "bot"}. Scan it with Feishu.','${botName ?? "\u673A\u5668\u4EBA"}\u7684\u7FA4\u6D88\u606F\u6743\u9650\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u98DE\u4E66\u786E\u8BA4\u3002':'Group-message permission QR code generated for ${botName ?? "bot"}. Confirm it with Feishu.',"${targetBotName}\u5DF2\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\uFF0C\u5E76\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\u3002":"${targetBotName} now has group-message permission and \u201CRespond to all group messages\u201D is enabled.","${targetBot.bot.name}\u5DF2\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\uFF0C\u5E76\u542F\u7528\u201C\u54CD\u5E94\u6240\u6709\u7FA4\u6D88\u606F\u201D\u3002":"${targetBot.bot.name} now has group-message permission and \u201CRespond to all group messages\u201D is enabled.","${targetBot.bot.name}\u5DF2\u8FDE\u63A5\uFF0C\u53EF\u4EE5\u5728\u98DE\u4E66\u4E2D\u5F00\u59CB\u804A\u5929\u3002":"${targetBot.bot.name} is connected and ready to chat in Feishu.","\u5DF2\u53D6\u6D88\u8865\u5168\u6743\u9650\u4E0E\u56DE\u8C03\u3002":"Completing permissions and the callback was cancelled.","\u5DF2\u53D6\u6D88\u7FA4\u6D88\u606F\u6743\u9650\u6388\u6743\u3002":"Group-message permission authorization was cancelled.","\u6743\u9650\u4E0E\u56DE\u8C03\u5DF2\u66F4\u65B0\uFF0C\u4F46\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u673A\u5668\u4EBA\u8FDE\u63A5\u72B6\u6001":"Permissions and the callback were updated, but the bot connection could not be confirmed yet","\u7FA4\u6D88\u606F\u6743\u9650\u5DF2\u66F4\u65B0\uFF0C\u4F46\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u673A\u5668\u4EBA\u8FDE\u63A5\u72B6\u6001":"The group-message permission was updated, but the bot connection could not be confirmed yet",\u98DE\u4E66\u6743\u9650\u4E0E\u56DE\u8C03\u8865\u5168\u5931\u8D25:"Could not complete Feishu permissions and callback setup",\u98DE\u4E66\u7FA4\u6D88\u606F\u6743\u9650\u5F00\u901A\u5931\u8D25:"Could not grant the Feishu group-message permission","\u8BF7\u5148\u5B8C\u6210\u5F53\u524D\u98DE\u4E66\u6388\u6743\u64CD\u4F5C\uFF0C\u518D\u5F00\u901A\u7FA4\u6D88\u606F\u6743\u9650\u3002":"Finish the current Feishu authorization before granting group-message permission.","\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u8FDE\u63A5\u65B0\u673A\u5668\u4EBA":"Confirmed. Connecting the new bot","\u6B63\u5728\u5B89\u5168\u4FDD\u5B58\u51ED\u636E\u5E76\u68C0\u67E5\u65B0\u673A\u5668\u4EBA\u7684\u6D88\u606F\u901A\u9053\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E0D\u4F1A\u4E2D\u65AD\u3002":"Saving credentials and checking the new bot connection. Existing bots will not be interrupted.","\u6B63\u5728\u5411\u98DE\u4E66\u7533\u8BF7\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u5019\u3002":"Requesting a one-time authorization QR code from Feishu\u2026",\u65B0\u673A\u5668\u4EBA\u6CA1\u6709\u6DFB\u52A0\u5B8C\u6210:"The new bot was not added","\u65B0\u98DE\u4E66\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5\uFF0C\u53EF\u4EE5\u5F00\u59CB\u804A\u5929\u3002":"The new Feishu bot is connected and ready to chat.",\u98DE\u4E66\u5E94\u7528\u521B\u5EFA\u5931\u8D25:"Could not create the Feishu app","\u673A\u5668\u4EBA\u5DF2\u7ECF\u521B\u5EFA\uFF0C\u4F46\u6682\u65F6\u65E0\u6CD5\u786E\u8BA4\u8FDE\u63A5\u72B6\u6001":"The bot was created, but its connection could not be confirmed yet",\u673A\u5668\u4EBA\u4ECD\u672A\u8FDE\u63A5:"The bot is still offline",\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5:"The bot is not connected yet",\u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38:"Persistent connection is healthy",\u957F\u8FDE\u63A5:"Persistent connection",\u5E94\u7528\u6807\u8BC6\u5DF2\u5B89\u5168\u4FDD\u5B58:"App identifier stored securely",\u673A\u5668\u4EBA\u6807\u8BC6\u5DF2\u5B89\u5168\u4FDD\u5B58:"Bot identifier stored securely",\u5DF2\u5B89\u5168\u4FDD\u5B58:"Stored securely",\u5DF2\u63A5\u5165\u7684\u5FAE\u4FE1\u8D26\u53F7:"Connected WeChat accounts",\u5DF2\u63A5\u5165\u7684\u673A\u5668\u4EBA:"Connected bots",\u5DF2\u63A5\u5165\u7684\u9489\u9489\u673A\u5668\u4EBA:"Connected DingTalk bots",\u5DF2\u7ED1\u5B9A\u7684\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connected WeCom bots","\u5DF2\u7ED1\u5B9A\u7684 QQ \u673A\u5668\u4EBA":"Connected QQ bots","\u5DF2\u63A5\u5165\u7684 WhatsApp \u673A\u5668\u4EBA":"Connected WhatsApp accounts",\u4F7F\u7528\u624B\u673A\u5FAE\u4FE1\u626B\u63CF\u4E8C\u7EF4\u7801:"Scan with WeChat on your phone","\u626B\u4E00\u6B21\u7801\uFF0C\u5C31\u80FD\u5728\u5FAE\u4FE1\u91CC\u4F7F\u7528 Harness":"Scan once to use Harness in WeChat",\u6253\u5F00\u624B\u673A\u5FAE\u4FE1\u5E76\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801:"Open WeChat on your phone and scan the QR code",\u5728\u5FAE\u4FE1\u4E2D\u786E\u8BA4\u8FDE\u63A5\u8BE5\u673A\u5668\u4EBA:"Confirm the bot connection in WeChat","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u673A\u5668\u4EBA\u81EA\u52A8\u8FDE\u63A5":"Keep this page open while the bot connects",\u7B49\u5F85\u5FAE\u4FE1\u626B\u7801:"Waiting for WeChat scan",\u9700\u8981\u914D\u5BF9\u7801:"Pairing code required",\u8F93\u5165\u624B\u673A\u5FAE\u4FE1\u663E\u793A\u7684\u6570\u5B57:"Enter the number shown in WeChat",\u5FAE\u4FE1\u914D\u5BF9\u7801:"WeChat pairing code","\u5DF2\u626B\u7801\uFF0C\u8BF7\u5728\u624B\u673A\u4E0A\u786E\u8BA4":"Scanned. Confirm on your phone","\u914D\u5BF9\u7801\u5DF2\u63D0\u4EA4\uFF0C\u6B63\u5728\u7B49\u5F85\u5FAE\u4FE1\u786E\u8BA4\u3002":"Pairing code submitted. Waiting for WeChat confirmation.","\u8FD9\u662F\u5FAE\u4FE1\u9644\u52A0\u7684\u5B89\u5168\u786E\u8BA4\u6B65\u9AA4\u3002\u914D\u5BF9\u7801\u53EA\u7528\u4E8E\u672C\u6B21\u626B\u7801\u8F6E\u8BE2\uFF0C\u4E0D\u4F1A\u5199\u5165\u914D\u7F6E\u6216\u65E5\u5FD7\u3002":"This is an additional WeChat confirmation step. The pairing code is used only for this connection and is never stored.","\u6B63\u5728\u4FDD\u5B58\u51ED\u636E\u5E76\u9A8C\u8BC1 Harness \u4E0E\u5FAE\u4FE1\u957F\u8F6E\u8BE2\u3002":"Saving credentials and verifying the WeChat connection.","\u5FAE\u4FE1\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u542F\u52A8\u6D88\u606F\u8FDE\u63A5":"Confirmed in WeChat. Starting the message connection","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u8BFB\u53D6\u73B0\u6709\u767B\u5F55\u51ED\u636E\u3002\u8BF7\u68C0\u67E5 DSH \u51ED\u636E\u5B58\u50A8\u3002":"WeChat was authorized, but the existing login credential could not be read. Check the DSH credential store.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u767B\u5F55\u51ED\u636E\u65E0\u6CD5\u5199\u5165 DSH \u51ED\u636E\u5B58\u50A8\u3002\u8BF7\u68C0\u67E5\u51ED\u636E\u5B58\u50A8\u662F\u5426\u53EF\u5199\u3002":"WeChat was authorized, but the login credential could not be written to the DSH credential store. Check that the store is writable.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u8D26\u53F7\u914D\u7F6E\u65E0\u6CD5\u5199\u5165\u672C\u673A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u76EE\u5F55\u6743\u9650\u3002":"WeChat was authorized, but the account configuration could not be saved locally. Check the DSH_HOME directory permissions.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u521D\u59CB\u5316\u8D26\u53F7\u72B6\u6001\u6216\u5DE5\u4F5C\u533A\u3002\u8BF7\u68C0\u67E5 DSH_HOME \u548C\u5DE5\u4F5C\u533A\u76EE\u5F55\u3002":"WeChat was authorized, but the account state or workspace could not be initialized. Check DSH_HOME and the workspace directory.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u63D2\u4EF6\u65E0\u6CD5\u8FDE\u63A5\u672C\u673A Harness\u3002\u8BF7\u68C0\u67E5 dsh web \u5730\u5740\u548C\u7AEF\u53E3\u3002":"WeChat was authorized, but the plugin could not connect to the local Harness. Check the dsh web address and port.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8D85\u65F6\u3002\u8BF7\u786E\u8BA4 dsh web \u672A\u963B\u585E\u3002":"WeChat was authorized, but the Harness health check timed out. Confirm that dsh web is not blocked.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u672C\u673A\u5065\u5EB7\u68C0\u67E5\u3002\u8BF7\u68C0\u67E5 Host \u4FE1\u4EFB\u914D\u7F6E\u3002":"WeChat was authorized, but Harness denied the local health check. Check the Host trust configuration.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u627E\u4E0D\u5230 Harness \u5065\u5EB7\u68C0\u67E5\u63A5\u53E3\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but the Harness health endpoint was not found. Confirm that Harness and the plugin are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u8FD4\u56DE\u670D\u52A1\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check returned a service error. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u54CD\u5E94\u3002\u8BF7\u786E\u8BA4 Harness \u4E0E\u63D2\u4EF6\u7248\u672C\u517C\u5BB9\u3002":"WeChat was authorized, but Harness returned an unrecognized response. Confirm that Harness and the plugin are compatible.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u62D2\u7EDD\u4E86\u5065\u5EB7\u68C0\u67E5\u8BF7\u6C42\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but Harness rejected the health-check request. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46 Harness \u5065\u5EB7\u68C0\u67E5\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but the Harness health check failed unexpectedly. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6D88\u606F\u8FDE\u63A5\u521D\u59CB\u5316\u5931\u8D25\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u540E\u91CD\u8BD5\u3002":"WeChat was authorized, but the message connection could not be initialized. Check the dsh web logs and try again.","\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u6FC0\u6D3B\u8FC7\u7A0B\u4E2D\u53D1\u751F\u672A\u77E5\u9519\u8BEF\u3002\u8BF7\u67E5\u770B dsh web \u65E5\u5FD7\u3002":"WeChat was authorized, but an unknown error occurred during activation. Check the dsh web logs.","\u5FAE\u4FE1\u5DF2\u7ED1\u5B9A\uFF0C\u53EF\u4EE5\u5F00\u59CB\u5411\u5DF2\u7ED1\u5B9A\u7684\u673A\u5668\u4EBA\u53D1\u6D88\u606F\u3002":"WeChat is connected and ready for messages.","\u8FD9\u4E2A\u5FAE\u4FE1\u8D26\u53F7\u5DF2\u7ECF\u7ED1\u5B9A\u5E76\u4FDD\u6301\u5728\u7EBF\u3002":"This WeChat account is connected and online.","\u5FAE\u4FE1\u8D26\u53F7\u53CA\u672C\u673A\u51ED\u636E\u5DF2\u79FB\u9664\u3002":"The WeChat account and local credentials were removed.","\u5DF2\u53D6\u6D88\u5FAE\u4FE1\u7ED1\u5B9A\u3002":"WeChat setup was cancelled.","\u6B63\u5728\u8054\u7CFB\u817E\u8BAF\u5FAE\u4FE1 iLink \u670D\u52A1\u3002":"Contacting the WeChat iLink service.","iLink \u957F\u8F6E\u8BE2":"iLink long polling","\u626B\u4E00\u6B21\u7801\uFF0C\u81EA\u52A8\u521B\u5EFA\u5E76\u8FDE\u63A5\u673A\u5668\u4EBA":"Scan once to create and connect a bot","\u4F7F\u7528\u9489\u9489 App \u5B8C\u6210\u673A\u5668\u4EBA\u6388\u6743":"Authorize the bot with the DingTalk app","\u4F7F\u7528\u5DF2\u52A0\u5165\u4F01\u4E1A/\u7EC4\u7EC7\u7684\u9489\u9489\u8D26\u53F7\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Scan the QR code with a DingTalk account that belongs to an organization","\u5728\u6388\u6743\u9875\u70B9\u51FB\u201C\u4E00\u952E\u521B\u5EFA\u65B0\u673A\u5668\u4EBA\u201D":"Select \u201CCreate new bot\u201D on the authorization page","\u8BF7\u52FF\u5173\u95ED\u672C\u9875\uFF0C\u9489\u9489\u5B8C\u6210\u6388\u6743\u540E\u5C06\u81EA\u52A8\u7EE7\u7EED\u3002":"Keep this page open. Setup will continue after DingTalk authorization.",\u7B49\u5F85\u9489\u9489\u626B\u7801\u6388\u6743:"Waiting for DingTalk authorization","\u6388\u6743\u5DF2\u786E\u8BA4\uFF0C\u6B63\u5728\u521B\u5EFA\u9489\u9489\u673A\u5668\u4EBA":"Authorized. Creating the DingTalk bot",\u6B63\u5728\u786E\u8BA4\u9489\u9489\u6388\u6743:"Confirming DingTalk authorization","\u6B63\u5728\u68C0\u67E5\u9489\u9489 Stream \u957F\u8FDE\u63A5\uFF0C\u6210\u529F\u540E\u4F1A\u81EA\u52A8\u663E\u793A\u4E3A\u5728\u7EBF\u3002":"Checking the DingTalk Stream connection. It will appear online when ready.","\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0C\u53EF\u4EE5\u5F00\u59CB\u53D1\u9001\u6D88\u606F\u3002":"The DingTalk bot is connected and ready for messages.","\u8FD9\u4E2A\u9489\u9489\u673A\u5668\u4EBA\u5DF2\u7ECF\u63A5\u5165\u5E76\u4FDD\u6301\u5728\u7EBF\u3002":"This DingTalk bot is connected and online.","Stream \u957F\u8FDE\u63A5":"Stream persistent connection","\u4F7F\u7528\u4F01\u4E1A\u5FAE\u4FE1 App \u626B\u7801\u521B\u5EFA\u667A\u80FD\u673A\u5668\u4EBA":"Scan with WeCom to create an AI bot","\u4F7F\u7528\u4F01\u4E1A\u5FAE\u4FE1 App \u5B8C\u6210\u667A\u80FD\u673A\u5668\u4EBA\u6388\u6743":"Authorize the AI bot with WeCom","\u6253\u5F00\u4F01\u4E1A\u5FAE\u4FE1 App\uFF0C\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Open WeCom and scan the QR code",\u5728\u817E\u8BAF\u6388\u6743\u9875\u9762\u786E\u8BA4\u521B\u5EFA\u667A\u80FD\u673A\u5668\u4EBA:"Confirm bot creation on the Tencent authorization page",\u8FD4\u56DE\u8FD9\u91CC\u7B49\u5F85\u8FDE\u63A5\u5B8C\u6210:"Return here and wait for the connection to complete","\u7B49\u5F85\u4F01\u4E1A\u5FAE\u4FE1 App \u626B\u7801":"Waiting for WeCom scan","\u4F01\u4E1A\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u6B63\u5728\u8FDE\u63A5\u673A\u5668\u4EBA":"Authorized in WeCom. Connecting the bot","\u51ED\u636E\u6B63\u5728\u5199\u5165\u672C\u673A\uFF0C\u5E76\u542F\u52A8\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u6D88\u606F\u8FDE\u63A5\u3002":"Saving credentials locally and starting the WeCom WebSocket connection.","WebSocket \u957F\u8FDE\u63A5":"WebSocket persistent connection","\u4F7F\u7528\u624B\u673A QQ \u626B\u7801\u521B\u5EFA\u5E76\u7ED1\u5B9A\u673A\u5668\u4EBA":"Scan with mobile QQ to create and connect a bot","\u4F7F\u7528\u624B\u673A QQ \u5B8C\u6210\u673A\u5668\u4EBA\u7ED1\u5B9A":"Complete bot setup with mobile QQ","\u6253\u5F00\u624B\u673A QQ\uFF0C\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Open mobile QQ and scan the QR code",\u5728\u817E\u8BAF\u6388\u6743\u9875\u9762\u786E\u8BA4\u521B\u5EFA\u6216\u7ED1\u5B9A\u673A\u5668\u4EBA:"Confirm bot creation or connection on the Tencent authorization page","\u7B49\u5F85\u624B\u673A QQ \u626B\u7801":"Waiting for mobile QQ scan","QQ \u5DF2\u6388\u6743\uFF0C\u6B63\u5728\u8FDE\u63A5\u673A\u5668\u4EBA":"Authorized in QQ. Connecting the bot","\u51ED\u636E\u6B63\u5728\u5199\u5165\u672C\u673A\uFF0C\u5E76\u542F\u52A8 QQ WebSocket \u6D88\u606F\u8FDE\u63A5\u3002":"Saving credentials locally and starting the QQ WebSocket connection.","\u4F7F\u7528\u624B\u673A WhatsApp \u626B\u63CF\u4E8C\u7EF4\u7801\u5373\u53EF\u63A5\u5165\u3002":"Scan the QR code with WhatsApp to connect.","\u7528\u624B\u673A WhatsApp \u626B\u63CF\u4E8C\u7EF4\u7801":"Scan with WhatsApp on your phone","\u6253\u5F00 WhatsApp \u2192 \u8BBE\u7F6E \u2192 \u5DF2\u5173\u8054\u8BBE\u5907":"Open WhatsApp \u2192 Settings \u2192 Linked devices","\u70B9\u51FB\u201C\u5173\u8054\u8BBE\u5907\u201D\u5E76\u626B\u63CF\u5DE6\u4FA7\u4E8C\u7EF4\u7801":"Select \u201CLink a device\u201D and scan the QR code","\u7B49\u5F85 WhatsApp \u626B\u7801":"Waiting for WhatsApp scan","\u5DF2\u626B\u7801\uFF0C\u6B63\u5728\u8FDE\u63A5 WhatsApp":"Scanned. Connecting WhatsApp","\u6B63\u5728\u5EFA\u7ACB\u5B89\u5168\u7684\u5173\u8054\u8BBE\u5907\u4F1A\u8BDD\u3002":"Creating a secure linked-device session.","\u5173\u8054\u8BBE\u5907\u6B63\u5728\u63A5\u5165 DeepSeek Harness\u3002":"Linking the device to DeepSeek Harness.","WhatsApp Web \u5173\u8054\u8BBE\u5907\u8FD0\u884C\u6B63\u5E38":"WhatsApp linked device is healthy","\u67E5\u770B WhatsApp \u8BBF\u95EE\u6A21\u5F0F\u8BF4\u660E":"View WhatsApp access mode details","WhatsApp \u8BBF\u95EE\u6A21\u5F0F":"WhatsApp access mode",\u4EC5\u81EA\u5DF1\u6A21\u5F0F:"Only me",\u6307\u5B9A\u8054\u7CFB\u4EBA\u6A21\u5F0F:"Selected contacts",\u5F00\u653E\u54CD\u5E94\u6A21\u5F0F:"Open responses","\u4EC5\u81EA\u5DF1\u6A21\u5F0F\uFF08\u9ED8\u8BA4\uFF09":"Only me (default)","\u5DF2\u751F\u6548\uFF1A":"Active: ","\u53EA\u54CD\u5E94\u5DF2\u7ED1\u5B9A WhatsApp \u8D26\u53F7\u7684\u81EA\u804A\u6D88\u606F\u3002":"Only respond to self-chat messages from the linked WhatsApp account.","\u54CD\u5E94\u81EA\u804A\u548C\u767D\u540D\u5355\u8054\u7CFB\u4EBA\u7684\u79C1\u804A\uFF0C\u5FFD\u7565\u7FA4\u804A\u3002":"Respond to self-chat and allowlisted direct messages; ignore group messages.","\u54CD\u5E94\u6240\u6709\u79C1\u804A\u3001\u5DF2\u7ED1\u5B9A\u8D26\u53F7\u81EA\u5DF1\u53D1\u51FA\u7684\u7FA4\u804A\u6D88\u606F\uFF0C\u4EE5\u53CA\u5176\u4ED6\u7FA4\u6210\u5458\u7684\u63D0\u53CA\u6216\u56DE\u590D\u3002":"Respond to all direct messages, group messages sent by the linked account, and mentions or replies from other group members.","\u5141\u8BB8\u79C1\u804A\u7684 WhatsApp \u7535\u8BDD\u53F7\u7801":"WhatsApp phone numbers allowed to send direct messages",\u6BCF\u884C\u4E00\u4E2A\u542B\u56FD\u5BB6\u6216\u5730\u533A\u4EE3\u7801\u7684\u53F7\u7801:"One number with country or region code per line","\u53EF\u4EE5\u5305\u542B\u5F00\u5934\u7684 +\uFF0C\u4FDD\u5B58\u65F6\u4F1A\u81EA\u52A8\u79FB\u9664\u3002":"A leading + is allowed and removed when saved.","\u4EC5\u6307\u5B9A\u8054\u7CFB\u4EBA\u6A21\u5F0F\u4F7F\u7528\u767D\u540D\u5355\uFF0C\u5207\u6362\u6A21\u5F0F\u65F6\u4F1A\u4FDD\u7559\u3002":"Only Selected contacts uses the allowlist; it is retained when modes change.","\u767D\u540D\u5355\u4E3A\u7A7A\uFF1B\u4FDD\u5B58\u540E\u5C06\u53EA\u63A5\u53D7\u81EA\u804A\u6D88\u606F\u3002":"The allowlist is empty; only self-chat messages will be accepted after saving.","\u7535\u8BDD\u53F7\u7801\u5FC5\u987B\u5305\u542B\u56FD\u5BB6\u6216\u5730\u533A\u4EE3\u7801\uFF0C\u6BCF\u884C\u4E00\u4E2A\u3002":"Each phone number must include a country or region code on its own line.","WhatsApp \u8BBF\u95EE\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"WhatsApp access settings are currently unavailable.","WhatsApp \u8BBF\u95EE\u8BBE\u7F6E\u4FDD\u5B58\u5931\u8D25\u3002":"Could not save WhatsApp access settings.","Bot API \u957F\u8F6E\u8BE2":"Bot API long polling"," Gateway \u957F\u8FDE\u63A5":" Gateway persistent connection","Gateway \u957F\u8FDE\u63A5":"Gateway persistent connection"," Socket Mode \u957F\u8FDE\u63A5":" Socket Mode persistent connection","Socket Mode \u957F\u8FDE\u63A5":"Socket Mode persistent connection","\u63A5\u5165 Telegram \u673A\u5668\u4EBA":"Connect a Telegram bot","\u5148\u901A\u8FC7 @BotFather \u83B7\u53D6 Bot Token\uFF0C\u518D\u5728\u8FD9\u91CC\u5B8C\u6210\u63A5\u5165\u3002":"Get a Bot Token from @BotFather, then connect it here.","\u586B\u5199 @BotFather \u751F\u6210\u7684 Bot Token":"Enter the Bot Token from @BotFather",\u8BBF\u95EE\u6A21\u5F0F:"Access mode","Telegram \u8BBF\u95EE\u6A21\u5F0F":"Telegram access mode","\u67E5\u770B Telegram \u8BBF\u95EE\u6A21\u5F0F\u8BF4\u660E":"View Telegram access mode details","\u7FA4\u804A\u5168\u90E8\u5FFD\u7565\uFF0C\u79C1\u804A\u4EC5\u5141\u8BB8\u767D\u540D\u5355\u7528\u6237\u3002":"All group messages are ignored; only allowlisted users may send DMs.","\u4FDD\u6301\u539F\u6709\u884C\u4E3A\uFF1A\u79C1\u804A\u76F4\u63A5\u54CD\u5E94\uFF0C\u7FA4\u804A\u5728\u88AB\u63D0\u53CA\u6216\u56DE\u590D\u65F6\u54CD\u5E94\u3002":"Keep the original behavior: respond to DMs and to group mentions or replies.",\u5B89\u5168\u6A21\u5F0F:"Safe mode",\u517C\u5BB9\u6A21\u5F0F:"Compatible mode","\u5DF2\u751F\u6548\uFF1A\u5B89\u5168\u6A21\u5F0F":"Active: Safe mode","\u5DF2\u751F\u6548\uFF1A\u517C\u5BB9\u6A21\u5F0F":"Active: Compatible mode",\u6A21\u5F0F:"Mode","\u517C\u5BB9\u6A21\u5F0F\uFF08\u9ED8\u8BA4\uFF09":"Compatible mode (default)","\u5B89\u5168\u6A21\u5F0F\uFF08\u79C1\u804A\u767D\u540D\u5355\uFF09":"Safe mode (private-chat allowlist)","\u5141\u8BB8\u79C1\u804A\u7684 Telegram User ID":"Telegram User IDs allowed to send DMs","\u6BCF\u884C\u4E00\u4E2A\u6570\u5B57 User ID":"One numeric User ID per line","\u767D\u540D\u5355\u4EC5\u5C5E\u4E8E\u5F53\u524D\u673A\u5668\u4EBA\u3002":"This allowlist belongs only to the current bot.","\u517C\u5BB9\u6A21\u5F0F\u4E0B\u6682\u4E0D\u4F7F\u7528\u767D\u540D\u5355\uFF0C\u5207\u6362\u6A21\u5F0F\u65F6\u4F1A\u4FDD\u7559\u3002":"Compatible mode does not enforce the allowlist; it is retained when modes change.","\u767D\u540D\u5355\u4E3A\u7A7A\uFF1B\u4FDD\u5B58\u540E\u8BE5\u673A\u5668\u4EBA\u4F1A\u62D2\u7EDD\u6240\u6709\u5165\u7AD9\u6D88\u606F\u3002":"The allowlist is empty; this bot will reject all inbound messages after saving.","\u6B63\u5728\u4FDD\u5B58\u2026":"Saving\u2026",\u4FDD\u5B58\u8BBF\u95EE\u8BBE\u7F6E:"Save access settings","User ID \u5FC5\u987B\u662F 1\u201316 \u4F4D\u6B63\u6574\u6570\uFF0C\u6BCF\u884C\u4E00\u4E2A\u3002":"Each User ID must be a 1\u201316 digit positive integer on its own line.","Telegram \u8BBF\u95EE\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"Telegram access settings are currently unavailable.","Telegram \u8BBF\u95EE\u8BBE\u7F6E\u4FDD\u5B58\u5931\u8D25\u3002":"Could not save Telegram access settings.","\u63A5\u5165 Discord \u673A\u5668\u4EBA":"Connect a Discord bot","\u5148\u5728 Developer Portal \u521B\u5EFA Bot \u5E76\u9080\u8BF7\u5230\u670D\u52A1\u5668\uFF0C\u518D\u5728\u8FD9\u91CC\u5B8C\u6210\u63A5\u5165\u3002":"Create a bot in the Developer Portal and invite it to your server, then connect it here.","\u586B\u5199 Discord Developer Portal \u7684 Bot Token":"Enter the Bot Token from the Discord Developer Portal","\u63A5\u5165 Slack \u673A\u5668\u4EBA":"Connect a Slack bot","\u5148\u7528 Manifest \u521B\u5EFA\u5E76\u914D\u7F6E Slack App":"Create and configure a Slack app with the manifest","\u590D\u5236\u914D\u7F6E\u540E\uFF0C\u5728 Slack \u9009\u62E9 From a manifest\uFF1B\u521B\u5EFA\u5B8C\u6210\u540E\u751F\u6210 connections:write App Token\uFF0C\u5E76\u5C06\u5E94\u7528\u5B89\u88C5\u5230\u5DE5\u4F5C\u533A\u3002":"Copy the manifest and choose \u201CFrom a manifest\u201D in Slack. Then create a connections:write App Token and install the app to your workspace.","\u590D\u5236 Manifest":"Copy manifest","\u5DF2\u590D\u5236 Manifest":"Manifest copied","\u6253\u5F00 Slack \u521B\u5EFA\u9875":"Open Slack app creation","Bot Token \u6765\u81EA OAuth & Permissions\uFF1BApp Token \u6765\u81EA Basic Information\uFF0C\u5E76\u4E14\u5FC5\u987B\u5305\u542B connections:write\u3002":"Get the Bot Token from OAuth & Permissions and the App Token from Basic Information. The App Token must include connections:write.","\u4F7F\u7528\u5B98\u65B9 App Manifest \u5FEB\u901F\u914D\u7F6E\u673A\u5668\u4EBA\uFF0C\u518D\u586B\u5199 Bot Token \u4E0E App Token \u5EFA\u7ACB\u672C\u5730 Socket Mode \u8FDE\u63A5\u3002":"Configure the bot with the official app manifest, then enter the Bot Token and App Token to start a local Socket Mode connection.","Slack \u5DE5\u4F5C\u533A":"Slack workspace","Bot Token \u4E0E App Token":"Bot Token and App Token","\u586B\u5199 Bot Token":"Enter Bot Token",\u624B\u52A8\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA:"Connect Feishu bot manually",\u624B\u52A8\u63A5\u5165\u9489\u9489\u673A\u5668\u4EBA:"Connect DingTalk bot manually",\u624B\u52A8\u63A5\u5165\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connect WeCom bot manually",\u624B\u52A8\u63A5\u5165QQ\u673A\u5668\u4EBA:"Connect QQ bot manually","\u586B\u5199\u98DE\u4E66\u5F00\u653E\u5E73\u53F0 App ID":"Enter the Feishu Open Platform App ID","\u586B\u5199\u98DE\u4E66\u5F00\u653E\u5E73\u53F0 App Secret":"Enter the Feishu Open Platform App Secret","\u586B\u5199\u9489\u9489\u5E94\u7528 Client ID":"Enter the DingTalk Client ID","\u586B\u5199\u9489\u9489\u5E94\u7528 Client Secret":"Enter the DingTalk Client Secret","\u586B\u5199\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA Bot ID":"Enter the WeCom AI Bot ID","\u586B\u5199\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA Secret":"Enter the WeCom AI Bot Secret","\u586B\u5199 QQ \u5F00\u653E\u5E73\u53F0 AppID":"Enter the QQ Open Platform AppID","\u586B\u5199 QQ \u5F00\u653E\u5E73\u53F0 AppSecret":"Enter the QQ Open Platform AppSecret",\u626B\u7801\u63A5\u5165\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connect WeChat bot by QR code",\u626B\u7801\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA:"Connect Feishu bot by QR code",\u626B\u7801\u63A5\u5165\u9489\u9489\u673A\u5668\u4EBA:"Connect DingTalk bot by QR code",\u626B\u7801\u63A5\u5165\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"Connect WeCom bot by QR code","\u626B\u7801\u63A5\u5165 QQ \u673A\u5668\u4EBA":"Connect QQ bot by QR code","\u626B\u7801\u63A5\u5165 WhatsApp \u673A\u5668\u4EBA":"Connect WhatsApp by QR code","\u626B\u7801\u7ED1\u5B9A WhatsApp \u673A\u5668\u4EBA":"Connect WhatsApp by QR code","\u4F7F\u7528 App ID \u548C App Secret \u7ED1\u5B9A\u98DE\u4E66\u673A\u5668\u4EBA":"Connect a Feishu bot with App ID and App Secret","\u4F7F\u7528 Client ID \u548C Client Secret \u7ED1\u5B9A\u9489\u9489\u673A\u5668\u4EBA":"Connect a DingTalk bot with Client ID and Client Secret","\u4F7F\u7528 Bot ID \u548C Secret \u7ED1\u5B9A\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA":"Connect a WeCom bot with Bot ID and Secret","\u4F7F\u7528 AppID \u548C AppSecret \u7ED1\u5B9A QQ \u673A\u5668\u4EBA":"Connect a QQ bot with AppID and AppSecret","\u4F7F\u7528 Manifest \u548C\u53CC Token \u63A5\u5165 Slack \u673A\u5668\u4EBA":"Connect a Slack bot with a manifest and two tokens","\u4F7F\u7528 Bot Token \u63A5\u5165 Telegram \u673A\u5668\u4EBA":"Connect a Telegram bot with a Bot Token","\u4F7F\u7528 Bot Token \u63A5\u5165 Discord \u673A\u5668\u4EBA":"Connect a Discord bot with a Bot Token",\u53D6\u6D88\u7ED1\u5B9A:"Cancel setup",\u53D6\u6D88\u63A5\u5165:"Cancel setup","\u4E8C\u7EF4\u7801\u7531\u817E\u8BAF\u5FAE\u4FE1 iLink \u670D\u52A1\u7B7E\u53D1\u3002\u7528\u624B\u673A\u5FAE\u4FE1\u626B\u63CF\u5E76\u786E\u8BA4\u540E\uFF0C\u8D26\u53F7\u51ED\u636E\u4F1A\u76F4\u63A5\u5199\u5165 Harness Host\uFF0C\u6D4F\u89C8\u5668\u4E0D\u4F1A\u6536\u5230 bot_token\u3002":"The QR code is issued by Tencent WeChat iLink. After you scan and confirm, account credentials are written directly to the Harness Host and are never exposed to the browser.","\u626B\u7801\u8D26\u53F7\u5FC5\u987B\u5DF2\u52A0\u5165\u4F01\u4E1A/\u7EC4\u7EC7\u3002\u5982\u679C\u9489\u9489\u63D0\u793A\u5C1A\u672A\u52A0\u5165\u7EC4\u7EC7\uFF0C\u8BF7\u5728\u63D0\u793A\u9875\u521B\u5EFA\u7EC4\u7EC7\uFF0C\u6216\u6362\u7528\u5DF2\u52A0\u5165\u7EC4\u7EC7\u7684\u8D26\u53F7\u3002":"The DingTalk account must belong to an organization. If prompted, create an organization or use an account that already belongs to one.","\u8BF7\u5728\u624B\u673A\u4E0A\u6838\u5BF9\u5E76\u786E\u8BA4\u6388\u6743\u3002\u90E8\u5206\u8D26\u53F7\u4F1A\u989D\u5916\u663E\u793A\u4E00\u4E2A\u914D\u5BF9\u6570\u5B57\uFF0C\u9875\u9762\u4F1A\u5728\u9700\u8981\u65F6\u63D0\u793A\u8F93\u5165\u3002":"Review and confirm authorization on your phone. Some accounts may also require a pairing number.","\u6388\u6743\u7531\u9489\u9489\u5B98\u65B9\u9875\u9762\u5B8C\u6210\u3002\u626B\u7801\u8D26\u53F7\u5FC5\u987B\u5DF2\u52A0\u5165\u4E00\u4E2A\u4F01\u4E1A/\u7EC4\u7EC7\u5E76\u6709\u6743\u521B\u5EFA\u673A\u5668\u4EBA\uFF1B\u521B\u5EFA\u6210\u529F\u540E\uFF0C\u5E94\u7528\u51ED\u636E\u4F1A\u76F4\u63A5\u5199\u5165 Harness Host\u3002":"Authorization is completed on DingTalk\u2019s official page. The account must belong to an organization and be allowed to create bots. Credentials are written directly to the Harness Host.","\u626B\u7801\u7531\u817E\u8BAF\u5B98\u65B9\u9875\u9762\u5B8C\u6210\uFF0C\u4E0D\u9700\u8981\u624B\u52A8\u586B\u5199 AppID \u6216 AppSecret\u3002\u626B\u7801\u6210\u529F\u540E\uFF0C\u673A\u5668\u4EBA\u4F1A\u81EA\u52A8\u8FDE\u63A5 DeepSeek Harness\u3002":"Scanning is completed on Tencent\u2019s official page. No AppID or AppSecret is required, and the bot connects automatically.","\u626B\u7801\u7531\u817E\u8BAF\u5B98\u65B9\u9875\u9762\u5B8C\u6210\uFF0C\u4E0D\u9700\u8981\u624B\u52A8\u586B\u5199 Bot ID \u6216 Secret\u3002\u521B\u5EFA\u6210\u529F\u540E\uFF0C\u673A\u5668\u4EBA\u4F1A\u81EA\u52A8\u8FDE\u63A5 DeepSeek Harness\u3002":"Scanning is completed on Tencent\u2019s official page. No Bot ID or Secret is required, and the bot connects automatically.","\u817E\u8BAF\u9875\u9762\u4F1A\u521B\u5EFA\u6216\u7ED1\u5B9A\u4E00\u4E2A QQ \u673A\u5668\u4EBA\uFF0C\u5E76\u628A\u8FDE\u63A5\u51ED\u636E\u5B89\u5168\u4EA4\u7ED9\u672C\u673A Harness Host\u3002":"Tencent will create or connect a QQ bot and securely deliver its credentials to the local Harness Host.","\u4F01\u4E1A\u5FAE\u4FE1\u5B98\u65B9\u9875\u9762\u4F1A\u521B\u5EFA\u4E00\u4E2A\u667A\u80FD\u673A\u5668\u4EBA\uFF0C\u5E76\u628A\u8FDE\u63A5\u51ED\u636E\u5B89\u5168\u4EA4\u7ED9\u672C\u673A Harness Host\u3002":"WeCom will create an AI bot and securely deliver its credentials to the local Harness Host.","\u4ECE\u6B64 Harness \u79FB\u9664\u8FD9\u4E2A\u5FAE\u4FE1\u8D26\u53F7\uFF1F":"Remove this WeChat account from Harness?","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684 bot_token\u3001\u8D26\u53F7\u914D\u7F6E\u548C\u4F1A\u8BDD\u6620\u5C04\u3002\u5176\u4ED6\u5FAE\u4FE1\u8D26\u53F7\u4E0D\u53D7\u5F71\u54CD\u3002":"This stops the message connection and removes the locally stored bot_token, account configuration, and session mappings. Other WeChat accounts are not affected.","\u6B64\u64CD\u4F5C\u4F1A\u505C\u6B62\u8FD9\u4E2A\u673A\u5668\u4EBA\u7684\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u4FDD\u5B58\u5728\u672C\u673A\u7684\u63A5\u5165\u914D\u7F6E\u548C\u51ED\u636E\u3002\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u5E94\u7528\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\uFF0C\u5176\u4ED6\u673A\u5668\u4EBA\u4E5F\u4E0D\u53D7\u5F71\u54CD\u3002":"This stops the bot connection and removes the locally stored configuration and credentials. The app in Feishu Open Platform is not deleted, and other bots are not affected.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684\u5E94\u7528\u51ED\u636E\u3001\u673A\u5668\u4EBA\u914D\u7F6E\u53CA\u4F1A\u8BDD\u6620\u5C04\u3002\u9489\u9489\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u673A\u5668\u4EBA\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\u3002":"This stops the message connection and removes the locally stored app credentials, bot configuration, and session mappings. The bot in DingTalk Open Platform is not deleted.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684\u5E94\u7528\u51ED\u636E\u3001\u673A\u5668\u4EBA\u914D\u7F6E\u53CA\u4F1A\u8BDD\u6620\u5C04\u3002\u4F01\u4E1A\u5FAE\u4FE1\u5E73\u53F0\u4E2D\u7684\u673A\u5668\u4EBA\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\u3002":"This stops the message connection and removes the locally stored app credentials, bot configuration, and session mappings. The bot in WeCom is not deleted.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684\u5E94\u7528\u51ED\u636E\u3001\u673A\u5668\u4EBA\u914D\u7F6E\u53CA\u4F1A\u8BDD\u6620\u5C04\u3002\u817E\u8BAF\u5E73\u53F0\u4E2D\u7684\u673A\u5668\u4EBA\u4E0D\u4F1A\u88AB\u81EA\u52A8\u5220\u9664\u3002":"This stops the message connection and removes the locally stored app credentials, bot configuration, and session mappings. The bot on Tencent\u2019s platform is not deleted.","\u8FD9\u4F1A\u505C\u6B62\u6D88\u606F\u8FDE\u63A5\uFF0C\u5E76\u5220\u9664\u672C\u673A\u4FDD\u5B58\u7684 WhatsApp \u5173\u8054\u8BBE\u5907\u548C\u4F1A\u8BDD\u6620\u5C04\u3002":"This stops the message connection and removes the locally stored WhatsApp linked device and session mappings.",\u6B63\u5728\u8BFB\u53D6\u98DE\u4E66\u673A\u5668\u4EBA\u5217\u8868:"Loading Feishu bots","\u6B63\u5728\u8BFB\u53D6\u98DE\u4E66\u8FDE\u63A5\u72B6\u6001\u2026":"Loading Feishu connection status\u2026","\u6B63\u5728\u8BFB\u53D6\u5FAE\u4FE1\u8FDE\u63A5\u72B6\u6001\u2026":"Loading WeChat connection status\u2026","\u6B63\u5728\u8BFB\u53D6\u9489\u9489\u8FDE\u63A5\u72B6\u6001\u2026":"Loading DingTalk connection status\u2026","\u901A\u8FC7\u626B\u7801\u628A\u9489\u9489\u673A\u5668\u4EBA\u63A5\u5165 DeepSeek Harness":"Connect a DingTalk bot to DeepSeek Harness by QR code",\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6:"DingTalk did not return QR setup progress",\u9489\u9489\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1:"DingTalk did not return a valid setup attempt","\u9489\u9489 Stream \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"DingTalk Stream connection is healthy",\u9489\u9489\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868:"DingTalk did not return a valid bot list","${totals.connected} / ${totals.configured} \u5728\u7EBF":"${totals.connected} / ${totals.configured} online","\u7528\u4E8E\u628A\u9489\u9489\u673A\u5668\u4EBA\u63A5\u5165 DeepSeek Harness \u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for connecting a DingTalk bot to DeepSeek Harness","\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\\n\u8BF7\u91CD\u65B0\u751F\u6210":"QR code expired\\nGenerate a new one","\u673A\u5668\u4EBA\u5DF2\u521B\u5EFA\uFF0C\u6B63\u5728\u5EFA\u7ACB\u6D88\u606F\u8FDE\u63A5":"Bot created. Starting the message connection",\u9489\u9489\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u5B89\u5168\u7684\u4E8C\u7EF4\u7801:"DingTalk did not return a secure QR code","\u9489\u9489\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u9489\u9489 App \u626B\u63CF\u3002":"DingTalk QR code generated. Scan it with the DingTalk app.","\u9489\u9489\u673A\u5668\u4EBA\u51ED\u636E\u5DF2\u7ED1\u5B9A\u3002":"DingTalk bot credentials connected.","\u5DF2\u53D6\u6D88\u9489\u9489\u673A\u5668\u4EBA\u63A5\u5165\u3002":"DingTalk bot setup cancelled.","\u9489\u9489\u673A\u5668\u4EBA\u53CA\u672C\u673A\u51ED\u636E\u5DF2\u79FB\u9664\u3002":"DingTalk bot and local credentials removed.",\u98DE\u4E66\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u4E8C\u7EF4\u7801\u4FE1\u606F:"Feishu did not return QR code information",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u4E8C\u7EF4\u7801\u4FE1\u606F\u4E0D\u5B8C\u6574:"Feishu returned incomplete QR code information",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u673A\u5668\u4EBA\u72B6\u6001:"Feishu returned an invalid bot status","\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u7684\u673A\u5668\u4EBA\u7F3A\u5C11 botId":"The Feishu bot is missing botId",\u98DE\u4E66\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u8FDE\u63A5\u72B6\u6001:"Feishu did not return connection status",\u98DE\u4E66\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u521B\u5EFA\u8FDB\u5EA6:"Feishu did not return creation progress",\u98DE\u4E66\u670D\u52A1\u8FD4\u56DE\u4E86\u672A\u77E5\u7684\u521B\u5EFA\u72B6\u6001:"Feishu returned an unknown creation status","\u5DF2\u63A5\u5165 ${totals.configured} \u4E2A\u673A\u5668\u4EBA\uFF0C\u5176\u4E2D ${totals.connected} \u4E2A\u5728\u7EBF":"${totals.connected} of ${totals.configured} bots online",\u5C1A\u672A\u63A5\u5165\u673A\u5668\u4EBA:"No bot connected yet","\u7528\u4E8E\u65B0\u589E DeepSeek Harness \u98DE\u4E66\u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u6388\u6743\u4E8C\u7EF4\u7801":"One-time authorization QR code for adding a Feishu bot to DeepSeek Harness",\u8BF7\u5237\u65B0\u540E\u91CD\u65B0\u626B\u7801:"Refresh and scan again",'${connected ? "\u68C0\u67E5\u8FDE\u63A5" : "\u91CD\u8BD5\u8FDE\u63A5"}${bot.name}':'${connected ? "Check connection" : "Reconnect"} ${bot.name}',\u65E0\u6CD5\u8BFB\u53D6\u98DE\u4E66\u673A\u5668\u4EBA:"Could not load Feishu bots","\u6388\u6743\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u98DE\u4E66\u626B\u7801\u3002":"Authorization QR code generated. Scan it with Feishu.","\u98DE\u4E66\u673A\u5668\u4EBA\u51ED\u636E\u5DF2\u7ED1\u5B9A\u3002":"Feishu bot credentials connected.","\u5DF2\u53D6\u6D88\u6DFB\u52A0\u673A\u5668\u4EBA\u3002":"Adding the bot was cancelled.","${newBot.bot.name}\u5DF2\u8FDE\u63A5\uFF0C\u53EF\u4EE5\u5728\u98DE\u4E66\u4E2D\u5F00\u59CB\u804A\u5929\u3002":"${newBot.bot.name} is connected and ready to chat in Feishu.","${bot.name}\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u67E5\u770B\u673A\u5668\u4EBA\u72B6\u6001\u3002":"${bot.name} operation failed. Check the bot status.","${bot.name}\u5DF2\u4ECE\u6B64 DeepSeek Harness \u79FB\u9664\uFF1B\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u4E2D\u7684\u5E94\u7528\u672A\u88AB\u5220\u9664\u3002":"${bot.name} was removed from this DeepSeek Harness. The app in Feishu Open Platform was not deleted.",\u65E0\u6CD5\u8BFB\u53D6\u8FDE\u63A5\u72B6\u6001:"Could not load connection status","QQ \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6":"QQ did not return QR setup progress","QQ \u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1":"QQ did not return a valid setup attempt","QQ WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"QQ WebSocket connection is healthy","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002":"The QQ connection is not ready; the plugin will retry automatically.","QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5":"The QQ connection is not ready; the plugin will retry automatically","QQ \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF":"The QQ connection is currently offline","QQ \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868":"QQ did not return a valid bot list","\u5C1A\u672A\u7ED1\u5B9A QQ \u673A\u5668\u4EBA":"No QQ bot connected yet","\u7528\u4E8E\u7ED1\u5B9A QQ \u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for connecting a QQ bot","${channel}${connectionSummary}\u8FD0\u884C\u6B63\u5E38":"${channel}${connectionSummary} is healthy","${channel} \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868":"${channel} did not return a valid bot list","\u4F7F\u7528 Bot Token \u63A5\u5165 ${channel} \u673A\u5668\u4EBA":"Connect a ${channel} bot with a Bot Token","${model.totals.connected} / ${model.totals.configured} \u5728\u7EBF":"${model.totals.connected}/${model.totals.configured} online"," Bot API \u957F\u8F6E\u8BE2":" Bot API long polling",\u4F01\u4E1A\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u7ED1\u5B9A\u8FDB\u5EA6:"WeCom did not return QR setup progress",\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1:"WeCom did not return a valid setup attempt","\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38":"WeCom WebSocket connection is healthy",\u4F01\u4E1A\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868:"WeCom did not return a valid bot list",\u5C1A\u672A\u7ED1\u5B9A\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA:"No WeCom bot connected yet",\u7528\u4E8E\u7ED1\u5B9A\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801:"One-time QR code for connecting a WeCom bot",\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u7ED1\u5B9A\u4EFB\u52A1:"WeChat did not return a valid setup attempt",\u5FAE\u4FE1\u7ED1\u5B9A\u6CA1\u6709\u5B8C\u6210:"WeChat setup did not complete",\u5FAE\u4FE1\u8FDE\u63A5\u6B63\u5E38:"WeChat connection is healthy",\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA:"WeChat connection is not ready","\u5F53\u524D\u6A21\u578B\u4E0D\u652F\u6301\u56FE\u7247\uFF0C\u8BF7\u7528 /models \u67E5\u770B\u53EF\u7528\u6A21\u578B\uFF0C\u518D\u7528 /model <\u5E8F\u53F7> \u5207\u6362\u540E\u91CD\u53D1\u3002":"The current model does not support images. Use /models to list models, then /model to switch and resend.","\u56FE\u7247\u8D85\u8FC7\u5BBF\u4E3B\u5141\u8BB8\u7684\u5927\u5C0F\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image exceeds the Host size limit. Compress it and try again.","\u56FE\u7247\u5206\u8FA8\u7387\u8FC7\u9AD8\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image resolution is too high. Compress it and try again.","\u56FE\u7247\u5185\u5BB9\u65E0\u6548\u6216\u683C\u5F0F\u4E0D\u53D7\u652F\u6301\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The image is invalid or unsupported. Send it again.","\u672A\u80FD\u8BFB\u53D6\u56FE\u7247\u5185\u5BB9\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The image could not be read. Send it again.","\u56FE\u7247\u683C\u5F0F\u4E0E\u5B9E\u9645\u5185\u5BB9\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u3002":"The declared image format does not match its content. Send it again.","\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u6570\u91CF\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u540E\u91CD\u8BD5\u3002":"The message exceeds the Host image-count limit. Remove some images and try again.","\u56FE\u7247\u603B\u5927\u5C0F\u8D85\u8FC7\u5BBF\u4E3B\u9650\u5236\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The images exceed the Host total-size limit. Remove or compress some images and try again.","\u56FE\u7247\u4E0B\u8F7D\u5730\u5740\u53D1\u751F\u4E86\u91CD\u5B9A\u5411\uFF0C\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u3002":"The image download redirected and cannot be read.","\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The image exceeds 5 MB. Compress it and try again.","\u4E00\u6B21\u53D1\u9001\u7684\u56FE\u7247\u603B\u5927\u5C0F\u8FC7\u5927\uFF0C\u8BF7\u51CF\u5C11\u56FE\u7247\u6570\u91CF\u6216\u538B\u7F29\u540E\u91CD\u8BD5\u3002":"The images are too large in total. Remove or compress some images and try again.","\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002":"The image download failed. Send it again.","\u6682\u4E0D\u652F\u6301\u8BE5\u56FE\u7247\u683C\u5F0F\uFF0C\u8BF7\u53D1\u9001 JPEG\u3001PNG\u3001WebP \u6216 GIF \u56FE\u7247\u3002":"This image format is unsupported. Send a JPEG, PNG, WebP, or GIF image.","\u6D88\u606F\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Message processing failed. Try again later.",\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u8D26\u53F7\u5217\u8868:"WeChat did not return a valid account list",\u5C1A\u672A\u7ED1\u5B9A\u5FAE\u4FE1:"No WeChat account connected yet","\u7528\u4E8E\u628A\u5FAE\u4FE1\u673A\u5668\u4EBA\u7ED1\u5B9A\u5230 DeepSeek Harness \u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for connecting a WeChat bot to DeepSeek Harness","\u4FDD\u6301\u672C\u9875\u6253\u5F00\uFF0C\u7B49\u5F85\u6D88\u606F\u957F\u8F6E\u8BE2\u53D8\u4E3A\u5728\u7EBF":"Keep this page open until long polling is online","\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u751F\u6210\uFF0C\u8BF7\u4F7F\u7528\u624B\u673A\u5FAE\u4FE1\u626B\u63CF\u3002":"WeChat QR code generated. Scan it with WeChat on your phone.","\u79FB\u9664\u5931\u8D25\uFF1A${presentError(error).message}":"Removal failed: ${presentError(error).message}",\u65E0\u6CD5\u8BFB\u53D6\u5FAE\u4FE1\u72B6\u6001:"Could not load WeChat status","WhatsApp \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u8FDB\u5EA6":"WhatsApp did not return QR setup progress","WhatsApp \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u626B\u7801\u4EFB\u52A1":"WhatsApp did not return a valid setup attempt","WhatsApp \u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6709\u6548\u7684\u673A\u5668\u4EBA\u5217\u8868":"WhatsApp did not return a valid account list","\u7528\u4E8E\u5173\u8054 WhatsApp \u8BBE\u5907\u7684\u4E00\u6B21\u6027\u4E8C\u7EF4\u7801":"One-time QR code for linking a WhatsApp device",\u7528\u6237:"User","\u5FAE\u4FE1\u7528\u6237 ID":"WeChat user ID","\u586B\u5199\u63A5\u6536\u6D88\u606F\u7684\u7528\u6237 ID":"Enter the recipient user ID",\u79C1\u804A:"Direct message",\u7FA4\u804A:"Group","\u7FA4 Chat ID":"Group Chat ID","\u7528\u6237 ID":"User ID","\u586B\u5199\u9489\u9489\u7528\u6237 ID":"Enter the DingTalk user ID","\u7FA4 Open Conversation ID":"Group Open Conversation ID","\u586B\u5199\u4F01\u4E1A\u5FAE\u4FE1\u7528\u6237 ID":"Enter the WeCom user ID","\u586B\u5199\u7FA4 chatid":"Enter the group chatid",\u5355\u804A:"Direct message","\u7528\u6237 Open ID":"User Open ID","\u586B\u5199 user_openid":"Enter the user_openid","\u7FA4 Open ID":"Group Open ID","\u586B\u5199 group_openid":"Enter the group_openid",\u4F1A\u8BDD:"Conversation",\u7EBF\u7A0B:"Thread","Thread \u65F6\u95F4\u6233":"Thread timestamp",\u804A\u5929:"Chat",\u8BDD\u9898:"Topic",\u9891\u9053\u6216\u79C1\u4FE1:"Channel or DM","\u586B\u5199\u53EF\u53D1\u6D88\u606F\u7684 Channel ID":"Enter a Channel ID the bot can message","\u7528\u6237 JID":"User JID","\u7FA4 JID":"Group JID","\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Request failed. Try again later.","\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301\u81EA\u52A8\u590D\u5236\uFF0C\u8BF7\u624B\u52A8\u9009\u62E9\u590D\u5236\u3002":"Automatic copy is unavailable. Select and copy the value manually.","\u76EE\u6807\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u540E\u91CD\u8BD5\u3002":"Could not save the target. Check it and try again.","\u65E0\u6CD5\u751F\u6210\u672A\u5360\u7528\u7684 Target ID\uFF0C\u8BF7\u91CD\u8BD5\u3002":"Could not generate an unused Target ID. Try again.",\u7F16\u8F91\u6295\u9012\u76EE\u6807:"Edit delivery target",\u65B0\u5EFA\u6295\u9012\u76EE\u6807:"New delivery target","\u5DF2\u4ECE\u4F1A\u8BDD\u81EA\u52A8\u586B\u5165\u76EE\u6807\u4FE1\u606F\uFF1B\u786E\u8BA4\u540E\u518D\u4FDD\u5B58\u3002":"Target details were filled from the conversation. Review them before saving.","\u8BF7\u624B\u52A8\u586B\u5199\u4ECE\u5BF9\u5E94\u5E73\u53F0\u53D6\u5F97\u7684\u539F\u751F\u6807\u8BC6\u3002":"Enter the native identifier from the platform manually.","\u4F8B\u5982 daily-report":"For example, daily-report","\u4F7F\u7528\u5927\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u70B9\u3001\u4E0B\u5212\u7EBF\u3001\u5192\u53F7\u3001@ \u6216\u8FDE\u5B57\u7B26\u3002":"Use letters, numbers, dots, underscores, colons, @, or hyphens.","\u663E\u793A\u540D\u79F0\uFF08\u53EF\u9009\uFF09":"Display name (optional)","\u4F8B\u5982 \u6BCF\u65E5\u6C47\u62A5\u7FA4":"For example, Daily reports",\u76EE\u6807\u7C7B\u578B:"Target type",\u4FDD\u5B58\u76EE\u6807:"Save target",\u8BF7\u5148\u5B8C\u6210\u6295\u9012\u76EE\u6807\u8BFB\u53D6:"Wait for delivery targets to finish loading",\u4ECE\u5DF2\u804A\u8FC7\u7684\u4F1A\u8BDD\u9009\u62E9:"Choose from conversations",\u5DF2\u804A\u4F1A\u8BDD:"Conversation",\u4ECE\u4F1A\u8BDD\u9009\u62E9targetID:"Select a targetID from conversations","\u9009\u62E9\u540E\u4F1A\u81EA\u52A8\u586B\u5199\u76EE\u6807\u4FE1\u606F\u548C\u8C03\u7528\u522B\u540D\uFF0C\u786E\u8BA4\u540E\u518D\u4FDD\u5B58\u3002":"Selecting a conversation fills the target details and call alias. Review them before saving.","\u6B63\u5728\u5237\u65B0\u2026":"Refreshing\u2026",\u5237\u65B0:"Refresh","\u6B63\u5728\u8BFB\u53D6\u5DF2\u804A\u4F1A\u8BDD\u2026":"Loading known conversations\u2026","\u65E0\u6CD5\u8BFB\u53D6\u5DF2\u804A\u4F1A\u8BDD\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not load known conversations. Try again later.",\u8FD8\u6CA1\u6709\u53EF\u9009\u62E9\u7684\u4F1A\u8BDD:"No conversations to choose from","\u5148\u5728\u5BF9\u5E94\u5E73\u53F0\u4E0E\u673A\u5668\u4EBA\u804A\u4E00\u6761\u6D88\u606F\uFF0C\u518D\u5237\u65B0\u3002":"Send the bot a message on the platform, then refresh.",\u5DF2\u6DFB\u52A0:"Added","\u624B\u52A8\u586B\u5199\uFF08\u9AD8\u7EA7\uFF09":"Enter manually (advanced)","\u6D4B\u8BD5\u6D88\u606F\u5DF2\u53D1\u9001\uFF0C\u8BF7\u5230\u76EE\u6807\u4F1A\u8BDD\u786E\u8BA4\u3002":"Test message sent. Confirm it in the target conversation.","\u6D4B\u8BD5\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Test delivery failed. Try again later.",\u5DF2\u590D\u5236\u8C03\u7528\u53C2\u6570:"Call parameters copied","\u590D\u5236\u5931\u8D25\u3002":"Copy failed.","\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not delete the target. Try again later.",\u590D\u5236\u8C03\u7528\u53C2\u6570:"Copy call parameters",\u673A\u5668\u4EBA\u79BB\u7EBF\u65F6\u4E0D\u53EF\u53D1\u9001\u6D4B\u8BD5\u6D88\u606F:"Test delivery is unavailable while the bot is offline",\u6D4B\u8BD5\u6295\u9012\u76EE\u6807:"Test delivery target",\u6D4B\u8BD5:"Test",\u7F16\u8F91:"Edit",\u5220\u9664:"Delete","\u5220\u9664 ":"Delete ","\uFF1F\u4F7F\u7528\u8FD9\u4E2A targetId \u7684\u5916\u90E8\u8C03\u7528\u5C06\u8FD4\u56DE unknown-target\u3002":"? External calls using this targetId will return unknown-target.","\u6B63\u5728\u5220\u9664\u2026":"Deleting\u2026",\u786E\u8BA4\u5220\u9664:"Delete target","\u6295\u9012\u76EE\u6807\u8BBE\u7F6E\u6682\u4E0D\u53EF\u7528\u3002":"Delivery target settings are unavailable.","\u65E0\u6CD5\u8BFB\u53D6\u6295\u9012\u76EE\u6807\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002":"Could not load delivery targets. Try again later.","\u2190 \u8FD4\u56DE\u673A\u5668\u4EBA\u5217\u8868":"\u2190 Back to bots",\u4F7F\u7528\u6587\u6863:"User guide",\u6253\u5F00\u4E3B\u52A8\u6295\u9012\u4F7F\u7528\u6587\u6863:"Open the proactive delivery guide","\u5F53\u524D\u6E20\u9053\u6682\u4E0D\u652F\u6301\u6295\u9012\u76EE\u6807\u3002":"Delivery targets are not supported for this channel.","\u5DF2\u590D\u5236 Bot ID":"Bot ID copied",\u590D\u5236:"Copy",\u6295\u9012\u76EE\u6807:"Delivery targets","\u673A\u5668\u4EBA\u5F53\u524D\u79BB\u7EBF\uFF1B\u4ECD\u53EF\u914D\u7F6E\u76EE\u6807\uFF0C\u6062\u590D\u8FDE\u63A5\u540E\u518D\u6D4B\u8BD5\u3002":"The bot is offline. You can still configure targets and test them after reconnection.",\u65B0\u5EFA\u76EE\u6807:"New target","\u6B63\u5728\u8BFB\u53D6\u6295\u9012\u76EE\u6807\u2026":"Loading delivery targets\u2026",\u5C1A\u672A\u914D\u7F6E\u6295\u9012\u76EE\u6807:"No delivery targets yet","\u70B9\u51FB\u201C\u65B0\u5EFA\u76EE\u6807\u201D\u53EF\u4ECE\u5DF2\u804A\u8FC7\u7684\u4F1A\u8BDD\u9009\u62E9\uFF0C\u4E5F\u53EF\u624B\u52A8\u586B\u5199\u3002":"Select New target to choose a conversation or enter the details manually."});var NhA=Object.freeze(Object.fromEntries(Object.keys(zGe).map(n=>[n,n==="$locale"?"zh":n])));var RhA=Object.freeze(["aria-label","alt","placeholder","title"]);var VGe=Object.freeze({defaultId:"",items:Object.freeze([])}),GhA=gh.createContext(VGe);var EG="/feishu",EZ=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",beginCallbackRepair:"bot.callback-repair.begin",beginGroupMessagePermission:"bot.group-message-permission.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",disconnectBot:"bot.disconnect",deleteBot:"bot.delete",setWorkspace:"bot.workspace.set",setAgentPreset:"bot.preset.set",setContextEnhancement:"bot.context-enhancement.set",setAccessPolicy:"bot.access-policy.set",setGroupResponseMode:"bot.group-response-mode.set",testConnection:"connection.test",disconnect:"connection.disconnect"}),qhA=Object.freeze({PROVISION:"provision",CALLBACK_REPAIR:"callback_repair",GROUP_MESSAGE_PERMISSION:"group_message_permission"});var Dt=Object.freeze({...EZ,setAccessPolicy:Xi,setGroupSessionScope:ea});var Ml=Object.freeze({reconnectBot:"bot.reconnect",disconnectBot:"bot.disconnect",deleteBot:"bot.delete"}),QZ=Object.freeze([...new Set([...Object.values(Dt),...Object.values(Ml)])]),ZGe=new Set(["idle","starting","qr_ready","polling","slow_down","domain_switched","saving","succeeded","expired","cancelled","error"]),XGe=new Set(["provision","callback_repair","group_message_permission"]),yZ="callback_repair",CG="group_message_permission",rw=new Set([yZ,CG]),$Ge=new Set(["accounts.feishu.cn","accounts.larksuite.com","open.feishu.cn","open.larksuite.com"]),eFe=/^[A-Za-z0-9_-]{1,128}$/,AFe=/^cli_[A-Za-z0-9_-]+$/,uZ=Object.freeze({abort:"Registration was cancelled.",access_denied:"Registration was denied.",expired_token:"The registration QR code expired.",invalid_credentials:"Feishu returned invalid app credentials.",credentials_callback_failed:"Unable to activate the Feishu connection.",registration_failed:"Unable to register the Feishu app.",connection_failed:"The bot was created, but its connection could not be started.",credential_removal_failed:"Unable to remove the Feishu credentials.",state_cleanup_failed:"Unable to remove the bot session data. Please retry.",deletion_pending:"Bot deletion is incomplete. Retry removal to finish cleanup.",missing_credentials:"The bot credentials are missing. Delete it and scan again.",repair_app_mismatch:"The authorized Feishu app does not match the selected bot.",repair_owner_missing:"Feishu did not return the authorizing account identity.",repair_domain_mismatch:"The authorized Feishu tenant does not match the selected bot.",repair_owner_mismatch:"The authorizing Feishu account is not an owner of the selected bot.",repair_credentials_invalid:"Feishu returned credentials that could not be verified for the selected bot.",repair_bot_mismatch:"The verified Feishu bot does not match the selected bot.",repair_target_changed:"The selected bot changed while repair was in progress. Start the repair again.",credential_update_failed:"Unable to store the repaired Feishu credentials.",credential_state_unknown:"The repaired Feishu credentials could not be confirmed after saving.",repair_connection_failed:"The callback update was accepted, but the selected bot could not reconnect.",group_message_permission_required:"Authorize access to all group messages before enabling this mode.",group_message_permission_save_failed:"Feishu granted the permission, but all-message mode could not be saved.",group_message_permission_connection_failed:"Feishu granted the permission, but the selected bot could not reconnect.",card_action_probe_unavailable:"The selected bot is not connected, so its card button cannot be verified.",card_action_probe_send_failed:"The callback update was accepted, but the verification card could not be sent.",card_action_probe_timeout:"Feishu accepted the update, but the card button was not verified in time. Start the repair again and click the test button within two minutes.",card_action_probe_failed:"Feishu accepted the update, but the card button verification failed."}),tFe=Object.freeze({idle:"pending",starting:"pending",qr_ready:"pending",polling:"pending",slow_down:"pending",domain_switched:"pending",saving:"connecting",succeeded:"connected",expired:"expired",cancelled:"failed",error:"failed"});function rFe(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;let t=Object.getPrototypeOf(n);return t===Object.prototype||t===null}function Wo(n,t){return rFe(n)&&Reflect.ownKeys(n).every(o=>typeof o=="string"&&t.has(o))}function $C(n){return Number.isFinite(n)?n:void 0}function Fn(n){return typeof n=="string"&&eFe.test(n)}function CZ(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function fG(n){if(!n||typeof n!="object")return null;let t=typeof n.code=="string"&&Object.hasOwn(uZ,n.code)?n.code:"registration_failed";return{code:t,message:uZ[t]}}function Ts(n){if(!n||typeof n!="object")return{state:"idle",attempt:0};let t=ZGe.has(n.state)?n.state:"error",o=Fn(n.attempt)?n.attempt:$C(n.attempt)??0,a={state:t,attempt:o};a.operation=XGe.has(n.operation)?n.operation:"provision";let e=$C(n.updatedAt),i=$C(n.expiresAt),A=$C(n.remainingSeconds),r=$C(n.pollIntervalSeconds);e!==void 0&&(a.updatedAt=e),typeof n.qrCodeUrl=="string"&&n.qrCodeUrl.length>0&&(a.qrCodeUrl=n.qrCodeUrl),i!==void 0&&(a.expiresAt=i),A!==void 0&&(a.remainingSeconds=A),r!==void 0&&(a.pollIntervalSeconds=r),Fn(n.botId)&&(a.botId=n.botId);let s=fG(n.error);return s&&(a.error=s),a}function iFe(n,t,o){if(!(typeof n!="string"||n.length===0))try{let a=new URL(n);if(a.protocol!=="https:"||!$Ge.has(a.hostname)||a.port||a.username||a.password)return;if(rw.has(t)){let e=a.searchParams.getAll("clientID"),i=a.searchParams.getAll("tp"),A=a.searchParams.getAll("addons"),r=[...a.searchParams.values()].some(s=>s.includes("{{")||s.includes("}}"));if(e.length!==1||i.length!==1||i[0]!=="sdk"||!AFe.test(e[0]??"")||a.hostname!==o||a.searchParams.has("createOnly")||A.length!==1||!A[0]?.trim()||r)return}return a.toString()}catch{return}}function iw(n){let t=n&&typeof n=="object"?n:{};return{connected:t.connected===!0||t.ready===!0&&t.feishuLongConnectionState==="connected"&&t.harnessReachable===!0,ready:t.ready===!0,harnessReachable:t.harnessReachable===!0}}function mZ(n){let t=n&&typeof n=="object"?n:{},o={name:typeof t.name=="string"&&t.name.length>0?t.name:"\u98DE\u4E66\u673A\u5668\u4EBA"};return typeof t.avatarUrl=="string"&&(o.avatarUrl=t.avatarUrl),typeof t.appIdMasked=="string"&&(o.appIdMasked=t.appIdMasked),typeof t.tenantName=="string"&&(o.tenantName=t.tenantName),(t.domain==="feishu"||t.domain==="lark")&&(o.domain=t.domain),(typeof t.activated=="boolean"||typeof t.activated=="number")&&(o.activated=t.activated),o}function SZ(n,t){return t?{status:"healthy",summary:"\u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38",lastCheckedAt:Date.now()}:n?.configured===!0?{status:"offline",summary:"\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5",lastCheckedAt:Date.now()}:{status:"offline",summary:"\u5C1A\u672A\u63A5\u5165\u98DE\u4E66\u673A\u5668\u4EBA",lastCheckedAt:Date.now()}}function wZ(n,t,o){return o?"connected":n?.phase==="error"||t.state==="error"?"error":n?.phase==="connecting"||t.state==="saving"?"connecting":n?.phase==="registering"||["starting","qr_ready","polling","slow_down","domain_switched"].includes(t.state)?"provisioning":"disconnected"}async function DZ(n){return WGe.toDataURL(n,{errorCorrectionLevel:"M",margin:1,width:320,type:"image/png"})}async function aFe(n,t,o){let a=iFe(n.qrCodeUrl,n.operation,o),e={attemptId:String(n.attempt),operation:n.operation,...n.botId?{botId:n.botId}:{},expiresAt:n.expiresAt??Date.now()+5*6e4,pollIntervalMs:Math.max(800,Math.min(1e4,(n.pollIntervalSeconds??1.8)*1e3))};if(a)return{...e,verificationUrl:a,qrCodeDataUrl:await t(a)};if(n.state==="saving"&&rw.has(n.operation)&&n.botId)return{...e,submitted:!0}}function oFe(n){let t=n&&typeof n=="object"?n:{};if(!Fn(t.botId))return null;let o=iw(t.connection),a=t.connected===!0||o.connected,e={state:"idle"},i={botId:t.botId,state:wZ(t,e,a),connected:a,configured:t.configured===!0,agentPreset:dg(t.agentPreset),contextEnhancement:xp(t.contextEnhancement),accessPolicy:qp(t.accessPolicy),groupResponseMode:uo(t.groupResponseMode),groupMessagePermissionGranted:t.groupMessagePermissionGranted===!0,bot:mZ(t.bot),health:SZ(t,a)};typeof t.workspace=="string"&&t.workspace&&(i.workspace=t.workspace);let A=ti(t.lastMessageError);A&&(i.lastMessageError=A);let r=fG(t.error);return r&&(i.error=r),i}async function di(n,{encodeQr:t=DZ}={}){let o=n&&typeof n=="object"?n:{},a=Ts(o.registration),e=iw(o.connection),i=o.connected===!0||e.connected,r=(rw.has(a.operation)&&a.botId&&Array.isArray(o.bots)?o.bots.find(p=>p?.botId===a.botId):void 0)?.bot?.domain==="lark"?"open.larksuite.com":"open.feishu.cn",s=await aFe(a,t,r),g=fG(o.error)??a.error??null,c=Array.isArray(o.bots)?o.bots.map(oFe).filter(Boolean):[],I={schemaVersion:o.schemaVersion===2?2:1,revision:Number.isSafeInteger(o.revision)&&o.revision>=0?o.revision:0,state:wZ(o,a,i),connected:i,configured:o.configured===!0,bot:mZ(o.bot),health:SZ(o,i),bots:c,agentPresetCatalog:gs(o.agentPresetCatalog),totals:{configured:c.length||(o.configured===!0?1:0),connected:c.length?c.filter(p=>p.connected).length:i?1:0}};return s&&(I.provisioning=s),g&&(I.error=g),I}function Aw(n){return{ok:!1,error:{code:"bad-request",message:n,details:{issues:[]}}}}function tw(){return{ok:!1,error:{code:"cancelled",message:"The Feishu request was cancelled.",details:{}}}}function nFe(){return{ok:!1,error:{code:"internal",message:"The Feishu integration operation failed.",details:{}}}}function sFe(n,t){return n===Dt.status?Wo(t,new Set)?null:"This endpoint accepts an empty payload only.":n===Dt.testConnection?Wo(t,new Set)?null:"This endpoint accepts an empty payload only.":n===Dt.beginProvisioning?Wo(t,new Set(["locale","replaceAttemptId"]))?t.locale!==void 0&&t.locale!=="zh-CN"?"The provisioning locale must be zh-CN.":t.replaceAttemptId!==void 0&&!Fn(t.replaceAttemptId)?"replaceAttemptId must be a valid opaque id.":null:"Provisioning accepts locale and replaceAttemptId only.":n===Dt.beginCallbackRepair?Wo(t,new Set(["botId"]))&&Fn(t.botId)?null:"Callback repair requires a single valid botId.":n===Dt.beginGroupMessagePermission?Wo(t,new Set(["botId"]))&&Fn(t.botId)?null:"Group message permission update requires a single valid botId.":n===Dt.bindCredentials?Wo(t,new Set(["appId","appSecret"]))&&CZ(t.appId,256)&&CZ(t.appSecret,1024)?null:"Credential binding requires App ID and App Secret.":n===Dt.pollProvisioning||n===Dt.cancelProvisioning?Wo(t,new Set(["attemptId"]))&&Fn(t.attemptId)?null:"A single valid attemptId is required.":n===Dt.disconnect?Wo(t,new Set(["removeCredentials"]))&&t.removeCredentials===!0?null:"Disconnect requires removeCredentials=true.":n===Ml.reconnectBot?Wo(t,new Set(["botId","sendTest"]))&&Fn(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"A valid botId and optional sendTest flag are required.":n===Ml.disconnectBot?Wo(t,new Set(["botId"]))&&Fn(t.botId)?null:"A single valid botId is required.":n===Ml.deleteBot?Wo(t,new Set(["botId","confirm"]))&&Fn(t.botId)&&t.confirm===!0?null:"Deleting a bot requires a valid botId and confirm=true.":n===Dt.setWorkspace?ta(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Dt.setAgentPreset?ia(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Dt.setContextEnhancement?Zi(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===Dt.setAccessPolicy?$i(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===Dt.setGroupSessionScope?Aa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u7FA4\u4F1A\u8BDD\u7B56\u7565\u3002":n===Dt.setGroupResponseMode?Wo(t,new Set(["botId","groupResponseMode"]))&&Fn(t.botId)&&TS(t.groupResponseMode)?null:"\u8BF7\u9009\u62E9\u7FA4\u804A\u54CD\u5E94\u65B9\u5F0F\u3002":"Unknown Feishu endpoint."}function gFe(n,t){return new Promise((o,a)=>{if(t?.aborted){a(t.reason??new Error("aborted"));return}let e=setTimeout(i,n);e.unref?.();function i(){t?.removeEventListener("abort",A),o()}function A(){clearTimeout(e),a(t.reason??new Error("aborted"))}t?.addEventListener("abort",A,{once:!0})})}async function BG(n,t){return typeof n.registrationStatus=="function"?n.registrationStatus(t):n.status()}async function uG(n,t,o,a){let e=t,i=Date.now()+15e3;for(;;){let A=Ts(e?.registration);if(A.qrCodeUrl)return e;if(["error","expired","cancelled"].includes(A.state))throw new Error("Provisioning stopped before the QR code was ready.");if(Date.now()>=i)throw new Error("Provisioning QR code timed out.");if(await gFe(50,a),e=await BG(n,o),!e)throw new Error("The provisioning attempt is no longer active.")}}function BZ(n,t){return String(Ts(n?.registration).attempt)===t}function fZ(n){let t=Ts(n?.registration);return t.state==="succeeded"?t.botId&&(n?.connected===!0||iw(n?.connection).connected)?"connected":"connecting":tFe[t.state]??"failed"}function cFe(n){if(!n||typeof n.status!="function"||typeof n.startRegistration!="function"||typeof n.cancelRegistration!="function"||typeof n.disconnect!="function")throw new TypeError("A Feishu controller with status/start/cancel/disconnect is required")}function OZ(n,{encodeQr:t=DZ}={}){cFe(n);let o=new Map,a=new Map,e=i=>{let A=o.get(i);return A||(o.size>=32&&o.delete(o.keys().next().value),A=Promise.resolve().then(()=>t(i)),o.set(i,A)),A};return async(i,A,r)=>{if(r?.aborted)return tw();if(!QZ.includes(i))return Aw("Unknown Feishu endpoint.");let s=sFe(i,A);if(s)return Aw(s);try{let g;if(i===Dt.status)g=await di(await n.status(),{encodeQr:e});else if(i===Dt.beginProvisioning){A.replaceAttemptId&&await n.cancelRegistration(A.replaceAttemptId);let c=await n.startRegistration({locale:A.locale}),I=String(Ts(c?.registration).attempt),p=await uG(n,c,I,r);if(g=(await di(p,{encodeQr:e})).provisioning,!g)throw new Error("Provisioning did not produce a QR code.");a.set(I,g.verificationUrl)}else if(i===Dt.beginCallbackRepair){if(typeof n.startCallbackRepair!="function")throw new Error("Feishu callback repair is unavailable.");let c=await n.startCallbackRepair(A.botId),I=String(Ts(c?.registration).attempt),p=await uG(n,c,I,r);if(g=(await di(p,{encodeQr:e})).provisioning,!g||g.operation!==yZ||g.botId!==A.botId)throw new Error("Callback repair did not produce a safe QR code.");a.set(I,g.verificationUrl)}else if(i===Dt.beginGroupMessagePermission){if(typeof n.startGroupMessagePermission!="function")throw new Error("Feishu group message permission update is unavailable.");let c=await n.startGroupMessagePermission(A.botId),I=String(Ts(c?.registration).attempt),p=await uG(n,c,I,r);if(g=(await di(p,{encodeQr:e})).provisioning,!g||g.operation!==CG||g.botId!==A.botId)throw new Error("Group message permission update did not produce a safe QR code.");a.set(I,g.verificationUrl)}else if(i===Dt.pollProvisioning){let c=await BG(n,A.attemptId);if(!c||!BZ(c,A.attemptId))return Aw("The provisioning attempt is no longer active.");let I=Ts(c.registration),p=await di(c,{encodeQr:e});if(g={status:fZ(c),operation:I.operation,...I.botId?{botId:I.botId}:{},...p.provisioning?{provisioning:p.provisioning}:{},...I.botId&&p.connected?{connection:p}:{},...p.error?{message:p.error.message}:{}},["connected","expired","failed"].includes(g.status)){let B=a.get(A.attemptId);B&&o.delete(B),a.delete(A.attemptId)}}else if(i===Dt.cancelProvisioning){let c=await BG(n,A.attemptId);if(!c||!BZ(c,A.attemptId))return Aw("The provisioning attempt is no longer active.");let I=typeof n.registrationStatus=="function",p=Ts(c.registration),B;!I&&p.state==="saving"?B=await n.disconnect():B=await n.cancelRegistration(A.attemptId);let f=Ts(B?.registration);if(rw.has(p.operation)&&p.state==="saving"&&["saving","succeeded"].includes(f.state)&&(g={status:fZ(B),operation:f.operation,...f.botId?{botId:f.botId}:{},message:p.operation===CG?"The permission update was already submitted and is still being applied.":"Callback repair was already submitted and is still being verified."}),g?.status!=="connecting"){let Q=a.get(A.attemptId);Q&&o.delete(Q),a.delete(A.attemptId),g??={status:"failed",operation:p.operation,...p.botId?{botId:p.botId}:{},message:"Registration was cancelled."}}}else if(i===Dt.bindCredentials){if(typeof n.bindCredentials!="function")throw new Error("Credential binding is unavailable");g=await di(await n.bindCredentials(A),{encodeQr:e})}else if(i===Dt.testConnection){let c=await n.status(),p=c?.connected===!0||iw(c?.connection).connected||typeof n.reconnect!="function"?c:await n.reconnect();g=await di(p,{encodeQr:e})}else if(i===Dt.disconnect)g=await di(await n.disconnect(),{encodeQr:e});else if(i===Ml.reconnectBot){if(typeof n.reconnectBot!="function")throw new Error("Multi-bot reconnect is unavailable");let c=await n.reconnectBot(A.botId);if(r?.aborted)return tw();if(g=await di(c,{encodeQr:e}),A.sendTest===!0){let I=null;if(!(c?.bots?.some(B=>B?.botId===A.botId&&B.connected===!0)===!0))I=new Error("Feishu bot is not connected"),I.code="test-target-unavailable";else try{if(typeof n.sendConnectionTest!="function"){let B=new Error("Connection test is unavailable");throw B.code="test-target-unavailable",B}await n.sendConnectionTest(A.botId)}catch(B){I=B}g={...g,testMessage:lr(I)}}}else if(i===Ml.disconnectBot){if(typeof n.disconnectBot!="function")throw new Error("Multi-bot disconnect is unavailable");g=await di(await n.disconnectBot(A.botId),{encodeQr:e})}else if(i===Dt.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");g=await di(await n.updateWorkspace(A.botId,A.workspace),{encodeQr:e})}else if(i===Dt.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");g=await n.updateContextEnhancement(A.botId,A.config,c=>di(c,{encodeQr:e}))}else if(i===Dt.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");g=await n.updateAccessPolicy(A.botId,A.policy,c=>di(c,{encodeQr:e}))}else if(i===Dt.setGroupSessionScope){if(typeof n.updateGroupSessionScope!="function")throw new Error("Group session scope update is unavailable");g=await n.updateGroupSessionScope(A.botId,A.groupSessionScope,c=>di(c,{encodeQr:e}))}else if(i===Dt.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");g=await di(await n.updateAgentPreset(A.botId,A.agentPreset),{encodeQr:e})}else if(i===Dt.setGroupResponseMode){if(typeof n.updateGroupResponseMode!="function")throw new Error("Group response mode update is unavailable");g=await di(await n.updateGroupResponseMode(A.botId,A.groupResponseMode),{encodeQr:e})}else{if(typeof n.deleteBot!="function")throw new Error("Multi-bot delete is unavailable");g=await di(await n.deleteBot(A.botId),{encodeQr:e})}return r?.aborted?tw():{ok:!0,value:g}}catch(g){let c=ra(g);return r?.aborted?tw():c?{ok:!1,error:{...c,details:{}}}:nFe()}}}function aw(n,t,o,a){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(EG,OZ(t,o),{authority:mr(a)})}function IFe(n,t){if(t?.controller)return t.controller;if(typeof t?.createController=="function")return t.createController();if(typeof t?.createProvisioningManager=="function")return YT(t)}async function bZ(n,t={}){let o=IFe(n,t);if(o)return aw(n,o,t.rpcOptions,t.rpcAuthority);let a=await sG(n,t),e=t.deliveryService&&a.deliveryAdapter?t.deliveryService.registerAdapter(a.deliveryAdapter):void 0,i=aw(n,a.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await e?.(),await a.close()},"dsh-feishu: close controller and live connection"),i}import{unlink as gLe}from"node:fs/promises";import{homedir as cLe}from"node:os";import{join as rB,resolve as Rl}from"node:path";import{createHash as lFe}from"node:crypto";import{mkdir as pFe,readFile as dFe,rename as hFe,unlink as EFe,writeFile as uFe}from"node:fs/promises";import{dirname as CFe}from"node:path";var QG=Object.freeze({version:1,bots:Object.freeze([])});function jc(n){return typeof n=="string"&&n.trim()?n.trim():null}function MZ(n){let t=jc(n);return t&&/^qq_[a-f0-9]{24}$/.test(t)?t:null}function BFe(n){let t=jc(n);return t&&/^DSH_QQBOT_APP_SECRET_[A-F0-9]{24}$/.test(t)?t:null}function nw(n){let t=jc(n);if(!t)throw new TypeError("appId is required");let o=lFe("sha256").update(t).digest("hex").slice(0,24);return{botId:`qq_${o}`,secretRef:`DSH_QQBOT_APP_SECRET_${o.toUpperCase()}`}}function yG(n){let t=jc(n)??"";return t.length<=10?t?`${t.slice(0,3)}\u2022\u2022\u2022`:w("QQ\u673A\u5668\u4EBA"):`${t.slice(0,6)}\u2022\u2022\u2022\u2022${t.slice(-4)}`}function _Z(n){if(!n||typeof n!="object")return null;let t=jc(n.appId),o=jc(n.ownerUserOpenid),a=MZ(n.botId),e=BFe(n.secretRef);if(!t||!o||!a||!e)return null;let i=nw(t);return i.botId!==a||i.secretRef!==e?null:Object.freeze({botId:a,appId:t,secretRef:e,ownerUserOpenid:o,createdAt:jc(n.createdAt)??new Date().toISOString(),connectedAt:jc(n.connectedAt)})}function fFe(n){if(!n||n.version!==1||!Array.isArray(n.bots))return null;let t=n.bots.map(_Z);if(t.some(i=>i===null))return null;let o=new Set,a=new Set,e=new Set;for(let i of t){if(o.has(i.botId)||a.has(i.appId)||e.has(i.secretRef))return null;o.add(i.botId),a.add(i.appId),e.add(i.secretRef)}return Object.freeze({version:1,bots:Object.freeze(t)})}var ow=class{#e;#A=QG;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=fFe(JSON.parse(await dFe(this.#e,"utf8")));if(!t)throw new Error("dsh-im QQ config contains invalid bot data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=QG}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(a=>a.botId===t);return o?structuredClone(o):null}getByAppId(t){let o=this.#A.bots.find(a=>a.appId===t);return o?structuredClone(o):null}async save(t){let o=_Z(t);if(!o)throw new Error("Refusing to persist incomplete QQ bot data");return this.#r(a=>{let e=a.find(r=>r.appId===o.appId&&r.botId!==o.botId),i=a.find(r=>r.secretRef===o.secretRef&&r.botId!==o.botId);if(e||i)throw new Error("Duplicate QQ bot identity");let A=a.findIndex(r=>r.botId===o.botId);return A===-1?a.push(o):a[A]=o,structuredClone(o)})}async remove(t){if(!MZ(t))throw new TypeError("Invalid QQ bot id");return this.#r(o=>{let a=o.findIndex(i=>i.botId===t);if(a===-1)return null;let[e]=o.splice(a,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await EFe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=QG});this.#t=t.then(()=>{},()=>{}),await t}async#r(t){let o,a=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let i=Object.freeze({version:1,bots:Object.freeze(e)});await this.#I(i),this.#A=i});return this.#t=a.then(()=>{},()=>{}),await a,o}async#I(t){await pFe(CFe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await uFe(o,`${JSON.stringify(t,null,2)} `,{encoding:"utf8",mode:384}),await hFe(o,this.#e)}};var sw=class extends yr{constructor(t){super({...t,rpcIdPrefix:"qq",logPrefix:"dsh-qq"})}};import{randomUUID as QFe}from"node:crypto";var TZ=new Set(["starting","pending","refreshing","connecting"]),_l=new Set(["connected","failed","cancelled"]),yFe=5*6e4;function Tl(n){return typeof n=="string"&&n.trim()?n.trim():null}function Ln(n,t){return Object.freeze({code:n,message:t})}function gw(n){return n?{attemptId:n.id,status:n.state,qrRevision:n.qrRevision,pollIntervalMs:1e3,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.botId?{botId:n.botId}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}var eB=class{#e;#A;#t;#r;#I;#o;#c=new Map;#i=new Map;#a=new Map;#s=null;#p=new Map;#g=0;#l=!1;constructor({qrAuth:t,credentials:o,configStore:a,createRuntime:e,deleteState:i=async()=>{},logger:A=console}){if(!t||typeof t.start!="function")throw new TypeError("QQ QR auth is required");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError("QqController requires the DSH credential provider");if(!a||typeof a.list!="function"||typeof a.save!="function"||typeof a.remove!="function")throw new TypeError("QqController requires a config store");if(typeof e!="function")throw new TypeError("createRuntime is required");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A}async initialize(){if(this.#l)return this.status();for(let t of this.#t.list())await this.#f(t.botId,async()=>{if(this.#l||this.#c.get(t.botId)?.status?.ready)return;let o=await this.#u(t.secretRef);if(!o){this.#i.set(t.botId,Ln("missing-secret",w("QQ \u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002")));return}try{await this.#d(t,o),this.#i.delete(t.botId)}catch(a){this.#i.set(t.botId,Ln("connection-failed",w("QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#o.warn?.(`[dsh-im:qq] bot ${t.botId} failed to initialize:`,a)}finally{this.#m()}});return this.status()}async startProvisioning(){if(this.#l)throw new Error("QQ controller is closed");this.#s&&await this.cancelProvisioning(this.#s);let t,o,a=new Promise((i,A)=>{t=i,o=A}),e={id:QFe(),state:"starting",createdAt:Date.now(),expiresAt:null,qrRevision:0,verificationUrl:null,controller:new AbortController,dispose:null,task:null,error:null,botId:null};this.#a.set(e.id,e),this.#s=e.id,this.#m();try{return e.dispose=this.#e.start({onQrDisplayed:i=>{if(e.controller.signal.aborted||_l.has(e.state))return;let A=Tl(i);A&&(e.verificationUrl=A,e.qrRevision+=1,e.expiresAt=Date.now()+yFe,e.state="pending",this.#m(),t())},onQrExpired:()=>{e.controller.signal.aborted||_l.has(e.state)||(e.state="refreshing",e.verificationUrl=null,e.expiresAt=null,this.#m())},onSuccess:i=>{e.controller.signal.aborted||_l.has(e.state)||(e.task=this.#n(e,i))},onFailure:i=>{e.controller.signal.aborted||_l.has(e.state)||(e.state="failed",e.error=Ln("qr-connect-failed",w("QQ \u626B\u7801\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002")),this.#s===e.id&&(this.#s=null),this.#m(),o(i))}},{signal:e.controller.signal}),await a,gw(e)}catch(i){throw e.controller.signal.aborted?(e.state="cancelled",e.error=Ln("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))):_l.has(e.state)||(e.state="failed",e.error=Ln("qr-start-failed",w("\u65E0\u6CD5\u751F\u6210 QQ \u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),this.#s===e.id&&(this.#s=null),this.#m(),i}}registrationStatus(t){return gw(this.#a.get(t))}async bindCredentials({appId:t,appSecret:o}={}){if(this.#l)throw new Error("QQ controller is closed");let a=Tl(t),e=Tl(o);if(!a||!e)throw new TypeError("QQ AppID and AppSecret are required");if(this.#s&&await this.cancelProvisioning(this.#s),this.#l)throw new Error("QQ controller is closed");let i=nw(a);return await this.#f(i.botId,async()=>{if(this.#l)throw new Error("QQ controller is closed");let A=this.#t.getByAppId(a),r=await this.#A.resolve(i.secretRef).catch(()=>{});if(this.#l)throw new Error("QQ controller is closed");let s={botId:i.botId,appId:a,secretRef:i.secretRef,ownerUserOpenid:A?.ownerUserOpenid??"*",createdAt:A?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};await this.#A.set(i.secretRef,e);try{await this.#t.save(s)}catch(g){throw await this.#B(i.secretRef,r),g}try{await this.#d(s,e),this.#i.delete(i.botId)}catch(g){this.#i.set(i.botId,Ln("connection-failed",w("QQ \u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:qq] bot ${i.botId} credential connection failed:`,g)}this.#m()}),this.status()}async cancelProvisioning(t){let o=this.#a.get(t);return o?(_l.has(o.state)||(o.controller.abort(),o.dispose?.(),await o.task?.catch(()=>{}),_l.has(o.state)||(o.state="cancelled"),o.error??=Ln("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))),this.#s===o.id&&(this.#s=null),this.#m(),gw(o)):null}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown QQ bot");return await this.#f(t,async()=>{let a=await this.#u(o.secretRef);if(!a)throw new Error("QQ bot secret is missing");try{await this.#d(o,a),this.#i.delete(t)}catch(e){throw this.#i.set(t,Ln("connection-failed",w("QQ \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#m()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown QQ bot");return this.#f(t,async()=>{let a=this.#c.get(t);if(!a?.status?.ready||typeof a.sendConnectionTest!="function"){let e=new Error(w("QQ\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw e.code="test-target-unavailable",e}return await a.sendConnectionTest(Ui(w("QQ \u673A\u5668\u4EBA\uFF08{appId}\uFF09",{appId:yG(o.appId)}))),{sent:!0}})}async sendProactiveText(t,o,a,e={}){if(!this.#t.get(t))throw new Error("Unknown QQ bot");return this.#f(t,async()=>{let A=this.#c.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("QQ\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,a,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown QQ bot");return await this.#f(t,async()=>{let a=await this.#A.resolve(o.secretRef).catch(()=>{});await this.#C(t);try{await this.#A.unset(o.secretRef),await this.#t.remove(t)}catch(e){throw a?.value&&(await this.#A.set(o.secretRef,a.value).catch(()=>{}),await this.#d(o,a.value).catch(()=>{})),new Error("Unable to remove the QQ bot safely.",{cause:e})}await this.#I({botId:t,config:o}).catch(e=>{this.#o.warn?.(`[dsh-im:qq] bot ${t} state cleanup failed:`,e)}),this.#i.delete(t),this.#m()}),this.status()}status(){let t=this.#t.list().map(e=>{let i=this.#c.get(e.botId)?.status??null,A=i?.ready===!0&&i.qqConnectionState==="connected"&&i.harnessReachable===!0,r=A?"connected":i?.qqConnectionState==="connecting"?"connecting":this.#i.has(e.botId)||i?.qqConnectionState==="failed"?"error":"offline";return{botId:e.botId,state:r,connected:A,configured:!0,bot:{name:w("QQ\u673A\u5668\u4EBA"),appIdMasked:yG(e.appId)},health:{status:A?"healthy":r==="error"?"error":"offline",summary:A?w("QQ WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38"):r==="error"?w("QQ \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5"):w("QQ \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:i?.lastCheckedAt??null,lastConnectedAt:i?.lastConnectedAt??null},stats:{messagesReceived:i?.messagesReceived??0,messagesReplied:i?.messagesReplied??0},lastMessageError:ti(i?.lastMessageError),error:structuredClone(this.#i.get(e.botId)??null)}}),o=t.filter(e=>e.connected).length,a=this.#s?this.#a.get(this.#s):null;return{schemaVersion:1,revision:this.#g,state:a&&TZ.has(a.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...a&&TZ.has(a.state)?{provisioning:gw(a)}:{}}}async close(){this.#l||(this.#l=!0,this.#s&&await this.cancelProvisioning(this.#s),await Promise.allSettled([...this.#p.values()]),await Promise.allSettled([...this.#c.keys()].map(t=>this.#C(t))))}async#n(t,o){try{t.state="connecting",t.verificationUrl=null,t.expiresAt=null,this.#m();let a=Array.isArray(o)?o[0]:null,e=Tl(a?.appId),i=Tl(a?.appSecret),A=Tl(a?.userOpenid);if(!e||!i||!A)throw new Error("QQ authorization returned incomplete credentials");t.botId=await this.#h(t,{appId:e,appSecret:i,ownerUserOpenid:A}),t.state="connected",t.error=null}catch(a){t.controller.signal.aborted?(t.state="cancelled",t.error=Ln("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))):(t.state="failed",t.error=Ln("activation-failed",w("QQ \u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002")),this.#o.error?.("[dsh-im:qq] provisioning failed:",a))}finally{t.dispose?.(),this.#s===t.id&&(this.#s=null),this.#m()}}async#h(t,{appId:o,appSecret:a,ownerUserOpenid:e}){let i=nw(o),A=this.#t.getByAppId(o),r=await this.#A.resolve(i.secretRef).catch(()=>{}),s={botId:i.botId,appId:o,secretRef:i.secretRef,ownerUserOpenid:e,createdAt:A?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};return this.#f(i.botId,async()=>{await this.#A.set(i.secretRef,a);try{if(t.controller.signal.aborted)throw new DOMException("Cancelled","AbortError");await this.#t.save(s)}catch(g){throw await this.#B(i.secretRef,r),g}try{if(t.controller.signal.aborted)throw new DOMException("Cancelled","AbortError");await this.#d(s,a),this.#i.delete(i.botId)}catch(g){if(t.controller.signal.aborted)throw await this.#C(i.botId),A?await this.#t.save(A).catch(()=>{}):await this.#t.remove(i.botId).catch(()=>null)&&await this.#I({botId:i.botId,config:s}).catch(I=>{this.#o.warn?.("[dsh-im:qq] cancelled bot state cleanup failed:",I)}),await this.#B(i.secretRef,r),g;this.#i.set(i.botId,Ln("connection-failed",w("QQ \u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:qq] bot ${i.botId} activation connection failed:`,g)}return this.#m(),i.botId})}async#d(t,o){if(this.#l)throw new Error("QQ controller is closed");if(await this.#C(t.botId),this.#l)throw new Error("QQ controller is closed");let a=await this.#r({botId:t.botId,config:t,appSecret:o});if(!a||typeof a.start!="function"||typeof a.stop!="function")throw new TypeError("createRuntime returned an invalid QQ runtime");this.#c.set(t.botId,a);try{await a.start()}catch(e){throw await a.stop().catch(()=>{}),this.#c.delete(t.botId),e}}async#C(t){let o=this.#c.get(t);this.#c.delete(t),await o?.stop().catch(a=>{this.#o.warn?.(`[dsh-im:qq] bot ${t} failed to stop cleanly:`,a)})}async#u(t){let o=await this.#A.resolve(t).catch(()=>{});return Tl(o?.value)}async#B(t,o){o?.value?await this.#A.set(t,o.value).catch(()=>{}):await this.#A.unset(t).catch(()=>{})}#f(t,o){let i=(this.#p.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#p.get(t)===i&&this.#p.delete(t)});return this.#p.set(t,i),i}#m(){this.#g+=1}};import{QQBot as VFe,contentSanitizer as WFe,typingIndicator as ZFe}from"@tencent-connect/qqbot-nodejs";import{ApiError as mFe}from"@tencent-connect/qqbot-nodejs";var NZ=4500,SFe=/^( {0,3})(`{3,}|~{3,})(.*)$/,wFe=new Set([40034090]),DFe=Object.freeze({c2c:4,group:5}),OFe=()=>w("\u56DE\u7B54\u8F83\u957F\uFF0C\u540E\u7EED\u5185\u5BB9\u672A\u80FD\u901A\u8FC7 QQ \u5B8C\u6574\u53D1\u9001\uFF0C\u8BF7\u56DE\u590D\u201C\u7EE7\u7EED\u201D\u3002");function SG(n,t){let o=Math.min(t,n.length),a=n.charCodeAt(o-1),e=n.charCodeAt(o);return a>=55296&&a<=56319&&e>=56320&&e<=57343&&(o-=1),Math.max(1,o)}function vZ(n){let t=n.endsWith("\r")?n.slice(0,-1):n,o=SFe.exec(t);return!o||o[2][0]==="`"&&o[3].includes("`")?null:{delimiter:o[2],info:o[3],indent:o[1].length}}function bFe(n,t){let o=/^ {0,3}(`{3,}|~{3,})[ \t]*$/.exec(n);return!!(o&&o[1][0]===t.delimiter[0]&&o[1].length>=t.delimiter.length)}function RZ(n,t){let o=0;for(let a of n.split(` `)){let e=0;for(;e<3&&a[e]===" ";)e+=1;let i=0;for(;a[e+i]===t;)i+=1;o=Math.max(o,i)}return o}function MFe(n,t){let o="`".repeat(Math.max(3,RZ(n,"`")+1)),a="~".repeat(Math.max(3,RZ(n,"~")+1));return t.includes("`")?a:o.length<=a.length?o:a}function _Fe(n,t){let o=0,a=0,e=t;for(;e>0&&o_Fe(o,t))}function mG(n,t){if(n.length<=t)return[n];let o=[],a=n;for(;a.length>t;){let e=SG(a,t),i=a.lastIndexOf(` `,e-1);i>=0&&(e=i+1),o.push(a.slice(0,e)),a=a.slice(e)}return(a||o.length===0)&&o.push(a),o}function wG(n,t,o){if(o<8)return mG(n,o).map(A=>({markdown:A,plain:A}));let a=MFe(n,t),e=`${a}${t}`;e.length+a.length+2>=o&&(e=a);let i=o-e.length-a.length-2;return i<1?mG(n,o).map(A=>({markdown:A,plain:A})):mG(n,i).map(A=>({markdown:`${e} @@ -411,14 +411,14 @@ ${q.join(` ${_}`:U),await g()}catch(U){this.#i.error?.("[dsh-im:qq] failed to send the safe error reply:",U)}}}async#k(t,o,a,e){this.#s?.throwIfAborted();let i=this.#n.get(a),A=e.claimedReplyMessageId===o;if(!i||i!==e||i.submitting)return A&&(!i||i!==e)?this.#T(t,o):this.#m(t,o,a,{releaseMessageId:!1});if(this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#c.messagesReceived+=1,this.#c.lastMessageAt=new Date().toISOString(),t.kind==="group"&&t.rawEventType!=="GROUP_AT_MESSAGE_CREATE"))return;let r=Ti(AB(t));if(!r||ch(t)||Nl(t)){await this.#e.sendText(t.replyTarget,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"));return}let s=this.#n.get(a);if(!s||s!==e||s.submitting){if(A&&(!s||s!==e)){await this.#e.sendText(t.replyTarget,cw());return}return this.#m(t,o,a,{releaseMessageId:!1,alreadyRecorded:!0})}if(s.target=t.replyTarget,s.needsPresentation){try{await this.#S(s)}catch{this.#c.lastError=w("QQ \u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#i.error?.("[dsh-im:qq] failed to retry an interaction question"),s.interaction.reconnect?.();return}let c=this.#n.get(a);if(!c||c!==e||c.submitting){if(A&&(!c||c!==e)){await this.#e.sendText(t.replyTarget,cw()).catch(()=>{});return}return this.#m(t,o,a,{releaseMessageId:!1,alreadyRecorded:!0})}}let g=s.questions[s.index];if(g){if(s.answers.push(Ma(g,r)),s.index+=1,s.index{});return}if(this.#n.get(a)!==s)return;s.submitting=!1,s.answers.pop(),s.index-=1,this.#c.lastError=w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002"),this.#i.error?.("[dsh-im:qq] failed to answer a Harness interaction"),await this.#e.sendText(s.target,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002")).catch(()=>{})}}}async#M(t,{key:o,actor:a,target:e,requiresMention:i}){if(t?.kind==="approval")return this.#B.handleRequested(t,{key:o,actor:a,requiresMention:i,send:c=>this.#e.sendText(e,c)});if(t?.kind!=="question")return;let A=t?.payload?.questions,r=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t?.rpcId!="string"||typeof r!="string"||typeof t.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!ba(c))){this.#i.warn?.("[dsh-im:qq] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"QQ safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#e.sendText(e,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002")).catch(()=>{});return}let s=this.#n.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#S(s);return}if(this.#h.has(r))return;if(s){await t.respond({ok:!1,error:{code:"cancelled",message:"QQ is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:a,requiresMention:i,questions:A,answers:[],index:0,target:e,queue:null,claimedReplyMessageId:null,presentationPromise:null,submitting:!1,needsPresentation:!0};this.#n.set(o,g),this.#h.set(r,o),await this.#S(g)}async#D(t){if(t?.kind==="approval"){await this.#B.handleResolved(t);return}let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let a=this.#h.get(o);a&&this.#P(a,o)}#S(t){if(!t.needsPresentation)return Promise.resolve();if(t.presentationPromise)return t.presentationPromise;let o=t.questions[t.index];if(!o)return Promise.resolve();let a=this.#e.sendText(t.target,Ia(o,t.index,t.questions.length,{requiresMention:t.requiresMention})).then(()=>{t.needsPresentation=!1}).finally(()=>{t.presentationPromise===a&&(t.presentationPromise=null)});return t.presentationPromise=a,a}async#T(t,o){this.#r.hasSeen(o)||(await this.#r.markSeen(o),this.#c.messagesReceived+=1,this.#c.lastMessageAt=new Date().toISOString(),await this.#e.sendText(t.replyTarget,cw()).catch(()=>{}))}#N(t,o){let a=this.#n.get(t);return!a||o!==void 0&&a.interactionId!==o?null:(this.#n.delete(t),this.#h.delete(a.interactionId),a)}#P(t,o){return this.#N(t,o)!==null}async#_(t){let o=this.#N(t);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The QQ interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(a){a?.code!=="interaction-not-pending"&&this.#i.warn?.("[dsh-im:qq] failed to cancel a pending Harness interaction")}}async#G(t,o,a){if(this.#s?.aborted)return;this.#c.lastError=a?.message??String(a);let e=rt(this.#c,a);this.#i.error?.(`[dsh-im:qq] failed to process an interaction reply [${e.referenceId}]:`,a),this.#r.hasSeen(o)||await this.#r.markSeen(o).catch(()=>{}),await this.#e.sendText(t.replyTarget,ut(e)).catch(()=>{})}};function XFe(){let n=new Error("QQ WebSocket did not become ready in time");return n.code="connect-timeout",n}function $Fe(){return{startedAt:null,ready:!1,qqConnectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,..._G()}}var tB=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g=$Fe();#l=null;#n=null;#h=null;#d=null;#C=null;constructor({config:t,appSecret:o,harness:a,state:e,contextEnhancement:i,accessPolicy:A,logger:r=console,replyTimeoutMs:s=6e5,connectTimeoutMs:g=2e4,createBot:c=p=>new VFe(p),typingMiddleware:I=ZFe}){if(!t||!o||!a||!e)throw new TypeError("QqRuntime requires config, app secret, Harness, and state");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g,this.#s=c,this.#p=I}get status(){return structuredClone(this.#g)}async sendConnectionTest(t){if(!this.#g.ready||!this.#l)throw Qr(w("QQ\u673A\u5668\u4EBA"));let o=typeof this.#e.ownerUserOpenid=="string"?this.#e.ownerUserOpenid.trim():"",a=ZE(this.#r),e=a?.scope==="c2c"&&typeof a.targetId=="string"?a.targetId.trim():"",i=e?{scope:"c2c",targetId:e}:o&&o!=="*"?{scope:"c2c",targetId:o}:null;if(!i)throw Qr(w("QQ\u673A\u5668\u4EBA"));return await this.#l.sendText(i,t),{sent:!0}}async sendProactiveText(t,o,{signal:a}={}){let e=t?.kind==="user"?typeof t?.route?.userOpenId=="string"?t.route.userOpenId.trim():"":t?.kind==="group"&&typeof t?.route?.groupOpenId=="string"?t.route.groupOpenId.trim():"";if(!e){let i=new TypeError("Invalid QQ proactive delivery target");throw i.code="invalid-target",i}if(!this.#g.ready||!this.#l){let i=new Error("QQ bot is not connected");throw i.code="bot-not-connected",i}return a?.throwIfAborted(),this.#l.sendText({scope:t.kind==="user"?"c2c":"group",targetId:e},o)}async start(){return this.#g.ready&&this.#l?this.status:this.#C?this.#C:(this.#C=this.#u().finally(()=>{this.#C=null}),this.#C)}async#u(){await this.stop(),this.#g.startedAt=new Date().toISOString(),this.#g.qqConnectionState="connecting",this.#g.lastError=null,await this.#t.ensureRunning(),this.#g.harnessReachable=!0;let t={error:(...p)=>this.#c.error?.(...p),warn:(...p)=>this.#c.warn?.(...p),info:(...p)=>this.#c.info?.(...p),debug:()=>{}},o=this.#s({appId:this.#e.appId,appSecret:this.#A,accountId:this.#e.botId,logger:t,transport:"websocket",tokenPrefetch:"sync",markdownSupport:!1});if(!o||typeof o.start!="function"||typeof o.stop!="function")throw new TypeError("QQ bot factory returned an invalid client");let a=new AbortController;this.#h=a,this.#l=o,this.#n=new lw({bot:o,ownerUserOpenid:this.#e.ownerUserOpenid,harness:this.#t,state:this.#r,contextEnhancement:this.#I,accessPolicy:this.#o,status:this.#g,logger:this.#c,replyTimeoutMs:this.#i,signal:a.signal}),o.use(WFe({parseFaceTags:!0})),o.use?.(this.#p({keepAlive:!0,predicate:p=>{let B=p?.message;return!B||B.kind==="group"&&B.rawEventType!=="GROUP_AT_MESSAGE_CREATE"?!1:this.#o?Mi(this.#o,{conversationType:B.kind==="c2c"?"direct":"group",senderIds:B.senderId,text:typeof B.content=="string"?B.content.trim():""}).allowed:B.kind==="group"||this.#e.ownerUserOpenid==="*"||B.senderId===this.#e.ownerUserOpenid}}));let e,i,A=new Promise((p,B)=>{e=p,i=B}),r=()=>{let p=Date.now();this.#g.ready=!0,this.#g.qqConnectionState="connected",this.#g.lastCheckedAt=p,this.#g.lastConnectedAt=p,this.#g.lastError=null,e()},s=p=>{this.#g.ready?(this.#g.lastError=p?.message??String(p),this.#c.warn?.(`[dsh-im:qq] bot ${this.#e.botId} connection error:`,p)):i(p)},g=(p,B)=>{let f=this.#n?.accept(B);f&&f.catch(Q=>{a.signal.aborted||this.#c.error?.(`[dsh-im:qq] bot ${this.#e.botId} message handling failed:`,Q)})};o.on("ready",r),o.on("resumed",r),o.on("error",s),o.on("message",g);let c=Promise.resolve().then(()=>o.start(a.signal));this.#d=c,c.catch(p=>{a.signal.aborted||(i(p),this.#g.ready=!1,this.#g.qqConnectionState="failed",this.#g.lastError=p?.message??String(p),this.#c.error?.(`[dsh-im:qq] bot ${this.#e.botId} connection stopped:`,p))});let I;try{return await Promise.race([A,new Promise((p,B)=>{I=setTimeout(()=>B(XFe()),this.#a)})]),this.#g.ready=!0,this.#g.qqConnectionState="connected",this.#g.lastCheckedAt=Date.now(),this.#g.lastConnectedAt=Date.now(),this.status}catch(p){throw this.#g.ready=!1,this.#g.qqConnectionState="failed",this.#g.lastError=p?.message??String(p),await this.stop(),p}finally{clearTimeout(I)}}async stop(){let t=this.#l,o=this.#n,a=this.#d;this.#h?.abort(),this.#h=null,this.#l=null,this.#n=null,this.#d=null;try{t?.stop()}catch(e){this.#c.warn?.(`[dsh-im:qq] bot ${this.#e.botId} failed to stop cleanly:`,e)}return await Promise.race([a?.catch(()=>{})??Promise.resolve(),new Promise(e=>setTimeout(e,2e3))]),await o?.waitForIdle(),this.#g.ready=!1,this.#g.qqConnectionState="idle",this.status}};import{startQrConnect as eLe}from"@tencent-connect/qqbot-connector";var pw=class{#e;#A;constructor({start:t=eLe,source:o="deepseek-harness"}={}){if(typeof t!="function")throw new TypeError("QQ QR connector is required");this.#e=t,this.#A=o}start(t,{signal:o}={}){if(!t||typeof t.onSuccess!="function"||typeof t.onFailure!="function")throw new TypeError("QQ QR callbacks are required");return this.#e(t,{displayQrCodeToConsole:!1,source:this.#A,signal:o})}};import{mkdir as ALe,readFile as tLe,rename as rLe,unlink as iLe,writeFile as aLe}from"node:fs/promises";import{dirname as oLe}from"node:path";var dw=Object.freeze({version:1,sessions:{},seenMessageIds:[]});function nLe(n){if(!n||typeof n!="object")return structuredClone(dw);let t={};if(n.sessions&&typeof n.sessions=="object"&&!Array.isArray(n.sessions))for(let[o,a]of Object.entries(n.sessions))typeof o=="string"&&typeof a=="string"&&a&&(t[o]=a);return{version:1,sessions:t,seenMessageIds:Array.isArray(n.seenMessageIds)?n.seenMessageIds.filter(o=>typeof o=="string").slice(-1e3):[]}}var hw=class{#e;#A=structuredClone(dw);#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{this.#A=nLe(JSON.parse(await tLe(this.#e,"utf8")))}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=structuredClone(dw),await this.#r()}return this}sessionFor(t){return this.#A.sessions[t]??null}async setSession(t,o){this.#A.sessions[t]=o,await this.#r()}async clearSession(t){delete this.#A.sessions[t],await this.#r()}async clearSessions(){this.#A.sessions={},await this.#r()}hasSeen(t){return this.#A.seenMessageIds.includes(t)}async markSeen(t){this.hasSeen(t)||(this.#A.seenMessageIds.push(t),this.#A.seenMessageIds.length>1e3&&this.#A.seenMessageIds.splice(0,this.#A.seenMessageIds.length-1e3),await this.#r())}snapshot(){return structuredClone(this.#A)}async remove(){try{await iLe(this.#e)}catch(t){if(t?.code!=="ENOENT")throw t}this.#A=structuredClone(dw)}async#r(){let t=`${JSON.stringify(this.#A,null,2)} `,o=this.#t.then(async()=>{await ALe(oLe(this.#e),{recursive:!0,mode:448});let a=`${this.#e}.tmp`;await aLe(a,t,{encoding:"utf8",mode:384}),await rLe(a,this.#e)});this.#t=o.then(()=>{},()=>{}),await o}};var xZ=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function sLe(n){if(!Array.isArray(n)||n.length===0)return[...xZ];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...xZ]}var Ew=class{#e;#A;#t;#r;#I;#o;#c;#i=null;#a=null;#s=0;#p=!1;#g=!1;#l;#n;constructor({controller:t,harness:o,logger:a=console,retryDelaysMs:e,healthyIntervalMs:i=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=a,this.#r=sLe(e),this.#I=Number.isFinite(i)&&i>=0?i:15e3,this.#o=A,this.#c=r,this.#l=new Promise(s=>{this.#n=s})}get ready(){return this.#l}start(){return this.#g||this.#p?this:(this.#g=!0,this.#h(0),this)}async close(){this.#p||(this.#p=!0,this.#i!==null&&this.#c(this.#i),this.#i=null,await this.#a?.catch(()=>{}),this.#n?.(null),this.#n=null)}#h(t){this.#p||(this.#i=this.#o(()=>{this.#i=null,this.#d()},t),this.#i?.unref?.())}async#d(){if(this.#p||this.#a)return;let t=this.#C();this.#a=t;try{await t}finally{this.#a===t&&(this.#a=null)}}async#C(){try{if(await this.#A.ensureRunning(),this.#p)return;let t=await this.#e.initialize();if(this.#p)return;this.#n?.(t),this.#n=null;let{configured:o,connected:a}=t.totals;if(axi(n),B=ILe(t),f=await new e(B.config).load(),Q=Rl(t.workspace??process.cwd()),y=o.WorkspaceStore??ni,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(J=>J.botId)),await Promise.all(T.map(J=>m.ensure(J.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("qq",J)})));let _=typeof f.remove=="function"?Yi(f,{workspaces:m}):f,R=o.qrAuth??new g({source:t.qrSource??"deepseek-harness"}),L=new Map,U=J=>Rl(B.bots,J,"state.json"),F=async J=>{let X=L.get(J);return X||(X=await new i(U(J)).load(),L.set(J,X)),X},q=zi(n,o.commandExecutor),{controlExecutor:z,sessionMaintenanceExecutor:K,fileIngressExecutor:G}=Vi(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),V=new A({...a,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...q?{commandExecutor:q}:{},...z?{controlExecutor:z}:{},...K?{sessionMaintenanceExecutor:K}:{},...G?{fileIngressExecutor:G}:{}}),H=new r({qrAuth:R,credentials:n.credentials,configStore:_,logger:I,createRuntime:async({botId:J,config:X,appSecret:ie})=>{let De=await F(J);await m.ensure(J,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("qq",X)});let oe=ji(V,{botId:J,workspaces:m,state:De,agentPresetCatalog:p});return new s({config:X,appSecret:ie,harness:oe.harness,state:oe.state,contextEnhancement:{botId:J,getSettings:()=>m.contextEnhancementFor(J)},accessPolicy:Wi(m,J,{channel:"qq",config:X}),groupSessionScope:{getScope:()=>m.groupSessionScopeFor(J)},replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??2e4,logger:{error:(...Se)=>I.error?.(`[${J}]`,...Se),warn:(...Se)=>I.warn?.(`[${J}]`,...Se),info:(...Se)=>I.info?.(`[${J}]`,...Se),debug:(...Se)=>I.debug?.(`[${J}]`,...Se)}})},deleteState:async({botId:J})=>{let X=L.get(J);if(L.delete(J),X&&typeof X.remove=="function")await X.remove();else try{await gLe(U(J))}catch(ie){if(ie?.code!=="ENOENT")throw ie}}}),N=Ji(H,{workspaces:m,stateFor:F,agentPresetCatalog:p}),k=c({controller:N,harness:V,logger:I,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:N,deliveryAdapter:qi({channel:"qq",workspaces:m,coreController:H,stateFor:F}),ready:k.ready,async close(){await k.close(),await N.close(),V.stopManagedProcess()}}}import lLe from"qrcode";var jZ="/qq",zt=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:La,setAgentPreset:Ua,setContextEnhancement:Fa,setAccessPolicy:Xi,setGroupSessionScope:ea}),JZ=Object.freeze(Object.values(zt)),pLe=new Set(["appSecret","app_secret","secretRef","ownerUserOpenid","userOpenid","verificationUrl"]);function vG(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function Ih(n,t){return vG(n)&&Object.keys(n).every(o=>t.includes(o))}function RG(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function YZ(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function dLe(n,t){return vG(t)?n===zt.status?Ih(t,[])?null:"connection.status does not accept fields.":n===zt.beginProvisioning?Ih(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[zt.pollProvisioning,zt.cancelProvisioning].includes(n)?Ih(t,["attemptId"])&&RG(t.attemptId)?null:`${n} requires an attemptId.`:n===zt.bindCredentials?Ih(t,["appId","appSecret"])&&YZ(t.appId,256)&&YZ(t.appSecret,1024)?null:"bot.bind-credentials requires AppID and AppSecret.":n===zt.reconnectBot?Ih(t,["botId","sendTest"])&&RG(t.botId)&&(t.sendTest===void 0||t.sendTest===!0)?null:"bot.reconnect requires a botId and accepts only sendTest=true.":n===zt.deleteBot?Ih(t,["botId","confirm"])&&RG(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===zt.setWorkspace?ta(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===zt.setAgentPreset?ia(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===zt.setContextEnhancement?Zi(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===zt.setAccessPolicy?$i(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===zt.setGroupSessionScope?Aa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u7FA4\u4F1A\u8BDD\u7B56\u7565\u3002":"Unknown QQ endpoint.":"Payload must be an object."}function lh(n){if(Array.isArray(n))return n.map(lh);if(!vG(n))return n;let t={};for(let[o,a]of Object.entries(n))pLe.has(o)||(t[o]=lh(a));return t}async function hLe(n){return lLe.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function kG(n,t){return!n||typeof n.verificationUrl!="string"?lh(n):lh({...n,qrCodeDataUrl:await t(n.verificationUrl)})}async function Lg(n,t){let o=structuredClone(n);return o?.provisioning&&(o.provisioning=await kG(o.provisioning,t)),lh(o)}function qZ(n,{encodeQr:t=hLe}={}){for(let e of["status","startProvisioning","registrationStatus","cancelProvisioning","bindCredentials","reconnectBot","deleteBot"])if(typeof n?.[e]!="function")throw new TypeError(`A complete QQ controller is required (${e})`);let o=new Map,a=e=>{let i=o.get(e);return i||(o.size>=16&&o.delete(o.keys().next().value),i=Promise.resolve().then(()=>t(e)),o.set(e,i)),i};return async(e,i,A)=>{if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!JZ.includes(e))return{ok:!1,error:{code:"bad-request",message:"Unknown QQ endpoint."}};let r=dLe(e,i);if(r)return{ok:!1,error:{code:"bad-request",message:r}};try{let s;if(e===zt.status)s=await Lg(await n.status(),a);else if(e===zt.beginProvisioning)s=await kG(await n.startProvisioning(),a);else if(e===zt.pollProvisioning){let g=await n.registrationStatus(i.attemptId);if(!g)return{ok:!1,error:{code:"bad-request",message:"The provisioning attempt no longer exists."}};s=await kG(g,a)}else if(e===zt.cancelProvisioning)s=lh(await n.cancelProvisioning(i.attemptId));else if(e===zt.bindCredentials)s=await Lg(await n.bindCredentials(i),a);else if(e===zt.reconnectBot){let g=await n.reconnectBot(i.botId);if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};let c;if(i.sendTest===!0)if(!(g?.bots?.some(p=>p?.botId===i.botId&&p?.connected===!0)===!0)||typeof n.sendConnectionTest!="function")c=lr(Qr("QQ\u673A\u5668\u4EBA"));else{let p=null;try{await n.sendConnectionTest(i.botId)}catch(B){p=B}c=lr(p)}s=await Lg({...g,...c?{testMessage:c}:{}},a)}else if(e===zt.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await Lg(await n.updateWorkspace(i.botId,i.workspace),a)}else if(e===zt.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(i.botId,i.config,g=>Lg(g,a))}else if(e===zt.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(i.botId,i.policy,g=>Lg(g,a))}else if(e===zt.setGroupSessionScope){if(typeof n.updateGroupSessionScope!="function")throw new Error("Group session scope update is unavailable");s=await n.updateGroupSessionScope(i.botId,i.groupSessionScope,g=>Lg(g,a))}else if(e===zt.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await Lg(await n.updateAgentPreset(i.botId,i.agentPreset),a)}else s=await Lg(await n.deleteBot(i.botId),a);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:s}}catch(s){let g=ra(s);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:g??{code:"qq-operation-failed",message:"QQ \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}}}function uw(n,t,o,a){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(jZ,qZ(t,o),{authority:mr(a)})}async function zZ(n,t={}){if(t?.controller)return uw(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await NG(n,t,t.internals),a=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=uw(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await a?.(),await o.close()},"dsh-im: close QQ bot connections"),e}import{unlink as XLe}from"node:fs/promises";import{resolve as n9}from"node:path";import{createHash as ELe}from"node:crypto";import{mkdir as uLe,readFile as CLe,rename as BLe,unlink as fLe,writeFile as QLe}from"node:fs/promises";import{dirname as yLe}from"node:path";var PG=Object.freeze({version:1,bots:Object.freeze([])}),VZ=/^slack_[a-f0-9]{24}$/,mLe=/^DSH_SLACK_BOT_TOKEN_[A-F0-9]{24}$/,SLe=/^DSH_SLACK_APP_TOKEN_[A-F0-9]{24}$/;function Zo(n){return typeof n=="string"&&n.trim()?n.trim():null}function GG(n){let t=Zo(n);if(!t)throw new TypeError("platformId is required");let o=ELe("sha256").update(t).digest("hex").slice(0,24),a=o.toUpperCase();return{botId:`slack_${o}`,botTokenRef:`DSH_SLACK_BOT_TOKEN_${a}`,appTokenRef:`DSH_SLACK_APP_TOKEN_${a}`}}function FG(n){let t=Zo(n)??"",[o,a]=t.split(":");return o&&a?`${o.slice(0,5)}\u2022\u2022\u2022 \xB7 ${a.slice(0,5)}\u2022\u2022\u2022`:t?`${t.slice(0,6)}\u2022\u2022\u2022\u2022`:w("Slack\u673A\u5668\u4EBA")}var Cw=class{#e;#A=PG;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=this.#I(JSON.parse(await CLe(this.#e,"utf8")));if(!t)throw new Error("dsh-im Slack config contains invalid bot data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=PG}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(a=>a.botId===t);return o?structuredClone(o):null}getByPlatformId(t){let o=this.#A.bots.find(a=>a.platformId===t);return o?structuredClone(o):null}async save(t){let o=this.#r(t);if(!o)throw new Error("Refusing to persist incomplete Slack bot data");return this.#o(a=>{if(a.find(A=>A.botId!==o.botId&&(A.platformId===o.platformId||A.botTokenRef===o.botTokenRef||A.appTokenRef===o.appTokenRef)))throw new Error("Duplicate Slack bot identity");let i=a.findIndex(A=>A.botId===o.botId);return i===-1?a.push(o):a[i]=o,structuredClone(o)})}async remove(t){if(!VZ.test(t))throw new TypeError("Invalid Slack bot id");return this.#o(o=>{let a=o.findIndex(e=>e.botId===t);return a===-1?null:structuredClone(o.splice(a,1)[0])})}async clear(){let t=this.#t.then(async()=>{try{await fLe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=PG});this.#t=t.then(()=>{},()=>{}),await t}#r(t){if(!t||typeof t!="object")return null;let o=Zo(t.botId),a=Zo(t.platformId),e=Zo(t.botTokenRef),i=Zo(t.appTokenRef),A=Zo(t.name);if(!o||!a||!e||!i||!A||!VZ.test(o)||!mLe.test(e)||!SLe.test(i))return null;let r=GG(a);return r.botId!==o||r.botTokenRef!==e||r.appTokenRef!==i?null:Object.freeze({botId:o,platformId:a,botTokenRef:e,appTokenRef:i,name:A,username:Zo(t.username),teamId:Zo(t.teamId),teamName:Zo(t.teamName),createdAt:Zo(t.createdAt)??new Date().toISOString(),connectedAt:Zo(t.connectedAt)})}#I(t){if(!t||t.version!==1||!Array.isArray(t.bots))return null;let o=t.bots.map(A=>this.#r(A));if(o.some(A=>A===null))return null;let a=new Set,e=new Set,i=new Set;for(let A of o){if(a.has(A.botId)||e.has(A.platformId)||i.has(A.botTokenRef)||i.has(A.appTokenRef))return null;a.add(A.botId),e.add(A.platformId),i.add(A.botTokenRef),i.add(A.appTokenRef)}return Object.freeze({version:1,bots:Object.freeze(o)})}async#o(t){let o,a=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let i=Object.freeze({version:1,bots:Object.freeze(e)});await uLe(yLe(this.#e),{recursive:!0,mode:448});let A=`${this.#e}.tmp`;await QLe(A,`${JSON.stringify(i,null,2)} -`,{encoding:"utf8",mode:384}),await BLe(A,this.#e),this.#A=i});return this.#t=a.then(()=>{},()=>{}),await a,o}};var wLe="https://slack.com/api/",oB="files.slack.com",DLe="slack.com",WZ="/files-pri/",OLe=Object.freeze([oB]),bLe="/upload/",MLe=12e4;function Ns(n){return typeof n=="string"&&n.trim()?n.trim():null}function ZZ(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}function iB(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function _Le(n,t){if(!Number.isInteger(n)||n<1)throw new TypeError(`${t} must be a positive integer`);return n}function XZ(n,t){return t?.providerCode!==void 0&&(n.providerCode=t.providerCode),Number.isInteger(t?.status)&&(n.status=t.status),n}function kl(n){let t="artifact-provider-failed",o="Slack file upload preparation failed";n?.code==="slack-file_upload_size_restricted"?(t="artifact-too-large",o="Slack rejected the result file because it is too large"):n?.code==="slack-missing-scope"?(t="artifact-permission-required",o="Slack file delivery requires the files:write scope"):n?.code?.startsWith?.("slack-")&&(t="artifact-provider-rejected",o="Slack rejected file upload preparation");let a=new Error(o,{cause:n});return a.code=t,XZ(a,n)}function TLe(n){let t=new Error("Slack file completion result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",XZ(t,n)}function NLe(n){return Number.isInteger(n)&&n>=300&&n<400}async function LG(n){try{await n?.body?.cancel?.()}catch{}}function RLe(n){let t=new URL(n);if(t.protocol!=="https:")throw new Error("Image download URL must use HTTPS");if(t.username||t.password||t.port&&t.port!=="443")throw new Error("Image download URL is not hosted by the messaging platform");if(t.hostname===DLe&&t.pathname.startsWith(WZ)&&(t.hostname=oB),t.hostname!==oB||!t.pathname.startsWith(WZ))throw new Error("Image download URL is not hosted by the messaging platform");return t.hash="",t}function kLe(n){let t=new URL(n);if(t.protocol!=="https:"||t.username||t.password||t.port&&t.port!=="443"||t.hostname!==oB||!t.pathname.startsWith(bLe))throw new Error("Slack returned an unsafe file upload URL");return t.hash="",t}function vLe(n,t){let o=n?.headers?.get?.("location");if(!o)return null;try{return new URL(o,t)}catch{return null}}function PLe(n){let t=n?.headers?.get?.("x-oauth-scopes");return t==null?null:new Set(t.split(",").map(o=>o.trim()).filter(Boolean))}function GLe(n){return n?.protocol==="https:"&&!n.username&&!n.password&&(!n.port||n.port==="443")&&n.hostname.endsWith(".slack.com")&&n.hostname!==oB&&n.pathname==="/"&&n.searchParams.has("redir")}function FLe(n,t){return new Promise((o,a)=>{if(t?.aborted){a(t.reason??new DOMException("Aborted","AbortError"));return}let e=setTimeout(o,n);e?.unref?.(),t?.addEventListener("abort",()=>{clearTimeout(e),a(t.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Xo(n,t){let o=Ns(n);if(!o||!/^[A-Z][A-Z0-9]{4,30}$/i.test(o))throw new TypeError(`Invalid Slack ${t}`);return o}function Un(n,t){let o=Ns(n);if(!o)throw new TypeError(`Slack ${t} is required`);return o}function aB(n,{trim:t=!0}={}){let o=typeof n=="string"?n:"",a=t?o.trim():o;if(!a)throw new TypeError("Slack message text is required");return a.replace(/<@([A-Z0-9]+)>/gi,"@$1").replace(/]*)?>/gi,"@$1")}function LLe(n,t,o){let a=Ns(t?.error)??"unknown_error",e=new Error(`Slack ${n} failed: ${a.replaceAll("_"," ")}`);return e.providerCode=a,["invalid_auth","not_authed","token_revoked","account_inactive"].includes(a)?e.code=o==="app"?"slack-invalid-app-token":"slack-invalid-bot-token":a==="missing_scope"?e.code="slack-missing-scope":a==="method_not_supported_for_channel_type"||a==="channel_type_not_supported"||a==="deprecated_endpoint"?e.code="slack-stream-unavailable":e.code=`slack-${a}`,e}function $Z(n){return typeof n=="string"&&/^xoxb-[A-Za-z0-9-]{16,}$/.test(n.trim())}function e9(n){return typeof n=="string"&&/^xapp-[A-Za-z0-9-]{16,}$/.test(n.trim())}var nB=class{#e;#A;#t;#r;#I=null;#o;constructor({botToken:t,appToken:o,fetchImpl:a=fetch,baseUrl:e=wLe,fileUploadTimeoutMs:i=MLe}){if(t!==void 0&&!$Z(t))throw new TypeError("Slack Bot Token is invalid");if(o!==void 0&&!e9(o))throw new TypeError("Slack App Token is invalid");if(!t&&!o)throw new TypeError("SlackApi requires a token");if(typeof a!="function")throw new TypeError("SlackApi requires fetch");this.#e=t?.trim(),this.#A=o?.trim(),this.#t=a,this.#r=new URL(e),this.#o=_Le(i,"fileUploadTimeoutMs")}authTest(t={}){return this.#i("auth.test",{...t,tokenKind:"bot"})}openConnection(t={}){return this.#i("apps.connections.open",{...t,tokenKind:"app",body:void 0})}async fileInfo({fileId:t,signal:o}={}){let a=await this.#i("files.info",{tokenKind:"bot",signal:o,body:{file:Xo(t,"file id")}});if(!a?.file||typeof a.file!="object"||Array.isArray(a.file))throw new Error("Slack files.info returned no file object");return a.file}async getMessage({channelId:t,messageTs:o,signal:a}={}){let e=Un(o,"message timestamp"),i=await this.#i("conversations.history",{tokenKind:"bot",signal:a,body:{channel:Xo(t,"channel id"),oldest:e,latest:e,inclusive:!0,limit:1}});return Array.isArray(i?.messages)?i.messages.find(A=>String(A?.ts??"")===e)??null:null}postMessage({channelId:t,text:o,threadTs:a,signal:e}){return this.#i("chat.postMessage",{tokenKind:"bot",signal:e,body:{channel:Xo(t,"channel id"),text:aB(o),...a?{thread_ts:Ns(a)}:{},mrkdwn:!0,link_names:!1,unfurl_links:!1,unfurl_media:!1}})}updateMessage({channelId:t,ts:o,text:a,signal:e}){return this.#i("chat.update",{tokenKind:"bot",signal:e,body:{channel:Xo(t,"channel id"),ts:Un(o,"message timestamp"),text:aB(a),parse:"none",link_names:!1}})}addReaction({channelId:t,messageTs:o,emojiName:a,signal:e,timeoutMs:i}){return this.#i("reactions.add",{tokenKind:"bot",signal:e,timeoutMs:i,retry:!1,body:{channel:Xo(t,"channel id"),timestamp:Un(o,"message timestamp"),name:Un(a,"reaction name")}})}removeReaction({channelId:t,messageTs:o,emojiName:a,signal:e,timeoutMs:i}){return this.#i("reactions.remove",{tokenKind:"bot",signal:e,timeoutMs:i,retry:!1,body:{channel:Xo(t,"channel id"),timestamp:Un(o,"message timestamp"),name:Un(a,"reaction name")}})}startStream({channelId:t,threadTs:o,recipientTeamId:a,recipientUserId:e,markdownText:i,signal:A}){return this.#i("chat.startStream",{tokenKind:"bot",signal:A,body:{channel:Xo(t,"channel id"),thread_ts:Un(o,"thread timestamp"),...a?{recipient_team_id:Xo(a,"team id")}:{},...e?{recipient_user_id:Xo(e,"user id")}:{},...Ns(i)?{markdown_text:aB(i)}:{}}})}appendStream({channelId:t,ts:o,markdownText:a,signal:e}){return this.#i("chat.appendStream",{tokenKind:"bot",signal:e,body:{channel:Xo(t,"channel id"),ts:Un(o,"stream timestamp"),markdown_text:aB(a,{trim:!1})}})}stopStream({channelId:t,ts:o,markdownText:a,signal:e}){return this.#i("chat.stopStream",{tokenKind:"bot",signal:e,body:{channel:Xo(t,"channel id"),ts:Un(o,"stream timestamp"),...Ns(a)?{markdown_text:aB(a,{trim:!1})}:{}}})}async uploadFile({channelId:t,threadTs:o,file:a,signal:e}){if(!a||typeof a!="object"||typeof a.fileName!="string"||!a.fileName||!Buffer.isBuffer(a.bytes))throw new TypeError("A Slack file is required");if(e?.aborted)throw iB(e);let i=ZZ(e,this.#o),A;try{A=await this.#i("files.getUploadURLExternal",{tokenKind:"bot",signal:i,timeoutMs:this.#o,body:{filename:a.fileName,length:a.bytes.byteLength}})}catch(I){throw e?.aborted?iB(e):kl(I)}let r,s;try{r=Un(A?.file_id,"file id"),s=kLe(A?.upload_url)}catch(I){throw kl(I)}let g;try{g=await this.#t(s,{method:"POST",headers:{"content-type":a.mediaType??"application/octet-stream"},body:a.bytes,signal:i,redirect:"error"})}catch(I){throw e?.aborted?iB(e):kl(I)}if(!Number.isInteger(g?.status))throw kl(new Error("Slack file upload returned an invalid response"));if(g.status!==200){await LG(g);let I=new Error(`Slack file upload failed with HTTP ${g.status}`);throw I.status=g.status,g.status===413?I.code="artifact-too-large":g.status===429?I.code="artifact-rate-limited":I.code="artifact-provider-rejected",I}await LG(g);let c;try{c={files:[{id:r,title:a.fileName}],channel_id:Xo(t,"channel id"),...o?{thread_ts:Un(o,"thread timestamp")}:{}}}catch(I){throw kl(I)}if(i.aborted)throw e?.aborted?iB(e):kl(i.reason);try{let I=await this.#i("files.completeUploadExternal",{tokenKind:"bot",signal:i,timeoutMs:this.#o,retry:!1,body:c});if(!Array.isArray(I?.files)||!I.files.some(p=>Ns(p?.id)===r))throw new Error("Slack file completion did not confirm the uploaded file");return I}catch(I){throw e?.aborted?iB(e):I?.code==="slack-missing-scope"?kl(I):TLe(I)}}async downloadFile({url:t,signal:o,maxBytes:a}){return this.#c({url:t,signal:o,maxBytes:a,stream:!1})}async downloadFileStream({url:t,signal:o}){return this.#c({url:t,signal:o,stream:!0})}async#c({url:t,signal:o,maxBytes:a,stream:e}){if(!this.#e)throw new TypeError("Slack bot token is required for file download");let i=RLe(t),r={fetchImpl:async(s,g)=>{let c=await this.#t(s,g);if(!NLe(c?.status))return c;let I=vLe(c,s);if(this.#I&&!this.#I.has("files:read")||GLe(I))throw await LG(c),new ft("slack-file-access-required","Slack redirected a private file request to the workspace because file access was not granted",w("Slack \u672A\u6388\u6743\u673A\u5668\u4EBA\u8BFB\u53D6\u8BE5\u6587\u4EF6\u3002\u8BF7\u4E3A\u5E94\u7528\u6DFB\u52A0 files:read \u540E\u91CD\u65B0\u5B89\u88C5\uFF0C\u518D\u91CD\u65B0\u53D1\u9001\u56FE\u7247\u3002"));return c},headers:{authorization:`Bearer ${this.#e}`},signal:o,allowedHosts:OLe};return e?ad(i,r):To(i,{...r,maxBytes:a})}async#i(t,{tokenKind:o,body:a,signal:e,timeoutMs:i=15e3,retry:A=!0}){let r=o==="app"?this.#A:this.#e;if(!r)throw new TypeError(`Slack ${o} token is required for ${t}`);let s=t==="files.getUploadURLExternal"||t==="files.info",g;try{g=await this.#t(new URL(t,this.#r),{method:"POST",headers:{authorization:`Bearer ${r}`,"content-type":a===void 0||s?"application/x-www-form-urlencoded;charset=utf-8":"application/json;charset=utf-8","user-agent":"DeepSeek-Harness-dsh-im (https://github.com/xmanrui/dsh-im, 0.2.2)"},...a===void 0?{}:{body:s?new URLSearchParams(a).toString():JSON.stringify(a)},signal:ZZ(e,i),redirect:"error"})}catch(I){throw I?.name==="AbortError"||I?.name==="TimeoutError"?I:new Error(`Slack ${t} transport failed`)}if(o==="bot"){let I=PLe(g);I&&(this.#I=I)}let c;try{c=await g.json()}catch{throw new Error(`Slack ${t} returned invalid JSON`)}if(g.status===429&&A){let I=Number(g.headers.get("retry-after"))||1;return await FLe(Math.min(1e4,Math.max(100,I*1e3)),e),this.#i(t,{tokenKind:o,body:a,signal:e,timeoutMs:i,retry:!1})}if(!g.ok||c?.ok!==!0){let I=LLe(t,c,o);throw I.status=g.status,I}return c}};async function A9({botToken:n,appToken:t},o={}){if(!$Z(n)){let r=new TypeError(w("Slack Bot Token \u5FC5\u987B\u4EE5 xoxb- \u5F00\u5934\u3002"));throw r.code="slack-invalid-bot-token",r}if(!e9(t)){let r=new TypeError(w("Slack App Token \u5FC5\u987B\u4EE5 xapp- \u5F00\u5934\u3002"));throw r.code="slack-invalid-app-token",r}let a=new nB({botToken:n,appToken:t,...o}),[e,i]=await Promise.all([a.authTest(),a.openConnection()]);if(!e?.team_id||!e?.user_id||!e?.bot_id)throw new Error(w("Slack Bot Token \u6CA1\u6709\u8FD4\u56DE\u5B8C\u6574\u7684\u673A\u5668\u4EBA\u8EAB\u4EFD\u3002"));let A;try{A=new URL(i?.url)}catch{A=null}if(!A||A.protocol!=="wss:"){let r=new Error(w("Slack App Token \u65E0\u6CD5\u521B\u5EFA Socket Mode \u8FDE\u63A5\uFF0C\u8BF7\u786E\u8BA4\u5DF2\u542F\u7528 Socket Mode \u548C connections:write\u3002"));throw r.code="slack-socket-mode",r}return{platformId:`${e.team_id}:${e.user_id}`,name:Ns(e.user)??"DeepSeek Harness",username:Ns(e.user),teamId:String(e.team_id),teamName:Ns(e.team)}}var UG=Object.freeze({key:"slack",label:"Slack",connectionLabel:" Socket Mode \u957F\u8FDE\u63A5",reactions:Object.freeze({processing:"eyes",success:"white_check_mark",error:"x"})}),Bw=class extends Es{constructor(t){super({descriptor:UG,...t})}};function Ug(n){return typeof n=="string"&&n.trim()?n.trim():null}function fw(n,t){return Object.freeze({code:n,message:t})}var sB=class{#e;#A;#t;#r;#I;#o;#c=new Map;#i=new Map;#a=new Map;#s=0;#p=!1;constructor({credentials:t,configStore:o,inspectCredentials:a=A9,createRuntime:e,deleteState:i=async()=>{},logger:A=console}){if(!t||typeof t.resolve!="function"||typeof t.set!="function"||typeof t.unset!="function")throw new TypeError("Slack requires the DSH credential provider");if(!o||typeof o.list!="function"||typeof o.save!="function"||typeof o.remove!="function")throw new TypeError("Slack requires a config store");if(typeof a!="function"||typeof e!="function")throw new TypeError("Slack controller dependencies are incomplete");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A}async initialize(){if(this.#p)return this.status();for(let t of this.#A.list())await this.#d(t.botId,async()=>{if(this.#p||this.#c.get(t.botId)?.status?.ready)return;let o=await this.#n(t);if(!o){this.#i.set(t.botId,fw("missing-token",w("Slack\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002")));return}try{await this.#g(t,o),this.#i.delete(t.botId)}catch(a){this.#i.set(t.botId,fw("connection-failed",w("Slack Socket Mode \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#o.warn?.(`[dsh-im:slack] bot ${t.botId} failed to initialize:`,a)}finally{this.#C()}});return this.status()}async bindCredentials({botToken:t,appToken:o}={}){if(this.#p)throw new Error("Slack controller is closed");let a=Ug(t),e=Ug(o);if(!a||!e)throw new TypeError("Slack Bot Token and App Token are required");let i=await this.#t({botToken:a,appToken:e}),A=Ug(i?.platformId),r=Ug(i?.name);if(!A||!r)throw new Error("Slack returned an invalid bot identity");let s=GG(A);return await this.#d(s.botId,async()=>{if(this.#p)throw new Error("Slack controller is closed");let g=this.#A.getByPlatformId(A),c=await this.#e.resolve(s.botTokenRef).catch(()=>{}),I=await this.#e.resolve(s.appTokenRef).catch(()=>{}),p={...s,platformId:A,name:r,username:Ug(i.username),teamId:Ug(i.teamId),teamName:Ug(i.teamName),createdAt:g?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};try{await this.#e.set(s.botTokenRef,a),await this.#e.set(s.appTokenRef,e),await this.#A.save(p)}catch(B){throw await Promise.all([this.#h(s.botTokenRef,c),this.#h(s.appTokenRef,I)]),B}try{await this.#g(p,{botToken:a,appToken:e}),this.#i.delete(s.botId)}catch(B){this.#i.set(s.botId,fw("connection-failed",w("Slack\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0CSocket Mode \u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:slack] bot ${s.botId} credential connection failed:`,B)}this.#C()}),this.status()}async reconnectBot(t){let o=this.#A.get(t);if(!o)throw new Error("Unknown Slack bot");return await this.#d(t,async()=>{let a=await this.#n(o);if(!a)throw new Error("Slack bot credentials are missing");try{await this.#g(o,a),this.#i.delete(t)}catch(e){throw this.#i.set(t,fw("connection-failed",w("Slack Socket Mode \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u68C0\u67E5\u4E24\u4E2A Token\u3002"))),e}finally{this.#C()}}),this.status()}async sendConnectionTest(t){let o=this.#A.get(t);if(!o)throw new Error("Unknown Slack bot");return this.#d(t,async()=>{let a=this.#c.get(t);if(!a?.status?.ready||typeof a.sendConnectionTest!="function"){let e=new Error(w("Slack\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw e.code="test-target-unavailable",e}return await a.sendConnectionTest(Ui(`${o.name}\uFF08${FG(o.platformId)}\uFF09`,w("Slack\u673A\u5668\u4EBA"))),{sent:!0}})}async sendProactiveText(t,o,a,e={}){if(!this.#A.get(t))throw new Error("Unknown Slack bot");return this.#d(t,async()=>{let A=this.#c.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("Slack\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,a,e)})}async deleteBot(t){let o=this.#A.get(t);if(!o)throw new Error("Unknown Slack bot");return await this.#d(t,async()=>{let a=await this.#e.resolve(o.botTokenRef).catch(()=>{}),e=await this.#e.resolve(o.appTokenRef).catch(()=>{});await this.#l(t);try{await this.#e.unset(o.botTokenRef),await this.#e.unset(o.appTokenRef),await this.#A.remove(t)}catch(i){throw await Promise.all([this.#h(o.botTokenRef,a),this.#h(o.appTokenRef,e)]),a?.value&&e?.value&&await this.#g(o,{botToken:a.value,appToken:e.value}).catch(()=>{}),new Error("Unable to remove the Slack bot safely.",{cause:i})}await this.#I({botId:t,config:o}).catch(i=>{this.#o.warn?.(`[dsh-im:slack] bot ${t} state cleanup failed:`,i)}),this.#i.delete(t),this.#C()}),this.status()}status(){let t=this.#A.list().map(a=>{let e=this.#c.get(a.botId)?.status??null,i=e?.ready===!0&&e.connectionState==="connected"&&e.harnessReachable===!0,A=i?"connected":e?.connectionState==="connecting"?"connecting":this.#i.has(a.botId)||e?.connectionState==="failed"?"error":"offline";return{botId:a.botId,state:A,connected:i,configured:!0,bot:{name:a.name,username:a.username,teamName:a.teamName,idMasked:FG(a.platformId)},health:{status:i?"healthy":A==="error"?"error":"offline",summary:i?w(`Slack${UG.connectionLabel}\u8FD0\u884C\u6B63\u5E38`):A==="error"?w("Slack\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5"):w("Slack\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:e?.lastCheckedAt??null,lastConnectedAt:e?.lastConnectedAt??null},stats:{messagesReceived:e?.messagesReceived??0,messagesReplied:e?.messagesReplied??0},lastMessageError:ti(e?.lastMessageError),error:structuredClone(this.#i.get(a.botId)??null)}}),o=t.filter(a=>a.connected).length;return{schemaVersion:1,revision:this.#s,state:t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o}}}async close(){this.#p||(this.#p=!0,await Promise.allSettled([...this.#a.values()]),await Promise.allSettled([...this.#c.keys()].map(t=>this.#l(t))))}async#g(t,{botToken:o,appToken:a}){if(this.#p)throw new Error("Slack controller is closed");if(await this.#l(t.botId),this.#p)throw new Error("Slack controller is closed");let e=await this.#r({botId:t.botId,config:t,botToken:o,appToken:a});if(!e||typeof e.start!="function"||typeof e.stop!="function")throw new TypeError("createRuntime returned an invalid Slack runtime");this.#c.set(t.botId,e);try{await e.start()}catch(i){throw await e.stop().catch(()=>{}),this.#c.delete(t.botId),i}}async#l(t){let o=this.#c.get(t);this.#c.delete(t),await o?.stop().catch(a=>{this.#o.warn?.(`[dsh-im:slack] bot ${t} failed to stop cleanly:`,a)})}async#n(t){let[o,a]=await Promise.all([this.#e.resolve(t.botTokenRef).catch(()=>{}),this.#e.resolve(t.appTokenRef).catch(()=>{})]),e=Ug(o?.value),i=Ug(a?.value);return e&&i?{botToken:e,appToken:i}:null}async#h(t,o){o?.value?await this.#e.set(t,o.value).catch(()=>{}):await this.#e.unset(t).catch(()=>{})}#d(t,o){let i=(this.#a.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#a.get(t)===i&&this.#a.delete(t)});return this.#a.set(t,i),i}#C(){this.#s+=1}};var Qw=class extends yr{constructor(t){super({...t,rpcIdPrefix:"slack",logPrefix:"dsh-slack"})}};var t9=Object.freeze([1e3,3e3,5e3,1e4,3e4]),KG=38e3,r9=11e3,a9=new Set(["image/jpeg","image/png","image/webp","image/gif"]);function HG(n,t,o){if(typeof n.addEventListener=="function")n.addEventListener(t,o);else if(typeof n.on=="function")n.on(t,o);else throw new TypeError("Slack WebSocket does not support events")}function ULe(n){let t=n?.data??n;return typeof t=="string"?t:Buffer.isBuffer(t)?t.toString("utf8"):t instanceof ArrayBuffer?Buffer.from(t).toString("utf8"):ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):null}function HLe(n){let t=new URL(n);if(t.protocol!=="wss:")throw new Error("Slack returned an insecure Socket Mode URL");return t.href}function o9(n){return typeof n=="string"?n.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">"):""}function KLe(n,t){return o9(n).replace(new RegExp(`<@${t}>`,"gi"),"").trim()}function xG(n){return typeof n?.url_private_download=="string"&&n.url_private_download?n.url_private_download:n?.url_private}function xLe(n){if(!n||typeof n!="object")return null;let t=typeof n.mimetype=="string"?n.mimetype.toLowerCase():"",o=t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":"file",a=typeof n.name=="string"&&n.name?n.name:typeof n.title=="string"&&n.title?n.title:void 0;return{kind:o,...a?{name:a}:{}}}function YLe(n,t){if(!n||String(n.ts??"")!==t)return null;let o=typeof n.user=="string"&&n.user?n.user:typeof n.bot_id=="string"&&n.bot_id?n.bot_id:void 0,a=typeof n.username=="string"&&n.username?n.username:void 0;return{messageId:t,...o?{authorId:o}:{},...a?{authorName:a}:{},content:o9(n.text??""),attachments:Array.isArray(n.files)?n.files.map(xLe).filter(Boolean):[]}}function jLe(n,t){let o=typeof n?.thread_ts=="string"?n.thread_ts:"";if(!(!o||o===String(n?.ts??"")))return{messageId:o,load:async({signal:a}={})=>{try{let e=await t({channelId:String(n.channel),messageTs:o,signal:a});return YLe(e,o)}catch(e){if(e?.code==="slack-missing-scope")return{messageId:o,unavailableReason:"permission-denied"};throw e}}}}function JLe(n,t){let o=typeof n?.mimetype=="string"?n.mimetype.toLowerCase():"",a=xG(n);return!a9.has(o)||typeof a!="string"||!a?null:{name:typeof n.name=="string"?n.name:void 0,mediaType:o,size:Number.isSafeInteger(n.size)&&n.size>=0?n.size:void 0,load:e=>t(a,e)}}function qLe(n,t,o){let a=typeof n?.mimetype=="string"&&n.mimetype?n.mimetype.toLowerCase():void 0,e=xG(n);if(a9.has(a))return null;let i=n?.file_access==="check_file_info"&&typeof n?.id=="string"&&n.id;return(typeof e!="string"||!e)&&!i?null:{name:typeof n?.name=="string"&&n.name?n.name:typeof n?.title=="string"&&n.title?n.title:i?n.id:"slack-file",...a?{mediaType:a}:{},size:Number.isSafeInteger(n?.size)&&n.size>=0?n.size:void 0,load:async({signal:A}={})=>{if(!i)return t(e,{signal:A});let r=await o(n.id,{signal:A}),s=xG(r);if(typeof s!="string"||!s)throw new Error("Slack files.info returned no downloadable URL");let g=await t(s,{signal:A}),c=typeof r?.name=="string"&&r.name?r.name:typeof r?.title=="string"&&r.title?r.title:n.id,I=typeof r?.mimetype=="string"&&r.mimetype?r.mimetype.toLowerCase():void 0;return Buffer.isBuffer(g)||g instanceof Uint8Array?{data:g,name:c,...I?{mediaType:I}:{}}:{...g,name:c,...I?{mediaType:I}:{}}}}}function zLe(n,t,{loadFile:o=async()=>{throw new Error("Slack file downloader is unavailable")},loadFileStream:a=o,loadFileInfo:e=async()=>{throw new Error("Slack file metadata loader is unavailable")},loadReply:i=async()=>{throw new Error("Slack reply loader is unavailable")}}={}){let A=n?.event;if(!A||!n?.event_id||!A.channel||!A.user||!A.ts)return null;let r=A.type==="message"&&A.channel_type==="im",s=A.type==="app_mention";if(!r&&!s||A.subtype&&A.subtype!=="file_share"||A.bot_id||A.app_id)return null;let g=String(A.thread_ts??A.ts),c=jLe(A,i);return{messageId:String(n.event_id),senderId:String(A.user),senderIsBot:String(A.user)===String(t),kind:r?"direct":"group",conversationId:r?String(A.channel):`${A.channel}:${g}`,contextSource:()=>({chatId:String(A.channel),threadId:A.thread_ts?String(A.thread_ts):void 0}),content:KLe(A.text??"",t),plainText:!Array.isArray(A.files)||A.files.length===0,images:Array.isArray(A.files)?A.files.map(I=>JLe(I,o)).filter(Boolean):[],files:Array.isArray(A.files)?A.files.map(I=>qLe(I,a,e)).filter(Boolean):[],...c?{replyTo:c}:{},addressed:r||s,reactionTarget:{channelId:String(A.channel),messageTs:String(A.ts)},replyTarget:{channelId:String(A.channel),threadTs:g,recipientUserId:String(A.user),recipientTeamId:String(A.user_team??n.team_id??"")},connectionTestTarget:{channelId:String(A.channel)}}}function VLe(n){if(typeof n!="string")return!1;let t="__DSH_IM_TOOL_NAME__",o=w("\u6B63\u5728\u4F7F\u7528{name}\u2026",{name:t}),a=o.indexOf(t);if(a<0)return!1;let e=o.slice(0,a),i=o.slice(a+t.length),A=n.trim();return A.startsWith(e)&&A.endsWith(i)&&A.length>e.length+i.length}async function i9(n,t,o,a,e){if(a)for(let i=0;i{let y=us(Q,KG)[0]??"";if(!y||!y.startsWith(A))return;let m=y.slice(A.length);m&&(await i9(n,t,i,m,o),A=y)},f=()=>{I||c||s!==null||g||!r||(s=setTimeout(()=>{s=null;let Q=r;r="",g=B(Q).catch(y=>{c=!0,a.warn?.("[dsh-im:slack] streaming append failed:",y)}).finally(()=>{g=null,f()})},350),s?.unref?.())};return{messageId:i,get providerMessageIds(){return[...p]},update(Q){I||c||typeof Q!="string"||!Q.trim()||VLe(Q)||(r=Q,f())},async finish(Q){if(I)throw new Error("Slack message stream is already closed");I=!0,s!==null&&clearTimeout(s),s=null,r="",await g?.catch(()=>{});let y=us(Q,KG),m=y[0]??w("\u5904\u7406\u5B8C\u6210\u3002");!c&&m.startsWith(A)?(await i9(n,t,i,m.slice(A.length),o),await n.stopStream({channelId:t.channelId,ts:i,signal:o})):(await n.stopStream({channelId:t.channelId,ts:i,signal:o}).catch(()=>{}),await n.updateMessage({channelId:t.channelId,ts:i,text:m,signal:o}));for(let T of y.slice(1)){let _=await n.postMessage({channelId:t.channelId,threadTs:t.threadTs,text:T,signal:o});typeof _?.ts=="string"&&_.ts&&p.push(_.ts)}},cancel(){I=!0,r="",s!==null&&clearTimeout(s),s=null,n.stopStream({channelId:t.channelId,ts:i,signal:o}).catch(()=>{})}}}var YG=class{#e;#A;#t;constructor({api:t,signal:o,logger:a}){this.#e=t,this.#A=o,this.#t=a}async sendText(t,o){let a=us(o,KG),e=[];for(let i of a){let A=await this.#e.postMessage({channelId:t.channelId,threadTs:t.threadTs,text:i,signal:this.#A});typeof A?.ts=="string"&&A.ts&&e.push(A.ts)}return{providerMessageIds:e}}async addReaction(t,o,{signal:a}={}){let e=String(o??"").trim();return await this.#e.addReaction({channelId:t.channelId,messageTs:t.messageTs,emojiName:e,signal:a??this.#A}),e}removeReaction(t,o,{signal:a}={}){return this.#e.removeReaction({channelId:t.channelId,messageTs:t.messageTs,emojiName:o,signal:a??this.#A})}openStream(t){return WLe({api:this.#e,target:t,signal:this.#A,logger:this.#t})}sendFile(t,o){return this.#e.uploadFile({channelId:t.channelId,threadTs:t.threadTs,file:o,signal:this.#A})}};function ZLe(){return{startedAt:null,ready:!1,connectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...co()}}var gB=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g;#l;#n=ZLe();#h=null;#d=null;#C=null;#u=null;#B=null;#f=null;#m=0;#w=0;#Q=!0;#y=null;constructor({config:t,botToken:o,appToken:a,harness:e,state:i,contextEnhancement:A,accessPolicy:r,groupSessionScope:s,logger:g=console,replyTimeoutMs:c=6e5,connectTimeoutMs:I=2e4,createApi:p=f=>new nB(f),createWebSocket:B=f=>new WebSocket(f)}){if(!t||!o||!a||!e||!i)throw new TypeError("SlackRuntime requires config, both tokens, Harness, and state");if(typeof B!="function")throw new TypeError("SlackRuntime requires WebSocket");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g,this.#s=c,this.#p=I,this.#g=p,this.#l=B}get status(){return structuredClone(this.#n)}async sendConnectionTest(t){if(!this.#n.ready||!this.#d){let o=new Error("Slack bot is not connected");throw o.code="test-target-unavailable",o}return this.#d.sendConnectionTest(t)}async sendProactiveText(t,o,a={}){if(!this.#n.ready||!this.#d){let A=new Error("Slack bot is not connected");throw A.code="bot-not-connected",A}let e=typeof t?.route?.channelId=="string"?t.route.channelId.trim():"",i=typeof t?.route?.threadTs=="string"?t.route.threadTs.trim():"";if(!e||t?.kind!=="conversation"&&t?.kind!=="thread"||t.kind==="thread"&&!i||t.kind==="conversation"&&i){let A=new TypeError("Invalid Slack proactive delivery target");throw A.code="invalid-target",A}return this.#d.sendProactiveText({channelId:e,...i?{threadTs:i}:{}},o,a)}async start(){return this.#n.ready&&this.#u?this.status:this.#y?this.#y:(this.#y=this.#b().finally(()=>{this.#y=null}),this.#y)}async#b(){await this.stop(),this.#Q=!1,this.#m=0,this.#n.startedAt=new Date().toISOString(),this.#n.connectionState="connecting",this.#n.lastError=null,await this.#r.ensureRunning(),this.#n.harnessReachable=!0;let t=new AbortController;this.#C=t;let o=this.#g({botToken:this.#A,appToken:this.#t});this.#h=o;try{let a=await o.authTest({signal:t.signal});if(`${a?.team_id}:${a?.user_id}`!==this.#e.platformId)throw new Error("Slack Bot Token identity does not match the saved bot");let e=new YG({api:o,signal:t.signal,logger:this.#a});this.#d=new Bw({bot:e,harness:this.#r,state:this.#I,contextEnhancement:this.#o,accessPolicy:this.#c,groupSessionScope:this.#i,status:this.#n,logger:this.#a,replyTimeoutMs:this.#s,signal:t.signal});let i;try{await Promise.race([this.#E(),new Promise((A,r)=>{i=setTimeout(()=>r(new Error("Slack Socket Mode did not become ready in time")),this.#p),i?.unref?.()})])}finally{clearTimeout(i)}return this.status}catch(a){throw this.#n.ready=!1,this.#n.connectionState="failed",this.#n.lastError=a?.message??String(a),await this.stop(),a}}async#E(){if(this.#Q)throw new Error("Slack runtime is stopped");let t=await this.#h.openConnection({signal:this.#C?.signal});return this.#k(t?.url)}#k(t){if(this.#Q)return Promise.reject(new Error("Slack runtime is stopped"));let o=++this.#w,a=this.#l(HLe(t));this.#u=a;let e=!1;return new Promise((i,A)=>{let r=s=>{if(e||o!==this.#w)return;e=!0,this.#B=s?.connection_info?.app_id??null,this.#m=0;let g=Date.now();this.#n.ready=!0,this.#n.connectionState="connected",this.#n.lastCheckedAt=g,this.#n.lastConnectedAt=g,this.#n.lastError=null,i()};HG(a,"message",s=>{if(o!==this.#w||this.#Q)return;let g=ULe(s);if(!g)return;let c;try{c=JSON.parse(g)}catch{this.#a.warn?.("[dsh-im:slack] ignored malformed Socket Mode JSON");return}if(c.type==="hello"){r(c);return}if(c.envelope_id&&a.readyState===1&&(a.send(JSON.stringify({envelope_id:c.envelope_id})),this.#n.lastCheckedAt=Date.now()),c.type==="disconnect"){a.close(4e3,"Slack requested reconnect");return}if(c.type!=="events_api"||c.payload?.type!=="event_callback"||this.#B&&c.payload.api_app_id&&c.payload.api_app_id!==this.#B)return;let I=zLe(c.payload,this.#e.platformId.split(":")[1],{loadFile:(B,f)=>this.#h.downloadFile({url:B,...f}),loadFileStream:(B,f)=>this.#h.downloadFileStream({url:B,...f}),loadFileInfo:(B,f)=>this.#h.fileInfo({fileId:B,...f}),loadReply:B=>this.#h.getMessage(B)}),p=this.#d;I&&p&&p.accept(I).catch(B=>{o!==this.#w||this.#Q||this.#a.error?.(`[dsh-im:slack] bot ${this.#e.botId} message handling failed:`,B)})}),HG(a,"close",(s={})=>{if(o!==this.#w)return;if(this.#u===a&&(this.#u=null),this.#Q){e||A(new DOMException("Stopped","AbortError"));return}let g=Number(s.code)||0,c=new Error(`Slack Socket Mode closed (${g||"unknown"})`);this.#n.ready=!1,this.#n.connectionState="connecting",this.#n.lastError=c.message,e||(e=!0,A(c)),this.#M()}),HG(a,"error",()=>{o!==this.#w||this.#Q||(this.#n.lastError="Slack Socket Mode WebSocket error")})})}#M(){if(this.#Q||this.#f!==null)return;let t=t9[Math.min(this.#m,t9.length-1)];this.#m+=1,this.#f=setTimeout(()=>{this.#f=null,this.#E().catch(o=>{this.#Q||(this.#a.warn?.("[dsh-im:slack] Socket Mode reconnect failed:",o),this.#M())})},t),this.#f?.unref?.()}async stop(){this.#Q=!0,this.#w+=1,this.#C?.abort(),this.#C=null,this.#f!==null&&clearTimeout(this.#f),this.#f=null;let t=this.#u,o=this.#d;this.#u=null,this.#d=null,this.#h=null,this.#B=null;try{t&&t.readyState<2&&t.close(1e3,"Plugin stopped")}catch(a){this.#a.warn?.(`[dsh-im:slack] bot ${this.#e.botId} failed to close Socket Mode:`,a)}return await Promise.race([o?.waitForIdle()??Promise.resolve(),new Promise(a=>setTimeout(a,2e3))]),this.#n.ready=!1,this.#n.connectionState="idle",this.status}};var yw=class extends Cs{};async function jG(n,t={},o={}){if(!n?.credentials)throw new TypeError("dsh-im slack requires ctx.credentials");let a=si(n,t),e=o.ConfigStore??Cw,i=o.StateStore??yw,A=o.HarnessClient??Qw,r=o.Controller??sB,s=o.Runtime??gB,g=o.createConnectionSupervisor??od,c=typeof n.logger=="function"?n.logger("dsh-im:slack"):n.logger??console,I=()=>xi(n),p=RT(t,"slack"),B=await new e(p.config).load(),f=n9(t.workspace??process.cwd()),Q=o.WorkspaceStore??ni,y=o.workspaces??await new Q(p.workspaces,{defaultWorkspace:f}).load(),m=B.list();await y.reconcile(m.map(N=>N.botId)),await Promise.all(m.map(N=>y.ensure(N.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("slack",N)})));let T=typeof B.remove=="function"?Yi(B,{workspaces:y}):B,_=new Map,R=N=>n9(p.bots,N,"state.json"),L=async N=>{let k=_.get(N);return k||(k=await new i(R(N)).load(),_.set(N,k)),k},U=zi(n,o.commandExecutor),{controlExecutor:F,sessionMaintenanceExecutor:q,fileIngressExecutor:z}=Vi(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),K=new A({...a,workspace:f,autostart:!1,dshBin:t.dshBin??"dsh",...U?{commandExecutor:U}:{},...F?{controlExecutor:F}:{},...q?{sessionMaintenanceExecutor:q}:{},...z?{fileIngressExecutor:z}:{}}),G=new r({credentials:n.credentials,configStore:T,logger:c,...o.inspectCredentials?{inspectCredentials:o.inspectCredentials}:{},createRuntime:async({botId:N,config:k,botToken:J,appToken:X})=>{let ie=await L(N);await y.ensure(N,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("slack",k)});let De=ji(K,{botId:N,workspaces:y,state:ie,agentPresetCatalog:I});return new s({config:k,botToken:J,appToken:X,harness:De.harness,state:De.state,contextEnhancement:{botId:N,getSettings:()=>y.contextEnhancementFor(N)},accessPolicy:Wi(y,N,{channel:"slack",config:k}),groupSessionScope:{getScope:()=>y.groupSessionScopeFor(N)},replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??2e4,logger:{error:(...oe)=>c.error?.(`[${N}]`,...oe),warn:(...oe)=>c.warn?.(`[${N}]`,...oe),info:(...oe)=>c.info?.(`[${N}]`,...oe),debug:(...oe)=>c.debug?.(`[${N}]`,...oe)}})},deleteState:async({botId:N})=>{let k=_.get(N);if(_.delete(N),k&&typeof k.remove=="function")await k.remove();else try{await XLe(R(N))}catch(J){if(J?.code!=="ENOENT")throw J}}}),V=Ji(G,{workspaces:y,stateFor:L,agentPresetCatalog:I}),H=g({channel:"slack",controller:V,harness:K,logger:c,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:V,deliveryAdapter:qi({channel:"slack",workspaces:y,coreController:G,stateFor:L}),ready:H.ready,async close(){await H.close(),await V.close(),K.stopManagedProcess()}}}var g9="/slack",jr=Object.freeze({status:"connection.status",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:La,setAgentPreset:Ua,setContextEnhancement:Fa,setAccessPolicy:Xi,setGroupSessionScope:ea}),c9=Object.freeze(Object.values(jr)),$Le=new Set(["token","botToken","appToken","botTokenRef","appTokenRef","tokenRef","platformId","secret","secretRef"]);function qG(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function mw(n,t){return qG(n)&&Object.keys(n).every(o=>t.includes(o))}function s9(n){return typeof n=="string"&&/^slack_[a-f0-9]{24}$/.test(n)}function e2e(n){return typeof n=="string"&&/^xoxb-[A-Za-z0-9-]{16,}$/.test(n.trim())&&n.length<=4096}function A2e(n){return typeof n=="string"&&/^xapp-[A-Za-z0-9-]{16,}$/.test(n.trim())&&n.length<=4096}function t2e(n,t){return qG(t)?n===jr.status?mw(t,[])?null:"connection.status does not accept fields.":n===jr.bindCredentials?mw(t,["botToken","appToken"])&&e2e(t.botToken)&&A2e(t.appToken)?null:"bot.bind-credentials requires xoxb Bot Token and xapp App Token.":n===jr.reconnectBot?mw(t,["botId","sendTest"])&&s9(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"bot.reconnect requires a botId.":n===jr.deleteBot?mw(t,["botId","confirm"])&&s9(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===jr.setWorkspace?ta(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===jr.setAgentPreset?ia(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===jr.setContextEnhancement?Zi(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===jr.setAccessPolicy?$i(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===jr.setGroupSessionScope?Aa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u7FA4\u4F1A\u8BDD\u7B56\u7565\u3002":"Unknown Slack endpoint.":"Payload must be an object."}function JG(n){if(Array.isArray(n))return n.map(JG);if(!qG(n))return n;let t={};for(let[o,a]of Object.entries(n))$Le.has(o)||(t[o]=JG(a));return t}function r2e(n){let t=ra(n);return t||(n?.code==="slack-invalid-bot-token"?{code:"invalid-bot-token",message:"Slack Bot Token \u65E0\u6548\uFF0C\u8BF7\u786E\u8BA4\u4F7F\u7528\u4EE5 xoxb- \u5F00\u5934\u7684\u4EE4\u724C\u3002"}:n?.code==="slack-invalid-app-token"?{code:"invalid-app-token",message:"Slack App Token \u65E0\u6548\uFF0C\u8BF7\u786E\u8BA4\u4F7F\u7528\u4EE5 xapp- \u5F00\u5934\u7684\u4EE4\u724C\u3002"}:n?.code==="slack-missing-scope"?{code:"missing-scope",message:"Slack \u5E94\u7528\u6743\u9650\u4E0D\u5B8C\u6574\uFF0C\u8BF7\u91CD\u65B0\u5BFC\u5165 Manifest \u5E76\u5B89\u88C5\u5230\u5DE5\u4F5C\u533A\u3002"}:n?.code==="slack-socket-mode"?{code:"socket-mode-unavailable",message:n.message}:{code:"slack-operation-failed",message:"Slack \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"})}function I9(n){for(let t of["status","bindCredentials","reconnectBot","deleteBot"])if(typeof n?.[t]!="function")throw new TypeError(`A complete Slack controller is required (${t})`);return async(t,o,a)=>{if(a?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!c9.includes(t))return{ok:!1,error:{code:"bad-request",message:"Unknown Slack endpoint."}};let e=t2e(t,o);if(e)return{ok:!1,error:{code:"bad-request",message:e}};try{let i;if(t===jr.status)i=await n.status();else if(t===jr.bindCredentials)i=await n.bindCredentials(o);else if(t===jr.reconnectBot){if(i=await n.reconnectBot(o.botId),a?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(o.sendTest===!0){let A=null;try{if(i?.bots?.find(r=>r?.botId===o.botId)?.connected!==!0){let r=new Error("Bot is not connected");throw r.code="test-target-unavailable",r}if(typeof n.sendConnectionTest!="function"){let r=new Error("Connection test is unavailable");throw r.code="test-target-unavailable",r}await n.sendConnectionTest(o.botId)}catch(r){A=r}i={...i,testMessage:lr(A)}}}else if(t===jr.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");i=await n.updateWorkspace(o.botId,o.workspace)}else if(t===jr.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");i=await n.updateContextEnhancement(o.botId,o.config)}else if(t===jr.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");i=await n.updateAccessPolicy(o.botId,o.policy)}else if(t===jr.setGroupSessionScope){if(typeof n.updateGroupSessionScope!="function")throw new Error("Group session scope update is unavailable");i=await n.updateGroupSessionScope(o.botId,o.groupSessionScope)}else if(t===jr.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");i=await n.updateAgentPreset(o.botId,o.agentPreset)}else i=await n.deleteBot(o.botId);return a?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:JG(i)}}catch(i){return a?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:r2e(i)}}}}function Sw(n,t,o){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(g9,I9(t),{authority:mr(o)})}async function l9(n,t={}){if(t?.controller)return Sw(n,t.controller,t.rpcAuthority);let o=await jG(n,t,t.internals??{}),a=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=Sw(n,o.controller,t.rpcAuthority);return n.effect(()=>async()=>{await a?.(),await o.close()},"dsh-im: close Slack bot connections"),e}var p9=Object.freeze({botPrefix:"telegram",tokenRefPrefix:"DSH_TELEGRAM_BOT_TOKEN"}),zG=Object.freeze({compatible:"compatible",privateAllowlist:"private-allowlist"}),i2e=/^[1-9]\d{0,15}$/;function d9(n){if(n===void 0)return Object.freeze([]);if(!Array.isArray(n))throw new TypeError("allowedUsers must be an array of numeric Telegram User IDs");let t=n.map(o=>{let a=typeof o=="number"&&Number.isSafeInteger(o)?String(o):typeof o=="string"?o.trim():"";if(!i2e.test(a))throw new TypeError("allowedUsers contains an invalid Telegram User ID");return a});return Object.freeze([...new Set(t)])}function Dw(n={}){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("Telegram access policy must be an object");let t=n.accessMode??zG.compatible;if(!Object.values(zG).includes(t))throw new TypeError("Telegram accessMode must be compatible or private-allowlist");return Object.freeze({accessMode:t,allowedUsers:d9(n.allowedUsers)})}function a2e(n){let t=Object.hasOwn(n,"accessMode"),o=Object.hasOwn(n,"allowedUsers");if(!t&&!o)return{};try{let a=Dw(n);return{...t?{accessMode:a.accessMode}:{},...o||t?{allowedUsers:a.allowedUsers}:{}}}catch{return null}}function h9(n){return hu(n,p9)}function E9(n){return py(n,w("Telegram\u673A\u5668\u4EBA"))}var ww=class extends rd{constructor(t){super(t,{channel:"Telegram",...p9,normalizeBotExtension:a2e})}async save(t){let o=t?.platformId?this.getByPlatformId(String(t.platformId)):null;return super.save({...o,...t})}};var Ow=class extends yr{constructor(t){super({...t,rpcIdPrefix:"telegram",logPrefix:"dsh-telegram"})}};var o2e="https://api.telegram.org/",u9=Object.freeze(["api.telegram.org"]),n2e=12e4;function Hg(n){return typeof n=="string"&&n.trim()?n.trim():null}function C9(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}function VG(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function s2e(n,t){if(!Number.isInteger(n)||n<1)throw new TypeError(`${t} must be a positive integer`);return n}function f9(n,t){return t?.providerCode!==void 0&&(n.providerCode=t.providerCode),t?.retry_after!==void 0&&(n.retry_after=t.retry_after,n.retryAfter=t.retry_after),Number.isInteger(t?.status)&&(n.status=t.status),n}function WG(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("A Telegram rich message is required");let t=["markdown","html","blocks"].filter(a=>n[a]!==void 0);if(t.length!==1)throw new TypeError("A Telegram rich message requires exactly one format");let o=t[0];if((o==="markdown"||o==="html")&&(typeof n[o]!="string"||!n[o].trim()))throw new TypeError("Telegram rich message text is invalid");if(o==="blocks"&&!Array.isArray(n.blocks))throw new TypeError("Telegram rich message blocks are invalid");return n}function g2e(n,t="document"){let o=Number(n?.providerCode),a=Number(n?.status),e=Hg(n?.message)??"",i="artifact-provider-rejected",A=`Telegram rejected the ${t}.`;o===401||o===403||a===401||a===403?(i="artifact-permission-required",A=`Telegram denied permission to send the ${t}.`):o===413||a===413||/(?:file|request|entity).{0,20}(?:too (?:big|large)|size limit)|too (?:big|large)/i.test(e)?(i="artifact-too-large",A=`The ${t} exceeds Telegram's size limit.`):o===429||a===429?(i="artifact-rate-limited",A=`Telegram rate-limited ${t} delivery.`):(o>=500||a>=500)&&(i="artifact-delivery-uncertain",A=`Telegram ${t} delivery result is uncertain.`);let r=new Error(A,{cause:n});return r.code=i,f9(r,n)}function B9(n,t="document"){let o=new Error(`Telegram ${t} delivery result is uncertain`,{cause:n});return o.code="artifact-delivery-uncertain",f9(o,n)}function c2e(n){return typeof n=="string"&&/^\d{5,20}:[A-Za-z0-9_-]{20,}$/.test(n.trim())}var I2e=/^[a-z0-9_]{1,32}$/;function l2e(n){return!!n&&typeof n=="object"&&!Array.isArray(n)&&typeof n.command=="string"&&I2e.test(n.command)&&typeof n.description=="string"&&n.description.length>=1&&n.description.length<=256}var ZG=Object.freeze({type:"commands"}),cB=class{#e;#A;#t;#r;#I;constructor({token:t,fetchImpl:o=fetch,FormDataImpl:a=globalThis.FormData,baseUrl:e=o2e,fileUploadTimeoutMs:i=n2e}){if(!c2e(t))throw new TypeError("Telegram Bot Token is invalid");if(typeof o!="function")throw new TypeError("TelegramApi requires fetch");if(typeof a!="function")throw new TypeError("TelegramApi requires FormData");this.#e=t.trim(),this.#A=o,this.#t=a,this.#r=new URL(e),this.#I=s2e(i,"fileUploadTimeoutMs")}async getMe(t={}){return this.#i("getMe",{},t)}async getWebhookInfo(t={}){return this.#i("getWebhookInfo",{},t)}async getUpdates({offset:t,timeout:o=25,signal:a}={}){let e={timeout:o,limit:100,allowed_updates:["message"],...Number.isSafeInteger(t)?{offset:t}:{}};return this.#i("getUpdates",e,{signal:a,timeoutMs:Math.max(1e4,(o+10)*1e3)})}async getFile({fileId:t,signal:o}={}){let a=Hg(t);if(!a||!/^[A-Za-z0-9_-]{1,512}$/.test(a))throw new TypeError("Telegram file id is invalid");return this.#i("getFile",{file_id:a},{signal:o})}async downloadFile({fileId:t,signal:o,maxBytes:a}={}){let e=await this.#o(t,o);return To(e,{fetchImpl:this.#A,signal:o,maxBytes:a,allowedHosts:u9})}async downloadFileStream({fileId:t,signal:o}={}){let a=await this.#o(t,o);return ad(a,{fetchImpl:this.#A,signal:o,allowedHosts:u9})}async#o(t,o){let a=await this.getFile({fileId:t,signal:o}),e=Hg(a?.file_path);if(!e||e.startsWith("/")||e.includes("\\")||e.includes("?")||e.includes("#"))throw new Error("Telegram returned an invalid file path");let i;try{i=e.split("/").map(r=>decodeURIComponent(r))}catch{throw new Error("Telegram returned an invalid file path")}if(i.some(r=>!r||r==="."||r===".."))throw new Error("Telegram returned an invalid file path");let A=new URL(this.#r);return A.pathname=`/file/bot${this.#e}/${e}`,A}async sendMessage({chatId:t,text:o,replyToMessageId:a,messageThreadId:e,signal:i}){return this.#i("sendMessage",{chat_id:t,text:o,link_preview_options:{is_disabled:!0},...a?{reply_parameters:{message_id:a,allow_sending_without_reply:!0}}:{},...e?{message_thread_id:e}:{}},{signal:i})}async setMessageReaction({chatId:t,messageId:o,emoji:a,signal:e,timeoutMs:i}){let A=Hg(a);return this.#i("setMessageReaction",{chat_id:t,message_id:o,reaction:A?[{type:"emoji",emoji:A}]:[]},{signal:e,timeoutMs:i})}async sendRichMessage({chatId:t,richMessage:o,replyToMessageId:a,messageThreadId:e,signal:i}){return this.#i("sendRichMessage",{chat_id:t,rich_message:WG(o),...a?{reply_parameters:{message_id:a,allow_sending_without_reply:!0}}:{},...e?{message_thread_id:e}:{}},{signal:i})}async sendRichMessageDraft({chatId:t,draftId:o,richMessage:a,messageThreadId:e,signal:i}){if(!Number.isSafeInteger(o)||o===0)throw new TypeError("Telegram rich message draft id must be a non-zero integer");return this.#i("sendRichMessageDraft",{chat_id:t,draft_id:o,rich_message:WG(a),...e?{message_thread_id:e}:{}},{signal:i})}async sendDocument({chatId:t,file:o,replyToMessageId:a,messageThreadId:e,signal:i}){return this.#c("sendDocument","document","document",{chatId:t,file:o,replyToMessageId:a,messageThreadId:e,signal:i})}async sendPhoto({chatId:t,file:o,replyToMessageId:a,messageThreadId:e,signal:i}){return this.#c("sendPhoto","photo","photo",{chatId:t,file:o,replyToMessageId:a,messageThreadId:e,signal:i})}async#c(t,o,a,{chatId:e,file:i,replyToMessageId:A,messageThreadId:r,signal:s}){if(!i||typeof i!="object"||typeof i.fileName!="string"||!i.fileName||!Buffer.isBuffer(i.bytes))throw new TypeError(`A Telegram ${a} is required`);let g=new this.#t;if(g.append("chat_id",String(e)),g.append(o,new Blob([i.bytes],{type:i.mediaType??"application/octet-stream"}),i.fileName),A&&g.append("reply_parameters",JSON.stringify({message_id:A,allow_sending_without_reply:!0})),r&&g.append("message_thread_id",String(r)),s?.aborted)throw VG(s);let c=C9(s,this.#I);try{return await this.#i(t,g,{signal:c,timeoutMs:this.#I,multipart:!0})}catch(I){throw s?.aborted?VG(s):I?.deliveryOutcome==="unknown"?B9(I?.cause??I,a):I?.code?.startsWith?.("telegram-")?g2e(I,a):B9(I,a)}}async editMessageText({chatId:t,messageId:o,text:a,richMessage:e,signal:i}){if(a===void 0==(e===void 0))throw new TypeError("Telegram message edit requires exactly one of text or richMessage");return this.#i("editMessageText",{chat_id:t,message_id:o,...a===void 0?{rich_message:WG(e)}:{text:a,link_preview_options:{is_disabled:!0}}},{signal:i})}async sendChatAction({chatId:t,messageThreadId:o,signal:a}){return this.#i("sendChatAction",{chat_id:t,action:"typing",...o?{message_thread_id:o}:{}},{signal:a})}async setMyCommands({commands:t,scope:o,languageCode:a,signal:e}={}){if(!Array.isArray(t)||t.length===0||t.some(i=>!l2e(i)))throw new TypeError("Telegram bot commands are invalid");return this.#i("setMyCommands",{commands:t,...o?{scope:o}:{},...Hg(a)?{language_code:Hg(a)}:{}},{signal:e})}async setChatMenuButton({menuButton:t=ZG,signal:o}={}){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError("Telegram menu button is invalid");return this.#i("setChatMenuButton",{menu_button:t},{signal:o})}async#i(t,o,{signal:a,timeoutMs:e=15e3,multipart:i=!1}={}){if(a?.aborted)throw VG(a);let A=new URL(this.#r);A.pathname=`${A.pathname.replace(/\/$/,"")}/bot${this.#e}/${t}`;let r;try{r=await this.#A(A,{method:"POST",...i?{}:{headers:{"content-type":"application/json"}},body:i?o:JSON.stringify(o),signal:C9(a,e),redirect:"error"})}catch(g){let c=new Error(`Telegram ${t} transport failed`,{cause:g});throw c.code=g?.name==="TimeoutError"?"telegram-timeout":g?.name==="AbortError"?"telegram-aborted-after-dispatch":"telegram-transport-error",c.deliveryOutcome="unknown",c}let s;try{s=await r.json()}catch{let g=new Error(`Telegram ${t} returned invalid JSON`);throw g.status=r?.status,g.code="telegram-response-invalid",g.deliveryOutcome="unknown",g}if(!r.ok||s?.ok!==!0){let g=Hg(s?.description),c=new Error(g??`Telegram ${t} failed`);c.code=Number.isInteger(s?.error_code)?`telegram-${s.error_code}`:"telegram-api-error",c.status=r.status,Number.isInteger(s?.error_code)&&(c.providerCode=s.error_code);let I=Number(s?.parameters?.retry_after);throw Number.isFinite(I)&&I>=0&&(c.retry_after=I,c.retryAfter=I),c}return s.result}};async function Q9(n,t={}){let a=await new cB({token:n,...t}).getMe();if(!a?.id||a?.is_bot!==!0)throw new Error("Telegram token does not belong to a bot");return{platformId:String(a.id),name:Hg([a.first_name,a.last_name].filter(Boolean).join(" "))??w("Telegram\u673A\u5668\u4EBA"),username:Hg(a.username)}}var XG=Object.freeze({key:"telegram",label:"Telegram",connectionLabel:" Bot API \u957F\u8F6E\u8BE2",reactions:Object.freeze({processing:"\u{1F440}",success:"\u{1F44D}",error:"\u{1F44E}"})}),bw=class extends Es{constructor(t){super({descriptor:XG,...t})}};var IB=class extends id{#e;constructor(t){super({...t,descriptor:XG,inspectToken:t.inspectToken??Q9,deriveIdentity:h9,maskPlatformId:E9}),this.#e=t.configStore}status(){let t=super.status();return{...t,bots:t.bots.map(o=>{let a=this.#e.get(o.botId),e=Dw(a??{});return{...o,accessPolicy:e}})}}async setAccessPolicy(t,o){let a=Dw(o);return this.updateBotConfig(t,e=>({...e,...a}))}};import{randomInt as f2e}from"node:crypto";import{EnvHttpProxyAgent as p2e,FormData as d2e,fetch as h2e}from"undici";var E2e=4;function y9(){let n=new p2e({connections:E2e}),t=!1;return{fetchImpl:(o,a={})=>h2e(o,{...a,dispatcher:n}),FormDataImpl:d2e,async destroy(){t||(t=!0,await n.destroy())}}}function eF(n){if(typeof n!="string"||!n.trim())throw new TypeError("Telegram message text must be a non-empty string");return n}function AF(n){return n==="&"?5:n==="<"||n===">"?4:1}function $G(n){return Array.from(n).reduce((t,o)=>t+AF(o),0)}function u2e(n,t,o,a){let e=t+Math.floor(a*.5);for(let i=o-1;i>=e;i-=1)if(n[i]===` +`,{encoding:"utf8",mode:384}),await BLe(A,this.#e),this.#A=i});return this.#t=a.then(()=>{},()=>{}),await a,o}};var wLe="https://slack.com/api/",oB="files.slack.com",DLe="slack.com",WZ="/files-pri/",OLe=Object.freeze([oB]),bLe="/upload/",MLe=12e4;function Ns(n){return typeof n=="string"&&n.trim()?n.trim():null}function ZZ(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}function iB(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function _Le(n,t){if(!Number.isInteger(n)||n<1)throw new TypeError(`${t} must be a positive integer`);return n}function XZ(n,t){return t?.providerCode!==void 0&&(n.providerCode=t.providerCode),Number.isInteger(t?.status)&&(n.status=t.status),n}function kl(n){let t="artifact-provider-failed",o="Slack file upload preparation failed";n?.code==="slack-file_upload_size_restricted"?(t="artifact-too-large",o="Slack rejected the result file because it is too large"):n?.code==="slack-missing-scope"?(t="artifact-permission-required",o="Slack file delivery requires the files:write scope"):n?.code?.startsWith?.("slack-")&&(t="artifact-provider-rejected",o="Slack rejected file upload preparation");let a=new Error(o,{cause:n});return a.code=t,XZ(a,n)}function TLe(n){let t=new Error("Slack file completion result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",XZ(t,n)}function NLe(n){return Number.isInteger(n)&&n>=300&&n<400}async function LG(n){try{await n?.body?.cancel?.()}catch{}}function RLe(n){let t=new URL(n);if(t.protocol!=="https:")throw new Error("Image download URL must use HTTPS");if(t.username||t.password||t.port&&t.port!=="443")throw new Error("Image download URL is not hosted by the messaging platform");if(t.hostname===DLe&&t.pathname.startsWith(WZ)&&(t.hostname=oB),t.hostname!==oB||!t.pathname.startsWith(WZ))throw new Error("Image download URL is not hosted by the messaging platform");return t.hash="",t}function kLe(n){let t=new URL(n);if(t.protocol!=="https:"||t.username||t.password||t.port&&t.port!=="443"||t.hostname!==oB||!t.pathname.startsWith(bLe))throw new Error("Slack returned an unsafe file upload URL");return t.hash="",t}function vLe(n,t){let o=n?.headers?.get?.("location");if(!o)return null;try{return new URL(o,t)}catch{return null}}function PLe(n){let t=n?.headers?.get?.("x-oauth-scopes");return t==null?null:new Set(t.split(",").map(o=>o.trim()).filter(Boolean))}function GLe(n){return n?.protocol==="https:"&&!n.username&&!n.password&&(!n.port||n.port==="443")&&n.hostname.endsWith(".slack.com")&&n.hostname!==oB&&n.pathname==="/"&&n.searchParams.has("redir")}function FLe(n,t){return new Promise((o,a)=>{if(t?.aborted){a(t.reason??new DOMException("Aborted","AbortError"));return}let e=setTimeout(o,n);e?.unref?.(),t?.addEventListener("abort",()=>{clearTimeout(e),a(t.reason??new DOMException("Aborted","AbortError"))},{once:!0})})}function Xo(n,t){let o=Ns(n);if(!o||!/^[A-Z][A-Z0-9]{4,30}$/i.test(o))throw new TypeError(`Invalid Slack ${t}`);return o}function Un(n,t){let o=Ns(n);if(!o)throw new TypeError(`Slack ${t} is required`);return o}function aB(n,{trim:t=!0}={}){let o=typeof n=="string"?n:"",a=t?o.trim():o;if(!a)throw new TypeError("Slack message text is required");return a.replace(/<@([A-Z0-9]+)>/gi,"@$1").replace(/]*)?>/gi,"@$1")}function LLe(n,t,o){let a=Ns(t?.error)??"unknown_error",e=new Error(`Slack ${n} failed: ${a.replaceAll("_"," ")}`);return e.providerCode=a,["invalid_auth","not_authed","token_revoked","account_inactive"].includes(a)?e.code=o==="app"?"slack-invalid-app-token":"slack-invalid-bot-token":a==="missing_scope"?e.code="slack-missing-scope":a==="method_not_supported_for_channel_type"||a==="channel_type_not_supported"||a==="deprecated_endpoint"?e.code="slack-stream-unavailable":e.code=`slack-${a}`,e}function $Z(n){return typeof n=="string"&&/^xoxb-[A-Za-z0-9-]{16,}$/.test(n.trim())}function e9(n){return typeof n=="string"&&/^xapp-[A-Za-z0-9-]{16,}$/.test(n.trim())}var nB=class{#e;#A;#t;#r;#I=null;#o;constructor({botToken:t,appToken:o,fetchImpl:a=fetch,baseUrl:e=wLe,fileUploadTimeoutMs:i=MLe}){if(t!==void 0&&!$Z(t))throw new TypeError("Slack Bot Token is invalid");if(o!==void 0&&!e9(o))throw new TypeError("Slack App Token is invalid");if(!t&&!o)throw new TypeError("SlackApi requires a token");if(typeof a!="function")throw new TypeError("SlackApi requires fetch");this.#e=t?.trim(),this.#A=o?.trim(),this.#t=a,this.#r=new URL(e),this.#o=_Le(i,"fileUploadTimeoutMs")}authTest(t={}){return this.#i("auth.test",{...t,tokenKind:"bot"})}openConnection(t={}){return this.#i("apps.connections.open",{...t,tokenKind:"app",body:void 0})}async fileInfo({fileId:t,signal:o}={}){let a=await this.#i("files.info",{tokenKind:"bot",signal:o,body:{file:Xo(t,"file id")}});if(!a?.file||typeof a.file!="object"||Array.isArray(a.file))throw new Error("Slack files.info returned no file object");return a.file}async getMessage({channelId:t,messageTs:o,signal:a}={}){let e=Un(o,"message timestamp"),i=await this.#i("conversations.history",{tokenKind:"bot",signal:a,body:{channel:Xo(t,"channel id"),oldest:e,latest:e,inclusive:!0,limit:1}});return Array.isArray(i?.messages)?i.messages.find(A=>String(A?.ts??"")===e)??null:null}postMessage({channelId:t,text:o,threadTs:a,signal:e}){return this.#i("chat.postMessage",{tokenKind:"bot",signal:e,body:{channel:Xo(t,"channel id"),text:aB(o),...a?{thread_ts:Ns(a)}:{},mrkdwn:!0,link_names:!1,unfurl_links:!1,unfurl_media:!1}})}updateMessage({channelId:t,ts:o,text:a,signal:e}){return this.#i("chat.update",{tokenKind:"bot",signal:e,body:{channel:Xo(t,"channel id"),ts:Un(o,"message timestamp"),text:aB(a),parse:"none",link_names:!1}})}addReaction({channelId:t,messageTs:o,emojiName:a,signal:e,timeoutMs:i}){return this.#i("reactions.add",{tokenKind:"bot",signal:e,timeoutMs:i,retry:!1,body:{channel:Xo(t,"channel id"),timestamp:Un(o,"message timestamp"),name:Un(a,"reaction name")}})}removeReaction({channelId:t,messageTs:o,emojiName:a,signal:e,timeoutMs:i}){return this.#i("reactions.remove",{tokenKind:"bot",signal:e,timeoutMs:i,retry:!1,body:{channel:Xo(t,"channel id"),timestamp:Un(o,"message timestamp"),name:Un(a,"reaction name")}})}startStream({channelId:t,threadTs:o,recipientTeamId:a,recipientUserId:e,markdownText:i,signal:A}){return this.#i("chat.startStream",{tokenKind:"bot",signal:A,body:{channel:Xo(t,"channel id"),thread_ts:Un(o,"thread timestamp"),...a?{recipient_team_id:Xo(a,"team id")}:{},...e?{recipient_user_id:Xo(e,"user id")}:{},...Ns(i)?{markdown_text:aB(i)}:{}}})}appendStream({channelId:t,ts:o,markdownText:a,signal:e}){return this.#i("chat.appendStream",{tokenKind:"bot",signal:e,body:{channel:Xo(t,"channel id"),ts:Un(o,"stream timestamp"),markdown_text:aB(a,{trim:!1})}})}stopStream({channelId:t,ts:o,markdownText:a,signal:e}){return this.#i("chat.stopStream",{tokenKind:"bot",signal:e,body:{channel:Xo(t,"channel id"),ts:Un(o,"stream timestamp"),...Ns(a)?{markdown_text:aB(a,{trim:!1})}:{}}})}async uploadFile({channelId:t,threadTs:o,file:a,signal:e}){if(!a||typeof a!="object"||typeof a.fileName!="string"||!a.fileName||!Buffer.isBuffer(a.bytes))throw new TypeError("A Slack file is required");if(e?.aborted)throw iB(e);let i=ZZ(e,this.#o),A;try{A=await this.#i("files.getUploadURLExternal",{tokenKind:"bot",signal:i,timeoutMs:this.#o,body:{filename:a.fileName,length:a.bytes.byteLength}})}catch(I){throw e?.aborted?iB(e):kl(I)}let r,s;try{r=Un(A?.file_id,"file id"),s=kLe(A?.upload_url)}catch(I){throw kl(I)}let g;try{g=await this.#t(s,{method:"POST",headers:{"content-type":a.mediaType??"application/octet-stream"},body:a.bytes,signal:i,redirect:"error"})}catch(I){throw e?.aborted?iB(e):kl(I)}if(!Number.isInteger(g?.status))throw kl(new Error("Slack file upload returned an invalid response"));if(g.status!==200){await LG(g);let I=new Error(`Slack file upload failed with HTTP ${g.status}`);throw I.status=g.status,g.status===413?I.code="artifact-too-large":g.status===429?I.code="artifact-rate-limited":I.code="artifact-provider-rejected",I}await LG(g);let c;try{c={files:[{id:r,title:a.fileName}],channel_id:Xo(t,"channel id"),...o?{thread_ts:Un(o,"thread timestamp")}:{}}}catch(I){throw kl(I)}if(i.aborted)throw e?.aborted?iB(e):kl(i.reason);try{let I=await this.#i("files.completeUploadExternal",{tokenKind:"bot",signal:i,timeoutMs:this.#o,retry:!1,body:c});if(!Array.isArray(I?.files)||!I.files.some(p=>Ns(p?.id)===r))throw new Error("Slack file completion did not confirm the uploaded file");return I}catch(I){throw e?.aborted?iB(e):I?.code==="slack-missing-scope"?kl(I):TLe(I)}}async downloadFile({url:t,signal:o,maxBytes:a}){return this.#c({url:t,signal:o,maxBytes:a,stream:!1})}async downloadFileStream({url:t,signal:o}){return this.#c({url:t,signal:o,stream:!0})}async#c({url:t,signal:o,maxBytes:a,stream:e}){if(!this.#e)throw new TypeError("Slack bot token is required for file download");let i=RLe(t),r={fetchImpl:async(s,g)=>{let c=await this.#t(s,g);if(!NLe(c?.status))return c;let I=vLe(c,s);if(this.#I&&!this.#I.has("files:read")||GLe(I))throw await LG(c),new Qt("slack-file-access-required","Slack redirected a private file request to the workspace because file access was not granted",w("Slack \u672A\u6388\u6743\u673A\u5668\u4EBA\u8BFB\u53D6\u8BE5\u6587\u4EF6\u3002\u8BF7\u4E3A\u5E94\u7528\u6DFB\u52A0 files:read \u540E\u91CD\u65B0\u5B89\u88C5\uFF0C\u518D\u91CD\u65B0\u53D1\u9001\u56FE\u7247\u3002"));return c},headers:{authorization:`Bearer ${this.#e}`},signal:o,allowedHosts:OLe};return e?ad(i,r):To(i,{...r,maxBytes:a})}async#i(t,{tokenKind:o,body:a,signal:e,timeoutMs:i=15e3,retry:A=!0}){let r=o==="app"?this.#A:this.#e;if(!r)throw new TypeError(`Slack ${o} token is required for ${t}`);let s=t==="files.getUploadURLExternal"||t==="files.info",g;try{g=await this.#t(new URL(t,this.#r),{method:"POST",headers:{authorization:`Bearer ${r}`,"content-type":a===void 0||s?"application/x-www-form-urlencoded;charset=utf-8":"application/json;charset=utf-8","user-agent":"DeepSeek-Harness-dsh-im (https://github.com/xmanrui/dsh-im, 0.2.2)"},...a===void 0?{}:{body:s?new URLSearchParams(a).toString():JSON.stringify(a)},signal:ZZ(e,i),redirect:"error"})}catch(I){throw I?.name==="AbortError"||I?.name==="TimeoutError"?I:new Error(`Slack ${t} transport failed`)}if(o==="bot"){let I=PLe(g);I&&(this.#I=I)}let c;try{c=await g.json()}catch{throw new Error(`Slack ${t} returned invalid JSON`)}if(g.status===429&&A){let I=Number(g.headers.get("retry-after"))||1;return await FLe(Math.min(1e4,Math.max(100,I*1e3)),e),this.#i(t,{tokenKind:o,body:a,signal:e,timeoutMs:i,retry:!1})}if(!g.ok||c?.ok!==!0){let I=LLe(t,c,o);throw I.status=g.status,I}return c}};async function A9({botToken:n,appToken:t},o={}){if(!$Z(n)){let r=new TypeError(w("Slack Bot Token \u5FC5\u987B\u4EE5 xoxb- \u5F00\u5934\u3002"));throw r.code="slack-invalid-bot-token",r}if(!e9(t)){let r=new TypeError(w("Slack App Token \u5FC5\u987B\u4EE5 xapp- \u5F00\u5934\u3002"));throw r.code="slack-invalid-app-token",r}let a=new nB({botToken:n,appToken:t,...o}),[e,i]=await Promise.all([a.authTest(),a.openConnection()]);if(!e?.team_id||!e?.user_id||!e?.bot_id)throw new Error(w("Slack Bot Token \u6CA1\u6709\u8FD4\u56DE\u5B8C\u6574\u7684\u673A\u5668\u4EBA\u8EAB\u4EFD\u3002"));let A;try{A=new URL(i?.url)}catch{A=null}if(!A||A.protocol!=="wss:"){let r=new Error(w("Slack App Token \u65E0\u6CD5\u521B\u5EFA Socket Mode \u8FDE\u63A5\uFF0C\u8BF7\u786E\u8BA4\u5DF2\u542F\u7528 Socket Mode \u548C connections:write\u3002"));throw r.code="slack-socket-mode",r}return{platformId:`${e.team_id}:${e.user_id}`,name:Ns(e.user)??"DeepSeek Harness",username:Ns(e.user),teamId:String(e.team_id),teamName:Ns(e.team)}}var UG=Object.freeze({key:"slack",label:"Slack",connectionLabel:" Socket Mode \u957F\u8FDE\u63A5",reactions:Object.freeze({processing:"eyes",success:"white_check_mark",error:"x"})}),Bw=class extends Es{constructor(t){super({descriptor:UG,...t})}};function Ug(n){return typeof n=="string"&&n.trim()?n.trim():null}function fw(n,t){return Object.freeze({code:n,message:t})}var sB=class{#e;#A;#t;#r;#I;#o;#c=new Map;#i=new Map;#a=new Map;#s=0;#p=!1;constructor({credentials:t,configStore:o,inspectCredentials:a=A9,createRuntime:e,deleteState:i=async()=>{},logger:A=console}){if(!t||typeof t.resolve!="function"||typeof t.set!="function"||typeof t.unset!="function")throw new TypeError("Slack requires the DSH credential provider");if(!o||typeof o.list!="function"||typeof o.save!="function"||typeof o.remove!="function")throw new TypeError("Slack requires a config store");if(typeof a!="function"||typeof e!="function")throw new TypeError("Slack controller dependencies are incomplete");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A}async initialize(){if(this.#p)return this.status();for(let t of this.#A.list())await this.#d(t.botId,async()=>{if(this.#p||this.#c.get(t.botId)?.status?.ready)return;let o=await this.#n(t);if(!o){this.#i.set(t.botId,fw("missing-token",w("Slack\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u63A5\u5165\u3002")));return}try{await this.#g(t,o),this.#i.delete(t.botId)}catch(a){this.#i.set(t.botId,fw("connection-failed",w("Slack Socket Mode \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#o.warn?.(`[dsh-im:slack] bot ${t.botId} failed to initialize:`,a)}finally{this.#C()}});return this.status()}async bindCredentials({botToken:t,appToken:o}={}){if(this.#p)throw new Error("Slack controller is closed");let a=Ug(t),e=Ug(o);if(!a||!e)throw new TypeError("Slack Bot Token and App Token are required");let i=await this.#t({botToken:a,appToken:e}),A=Ug(i?.platformId),r=Ug(i?.name);if(!A||!r)throw new Error("Slack returned an invalid bot identity");let s=GG(A);return await this.#d(s.botId,async()=>{if(this.#p)throw new Error("Slack controller is closed");let g=this.#A.getByPlatformId(A),c=await this.#e.resolve(s.botTokenRef).catch(()=>{}),I=await this.#e.resolve(s.appTokenRef).catch(()=>{}),p={...s,platformId:A,name:r,username:Ug(i.username),teamId:Ug(i.teamId),teamName:Ug(i.teamName),createdAt:g?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};try{await this.#e.set(s.botTokenRef,a),await this.#e.set(s.appTokenRef,e),await this.#A.save(p)}catch(B){throw await Promise.all([this.#h(s.botTokenRef,c),this.#h(s.appTokenRef,I)]),B}try{await this.#g(p,{botToken:a,appToken:e}),this.#i.delete(s.botId)}catch(B){this.#i.set(s.botId,fw("connection-failed",w("Slack\u673A\u5668\u4EBA\u5DF2\u63A5\u5165\uFF0CSocket Mode \u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:slack] bot ${s.botId} credential connection failed:`,B)}this.#C()}),this.status()}async reconnectBot(t){let o=this.#A.get(t);if(!o)throw new Error("Unknown Slack bot");return await this.#d(t,async()=>{let a=await this.#n(o);if(!a)throw new Error("Slack bot credentials are missing");try{await this.#g(o,a),this.#i.delete(t)}catch(e){throw this.#i.set(t,fw("connection-failed",w("Slack Socket Mode \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u68C0\u67E5\u4E24\u4E2A Token\u3002"))),e}finally{this.#C()}}),this.status()}async sendConnectionTest(t){let o=this.#A.get(t);if(!o)throw new Error("Unknown Slack bot");return this.#d(t,async()=>{let a=this.#c.get(t);if(!a?.status?.ready||typeof a.sendConnectionTest!="function"){let e=new Error(w("Slack\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw e.code="test-target-unavailable",e}return await a.sendConnectionTest(Ui(`${o.name}\uFF08${FG(o.platformId)}\uFF09`,w("Slack\u673A\u5668\u4EBA"))),{sent:!0}})}async sendProactiveText(t,o,a,e={}){if(!this.#A.get(t))throw new Error("Unknown Slack bot");return this.#d(t,async()=>{let A=this.#c.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("Slack\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,a,e)})}async deleteBot(t){let o=this.#A.get(t);if(!o)throw new Error("Unknown Slack bot");return await this.#d(t,async()=>{let a=await this.#e.resolve(o.botTokenRef).catch(()=>{}),e=await this.#e.resolve(o.appTokenRef).catch(()=>{});await this.#l(t);try{await this.#e.unset(o.botTokenRef),await this.#e.unset(o.appTokenRef),await this.#A.remove(t)}catch(i){throw await Promise.all([this.#h(o.botTokenRef,a),this.#h(o.appTokenRef,e)]),a?.value&&e?.value&&await this.#g(o,{botToken:a.value,appToken:e.value}).catch(()=>{}),new Error("Unable to remove the Slack bot safely.",{cause:i})}await this.#I({botId:t,config:o}).catch(i=>{this.#o.warn?.(`[dsh-im:slack] bot ${t} state cleanup failed:`,i)}),this.#i.delete(t),this.#C()}),this.status()}status(){let t=this.#A.list().map(a=>{let e=this.#c.get(a.botId)?.status??null,i=e?.ready===!0&&e.connectionState==="connected"&&e.harnessReachable===!0,A=i?"connected":e?.connectionState==="connecting"?"connecting":this.#i.has(a.botId)||e?.connectionState==="failed"?"error":"offline";return{botId:a.botId,state:A,connected:i,configured:!0,bot:{name:a.name,username:a.username,teamName:a.teamName,idMasked:FG(a.platformId)},health:{status:i?"healthy":A==="error"?"error":"offline",summary:i?w(`Slack${UG.connectionLabel}\u8FD0\u884C\u6B63\u5E38`):A==="error"?w("Slack\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5"):w("Slack\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:e?.lastCheckedAt??null,lastConnectedAt:e?.lastConnectedAt??null},stats:{messagesReceived:e?.messagesReceived??0,messagesReplied:e?.messagesReplied??0},lastMessageError:ti(e?.lastMessageError),error:structuredClone(this.#i.get(a.botId)??null)}}),o=t.filter(a=>a.connected).length;return{schemaVersion:1,revision:this.#s,state:t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o}}}async close(){this.#p||(this.#p=!0,await Promise.allSettled([...this.#a.values()]),await Promise.allSettled([...this.#c.keys()].map(t=>this.#l(t))))}async#g(t,{botToken:o,appToken:a}){if(this.#p)throw new Error("Slack controller is closed");if(await this.#l(t.botId),this.#p)throw new Error("Slack controller is closed");let e=await this.#r({botId:t.botId,config:t,botToken:o,appToken:a});if(!e||typeof e.start!="function"||typeof e.stop!="function")throw new TypeError("createRuntime returned an invalid Slack runtime");this.#c.set(t.botId,e);try{await e.start()}catch(i){throw await e.stop().catch(()=>{}),this.#c.delete(t.botId),i}}async#l(t){let o=this.#c.get(t);this.#c.delete(t),await o?.stop().catch(a=>{this.#o.warn?.(`[dsh-im:slack] bot ${t} failed to stop cleanly:`,a)})}async#n(t){let[o,a]=await Promise.all([this.#e.resolve(t.botTokenRef).catch(()=>{}),this.#e.resolve(t.appTokenRef).catch(()=>{})]),e=Ug(o?.value),i=Ug(a?.value);return e&&i?{botToken:e,appToken:i}:null}async#h(t,o){o?.value?await this.#e.set(t,o.value).catch(()=>{}):await this.#e.unset(t).catch(()=>{})}#d(t,o){let i=(this.#a.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#a.get(t)===i&&this.#a.delete(t)});return this.#a.set(t,i),i}#C(){this.#s+=1}};var Qw=class extends yr{constructor(t){super({...t,rpcIdPrefix:"slack",logPrefix:"dsh-slack"})}};var t9=Object.freeze([1e3,3e3,5e3,1e4,3e4]),KG=38e3,r9=11e3,a9=new Set(["image/jpeg","image/png","image/webp","image/gif"]);function HG(n,t,o){if(typeof n.addEventListener=="function")n.addEventListener(t,o);else if(typeof n.on=="function")n.on(t,o);else throw new TypeError("Slack WebSocket does not support events")}function ULe(n){let t=n?.data??n;return typeof t=="string"?t:Buffer.isBuffer(t)?t.toString("utf8"):t instanceof ArrayBuffer?Buffer.from(t).toString("utf8"):ArrayBuffer.isView(t)?Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):null}function HLe(n){let t=new URL(n);if(t.protocol!=="wss:")throw new Error("Slack returned an insecure Socket Mode URL");return t.href}function o9(n){return typeof n=="string"?n.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">"):""}function KLe(n,t){return o9(n).replace(new RegExp(`<@${t}>`,"gi"),"").trim()}function xG(n){return typeof n?.url_private_download=="string"&&n.url_private_download?n.url_private_download:n?.url_private}function xLe(n){if(!n||typeof n!="object")return null;let t=typeof n.mimetype=="string"?n.mimetype.toLowerCase():"",o=t.startsWith("image/")?"image":t.startsWith("audio/")?"audio":t.startsWith("video/")?"video":"file",a=typeof n.name=="string"&&n.name?n.name:typeof n.title=="string"&&n.title?n.title:void 0;return{kind:o,...a?{name:a}:{}}}function YLe(n,t){if(!n||String(n.ts??"")!==t)return null;let o=typeof n.user=="string"&&n.user?n.user:typeof n.bot_id=="string"&&n.bot_id?n.bot_id:void 0,a=typeof n.username=="string"&&n.username?n.username:void 0;return{messageId:t,...o?{authorId:o}:{},...a?{authorName:a}:{},content:o9(n.text??""),attachments:Array.isArray(n.files)?n.files.map(xLe).filter(Boolean):[]}}function jLe(n,t){let o=typeof n?.thread_ts=="string"?n.thread_ts:"";if(!(!o||o===String(n?.ts??"")))return{messageId:o,load:async({signal:a}={})=>{try{let e=await t({channelId:String(n.channel),messageTs:o,signal:a});return YLe(e,o)}catch(e){if(e?.code==="slack-missing-scope")return{messageId:o,unavailableReason:"permission-denied"};throw e}}}}function JLe(n,t){let o=typeof n?.mimetype=="string"?n.mimetype.toLowerCase():"",a=xG(n);return!a9.has(o)||typeof a!="string"||!a?null:{name:typeof n.name=="string"?n.name:void 0,mediaType:o,size:Number.isSafeInteger(n.size)&&n.size>=0?n.size:void 0,load:e=>t(a,e)}}function qLe(n,t,o){let a=typeof n?.mimetype=="string"&&n.mimetype?n.mimetype.toLowerCase():void 0,e=xG(n);if(a9.has(a))return null;let i=n?.file_access==="check_file_info"&&typeof n?.id=="string"&&n.id;return(typeof e!="string"||!e)&&!i?null:{name:typeof n?.name=="string"&&n.name?n.name:typeof n?.title=="string"&&n.title?n.title:i?n.id:"slack-file",...a?{mediaType:a}:{},size:Number.isSafeInteger(n?.size)&&n.size>=0?n.size:void 0,load:async({signal:A}={})=>{if(!i)return t(e,{signal:A});let r=await o(n.id,{signal:A}),s=xG(r);if(typeof s!="string"||!s)throw new Error("Slack files.info returned no downloadable URL");let g=await t(s,{signal:A}),c=typeof r?.name=="string"&&r.name?r.name:typeof r?.title=="string"&&r.title?r.title:n.id,I=typeof r?.mimetype=="string"&&r.mimetype?r.mimetype.toLowerCase():void 0;return Buffer.isBuffer(g)||g instanceof Uint8Array?{data:g,name:c,...I?{mediaType:I}:{}}:{...g,name:c,...I?{mediaType:I}:{}}}}}function zLe(n,t,{loadFile:o=async()=>{throw new Error("Slack file downloader is unavailable")},loadFileStream:a=o,loadFileInfo:e=async()=>{throw new Error("Slack file metadata loader is unavailable")},loadReply:i=async()=>{throw new Error("Slack reply loader is unavailable")}}={}){let A=n?.event;if(!A||!n?.event_id||!A.channel||!A.user||!A.ts)return null;let r=A.type==="message"&&A.channel_type==="im",s=A.type==="app_mention";if(!r&&!s||A.subtype&&A.subtype!=="file_share"||A.bot_id||A.app_id)return null;let g=String(A.thread_ts??A.ts),c=jLe(A,i);return{messageId:String(n.event_id),senderId:String(A.user),senderIsBot:String(A.user)===String(t),kind:r?"direct":"group",conversationId:r?String(A.channel):`${A.channel}:${g}`,contextSource:()=>({chatId:String(A.channel),threadId:A.thread_ts?String(A.thread_ts):void 0}),content:KLe(A.text??"",t),plainText:!Array.isArray(A.files)||A.files.length===0,images:Array.isArray(A.files)?A.files.map(I=>JLe(I,o)).filter(Boolean):[],files:Array.isArray(A.files)?A.files.map(I=>qLe(I,a,e)).filter(Boolean):[],...c?{replyTo:c}:{},addressed:r||s,reactionTarget:{channelId:String(A.channel),messageTs:String(A.ts)},replyTarget:{channelId:String(A.channel),threadTs:g,recipientUserId:String(A.user),recipientTeamId:String(A.user_team??n.team_id??"")},connectionTestTarget:{channelId:String(A.channel)}}}function VLe(n){if(typeof n!="string")return!1;let t="__DSH_IM_TOOL_NAME__",o=w("\u6B63\u5728\u4F7F\u7528{name}\u2026",{name:t}),a=o.indexOf(t);if(a<0)return!1;let e=o.slice(0,a),i=o.slice(a+t.length),A=n.trim();return A.startsWith(e)&&A.endsWith(i)&&A.length>e.length+i.length}async function i9(n,t,o,a,e){if(a)for(let i=0;i{let y=us(Q,KG)[0]??"";if(!y||!y.startsWith(A))return;let m=y.slice(A.length);m&&(await i9(n,t,i,m,o),A=y)},f=()=>{I||c||s!==null||g||!r||(s=setTimeout(()=>{s=null;let Q=r;r="",g=B(Q).catch(y=>{c=!0,a.warn?.("[dsh-im:slack] streaming append failed:",y)}).finally(()=>{g=null,f()})},350),s?.unref?.())};return{messageId:i,get providerMessageIds(){return[...p]},update(Q){I||c||typeof Q!="string"||!Q.trim()||VLe(Q)||(r=Q,f())},async finish(Q){if(I)throw new Error("Slack message stream is already closed");I=!0,s!==null&&clearTimeout(s),s=null,r="",await g?.catch(()=>{});let y=us(Q,KG),m=y[0]??w("\u5904\u7406\u5B8C\u6210\u3002");!c&&m.startsWith(A)?(await i9(n,t,i,m.slice(A.length),o),await n.stopStream({channelId:t.channelId,ts:i,signal:o})):(await n.stopStream({channelId:t.channelId,ts:i,signal:o}).catch(()=>{}),await n.updateMessage({channelId:t.channelId,ts:i,text:m,signal:o}));for(let T of y.slice(1)){let _=await n.postMessage({channelId:t.channelId,threadTs:t.threadTs,text:T,signal:o});typeof _?.ts=="string"&&_.ts&&p.push(_.ts)}},cancel(){I=!0,r="",s!==null&&clearTimeout(s),s=null,n.stopStream({channelId:t.channelId,ts:i,signal:o}).catch(()=>{})}}}var YG=class{#e;#A;#t;constructor({api:t,signal:o,logger:a}){this.#e=t,this.#A=o,this.#t=a}async sendText(t,o){let a=us(o,KG),e=[];for(let i of a){let A=await this.#e.postMessage({channelId:t.channelId,threadTs:t.threadTs,text:i,signal:this.#A});typeof A?.ts=="string"&&A.ts&&e.push(A.ts)}return{providerMessageIds:e}}async addReaction(t,o,{signal:a}={}){let e=String(o??"").trim();return await this.#e.addReaction({channelId:t.channelId,messageTs:t.messageTs,emojiName:e,signal:a??this.#A}),e}removeReaction(t,o,{signal:a}={}){return this.#e.removeReaction({channelId:t.channelId,messageTs:t.messageTs,emojiName:o,signal:a??this.#A})}openStream(t){return WLe({api:this.#e,target:t,signal:this.#A,logger:this.#t})}sendFile(t,o){return this.#e.uploadFile({channelId:t.channelId,threadTs:t.threadTs,file:o,signal:this.#A})}};function ZLe(){return{startedAt:null,ready:!1,connectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...co()}}var gB=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g;#l;#n=ZLe();#h=null;#d=null;#C=null;#u=null;#B=null;#f=null;#m=0;#w=0;#Q=!0;#y=null;constructor({config:t,botToken:o,appToken:a,harness:e,state:i,contextEnhancement:A,accessPolicy:r,groupSessionScope:s,logger:g=console,replyTimeoutMs:c=6e5,connectTimeoutMs:I=2e4,createApi:p=f=>new nB(f),createWebSocket:B=f=>new WebSocket(f)}){if(!t||!o||!a||!e||!i)throw new TypeError("SlackRuntime requires config, both tokens, Harness, and state");if(typeof B!="function")throw new TypeError("SlackRuntime requires WebSocket");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g,this.#s=c,this.#p=I,this.#g=p,this.#l=B}get status(){return structuredClone(this.#n)}async sendConnectionTest(t){if(!this.#n.ready||!this.#d){let o=new Error("Slack bot is not connected");throw o.code="test-target-unavailable",o}return this.#d.sendConnectionTest(t)}async sendProactiveText(t,o,a={}){if(!this.#n.ready||!this.#d){let A=new Error("Slack bot is not connected");throw A.code="bot-not-connected",A}let e=typeof t?.route?.channelId=="string"?t.route.channelId.trim():"",i=typeof t?.route?.threadTs=="string"?t.route.threadTs.trim():"";if(!e||t?.kind!=="conversation"&&t?.kind!=="thread"||t.kind==="thread"&&!i||t.kind==="conversation"&&i){let A=new TypeError("Invalid Slack proactive delivery target");throw A.code="invalid-target",A}return this.#d.sendProactiveText({channelId:e,...i?{threadTs:i}:{}},o,a)}async start(){return this.#n.ready&&this.#u?this.status:this.#y?this.#y:(this.#y=this.#b().finally(()=>{this.#y=null}),this.#y)}async#b(){await this.stop(),this.#Q=!1,this.#m=0,this.#n.startedAt=new Date().toISOString(),this.#n.connectionState="connecting",this.#n.lastError=null,await this.#r.ensureRunning(),this.#n.harnessReachable=!0;let t=new AbortController;this.#C=t;let o=this.#g({botToken:this.#A,appToken:this.#t});this.#h=o;try{let a=await o.authTest({signal:t.signal});if(`${a?.team_id}:${a?.user_id}`!==this.#e.platformId)throw new Error("Slack Bot Token identity does not match the saved bot");let e=new YG({api:o,signal:t.signal,logger:this.#a});this.#d=new Bw({bot:e,harness:this.#r,state:this.#I,contextEnhancement:this.#o,accessPolicy:this.#c,groupSessionScope:this.#i,status:this.#n,logger:this.#a,replyTimeoutMs:this.#s,signal:t.signal});let i;try{await Promise.race([this.#E(),new Promise((A,r)=>{i=setTimeout(()=>r(new Error("Slack Socket Mode did not become ready in time")),this.#p),i?.unref?.()})])}finally{clearTimeout(i)}return this.status}catch(a){throw this.#n.ready=!1,this.#n.connectionState="failed",this.#n.lastError=a?.message??String(a),await this.stop(),a}}async#E(){if(this.#Q)throw new Error("Slack runtime is stopped");let t=await this.#h.openConnection({signal:this.#C?.signal});return this.#k(t?.url)}#k(t){if(this.#Q)return Promise.reject(new Error("Slack runtime is stopped"));let o=++this.#w,a=this.#l(HLe(t));this.#u=a;let e=!1;return new Promise((i,A)=>{let r=s=>{if(e||o!==this.#w)return;e=!0,this.#B=s?.connection_info?.app_id??null,this.#m=0;let g=Date.now();this.#n.ready=!0,this.#n.connectionState="connected",this.#n.lastCheckedAt=g,this.#n.lastConnectedAt=g,this.#n.lastError=null,i()};HG(a,"message",s=>{if(o!==this.#w||this.#Q)return;let g=ULe(s);if(!g)return;let c;try{c=JSON.parse(g)}catch{this.#a.warn?.("[dsh-im:slack] ignored malformed Socket Mode JSON");return}if(c.type==="hello"){r(c);return}if(c.envelope_id&&a.readyState===1&&(a.send(JSON.stringify({envelope_id:c.envelope_id})),this.#n.lastCheckedAt=Date.now()),c.type==="disconnect"){a.close(4e3,"Slack requested reconnect");return}if(c.type!=="events_api"||c.payload?.type!=="event_callback"||this.#B&&c.payload.api_app_id&&c.payload.api_app_id!==this.#B)return;let I=zLe(c.payload,this.#e.platformId.split(":")[1],{loadFile:(B,f)=>this.#h.downloadFile({url:B,...f}),loadFileStream:(B,f)=>this.#h.downloadFileStream({url:B,...f}),loadFileInfo:(B,f)=>this.#h.fileInfo({fileId:B,...f}),loadReply:B=>this.#h.getMessage(B)}),p=this.#d;I&&p&&p.accept(I).catch(B=>{o!==this.#w||this.#Q||this.#a.error?.(`[dsh-im:slack] bot ${this.#e.botId} message handling failed:`,B)})}),HG(a,"close",(s={})=>{if(o!==this.#w)return;if(this.#u===a&&(this.#u=null),this.#Q){e||A(new DOMException("Stopped","AbortError"));return}let g=Number(s.code)||0,c=new Error(`Slack Socket Mode closed (${g||"unknown"})`);this.#n.ready=!1,this.#n.connectionState="connecting",this.#n.lastError=c.message,e||(e=!0,A(c)),this.#M()}),HG(a,"error",()=>{o!==this.#w||this.#Q||(this.#n.lastError="Slack Socket Mode WebSocket error")})})}#M(){if(this.#Q||this.#f!==null)return;let t=t9[Math.min(this.#m,t9.length-1)];this.#m+=1,this.#f=setTimeout(()=>{this.#f=null,this.#E().catch(o=>{this.#Q||(this.#a.warn?.("[dsh-im:slack] Socket Mode reconnect failed:",o),this.#M())})},t),this.#f?.unref?.()}async stop(){this.#Q=!0,this.#w+=1,this.#C?.abort(),this.#C=null,this.#f!==null&&clearTimeout(this.#f),this.#f=null;let t=this.#u,o=this.#d;this.#u=null,this.#d=null,this.#h=null,this.#B=null;try{t&&t.readyState<2&&t.close(1e3,"Plugin stopped")}catch(a){this.#a.warn?.(`[dsh-im:slack] bot ${this.#e.botId} failed to close Socket Mode:`,a)}return await Promise.race([o?.waitForIdle()??Promise.resolve(),new Promise(a=>setTimeout(a,2e3))]),this.#n.ready=!1,this.#n.connectionState="idle",this.status}};var yw=class extends Cs{};async function jG(n,t={},o={}){if(!n?.credentials)throw new TypeError("dsh-im slack requires ctx.credentials");let a=si(n,t),e=o.ConfigStore??Cw,i=o.StateStore??yw,A=o.HarnessClient??Qw,r=o.Controller??sB,s=o.Runtime??gB,g=o.createConnectionSupervisor??od,c=typeof n.logger=="function"?n.logger("dsh-im:slack"):n.logger??console,I=()=>xi(n),p=RT(t,"slack"),B=await new e(p.config).load(),f=n9(t.workspace??process.cwd()),Q=o.WorkspaceStore??ni,y=o.workspaces??await new Q(p.workspaces,{defaultWorkspace:f}).load(),m=B.list();await y.reconcile(m.map(N=>N.botId)),await Promise.all(m.map(N=>y.ensure(N.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("slack",N)})));let T=typeof B.remove=="function"?Yi(B,{workspaces:y}):B,_=new Map,R=N=>n9(p.bots,N,"state.json"),L=async N=>{let k=_.get(N);return k||(k=await new i(R(N)).load(),_.set(N,k)),k},U=zi(n,o.commandExecutor),{controlExecutor:F,sessionMaintenanceExecutor:q,fileIngressExecutor:z}=Vi(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),K=new A({...a,workspace:f,autostart:!1,dshBin:t.dshBin??"dsh",...U?{commandExecutor:U}:{},...F?{controlExecutor:F}:{},...q?{sessionMaintenanceExecutor:q}:{},...z?{fileIngressExecutor:z}:{}}),G=new r({credentials:n.credentials,configStore:T,logger:c,...o.inspectCredentials?{inspectCredentials:o.inspectCredentials}:{},createRuntime:async({botId:N,config:k,botToken:J,appToken:X})=>{let ie=await L(N);await y.ensure(N,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("slack",k)});let De=ji(K,{botId:N,workspaces:y,state:ie,agentPresetCatalog:I});return new s({config:k,botToken:J,appToken:X,harness:De.harness,state:De.state,contextEnhancement:{botId:N,getSettings:()=>y.contextEnhancementFor(N)},accessPolicy:Wi(y,N,{channel:"slack",config:k}),groupSessionScope:{getScope:()=>y.groupSessionScopeFor(N)},replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??2e4,logger:{error:(...oe)=>c.error?.(`[${N}]`,...oe),warn:(...oe)=>c.warn?.(`[${N}]`,...oe),info:(...oe)=>c.info?.(`[${N}]`,...oe),debug:(...oe)=>c.debug?.(`[${N}]`,...oe)}})},deleteState:async({botId:N})=>{let k=_.get(N);if(_.delete(N),k&&typeof k.remove=="function")await k.remove();else try{await XLe(R(N))}catch(J){if(J?.code!=="ENOENT")throw J}}}),V=Ji(G,{workspaces:y,stateFor:L,agentPresetCatalog:I}),H=g({channel:"slack",controller:V,harness:K,logger:c,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:V,deliveryAdapter:qi({channel:"slack",workspaces:y,coreController:G,stateFor:L}),ready:H.ready,async close(){await H.close(),await V.close(),K.stopManagedProcess()}}}var g9="/slack",jr=Object.freeze({status:"connection.status",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:La,setAgentPreset:Ua,setContextEnhancement:Fa,setAccessPolicy:Xi,setGroupSessionScope:ea}),c9=Object.freeze(Object.values(jr)),$Le=new Set(["token","botToken","appToken","botTokenRef","appTokenRef","tokenRef","platformId","secret","secretRef"]);function qG(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function mw(n,t){return qG(n)&&Object.keys(n).every(o=>t.includes(o))}function s9(n){return typeof n=="string"&&/^slack_[a-f0-9]{24}$/.test(n)}function e2e(n){return typeof n=="string"&&/^xoxb-[A-Za-z0-9-]{16,}$/.test(n.trim())&&n.length<=4096}function A2e(n){return typeof n=="string"&&/^xapp-[A-Za-z0-9-]{16,}$/.test(n.trim())&&n.length<=4096}function t2e(n,t){return qG(t)?n===jr.status?mw(t,[])?null:"connection.status does not accept fields.":n===jr.bindCredentials?mw(t,["botToken","appToken"])&&e2e(t.botToken)&&A2e(t.appToken)?null:"bot.bind-credentials requires xoxb Bot Token and xapp App Token.":n===jr.reconnectBot?mw(t,["botId","sendTest"])&&s9(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"bot.reconnect requires a botId.":n===jr.deleteBot?mw(t,["botId","confirm"])&&s9(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===jr.setWorkspace?ta(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===jr.setAgentPreset?ia(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===jr.setContextEnhancement?Zi(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===jr.setAccessPolicy?$i(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===jr.setGroupSessionScope?Aa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u7FA4\u4F1A\u8BDD\u7B56\u7565\u3002":"Unknown Slack endpoint.":"Payload must be an object."}function JG(n){if(Array.isArray(n))return n.map(JG);if(!qG(n))return n;let t={};for(let[o,a]of Object.entries(n))$Le.has(o)||(t[o]=JG(a));return t}function r2e(n){let t=ra(n);return t||(n?.code==="slack-invalid-bot-token"?{code:"invalid-bot-token",message:"Slack Bot Token \u65E0\u6548\uFF0C\u8BF7\u786E\u8BA4\u4F7F\u7528\u4EE5 xoxb- \u5F00\u5934\u7684\u4EE4\u724C\u3002"}:n?.code==="slack-invalid-app-token"?{code:"invalid-app-token",message:"Slack App Token \u65E0\u6548\uFF0C\u8BF7\u786E\u8BA4\u4F7F\u7528\u4EE5 xapp- \u5F00\u5934\u7684\u4EE4\u724C\u3002"}:n?.code==="slack-missing-scope"?{code:"missing-scope",message:"Slack \u5E94\u7528\u6743\u9650\u4E0D\u5B8C\u6574\uFF0C\u8BF7\u91CD\u65B0\u5BFC\u5165 Manifest \u5E76\u5B89\u88C5\u5230\u5DE5\u4F5C\u533A\u3002"}:n?.code==="slack-socket-mode"?{code:"socket-mode-unavailable",message:n.message}:{code:"slack-operation-failed",message:"Slack \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"})}function I9(n){for(let t of["status","bindCredentials","reconnectBot","deleteBot"])if(typeof n?.[t]!="function")throw new TypeError(`A complete Slack controller is required (${t})`);return async(t,o,a)=>{if(a?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!c9.includes(t))return{ok:!1,error:{code:"bad-request",message:"Unknown Slack endpoint."}};let e=t2e(t,o);if(e)return{ok:!1,error:{code:"bad-request",message:e}};try{let i;if(t===jr.status)i=await n.status();else if(t===jr.bindCredentials)i=await n.bindCredentials(o);else if(t===jr.reconnectBot){if(i=await n.reconnectBot(o.botId),a?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(o.sendTest===!0){let A=null;try{if(i?.bots?.find(r=>r?.botId===o.botId)?.connected!==!0){let r=new Error("Bot is not connected");throw r.code="test-target-unavailable",r}if(typeof n.sendConnectionTest!="function"){let r=new Error("Connection test is unavailable");throw r.code="test-target-unavailable",r}await n.sendConnectionTest(o.botId)}catch(r){A=r}i={...i,testMessage:lr(A)}}}else if(t===jr.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");i=await n.updateWorkspace(o.botId,o.workspace)}else if(t===jr.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");i=await n.updateContextEnhancement(o.botId,o.config)}else if(t===jr.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");i=await n.updateAccessPolicy(o.botId,o.policy)}else if(t===jr.setGroupSessionScope){if(typeof n.updateGroupSessionScope!="function")throw new Error("Group session scope update is unavailable");i=await n.updateGroupSessionScope(o.botId,o.groupSessionScope)}else if(t===jr.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");i=await n.updateAgentPreset(o.botId,o.agentPreset)}else i=await n.deleteBot(o.botId);return a?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:JG(i)}}catch(i){return a?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:r2e(i)}}}}function Sw(n,t,o){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(g9,I9(t),{authority:mr(o)})}async function l9(n,t={}){if(t?.controller)return Sw(n,t.controller,t.rpcAuthority);let o=await jG(n,t,t.internals??{}),a=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=Sw(n,o.controller,t.rpcAuthority);return n.effect(()=>async()=>{await a?.(),await o.close()},"dsh-im: close Slack bot connections"),e}var p9=Object.freeze({botPrefix:"telegram",tokenRefPrefix:"DSH_TELEGRAM_BOT_TOKEN"}),zG=Object.freeze({compatible:"compatible",privateAllowlist:"private-allowlist"}),i2e=/^[1-9]\d{0,15}$/;function d9(n){if(n===void 0)return Object.freeze([]);if(!Array.isArray(n))throw new TypeError("allowedUsers must be an array of numeric Telegram User IDs");let t=n.map(o=>{let a=typeof o=="number"&&Number.isSafeInteger(o)?String(o):typeof o=="string"?o.trim():"";if(!i2e.test(a))throw new TypeError("allowedUsers contains an invalid Telegram User ID");return a});return Object.freeze([...new Set(t)])}function Dw(n={}){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("Telegram access policy must be an object");let t=n.accessMode??zG.compatible;if(!Object.values(zG).includes(t))throw new TypeError("Telegram accessMode must be compatible or private-allowlist");return Object.freeze({accessMode:t,allowedUsers:d9(n.allowedUsers)})}function a2e(n){let t=Object.hasOwn(n,"accessMode"),o=Object.hasOwn(n,"allowedUsers");if(!t&&!o)return{};try{let a=Dw(n);return{...t?{accessMode:a.accessMode}:{},...o||t?{allowedUsers:a.allowedUsers}:{}}}catch{return null}}function h9(n){return hu(n,p9)}function E9(n){return py(n,w("Telegram\u673A\u5668\u4EBA"))}var ww=class extends rd{constructor(t){super(t,{channel:"Telegram",...p9,normalizeBotExtension:a2e})}async save(t){let o=t?.platformId?this.getByPlatformId(String(t.platformId)):null;return super.save({...o,...t})}};var Ow=class extends yr{constructor(t){super({...t,rpcIdPrefix:"telegram",logPrefix:"dsh-telegram"})}};var o2e="https://api.telegram.org/",u9=Object.freeze(["api.telegram.org"]),n2e=12e4;function Hg(n){return typeof n=="string"&&n.trim()?n.trim():null}function C9(n,t){let o=AbortSignal.timeout(t);return n?AbortSignal.any([n,o]):o}function VG(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function s2e(n,t){if(!Number.isInteger(n)||n<1)throw new TypeError(`${t} must be a positive integer`);return n}function f9(n,t){return t?.providerCode!==void 0&&(n.providerCode=t.providerCode),t?.retry_after!==void 0&&(n.retry_after=t.retry_after,n.retryAfter=t.retry_after),Number.isInteger(t?.status)&&(n.status=t.status),n}function WG(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("A Telegram rich message is required");let t=["markdown","html","blocks"].filter(a=>n[a]!==void 0);if(t.length!==1)throw new TypeError("A Telegram rich message requires exactly one format");let o=t[0];if((o==="markdown"||o==="html")&&(typeof n[o]!="string"||!n[o].trim()))throw new TypeError("Telegram rich message text is invalid");if(o==="blocks"&&!Array.isArray(n.blocks))throw new TypeError("Telegram rich message blocks are invalid");return n}function g2e(n,t="document"){let o=Number(n?.providerCode),a=Number(n?.status),e=Hg(n?.message)??"",i="artifact-provider-rejected",A=`Telegram rejected the ${t}.`;o===401||o===403||a===401||a===403?(i="artifact-permission-required",A=`Telegram denied permission to send the ${t}.`):o===413||a===413||/(?:file|request|entity).{0,20}(?:too (?:big|large)|size limit)|too (?:big|large)/i.test(e)?(i="artifact-too-large",A=`The ${t} exceeds Telegram's size limit.`):o===429||a===429?(i="artifact-rate-limited",A=`Telegram rate-limited ${t} delivery.`):(o>=500||a>=500)&&(i="artifact-delivery-uncertain",A=`Telegram ${t} delivery result is uncertain.`);let r=new Error(A,{cause:n});return r.code=i,f9(r,n)}function B9(n,t="document"){let o=new Error(`Telegram ${t} delivery result is uncertain`,{cause:n});return o.code="artifact-delivery-uncertain",f9(o,n)}function c2e(n){return typeof n=="string"&&/^\d{5,20}:[A-Za-z0-9_-]{20,}$/.test(n.trim())}var I2e=/^[a-z0-9_]{1,32}$/;function l2e(n){return!!n&&typeof n=="object"&&!Array.isArray(n)&&typeof n.command=="string"&&I2e.test(n.command)&&typeof n.description=="string"&&n.description.length>=1&&n.description.length<=256}var ZG=Object.freeze({type:"commands"}),cB=class{#e;#A;#t;#r;#I;constructor({token:t,fetchImpl:o=fetch,FormDataImpl:a=globalThis.FormData,baseUrl:e=o2e,fileUploadTimeoutMs:i=n2e}){if(!c2e(t))throw new TypeError("Telegram Bot Token is invalid");if(typeof o!="function")throw new TypeError("TelegramApi requires fetch");if(typeof a!="function")throw new TypeError("TelegramApi requires FormData");this.#e=t.trim(),this.#A=o,this.#t=a,this.#r=new URL(e),this.#I=s2e(i,"fileUploadTimeoutMs")}async getMe(t={}){return this.#i("getMe",{},t)}async getWebhookInfo(t={}){return this.#i("getWebhookInfo",{},t)}async getUpdates({offset:t,timeout:o=25,signal:a}={}){let e={timeout:o,limit:100,allowed_updates:["message"],...Number.isSafeInteger(t)?{offset:t}:{}};return this.#i("getUpdates",e,{signal:a,timeoutMs:Math.max(1e4,(o+10)*1e3)})}async getFile({fileId:t,signal:o}={}){let a=Hg(t);if(!a||!/^[A-Za-z0-9_-]{1,512}$/.test(a))throw new TypeError("Telegram file id is invalid");return this.#i("getFile",{file_id:a},{signal:o})}async downloadFile({fileId:t,signal:o,maxBytes:a}={}){let e=await this.#o(t,o);return To(e,{fetchImpl:this.#A,signal:o,maxBytes:a,allowedHosts:u9})}async downloadFileStream({fileId:t,signal:o}={}){let a=await this.#o(t,o);return ad(a,{fetchImpl:this.#A,signal:o,allowedHosts:u9})}async#o(t,o){let a=await this.getFile({fileId:t,signal:o}),e=Hg(a?.file_path);if(!e||e.startsWith("/")||e.includes("\\")||e.includes("?")||e.includes("#"))throw new Error("Telegram returned an invalid file path");let i;try{i=e.split("/").map(r=>decodeURIComponent(r))}catch{throw new Error("Telegram returned an invalid file path")}if(i.some(r=>!r||r==="."||r===".."))throw new Error("Telegram returned an invalid file path");let A=new URL(this.#r);return A.pathname=`/file/bot${this.#e}/${e}`,A}async sendMessage({chatId:t,text:o,replyToMessageId:a,messageThreadId:e,signal:i}){return this.#i("sendMessage",{chat_id:t,text:o,link_preview_options:{is_disabled:!0},...a?{reply_parameters:{message_id:a,allow_sending_without_reply:!0}}:{},...e?{message_thread_id:e}:{}},{signal:i})}async setMessageReaction({chatId:t,messageId:o,emoji:a,signal:e,timeoutMs:i}){let A=Hg(a);return this.#i("setMessageReaction",{chat_id:t,message_id:o,reaction:A?[{type:"emoji",emoji:A}]:[]},{signal:e,timeoutMs:i})}async sendRichMessage({chatId:t,richMessage:o,replyToMessageId:a,messageThreadId:e,signal:i}){return this.#i("sendRichMessage",{chat_id:t,rich_message:WG(o),...a?{reply_parameters:{message_id:a,allow_sending_without_reply:!0}}:{},...e?{message_thread_id:e}:{}},{signal:i})}async sendRichMessageDraft({chatId:t,draftId:o,richMessage:a,messageThreadId:e,signal:i}){if(!Number.isSafeInteger(o)||o===0)throw new TypeError("Telegram rich message draft id must be a non-zero integer");return this.#i("sendRichMessageDraft",{chat_id:t,draft_id:o,rich_message:WG(a),...e?{message_thread_id:e}:{}},{signal:i})}async sendDocument({chatId:t,file:o,replyToMessageId:a,messageThreadId:e,signal:i}){return this.#c("sendDocument","document","document",{chatId:t,file:o,replyToMessageId:a,messageThreadId:e,signal:i})}async sendPhoto({chatId:t,file:o,replyToMessageId:a,messageThreadId:e,signal:i}){return this.#c("sendPhoto","photo","photo",{chatId:t,file:o,replyToMessageId:a,messageThreadId:e,signal:i})}async#c(t,o,a,{chatId:e,file:i,replyToMessageId:A,messageThreadId:r,signal:s}){if(!i||typeof i!="object"||typeof i.fileName!="string"||!i.fileName||!Buffer.isBuffer(i.bytes))throw new TypeError(`A Telegram ${a} is required`);let g=new this.#t;if(g.append("chat_id",String(e)),g.append(o,new Blob([i.bytes],{type:i.mediaType??"application/octet-stream"}),i.fileName),A&&g.append("reply_parameters",JSON.stringify({message_id:A,allow_sending_without_reply:!0})),r&&g.append("message_thread_id",String(r)),s?.aborted)throw VG(s);let c=C9(s,this.#I);try{return await this.#i(t,g,{signal:c,timeoutMs:this.#I,multipart:!0})}catch(I){throw s?.aborted?VG(s):I?.deliveryOutcome==="unknown"?B9(I?.cause??I,a):I?.code?.startsWith?.("telegram-")?g2e(I,a):B9(I,a)}}async editMessageText({chatId:t,messageId:o,text:a,richMessage:e,signal:i}){if(a===void 0==(e===void 0))throw new TypeError("Telegram message edit requires exactly one of text or richMessage");return this.#i("editMessageText",{chat_id:t,message_id:o,...a===void 0?{rich_message:WG(e)}:{text:a,link_preview_options:{is_disabled:!0}}},{signal:i})}async sendChatAction({chatId:t,messageThreadId:o,signal:a}){return this.#i("sendChatAction",{chat_id:t,action:"typing",...o?{message_thread_id:o}:{}},{signal:a})}async setMyCommands({commands:t,scope:o,languageCode:a,signal:e}={}){if(!Array.isArray(t)||t.length===0||t.some(i=>!l2e(i)))throw new TypeError("Telegram bot commands are invalid");return this.#i("setMyCommands",{commands:t,...o?{scope:o}:{},...Hg(a)?{language_code:Hg(a)}:{}},{signal:e})}async setChatMenuButton({menuButton:t=ZG,signal:o}={}){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError("Telegram menu button is invalid");return this.#i("setChatMenuButton",{menu_button:t},{signal:o})}async#i(t,o,{signal:a,timeoutMs:e=15e3,multipart:i=!1}={}){if(a?.aborted)throw VG(a);let A=new URL(this.#r);A.pathname=`${A.pathname.replace(/\/$/,"")}/bot${this.#e}/${t}`;let r;try{r=await this.#A(A,{method:"POST",...i?{}:{headers:{"content-type":"application/json"}},body:i?o:JSON.stringify(o),signal:C9(a,e),redirect:"error"})}catch(g){let c=new Error(`Telegram ${t} transport failed`,{cause:g});throw c.code=g?.name==="TimeoutError"?"telegram-timeout":g?.name==="AbortError"?"telegram-aborted-after-dispatch":"telegram-transport-error",c.deliveryOutcome="unknown",c}let s;try{s=await r.json()}catch{let g=new Error(`Telegram ${t} returned invalid JSON`);throw g.status=r?.status,g.code="telegram-response-invalid",g.deliveryOutcome="unknown",g}if(!r.ok||s?.ok!==!0){let g=Hg(s?.description),c=new Error(g??`Telegram ${t} failed`);c.code=Number.isInteger(s?.error_code)?`telegram-${s.error_code}`:"telegram-api-error",c.status=r.status,Number.isInteger(s?.error_code)&&(c.providerCode=s.error_code);let I=Number(s?.parameters?.retry_after);throw Number.isFinite(I)&&I>=0&&(c.retry_after=I,c.retryAfter=I),c}return s.result}};async function Q9(n,t={}){let a=await new cB({token:n,...t}).getMe();if(!a?.id||a?.is_bot!==!0)throw new Error("Telegram token does not belong to a bot");return{platformId:String(a.id),name:Hg([a.first_name,a.last_name].filter(Boolean).join(" "))??w("Telegram\u673A\u5668\u4EBA"),username:Hg(a.username)}}var XG=Object.freeze({key:"telegram",label:"Telegram",connectionLabel:" Bot API \u957F\u8F6E\u8BE2",reactions:Object.freeze({processing:"\u{1F440}",success:"\u{1F44D}",error:"\u{1F44E}"})}),bw=class extends Es{constructor(t){super({descriptor:XG,...t})}};var IB=class extends id{#e;constructor(t){super({...t,descriptor:XG,inspectToken:t.inspectToken??Q9,deriveIdentity:h9,maskPlatformId:E9}),this.#e=t.configStore}status(){let t=super.status();return{...t,bots:t.bots.map(o=>{let a=this.#e.get(o.botId),e=Dw(a??{});return{...o,accessPolicy:e}})}}async setAccessPolicy(t,o){let a=Dw(o);return this.updateBotConfig(t,e=>({...e,...a}))}};import{randomInt as f2e}from"node:crypto";import{EnvHttpProxyAgent as p2e,FormData as d2e,fetch as h2e}from"undici";var E2e=4;function y9(){let n=new p2e({connections:E2e}),t=!1;return{fetchImpl:(o,a={})=>h2e(o,{...a,dispatcher:n}),FormDataImpl:d2e,async destroy(){t||(t=!0,await n.destroy())}}}function eF(n){if(typeof n!="string"||!n.trim())throw new TypeError("Telegram message text must be a non-empty string");return n}function AF(n){return n==="&"?5:n==="<"||n===">"?4:1}function $G(n){return Array.from(n).reduce((t,o)=>t+AF(o),0)}function u2e(n,t,o,a){let e=t+Math.floor(a*.5);for(let i=o-1;i>=e;i-=1)if(n[i]===` `||n[i]===" ")return i+1;return o}function tF(n,t,o=()=>1){if(typeof n!="string")throw new TypeError("Telegram message text must be a string");if(!n)return[];let a=Array.from(n),e=[],i=0;for(;it)break;r+=s,A+=1}if(A===i)throw new Error("Telegram message character exceeds the chunk limit");A",">")}function m9(n,t){return tF(n,t,AF).map(o=>({source:o,markdown:lB(o)}))}function B2e(n,t,o,a){let e=n.slice(t.length,n.length-o.length),i=$G(t)+Math.max($G(o),$G("```"))+1,A=a-i;if(A<1)throw new Error("Telegram Rich Markdown code fence exceeds the limit");let r=tF(e,A,AF);return r.map((s,g)=>{let c=g===r.length-1,I=s.endsWith(` `)?"":` `,p=c?o:"```",B=`${g===0?t:""}${s}${c?o:""}`,f=lB(`${t}${s}${I}${p}`);if(Array.from(f).length>a)throw new Error("Telegram Rich Markdown code block exceeds the limit");return{source:B,markdown:f}})}function rF(n){let t=eF(n);return S9(t),lB(t)}function iF(n,t=3e4){if(!Number.isInteger(t)||t<128||t>32768)throw new TypeError("Telegram Rich Markdown limit is invalid");let o=eF(n),a=S9(o),e=lB(o);if(Array.from(e).length<=t)return[{source:o,markdown:e}];let i=[],A=0;for(let r=0;rA&&i.push(...m9(o.slice(A,s.index),t));let c=g.index+g[0].length,I=o.slice(s.index,c),p=lB(I);Array.from(p).length<=t?i.push({source:I,markdown:p}):i.push(...B2e(I,s[0],g[0],t)),A=c}return A4096)throw new TypeError("Telegram regular message limit is invalid");return tF(eF(n),t,o=>o.length)}var Q2e=Object.freeze([{command:"new",description:"\u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD"},{command:"compact",description:"\u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587"},{command:"workspace",description:"\u5207\u6362\u5DE5\u4F5C\u533A"},{command:"ws",description:"\u5207\u6362\u5DE5\u4F5C\u533A"},{command:"workspacelist",description:"\u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"},{command:"workspaces",description:"\u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"},{command:"wsl",description:"\u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"},{command:"sessionlist",description:"\u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"},{command:"sessions",description:"\u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"},{command:"session",description:"\u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD"},{command:"models",description:"\u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B"},{command:"model",description:"\u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B"},{command:"presetlist",description:"\u5217\u51FA\u53EF\u7528 Agent Preset"},{command:"presets",description:"\u5217\u51FA\u53EF\u7528 Agent Preset"},{command:"preset",description:"\u67E5\u770B\u6216\u8BBE\u7F6E\u65B0\u4F1A\u8BDD Agent Preset"},{command:"stop",description:"\u505C\u6B62\u5F53\u524D\u4EFB\u52A1"},{command:"steer",description:"\u7EA0\u504F\u5F53\u524D\u4EFB\u52A1"},{command:"batch",description:"\u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF09"},{command:"send",description:"\u63D0\u4EA4\u5F53\u524D\u6279\u6B21"},{command:"cancel",description:"\u53D6\u6D88\u5F53\u524D\u6279\u6B21"},{command:"status",description:"\u68C0\u67E5\u8FDE\u63A5\u72B6\u6001"},{command:"version",description:"\u67E5\u770B\u63D2\u4EF6\u7248\u672C"},{command:"help",description:"\u663E\u793A\u5E2E\u52A9"}]);function y2e(){return Q2e.map(n=>({...n,description:w(n.description)}))}function m2e(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function S2e(n,t){return t?[[n?.text,n?.entities],[n?.caption,n?.caption_entities]].some(([o,a])=>typeof o=="string"&&Array.isArray(a)&&a.some(e=>e?.type!=="mention"||!Number.isInteger(e.offset)||!Number.isInteger(e.length)?!1:o.slice(e.offset,e.offset+e.length).toLowerCase()===`@${t.toLowerCase()}`)):!1}function w2e(n,t){return!t||typeof n!="string"?n:n.replace(new RegExp(`@${m2e(t)}\\b`,"ig"),"").trim()}var D2e=new Set(["image/jpeg","image/png","image/webp","image/gif"]),O2e=new Map([[".jpg","image/jpeg"],[".jpeg","image/jpeg"],[".png","image/png"],[".webp","image/webp"],[".gif","image/gif"]]);function sF(n){let t=n?.mime_type??n?.mimetype,o=typeof t=="string"?t.toLowerCase():"";if(D2e.has(o))return o;let a=typeof n?.file_name=="string"?n.file_name.toLowerCase():"";for(let[e,i]of O2e)if(a.endsWith(e))return i;return null}function gF(n){return Number.isSafeInteger(n)&&n>=0?n:void 0}function _w(n){return gF(n?.file_size)??(Number(n?.width)||0)*(Number(n?.height)||0)}function b2e(n,t){let o,a,e;if(Array.isArray(n?.photo)&&n.photo.length>0)o=n.photo.reduce((i,A)=>_w(A)>_w(i)?A:i),a="image/jpeg",e=`${o.file_unique_id??o.file_id??"telegram-photo"}.jpg`;else if(n?.document){let i=sF(n.document);if(!i)return null;o=n.document,a=i,e=typeof o.file_name=="string"?o.file_name:void 0}return!o||typeof o.file_id!="string"?null:{name:e,mediaType:a,size:gF(o.file_size),load:i=>t(o.file_id,i)}}function M2e(n,t){let o=n?.document;if(!o||sF(o)||typeof o.file_id!="string"||!o.file_id)return null;let a=typeof o.mime_type=="string"&&o.mime_type?o.mime_type.toLowerCase():void 0;return{name:typeof o.file_name=="string"&&o.file_name?o.file_name:String(o.file_unique_id??o.file_id),...a?{mediaType:a}:{},size:gF(o.file_size),load:({signal:e}={})=>t(o.file_id,{signal:e})}}function Mw(n,t){if(!t||typeof t!="object")return null;let o=typeof t.file_name=="string"&&t.file_name?t.file_name:void 0;return{kind:n,...o?{name:o}:{}}}function _2e(n){let t=[];if(Array.isArray(n?.photo)&&n.photo.length>0){let o=n.photo.reduce((a,e)=>_w(e)>_w(a)?e:a);t.push(Mw("image",o))}else n?.document&&t.push(Mw(sF(n.document)?"image":"file",n.document));for(let[o,a]of[["audio","audio"],["voice","audio"],["video","video"],["video_note","video"],["animation","video"]])n?.[o]&&t.push(Mw(a,n[o]));return n?.sticker&&t.push(Mw(n.sticker.is_video===!0?"video":"image",n.sticker)),t.filter(Boolean)}function T2e(n,{quote:t,loadReplyContent:o}={}){if((!n||typeof n!="object")&&(!t||typeof t!="object"))return;let a=n?.from?.id===void 0?void 0:String(n.from.id),e=[n?.from?.first_name,n?.from?.last_name].filter(c=>typeof c=="string"&&c.trim()).map(c=>c.trim()).join(" ")||(typeof n?.from?.username=="string"&&n.from.username?n.from.username:void 0),i=typeof n?.text=="string"?n.text:typeof n?.caption=="string"?n.caption:typeof t?.text=="string"?t.text:"",A=_2e(n),r=Number.isSafeInteger(n?.message_id)?String(n.message_id):void 0,s=Number.isSafeInteger(n?.date)&&n.date>=0?n.date*1e3:void 0,g=!i.trim()&&A.length===0&&typeof o=="function"?({signal:c}={})=>o({...r?{messageId:r}:{},...s===void 0?{}:{createdAt:s}},{signal:c}):null;return{...r?{messageId:r}:{},...a?{authorId:a}:{},...e?{authorName:e}:{},...i.trim()?{content:i}:{},...A.length>0?{attachments:A}:{},...g?{load:g}:{},...!i.trim()&&A.length===0&&!g?{unavailableReason:"not-delivered"}:{}}}function N2e(n,{botId:t,username:o,loadFile:a=async()=>{throw new Error("Telegram file downloader is unavailable")},loadFileStream:e=a,loadReplyContent:i}){let A=n?.message,r=A?.chat?.id,s=A?.from?.id,g=A?.message_id;if(!Number.isSafeInteger(n?.update_id)||r===void 0||s===void 0||!Number.isSafeInteger(g)||!["private","group","supergroup"].includes(A.chat?.type))return null;let c=A.chat.type==="private",I=c||String(A.reply_to_message?.from?.id??"")===String(t)||S2e(A,o),p=Number.isSafeInteger(A.message_thread_id)?A.message_thread_id:void 0,B=b2e(A,a),f=M2e(A,e),Q=p===void 0?String(r):`${r}:${p}`,y=`${c?"direct":"group"}:${Q}`,m=T2e(A.reply_to_message??A.external_reply,{quote:A.quote,...typeof i=="function"?{loadReplyContent:(T,_)=>i({conversationKey:y,...T},_)}:{}});return{messageId:String(n.update_id),senderId:String(s),contextSource:()=>({senderName:[A.from?.first_name,A.from?.last_name].filter(T=>typeof T=="string"&&T.trim()).map(T=>T.trim()).join(" ")||A.from?.username,conversationTitle:c?void 0:A.chat?.title,chatId:String(r),threadId:p===void 0?void 0:String(p)}),senderIsBot:A.from?.is_bot===!0,kind:c?"direct":"group",conversationId:Q,content:w2e(A.text??A.caption??"",o),plainText:typeof A.text=="string",images:B?[B]:[],files:f?[f]:[],...m?{replyTo:m}:{},addressed:I,reactionTarget:{chatId:r,messageId:g},replyTarget:{chatId:r,chatType:A.chat.type,replyToMessageId:g,messageThreadId:p},connectionTestTarget:{chatId:r,messageThreadId:p}}}function oF(n){return Number.isSafeInteger(n?.message_id)?String(n.message_id):null}function pB(n){let t=Number(n?.providerCode),o=Number(n?.status),a=n?.deliveryOutcome==="unknown"||t>=500||o>=500||["telegram-timeout","telegram-aborted-after-dispatch","telegram-transport-error","telegram-response-invalid"].includes(n?.code);return{outcome:a?"unknown":"failed",reason:typeof n?.code=="string"&&n.code?n.code:a?"telegram-delivery-uncertain":"telegram-provider-rejected"}}function za(n,t,o="sent",a){return{presentation:n,providerMessageIds:[...new Set(t)],deliveryOutcome:o,...a?{reason:a}:{}}}var Tw=class{#e;#A;#t;#r;#I;#o=!1;#c=null;constructor({update:t,finish:o,fail:a,providerMessageIds:e=[],presentation:i,logger:A}){this.#e=t,this.#A=o,this.#t=a,this.#I=e,this.presentation=i,this.#r=A}get providerMessageIds(){return[...this.#I]}async update(t){if(this.#o)return;let o=ls(t),a=`${o.format}:${o.text}`;if(a!==this.#c){this.#c=a;try{return await this.#e(o)}catch(e){this.#r.warn?.("[dsh-im:telegram] rich stream update failed:",e);return}}}async finish(t){if(this.#o)throw new Error("Message stream is already closed");this.#o=!0;let o=await this.#A(ls(t));return this.#I.push(...o?.providerMessageIds??[]),o}async fail(t){if(this.#o)return;this.#o=!0;let o=await this.#t(ls(t,"plain"));return this.#I.push(...o?.providerMessageIds??[]),o}cancel(){this.#o=!0}},nF=class{#e;#A;#t;constructor({api:t,signal:o,logger:a=console}){this.#e=t,this.#A=o,this.#t=a}async sendText(t,o){let a=aF(o),e=[];for(let[i,A]of a.entries()){let r=await this.#e.sendMessage({chatId:t.chatId,text:A,replyToMessageId:i===0?t.replyToMessageId:void 0,messageThreadId:t.messageThreadId,signal:this.#A});Number.isSafeInteger(r?.message_id)&&e.push(String(r.message_id))}return{providerMessageIds:e}}async addReaction(t,o,{signal:a}={}){let e=String(o??"").trim();return await this.#e.setMessageReaction({chatId:t.chatId,messageId:t.messageId,emoji:e,signal:a??this.#A}),e}removeReaction(t,o,{signal:a}={}){return this.#e.setMessageReaction({chatId:t.chatId,messageId:t.messageId,signal:a??this.#A})}sendTyping(t){return this.#e.sendChatAction({chatId:t.chatId,messageThreadId:t.messageThreadId,signal:this.#A})}sendFile(t,o){return this.#e.sendDocument({chatId:t.chatId,file:o,replyToMessageId:t.replyToMessageId,messageThreadId:t.messageThreadId,signal:this.#A})}sendImage(t,o){return this.#e.sendPhoto({chatId:t.chatId,file:o,replyToMessageId:t.replyToMessageId,messageThreadId:t.messageThreadId,signal:this.#A})}async#r(t,o,{placeholderMessageId:a}={}){let e=aF(o),i=a===void 0?[]:[String(a)],A=0;if(a!==void 0)try{await this.#e.editMessageText({chatId:t.chatId,messageId:a,text:e[0],signal:this.#A}),A=1}catch(r){let s=pB(r);if(s.outcome==="unknown")return za("text-fallback",i,"unknown",s.reason);let g=await this.#r(t,o),c=g.deliveryOutcome==="sent"?"\u56DE\u590D\u5DF2\u53D1\u9001\u3002":g.deliveryOutcome==="unknown"?"\u56DE\u590D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\u3002":"\u6D88\u606F\u53D1\u9001\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002";try{await this.#e.editMessageText({chatId:t.chatId,messageId:a,text:c,signal:this.#A})}catch(I){this.#t.warn?.("[dsh-im:telegram] unable to replace the processing placeholder:",I)}return za("text-fallback",[...i,...g.providerMessageIds],g.deliveryOutcome,g.reason)}for(let r=A;rI.source).join(""),c=await this.#r({...t,replyToMessageId:i===0?t.replyToMessageId:void 0},g);return za(c.presentation,[...e,...c.providerMessageIds],c.deliveryOutcome,c.reason)}return za("telegram-rich-final",e)}async#o(t,o,a){if(a.format==="plain")return this.#r(t,a.text,{placeholderMessageId:o});let e;try{e=iF(a.text)}catch{return this.#r(t,a.text,{placeholderMessageId:o})}let i=[String(o)];try{await this.#e.editMessageText({chatId:t.chatId,messageId:o,richMessage:{markdown:e[0].markdown},signal:this.#A})}catch(A){let r=pB(A);return r.outcome==="unknown"?za("telegram-rich-final",i,"unknown",r.reason):this.#r(t,a.text,{placeholderMessageId:o})}for(let[A,r]of e.slice(1).entries())try{let s=await this.#e.sendRichMessage({chatId:t.chatId,richMessage:{markdown:r.markdown},messageThreadId:t.messageThreadId,signal:this.#A}),g=oF(s);g&&i.push(g)}catch(s){let g=pB(s);if(g.outcome==="unknown")return za("telegram-rich-final",i,"unknown",g.reason);let c=e.slice(A+1).map(p=>p.source).join(""),I=await this.#r({...t,replyToMessageId:void 0},c);return za(I.presentation,[...i,...I.providerMessageIds],I.deliveryOutcome,I.reason)}return za("telegram-rich-final",i)}sendDelivery(t,o){return this.#I(t,ls(o))}async openDeliveryStream(t){if(t.chatType==="private"){let e=f2e(1,2147483647),i=async r=>{let s={markdown:rF(r.text)};return await this.#e.sendRichMessageDraft({chatId:t.chatId,draftId:e,richMessage:s,messageThreadId:t.messageThreadId,signal:this.#A}),za("telegram-rich-draft",[])},A=new Tw({update:i,finish:r=>this.#I(t,r),fail:r=>this.#r(t,r.text),presentation:"telegram-rich-draft",logger:this.#t});return await A.update(ls("\u6B63\u5728\u5904\u7406\u2026","plain")),A}let a=(await this.#e.sendMessage({chatId:t.chatId,text:"\u6B63\u5728\u5904\u7406\u2026",replyToMessageId:t.replyToMessageId,messageThreadId:t.messageThreadId,signal:this.#A}))?.message_id;if(!Number.isSafeInteger(a))throw new Error("Telegram did not return a placeholder message id");return new Tw({update:async e=>e.format==="plain"?(await this.#e.editMessageText({chatId:t.chatId,messageId:a,text:e.text,signal:this.#A}),za("text-fallback",[String(a)])):(await this.#e.editMessageText({chatId:t.chatId,messageId:a,richMessage:{markdown:rF(e.text)},signal:this.#A}),za("telegram-rich-draft",[String(a)])),finish:e=>this.#o(t,a,e),fail:e=>this.#r(t,e.text,{placeholderMessageId:a}),providerMessageIds:[String(a)],presentation:"telegram-regular",logger:this.#t})}async openStream(t){return Cy({limit:4e3,create:async a=>(await this.#e.sendMessage({chatId:t.chatId,text:a,replyToMessageId:t.replyToMessageId,messageThreadId:t.messageThreadId,signal:this.#A})).message_id,edit:(a,e)=>this.#e.editMessageText({chatId:t.chatId,messageId:a,text:e,signal:this.#A}),sendRemainder:a=>this.#e.sendMessage({chatId:t.chatId,text:a,messageThreadId:t.messageThreadId,signal:this.#A}),messageIdForResult:a=>a?.message_id}).start()}};function R2e(){return{startedAt:null,ready:!1,connectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...co()}}var dB=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g=R2e();#l=null;#n=null;#h=null;#d=null;#C=null;#u=null;constructor({config:t,token:o,harness:a,state:e,contextEnhancement:i,accessPolicy:A,groupSessionScope:r,logger:s=console,replyTimeoutMs:g=6e5,createApi:c=p=>new cB(p),createHttpTransport:I=y9}){if(!t||!o||!a||!e)throw new TypeError("TelegramRuntime requires config, token, Harness, and state");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g,this.#s=c,this.#p=I}get status(){return structuredClone(this.#g)}async sendConnectionTest(t){if(!this.#g.ready||!this.#h){let o=new Error("Telegram bot is not connected");throw o.code="test-target-unavailable",o}return this.#h.sendConnectionTest(t)}async sendProactiveText(t,o,a={}){if(!this.#g.ready||!this.#h){let r=new Error("Telegram bot is not connected");throw r.code="bot-not-connected",r}let e=typeof t?.route?.chatId=="string"?t.route.chatId.trim():"",i=Number(e),A=t?.route?.messageThreadId;if(!/^-?\d+$/.test(e)||!Number.isSafeInteger(i)||t?.kind!=="chat"&&t?.kind!=="topic"||t.kind==="topic"&&(!Number.isSafeInteger(A)||A<=0)||t.kind==="chat"&&A!==void 0){let r=new TypeError("Invalid Telegram proactive delivery target");throw r.code="invalid-target",r}return this.#h.sendProactiveText({chatId:i,...t.kind==="topic"?{messageThreadId:A}:{}},o,a)}async start(){return this.#g.ready&&this.#C?this.status:this.#u?this.#u:(this.#u=this.#B().finally(()=>{this.#u=null}),this.#u)}async#B(){await this.stop(),this.#g.startedAt=new Date().toISOString(),this.#g.connectionState="connecting",this.#g.lastError=null,await this.#t.ensureRunning(),this.#g.harnessReachable=!0;let t=new AbortController;this.#d=t;try{let o=this.#p();this.#l=o;let a=this.#s({token:this.#A,fetchImpl:o.fetchImpl,FormDataImpl:o.FormDataImpl});this.#n=a;let e=await a.getMe({signal:t.signal});if(String(e?.id??"")!==this.#e.platformId||e?.is_bot!==!0)throw new Error("Telegram token identity does not match the saved bot");let i=await a.getWebhookInfo({signal:t.signal});if(typeof i?.url=="string"&&i.url){let g=new Error(w("\u8BE5 Telegram \u673A\u5668\u4EBA\u5DF2\u914D\u7F6E Webhook\uFF0C\u8BF7\u5148\u5728\u539F\u670D\u52A1\u4E2D\u79FB\u9664 Webhook \u540E\u91CD\u8BD5\u3002"));throw g.code="webhook-configured",g}try{await a.setMyCommands({commands:y2e(),signal:t.signal}),await a.setChatMenuButton({menuButton:ZG,signal:t.signal})}catch(g){this.#i.warn?.(`[dsh-im:telegram] bot ${this.#e.botId} command menu setup failed:`,g)}let A=new nF({api:a,signal:t.signal,logger:this.#i});this.#h=new bw({bot:A,harness:this.#t,state:this.#r,contextEnhancement:this.#I,accessPolicy:this.#o,groupSessionScope:this.#c,status:this.#g,logger:this.#i,replyTimeoutMs:this.#a,signal:t.signal});let r=this.#r.cursor();if(r===null){let g=await a.getUpdates({offset:-1,timeout:0,signal:t.signal});r=g.length>0?g.at(-1).update_id+1:0,await this.#r.setCursor(r)}let s=Date.now();return this.#g.ready=!0,this.#g.connectionState="connected",this.#g.lastCheckedAt=s,this.#g.lastConnectedAt=s,this.#C=this.#m(r,t.signal),this.#C.catch(g=>{t.signal.aborted||(this.#g.ready=!1,this.#g.connectionState="failed",this.#g.lastError=g?.message??String(g),this.#i.error?.(`[dsh-im:telegram] bot ${this.#e.botId} polling stopped:`,g))}),this.status}catch(o){throw this.#g.ready=!1,this.#g.connectionState="failed",this.#g.lastError=o?.message??String(o),await this.stop(),o}}async#f(t,{signal:o}={}){let a=typeof t?.conversationKey=="string"?t.conversationKey.trim():"",e=Number(t?.createdAt);if(!a||!Number.isFinite(e))return{unavailableReason:"not-delivered"};let i=this.#r.sessionFor(a),A=typeof i=="string"&&i?this.#t.workspaceSession?.(i):null,r=await Jp({session:A,quotedAt:e,signal:o});return r?{content:r}:{unavailableReason:"not-delivered"}}async#m(t,o){let a=t;for(;!o.aborted;){let e=await this.#n.getUpdates({offset:a,timeout:25,signal:o});if(this.#g.lastCheckedAt=Date.now(),o.aborted)return;let i=e.map(A=>{let r=A?.message?.chat?.type;return{update:A,contextSnapshot:ai(this.#I,r==="private"?"direct":r==="group"||r==="supergroup"?"group":null)}});for(let{update:A,contextSnapshot:r}of i){if(o.aborted)return;let s=N2e(A,{botId:this.#e.platformId,username:this.#e.username,loadFile:(g,c)=>this.#n.downloadFile({fileId:g,...c}),loadFileStream:(g,c)=>this.#n.downloadFileStream({fileId:g,...c}),loadReplyContent:(g,c)=>this.#f(g,c)});s&&this.#h.accept(s,{contextSnapshot:r}).catch(g=>{o.aborted||this.#i.error?.(`[dsh-im:telegram] bot ${this.#e.botId} message handling failed:`,g)}),a=A.update_id+1,await this.#r.setCursor(a)}}}async stop(){let t=this.#C,o=this.#h,a=this.#l;this.#d?.abort(),this.#d=null,this.#C=null,this.#l=null,this.#n=null,this.#h=null,await Promise.race([t?.catch(()=>{})??Promise.resolve(),new Promise(e=>setTimeout(e,2e3))]),await Promise.race([o?.waitForIdle()??Promise.resolve(),new Promise(e=>setTimeout(e,2e3))]);try{await a?.destroy()}catch{this.#i.warn?.("[dsh-im:telegram] Telegram HTTP transport cleanup failed")}return this.#g.ready=!1,this.#g.connectionState="idle",this.status}};var Nw=class extends Cs{};function cF(n,t={},o={}){return Qy(n,t,o,{channel:"telegram",ConfigStore:ww,StateStore:Nw,HarnessClient:Ow,Controller:IB,Runtime:dB})}var w9="/telegram",D9=Sr,k2e=Object.freeze(Object.values(D9));function O9(n){return my(n,{channel:"Telegram"})}function Rw(n,t,o){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(w9,O9(t),{authority:mr(o)})}async function b9(n,t={}){if(t?.controller)return Rw(n,t.controller,t.rpcAuthority);let o=await cF(n,t,t.internals??{}),a=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=Rw(n,o.controller,t.rpcAuthority);return n.effect(()=>async()=>{await a?.(),await o.close()},"dsh-im: close Telegram bot connections"),e}import{unlink as OUe}from"node:fs/promises";import{homedir as bUe}from"node:os";import{join as BB,resolve as Fl}from"node:path";import{createHash as v2e}from"node:crypto";import{mkdir as P2e,readFile as G2e,rename as F2e,unlink as L2e,writeFile as U2e}from"node:fs/promises";import{dirname as H2e}from"node:path";var IF=Object.freeze({version:1,bots:Object.freeze([])});function vl(n){return typeof n=="string"&&n.trim()?n.trim():null}function M9(n){let t=vl(n);return t&&/^wecom_[a-f0-9]{24}$/.test(t)?t:null}function K2e(n){let t=vl(n);return t&&/^DSH_WECOM_BOT_SECRET_[A-F0-9]{24}$/.test(t)?t:null}function vw(n){let t=vl(n);if(!t)throw new TypeError("Enterprise WeChat bot ID is required");let o=v2e("sha256").update(t).digest("hex").slice(0,24);return{botId:`wecom_${o}`,secretRef:`DSH_WECOM_BOT_SECRET_${o.toUpperCase()}`}}function lF(n){let t=vl(n)??"";return t?t.length<=10?`${t.slice(0,3)}\u2022\u2022\u2022`:`${t.slice(0,6)}\u2022\u2022\u2022\u2022${t.slice(-4)}`:w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA")}function _9(n){if(!n||typeof n!="object")return null;let t=M9(n.botId),o=vl(n.remoteBotId),a=K2e(n.secretRef);if(!t||!o||!a)return null;let e=vw(o);return e.botId!==t||e.secretRef!==a?null:Object.freeze({botId:t,remoteBotId:o,secretRef:a,createdAt:vl(n.createdAt)??new Date().toISOString(),connectedAt:vl(n.connectedAt)})}function x2e(n){if(!n||n.version!==1||!Array.isArray(n.bots))return null;let t=n.bots.map(_9);if(t.some(i=>i===null))return null;let o=new Set,a=new Set,e=new Set;for(let i of t){if(o.has(i.botId)||a.has(i.remoteBotId)||e.has(i.secretRef))return null;o.add(i.botId),a.add(i.remoteBotId),e.add(i.secretRef)}return Object.freeze({version:1,bots:Object.freeze(t)})}var kw=class{#e;#A=IF;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=x2e(JSON.parse(await G2e(this.#e,"utf8")));if(!t)throw new Error("dsh-im Enterprise WeChat config contains invalid bot data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=IF}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(a=>a.botId===t);return o?structuredClone(o):null}getByRemoteBotId(t){let o=this.#A.bots.find(a=>a.remoteBotId===t);return o?structuredClone(o):null}async save(t){let o=_9(t);if(!o)throw new Error("Refusing to persist incomplete Enterprise WeChat bot data");return this.#r(a=>{let e=a.find(r=>r.remoteBotId===o.remoteBotId&&r.botId!==o.botId),i=a.find(r=>r.secretRef===o.secretRef&&r.botId!==o.botId);if(e||i)throw new Error("Duplicate Enterprise WeChat bot identity");let A=a.findIndex(r=>r.botId===o.botId);return A===-1?a.push(o):a[A]=o,structuredClone(o)})}async remove(t){if(!M9(t))throw new TypeError("Invalid Enterprise WeChat bot ID");return this.#r(o=>{let a=o.findIndex(i=>i.botId===t);if(a===-1)return null;let[e]=o.splice(a,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await L2e(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=IF});this.#t=t.then(()=>{},()=>{}),await t}async#r(t){let o,a=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let i=Object.freeze({version:1,bots:Object.freeze(e)});await this.#I(i),this.#A=i});return this.#t=a.then(()=>{},()=>{}),await a,o}async#I(t){await P2e(H2e(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await U2e(o,`${JSON.stringify(t,null,2)} `,{encoding:"utf8",mode:384}),await F2e(o,this.#e)}};var Pw=class extends yr{constructor(t){super({...t,rpcIdPrefix:"wecom",logPrefix:"dsh-wecom"})}};var Y2e="https://work.weixin.qq.com/ai/qc/generate",j2e="https://work.weixin.qq.com/ai/qc/query_result";function T9(){return process.platform==="win32"?2:process.platform==="linux"?3:1}function ph(n){return typeof n=="string"&&n.trim()?n.trim():null}function J2e(n){let t=ph(n);if(!t)return null;try{let o=new URL(t);return o.protocol==="https:"&&o.hostname==="work.weixin.qq.com"&&(!o.port||o.port==="443")?o.href:null}catch{return null}}function q2e(n,t){return n?AbortSignal.any([n,AbortSignal.timeout(t)]):AbortSignal.timeout(t)}async function N9(n,t,o){let a=await n(t,{method:"GET",redirect:"error",signal:q2e(o,1e4),headers:{accept:"application/json"}});if(!a.ok)throw new Error(`Enterprise WeChat QR service returned HTTP ${a.status}`);return a.json()}var Gw=class{#e;#A;#t;#r;constructor({fetch:t=globalThis.fetch,clock:o=()=>Date.now(),source:a="deepseek-harness",platform:e=T9()}={}){if(typeof t!="function")throw new TypeError("A fetch implementation is required");this.#e=t,this.#A=o,this.#t=a,this.#r=[1,2,3].includes(e)?e:T9()}async start({signal:t}={}){let o=new URL(Y2e);o.searchParams.set("source",this.#t),o.searchParams.set("plat",String(this.#r));let a=await N9(this.#e,o,t),e=ph(a?.data?.scode),i=J2e(a?.data?.auth_url);if(!e||!i)throw new Error("Enterprise WeChat QR service returned invalid data");return{scode:e,verificationUrl:i,expiresAt:this.#A()+3e5,pollIntervalMs:3e3}}async poll({scode:t,signal:o}={}){let a=ph(t);if(!a)throw new TypeError("Enterprise WeChat QR poll code is required");let e=new URL(j2e);e.searchParams.set("scode",a);let i=await N9(this.#e,e,o),A=ph(i?.data?.status)?.toLowerCase();if(A==="success"){let r=ph(i?.data?.bot_info?.botid),s=ph(i?.data?.bot_info?.secret);if(!r||!s)throw new Error("Enterprise WeChat QR result omitted bot credentials");return{status:"success",remoteBotId:r,secret:s}}return["expired","timeout"].includes(A)?{status:"expired"}:["fail","failed","error"].includes(A)?{status:"failed"}:{status:"waiting"}}};import{mkdir as z2e,readFile as V2e,rename as W2e,unlink as Z2e,writeFile as X2e}from"node:fs/promises";import{dirname as $2e}from"node:path";var Fw=Object.freeze({version:1,sessions:{},seenMessageIds:[]});function eUe(n){if(!n||typeof n!="object")return structuredClone(Fw);let t={};if(n.sessions&&typeof n.sessions=="object"&&!Array.isArray(n.sessions))for(let[o,a]of Object.entries(n.sessions))typeof o=="string"&&typeof a=="string"&&a&&(t[o]=a);return{version:1,sessions:t,seenMessageIds:Array.isArray(n.seenMessageIds)?n.seenMessageIds.filter(o=>typeof o=="string").slice(-1e3):[]}}var Lw=class{#e;#A=structuredClone(Fw);#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{this.#A=eUe(JSON.parse(await V2e(this.#e,"utf8")))}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=structuredClone(Fw),await this.#r()}return this}sessionFor(t){return this.#A.sessions[t]??null}async setSession(t,o){this.#A.sessions[t]=o,await this.#r()}async clearSession(t){delete this.#A.sessions[t],await this.#r()}async clearSessions(){this.#A.sessions={},await this.#r()}hasSeen(t){return this.#A.seenMessageIds.includes(t)}async markSeen(t){this.hasSeen(t)||(this.#A.seenMessageIds.push(t),this.#A.seenMessageIds.length>1e3&&this.#A.seenMessageIds.splice(0,this.#A.seenMessageIds.length-1e3),await this.#r())}snapshot(){return structuredClone(this.#A)}async remove(){try{await Z2e(this.#e)}catch(t){if(t?.code!=="ENOENT")throw t}this.#A=structuredClone(Fw)}async#r(){let t=`${JSON.stringify(this.#A,null,2)} `,o=this.#t.then(async()=>{await z2e($2e(this.#e),{recursive:!0,mode:448});let a=`${this.#e}.tmp`;await X2e(a,t,{encoding:"utf8",mode:384}),await W2e(a,this.#e)});this.#t=o.then(()=>{},()=>{}),await o}};import{randomUUID as AUe}from"node:crypto";var R9=new Set(["pending","connecting"]),hB=new Set(["connected","failed","cancelled","expired"]);function Pl(n){return typeof n=="string"&&n.trim()?n.trim():null}function Va(n,t){return Object.freeze({code:n,message:t})}function Gl(n){return n?{attemptId:n.id,status:n.state,pollIntervalMs:n.pollIntervalMs,qrRevision:n.qrRevision,...n.verificationUrl?{verificationUrl:n.verificationUrl}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.botId?{botId:n.botId}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}var EB=class{#e;#A;#t;#r;#I;#o;#c=new Map;#i=new Map;#a=new Map;#s=null;#p=new Map;#g=0;#l=!1;constructor({qrAuth:t,credentials:o,configStore:a,createRuntime:e,deleteState:i=async()=>{},logger:A=console}){if(!t||typeof t.start!="function"||typeof t.poll!="function")throw new TypeError("Enterprise WeChat QR auth is required");if(!o||typeof o.resolve!="function"||typeof o.set!="function"||typeof o.unset!="function")throw new TypeError("WecomController requires the DSH credential provider");if(!a||typeof a.list!="function"||typeof a.save!="function"||typeof a.remove!="function")throw new TypeError("WecomController requires a config store");if(typeof e!="function")throw new TypeError("createRuntime is required");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A}async initialize(){if(this.#l)return this.status();for(let t of this.#t.list())await this.#m(t.botId,async()=>{let o=this.#c.get(t.botId)?.status;if(this.#l||o?.ready||o?.wecomConnectionState==="connecting")return;let a=await this.#B(t.secretRef);if(!a){this.#i.set(t.botId,Va("missing-secret",w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u51ED\u636E\u7F3A\u5931\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002")));return}try{await this.#C(t,a),this.#i.delete(t.botId)}catch{this.#i.set(t.botId,Va("connection-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#o.warn?.(`[dsh-im:wecom] bot ${t.botId} failed to initialize`)}finally{this.#Q()}});return this.status()}async startProvisioning(){if(this.#l)throw new Error("Enterprise WeChat controller is closed");this.#s&&await this.cancelProvisioning(this.#s);let t={id:AUe(),state:"pending",createdAt:Date.now(),expiresAt:null,pollIntervalMs:3e3,qrRevision:1,verificationUrl:null,scode:null,botId:null,error:null,controller:new AbortController,polling:null,transition:null};this.#a.set(t.id,t),this.#s=t.id,this.#Q();try{let o=await this.#e.start({signal:t.controller.signal});if(t.scode=Pl(o.scode),t.verificationUrl=Pl(o.verificationUrl),t.expiresAt=Number(o.expiresAt),t.pollIntervalMs=Math.min(1e4,Math.max(500,Number(o.pollIntervalMs)||3e3)),!t.scode||!t.verificationUrl||!Number.isFinite(t.expiresAt))throw new Error("Enterprise WeChat QR auth returned incomplete data");return this.#Q(),Gl(t)}catch(o){throw t.state=t.controller.signal.aborted?"cancelled":"failed",t.error=t.controller.signal.aborted?Va("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002")):Va("qr-start-failed",w("\u65E0\u6CD5\u751F\u6210\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002")),this.#w(t),o}}async registrationStatus(t){let o=this.#a.get(t);if(!o||hB.has(o.state))return Gl(o);if(o.state==="connecting")return await o.transition?.catch(()=>{}),Gl(o);if(Date.now()>=o.expiresAt)return o.state="expired",o.error=Va("expired",w("\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),o.controller.abort(),this.#w(o),Gl(o);if(!o.polling){let a=this.#n(o).finally(()=>{o.polling===a&&(o.polling=null)});o.polling=a}return await o.polling.catch(()=>{}),Gl(o)}async bindCredentials({botId:t,secret:o}={}){if(this.#l)throw new Error("Enterprise WeChat controller is closed");let a=Pl(t),e=Pl(o);if(!a||!e)throw new TypeError("Enterprise WeChat Bot ID and Secret are required");if(this.#s&&await this.cancelProvisioning(this.#s),this.#l)throw new Error("Enterprise WeChat controller is closed");let i=vw(a);return await this.#m(i.botId,async()=>{if(this.#l)throw new Error("Enterprise WeChat controller is closed");let A=this.#t.getByRemoteBotId(a),r=await this.#A.resolve(i.secretRef).catch(()=>{});if(this.#l)throw new Error("Enterprise WeChat controller is closed");let s={botId:i.botId,remoteBotId:a,secretRef:i.secretRef,createdAt:A?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};await this.#A.set(i.secretRef,e);try{await this.#t.save(s)}catch(g){throw await this.#f(i.secretRef,r),g}try{await this.#C(s,e),this.#i.delete(i.botId)}catch{this.#i.set(i.botId,Va("connection-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:wecom] bot ${i.botId} credential connection failed`)}this.#Q()}),this.status()}async cancelProvisioning(t){let o=this.#a.get(t);return o?(hB.has(o.state)||(o.controller.abort(),await Promise.allSettled([o.polling,o.transition].filter(Boolean)),hB.has(o.state)||(o.state="cancelled"),o.error??=Va("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002")),this.#w(o)),Gl(o)):null}async reconnectBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Enterprise WeChat bot");return await this.#m(t,async()=>{let a=await this.#B(o.secretRef);if(!a)throw new Error("Enterprise WeChat bot secret is missing");try{await this.#C(o,a),this.#i.delete(t)}catch(e){throw this.#i.set(t,Va("connection-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),e}finally{this.#Q()}}),this.status()}async sendConnectionTest(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Enterprise WeChat bot");return this.#m(t,async()=>{let a=this.#c.get(t);if(!a?.status?.ready||typeof a.sendConnectionTest!="function")throw Qr(w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"));return a.sendConnectionTest(Ui(w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\uFF08{botId}\uFF09",{botId:lF(o.remoteBotId)})))})}async sendProactiveText(t,o,a,e={}){if(!this.#t.get(t))throw new Error("Unknown Enterprise WeChat bot");return this.#m(t,async()=>{let A=this.#c.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,a,e)})}async deleteBot(t){let o=this.#t.get(t);if(!o)throw new Error("Unknown Enterprise WeChat bot");return await this.#m(t,async()=>{let a=await this.#A.resolve(o.secretRef).catch(()=>{});await this.#u(t);try{await this.#A.unset(o.secretRef),await this.#t.remove(t)}catch(e){throw a?.value&&(await this.#A.set(o.secretRef,a.value).catch(()=>{}),await this.#C(o,a.value).catch(()=>{})),new Error("Unable to remove the Enterprise WeChat bot safely.",{cause:e})}await this.#I({botId:t,config:o}).catch(e=>{this.#o.warn?.(`[dsh-im:wecom] bot ${t} state cleanup failed:`,e)}),this.#i.delete(t),this.#Q()}),this.status()}status(){let t=this.#t.list().map(e=>{let i=this.#c.get(e.botId)?.status??null,A=i?.ready===!0&&i.wecomConnectionState==="connected"&&i.harnessReachable===!0,r=A?"connected":i?.wecomConnectionState==="connecting"?"connecting":this.#i.has(e.botId)||i?.wecomConnectionState==="failed"?"error":"offline";return{botId:e.botId,state:r,connected:A,configured:!0,bot:{name:w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"),appIdMasked:lF(e.remoteBotId)},health:{status:A?"healthy":r==="error"?"error":"offline",summary:A?w("\u4F01\u4E1A\u5FAE\u4FE1 WebSocket \u957F\u8FDE\u63A5\u8FD0\u884C\u6B63\u5E38"):r==="error"?w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5"):w("\u4F01\u4E1A\u5FAE\u4FE1\u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:i?.lastCheckedAt??null,lastConnectedAt:i?.lastConnectedAt??null},stats:{messagesReceived:i?.messagesReceived??0,messagesReplied:i?.messagesReplied??0},lastMessageError:ti(i?.lastMessageError),error:structuredClone(this.#i.get(e.botId)??null)}}),o=t.filter(e=>e.connected).length,a=this.#s?this.#a.get(this.#s):null;return{schemaVersion:1,revision:this.#g,state:a&&R9.has(a.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...a&&R9.has(a.state)?{provisioning:Gl(a)}:{}}}async close(){this.#l||(this.#l=!0,this.#s&&await this.cancelProvisioning(this.#s),await Promise.allSettled([...this.#p.values()]),await Promise.allSettled([...this.#c.keys()].map(t=>this.#u(t))))}async#n(t){try{let o=await this.#e.poll({scode:t.scode,signal:t.controller.signal});if(t.controller.signal.aborted||hB.has(t.state)||o.status==="waiting")return;if(o.status==="expired"){t.state="expired",t.error=Va("expired",w("\u4F01\u4E1A\u5FAE\u4FE1\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u3002")),this.#w(t);return}if(o.status!=="success"){t.state="failed",t.error=Va("qr-connect-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u6CA1\u6709\u5B8C\u6210\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002")),this.#w(t);return}t.state="connecting",t.verificationUrl=null,t.expiresAt=null,t.scode=null,this.#Q();let a=this.#h(t,o);t.transition=a,await a}catch{if(t.controller.signal.aborted)return;t.state="failed",t.error=Va("qr-connect-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u626B\u7801\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002")),this.#o.warn?.("[dsh-im:wecom] QR polling failed"),this.#w(t)}}async#h(t,o){try{let a=Pl(o.remoteBotId),e=Pl(o.secret);if(!a||!e)throw new Error("Enterprise WeChat authorization returned incomplete credentials");t.botId=await this.#d(t,{remoteBotId:a,secret:e}),t.state="connected",t.error=null}catch{t.controller.signal.aborted?(t.state="cancelled",t.error=Va("cancelled",w("\u626B\u7801\u7ED1\u5B9A\u5DF2\u53D6\u6D88\u3002"))):(t.state="failed",t.error=Va("activation-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u5DF2\u6388\u6743\uFF0C\u4F46\u65E0\u6CD5\u5B89\u5168\u4FDD\u5B58\u63A5\u5165\u914D\u7F6E\u3002")),this.#o.error?.("[dsh-im:wecom] provisioning failed"))}finally{this.#w(t)}}async#d(t,{remoteBotId:o,secret:a}){let e=vw(o),i=this.#t.getByRemoteBotId(o),A=await this.#A.resolve(e.secretRef).catch(()=>{}),r={botId:e.botId,remoteBotId:o,secretRef:e.secretRef,createdAt:i?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString()};return this.#m(e.botId,async()=>{await this.#A.set(e.secretRef,a);try{if(t.controller.signal.aborted)throw new DOMException("Cancelled","AbortError");await this.#t.save(r)}catch(s){throw await this.#f(e.secretRef,A),s}try{if(t.controller.signal.aborted)throw new DOMException("Cancelled","AbortError");await this.#C(r,a),this.#i.delete(e.botId)}catch(s){if(t.controller.signal.aborted)throw await this.#u(e.botId),i?await this.#t.save(i).catch(()=>{}):await this.#t.remove(e.botId).catch(()=>null)&&await this.#I({botId:e.botId,config:r}).catch(c=>{this.#o.warn?.("[dsh-im:wecom] cancelled bot state cleanup failed:",c)}),await this.#f(e.secretRef,A),s;this.#i.set(e.botId,Va("connection-failed",w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#o.warn?.(`[dsh-im:wecom] bot ${e.botId} activation connection failed`)}return this.#Q(),e.botId})}async#C(t,o){if(this.#l)throw new Error("Enterprise WeChat controller is closed");if(await this.#u(t.botId),this.#l)throw new Error("Enterprise WeChat controller is closed");let a=await this.#r({botId:t.botId,config:t,secret:o});if(!a||typeof a.start!="function"||typeof a.stop!="function")throw new TypeError("createRuntime returned an invalid Enterprise WeChat runtime");this.#c.set(t.botId,a);try{await a.start()}catch(e){throw await a.stop().catch(()=>{}),this.#c.delete(t.botId),e}}async#u(t){let o=this.#c.get(t);this.#c.delete(t),await o?.stop().catch(a=>{this.#o.warn?.(`[dsh-im:wecom] bot ${t} failed to stop cleanly:`,a)})}async#B(t){let o=await this.#A.resolve(t).catch(()=>{});return Pl(o?.value)}async#f(t,o){o?.value?await this.#A.set(t,o.value).catch(()=>{}):await this.#A.unset(t).catch(()=>{})}#m(t,o){let i=(this.#p.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#p.get(t)===i&&this.#p.delete(t)});return this.#p.set(t,i),i}#w(t){t.scode=null,t.verificationUrl=null,t.expiresAt=null,this.#s===t.id&&(this.#s=null),this.#Q();let o=[...this.#a.values()].filter(a=>hB.has(a.state));for(;o.length>16;)this.#a.delete(o.shift().id)}#Q(){this.#g+=1}};import{WSAuthFailureError as QUe,WSClient as yUe,WSReconnectExhaustedError as mUe}from"@wecom/aibot-node-sdk";import{generateReqId as tUe}from"@wecom/aibot-node-sdk";var EF=12e4;function rUe(){return[w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u5DF2\u8FDE\u63A5 DeepSeek Harness\u3002"),"",w("\u76F4\u63A5\u53D1\u9001\u6587\u5B57\u3001\u56FE\u7247\u6216\u6587\u4EF6\u5373\u53EF\u7EE7\u7EED\u5F53\u524D\u4F1A\u8BDD\u3002"),w("/new \u5F00\u542F\u4E00\u4E2A\u5168\u65B0\u4F1A\u8BDD"),w("/compact \u538B\u7F29\u5F53\u524D\u4F1A\u8BDD\u7684\u8F83\u65E9\u4E0A\u4E0B\u6587"),w("/history [\u6570\u91CF] \u67E5\u770B\u6700\u8FD1\u5386\u53F2\u6D88\u606F\uFF08\u9ED8\u8BA4 3 \u6761\uFF0C\u6700\u591A 5 \u6761\uFF09"),w("/workspace \u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84 \u5207\u6362\u5DE5\u4F5C\u533A"),w("/workspacelist \u5217\u51FA\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84"),w("/ws\u3001/wsl\u3001/workspaces \u5DE5\u4F5C\u533A\u547D\u4EE4\u522B\u540D"),w("/sessionlist \u6216 /sessions [\u5DE5\u4F5C\u533A\u5E8F\u53F7\u6216\u7EDD\u5BF9\u8DEF\u5F84] \u5217\u51FA\u4F1A\u8BDD ID \u548C\u6807\u9898"),w("/sessionlist --limit N \u4EC5\u5217\u51FA\u5F53\u524D\u5DE5\u4F5C\u533A\u524D N \u4E2A\u4F1A\u8BDD"),w("/session Session ID \u6216\u5F53\u524D\u5DE5\u4F5C\u533A\u5E8F\u53F7 \u5C06\u5F53\u524D\u804A\u5929\u7ED1\u5B9A\u5230\u6307\u5B9A\u4F1A\u8BDD"),w("/models \u6309\u5E8F\u53F7\u5217\u51FA\u6240\u6709\u53EF\u7528\u6A21\u578B"),w("/reasoninglist \u6216 /reasonings \u6309\u5E8F\u53F7\u5217\u51FA\u5F53\u524D\u6A21\u578B\u53EF\u7528\u63A8\u7406\u7B49\u7EA7"),w("/reasoning [\u5E8F\u53F7\u3001\u7B49\u7EA7ID\u6216 --default] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u63A8\u7406\u7B49\u7EA7"),w("/model [\u5E8F\u53F7\u6216\u5B8C\u6574\u6A21\u578BID] [\u63A8\u7406\u7B49\u7EA7ID] \u67E5\u770B\u6216\u5207\u6362\u5F53\u524D\u4F1A\u8BDD\u6A21\u578B"),w("\u793A\u4F8B\uFF1A\u5148\u53D1 /models\uFF0C\u518D\u53D1 /model 2 [\u63A8\u7406\u7B49\u7EA7ID]"),w("/presetlist \u6216 /presets \u6309\u5E8F\u53F7\u5217\u51FA\u53EF\u7528 Agent Preset"),w("/preset [\u5E8F\u53F7\u6216\u5B8C\u6574ID] \u67E5\u770B\u6216\u8BBE\u7F6E\u5F53\u524D\u673A\u5668\u4EBA Agent Preset"),w("\u7EAF\u6570\u5B57 ID\uFF1A/preset id:"),w("/preset --default \u8DDF\u968F Host \u9ED8\u8BA4"),w("/stop \u505C\u6B62\u5F53\u524D\u4EFB\u52A1"),w("/steer \u8865\u5145\u6307\u4EE4 \u7EA0\u504F\u5F53\u524D\u4EFB\u52A1"),w("/batch \u5F00\u59CB\u6279\u91CF\u8F93\u5165\uFF08\u4EC5\u79C1\u804A\uFF0C\u6700\u591A 10 \u6761\u6587\u5B57\uFF09"),w("/send \u63D0\u4EA4\u5F53\u524D\u6279\u6B21"),w("/cancel \u53D6\u6D88\u5F53\u524D\u6279\u6B21"),w("/status \u68C0\u67E5\u8FDE\u63A5\u72B6\u6001"),w("/version \u67E5\u770B\u63D2\u4EF6\u7248\u672C"),w("/help \u663E\u793A\u672C\u5E2E\u52A9")].join(` `)}var iUe=18e3,k9=5*1024*1024,G9=4;function hi(n){return typeof n=="string"&&n.trim()?n.trim():null}function Hn(n){return n?.body&&typeof n.body=="object"?n.body:{}}function v9(n){let t=Hn(n);return t.chattype==="group"?`group:${t.chatid}`:`direct:${t.from?.userid}`}function F9(n){let t="";return n.msgtype==="text"?t=typeof n.text?.content=="string"?n.text.content.trim():"":n.msgtype==="voice"?t=typeof n.voice?.content=="string"?n.voice.content.trim():"":n.msgtype==="mixed"&&Array.isArray(n.mixed?.msg_item)&&(t=n.mixed.msg_item.filter(o=>o?.msgtype==="text"&&typeof o.text?.content=="string").map(o=>o.text.content).join(` -`).trim()),t}function BF(n){let t=Hn(n),o=F9(t);return t.chattype==="group"?o.replace(/^\s*@\S+(?:\s+|$)/u,"").trim():o}function aUe(n){let t=Hn(n);return t.msgtype==="image"?[t.image]:t.msgtype!=="mixed"||!Array.isArray(t.mixed?.msg_item)?[]:t.mixed.msg_item.filter(o=>o?.msgtype==="image").map(o=>o.image)}function oUe(n){let t=Hn(n);return t.msgtype==="file"&&t.file&&typeof t.file=="object"?[t.file]:[]}function nUe(n){if(n?.msgtype==="image")return[{kind:"image"}];if(n?.msgtype==="voice")return[{kind:"audio"}];if(n?.msgtype==="file"){let t=hi(n.file?.filename??n.file?.file_name??n.file?.name);return[{kind:"file",...t?{name:t}:{}}]}return n?.msgtype!=="mixed"||!Array.isArray(n.mixed?.msg_item)?[]:n.mixed.msg_item.filter(t=>t?.msgtype==="image").map(()=>({kind:"image"}))}function sUe(n){let t=n?.quote;if(!t||typeof t!="object")return null;let o=F9(t),a=nUe(t),e=["text","image","mixed","voice","file"].includes(t.msgtype);return{...o?{content:o}:{},...a.length>0?{attachments:a}:{},...!o&&a.length===0?{unavailableReason:e?"not-delivered":"unsupported"}:{}}}function gUe(n,t){let o=hi(t?.url);if(!o)return null;let a=hi(t?.aeskey)??void 0;return{async load({signal:e,maxBytes:i}){if(e?.throwIfAborted(),typeof n?.downloadFile!="function")throw new Error("Enterprise WeChat image download is unavailable");let A=await n.downloadFile(o,a);e?.throwIfAborted();let r=A?.buffer;if(!Buffer.isBuffer(r)&&!(r instanceof Uint8Array))throw new Error("Enterprise WeChat image download returned no data");let s=Buffer.from(r);if(Number.isFinite(i)&&s.length>i)throw new ft("image-too-large",`Enterprise WeChat image exceeds ${i} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return{data:s,name:A?.filename}}}}function cUe(n,t){let o=hi(t?.url);if(!o)return null;let a=hi(t?.aeskey)??void 0;return{name:hi(t?.filename??t?.file_name??t?.name)??"file",async load({signal:e}={}){if(e?.throwIfAborted(),typeof n?.downloadFile!="function")throw new Error("Enterprise WeChat file download is unavailable");let i=await n.downloadFile(o,a);e?.throwIfAborted();let A=i?.buffer??i?.data;if(!Buffer.isBuffer(A)&&!(A instanceof Uint8Array))throw new Error("Enterprise WeChat file download returned no data");return{data:Buffer.from(A),...hi(i?.filename)?{name:i.filename.trim()}:{}}}}}function pF(n,t){let o=Hn(n),a=sUe(o);return{content:BF(n),images:aUe(n).map(e=>gUe(t,e)).filter(Boolean),files:oUe(n).map(e=>cUe(t,e)).filter(Boolean),...a?{replyTo:a}:{}}}function IUe(n,t){return!Array.isArray(n?.files)||n.files.length===0?n:{...n,files:n.files.map(o=>{let a=o.load({signal:t});return a.catch(()=>{}),{...o,async load({signal:e}={}){e?.throwIfAborted();let i=await a;return e?.throwIfAborted(),i}}})}}function lUe(n,t){return kt(n)?{...n,images:n.images.map(o=>{let a=o.load({signal:t,maxBytes:k9});return a.catch(()=>{}),{...o,async load({signal:e,maxBytes:i=k9}={}){e?.throwIfAborted();let A=await a;e?.throwIfAborted();let r=A?.data??A?.buffer??A;if((Buffer.isBuffer(r)||r instanceof Uint8Array?r.length:0)>i)throw new ft("image-too-large",`Enterprise WeChat image exceeds ${i} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return A}}})}:n}function pUe(n){return{...n,images:n.images.map(t=>({...t,async load(){throw new ft("image-queue-full",`Enterprise WeChat already has ${G9} prefetched images`,w("\u5F53\u524D\u5F85\u5904\u7406\u56FE\u7247\u8F83\u591A\uFF0C\u8BF7\u7A0D\u540E\u91CD\u65B0\u53D1\u9001\u3002"))}}))}}function uF(n){return Hn(n).msgtype==="text"?BF(n):""}function dUe(n){return Hn(n).msgtype==="text"&&!!hi(BF(n))}function Uw(n,t=iUe){let o=String(n??"").trim();if(!o)return[];let a=[],e="",i=0;for(let A of o){let r=Buffer.byteLength(A);e&&i+r>t?(a.push(e),e=A,i=r):(e+=A,i+=r)}return e&&a.push(e),a}function hUe(n){return n?.type==="tool"?w("\u6B63\u5728\u4F7F\u7528{name}\u2026",{name:n.name}):n?.text}function uB(n,t="",{finish:o=!1}={}){let a=String(n??"").replace(/<\/?think>/gi,"").trim(),e=String(t??"").trim();if(!a)return e;let i=o||e?`${a}`:`${a}`;return e?`${i} +`).trim()),t}function BF(n){let t=Hn(n),o=F9(t);return t.chattype==="group"?o.replace(/^\s*@\S+(?:\s+|$)/u,"").trim():o}function aUe(n){let t=Hn(n);return t.msgtype==="image"?[t.image]:t.msgtype!=="mixed"||!Array.isArray(t.mixed?.msg_item)?[]:t.mixed.msg_item.filter(o=>o?.msgtype==="image").map(o=>o.image)}function oUe(n){let t=Hn(n);return t.msgtype==="file"&&t.file&&typeof t.file=="object"?[t.file]:[]}function nUe(n){if(n?.msgtype==="image")return[{kind:"image"}];if(n?.msgtype==="voice")return[{kind:"audio"}];if(n?.msgtype==="file"){let t=hi(n.file?.filename??n.file?.file_name??n.file?.name);return[{kind:"file",...t?{name:t}:{}}]}return n?.msgtype!=="mixed"||!Array.isArray(n.mixed?.msg_item)?[]:n.mixed.msg_item.filter(t=>t?.msgtype==="image").map(()=>({kind:"image"}))}function sUe(n){let t=n?.quote;if(!t||typeof t!="object")return null;let o=F9(t),a=nUe(t),e=["text","image","mixed","voice","file"].includes(t.msgtype);return{...o?{content:o}:{},...a.length>0?{attachments:a}:{},...!o&&a.length===0?{unavailableReason:e?"not-delivered":"unsupported"}:{}}}function gUe(n,t){let o=hi(t?.url);if(!o)return null;let a=hi(t?.aeskey)??void 0;return{async load({signal:e,maxBytes:i}){if(e?.throwIfAborted(),typeof n?.downloadFile!="function")throw new Error("Enterprise WeChat image download is unavailable");let A=await n.downloadFile(o,a);e?.throwIfAborted();let r=A?.buffer;if(!Buffer.isBuffer(r)&&!(r instanceof Uint8Array))throw new Error("Enterprise WeChat image download returned no data");let s=Buffer.from(r);if(Number.isFinite(i)&&s.length>i)throw new Qt("image-too-large",`Enterprise WeChat image exceeds ${i} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return{data:s,name:A?.filename}}}}function cUe(n,t){let o=hi(t?.url);if(!o)return null;let a=hi(t?.aeskey)??void 0;return{name:hi(t?.filename??t?.file_name??t?.name)??"file",async load({signal:e}={}){if(e?.throwIfAborted(),typeof n?.downloadFile!="function")throw new Error("Enterprise WeChat file download is unavailable");let i=await n.downloadFile(o,a);e?.throwIfAborted();let A=i?.buffer??i?.data;if(!Buffer.isBuffer(A)&&!(A instanceof Uint8Array))throw new Error("Enterprise WeChat file download returned no data");return{data:Buffer.from(A),...hi(i?.filename)?{name:i.filename.trim()}:{}}}}}function pF(n,t){let o=Hn(n),a=sUe(o);return{content:BF(n),images:aUe(n).map(e=>gUe(t,e)).filter(Boolean),files:oUe(n).map(e=>cUe(t,e)).filter(Boolean),...a?{replyTo:a}:{}}}function IUe(n,t){return!Array.isArray(n?.files)||n.files.length===0?n:{...n,files:n.files.map(o=>{let a=o.load({signal:t});return a.catch(()=>{}),{...o,async load({signal:e}={}){e?.throwIfAborted();let i=await a;return e?.throwIfAborted(),i}}})}}function lUe(n,t){return kt(n)?{...n,images:n.images.map(o=>{let a=o.load({signal:t,maxBytes:k9});return a.catch(()=>{}),{...o,async load({signal:e,maxBytes:i=k9}={}){e?.throwIfAborted();let A=await a;e?.throwIfAborted();let r=A?.data??A?.buffer??A;if((Buffer.isBuffer(r)||r instanceof Uint8Array?r.length:0)>i)throw new Qt("image-too-large",`Enterprise WeChat image exceeds ${i} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));return A}}})}:n}function pUe(n){return{...n,images:n.images.map(t=>({...t,async load(){throw new Qt("image-queue-full",`Enterprise WeChat already has ${G9} prefetched images`,w("\u5F53\u524D\u5F85\u5904\u7406\u56FE\u7247\u8F83\u591A\uFF0C\u8BF7\u7A0D\u540E\u91CD\u65B0\u53D1\u9001\u3002"))}}))}}function uF(n){return Hn(n).msgtype==="text"?BF(n):""}function dUe(n){return Hn(n).msgtype==="text"&&!!hi(BF(n))}function Uw(n,t=iUe){let o=String(n??"").trim();if(!o)return[];let a=[],e="",i=0;for(let A of o){let r=Buffer.byteLength(A);e&&i+r>t?(a.push(e),e=A,i=r):(e+=A,i+=r)}return e&&a.push(e),a}function hUe(n){return n?.type==="tool"?w("\u6B63\u5728\u4F7F\u7528{name}\u2026",{name:n.name}):n?.text}function uB(n,t="",{finish:o=!1}={}){let a=String(n??"").replace(/<\/?think>/gi,"").trim(),e=String(t??"").trim();if(!a)return e;let i=o||e?`${a}`:`${a}`;return e?`${i} ${e}`:i}function EUe(n,t){let o=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||w("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u7684\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});case"artifact-permission-required":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA\u7F3A\u5C11\u7D20\u6750\u4E0A\u4F20\u6216\u6587\u4EF6\u6D88\u606F\u80FD\u529B\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u6743\u9650\u3002",{name:o});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-empty":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u4E3A\u7A7A\uFF0C\u4F01\u4E1A\u5FAE\u4FE1\u4E0D\u5141\u8BB8\u53D1\u9001\u7A7A\u6587\u4EF6\u3002",{name:o});case"artifact-changed":case"artifact-invalid":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u4F01\u4E1A\u5FAE\u4FE1\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u4F01\u4E1A\u5FAE\u4FE1\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6216\u6587\u4EF6\u6D88\u606F\u3002",{name:o});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u4F01\u4E1A\u5FAE\u4FE1\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function CF(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}function P9(n,t){return t?(t.throwIfAborted(),new Promise((o,a)=>{let e=!1,i=(r,s)=>{e||(e=!0,t.removeEventListener("abort",A),r(s))},A=()=>i(a,CF(t));t.addEventListener("abort",A,{once:!0}),Promise.resolve(n).then(r=>i(o,r),r=>i(a,r)),t.aborted&&A()})):n}function dF(n,{dispatched:t=!1}={}){if(n?.code?.startsWith?.("artifact-"))return n;let o=Number(n?.httpStatus??n?.status??n?.response?.status),a=Number(n?.providerCode??n?.errcode??n?.body?.errcode),e=new Error("Enterprise WeChat file delivery failed",{cause:n});return o===401||o===403||a===48002?e.code="artifact-permission-required":o===413?e.code="artifact-too-large":o===429||a===45009?e.code="artifact-rate-limited":Number.isFinite(a)&&a!==0?e.code="artifact-provider-rejected":e.code=t?"artifact-delivery-uncertain":"artifact-provider-failed",Number.isFinite(o)&&(e.status=o),Number.isFinite(a)&&(e.providerCode=a),e}async function L9(n,t,o,a,{signal:e,timeoutMs:i=EF}={}){if(e?.throwIfAborted(),typeof n?.uploadMedia!="function"||typeof n?.sendMediaMessage!="function"){let p=new Error(`Enterprise WeChat ${a} delivery is unavailable`);throw p.code="artifact-provider-unavailable",p}let A=AbortSignal.timeout(i),r=e?AbortSignal.any([e,A]):A,s;try{let p=n.uploadMedia(o.bytes,{type:a,filename:o.fileName});wn(o,p),s=await P9(p,r)}catch(p){throw e?.aborted?CF(e):dF(p)}e?.throwIfAborted();let g=hi(s?.media_id);if(!g){let p=new Error(`Enterprise WeChat ${a} upload returned no media id`);throw p.code="artifact-provider-rejected",p}let c;try{let p=n.sendMediaMessage(t,a,g);wn(o,p),c=await P9(p,r)}catch(p){throw e?.aborted?CF(e):dF(p,{dispatched:!0})}e?.throwIfAborted();let I=Number(c?.body?.errcode??c?.errcode);if(Number.isFinite(I)&&I!==0)throw dF({providerCode:I});return c}function uUe(n,t,o,a){return L9(n,t,o,"image",a)}function CUe(n,t,o,a){return L9(n,t,o,"file",a)}function BUe(n,t){return typeof n=="string"&&n.trim()?n:t.length>0?w("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):w("\u4EFB\u52A1\u5DF2\u5B8C\u6210\uFF0C\u4F46\u6CA1\u6709\u751F\u6210\u53EF\u663E\u793A\u7684\u6587\u672C\u3002")}function hF(n){return hi(n?.body?.msgid)??hi(n?.body?.message_id)}function fUe(n,t){return t.questions[t.index]&&hi(Hn(n).from?.userid)===t.actor&&hi(uF(n))}function fF(){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,artifactsSent:0,artifactSendErrors:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null}}var Hw=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g=new Map;#l=new Map;#n=new Map;#h=new Map;#d=new Set;#C=new Set;#u;#B=new va;#f=0;constructor({client:t,harness:o,state:a,contextEnhancement:e,accessPolicy:i,status:A=fF(),logger:r=console,replyTimeoutMs:s=6e5,generateStreamId:g=tUe,fileUploadTimeoutMs:c=EF,signal:I}){if(!t||typeof t.replyStream!="function"||typeof t.sendMessage!="function")throw new TypeError("Enterprise WeChat client is required");if(!o||!a)throw new TypeError("Harness client and state store are required");if(!Number.isInteger(c)||c<1)throw new TypeError("fileUploadTimeoutMs must be a positive integer");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g,this.#p=Math.min(c,EF),this.#s=I,this.#u=new _a({label:"wecom",logger:r})}get status(){return structuredClone(this.#o)}accept(t){if(this.#s?.aborted)return Promise.resolve();let o=Hn(t),a=hi(o.msgid),e=hi(o.from?.userid),i=o.chattype==="group"?hi(o.chatid):e;if(!a||!e||!i||!["single","group"].includes(o.chattype)||this.#t.hasSeen(a)||this.#h.has(a))return Promise.resolve();let A=v9(t),r=this.#l.get(A),s=pF(t,this.#e),g=hi(s.content)??"",c=o.chattype==="single"?"direct":"group",I=Mi(this.#I,{conversationType:c,senderIds:e,text:g,hasImages:kt(s),hasFiles:bt(s)});if(!I.allowed)return this.#h.set(a,null),this.#Q(t,a,i,I);this.#h.set(a,ai(this.#r,c)),o.chattype==="single"&&bo(this.#t,{chatId:i});let p=Pa(g),B=this.#B.status(A);if(p&&o.chattype==="group")return this.#w(t,a,i,{message:cs()});if(o.chattype==="single"&&(p||B.phase==="collecting")){let m=/^\/batch$/iu.test(g)&&B.phase==="idle"&&(this.#g.has(A)||r||this.#u.hasPending(A))?{handled:!0,kind:"busy",message:Po()}:this.#B.handle(A,g,{plainText:dUe(t)&&!Hr(s)});if(m.handled)return m.kind==="submit"?this.#m({...t,body:{...o,msgtype:"text",text:{content:m.prompt}}},a,A,{batchSubmission:m}):this.#w(t,a,i,m)}let f=Ki(g)?oo:bt(s)?null:la(g)?Ra:pa(g)?no:da(g)?ka:null;if(f){let y;return y=this.#y(t,a,i,A,s,f).catch(m=>{if(m?.code==="turn-stopped"||this.#s?.aborted)return;this.#o.lastError=m?.message??String(m);let T=rt(this.#o,m);return this.#c.error?.(`[dsh-im:wecom] failed to process a command [${T.referenceId}]`),this.#E(t,i,ut(T)).catch(()=>{})}).finally(()=>{this.#h.delete(a),this.#C.delete(y)}),this.#C.add(y),y}let Q=this.#u.claimReply({key:A,actor:e,messageId:a,text:uF(t),addressed:!0,hasPendingQuestion:!!r,questionCompletion:r?.submitting||r?.claimedReplyMessageId?r.queue:null,isQuestionPending:()=>this.#l.has(A),send:y=>this.#E(t,i,y)});if(Q){let y;return y=Q.process(async()=>this.#t.hasSeen(a)?!1:(await this.#t.markSeen(a),this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString(),!0)).finally(()=>{this.#h.delete(a),this.#d.delete(y)}),this.#d.add(y),y}if(r&&r.actor!==e)return this.#m(t,a,A);if(r?.submitting||r?.claimedReplyMessageId)return this.#m(t,a,A);if(r){fUe(t,r)&&(r.claimedReplyMessageId=a);let m=(r.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#D(t,a,e,i,A,r)).finally(()=>{this.#h.delete(a),r.claimedReplyMessageId===a&&(r.claimedReplyMessageId=null),r.queue===m&&(r.queue=null)});return r.queue=m,m}return this.#m(t,a,A)}#m(t,o,a,{releaseMessageId:e=!0,alreadyRecorded:i=!1,batchSubmission:A=null}={}){let r=pF(t,this.#e),s=r.images.length,g=0,c=r;s>0&&(this.#f+s<=G9?(g=s,this.#f+=g,c=lUe(r,this.#s)):c=pUe(r)),c=IUe(c,this.#s);let p=(this.#g.get(a)??Promise.resolve()).catch(()=>{}).then(()=>this.#M(t,{alreadyRecorded:i,preparedMessage:c,batchSubmission:A})).finally(()=>{this.#f-=g,e&&this.#h.delete(o),this.#g.get(a)===p&&this.#g.delete(a)});return this.#g.set(a,p),p}#w(t,o,a,e){let i;return i=Promise.resolve().then(async()=>{this.#t.hasSeen(o)||(await this.#t.markSeen(o),this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString(),e.message&&await this.#E(t,a,e.message),this.#o.lastError=null)}).catch(async A=>{if(this.#s?.aborted)return;this.#o.lastError=A?.message??String(A);let r=rt(this.#o,A);this.#c.error?.(`[dsh-im:wecom] failed to process a batch input message [${r.referenceId}]`),await this.#E(t,a,ut(r)).catch(()=>{})}).finally(()=>{this.#h.delete(o),this.#C.delete(i)}),this.#C.add(i),i}#Q(t,o,a,e){let i;return i=Promise.resolve().then(async()=>{this.#t.hasSeen(o)||(await this.#t.markSeen(o),e.reason==="command-not-allowed"?(this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString(),await this.#E(t,a,w(go)),this.#o.messagesReplied+=1,this.#o.lastReplyAt=new Date().toISOString()):(this.#o.messagesRejected+=1,this.#o.lastRejectedAt=new Date().toISOString()),this.#o.lastError=null)}).catch(A=>{this.#s?.aborted||(this.#o.lastError=A?.message??String(A),this.#c.error?.("[dsh-im:wecom] failed to apply inbound access policy",A))}).finally(()=>{this.#h.delete(o),this.#C.delete(i)}),this.#C.add(i),i}async waitForIdle(){await Promise.allSettled([...this.#g.values(),...[...this.#l.values()].flatMap(t=>t.queue?[t.queue]:[]),...this.#d,...this.#C])}async#y(t,o,a,e,i,A){if(this.#s?.throwIfAborted(),this.#t.hasSeen(o))return;await this.#t.markSeen(o),this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString();let r=await A(i.content,this.#A,this.#t,e,{signal:this.#s,isDirect:Hn(t).chattype==="single",hasImages:kt(i),hasFiles:bt(i),pendingInteraction:this.#l.has(e)||this.#u.hasPending(e),control:{owner:this,key:e}});r?.stopped&&await Promise.allSettled([this.#R(e),this.#u.closeRoute(e)]);for(let s of r?.messages??[r?.message])s&&await this.#E(t,a,s);this.#o.lastError=null}async#b(t,o){let a=[];for(let e of Uw(o)){this.#s?.throwIfAborted();let i=await this.#e.sendMessage(t,{msgtype:"markdown",markdown:{content:e}}),A=hF(i);A&&a.push(A)}return a}async#E(t,o,a){this.#s?.throwIfAborted();let e=Uw(a);if(e.length!==0)try{await this.#e.replyStream(t,this.#a("stream"),e[0],!0);for(let i of e.slice(1))await this.#e.sendMessage(o,{msgtype:"markdown",markdown:{content:i}})}catch{await this.#b(o,a)}}async#k(t,o,a=[],e=null){if(a.length===0)return{receipt:e,failureNoticeVisible:!1,artifactSendErrors:0};let i=await Lo({artifacts:a,baseReceipt:e,deliveryId:o,aggregatePresentation:e?"wecom-text-and-files":"wecom-files",alwaysMerge:!0,channelKey:"wecom",signal:this.#s,sendImage:A=>uUe(this.#e,t,A,{signal:this.#s,timeoutMs:this.#p}),sendFile:A=>CUe(this.#e,t,A,{signal:this.#s,timeoutMs:this.#p}),onFailure:(A,r)=>rt(this.#o,r,{userMessage:EUe(A?.fileName,r),reason:r?.code}),sendFailureNotice:(A,r,s)=>this.#b(t,ut(s)),logger:this.#c});return this.#o.artifactsSent=(this.#o.artifactsSent??0)+i.artifactsSent,this.#o.artifactSendErrors=(this.#o.artifactSendErrors??0)+i.artifactSendErrors,{receipt:i.receipt,failureNoticeVisible:i.failureNoticeVisible,artifactSendErrors:i.artifactSendErrors}}async#M(t,{alreadyRecorded:o=!1,preparedMessage:a,batchSubmission:e=null}={}){if(this.#s?.aborted)return;let i=Hn(t),A=typeof i.msgid=="string"?i.msgid:"",r=typeof i.from?.userid=="string"?i.from.userid:"",s=i.chattype==="group"?i.chatid:r;if(!A||!r||!s||!["single","group"].includes(i.chattype))return;if(!o){if(this.#t.hasSeen(A))return;this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString()}let g=a??pF(t,this.#e),c=g.content,I=kt(g),p=bt(g),B=Hr(g),f=v9(t),Q=null,y=!1,m=w("\u6B63\u5728\u601D\u8003\u4E2D\u2026"),T="",_=e===null,R=!1;try{if(!c&&!I&&!p&&!B){await this.#E(t,s,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\u548C\u8BED\u97F3\u8F6C\u5199\u6D88\u606F\u3002")),await this.#t.markSeen(A);return}let L=c.toLowerCase();if(!I&&!p&&L==="/help"){await this.#E(t,s,rUe()),await this.#t.markSeen(A);return}if(!I&&!p&&L==="/status"){await this.#A.ensureRunning({signal:this.#s}),await this.#E(t,s,w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002")),await this.#t.markSeen(A);return}if(!I&&!p&&L==="/new"){await this.#t.clearSession(f),await this.#E(t,s,w("\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002")),await this.#t.markSeen(A);return}let U=I||p?null:await Ro(c,this.#A,f);if(U){for(let oe of U.messages??[U.message])await this.#E(t,s,oe);await this.#t.markSeen(A);return}let F=I||p?null:await Na(c,this.#A,this.#t,f,{signal:this.#s});if(F){await this.#E(t,s,F.message),await this.#t.markSeen(A);return}Q=this.#a("stream");try{await this.#e.replyStream(t,Q,uB(m),!1),y=!0}catch(oe){this.#c.warn?.("[dsh-im:wecom] unable to start a stream; using an active reply:",oe)}let q=I||B?await Uo(g,{signal:this.#s}):void 0,z=this.#h.get(A),K=!1;if(z){let oe=q??c;q=vo(oe,z,()=>({channel:"wecom",senderId:r,chatId:s})),K=q!==oe}await this.#t.markSeen(A),R=!0;let{answer:G,artifacts:V=[]}=await Ta({harness:this.#A,state:this.#t,key:f,text:c,content:q,contextEnhanced:K,createOptions:{signal:this.#s},existsOptions:{signal:this.#s},askOptions:{timeoutMs:this.#i,signal:this.#s,control:{owner:this,key:f},onUpdate:y&&typeof this.#e.replyStreamNonBlocking=="function"?async oe=>{oe?.type==="text"?T=oe.text:m=hUe(oe)||m;let Se=Uw(uB(m,T))[0];Se&&await this.#e.replyStreamNonBlocking(t,Q,Se,!1)}:void 0,onInteraction:oe=>this.#S(oe,{key:f,actor:r,chatId:s,requiresMention:i.chattype==="group"}),onInteractionResolved:oe=>this.#T(oe),files:g.files}});e&&(this.#B.complete(f,e.token),_=!0),this.#s?.throwIfAborted();let H=BUe(G,V),N=Uw(uB(m,H,{finish:!0})),k=!1,J=null,X=null;try{if(y&&N.length>0)try{let oe=[],Se=await this.#e.replyStream(t,Q,N[0],!0),Be=hF(Se);Be&&oe.push(Be);for(let Re of N.slice(1)){let Ne=await this.#e.sendMessage(s,{msgtype:"markdown",markdown:{content:Re}}),Je=hF(Ne);Je&&oe.push(Je)}k=!0,J=tr({deliveryId:A,presentation:"wecom-text",providerMessageIds:oe})}catch(oe){this.#c.warn?.("[dsh-im:wecom] stream finalization failed; using an active reply:",oe)}if(!k){let oe=await this.#b(s,H);J=tr({deliveryId:A,presentation:"wecom-text",providerMessageIds:oe})}}catch(oe){X=Hi(oe),this.#c.warn?.("[dsh-im:wecom] final text delivery failed; continuing with result files:",oe)}let ie=await this.#k(s,A,V,J),De=ie.receipt?.artifacts?.some(({outcome:oe})=>oe==="sent"||oe==="unknown");if(X&&!De&&!ie.failureNoticeVisible)throw X;return X&&ie.artifactSendErrors===0&&rt(this.#o,X),R||await this.#t.markSeen(A),this.#o.messagesReplied+=1,this.#o.lastReplyAt=new Date().toISOString(),this.#o.lastError=null,!X&&ie.artifactSendErrors===0&&Mo(this.#o),ie.receipt}catch(L){let U=null;if(!_&&e&&(L?.code==="turn-stopped"?this.#B.complete(f,e.token):U=this.#B.fail(f,e.token).message??null,_=!0),L?.code==="turn-stopped"){y&&Q&&await this.#e.replyStream(t,Q,uB(m,w("\u5DF2\u505C\u6B62\u3002"),{finish:!0}),!0).catch(()=>{}),R||await this.#t.markSeen(A);return}if(this.#s?.aborted)return;this.#o.lastError=L?.message??String(L);let F=Fo(L)??No(L),q=rt(this.#o,L,{userMessage:F,reason:ao(L)?.reason});this.#c.error?.(`[dsh-im:wecom] failed to process an inbound message [${q.referenceId}]`);let z=ut(q),K=U?`${z} ${U}`:z;try{y&&Q?await this.#e.replyStream(t,Q,uB(m,K,{finish:!0}),!0):await this.#E(t,s,K),R||await this.#t.markSeen(A)}catch{this.#c.error?.("[dsh-im:wecom] failed to send the safe error reply")}}finally{await Promise.allSettled([this.#R(f),this.#u.closeRoute(f)])}}async#D(t,o,a,e,i,A){if(this.#s?.aborted)return;let r=this.#l.get(i),s=A.claimedReplyMessageId===o;if(!r||r!==A||r.submitting)return s&&(!r||r!==A)?this.#P(t,o,e):this.#m(t,o,i,{releaseMessageId:!1});if(this.#t.hasSeen(o))return;await this.#t.markSeen(o),this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString();let g=hi(uF(t));if(!g){await this.#E(t,e,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002")).catch(()=>{});return}let c=this.#l.get(i);if(!c||c!==A||c.submitting){if(s&&(!c||c!==A)){await this.#E(t,e,w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002")).catch(()=>{});return}return this.#m(t,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}if(c.actor!==a)return this.#m(t,o,i,{releaseMessageId:!1,alreadyRecorded:!0});if(c.chatId=e,c.needsPresentation){try{await this.#N(c)}catch{this.#o.lastError=w("\u4F01\u4E1A\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#c.error?.("[dsh-im:wecom] failed to retry an interaction question"),c.interaction.reconnect?.();return}let p=this.#l.get(i);if(!p||p!==A||p.submitting){if(s&&(!p||p!==A)){await this.#E(t,e,w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002")).catch(()=>{});return}return this.#m(t,o,i,{releaseMessageId:!1,alreadyRecorded:!0})}}let I=c.questions[c.index];if(I){if(c.answers.push(Ma(I,g)),c.index+=1,c.index{});return}if(this.#l.get(i)!==c)return;c.submitting=!1,c.answers.pop(),c.index-=1,this.#o.lastError=w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002"),this.#c.error?.("[dsh-im:wecom] failed to answer a Harness interaction"),await this.#E(t,e,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002")).catch(()=>{})}}}async#S(t,{key:o,actor:a,chatId:e,requiresMention:i}){if(t?.kind==="approval")return this.#u.handleRequested(t,{key:o,actor:a,requiresMention:i,send:c=>this.#b(e,c)});if(t?.kind!=="question")return;let A=t?.payload?.questions,r=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t?.rpcId!="string"||typeof r!="string"||typeof t.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!ba(c))){this.#c.warn?.("[dsh-im:wecom] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"Enterprise WeChat safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#b(e,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002")).catch(()=>{});return}let s=this.#l.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#N(s);return}if(this.#n.has(r))return;if(s){this.#c.warn?.("[dsh-im:wecom] cancelled a second pending Harness question"),await t.respond({ok:!1,error:{code:"cancelled",message:"Enterprise WeChat is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:a,requiresMention:i,questions:A,answers:[],index:0,chatId:e,queue:null,claimedReplyMessageId:null,submitting:!1,needsPresentation:!0,presentationPromise:null};this.#l.set(o,g),this.#n.set(g.interactionId,o),await this.#N(g)}async#T(t){if(t?.kind==="approval"){await this.#u.handleResolved(t);return}let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let a=this.#n.get(o);a&&this.#G(a,o)}#N(t){if(!t.needsPresentation)return Promise.resolve();if(t.presentationPromise)return t.presentationPromise;let o=t.questions[t.index];if(!o)return Promise.resolve();let a=this.#b(t.chatId,Ia(o,t.index,t.questions.length,{requiresMention:t.requiresMention})).then(()=>{t.needsPresentation=!1}).finally(()=>{t.presentationPromise===a&&(t.presentationPromise=null)});return t.presentationPromise=a,a}async#P(t,o,a){this.#t.hasSeen(o)||(await this.#t.markSeen(o),this.#o.messagesReceived+=1,this.#o.lastMessageAt=new Date().toISOString(),await this.#E(t,a,w("\u8FD9\u4E2A\u95EE\u9898\u5DF2\u5728\u5176\u4ED6\u5BA2\u6237\u7AEF\u5904\u7406\uFF0C\u65E0\u9700\u518D\u6B21\u56DE\u7B54\u3002")).catch(()=>{}))}#_(t,o){let a=this.#l.get(t);return!a||o!==void 0&&a.interactionId!==o?null:(this.#l.delete(t),this.#n.delete(a.interactionId),a)}#G(t,o){return this.#_(t,o)!==null}async#R(t){let o=this.#_(t);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The Enterprise WeChat interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(a){a?.code!=="interaction-not-pending"&&this.#c.warn?.("[dsh-im:wecom] failed to cancel a pending Harness interaction")}}};function SUe(){let n=new Error("Enterprise WeChat WebSocket authentication timed out");return n.code="connect-timeout",n}function wUe(){return{startedAt:null,ready:!1,wecomConnectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...fF()}}var CB=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g=wUe();#l=null;#n=null;#h=null;#d=null;#C=null;constructor({config:t,secret:o,harness:a,state:e,contextEnhancement:i,accessPolicy:A,logger:r=console,replyTimeoutMs:s=6e5,connectTimeoutMs:g=2e4,maxReconnectAttempts:c=10,createClient:I=p=>new yUe(p)}){if(!t||!o||!a||!e)throw new TypeError("WecomRuntime requires config, secret, Harness, and state");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g,this.#s=c,this.#p=I}get status(){return structuredClone(this.#g)}async start(){if(this.#g.ready&&this.#l)return this.status;if(this.#h)return this.#h;this.#C?.abort(new DOMException("Enterprise WeChat runtime replaced","AbortError"));let t=new AbortController;return this.#d=t,this.#C=t,this.#h=this.#u(t.signal).finally(()=>{this.#d===t&&(this.#d=null),this.#h=null}),this.#h}async#u(t){await this.#B(),t.throwIfAborted(),this.#g.startedAt=new Date().toISOString(),this.#g.wecomConnectionState="connecting",this.#g.lastError=null,await this.#t.ensureRunning(),this.#g.harnessReachable=!0;let o={debug(){},info(){},warn(){},error(){}},a=this.#p({botId:this.#e.remoteBotId,secret:this.#A,logger:o,maxReconnectAttempts:this.#s});if(!a||typeof a.connect!="function"||typeof a.disconnect!="function")throw new TypeError("Enterprise WeChat client factory returned an invalid client");this.#l=a,this.#n=new Hw({client:a,harness:this.#t,state:this.#r,contextEnhancement:this.#I,accessPolicy:this.#o,status:this.#g,logger:this.#c,replyTimeoutMs:this.#i,signal:t});let e,i,A=!1,r=new Promise((f,Q)=>{e=f,i=Q}),s=()=>{if(this.#l!==a||t.aborted)return;A=!0;let f=Date.now();this.#g.ready=!0,this.#g.wecomConnectionState="connected",this.#g.lastCheckedAt=f,this.#g.lastConnectedAt=f,this.#g.lastError=null,e()},g=()=>{this.#l===a&&(this.#g.ready=!1,this.#g.wecomConnectionState="connecting",this.#g.lastCheckedAt=Date.now())},c=()=>{this.#l===a&&(this.#g.ready=!1,this.#g.wecomConnectionState="connecting",this.#g.lastCheckedAt=Date.now())},I=f=>{if(this.#l!==a)return;let Q=f instanceof QUe||f instanceof mUe;!A&&Q&&i(f),Q&&(this.#g.ready=!1,this.#g.wecomConnectionState="failed"),this.#g.lastError=Q?f.name:"connection-error",this.#c.warn?.(`[dsh-im:wecom] bot ${this.#e.botId} connection error`)},p=f=>this.#n?.accept(f);a.on("authenticated",s),a.on("disconnected",g),a.on("reconnecting",c),a.on("error",I),a.on("message",p);let B;try{return a.connect(),await Promise.race([r,new Promise((f,Q)=>{t.addEventListener("abort",()=>Q(t.reason),{once:!0})}),new Promise((f,Q)=>{B=setTimeout(()=>Q(SUe()),this.#a)})]),this.status}catch(f){throw t.aborted?(await this.#B(),f):(this.#g.ready=!1,this.#g.wecomConnectionState="failed",this.#g.lastError=f?.message??String(f),await this.#B(),f)}finally{clearTimeout(B)}}async stop(){let t=this.#h;return this.#d?.abort(new DOMException("Enterprise WeChat runtime stopped","AbortError")),this.#C?.abort(new DOMException("Enterprise WeChat runtime stopped","AbortError")),this.#C=null,await this.#B(),await t?.catch(()=>{}),this.status}async sendConnectionTest(t){return Ec({state:this.#r,text:t,channelLabel:w("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"),send:async({chatId:o},a)=>{if(!this.#g.ready||!this.#l)throw new Error("Enterprise WeChat runtime is not connected");await this.#l.sendMessage(o,{msgtype:"markdown",markdown:{content:a}})}})}async sendProactiveText(t,o,{signal:a}={}){let e=typeof t?.route?.chatId=="string"?t.route.chatId.trim():"";if(t?.kind!=="user"&&t?.kind!=="group"||!e){let i=new TypeError("Invalid Enterprise WeChat proactive delivery target");throw i.code="invalid-target",i}if(!this.#g.ready||!this.#l){let i=new Error("Enterprise WeChat runtime is not connected");throw i.code="bot-not-connected",i}return a?.throwIfAborted(),await this.#l.sendMessage(e,{msgtype:"markdown",markdown:{content:o}}),{sent:!0}}async#B(){let t=this.#l,o=this.#n;this.#l=null,this.#n=null;try{t?.disconnect(),t?.removeAllListeners?.()}catch{this.#c.warn?.(`[dsh-im:wecom] bot ${this.#e.botId} failed to stop cleanly`)}await o?.waitForIdle(),this.#g.ready=!1,this.#g.wecomConnectionState="idle"}};var U9=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function DUe(n){if(!Array.isArray(n)||n.length===0)return[...U9];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...U9]}var Kw=class{#e;#A;#t;#r;#I;#o;#c;#i=null;#a=null;#s=0;#p=!1;#g=!1;#l;#n;constructor({controller:t,harness:o,logger:a=console,retryDelaysMs:e,healthyIntervalMs:i=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=a,this.#r=DUe(e),this.#I=Number.isFinite(i)&&i>=0?i:15e3,this.#o=A,this.#c=r,this.#l=new Promise(s=>{this.#n=s})}get ready(){return this.#l}start(){return this.#g||this.#p?this:(this.#g=!0,this.#h(0),this)}async close(){this.#p||(this.#p=!0,this.#i!==null&&this.#c(this.#i),this.#i=null,await this.#a?.catch(()=>{}),this.#n?.(null),this.#n=null)}#h(t){this.#p||(this.#i=this.#o(()=>{this.#i=null,this.#d()},t),this.#i?.unref?.())}async#d(){if(this.#p||this.#a)return;let t=this.#C();this.#a=t;try{await t}finally{this.#a===t&&(this.#a=null)}}async#C(){try{if(await this.#A.ensureRunning(),this.#p)return;let t=await this.#e.initialize();if(this.#p)return;this.#n?.(t),this.#n=null;let{configured:o,connected:a}=t.totals;if(axi(n),B=MUe(t),f=await new e(B.config).load(),Q=Fl(t.workspace??process.cwd()),y=o.WorkspaceStore??ni,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(J=>J.botId)),await Promise.all(T.map(J=>m.ensure(J.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("wecom",J)})));let _=typeof f.remove=="function"?Yi(f,{workspaces:m}):f,R=o.qrAuth??new g({source:t.qrSource??"deepseek-harness",platform:t.qrPlatform}),L=new Map,U=J=>Fl(B.bots,J,"state.json"),F=async J=>{let X=L.get(J);return X||(X=await new i(U(J)).load(),L.set(J,X)),X},q=zi(n,o.commandExecutor),{controlExecutor:z,sessionMaintenanceExecutor:K,fileIngressExecutor:G}=Vi(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),V=new A({...a,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...q?{commandExecutor:q}:{},...z?{controlExecutor:z}:{},...K?{sessionMaintenanceExecutor:K}:{},...G?{fileIngressExecutor:G}:{}}),H=new r({qrAuth:R,credentials:n.credentials,configStore:_,logger:I,createRuntime:async({botId:J,config:X,secret:ie})=>{let De=await F(J);await m.ensure(J,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("wecom",X)});let oe=ji(V,{botId:J,workspaces:m,state:De,agentPresetCatalog:p});return new s({config:X,secret:ie,harness:oe.harness,state:oe.state,contextEnhancement:{botId:J,getSettings:()=>m.contextEnhancementFor(J)},accessPolicy:Wi(m,J,{channel:"wecom",config:X}),groupSessionScope:{getScope:()=>m.groupSessionScopeFor(J)},replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??2e4,maxReconnectAttempts:t.maxReconnectAttempts??10,logger:{error:(...Se)=>I.error?.(`[${J}]`,...Se),warn:(...Se)=>I.warn?.(`[${J}]`,...Se),info:(...Se)=>I.info?.(`[${J}]`,...Se),debug:(...Se)=>I.debug?.(`[${J}]`,...Se)}})},deleteState:async({botId:J})=>{let X=L.get(J);if(L.delete(J),X&&typeof X.remove=="function")await X.remove();else try{await OUe(U(J))}catch(ie){if(ie?.code!=="ENOENT")throw ie}}}),N=Ji(H,{workspaces:m,stateFor:F,agentPresetCatalog:p}),k=c({controller:N,harness:V,logger:I,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:N,deliveryAdapter:qi({channel:"wecom",workspaces:m,coreController:H,stateFor:F}),ready:k.ready,async close(){await k.close(),await N.close(),V.stopManagedProcess()}}}import _Ue from"qrcode";var K9="/wecom",Vt=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",bindCredentials:"bot.bind-credentials",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:La,setAgentPreset:Ua,setContextEnhancement:Fa,setAccessPolicy:Xi,setGroupSessionScope:ea}),x9=Object.freeze(Object.values(Vt)),TUe=new Set(["secret","secretRef","scode","remoteBotId","verificationUrl","bot_info","botid"]);function wF(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function dh(n,t){return wF(n)&&Object.keys(n).every(o=>t.includes(o))}function mF(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function H9(n,t){return typeof n=="string"&&n.trim().length>0&&n.length<=t}function NUe(n,t){return wF(t)?n===Vt.status?dh(t,[])?null:"connection.status does not accept fields.":n===Vt.beginProvisioning?dh(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[Vt.pollProvisioning,Vt.cancelProvisioning].includes(n)?dh(t,["attemptId"])&&mF(t.attemptId)?null:`${n} requires an attemptId.`:n===Vt.bindCredentials?dh(t,["botId","secret"])&&H9(t.botId,512)&&H9(t.secret,1024)?null:"bot.bind-credentials requires Bot ID and Secret.":n===Vt.reconnectBot?dh(t,["botId","sendTest"])&&mF(t.botId)&&(t.sendTest===void 0||t.sendTest===!0)?null:"bot.reconnect requires a botId and optional sendTest=true.":n===Vt.deleteBot?dh(t,["botId","confirm"])&&mF(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Vt.setWorkspace?ta(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Vt.setAgentPreset?ia(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Vt.setContextEnhancement?Zi(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===Vt.setAccessPolicy?$i(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===Vt.setGroupSessionScope?Aa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u7FA4\u4F1A\u8BDD\u7B56\u7565\u3002":"Unknown Enterprise WeChat endpoint.":"Payload must be an object."}function hh(n){if(Array.isArray(n))return n.map(hh);if(!wF(n))return n;let t={};for(let[o,a]of Object.entries(n))TUe.has(o)||(t[o]=hh(a));return t}async function RUe(n){return _Ue.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function SF(n,t){return!n||typeof n.verificationUrl!="string"?hh(n):hh({...n,qrCodeDataUrl:await t(n.verificationUrl)})}async function Kg(n,t){let o=structuredClone(n);return o?.provisioning&&(o.provisioning=await SF(o.provisioning,t)),hh(o)}function Y9(n,{encodeQr:t=RUe}={}){for(let e of["status","startProvisioning","registrationStatus","cancelProvisioning","bindCredentials","reconnectBot","deleteBot"])if(typeof n?.[e]!="function")throw new TypeError(`A complete Enterprise WeChat controller is required (${e})`);let o=new Map,a=e=>{let i=o.get(e);return i||(o.size>=16&&o.delete(o.keys().next().value),i=Promise.resolve().then(()=>t(e)),o.set(e,i)),i};return async(e,i,A)=>{if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!x9.includes(e))return{ok:!1,error:{code:"bad-request",message:"Unknown Enterprise WeChat endpoint."}};let r=NUe(e,i);if(r)return{ok:!1,error:{code:"bad-request",message:r}};try{let s;if(e===Vt.status)s=await Kg(await n.status(),a);else if(e===Vt.beginProvisioning)s=await SF(await n.startProvisioning(),a);else if(e===Vt.pollProvisioning){let g=await n.registrationStatus(i.attemptId);if(!g)return{ok:!1,error:{code:"bad-request",message:"The provisioning attempt no longer exists."}};s=await SF(g,a)}else if(e===Vt.cancelProvisioning)s=hh(await n.cancelProvisioning(i.attemptId));else if(e===Vt.bindCredentials)s=await Kg(await n.bindCredentials(i),a);else if(e===Vt.reconnectBot){let g=await n.reconnectBot(i.botId);if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};let c;if(i.sendTest===!0)if(!g?.bots?.some(p=>p?.botId===i.botId&&p?.connected===!0)||typeof n.sendConnectionTest!="function")c=lr(Qr("\u4F01\u4E1A\u5FAE\u4FE1\u673A\u5668\u4EBA"));else try{await n.sendConnectionTest(i.botId),c=lr()}catch(p){c=lr(p)}s=await Kg({...g,...c?{testMessage:c}:{}},a)}else if(e===Vt.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await Kg(await n.updateWorkspace(i.botId,i.workspace),a)}else if(e===Vt.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(i.botId,i.config,g=>Kg(g,a))}else if(e===Vt.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(i.botId,i.policy,g=>Kg(g,a))}else if(e===Vt.setGroupSessionScope){if(typeof n.updateGroupSessionScope!="function")throw new Error("Group session scope update is unavailable");s=await n.updateGroupSessionScope(i.botId,i.groupSessionScope,g=>Kg(g,a))}else if(e===Vt.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await Kg(await n.updateAgentPreset(i.botId,i.agentPreset),a)}else s=await Kg(await n.deleteBot(i.botId),a);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:s}}catch(s){let g=ra(s);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:g??{code:"wecom-operation-failed",message:"\u4F01\u4E1A\u5FAE\u4FE1\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}}}function xw(n,t,o,a){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(K9,Y9(t,o),{authority:mr(a)})}async function j9(n,t={}){if(t?.controller)return xw(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await yF(n,t,t.internals),a=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=xw(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await a?.(),await o.close()},"dsh-im: close Enterprise WeChat bot connections"),e}import{unlink as ZHe}from"node:fs/promises";import{homedir as XHe}from"node:os";import{join as MB,resolve as Hl}from"node:path";import{createHash as aHe}from"node:crypto";import{mkdir as oHe,readFile as nHe,rename as sHe,unlink as gHe,writeFile as cHe}from"node:fs/promises";import{dirname as IHe}from"node:path";import{createCipheriv as kUe,createDecipheriv as vUe,createHash as J9,randomBytes as OF,randomUUID as q9}from"node:crypto";var Yw="https://ilinkai.weixin.qq.com/",PUe="2.4.6",GUe="3",W9="https://novac2c.cdn.weixin.qq.com/c2c",Ll=1800,bF="novac2c.cdn.weixin.qq.com",FUe="bot",LUe=2<<16|1024|6,UUe=15e3,z9=35e3,HUe=3,KUe=22n,xUe=Date.UTC(2020,0,1),YUe=1440*60*1e3,jUe=new Set(["wait","scaned","confirmed","expired","scaned_but_redirect","need_verifycode","verify_code_blocked","binded_redirect"]),NA=class extends Error{constructor(t,o,a={}){super(o,a),this.name="WeixinApiError",this.code=t,this.status=a.status,this.providerCode=a.providerCode}};function pt(n){return typeof n=="string"&&n.trim()?n.trim():null}function Z9(n){let t=n==null?null:String(n).trim();return t&&/^-?[A-Za-z0-9_.:-]{1,160}$/.test(t)?t:void 0}function X9(n,t){return Number.isInteger(t?.status)&&(n.status=t.status),t?.providerCode!==void 0&&(n.providerCode=t.providerCode),n}function fB(n,{fallback:t="artifact-provider-rejected"}={}){if(n?.code?.startsWith?.("artifact-"))return n;let o=Number(n?.status),a=Z9(n?.providerCode),e=a??"",i=t,A="Weixin could not prepare the file for delivery.";o===401||o===403||a==="401"||a==="403"||/(?:permission|forbidden|unauthor|access.?denied)/i.test(e)?(i="artifact-permission-required",A="Weixin denied permission to send the file."):o===413||a==="413"||/(?:too.?large|size.?limit)/i.test(e)?(i="artifact-too-large",A="The file exceeds Weixin's size limit."):o===429||a==="429"||/(?:rate.?limit|too.?many)/i.test(e)?(i="artifact-rate-limited",A="Weixin rate-limited file delivery."):t==="artifact-provider-rejected"&&(A="Weixin rejected the file message.");let r=new Error(A,{cause:n});return r.code=i,X9(r,n)}function JUe(n){let t=new Error("Weixin file delivery result is uncertain",{cause:n});return t.code="artifact-delivery-uncertain",X9(t,n)}function DF(n){if(!n||typeof n!="object")return null;for(let t of["ret","errcode"])if(n[t]!==void 0&&n[t]!==0&&n[t]!=="0")return Z9(n[t])??"rejected";return null}function qUe(n,t){if(t?.aborted)throw Eh(t);let o=Number(n?.status);return n?.code==="network-error"||n?.code==="timeout"||n?.code==="invalid-response"||o>=500&&o<600?JUe(n):fB(n)}function zUe(n){let t=pt(n);return!t||t.length%4!==0||!/^[A-Za-z0-9+/]+={0,2}$/.test(t)?null:Buffer.from(t,"base64")}function $9(n){let t=pt(n?.aeskey);if(t){if(!/^[0-9a-fA-F]{32}$/.test(t))throw new NA("invalid-image-key","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u5BC6\u94A5\u65E0\u6548\u3002");return Buffer.from(t,"hex")}let o=zUe(n?.media?.aes_key);if(o?.length===16)return o;if(o?.length===32&&/^[0-9a-fA-F]{32}$/.test(o.toString("ascii")))return Buffer.from(o.toString("ascii"),"hex");throw new NA("invalid-image-key","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u5BC6\u94A5\u65E0\u6548\u3002")}function eX(n,t){let o=Buffer.from(n),a=Buffer.from(t);if(a.length!==16||o.length===0||o.length%16!==0)throw new NA("invalid-image-ciphertext","\u5FAE\u4FE1\u56FE\u7247\u7684\u52A0\u5BC6\u6570\u636E\u65E0\u6548\u3002");try{let e=vUe("aes-128-ecb",a,null);return Buffer.concat([e.update(o),e.final()])}catch(e){throw new NA("image-decryption-failed","\u5FAE\u4FE1\u56FE\u7247\u89E3\u5BC6\u5931\u8D25\u3002",{cause:e})}}function AX(n){let t=pt(n?.encrypt_query_param);if(t)return`${W9}/download?encrypted_query_param=${encodeURIComponent(t)}`;let o=pt(n?.full_url);if(!o)throw new NA("missing-image-url","\u5FAE\u4FE1\u56FE\u7247\u6CA1\u6709\u53EF\u7528\u7684\u4E0B\u8F7D\u5730\u5740\u3002");let a;try{a=new URL(o)}catch{throw new NA("invalid-image-url","\u5FAE\u4FE1\u56FE\u7247\u7684\u4E0B\u8F7D\u5730\u5740\u65E0\u6548\u3002")}if(a.protocol!=="https:"||a.hostname!==bF||a.port&&a.port!=="443"||!a.pathname.startsWith("/c2c/"))throw new NA("untrusted-image-url","\u5FAE\u4FE1\u56FE\u7247\u7684\u4E0B\u8F7D\u5730\u5740\u4E0D\u53D7\u4FE1\u4EFB\u3002");return a.username="",a.password="",a.hash="",a.toString()}function MF(n,{fetchImpl:t=fetch}={}){if(typeof t!="function")throw new TypeError("fetchImpl must be a function");let o=[];for(let a of n?.item_list??[]){let e=a?.image_item;!e||typeof e!="object"||o.push({name:o.length===0?"image":`image-${o.length+1}`,load:async({signal:i,maxBytes:A})=>{let r=$9(e),s=AX(e.media),g=await To(s,{fetchImpl:t,signal:i,maxBytes:A+16,allowedHosts:[bF]});return eX(g,r)}})}return o}async function VUe(n,{fetchImpl:t,signal:o}){let a=await t(new URL(n),{method:"GET",signal:o,redirect:"manual"});if(!a?.ok)throw await a?.body?.cancel?.().catch?.(()=>{}),new NA("file-download-failed",`\u5FAE\u4FE1\u6587\u4EF6\u4E0B\u8F7D\u5931\u8D25\uFF08HTTP ${a?.status??"unknown"}\uFF09\u3002`,{status:a?.status});return Buffer.from(await a.arrayBuffer())}function _F(n,{fetchImpl:t=fetch}={}){if(typeof t!="function")throw new TypeError("fetchImpl must be a function");let o=[];for(let a of n?.item_list??[]){let e=a?.file_item;if(!e||typeof e!="object")continue;let i=Number(e.len);o.push({name:pt(e.file_name)??(o.length===0?"file":`file-${o.length+1}`),...Number.isFinite(i)&&i>=0?{size:i}:{},load:async({signal:A}={})=>{A?.throwIfAborted();let r=$9(e),s=AX(e.media),g=await VUe(s,{fetchImpl:t,signal:A});return A?.throwIfAborted(),eX(g,r)}})}return o}function TF(n){let t=n.toLowerCase().replace(/\.$/,"");return t==="weixin.qq.com"||t.endsWith(".weixin.qq.com")||t==="wechat.com"||t.endsWith(".wechat.com")}function uh(n){let t;try{t=new URL(n)}catch{throw new NA("invalid-base-url","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u8FDE\u63A5\u5730\u5740\u3002")}if(t.protocol!=="https:"||!TF(t.hostname)||t.port!==""&&t.port!=="443")throw new NA("untrusted-base-url","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u8FDE\u63A5\u5730\u5740\u3002");return t.username="",t.password="",t.search="",t.hash="",t.pathname.endsWith("/")||(t.pathname+="/"),t.toString()}function WUe(n){let t=pt(n);if(!t)throw new NA("invalid-qr","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u626B\u7801\u5730\u5740\u3002");let o;try{o=new URL(t)}catch{throw new NA("invalid-qr","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u626B\u7801\u5730\u5740\u3002")}if(o.protocol!=="https:"||!TF(o.hostname))throw new NA("untrusted-qr","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u626B\u7801\u5730\u5740\u3002");return o.toString()}function tX(){return{"iLink-App-Id":FUe,"iLink-App-ClientVersion":String(LUe)}}function ZUe(n){let t={...tX(),"content-type":"application/json",AuthorizationType:"ilink_bot_token","X-WECHAT-UIN":Buffer.from(String(OF(4).readUInt32BE(0)),"utf8").toString("base64")};return pt(n)&&(t.Authorization=`Bearer ${n.trim()}`),t}function Jc(){return{channel_version:PUe,bot_agent:"DeepSeekHarness/1.1.0"}}function XUe(n){return Math.ceil((n+1)/16)*16}function V9(n){let t;try{t=new URL(n)}catch{throw new NA("invalid-upload-url","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6548\u7684\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002")}if(t.protocol!=="https:"||t.hostname!==bF||t.port&&t.port!=="443"||t.pathname!=="/c2c/upload"||t.username||t.password)throw new NA("untrusted-upload-url","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u4E0D\u53D7\u4FE1\u4EFB\u7684\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002");return t.hash="",t}function $Ue(n,t){let o=pt(n?.upload_full_url);if(o)return V9(o);let a=pt(n?.upload_param);if(!a)throw new NA("missing-upload-url","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u6587\u4EF6\u4E0A\u4F20\u5730\u5740\u3002");let e=new URL(`${W9}/upload`);return e.searchParams.set("encrypted_query_param",a),e.searchParams.set("filekey",t),V9(e)}function eHe(n,t){let o=kUe("aes-128-ecb",t,null);return Buffer.concat([o.update(n),o.final()])}async function AHe(n,t,o,{signal:a}={}){let e;for(let i=1;i<=HUe;i+=1){a?.throwIfAborted();try{let A=await n(t,{method:"POST",headers:{"content-type":"application/octet-stream"},body:o,signal:a?AbortSignal.any([a,AbortSignal.timeout(6e4)]):AbortSignal.timeout(6e4),redirect:"error"});if(A.status>=400&&A.status<500)throw new NA("upload-rejected",`\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u88AB\u62D2\u7EDD\uFF08HTTP ${A.status}\uFF09\u3002`,{status:A.status});if(A.status!==200)throw new NA("upload-failed",`\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\uFF08HTTP ${A.status}\uFF09\u3002`,{status:A.status});let r=pt(A.headers.get("x-encrypted-param"));if(await A.body?.cancel?.().catch(()=>{}),!r)throw new NA("invalid-upload-response","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u54CD\u5E94\u7F3A\u5C11\u4E0B\u8F7D\u53C2\u6570\u3002");return r}catch(A){if(a?.aborted)throw Eh(a);if(A instanceof NA&&(A.code==="upload-rejected"||A.status<500))throw A;e=A}}throw e instanceof NA?e:new NA("upload-failed","\u5FAE\u4FE1\u6587\u4EF6\u4E0A\u4F20\u5931\u8D25\u3002",{cause:e})}function Eh(n){return n?.reason instanceof Error?n.reason:new DOMException("The operation was aborted","AbortError")}async function Rs(n,{method:t,baseUrl:o,endpoint:a,body:e,token:i,timeoutMs:A=UUe,signal:r,authenticated:s=!0}){let g=uh(o),c=new URL(a,g);if(!TF(c.hostname))throw new NA("untrusted-endpoint","\u62D2\u7EDD\u8BBF\u95EE\u4E0D\u53D7\u4FE1\u4EFB\u7684\u5FAE\u4FE1\u670D\u52A1\u5730\u5740\u3002");let I=new AbortController,p=!1,B=()=>I.abort(r?.reason);if(r?.aborted)throw Eh(r);r?.addEventListener("abort",B,{once:!0});let f=A>0?setTimeout(()=>{p=!0,I.abort()},A):null;try{let Q=await n(c,{method:t,headers:s?ZUe(i):tX(),...e===void 0?{}:{body:JSON.stringify(e)},signal:I.signal});if(!Q.ok)throw new NA("http-error",`\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u5931\u8D25\uFF08HTTP ${Q.status}\uFF09\u3002`,{status:Q.status});try{return await Q.json()}catch(y){throw new NA("invalid-response","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u89E3\u6790\u7684\u54CD\u5E94\u3002",{cause:y})}}catch(Q){throw r?.aborted?Eh(r):p?new NA("timeout","\u5FAE\u4FE1\u670D\u52A1\u8BF7\u6C42\u8D85\u65F6\u3002",{cause:Q}):Q instanceof NA?Q:new NA("network-error","\u6682\u65F6\u65E0\u6CD5\u8BBF\u95EE\u5FAE\u4FE1\u670D\u52A1\u3002",{cause:Q})}finally{f&&clearTimeout(f),r?.removeEventListener("abort",B)}}function tHe(n){if(!n||typeof n!="object"||!jUe.has(n.status))throw new NA("invalid-login-status","\u5FAE\u4FE1\u670D\u52A1\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u626B\u7801\u72B6\u6001\u3002");return n}function rX({fetchImpl:n=fetch}={}){if(typeof n!="function")throw new TypeError("fetchImpl must be a function");async function t({baseUrl:o,token:a,toUserId:e,file:i,contextToken:A,runId:r,signal:s},{mediaType:g,createItem:c}){let I=pt(e);if(!I||!i||typeof i!="object"||typeof i.fileName!="string"||!i.fileName||!Buffer.isBuffer(i.bytes))throw new TypeError("toUserId and a file are required");s?.throwIfAborted();let p=OF(16).toString("hex"),B=OF(16),f=J9("md5").update(i.bytes).digest("hex"),Q;try{Q=await Rs(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/getuploadurl",token:a,signal:s,body:{filekey:p,media_type:g,to_user_id:I,rawsize:i.bytes.byteLength,rawfilemd5:f,filesize:XUe(i.bytes.byteLength),no_need_thumb:!0,aeskey:B.toString("hex"),base_info:Jc()}})}catch(K){if(s?.aborted)throw Eh(s);let G=Number(K?.status),V=K?.code==="http-error"&&G>=400&&G<500?"artifact-provider-rejected":"artifact-provider-failed";throw fB(K,{fallback:V})}let y=DF(Q);if(y)throw fB(new NA("upload-url-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u4E0A\u4F20\u8BF7\u6C42\u3002",{providerCode:y}));let m=$Ue(Q,p),T=eHe(i.bytes,B),_;try{_=await AHe(n,m,T,{signal:s})}catch(K){if(s?.aborted)throw Eh(s);let G=Number(K?.status),V=K?.code==="upload-rejected"||G>=400&&G<500?"artifact-provider-rejected":"artifact-provider-failed";throw fB(K,{fallback:V})}s?.throwIfAborted();let R=pt(i.deliveryKey)??pt(i.artifactId)??q9(),L=g===3?R:`${R}\0${g}`,U=`dsh-weixin-${J9("sha256").update(L).digest("hex").slice(0,32)}`,F={encrypt_query_param:_,aes_key:Buffer.from(B.toString("hex")).toString("base64"),encrypt_type:1},q;try{q=await Rs(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/sendmessage",token:a,signal:s,body:{msg:{from_user_id:"",to_user_id:I,client_id:U,message_type:2,message_state:2,item_list:[c({file:i,media:F,ciphertextSize:T.byteLength})],...pt(A)?{context_token:A.trim()}:{},...pt(r)?{run_id:r.trim()}:{}},base_info:Jc()}})}catch(K){throw qUe(K,s)}let z=DF(q);if(z)throw fB(new NA("send-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u6587\u4EF6\u6D88\u606F\u3002",{providerCode:z}));return{messageId:U}}return Object.freeze({inboundImages(o){return MF(o,{fetchImpl:n})},inboundFiles(o){return _F(o,{fetchImpl:n})},async beginLogin({localTokens:o=[],botType:a=GUe,signal:e}={}){let i=[...new Set(o.map(pt).filter(Boolean))].slice(-10),A=await Rs(n,{method:"POST",baseUrl:Yw,endpoint:`ilink/bot/get_bot_qrcode?bot_type=${encodeURIComponent(a)}`,body:{local_token_list:i},timeoutMs:1e4,signal:e}),r=pt(A?.qrcode);if(!r)throw new NA("invalid-qr","\u5FAE\u4FE1\u670D\u52A1\u6CA1\u6709\u8FD4\u56DE\u4E8C\u7EF4\u7801\u4EE4\u724C\u3002");return{qrcode:r,qrcodeUrl:WUe(A.qrcode_img_content)}},async pollLogin({qrcode:o,baseUrl:a=Yw,verifyCode:e,signal:i}){let A=pt(o);if(!A)throw new TypeError("qrcode is required");let r=`ilink/bot/get_qrcode_status?qrcode=${encodeURIComponent(A)}`;pt(e)&&(r+=`&verify_code=${encodeURIComponent(e.trim())}`);let s=await Rs(n,{method:"GET",baseUrl:a,endpoint:r,timeoutMs:z9,signal:i,authenticated:!1});return tHe(s)},async getUpdates({baseUrl:o,token:a,getUpdatesBuf:e="",timeoutMs:i,signal:A}){try{return await Rs(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/getupdates",body:{get_updates_buf:e,base_info:Jc()},token:a,timeoutMs:i??z9,signal:A})}catch(r){if(r instanceof NA&&r.code==="timeout")return{ret:0,msgs:[],get_updates_buf:e};throw r}},async getConfig({baseUrl:o,token:a,toUserId:e,contextToken:i,signal:A}){let r=pt(e);if(!r)throw new TypeError("toUserId is required");let s=await Rs(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/getconfig",token:a,signal:A,timeoutMs:1e4,body:{ilink_user_id:r,...pt(i)?{context_token:i.trim()}:{},base_info:Jc()}});if(s?.ret!==void 0&&s.ret!==0)throw new NA("config-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u673A\u5668\u4EBA\u914D\u7F6E\u8BF7\u6C42\u3002");return{typingTicket:pt(s?.typing_ticket)}},async sendTyping({baseUrl:o,token:a,toUserId:e,typingTicket:i,status:A,signal:r}){let s=pt(e),g=pt(i);if(!s||!g)throw new TypeError("toUserId and typingTicket are required");if(A!==1&&A!==2)throw new TypeError("typing status must be 1 or 2");let c=await Rs(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/sendtyping",token:a,signal:r,timeoutMs:1e4,body:{ilink_user_id:s,typing_ticket:g,status:A,base_info:Jc()}});if(c?.ret!==void 0&&c.ret!==0)throw new NA("typing-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u8F93\u5165\u72B6\u6001\u8BF7\u6C42\u3002");return!0},async sendText({baseUrl:o,token:a,toUserId:e,text:i,contextToken:A,runId:r,signal:s}){let g=pt(e),c=pt(i);if(!g||!c)throw new TypeError("toUserId and text are required");let I=`dsh-weixin-${q9()}`,p=await Rs(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/sendmessage",token:a,signal:s,body:{msg:{from_user_id:"",to_user_id:g,client_id:I,message_type:2,message_state:2,item_list:[{type:1,text_item:{text:c}}],...pt(A)?{context_token:A.trim()}:{},...pt(r)?{run_id:r.trim()}:{}},base_info:Jc()}}),B=DF(p);if(B)throw new NA("send-rejected","\u5FAE\u4FE1\u670D\u52A1\u62D2\u7EDD\u4E86\u56DE\u590D\u6D88\u606F\u3002",{providerCode:B});return{...p&&typeof p=="object"?p:{},providerMessageIds:[I]}},async sendFile(o){return t(o,{mediaType:3,createItem:({file:a,media:e})=>({type:4,file_item:{media:e,file_name:a.fileName,len:String(a.bytes.byteLength)}})})},async sendImage(o){return t(o,{mediaType:1,createItem:({media:a,ciphertextSize:e})=>({type:2,image_item:{media:a,mid_size:e}})})},async notifyStart({baseUrl:o,token:a,signal:e}){let i=await Rs(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/msg/notifystart",token:a,signal:e,timeoutMs:1e4,body:{base_info:Jc()}});if(i?.ret!==void 0&&i.ret!==0)throw new NA("start-rejected","\u5FAE\u4FE1\u8D26\u53F7\u8FDE\u63A5\u542F\u52A8\u5931\u8D25\u3002");return i},async notifyStop({baseUrl:o,token:a,signal:e}){return Rs(n,{method:"POST",baseUrl:o,endpoint:"ilink/bot/msg/notifystop",token:a,signal:e,timeoutMs:1e4,body:{base_info:Jc()}})}})}function Ul(n){for(let t of n?.item_list??[]){if(t?.type===1&&typeof t.text_item?.text=="string"){let o=t.text_item.text.trim();if(o)return o}if(t?.type===3&&typeof t.voice_item?.text=="string"){let o=t.voice_item.text.trim();if(o)return o}}return null}function rHe(n){if(n?.type===2||n?.image_item&&typeof n.image_item=="object")return{kind:"image"};if(n?.type===3||n?.voice_item&&typeof n.voice_item=="object")return{kind:"audio"};if(n?.type===4||n?.file_item&&typeof n.file_item=="object"){let t=pt(n?.file_item?.file_name);return{kind:"file",...t?{name:t}:{}}}return n?.type===5||n?.video_item&&typeof n.video_item=="object"?{kind:"video"}:null}function iHe(n){let t=pt(n?.text_item?.text);return t||pt(n?.voice_item?.text)}function NF(n,{resolveContent:t,loadContent:o}={}){let a=(n?.item_list??[]).find(B=>B?.ref_msg&&typeof B.ref_msg=="object");if(!a)return null;let e=a.ref_msg,i=e.message_item&&typeof e.message_item=="object"?e.message_item:null,r=iHe(i)??pt(e.title),s=rHe(i),g=i?.msg_id===void 0||i?.msg_id===null?null:pt(String(i.msg_id)),c={messageId:g,createTimeMs:i?.create_time_ms??e.create_time_ms,updateTimeMs:i?.update_time_ms??e.update_time_ms};!r&&!s&&typeof t=="function"&&(r=pt(t(c)));let I=!r&&!s&&typeof o=="function"?B=>o(c,B):null,p=i&&[1,2,3,4,5,8].includes(i.type);return{...g?{messageId:g}:{},...r?{content:r}:{},...s?{attachments:[s]}:{},...I?{load:I}:{},...!r&&!s&&!I?{unavailableReason:i&&!p?"unsupported":"not-delivered"}:{}}}function jw(n,{now:t=Date.now()}={}){let o=n==null?"":String(n).trim();if(!/^\d{16,20}$/u.test(o))return null;try{let a=Number(BigInt(o)>>KUe);return!Number.isSafeInteger(a)||at+YUe?null:a}catch{return null}}function RF(n){return n?.message_id!==void 0&&n.message_id!==null?String(n.message_id):pt(n?.client_id)}function iX(n,t=Ll){if(n.length<=t)return[n];let o=[],a=n;for(;a.length>t;){let e=a.lastIndexOf(` @@ -428,13 +428,13 @@ ${U}`:z;try{y&&Q?await this.#e.replyStream(t,Q,uB(m,K,{finish:!0}),!0):await thi `);function dX(n){return`p2p:${n}`}function ir(n){return typeof n=="string"&&n.trim()?n.trim():null}function OB(n){let t=n==null?"":String(n).trim();return/^-?[A-Za-z0-9_.:-]{1,160}$/u.test(t)?t:"-"}function vHe(n){try{return OB(new URL(n).hostname.toLowerCase())}catch{return"-"}}function PHe({baseUrl:n,text:t,chunk:o,chunkIndex:a,chunkCount:e,maxMessageChars:i,contextToken:A,runId:r,error:s}){let g=Number(s?.status??s?.httpStatus),c=Number.isInteger(g)?String(g):s?.code==="send-rejected"?"2xx":"-";return["endpoint=sendmessage",`host=${vHe(n)}`,`chunk=${a+1}/${e}`,`chunkChars=${o.length}`,`chunkUtf8Bytes=${Buffer.byteLength(o,"utf8")}`,`totalChars=${t.length}`,`totalUtf8Bytes=${Buffer.byteLength(t,"utf8")}`,`limitChars=${i}`,`contextToken=${A?"yes":"no"}`,`runId=${r?"yes":"no"}`,`http=${c}`,`provider=${OB(s?.providerCode)}`,`cause=${OB(s?.code??s?.name)}`].join(" ")}function GHe(n,t){let o=PHe({...t,error:n}),a=new Error(`Weixin text delivery failed (${o})`,{cause:n}),e=OB(n?.code);a.code=e==="-"?"weixin-send-failed":e;let i=Number(n?.status??n?.httpStatus);Number.isInteger(i)&&(a.status=i);let A=OB(n?.providerCode);return A!=="-"&&(a.providerCode=A),a[EX]=o,a}function hX(n){let t=n;for(let o=0;t&&o<5;o+=1){let a=t[EX];if(typeof a=="string"&&a)return{reason:"weixin-send-failed",userMessage:[w("\u56DE\u590D\u5DF2\u7ECF\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u53D1\u9001\u5931\u8D25\uFF0C\u53EF\u80FD\u53EA\u6536\u5230\u90E8\u5206\u5185\u5BB9\u3002\u8BF7\u5C06\u4E0B\u9762\u7684\u8BCA\u65AD\u4FE1\u606F\u5B8C\u6574\u53CD\u9988\u7ED9\u7BA1\u7406\u5458\u3002"),w("\u5FAE\u4FE1\u53D1\u9001\u8BCA\u65AD\uFF1A{diagnostic}",{diagnostic:a})].join(` `)};t=t.cause}}function FHe(n,t,o,{loadReplyContent:a}={}){let e=ir(n?.from_user_id),i=NF(n,{resolveContent:A=>o?.recentOutboundTextFor?.({toUserId:e,...A}),...typeof a=="function"?{loadContent:(A,r)=>a({toUserId:e,...A},r)}:{}});return{content:Ul(n)??"",images:typeof t?.inboundImages=="function"?t.inboundImages(n):MF(n),files:typeof t?.inboundFiles=="function"?t.inboundFiles(n):_F(n),...i?{replyTo:i}:{}}}function wB(n){return Array.isArray(n?.item_list)&&n.item_list.some(t=>t?.image_item&&typeof t.image_item=="object")}function DB(n){return Array.isArray(n?.item_list)&&n.item_list.some(t=>t?.file_item&&typeof t.file_item=="object")}function LHe(n){return Array.isArray(n?.item_list)&&n.item_list.length>0&&n.item_list.every(t=>t?.type===1&&typeof t.text_item?.text=="string")&&!!ir(Ul(n))}function UHe(n,t){return t.questions[t.index]&&ir(n?.from_user_id)===t.actor&&!wB(n)&&!DB(n)&&ir(Ul(n))}function HHe(n,t){let o=String(n??w("\u7ED3\u679C\u6587\u4EF6")).replace(/[\r\n]+/g," ").trim()||w("\u7ED3\u679C\u6587\u4EF6");switch(t?.code){case"artifact-delivery-uncertain":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u53D1\u9001\u7ED3\u679C\u672A\u80FD\u786E\u8BA4\uFF0C\u8BF7\u5148\u68C0\u67E5\u804A\u5929\u5185\u662F\u5426\u5DF2\u6536\u5230\uFF0C\u4E0D\u8981\u7ACB\u5373\u91CD\u8BD5\u3002",{name:o});case"artifact-permission-required":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u673A\u5668\u4EBA\u5F53\u524D\u6CA1\u6709\u6587\u4EF6\u6D88\u606F\u53D1\u9001\u6743\u9650\uFF0C\u8BF7\u68C0\u67E5\u673A\u5668\u4EBA\u6587\u4EF6\u6D88\u606F\u80FD\u529B\u3002",{name:o});case"artifact-too-large":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u8D85\u8FC7\u5F53\u524D\u5FAE\u4FE1\u4F1A\u8BDD\u53EF\u53D1\u9001\u7684\u6587\u4EF6\u5927\u5C0F\uFF0C\u672A\u53D1\u9001\u3002",{name:o});case"artifact-rate-limited":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u88AB\u5FAE\u4FE1\u9650\u6D41\uFF0C\u672A\u80FD\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o});case"artifact-provider-rejected":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u5FAE\u4FE1\u62D2\u7EDD\u4E86\u8BE5\u6587\u4EF6\u6D88\u606F\u3002",{name:o});case"artifact-invalid":case"artifact-changed":case"artifact-unavailable":return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u6682\u65F6\u65E0\u6CD5\u8BFB\u53D6\u6216\u51C6\u5907\u53D1\u9001\uFF0C\u8BF7\u786E\u8BA4\u6587\u4EF6\u4ECD\u53EF\u8BBF\u95EE\u540E\u91CD\u8BD5\u3002",{name:o});default:return w("\u7ED3\u679C\u6587\u4EF6\u300C{name}\u300D\u5DF2\u751F\u6210\uFF0C\u4F46\u6682\u65F6\u672A\u80FD\u901A\u8FC7\u5FAE\u4FE1\u53D1\u9001\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",{name:o})}}function LF(){return{messagesReceived:0,messagesReplied:0,messagesRejected:0,lastMessageAt:null,lastReplyAt:null,lastRejectedAt:null,lastError:null,lastMessageError:null}}var $w=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g;#l;#n;#h=new Map;#d=new Map;#C=new Map;#u=new Map;#B=new Set;#f=new Set;#m;#w=new va;#Q=null;#y=null;#b=null;#E=0;#k=Promise.resolve();#M=!1;#D=0;#S=!1;constructor({api:t,baseUrl:o,token:a,ownerUserId:e,harness:i,state:A,contextEnhancement:r,accessPolicy:s,status:g=LF(),logger:c=console,replyTimeoutMs:I=6e5,maxMessageChars:p=Ll,typingKeepaliveMs:B=MHe,signal:f}){if(!t||typeof t.sendText!="function")throw new TypeError("Weixin API is required");if(!o||!a||!e)throw new TypeError("Weixin account credentials are required");if(!i||!A)throw new TypeError("Harness client and state store are required");if(!Number.isFinite(B)||B<=0)throw new TypeError("typingKeepaliveMs must be a positive number");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g,this.#s=c,this.#p=I,this.#g=p,this.#l=B,this.#n=f,this.#m=new _a({label:"weixin",logger:c})}get status(){return structuredClone(this.#a)}accept(t){if(this.#n?.aborted||t?.message_type===2)return Promise.resolve();let o=RF(t),a=ir(t?.from_user_id);if(!o||!a||this.#o.hasSeen(o)||this.#u.has(o))return Promise.resolve();let e=ir(Ul(t))??"",i=this.#i?Mi(this.#i,{conversationType:"direct",senderIds:a,text:e,hasImages:wB(t),hasFiles:DB(t)}):a===this.#r?{allowed:!0,reason:"legacy-owner"}:{allowed:!1,reason:"sender-not-allowed"};if(!i.allowed)return this.#u.set(o,null),this.#G(o,a,t,i);this.#u.set(o,ai(this.#c,"direct")),a===this.#r&&bo(this.#o,{toUserId:a});let A=dX(a),r=ir(t?.context_token)??void 0,s=ir(t?.run_id)??void 0,g=this.#d.get(A),c=Pa(e),I=this.#w.status(A);if(c||I.phase==="collecting"){let Q=/^\/batch$/iu.test(e)&&I.phase==="idle"&&(this.#h.has(A)||g||this.#m.hasPending(A))?{handled:!0,kind:"busy",message:Po()}:this.#w.handle(A,e,{plainText:LHe(t)&&!NF(t)});if(Q.handled)return Q.kind==="submit"?this.#T({...t,item_list:[{type:1,text_item:{text:Q.prompt}}]},o,A,{batchSubmission:Q}):this.#_(t,o,A,a,r,s,Q)}let p=Ki(e)?oo:DB(t)?null:la(e)?Ra:pa(e)?no:da(e)?ka:null;if(p){let f;return f=this.#R(t,o,A,a,r,s,e,p).catch(Q=>{if(Q?.code==="turn-stopped"||this.#n?.aborted)return;this.#a.lastError=Q?.message??String(Q);let y=rt(this.#a,Q);return this.#s.error?.(`[dsh-weixin] failed to process a command [${y.referenceId}]:`,Q),this.#Z(A,a,ut(y),r,s).catch(()=>{})}).finally(()=>{this.#u.delete(o),this.#f.delete(f)}),this.#f.add(f),f}let B=this.#m.claimReply({key:A,actor:a,messageId:o,text:wB(t)||DB(t)?"":Ul(t),addressed:!0,hasPendingQuestion:!!g,questionCompletion:g?.submitting||g?.claimedReplyMessageId?g.queue:null,isQuestionPending:()=>this.#d.has(A),send:f=>this.#H(a,f,r,s)});if(B){let f;return f=B.process(async()=>this.#o.hasSeen(o)?!1:(await this.#o.markSeen(o),this.#a.messagesReceived+=1,this.#a.lastMessageAt=new Date().toISOString(),!0)).finally(()=>{this.#u.delete(o),this.#B.delete(f)}),this.#B.add(f),f}if(g?.submitting||g?.claimedReplyMessageId)return this.#T(t,o,A);if(g){UHe(t,g)&&(g.claimedReplyMessageId=o);let Q=(g.queue??Promise.resolve()).catch(()=>{}).then(()=>this.#K(t,o,A,g)).catch(y=>this.#W(t,o,y)).finally(()=>{this.#u.delete(o),g.claimedReplyMessageId===o&&(g.claimedReplyMessageId=null),g.queue===Q&&(g.queue=null)});return g.queue=Q,Q}return this.#T(t,o,A)}#T(t,o,a,{releaseMessageId:e=!0,alreadyRecorded:i=!1,batchSubmission:A=null}={}){let r=Yp(this.#N(t),{signal:this.#n}),g=(this.#h.get(a)??Promise.resolve()).catch(()=>{}).then(()=>this.#x(t,a,{alreadyRecorded:i,preparedMessage:r,batchSubmission:A})).finally(()=>{e&&this.#u.delete(o),this.#h.get(a)===g&&this.#h.delete(a)});return this.#h.set(a,g),g}#N(t){return FHe(t,this.#e,this.#o,{loadReplyContent:(o,a)=>this.#P(o,a)})}async#P(t,{signal:o}={}){let a=this.#o.recentOutboundTextFor?.(t);if(a)return{content:a};let e=[jw(t?.messageId),Number(t?.createTimeMs),Number(t?.updateTimeMs)].find(Number.isSafeInteger);if(e===void 0)return{unavailableReason:"not-delivered"};let i=ir(t?.toUserId),A=i?this.#o.sessionFor(dX(i)):null,r=typeof A=="string"&&A?this.#I.workspaceSession?.(A):null;if(typeof r?.readHistory!="function")return{unavailableReason:"not-delivered"};let s=await Jp({session:r,quotedAt:e,signal:o,pageSize:_He,maxPages:THe,timeoutMs:NHe,toleranceMs:RHe});if(!s)return{unavailableReason:"not-delivered"};let g=ir(t?.messageId);try{await this.#o.rememberOutboundMessage?.({toUserId:i,text:s,sentAt:e,completedAt:e,providerMessageIds:g?[g]:[]})}catch(c){this.#s.warn?.("[dsh-weixin] failed to remember a recovered quote:",c)}return{content:s}}#_(t,o,a,e,i,A,r){let s;return s=Promise.resolve().then(async()=>{this.#o.hasSeen(o)||(await this.#o.markSeen(o),this.#a.messagesReceived+=1,this.#a.lastMessageAt=new Date().toISOString(),r.message&&await this.#Z(a,e,r.message,i,A),this.#a.lastError=null)}).catch(async g=>{if(this.#n?.aborted)return;this.#a.lastError=g?.message??String(g);let c=rt(this.#a,g);this.#s.error?.(`[dsh-weixin] failed to process a batch input message [${c.referenceId}]:`,g),await this.#Z(a,e,ut(c),i,A).catch(()=>{})}).finally(()=>{this.#u.delete(o),this.#f.delete(s)}),this.#f.add(s),s}#G(t,o,a,e){let i=ir(a?.context_token)??void 0,A=ir(a?.run_id)??void 0,r;return r=Promise.resolve().then(async()=>{this.#o.hasSeen(t)||(await this.#o.markSeen(t),e.reason==="command-not-allowed"?(this.#a.messagesReceived+=1,this.#a.lastMessageAt=new Date().toISOString(),await this.#H(o,w(go),i,A),this.#a.messagesReplied+=1,this.#a.lastReplyAt=new Date().toISOString()):(this.#a.messagesRejected+=1,this.#a.lastRejectedAt=new Date().toISOString()),this.#a.lastError=null)}).catch(s=>{this.#n?.aborted||(this.#a.lastError=s?.message??String(s),this.#s.error?.("[dsh-weixin] failed to apply inbound access policy:",s))}).finally(()=>{this.#u.delete(t),this.#f.delete(r)}),this.#f.add(r),r}async waitForIdle(){await Promise.allSettled([...this.#h.values(),...[...this.#d.values()].flatMap(t=>t.queue?[t.queue]:[]),...this.#B,...this.#f,this.#k])}async close(){this.#M=!0,await this.#$({signal:AbortSignal.timeout(5e3)})}async#R(t,o,a,e,i,A,r,s){if(this.#n?.throwIfAborted(),this.#o.hasSeen(o))return;await this.#o.markSeen(o),this.#a.messagesReceived+=1,this.#a.lastMessageAt=new Date().toISOString();let g=await s(r,this.#I,this.#o,a,{signal:this.#n,isDirect:!0,hasImages:wB(t),hasFiles:DB(t),pendingInteraction:this.#d.has(a)||this.#m.hasPending(a),control:{owner:this,key:a}});g?.stopped&&await Promise.allSettled([this.#v(a),this.#m.closeRoute(a)]);for(let c of g?.messages??[g?.message])c&&(g?.stopped?await this.#H(e,c,i,A):await this.#Z(a,e,c,i,A));this.#a.lastError=null}async#x(t,o,{alreadyRecorded:a=!1,preparedMessage:e,batchSubmission:i=null}={}){this.#n?.throwIfAborted();let A=RF(t),r=ir(t?.from_user_id);if(!A||!r)return;if(!a){if(this.#o.hasSeen(A))return;this.#a.messagesReceived+=1,this.#a.lastMessageAt=new Date().toISOString()}let s=typeof t.context_token=="string"?t.context_token:void 0,g=typeof t.run_id=="string"?t.run_id:void 0,c=i===null,I=!1;try{let p=e??this.#N(t),B=p.content,f=kt(p),Q=bt(p),y=Hr(p);if(!B&&!f&&!Q&&!y){await this.#H(r,w("\u76EE\u524D\u652F\u6301\u6587\u5B57\u3001\u56FE\u7247\u3001\u6587\u4EF6\uFF0C\u4EE5\u53CA\u5FAE\u4FE1\u5DF2\u8F6C\u6210\u6587\u5B57\u7684\u8BED\u97F3\u6D88\u606F\u3002"),s,g),await this.#o.markSeen(A);return}let m=B.trim().toLowerCase();if(!f&&!Q&&m==="/help"){await this.#H(r,kHe(),s,g),await this.#o.markSeen(A);return}if(!f&&!Q&&m==="/status"){await this.#I.ensureRunning({signal:this.#n}),await this.#H(r,w("\u5FAE\u4FE1\u4E0E DeepSeek Harness \u8FDE\u63A5\u6B63\u5E38\u3002"),s,g),await this.#o.markSeen(A);return}if(!f&&!Q&&m==="/new"){await this.#o.clearSession(o),await this.#H(r,w("\u5DF2\u5F00\u542F\u65B0\u4F1A\u8BDD\u3002\u8BF7\u53D1\u9001\u4F60\u7684\u95EE\u9898\u3002"),s,g),await this.#o.markSeen(A);return}let T=f||Q?null:await Ro(B,this.#I,o);if(T){for(let K of T.messages??[T.message])await this.#H(r,K,s,g);await this.#o.markSeen(A);return}let _=f||Q?null:await Na(B,this.#I,this.#o,o,{signal:this.#n});if(_){await this.#H(r,_.message,s,g),await this.#o.markSeen(A);return}let R,L=[];await this.#ie(r,s);try{let K=f||y?await Uo(p,{signal:this.#n}):void 0,G=this.#u.get(A),V=!1;if(G){let H=K??B;K=vo(H,G,()=>({channel:"weixin",senderId:r,chatId:r})),V=K!==H}await this.#o.markSeen(A),I=!0,{answer:R,artifacts:L=[]}=await Ta({harness:this.#I,state:this.#o,key:o,text:B,content:K,contextEnhanced:V,createOptions:{signal:this.#n},existsOptions:{signal:this.#n},askOptions:{timeoutMs:this.#p,signal:this.#n,control:{owner:this,key:o},onUpdate:()=>this.#Y(o,r,s),onInteraction:H=>this.#J(H,{key:o,actor:r,contextToken:s,runId:g}),onInteractionResolved:async H=>{await this.#U(H),await this.#Y(o,r,s)},files:p.files}}),i&&(this.#w.complete(o,i.token),c=!0)}finally{await Promise.allSettled([this.#$(),this.#v(o),this.#m.closeRoute(o)])}let U=typeof R=="string"&&R.trim()?R:L.length>0?w("\u7ED3\u679C\u6587\u4EF6\u5DF2\u751F\u6210\u3002"):R,F=null,q=null;try{q=tr({deliveryId:A,presentation:"weixin-text",providerMessageIds:await this.#H(r,U,s,g)})}catch(K){F=Hi(K)}let z=await this.#te(r,A,L,s,g,q);if(F&&!z.userVisible)throw F;return F&&z.artifactSendErrors===0&&rt(this.#a,F,hX(F)),I||await this.#o.markSeen(A),this.#a.messagesReplied+=1,this.#a.lastReplyAt=new Date().toISOString(),this.#a.lastError=null,!F&&z.artifactSendErrors===0&&Mo(this.#a),z.receipt}catch(p){let B=null;if(!c&&i&&(p?.code==="turn-stopped"?this.#w.complete(o,i.token):B=this.#w.fail(o,i.token).message??null,c=!0),p?.code==="turn-stopped"){I||await this.#o.markSeen(A);return}if(this.#n?.aborted)return;this.#a.lastError=p?.message??String(p);let f=Fo(p)??No(p),Q=ao(p),y=hX(p),m=rt(this.#a,p,{userMessage:f??y?.userMessage,reason:Q?.reason??y?.reason});this.#s.error?.(`[dsh-weixin] failed to process an inbound message [${m.referenceId}]:`,p);try{await this.#H(r,B?`${ut(m)} -${B}`:ut(m),s,g),I||await this.#o.markSeen(A)}catch(T){this.#s.error?.("[dsh-weixin] failed to send the safe error reply:",T)}}}async#K(t,o,a,e){this.#n?.throwIfAborted();let i=this.#d.get(a),A=e.claimedReplyMessageId===o;if(!i||i!==e||i.submitting)return A&&(!i||i!==e)?this.#L(t,o):this.#T(t,o,a,{releaseMessageId:!1});if(this.#o.hasSeen(o))return;await this.#o.markSeen(o),this.#a.messagesReceived+=1,this.#a.lastMessageAt=new Date().toISOString();let r=ir(Ul(t)),s=ir(t?.context_token)??void 0,g=ir(t?.run_id)??void 0;if(!r||wB(t)){await this.#H(e.actor,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"),s,g);return}let c=this.#d.get(a);if(!c||c!==e||c.submitting){if(A&&(!c||c!==e)){await this.#H(e.actor,Xw(),s,g);return}return this.#T(t,o,a,{releaseMessageId:!1,alreadyRecorded:!0})}if(c.contextToken=s,c.runId=g,c.needsPresentation){try{await this.#F(c)}catch{this.#a.lastError=w("\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#s.error?.("[dsh-weixin] failed to retry an interaction question"),c.interaction.reconnect?.();return}let p=this.#d.get(a);if(!p||p!==e||p.submitting){if(A&&(!p||p!==e)){await this.#H(e.actor,Xw(),s,g).catch(()=>{});return}return this.#T(t,o,a,{releaseMessageId:!1,alreadyRecorded:!0})}}let I=c.questions[c.index];if(I){if(c.answers.push(Ma(I,r)),c.index+=1,c.index{});return}if(this.#d.get(a)!==c)return;c.submitting=!1,c.answers.pop(),c.index-=1,this.#a.lastError=w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002"),this.#s.error?.("[dsh-weixin] failed to answer a Harness interaction"),await this.#H(c.actor,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002"),c.contextToken,c.runId).catch(()=>{})}}}async#J(t,{key:o,actor:a,contextToken:e,runId:i}){if(t?.kind==="approval")return this.#m.handleRequested(t,{key:o,actor:a,send:c=>this.#H(a,c,e,i)});if(t?.kind!=="question")return;let A=t?.payload?.questions,r=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t?.rpcId!="string"||typeof r!="string"||typeof t.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!ba(c))){this.#s.warn?.("[dsh-weixin] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"Weixin safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#H(a,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002"),e,i).catch(()=>{});return}let s=this.#d.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#F(s);return}if(this.#C.has(r))return;if(s){await t.respond({ok:!1,error:{code:"cancelled",message:"Weixin is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:a,questions:A,answers:[],index:0,contextToken:e,runId:i,queue:null,claimedReplyMessageId:null,presentationPromise:null,submitting:!1,needsPresentation:!0};this.#d.set(o,g),this.#C.set(r,o),await this.#F(g)}async#U(t){if(t?.kind==="approval"){await this.#m.handleResolved(t);return}let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let a=this.#C.get(o);a&&this.#q(a,o)}#F(t){if(!t.needsPresentation)return Promise.resolve();if(t.presentationPromise)return t.presentationPromise;let o=t.questions[t.index];if(!o)return Promise.resolve();let a=this.#H(t.actor,Ia(o,t.index,t.questions.length),t.contextToken,t.runId).then(()=>{t.needsPresentation=!1}).finally(()=>{t.presentationPromise===a&&(t.presentationPromise=null)});return t.presentationPromise=a,a}async#L(t,o){this.#o.hasSeen(o)||(await this.#o.markSeen(o),this.#a.messagesReceived+=1,this.#a.lastMessageAt=new Date().toISOString(),await this.#H(ir(t?.from_user_id),Xw(),ir(t?.context_token)??void 0,ir(t?.run_id)??void 0).catch(()=>{}))}#V(t,o){let a=this.#d.get(t);return!a||o!==void 0&&a.interactionId!==o?null:(this.#d.delete(t),this.#C.delete(a.interactionId),a)}#q(t,o){return this.#V(t,o)!==null}async#v(t){let o=this.#V(t);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The Weixin interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(a){a?.code!=="interaction-not-pending"&&this.#s.warn?.("[dsh-weixin] failed to cancel a pending Harness interaction")}}async#W(t,o,a){if(this.#n?.aborted)return;this.#a.lastError=a?.message??String(a);let e=rt(this.#a,a);this.#s.error?.(`[dsh-weixin] failed to process an interaction reply [${e.referenceId}]:`,a),this.#o.hasSeen(o)||await this.#o.markSeen(o).catch(()=>{}),await this.#H(ir(t?.from_user_id),ut(e),ir(t?.context_token)??void 0,ir(t?.run_id)??void 0).catch(()=>{})}async#H(t,o,a,e){await this.#$();let i=[],A=iX(o,this.#g);for(let r=0;r{}).then(t);return this.#k=o.catch(()=>{}),o}async#ie(t,o){let a=ir(t);if(!a||this.#M||this.#n?.aborted||Date.now(){if(e!==this.#E||this.#M)return!1;let i=this.#Q;if(!i){let A=await this.#e.getConfig({baseUrl:this.#A,token:this.#t,toUserId:a,contextToken:o,signal:this.#n});if(i=ir(A?.typingTicket),!i)return this.#D=Date.now()+FF,!1;if(e!==this.#E||this.#M)return!1;this.#Q=i,this.#D=0}return this.#y=a,await this.#e.sendTyping({baseUrl:this.#A,token:this.#t,toUserId:a,typingTicket:i,status:1,signal:this.#n}),e!==this.#E||this.#M?!1:(this.#S=!1,this.#D=0,this.#j(e),!0)})}catch(i){return e===this.#E&&(this.#Ae(),this.#S=!!(this.#y&&this.#Q),this.#D=Date.now()+FF),!this.#n?.aborted&&!this.#M&&this.#s.warn?.("[dsh-weixin] typing indicator failed:",i),!1}}async#$({signal:t=AbortSignal.timeout(5e3)}={}){++this.#E,this.#Ae();let o=this.#y,a=this.#Q,e=this.#S;if(this.#y=null,typeof this.#e.sendTyping!="function")return!1;try{return await this.#X(async()=>{if(!o||!a)return!1;try{await this.#e.sendTyping({baseUrl:this.#A,token:this.#t,toUserId:o,typingTicket:a,status:2,signal:t})}finally{e&&this.#Q===a&&(this.#Q=null),this.#S=!1}return!0})}catch(i){return t?.aborted||this.#s.warn?.("[dsh-weixin] typing cancellation failed:",i),!1}}#j(t){if(this.#Ae(),t!==this.#E||!this.#y||this.#M)return;let o=setTimeout(()=>{this.#b===o&&(this.#b=null),this.#X(async()=>t!==this.#E||!this.#y||this.#M?!1:(await this.#e.sendTyping({baseUrl:this.#A,token:this.#t,toUserId:this.#y,typingTicket:this.#Q,status:1,signal:this.#n}),!0)).then(a=>{a&&this.#j(t)}).catch(a=>{t===this.#E&&(this.#S=!!(this.#y&&this.#Q),this.#D=Date.now()+FF,!this.#n?.aborted&&!this.#M&&this.#s.warn?.("[dsh-weixin] typing keepalive failed:",a))})},this.#l);o.unref?.(),this.#b=o}#Ae(){this.#b&&clearTimeout(this.#b),this.#b=null}#Y(t,o,a){return this.#d.has(t)||this.#m.hasPending(t)?Promise.resolve(!1):this.#ie(o,a)}async#te(t,o,a,e,i,A){let r=(g,c)=>this.#e[g]({baseUrl:this.#A,token:this.#t,toUserId:t,file:c,contextToken:e,runId:i,signal:this.#n}),s=await Lo({artifacts:a,baseReceipt:A,deliveryId:o,aggregatePresentation:A?"weixin-text-and-files":"weixin-files",channelKey:"weixin",signal:this.#n,sendImage:typeof this.#e.sendImage=="function"?g=>r("sendImage",g):void 0,sendFile:typeof this.#e.sendFile=="function"?g=>r("sendFile",g):void 0,onFailure:(g,c)=>rt(this.#a,c,{userMessage:HHe(g?.fileName,c),reason:c?.code}),sendFailureNotice:(g,c,I)=>this.#H(t,ut(I),e,i),logger:this.#s});return this.#a.artifactsSent=(this.#a.artifactsSent??0)+s.artifactsSent,this.#a.artifactSendErrors=(this.#a.artifactSendErrors??0)+s.artifactSendErrors,{receipt:s.receipt,userVisible:s.userVisible,artifactSendErrors:s.artifactSendErrors}}};var KHe=Object.freeze([250,1e3,3e3]),xHe=new Set(["harness-connect-failed","harness-timeout","harness-auth-required","harness-proxy-auth-required","harness-loopback-forbidden","harness-host-untrusted","harness-request-forbidden","harness-api-not-found","harness-http-failed","harness-response-invalid","harness-rpc-rejected"]);function YHe(n){if(n===void 0)return[...KHe];if(!Array.isArray(n))throw new TypeError("startRetryDelaysMs must be an array");return n.map(t=>{if(!Number.isFinite(t)||t<0)throw new TypeError("startRetryDelaysMs must contain non-negative delays");return t})}function jHe(n){return n instanceof NA?n.code==="network-error"||n.code==="timeout"?!0:n.code==="http-error"&&(n.status===408||n.status===425||n.status===429||n.status>=500):!1}function JHe(n,t){let o=new Error(`Weixin runtime failed during ${n}`,{cause:t});return o.name="WeixinRuntimeStartError",o.code=n,o}function qHe(n){let t=xHe.has(n?.code)?n.code:"harness-check-unknown-failed";return JHe(t,n)}function uX(n,t){return new Promise((o,a)=>{if(t?.aborted){a(t.reason??new DOMException("Aborted","AbortError"));return}let i=setTimeout(()=>{t?.removeEventListener("abort",A),o()},n),A=()=>{clearTimeout(i),t?.removeEventListener("abort",A),a(t.reason??new DOMException("Aborted","AbortError"))};t?.addEventListener("abort",A,{once:!0})})}function zHe(n){if(!Array.isArray(n)||n.length<2)return Array.isArray(n)?n:[];let t=["seq","create_time_ms"].find(o=>n.every(a=>typeof a?.[o]=="number"&&Number.isFinite(a[o])||typeof a?.[o]=="string"&&a[o].trim()&&Number.isFinite(Number(a[o]))));return t?n.map((o,a)=>({message:o,index:a,order:Number(o[t])})).sort((o,a)=>o.order-a.order||o.index-a.index).map(({message:o})=>o):n}function VHe(){return{startedAt:null,ready:!1,weixinConnectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastError:null,...LF()}}var bB=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g=VHe();#l=null;#n=null;#h=null;#d=null;constructor({api:t,config:o,token:a,harness:e,state:i,contextEnhancement:A,accessPolicy:r,logger:s=console,replyTimeoutMs:g=6e5,maxMessageChars:c=Ll,startRetryDelaysMs:I}){if(!t||!o||!a||!e||!i)throw new TypeError("WeixinRuntime requires API, account, token, Harness, and state");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g,this.#s=c,this.#p=YHe(I)}get status(){return structuredClone(this.#g)}async start(){return this.#g.ready&&this.#h?this.status:this.#d?this.#d:(this.#d=this.#C().finally(()=>{this.#d=null}),this.#d)}async#C(){await this.stop(),this.#g.startedAt=new Date().toISOString(),this.#g.weixinConnectionState="connecting",this.#g.lastError=null;try{try{await this.#r.ensureRunning()}catch(o){throw qHe(o)}this.#g.harnessReachable=!0,await this.#u(),this.#n=new AbortController;let t=this.#n.signal;return this.#l=new $w({api:this.#e,baseUrl:this.#A.baseUrl,token:this.#t,ownerUserId:this.#A.ownerUserId,harness:this.#r,state:this.#I,contextEnhancement:this.#o,accessPolicy:this.#c,status:this.#g,logger:this.#i,replyTimeoutMs:this.#a,maxMessageChars:this.#s,signal:t}),this.#g.ready=!0,this.#g.weixinConnectionState="connected",this.#g.lastCheckedAt=Date.now(),this.#h=this.#B(t).catch(o=>{t.aborted||(this.#g.ready=!1,this.#g.weixinConnectionState="failed",this.#g.lastError=o?.message??String(o),this.#i.error?.(`[dsh-weixin] account ${this.#A.botId} monitor stopped:`,o))}),this.status}catch(t){throw this.#n?.abort(),this.#n=null,this.#l=null,this.#g.ready=!1,this.#g.weixinConnectionState="failed",this.#g.lastError=t?.message??String(t),t}}async#u(){for(let t=0;;t+=1)try{return await this.#e.notifyStart({baseUrl:this.#A.baseUrl,token:this.#t})}catch(o){let a=this.#p[t];if(a===void 0||!jHe(o))throw o;this.#i.warn?.(`[dsh-weixin] account ${this.#A.botId} start request failed; retrying in ${a}ms:`,o),await uX(a)}}async#B(t){let o=0;for(;!t.aborted;)try{let a=await this.#e.getUpdates({baseUrl:this.#A.baseUrl,token:this.#t,getUpdatesBuf:this.#I.getUpdatesBuf(),signal:t});if(t.aborted)return;if(a?.ret!==void 0&&a.ret!==0||a?.errcode!==void 0&&a.errcode!==0){let i=a.errcode??a.ret;throw new NA(i===-14?"stale-token":"updates-rejected",i===-14?w("\u5FAE\u4FE1\u767B\u5F55\u51ED\u636E\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("\u5FAE\u4FE1\u6D88\u606F\u540C\u6B65\u8BF7\u6C42\u88AB\u62D2\u7EDD\u3002"))}o=0,this.#g.ready=!0,this.#g.weixinConnectionState="connected",this.#g.lastCheckedAt=Date.now(),this.#g.lastError=null;for(let i of zHe(a?.msgs))this.#l.accept(i).catch(A=>{t.aborted||this.#i.error?.(`[dsh-weixin] account ${this.#A.botId} message handling failed:`,A)});typeof a?.get_updates_buf=="string"&&a.get_updates_buf&&await this.#I.setGetUpdatesBuf(a.get_updates_buf)}catch(a){if(t.aborted)return;if(o+=1,this.#g.lastError=a?.message??String(a),this.#i.warn?.(`[dsh-weixin] account ${this.#A.botId} poll failed (${o}/3):`,a),a instanceof NA&&a.code==="stale-token"||o>=3)throw a;await uX(Math.min(2e3*2**(o-1),1e4),t)}}async stop(){let t=this.#h,o=this.#l,a=!!(this.#n||t||this.#g.ready);if(this.#n?.abort(),this.#n=null,this.#h=null,await o?.close?.(),await t?.catch(()=>{}),await o?.waitForIdle(),this.#l=null,a)try{await this.#e.notifyStop({baseUrl:this.#A.baseUrl,token:this.#t,signal:AbortSignal.timeout(1e4)})}catch(e){this.#i.warn?.(`[dsh-weixin] account ${this.#A.botId} stop notification failed:`,e)}return this.#g.ready=!1,this.#g.weixinConnectionState="idle",this.status}async sendConnectionTest(t){let o=ZE(this.#I),a=typeof o?.toUserId=="string"&&o.toUserId.trim()?o.toUserId.trim():typeof this.#A.ownerUserId=="string"&&this.#A.ownerUserId.trim()?this.#A.ownerUserId.trim():null;if(!a)throw Qr(w("\u5FAE\u4FE1\u673A\u5668\u4EBA"));if(!this.#g.ready||!this.#n)throw new Error("Weixin runtime is not connected");return await this.#f({toUserId:a,text:t,signal:this.#n.signal}),{sent:!0}}async#f({toUserId:t,text:o,signal:a}){let e=Date.now(),i=await this.#e.sendText({baseUrl:this.#A.baseUrl,token:this.#t,toUserId:t,text:o,signal:a});try{await this.#I.rememberOutboundMessage?.({toUserId:t,text:o,sentAt:e,completedAt:Date.now(),providerMessageIds:Ur(i)})}catch(A){this.#i.warn?.("[dsh-weixin] failed to remember an outbound message:",A)}return i}async sendProactiveText(t,o,{signal:a}={}){let e=typeof t?.route?.toUserId=="string"?t.route.toUserId.trim():"";if(t?.kind!=="user"||!e){let i=new TypeError("Invalid Weixin proactive delivery target");throw i.code="invalid-target",i}if(!this.#g.ready||!this.#n){let i=new Error("Weixin runtime is not connected");throw i.code="bot-not-connected",i}return a?.throwIfAborted(),await this.#f({toUserId:e,text:o,signal:a??this.#n.signal}),{sent:!0}}};var CX=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function WHe(n){if(!Array.isArray(n)||n.length===0)return[...CX];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...CX]}var eD=class{#e;#A;#t;#r;#I;#o;#c;#i=null;#a=null;#s=0;#p=!1;#g=!1;#l;#n;constructor({controller:t,harness:o,logger:a=console,retryDelaysMs:e,healthyIntervalMs:i=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=a,this.#r=WHe(e),this.#I=Number.isFinite(i)&&i>=0?i:15e3,this.#o=A,this.#c=r,this.#l=new Promise(s=>{this.#n=s})}get ready(){return this.#l}start(){return this.#g||this.#p?this:(this.#g=!0,this.#h(0),this)}async close(){this.#p||(this.#p=!0,this.#i!==null&&this.#c(this.#i),this.#i=null,await this.#a?.catch(()=>{}),this.#n?.(null),this.#n=null)}#h(t){this.#p||(this.#i=this.#o(()=>{this.#i=null,this.#d()},t),this.#i?.unref?.())}async#d(){if(this.#p||this.#a)return;let t=this.#C();this.#a=t;try{await t}finally{this.#a===t&&(this.#a=null)}}async#C(){try{if(await this.#A.ensureRunning(),this.#p)return;let t=await this.#e.initialize();if(this.#p)return;this.#n?.(t),this.#n=null;let{configured:o,connected:a}=t.totals;if(axi(n),B=$He(t),f=await new e(B.config).load(),Q=Hl(t.workspace??process.cwd()),y=o.WorkspaceStore??ni,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(k=>k.botId)),await Promise.all(T.map(k=>m.ensure(k.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("weixin",k)})));let _=typeof f.remove=="function"?Yi(f,{workspaces:m}):f,R=new Map,L=k=>Hl(B.accounts,k,"state.json"),U=async k=>{let J=R.get(k);return J||(J=await new i(L(k)).load(),R.set(k,J)),J},F=zi(n,o.commandExecutor),{controlExecutor:q,sessionMaintenanceExecutor:z,fileIngressExecutor:K}=Vi(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),G=new A({...a,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...F?{commandExecutor:F}:{},...q?{controlExecutor:q}:{},...z?{sessionMaintenanceExecutor:z}:{},...K?{fileIngressExecutor:K}:{}}),V=new r({api:g,credentials:n.credentials,configStore:_,logger:I,createRuntime:async({botId:k,config:J,token:X})=>{let ie=await U(k);await m.ensure(k,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("weixin",J)});let De=ji(G,{botId:k,workspaces:m,state:ie,agentPresetCatalog:p});return new s({api:g,config:J,token:X,harness:De.harness,state:De.state,contextEnhancement:{botId:k,getSettings:()=>m.contextEnhancementFor(k)},accessPolicy:Wi(m,k,{channel:"weixin",config:J}),groupSessionScope:{getScope:()=>m.groupSessionScopeFor(k)},replyTimeoutMs:t.replyTimeoutMs??6e5,maxMessageChars:t.maxMessageChars??Ll,logger:{error:(...oe)=>I.error?.(`[${k}]`,...oe),warn:(...oe)=>I.warn?.(`[${k}]`,...oe),info:(...oe)=>I.info?.(`[${k}]`,...oe),debug:(...oe)=>I.debug?.(`[${k}]`,...oe)}})},deleteState:async({botId:k})=>{let J=R.get(k);if(R.delete(k),J&&typeof J.remove=="function")await J.remove();else try{await ZHe(L(k))}catch(X){if(X?.code!=="ENOENT")throw X}}}),H=Ji(V,{workspaces:m,stateFor:U,agentPresetCatalog:p}),N=c({controller:H,harness:G,logger:I,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:H,deliveryAdapter:qi({channel:"weixin",workspaces:m,coreController:V,stateFor:U}),ready:N.ready,async close(){await N.close(),await H.close(),G.stopManagedProcess()}}}import eKe from"qrcode";var BX="/weixin",Wt=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",submitVerification:"provision.verify",cancelProvisioning:"provision.cancel",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:La,setAgentPreset:Ua,setContextEnhancement:Fa,setAccessPolicy:Xi,setGroupSessionScope:ea}),fX=Object.freeze(Object.values(Wt));function QX(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function Bh(n,t){return QX(n)&&Object.keys(n).every(o=>t.includes(o))}function AD(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function AKe(n,t){return QX(t)?n===Wt.status?Bh(t,[])?null:"connection.status does not accept fields.":n===Wt.beginProvisioning?Bh(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[Wt.pollProvisioning,Wt.cancelProvisioning].includes(n)?Bh(t,["attemptId"])&&AD(t.attemptId)?null:`${n} requires an attemptId.`:n===Wt.submitVerification?Bh(t,["attemptId","verifyCode"])&&AD(t.attemptId)&&typeof t.verifyCode=="string"&&/^\d{4,8}$/.test(t.verifyCode)?null:"provision.verify requires an attemptId and a 4-to-8-digit code.":n===Wt.reconnectBot?Bh(t,["botId","sendTest"])&&AD(t.botId)&&(t.sendTest===void 0||t.sendTest===!0)?null:"bot.reconnect requires a botId and optional sendTest=true.":n===Wt.deleteBot?Bh(t,["botId","confirm"])&&AD(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Wt.setWorkspace?ta(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Wt.setAgentPreset?ia(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Wt.setContextEnhancement?Zi(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===Wt.setAccessPolicy?$i(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===Wt.setGroupSessionScope?Aa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u7FA4\u4F1A\u8BDD\u7B56\u7565\u3002":"Unknown Weixin endpoint.":"Payload must be an object."}function tD(n){return{ok:!1,error:{code:"bad-request",message:n}}}function _B(){return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}}function tKe(){return{ok:!1,error:{code:"weixin-operation-failed",message:"\u5FAE\u4FE1\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}async function rKe(n){return eKe.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function rD(n,t){return!n||!n.verificationUrl?n:{...n,qrCodeDataUrl:await t(n.verificationUrl)}}async function zc(n,t){let o=structuredClone(n);return o.provisioning&&(o.provisioning=await rD(o.provisioning,t)),o}function iKe(n){if(!n||typeof n.status!="function"||typeof n.startProvisioning!="function"||typeof n.registrationStatus!="function"||typeof n.submitVerification!="function"||typeof n.cancelProvisioning!="function"||typeof n.reconnectBot!="function"||typeof n.deleteBot!="function")throw new TypeError("A complete Weixin controller is required")}function yX(n,{encodeQr:t=rKe}={}){iKe(n);let o=new Map,a=e=>{let i=o.get(e);return i||(o.size>=16&&o.delete(o.keys().next().value),i=Promise.resolve().then(()=>t(e)),o.set(e,i)),i};return async(e,i,A)=>{if(A?.aborted)return _B();if(!fX.includes(e))return tD("Unknown Weixin endpoint.");let r=AKe(e,i);if(r)return tD(r);try{let s;if(e===Wt.status)s=await zc(await n.status(),a);else if(e===Wt.beginProvisioning){let g=await n.startProvisioning();if(A?.aborted)return await n.cancelProvisioning(g.attemptId),_B();s=await rD(g,a)}else if(e===Wt.pollProvisioning){let g=await n.registrationStatus(i.attemptId);if(!g)return tD("The provisioning attempt no longer exists.");s=await rD(g,a)}else if(e===Wt.submitVerification)s=await rD(await n.submitVerification(i.attemptId,i.verifyCode),a);else if(e===Wt.cancelProvisioning){if(s=await n.cancelProvisioning(i.attemptId),!s)return tD("The provisioning attempt no longer exists.")}else if(e===Wt.reconnectBot){let g=await n.reconnectBot(i.botId);if(A?.aborted)return _B();let c;if(i.sendTest===!0)if(!g?.bots?.some(p=>p?.botId===i.botId&&p?.connected===!0)||typeof n.sendConnectionTest!="function")c=lr(Qr("\u5FAE\u4FE1\u673A\u5668\u4EBA"));else try{await n.sendConnectionTest(i.botId),c=lr()}catch(p){c=lr(p)}s=await zc({...g,...c?{testMessage:c}:{}},a)}else if(e===Wt.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await zc(await n.updateWorkspace(i.botId,i.workspace),a)}else if(e===Wt.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(i.botId,i.config,g=>zc(g,a))}else if(e===Wt.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(i.botId,i.policy,g=>zc(g,a))}else if(e===Wt.setGroupSessionScope){if(typeof n.updateGroupSessionScope!="function")throw new Error("Group session scope update is unavailable");s=await n.updateGroupSessionScope(i.botId,i.groupSessionScope,g=>zc(g,a))}else if(e===Wt.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await zc(await n.updateAgentPreset(i.botId,i.agentPreset),a)}else s=await zc(await n.deleteBot(i.botId),a);return A?.aborted?_B():{ok:!0,value:s}}catch(s){let g=ra(s);return A?.aborted?_B():g?{ok:!1,error:g}:tKe()}}}function iD(n,t,o,a){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(BX,yX(t,o),{authority:mr(a)})}async function mX(n,t={}){if(t?.controller)return iD(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await HF(n,t,t.internals),a=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=iD(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await a?.(),await o.close()},"dsh-weixin: close account connections"),e}import{rm as d7e,unlink as h7e}from"node:fs/promises";import{homedir as E7e}from"node:os";import{join as jE,resolve as dc}from"node:path";import{createHash as aKe}from"node:crypto";import{mkdir as oKe,readFile as nKe,rename as sKe,unlink as gKe,writeFile as cKe}from"node:fs/promises";import{dirname as IKe}from"node:path";var KF=Object.freeze({version:2,bots:Object.freeze([])}),SX=/^whatsapp_[a-f0-9]{24}$/,lKe=/^[a-f0-9-]{36}$/,pKe=/^[1-9]\d{4,14}$/,xF=Object.freeze({selfOnly:"self-only",privateAllowlist:"private-allowlist",open:"open"});function fh(n){return typeof n=="string"&&n.trim()?n.trim():null}function aD(n){let t=fh(n)?.toLowerCase();return/^\d{5,32}@(s\.whatsapp\.net|lid)$/.test(t??"")?t:null}function YF(n){let t=aD(n);if(!t)throw new TypeError("A valid WhatsApp account JID is required");return`whatsapp_${aKe("sha256").update(t).digest("hex").slice(0,24)}`}function jF(n){let t=aD(n)?.split("@")[0]??"";return t?t.length<=7?`${t.slice(0,2)}\u2022\u2022\u2022${t.slice(-2)}`:`${t.slice(0,4)}\u2022\u2022\u2022\u2022${t.slice(-4)}`:w("WhatsApp\u8D26\u53F7")}function dKe(n){if(n===void 0)return Object.freeze([]);if(!Array.isArray(n))throw new TypeError("allowedNumbers must be an array of WhatsApp phone numbers");let t=n.map(o=>{let a=typeof o=="string"?o.trim().replace(/^\+/,""):"";if(!pKe.test(a))throw new TypeError("allowedNumbers contains an invalid WhatsApp phone number");return a});return Object.freeze([...new Set(t)])}function nD(n={}){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("WhatsApp access policy must be an object");let t=n.accessMode??xF.selfOnly;if(!Object.values(xF).includes(t))throw new TypeError("WhatsApp accessMode is invalid");return Object.freeze({accessMode:t,allowedNumbers:dKe(n.allowedNumbers)})}var oD=class{#e;#A=KF;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=this.#I(JSON.parse(await nKe(this.#e,"utf8")));if(!t)throw new Error("dsh-im WhatsApp config contains invalid account data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=KF}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(a=>a.botId===t);return o?structuredClone(o):null}getByAccountJid(t){let o=aD(t),a=this.#A.bots.find(e=>e.accountJid===o);return a?structuredClone(a):null}async save(t){let o=this.#r(t);if(!o)throw new Error("Refusing to persist incomplete WhatsApp account data");return this.#o(a=>{let e=a.find(r=>r.accountJid===o.accountJid&&r.botId!==o.botId),i=a.find(r=>r.authDirectory===o.authDirectory&&r.botId!==o.botId);if(e||i)throw new Error("Duplicate WhatsApp account identity");let A=a.findIndex(r=>r.botId===o.botId);return A===-1?a.push(o):a[A]=o,structuredClone(o)})}async remove(t){if(!SX.test(t))throw new TypeError("Invalid WhatsApp bot id");return this.#o(o=>{let a=o.findIndex(i=>i.botId===t);if(a===-1)return null;let[e]=o.splice(a,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await gKe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=KF});this.#t=t.then(()=>{},()=>{}),await t}#r(t){if(!t||typeof t!="object")return null;let o=aD(t.accountJid),a=fh(t.botId),e=fh(t.authDirectory),i=fh(t.name);if(!o||!a||!e||!i||!SX.test(a)||!lKe.test(e)||YF(o)!==a)return null;let A;try{A=nD(t)}catch{return null}return Object.freeze({botId:a,accountJid:o,authDirectory:e,name:i,createdAt:fh(t.createdAt)??new Date().toISOString(),connectedAt:fh(t.connectedAt),...A})}#I(t){if(!t||t.version!==2||!Array.isArray(t.bots))return null;let o=t.bots.map(A=>this.#r(A));if(o.some(A=>A===null))return null;let a=new Set,e=new Set,i=new Set;for(let A of o){if(a.has(A.botId)||e.has(A.accountJid)||i.has(A.authDirectory))return null;a.add(A.botId),e.add(A.accountJid),i.add(A.authDirectory)}return Object.freeze({version:2,bots:Object.freeze(o)})}async#o(t){let o,a=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let i=Object.freeze({version:2,bots:Object.freeze(e)});await this.#c(i),this.#A=i});return this.#t=a.then(()=>{},()=>{}),await a,o}async#c(t){await oKe(IKe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await cKe(o,`${JSON.stringify(t,null,2)} -`,{encoding:"utf8",mode:384}),await sKe(o,this.#e)}};var sD=class extends yr{constructor(t){super({...t,rpcIdPrefix:"whatsapp",logPrefix:"dsh-whatsapp"})}};var gD=class extends Cs{};import{randomUUID as hKe}from"node:crypto";var wX=new Set(["starting","pending","connecting"]),cD=new Set(["connected","failed","cancelled"]),EKe=6e4;function Vc(n,t){return Object.freeze({code:n,message:t})}function ID(n){return n?{attemptId:n.id,status:n.state,qrRevision:n.qrRevision,pollIntervalMs:1e3,...n.qrValue?{qrValue:n.qrValue}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.botId?{botId:n.botId}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}var TB=class{#e;#A;#t;#r;#I;#o;#c;#i=new Map;#a=new Map;#s=new Map;#p=new Map;#g=null;#l=0;#n=!1;constructor({configStore:t,authPath:o,createSession:a,createRuntime:e,deleteAuth:i=async()=>{},deleteState:A=async()=>{},logger:r=console}){if(!t||typeof t.list!="function"||typeof t.save!="function"||typeof t.remove!="function")throw new TypeError("WhatsappController requires a config store");if(typeof o!="function"||typeof a!="function"||typeof e!="function")throw new TypeError("WhatsappController dependencies are incomplete");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r}async initialize(){if(this.#n)return this.status();for(let t of this.#e.list())await this.#B(t.botId,async()=>{if(!(this.#n||this.#i.get(t.botId)?.status?.ready))try{await this.#C(t),this.#a.delete(t.botId)}catch(o){this.#a.set(t.botId,Vc(o?.code==="relink-required"?"relink-required":"connection-failed",o?.code==="relink-required"?w("WhatsApp \u5173\u8054\u8BBE\u5907\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#c.warn?.(`[dsh-im:whatsapp] bot ${t.botId} failed to initialize`)}finally{this.#f()}});return this.status()}async startProvisioning(){if(this.#n)throw new Error("WhatsApp controller is closed");this.#g&&await this.cancelProvisioning(this.#g);let t,o,a=!1,e=new Promise((r,s)=>{t=()=>{a||(a=!0,r())},o=g=>{a||(a=!0,s(g))}}),i=hKe(),A={id:i,state:"starting",authDirectory:i,createdAt:Date.now(),expiresAt:null,qrRevision:0,qrValue:null,controller:new AbortController,session:null,task:null,error:null,botId:null};this.#s.set(i,A),this.#g=i,this.#f();try{let r=await this.#t({authDir:this.#A(A.authDirectory),signal:A.controller.signal,logger:this.#c,onQr:s=>{A.controller.signal.aborted||cD.has(A.state)||typeof s!="string"||!s||(A.qrValue=s,A.qrRevision+=1,A.expiresAt=Date.now()+EKe,A.state="pending",this.#f(),t())}});return A.session=r,A.task=r.ready.then(s=>this.#h(A,s)).catch(s=>this.#d(A,s,o)),await e,ID(A)}catch(r){throw await this.#d(A,r,o),r}}registrationStatus(t){return ID(this.#s.get(t))}async cancelProvisioning(t){let o=this.#s.get(t);return o?(cD.has(o.state)||(o.controller.abort(),await o.session?.close().catch(()=>{}),await o.task?.catch(()=>{}),cD.has(o.state)||(o.state="cancelled",o.error=Vc("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))),await this.#I(o.authDirectory).catch(()=>{})),this.#g===o.id&&(this.#g=null),this.#f(),ID(o)):null}async reconnectBot(t){let o=this.#e.get(t);if(!o)throw new Error("Unknown WhatsApp bot");return await this.#B(t,async()=>{try{await this.#C(o),this.#a.delete(t)}catch(a){throw this.#a.set(t,Vc(a?.code==="relink-required"?"relink-required":"connection-failed",a?.code==="relink-required"?w("WhatsApp \u5173\u8054\u8BBE\u5907\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("WhatsApp \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),a}finally{this.#f()}}),this.status()}async sendConnectionTest(t){let o=this.#e.get(t);if(!o)throw new Error("Unknown WhatsApp bot");return this.#B(t,async()=>{let a=this.#i.get(t);if(!a?.status?.ready||typeof a.sendConnectionTest!="function"){let e=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw e.code="test-target-unavailable",e}return a.sendConnectionTest(Ui(`${o.name}\uFF08${jF(o.accountJid)}\uFF09`,w("WhatsApp\u673A\u5668\u4EBA")))})}async sendProactiveText(t,o,a,e={}){if(!this.#e.get(t))throw new Error("Unknown WhatsApp bot");return this.#B(t,async()=>{let A=this.#i.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,a,e)})}async setAccessPolicy(t,o){if(this.#n)throw new Error("WhatsApp controller is closed");let a=nD(o);return await this.#B(t,async()=>{if(this.#n)throw new Error("WhatsApp controller is closed");let e=this.#e.get(t);if(!e)throw new Error("Unknown WhatsApp bot");let i=await this.#e.save({...e,...a});this.#i.get(t)?.setAccessPolicy?.(i),this.#f()}),this.status()}async deleteBot(t){let o=this.#e.get(t);if(!o)throw new Error("Unknown WhatsApp bot");return await this.#B(t,async()=>{await this.#u(t);try{await this.#e.remove(t)}catch(a){throw await this.#C(o).catch(()=>{}),a}await Promise.allSettled([this.#I(o.authDirectory),this.#o({botId:t,config:o})]),this.#a.delete(t),this.#f()}),this.status()}status(){let t=this.#e.list().map(e=>{let i=this.#i.get(e.botId)?.status??null,A=i?.ready===!0&&i.connectionState==="connected"&&i.harnessReachable===!0,r=A?"connected":i?.connectionState==="connecting"?"connecting":this.#a.has(e.botId)||i?.connectionState==="failed"?"error":"offline";return{botId:e.botId,state:r,connected:A,configured:!0,bot:{name:e.name,idMasked:jF(e.accountJid)},health:{status:A?"healthy":r==="error"?"error":"offline",summary:A?w("WhatsApp Web \u5173\u8054\u8BBE\u5907\u8FD0\u884C\u6B63\u5E38"):r==="error"?w("WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA"):w("WhatsApp \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:i?.lastCheckedAt??null,lastConnectedAt:i?.lastConnectedAt??null},stats:{messagesReceived:i?.messagesReceived??0,messagesReplied:i?.messagesReplied??0},lastMessageError:ti(i?.lastMessageError),accessPolicy:nD(e),error:structuredClone(this.#a.get(e.botId)??null)}}),o=t.filter(e=>e.connected).length,a=this.#g?this.#s.get(this.#g):null;return{schemaVersion:1,revision:this.#l,state:a&&wX.has(a.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...a&&wX.has(a.state)?{provisioning:ID(a)}:{}}}async close(){this.#n||(this.#n=!0,this.#g&&await this.cancelProvisioning(this.#g),await Promise.allSettled([...this.#p.values()]),await Promise.allSettled([...this.#i.keys()].map(t=>this.#u(t))))}async#h(t,o){if(t.controller.signal.aborted||this.#n)return;t.state="connecting",t.qrValue=null,t.expiresAt=null,this.#f();let a=YF(o.accountJid);t.botId=a,await t.session?.close();let e=this.#e.get(a),i={botId:a,accountJid:o.accountJid,authDirectory:t.authDirectory,name:o.name,createdAt:e?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString(),accessMode:e?.accessMode,allowedNumbers:e?.allowedNumbers};try{if(t.controller.signal.aborted||this.#n)throw Object.assign(new Error,{name:"AbortError"});if(await this.#e.save(i),t.controller.signal.aborted||this.#n)throw Object.assign(new Error,{name:"AbortError"});try{await this.#C(i),this.#a.delete(a)}catch{this.#a.set(a,Vc("connection-failed",w("WhatsApp \u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#c.warn?.(`[dsh-im:whatsapp] bot ${a} did not reconnect after QR binding`)}e?.authDirectory&&e.authDirectory!==i.authDirectory&&await this.#I(e.authDirectory).catch(()=>{}),t.state="connected",t.error=null}catch(A){t.controller.signal.aborted||this.#n||A?.name==="AbortError"?(await this.#u(a),e?await this.#e.save(e).catch(()=>{}):await this.#e.remove(a).catch(()=>null)&&await this.#o({botId:a,config:i}).catch(s=>{this.#c.warn?.("[dsh-im:whatsapp] cancelled bot state cleanup failed:",s)}),await this.#I(t.authDirectory).catch(()=>{}),e&&await this.#C(e).catch(()=>{}),t.state="cancelled",t.error=Vc("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(await this.#I(t.authDirectory).catch(()=>{}),t.state="failed",t.error=Vc("activation-failed",w("WhatsApp \u5DF2\u626B\u7801\uFF0C\u4F46\u65E0\u6CD5\u4FDD\u5B58\u5173\u8054\u8BBE\u5907\u3002")),this.#c.error?.("[dsh-im:whatsapp] unable to persist linked-device session"))}finally{this.#g===t.id&&(this.#g=null),this.#f()}}async#d(t,o,a=()=>{}){cD.has(t.state)||(t.controller.signal.aborted||o?.name==="AbortError"?(t.state="cancelled",t.error=Vc("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(t.state="failed",t.error=Vc("qr-connect-failed",w("\u65E0\u6CD5\u8FDE\u63A5 WhatsApp\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002"))),this.#g===t.id&&(this.#g=null),await t.session?.close().catch(()=>{}),await this.#I(t.authDirectory).catch(()=>{}),this.#f(),a(o))}async#C(t){if(this.#n)throw new Error("WhatsApp controller is closed");if(await this.#u(t.botId),this.#n)throw new Error("WhatsApp controller is closed");let o=await this.#r({botId:t.botId,config:t,authDir:this.#A(t.authDirectory)});if(!o||typeof o.start!="function"||typeof o.stop!="function")throw new TypeError("createRuntime returned an invalid WhatsApp runtime");this.#i.set(t.botId,o);try{await o.start()}catch(a){throw await o.stop().catch(()=>{}),this.#i.delete(t.botId),a}}async#u(t){let o=this.#i.get(t);this.#i.delete(t),await o?.stop().catch(()=>{})}#B(t,o){let i=(this.#p.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#p.get(t)===i&&this.#p.delete(t)});return this.#p.set(t,i),i}#f(){this.#l+=1}};import{createHash as ZXe,randomBytes as sle}from"node:crypto";var v=ze(tS(),1),D=v.default.Reader,P=v.default.Writer,l=v.default.util,d=v.default.roots.default||(v.default.roots.default={});function ge(n,t){if(typeof n=="string")return n;if(typeof n=="number")return String(n);if(n&&typeof n.low=="number"&&typeof n.high=="number"){let o=BigInt(n.low>>>0),e=BigInt(n.high>>>0)<<32n|o;return!t&&n.high<0?(e-(1n<<64n)).toString():e.toString()}return String(n)}function ce(n,t){if(typeof n=="number")return n;if(typeof n=="string")return Number(n);if(n&&typeof n.low=="number"&&typeof n.high=="number"){let o=BigInt(n.low>>>0),e=BigInt(n.high>>>0)<<32n|o;return!t&&n.high<0?Number(e-(1n<<64n)):Number(e)}return Number(n)}var ne=d.proto=(()=>{let n={};return n.ADVDeviceIdentity=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.rawId=e.uint32();break}case 2:{s.timestamp=e.uint64();break}case 3:{s.keyIndex=e.uint32();break}case 4:{s.accountType=e.int32();break}case 5:{s.deviceType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ADVDeviceIdentity)return e;var i=new d.proto.ADVDeviceIdentity;switch(e.rawId!=null&&(i.rawId=e.rawId>>>0),e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.keyIndex!=null&&(i.keyIndex=e.keyIndex>>>0),e.accountType){default:if(typeof e.accountType=="number"){i.accountType=e.accountType;break}break;case"E2EE":case 0:i.accountType=0;break;case"HOSTED":case 1:i.accountType=1;break}switch(e.deviceType){default:if(typeof e.deviceType=="number"){i.deviceType=e.deviceType;break}break;case"E2EE":case 0:i.deviceType=0;break;case"HOSTED":case 1:i.deviceType=1;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.rawId!=null&&e.hasOwnProperty("rawId")&&(A.rawId=e.rawId,i.oneofs&&(A._rawId="rawId")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=i.longs===String?String(e.timestamp):e.timestamp:A.timestamp=i.longs===String?ge(e.timestamp,!0):i.longs===Number?ce(e.timestamp,!0):e.timestamp,i.oneofs&&(A._timestamp="timestamp")),e.keyIndex!=null&&e.hasOwnProperty("keyIndex")&&(A.keyIndex=e.keyIndex,i.oneofs&&(A._keyIndex="keyIndex")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=i.enums===String?d.proto.ADVEncryptionType[e.accountType]===void 0?e.accountType:d.proto.ADVEncryptionType[e.accountType]:e.accountType,i.oneofs&&(A._accountType="accountType")),e.deviceType!=null&&e.hasOwnProperty("deviceType")&&(A.deviceType=i.enums===String?d.proto.ADVEncryptionType[e.deviceType]===void 0?e.deviceType:d.proto.ADVEncryptionType[e.deviceType]:e.deviceType,i.oneofs&&(A._deviceType="deviceType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVDeviceIdentity"},t})(),n.ADVEncryptionType=(function(){let t={},o=Object.create(t);return o[t[0]="E2EE"]=0,o[t[1]="HOSTED"]=1,o})(),n.ADVKeyIndexList=(function(){function t(a){if(this.validIndexes=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.rawId=e.uint32();break}case 2:{s.timestamp=e.uint64();break}case 3:{s.currentIndex=e.uint32();break}case 4:{if(s.validIndexes&&s.validIndexes.length||(s.validIndexes=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos>>0),e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.currentIndex!=null&&(i.currentIndex=e.currentIndex>>>0),e.validIndexes){if(!Array.isArray(e.validIndexes))throw TypeError(".proto.ADVKeyIndexList.validIndexes: array expected");i.validIndexes=[];for(var A=0;A>>0}switch(e.accountType){default:if(typeof e.accountType=="number"){i.accountType=e.accountType;break}break;case"E2EE":case 0:i.accountType=0;break;case"HOSTED":case 1:i.accountType=1;break}return i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.validIndexes=[]),e.rawId!=null&&e.hasOwnProperty("rawId")&&(A.rawId=e.rawId,i.oneofs&&(A._rawId="rawId")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=i.longs===String?String(e.timestamp):e.timestamp:A.timestamp=i.longs===String?ge(e.timestamp,!0):i.longs===Number?ce(e.timestamp,!0):e.timestamp,i.oneofs&&(A._timestamp="timestamp")),e.currentIndex!=null&&e.hasOwnProperty("currentIndex")&&(A.currentIndex=e.currentIndex,i.oneofs&&(A._currentIndex="currentIndex")),e.validIndexes&&e.validIndexes.length){A.validIndexes=[];for(var r=0;r>>3){case 1:{s.details=e.bytes();break}case 2:{s.accountSignatureKey=e.bytes();break}case 3:{s.accountSignature=e.bytes();break}case 4:{s.deviceSignature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ADVSignedDeviceIdentity)return e;var i=new d.proto.ADVSignedDeviceIdentity;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,i.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(i.details=e.details)),e.accountSignatureKey!=null&&(typeof e.accountSignatureKey=="string"?l.base64.decode(e.accountSignatureKey,i.accountSignatureKey=l.newBuffer(l.base64.length(e.accountSignatureKey)),0):e.accountSignatureKey.length>=0&&(i.accountSignatureKey=e.accountSignatureKey)),e.accountSignature!=null&&(typeof e.accountSignature=="string"?l.base64.decode(e.accountSignature,i.accountSignature=l.newBuffer(l.base64.length(e.accountSignature)),0):e.accountSignature.length>=0&&(i.accountSignature=e.accountSignature)),e.deviceSignature!=null&&(typeof e.deviceSignature=="string"?l.base64.decode(e.deviceSignature,i.deviceSignature=l.newBuffer(l.base64.length(e.deviceSignature)),0):e.deviceSignature.length>=0&&(i.deviceSignature=e.deviceSignature)),i},t.toObject=function(e,i){i||(i={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=i.bytes===String?l.base64.encode(e.details,0,e.details.length):i.bytes===Array?Array.prototype.slice.call(e.details):e.details,i.oneofs&&(A._details="details")),e.accountSignatureKey!=null&&e.hasOwnProperty("accountSignatureKey")&&(A.accountSignatureKey=i.bytes===String?l.base64.encode(e.accountSignatureKey,0,e.accountSignatureKey.length):i.bytes===Array?Array.prototype.slice.call(e.accountSignatureKey):e.accountSignatureKey,i.oneofs&&(A._accountSignatureKey="accountSignatureKey")),e.accountSignature!=null&&e.hasOwnProperty("accountSignature")&&(A.accountSignature=i.bytes===String?l.base64.encode(e.accountSignature,0,e.accountSignature.length):i.bytes===Array?Array.prototype.slice.call(e.accountSignature):e.accountSignature,i.oneofs&&(A._accountSignature="accountSignature")),e.deviceSignature!=null&&e.hasOwnProperty("deviceSignature")&&(A.deviceSignature=i.bytes===String?l.base64.encode(e.deviceSignature,0,e.deviceSignature.length):i.bytes===Array?Array.prototype.slice.call(e.deviceSignature):e.deviceSignature,i.oneofs&&(A._deviceSignature="deviceSignature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedDeviceIdentity"},t})(),n.ADVSignedDeviceIdentityHMAC=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.details=e.bytes();break}case 2:{s.hmac=e.bytes();break}case 3:{s.accountType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ADVSignedDeviceIdentityHMAC)return e;var i=new d.proto.ADVSignedDeviceIdentityHMAC;switch(e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,i.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(i.details=e.details)),e.hmac!=null&&(typeof e.hmac=="string"?l.base64.decode(e.hmac,i.hmac=l.newBuffer(l.base64.length(e.hmac)),0):e.hmac.length>=0&&(i.hmac=e.hmac)),e.accountType){default:if(typeof e.accountType=="number"){i.accountType=e.accountType;break}break;case"E2EE":case 0:i.accountType=0;break;case"HOSTED":case 1:i.accountType=1;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=i.bytes===String?l.base64.encode(e.details,0,e.details.length):i.bytes===Array?Array.prototype.slice.call(e.details):e.details,i.oneofs&&(A._details="details")),e.hmac!=null&&e.hasOwnProperty("hmac")&&(A.hmac=i.bytes===String?l.base64.encode(e.hmac,0,e.hmac.length):i.bytes===Array?Array.prototype.slice.call(e.hmac):e.hmac,i.oneofs&&(A._hmac="hmac")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=i.enums===String?d.proto.ADVEncryptionType[e.accountType]===void 0?e.accountType:d.proto.ADVEncryptionType[e.accountType]:e.accountType,i.oneofs&&(A._accountType="accountType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedDeviceIdentityHMAC"},t})(),n.ADVSignedKeyIndexList=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.details=e.bytes();break}case 2:{s.accountSignature=e.bytes();break}case 3:{s.accountSignatureKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ADVSignedKeyIndexList)return e;var i=new d.proto.ADVSignedKeyIndexList;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,i.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(i.details=e.details)),e.accountSignature!=null&&(typeof e.accountSignature=="string"?l.base64.decode(e.accountSignature,i.accountSignature=l.newBuffer(l.base64.length(e.accountSignature)),0):e.accountSignature.length>=0&&(i.accountSignature=e.accountSignature)),e.accountSignatureKey!=null&&(typeof e.accountSignatureKey=="string"?l.base64.decode(e.accountSignatureKey,i.accountSignatureKey=l.newBuffer(l.base64.length(e.accountSignatureKey)),0):e.accountSignatureKey.length>=0&&(i.accountSignatureKey=e.accountSignatureKey)),i},t.toObject=function(e,i){i||(i={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=i.bytes===String?l.base64.encode(e.details,0,e.details.length):i.bytes===Array?Array.prototype.slice.call(e.details):e.details,i.oneofs&&(A._details="details")),e.accountSignature!=null&&e.hasOwnProperty("accountSignature")&&(A.accountSignature=i.bytes===String?l.base64.encode(e.accountSignature,0,e.accountSignature.length):i.bytes===Array?Array.prototype.slice.call(e.accountSignature):e.accountSignature,i.oneofs&&(A._accountSignature="accountSignature")),e.accountSignatureKey!=null&&e.hasOwnProperty("accountSignatureKey")&&(A.accountSignatureKey=i.bytes===String?l.base64.encode(e.accountSignatureKey,0,e.accountSignatureKey.length):i.bytes===Array?Array.prototype.slice.call(e.accountSignatureKey):e.accountSignatureKey,i.oneofs&&(A._accountSignatureKey="accountSignatureKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedKeyIndexList"},t})(),n.AIHomeState=(function(){function t(a){if(this.capabilityOptions=[],this.conversationOptions=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.lastFetchTime=e.int64();break}case 2:{s.capabilityOptions&&s.capabilityOptions.length||(s.capabilityOptions=[]),s.capabilityOptions.push(d.proto.AIHomeState.AIHomeOption.decode(e,e.uint32()));break}case 3:{s.conversationOptions&&s.conversationOptions.length||(s.conversationOptions=[]),s.conversationOptions.push(d.proto.AIHomeState.AIHomeOption.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIHomeState)return e;var i=new d.proto.AIHomeState;if(e.lastFetchTime!=null&&(l.Long?(i.lastFetchTime=l.Long.fromValue(e.lastFetchTime)).unsigned=!1:typeof e.lastFetchTime=="string"?i.lastFetchTime=parseInt(e.lastFetchTime,10):typeof e.lastFetchTime=="number"?i.lastFetchTime=e.lastFetchTime:typeof e.lastFetchTime=="object"&&(i.lastFetchTime=new l.LongBits(e.lastFetchTime.low>>>0,e.lastFetchTime.high>>>0).toNumber())),e.capabilityOptions){if(!Array.isArray(e.capabilityOptions))throw TypeError(".proto.AIHomeState.capabilityOptions: array expected");i.capabilityOptions=[];for(var A=0;A>>3){case 1:{c.type=A.int32();break}case 2:{c.title=A.string();break}case 3:{c.promptText=A.string();break}case 4:{c.sessionId=A.string();break}case 5:{c.imageWdsIdentifier=A.string();break}case 6:{c.imageTintColor=A.string();break}case 7:{c.imageBackgroundColor=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIHomeState.AIHomeOption)return A;var r=new d.proto.AIHomeState.AIHomeOption;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"PROMPT":case 0:r.type=0;break;case"CREATE_IMAGE":case 1:r.type=1;break;case"ANIMATE_PHOTO":case 2:r.type=2;break;case"ANALYZE_FILE":case 3:r.type=3;break}return A.title!=null&&(r.title=String(A.title)),A.promptText!=null&&(r.promptText=String(A.promptText)),A.sessionId!=null&&(r.sessionId=String(A.sessionId)),A.imageWdsIdentifier!=null&&(r.imageWdsIdentifier=String(A.imageWdsIdentifier)),A.imageTintColor!=null&&(r.imageTintColor=String(A.imageTintColor)),A.imageBackgroundColor!=null&&(r.imageBackgroundColor=String(A.imageBackgroundColor)),r},a.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.AIHomeState.AIHomeOption.AIHomeActionType[A.type]===void 0?A.type:d.proto.AIHomeState.AIHomeOption.AIHomeActionType[A.type]:A.type,r.oneofs&&(s._type="type")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.promptText!=null&&A.hasOwnProperty("promptText")&&(s.promptText=A.promptText,r.oneofs&&(s._promptText="promptText")),A.sessionId!=null&&A.hasOwnProperty("sessionId")&&(s.sessionId=A.sessionId,r.oneofs&&(s._sessionId="sessionId")),A.imageWdsIdentifier!=null&&A.hasOwnProperty("imageWdsIdentifier")&&(s.imageWdsIdentifier=A.imageWdsIdentifier,r.oneofs&&(s._imageWdsIdentifier="imageWdsIdentifier")),A.imageTintColor!=null&&A.hasOwnProperty("imageTintColor")&&(s.imageTintColor=A.imageTintColor,r.oneofs&&(s._imageTintColor="imageTintColor")),A.imageBackgroundColor!=null&&A.hasOwnProperty("imageBackgroundColor")&&(s.imageBackgroundColor=A.imageBackgroundColor,r.oneofs&&(s._imageBackgroundColor="imageBackgroundColor")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIHomeState.AIHomeOption"},a.AIHomeActionType=(function(){let i={},A=Object.create(i);return A[i[0]="PROMPT"]=0,A[i[1]="CREATE_IMAGE"]=1,A[i[2]="ANIMATE_PHOTO"]=2,A[i[3]="ANALYZE_FILE"]=3,A})(),a})(),t})(),n.AIQueryFanout=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.messageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=d.proto.Message.decode(e,e.uint32());break}case 3:{s.timestamp=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIQueryFanout)return e;var i=new d.proto.AIQueryFanout;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.AIQueryFanout.messageKey: object expected");i.messageKey=d.proto.MessageKey.fromObject(e.messageKey)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.AIQueryFanout.message: object expected");i.message=d.proto.Message.fromObject(e.message)}return e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=d.proto.MessageKey.toObject(e.messageKey,i),i.oneofs&&(A._messageKey="messageKey")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=d.proto.Message.toObject(e.message,i),i.oneofs&&(A._message="message")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=i.longs===String?String(e.timestamp):e.timestamp:A.timestamp=i.longs===String?ge(e.timestamp):i.longs===Number?ce(e.timestamp):e.timestamp,i.oneofs&&(A._timestamp="timestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIQueryFanout"},t})(),n.AIRegenerateMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.messageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.responseTimestampMs=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRegenerateMetadata)return e;var i=new d.proto.AIRegenerateMetadata;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.AIRegenerateMetadata.messageKey: object expected");i.messageKey=d.proto.MessageKey.fromObject(e.messageKey)}return e.responseTimestampMs!=null&&(l.Long?(i.responseTimestampMs=l.Long.fromValue(e.responseTimestampMs)).unsigned=!1:typeof e.responseTimestampMs=="string"?i.responseTimestampMs=parseInt(e.responseTimestampMs,10):typeof e.responseTimestampMs=="number"?i.responseTimestampMs=e.responseTimestampMs:typeof e.responseTimestampMs=="object"&&(i.responseTimestampMs=new l.LongBits(e.responseTimestampMs.low>>>0,e.responseTimestampMs.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=d.proto.MessageKey.toObject(e.messageKey,i),i.oneofs&&(A._messageKey="messageKey")),e.responseTimestampMs!=null&&e.hasOwnProperty("responseTimestampMs")&&(typeof e.responseTimestampMs=="number"?A.responseTimestampMs=i.longs===String?String(e.responseTimestampMs):e.responseTimestampMs:A.responseTimestampMs=i.longs===String?ge(e.responseTimestampMs):i.longs===Number?ce(e.responseTimestampMs):e.responseTimestampMs,i.oneofs&&(A._responseTimestampMs="responseTimestampMs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRegenerateMetadata"},t})(),n.AIRichResponseCodeMetadata=(function(){function t(a){if(this.codeBlocks=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.codeLanguage=e.string();break}case 2:{s.codeBlocks&&s.codeBlocks.length||(s.codeBlocks=[]),s.codeBlocks.push(d.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseCodeMetadata)return e;var i=new d.proto.AIRichResponseCodeMetadata;if(e.codeLanguage!=null&&(i.codeLanguage=String(e.codeLanguage)),e.codeBlocks){if(!Array.isArray(e.codeBlocks))throw TypeError(".proto.AIRichResponseCodeMetadata.codeBlocks: array expected");i.codeBlocks=[];for(var A=0;A>>3){case 1:{c.highlightType=A.int32();break}case 2:{c.codeContent=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock)return A;var r=new d.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock;switch(A.highlightType){default:if(typeof A.highlightType=="number"){r.highlightType=A.highlightType;break}break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT":case 0:r.highlightType=0;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD":case 1:r.highlightType=1;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD":case 2:r.highlightType=2;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING":case 3:r.highlightType=3;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER":case 4:r.highlightType=4;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT":case 5:r.highlightType=5;break}return A.codeContent!=null&&(r.codeContent=String(A.codeContent)),r},a.toObject=function(A,r){r||(r={});var s={};return A.highlightType!=null&&A.hasOwnProperty("highlightType")&&(s.highlightType=r.enums===String?d.proto.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[A.highlightType]===void 0?A.highlightType:d.proto.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[A.highlightType]:A.highlightType,r.oneofs&&(s._highlightType="highlightType")),A.codeContent!=null&&A.hasOwnProperty("codeContent")&&(s.codeContent=A.codeContent,r.oneofs&&(s._codeContent="codeContent")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock"},a})(),t.AIRichResponseCodeHighlightType=(function(){let a={},e=Object.create(a);return e[a[0]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT"]=0,e[a[1]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD"]=1,e[a[2]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD"]=2,e[a[3]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING"]=3,e[a[4]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER"]=4,e[a[5]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT"]=5,e})(),t})(),n.AIRichResponseContentItemsMetadata=(function(){function t(a){if(this.itemsMetadata=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.itemsMetadata&&s.itemsMetadata.length||(s.itemsMetadata=[]),s.itemsMetadata.push(d.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.decode(e,e.uint32()));break}case 2:{s.contentType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseContentItemsMetadata)return e;var i=new d.proto.AIRichResponseContentItemsMetadata;if(e.itemsMetadata){if(!Array.isArray(e.itemsMetadata))throw TypeError(".proto.AIRichResponseContentItemsMetadata.itemsMetadata: array expected");i.itemsMetadata=[];for(var A=0;A>>3){case 1:{c.reelItem=d.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata)return A;var r=new d.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata;if(A.reelItem!=null){if(typeof A.reelItem!="object")throw TypeError(".proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.reelItem: object expected");r.reelItem=d.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.fromObject(A.reelItem)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.reelItem!=null&&A.hasOwnProperty("reelItem")&&(s.reelItem=d.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.toObject(A.reelItem,r),r.oneofs&&(s.aIRichResponseContentItem="reelItem")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata"},a})(),t.AIRichResponseReelItem=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.title=A.string();break}case 2:{c.profileIconUrl=A.string();break}case 3:{c.thumbnailUrl=A.string();break}case 4:{c.videoUrl=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem)return A;var r=new d.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem;return A.title!=null&&(r.title=String(A.title)),A.profileIconUrl!=null&&(r.profileIconUrl=String(A.profileIconUrl)),A.thumbnailUrl!=null&&(r.thumbnailUrl=String(A.thumbnailUrl)),A.videoUrl!=null&&(r.videoUrl=String(A.videoUrl)),r},a.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.profileIconUrl!=null&&A.hasOwnProperty("profileIconUrl")&&(s.profileIconUrl=A.profileIconUrl,r.oneofs&&(s._profileIconUrl="profileIconUrl")),A.thumbnailUrl!=null&&A.hasOwnProperty("thumbnailUrl")&&(s.thumbnailUrl=A.thumbnailUrl,r.oneofs&&(s._thumbnailUrl="thumbnailUrl")),A.videoUrl!=null&&A.hasOwnProperty("videoUrl")&&(s.videoUrl=A.videoUrl,r.oneofs&&(s._videoUrl="videoUrl")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem"},a})(),t.ContentType=(function(){let a={},e=Object.create(a);return e[a[0]="DEFAULT"]=0,e[a[1]="CAROUSEL"]=1,e})(),t})(),n.AIRichResponseDynamicMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.type=e.int32();break}case 2:{s.version=e.uint64();break}case 3:{s.url=e.string();break}case 4:{s.loopCount=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseDynamicMetadata)return e;var i=new d.proto.AIRichResponseDynamicMetadata;switch(e.type){default:if(typeof e.type=="number"){i.type=e.type;break}break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN":case 0:i.type=0;break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE":case 1:i.type=1;break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF":case 2:i.type=2;break}return e.version!=null&&(l.Long?(i.version=l.Long.fromValue(e.version)).unsigned=!0:typeof e.version=="string"?i.version=parseInt(e.version,10):typeof e.version=="number"?i.version=e.version:typeof e.version=="object"&&(i.version=new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber(!0))),e.url!=null&&(i.url=String(e.url)),e.loopCount!=null&&(i.loopCount=e.loopCount>>>0),i},t.toObject=function(e,i){i||(i={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=i.enums===String?d.proto.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[e.type]===void 0?e.type:d.proto.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[e.type]:e.type,i.oneofs&&(A._type="type")),e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?A.version=i.longs===String?String(e.version):e.version:A.version=i.longs===String?ge(e.version,!0):i.longs===Number?ce(e.version,!0):e.version,i.oneofs&&(A._version="version")),e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,i.oneofs&&(A._url="url")),e.loopCount!=null&&e.hasOwnProperty("loopCount")&&(A.loopCount=e.loopCount,i.oneofs&&(A._loopCount="loopCount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseDynamicMetadata"},t.AIRichResponseDynamicMetadataType=(function(){let a={},e=Object.create(a);return e[a[0]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN"]=0,e[a[1]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE"]=1,e[a[2]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF"]=2,e})(),t})(),n.AIRichResponseGridImageMetadata=(function(){function t(a){if(this.imageUrls=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.gridImageUrl=d.proto.AIRichResponseImageURL.decode(e,e.uint32());break}case 2:{s.imageUrls&&s.imageUrls.length||(s.imageUrls=[]),s.imageUrls.push(d.proto.AIRichResponseImageURL.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseGridImageMetadata)return e;var i=new d.proto.AIRichResponseGridImageMetadata;if(e.gridImageUrl!=null){if(typeof e.gridImageUrl!="object")throw TypeError(".proto.AIRichResponseGridImageMetadata.gridImageUrl: object expected");i.gridImageUrl=d.proto.AIRichResponseImageURL.fromObject(e.gridImageUrl)}if(e.imageUrls){if(!Array.isArray(e.imageUrls))throw TypeError(".proto.AIRichResponseGridImageMetadata.imageUrls: array expected");i.imageUrls=[];for(var A=0;A>>3){case 1:{s.imagePreviewUrl=e.string();break}case 2:{s.imageHighResUrl=e.string();break}case 3:{s.sourceUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseImageURL)return e;var i=new d.proto.AIRichResponseImageURL;return e.imagePreviewUrl!=null&&(i.imagePreviewUrl=String(e.imagePreviewUrl)),e.imageHighResUrl!=null&&(i.imageHighResUrl=String(e.imageHighResUrl)),e.sourceUrl!=null&&(i.sourceUrl=String(e.sourceUrl)),i},t.toObject=function(e,i){i||(i={});var A={};return e.imagePreviewUrl!=null&&e.hasOwnProperty("imagePreviewUrl")&&(A.imagePreviewUrl=e.imagePreviewUrl,i.oneofs&&(A._imagePreviewUrl="imagePreviewUrl")),e.imageHighResUrl!=null&&e.hasOwnProperty("imageHighResUrl")&&(A.imageHighResUrl=e.imageHighResUrl,i.oneofs&&(A._imageHighResUrl="imageHighResUrl")),e.sourceUrl!=null&&e.hasOwnProperty("sourceUrl")&&(A.sourceUrl=e.sourceUrl,i.oneofs&&(A._sourceUrl="sourceUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseImageURL"},t})(),n.AIRichResponseInlineImageMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.imageUrl=d.proto.AIRichResponseImageURL.decode(e,e.uint32());break}case 2:{s.imageText=e.string();break}case 3:{s.alignment=e.int32();break}case 4:{s.tapLinkUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseInlineImageMetadata)return e;var i=new d.proto.AIRichResponseInlineImageMetadata;if(e.imageUrl!=null){if(typeof e.imageUrl!="object")throw TypeError(".proto.AIRichResponseInlineImageMetadata.imageUrl: object expected");i.imageUrl=d.proto.AIRichResponseImageURL.fromObject(e.imageUrl)}switch(e.imageText!=null&&(i.imageText=String(e.imageText)),e.alignment){default:if(typeof e.alignment=="number"){i.alignment=e.alignment;break}break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED":case 0:i.alignment=0;break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED":case 1:i.alignment=1;break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED":case 2:i.alignment=2;break}return e.tapLinkUrl!=null&&(i.tapLinkUrl=String(e.tapLinkUrl)),i},t.toObject=function(e,i){i||(i={});var A={};return e.imageUrl!=null&&e.hasOwnProperty("imageUrl")&&(A.imageUrl=d.proto.AIRichResponseImageURL.toObject(e.imageUrl,i),i.oneofs&&(A._imageUrl="imageUrl")),e.imageText!=null&&e.hasOwnProperty("imageText")&&(A.imageText=e.imageText,i.oneofs&&(A._imageText="imageText")),e.alignment!=null&&e.hasOwnProperty("alignment")&&(A.alignment=i.enums===String?d.proto.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[e.alignment]===void 0?e.alignment:d.proto.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[e.alignment]:e.alignment,i.oneofs&&(A._alignment="alignment")),e.tapLinkUrl!=null&&e.hasOwnProperty("tapLinkUrl")&&(A.tapLinkUrl=e.tapLinkUrl,i.oneofs&&(A._tapLinkUrl="tapLinkUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseInlineImageMetadata"},t.AIRichResponseImageAlignment=(function(){let a={},e=Object.create(a);return e[a[0]="AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED"]=0,e[a[1]="AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED"]=1,e[a[2]="AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED"]=2,e})(),t})(),n.AIRichResponseLatexMetadata=(function(){function t(a){if(this.expressions=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.text=e.string();break}case 2:{s.expressions&&s.expressions.length||(s.expressions=[]),s.expressions.push(d.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseLatexMetadata)return e;var i=new d.proto.AIRichResponseLatexMetadata;if(e.text!=null&&(i.text=String(e.text)),e.expressions){if(!Array.isArray(e.expressions))throw TypeError(".proto.AIRichResponseLatexMetadata.expressions: array expected");i.expressions=[];for(var A=0;A>>3){case 1:{c.latexExpression=A.string();break}case 2:{c.url=A.string();break}case 3:{c.width=A.double();break}case 4:{c.height=A.double();break}case 5:{c.fontHeight=A.double();break}case 6:{c.imageTopPadding=A.double();break}case 7:{c.imageLeadingPadding=A.double();break}case 8:{c.imageBottomPadding=A.double();break}case 9:{c.imageTrailingPadding=A.double();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression)return A;var r=new d.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression;return A.latexExpression!=null&&(r.latexExpression=String(A.latexExpression)),A.url!=null&&(r.url=String(A.url)),A.width!=null&&(r.width=Number(A.width)),A.height!=null&&(r.height=Number(A.height)),A.fontHeight!=null&&(r.fontHeight=Number(A.fontHeight)),A.imageTopPadding!=null&&(r.imageTopPadding=Number(A.imageTopPadding)),A.imageLeadingPadding!=null&&(r.imageLeadingPadding=Number(A.imageLeadingPadding)),A.imageBottomPadding!=null&&(r.imageBottomPadding=Number(A.imageBottomPadding)),A.imageTrailingPadding!=null&&(r.imageTrailingPadding=Number(A.imageTrailingPadding)),r},a.toObject=function(A,r){r||(r={});var s={};return A.latexExpression!=null&&A.hasOwnProperty("latexExpression")&&(s.latexExpression=A.latexExpression,r.oneofs&&(s._latexExpression="latexExpression")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=r.json&&!isFinite(A.width)?String(A.width):A.width,r.oneofs&&(s._width="width")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=r.json&&!isFinite(A.height)?String(A.height):A.height,r.oneofs&&(s._height="height")),A.fontHeight!=null&&A.hasOwnProperty("fontHeight")&&(s.fontHeight=r.json&&!isFinite(A.fontHeight)?String(A.fontHeight):A.fontHeight,r.oneofs&&(s._fontHeight="fontHeight")),A.imageTopPadding!=null&&A.hasOwnProperty("imageTopPadding")&&(s.imageTopPadding=r.json&&!isFinite(A.imageTopPadding)?String(A.imageTopPadding):A.imageTopPadding,r.oneofs&&(s._imageTopPadding="imageTopPadding")),A.imageLeadingPadding!=null&&A.hasOwnProperty("imageLeadingPadding")&&(s.imageLeadingPadding=r.json&&!isFinite(A.imageLeadingPadding)?String(A.imageLeadingPadding):A.imageLeadingPadding,r.oneofs&&(s._imageLeadingPadding="imageLeadingPadding")),A.imageBottomPadding!=null&&A.hasOwnProperty("imageBottomPadding")&&(s.imageBottomPadding=r.json&&!isFinite(A.imageBottomPadding)?String(A.imageBottomPadding):A.imageBottomPadding,r.oneofs&&(s._imageBottomPadding="imageBottomPadding")),A.imageTrailingPadding!=null&&A.hasOwnProperty("imageTrailingPadding")&&(s.imageTrailingPadding=r.json&&!isFinite(A.imageTrailingPadding)?String(A.imageTrailingPadding):A.imageTrailingPadding,r.oneofs&&(s._imageTrailingPadding="imageTrailingPadding")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression"},a})(),t})(),n.AIRichResponseMapMetadata=(function(){function t(a){if(this.annotations=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.centerLatitude=e.double();break}case 2:{s.centerLongitude=e.double();break}case 3:{s.latitudeDelta=e.double();break}case 4:{s.longitudeDelta=e.double();break}case 5:{s.annotations&&s.annotations.length||(s.annotations=[]),s.annotations.push(d.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation.decode(e,e.uint32()));break}case 6:{s.showInfoList=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseMapMetadata)return e;var i=new d.proto.AIRichResponseMapMetadata;if(e.centerLatitude!=null&&(i.centerLatitude=Number(e.centerLatitude)),e.centerLongitude!=null&&(i.centerLongitude=Number(e.centerLongitude)),e.latitudeDelta!=null&&(i.latitudeDelta=Number(e.latitudeDelta)),e.longitudeDelta!=null&&(i.longitudeDelta=Number(e.longitudeDelta)),e.annotations){if(!Array.isArray(e.annotations))throw TypeError(".proto.AIRichResponseMapMetadata.annotations: array expected");i.annotations=[];for(var A=0;A>>3){case 1:{c.annotationNumber=A.uint32();break}case 2:{c.latitude=A.double();break}case 3:{c.longitude=A.double();break}case 4:{c.title=A.string();break}case 5:{c.body=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation)return A;var r=new d.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation;return A.annotationNumber!=null&&(r.annotationNumber=A.annotationNumber>>>0),A.latitude!=null&&(r.latitude=Number(A.latitude)),A.longitude!=null&&(r.longitude=Number(A.longitude)),A.title!=null&&(r.title=String(A.title)),A.body!=null&&(r.body=String(A.body)),r},a.toObject=function(A,r){r||(r={});var s={};return A.annotationNumber!=null&&A.hasOwnProperty("annotationNumber")&&(s.annotationNumber=A.annotationNumber,r.oneofs&&(s._annotationNumber="annotationNumber")),A.latitude!=null&&A.hasOwnProperty("latitude")&&(s.latitude=r.json&&!isFinite(A.latitude)?String(A.latitude):A.latitude,r.oneofs&&(s._latitude="latitude")),A.longitude!=null&&A.hasOwnProperty("longitude")&&(s.longitude=r.json&&!isFinite(A.longitude)?String(A.longitude):A.longitude,r.oneofs&&(s._longitude="longitude")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,r.oneofs&&(s._body="body")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation"},a})(),t})(),n.AIRichResponseMessage=(function(){function t(a){if(this.submessages=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.messageType=e.int32();break}case 2:{s.submessages&&s.submessages.length||(s.submessages=[]),s.submessages.push(d.proto.AIRichResponseSubMessage.decode(e,e.uint32()));break}case 3:{s.unifiedResponse=d.proto.AIRichResponseUnifiedResponse.decode(e,e.uint32());break}case 4:{s.contextInfo=d.proto.ContextInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseMessage)return e;var i=new d.proto.AIRichResponseMessage;switch(e.messageType){default:if(typeof e.messageType=="number"){i.messageType=e.messageType;break}break;case"AI_RICH_RESPONSE_TYPE_UNKNOWN":case 0:i.messageType=0;break;case"AI_RICH_RESPONSE_TYPE_STANDARD":case 1:i.messageType=1;break}if(e.submessages){if(!Array.isArray(e.submessages))throw TypeError(".proto.AIRichResponseMessage.submessages: array expected");i.submessages=[];for(var A=0;A>>3){case 1:{s.messageType=e.int32();break}case 2:{s.gridImageMetadata=d.proto.AIRichResponseGridImageMetadata.decode(e,e.uint32());break}case 3:{s.messageText=e.string();break}case 4:{s.imageMetadata=d.proto.AIRichResponseInlineImageMetadata.decode(e,e.uint32());break}case 5:{s.codeMetadata=d.proto.AIRichResponseCodeMetadata.decode(e,e.uint32());break}case 6:{s.tableMetadata=d.proto.AIRichResponseTableMetadata.decode(e,e.uint32());break}case 7:{s.dynamicMetadata=d.proto.AIRichResponseDynamicMetadata.decode(e,e.uint32());break}case 8:{s.latexMetadata=d.proto.AIRichResponseLatexMetadata.decode(e,e.uint32());break}case 9:{s.mapMetadata=d.proto.AIRichResponseMapMetadata.decode(e,e.uint32());break}case 10:{s.contentItemsMetadata=d.proto.AIRichResponseContentItemsMetadata.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseSubMessage)return e;var i=new d.proto.AIRichResponseSubMessage;switch(e.messageType){default:if(typeof e.messageType=="number"){i.messageType=e.messageType;break}break;case"AI_RICH_RESPONSE_UNKNOWN":case 0:i.messageType=0;break;case"AI_RICH_RESPONSE_GRID_IMAGE":case 1:i.messageType=1;break;case"AI_RICH_RESPONSE_TEXT":case 2:i.messageType=2;break;case"AI_RICH_RESPONSE_INLINE_IMAGE":case 3:i.messageType=3;break;case"AI_RICH_RESPONSE_TABLE":case 4:i.messageType=4;break;case"AI_RICH_RESPONSE_CODE":case 5:i.messageType=5;break;case"AI_RICH_RESPONSE_DYNAMIC":case 6:i.messageType=6;break;case"AI_RICH_RESPONSE_MAP":case 7:i.messageType=7;break;case"AI_RICH_RESPONSE_LATEX":case 8:i.messageType=8;break;case"AI_RICH_RESPONSE_CONTENT_ITEMS":case 9:i.messageType=9;break}if(e.gridImageMetadata!=null){if(typeof e.gridImageMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.gridImageMetadata: object expected");i.gridImageMetadata=d.proto.AIRichResponseGridImageMetadata.fromObject(e.gridImageMetadata)}if(e.messageText!=null&&(i.messageText=String(e.messageText)),e.imageMetadata!=null){if(typeof e.imageMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.imageMetadata: object expected");i.imageMetadata=d.proto.AIRichResponseInlineImageMetadata.fromObject(e.imageMetadata)}if(e.codeMetadata!=null){if(typeof e.codeMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.codeMetadata: object expected");i.codeMetadata=d.proto.AIRichResponseCodeMetadata.fromObject(e.codeMetadata)}if(e.tableMetadata!=null){if(typeof e.tableMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.tableMetadata: object expected");i.tableMetadata=d.proto.AIRichResponseTableMetadata.fromObject(e.tableMetadata)}if(e.dynamicMetadata!=null){if(typeof e.dynamicMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.dynamicMetadata: object expected");i.dynamicMetadata=d.proto.AIRichResponseDynamicMetadata.fromObject(e.dynamicMetadata)}if(e.latexMetadata!=null){if(typeof e.latexMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.latexMetadata: object expected");i.latexMetadata=d.proto.AIRichResponseLatexMetadata.fromObject(e.latexMetadata)}if(e.mapMetadata!=null){if(typeof e.mapMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.mapMetadata: object expected");i.mapMetadata=d.proto.AIRichResponseMapMetadata.fromObject(e.mapMetadata)}if(e.contentItemsMetadata!=null){if(typeof e.contentItemsMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.contentItemsMetadata: object expected");i.contentItemsMetadata=d.proto.AIRichResponseContentItemsMetadata.fromObject(e.contentItemsMetadata)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.messageType!=null&&e.hasOwnProperty("messageType")&&(A.messageType=i.enums===String?d.proto.AIRichResponseSubMessageType[e.messageType]===void 0?e.messageType:d.proto.AIRichResponseSubMessageType[e.messageType]:e.messageType,i.oneofs&&(A._messageType="messageType")),e.gridImageMetadata!=null&&e.hasOwnProperty("gridImageMetadata")&&(A.gridImageMetadata=d.proto.AIRichResponseGridImageMetadata.toObject(e.gridImageMetadata,i),i.oneofs&&(A._gridImageMetadata="gridImageMetadata")),e.messageText!=null&&e.hasOwnProperty("messageText")&&(A.messageText=e.messageText,i.oneofs&&(A._messageText="messageText")),e.imageMetadata!=null&&e.hasOwnProperty("imageMetadata")&&(A.imageMetadata=d.proto.AIRichResponseInlineImageMetadata.toObject(e.imageMetadata,i),i.oneofs&&(A._imageMetadata="imageMetadata")),e.codeMetadata!=null&&e.hasOwnProperty("codeMetadata")&&(A.codeMetadata=d.proto.AIRichResponseCodeMetadata.toObject(e.codeMetadata,i),i.oneofs&&(A._codeMetadata="codeMetadata")),e.tableMetadata!=null&&e.hasOwnProperty("tableMetadata")&&(A.tableMetadata=d.proto.AIRichResponseTableMetadata.toObject(e.tableMetadata,i),i.oneofs&&(A._tableMetadata="tableMetadata")),e.dynamicMetadata!=null&&e.hasOwnProperty("dynamicMetadata")&&(A.dynamicMetadata=d.proto.AIRichResponseDynamicMetadata.toObject(e.dynamicMetadata,i),i.oneofs&&(A._dynamicMetadata="dynamicMetadata")),e.latexMetadata!=null&&e.hasOwnProperty("latexMetadata")&&(A.latexMetadata=d.proto.AIRichResponseLatexMetadata.toObject(e.latexMetadata,i),i.oneofs&&(A._latexMetadata="latexMetadata")),e.mapMetadata!=null&&e.hasOwnProperty("mapMetadata")&&(A.mapMetadata=d.proto.AIRichResponseMapMetadata.toObject(e.mapMetadata,i),i.oneofs&&(A._mapMetadata="mapMetadata")),e.contentItemsMetadata!=null&&e.hasOwnProperty("contentItemsMetadata")&&(A.contentItemsMetadata=d.proto.AIRichResponseContentItemsMetadata.toObject(e.contentItemsMetadata,i),i.oneofs&&(A._contentItemsMetadata="contentItemsMetadata")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseSubMessage"},t})(),n.AIRichResponseSubMessageType=(function(){let t={},o=Object.create(t);return o[t[0]="AI_RICH_RESPONSE_UNKNOWN"]=0,o[t[1]="AI_RICH_RESPONSE_GRID_IMAGE"]=1,o[t[2]="AI_RICH_RESPONSE_TEXT"]=2,o[t[3]="AI_RICH_RESPONSE_INLINE_IMAGE"]=3,o[t[4]="AI_RICH_RESPONSE_TABLE"]=4,o[t[5]="AI_RICH_RESPONSE_CODE"]=5,o[t[6]="AI_RICH_RESPONSE_DYNAMIC"]=6,o[t[7]="AI_RICH_RESPONSE_MAP"]=7,o[t[8]="AI_RICH_RESPONSE_LATEX"]=8,o[t[9]="AI_RICH_RESPONSE_CONTENT_ITEMS"]=9,o})(),n.AIRichResponseTableMetadata=(function(){function t(a){if(this.rows=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.rows&&s.rows.length||(s.rows=[]),s.rows.push(d.proto.AIRichResponseTableMetadata.AIRichResponseTableRow.decode(e,e.uint32()));break}case 2:{s.title=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseTableMetadata)return e;var i=new d.proto.AIRichResponseTableMetadata;if(e.rows){if(!Array.isArray(e.rows))throw TypeError(".proto.AIRichResponseTableMetadata.rows: array expected");i.rows=[];for(var A=0;A>>3){case 1:{c.items&&c.items.length||(c.items=[]),c.items.push(A.string());break}case 2:{c.isHeading=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIRichResponseTableMetadata.AIRichResponseTableRow)return A;var r=new d.proto.AIRichResponseTableMetadata.AIRichResponseTableRow;if(A.items){if(!Array.isArray(A.items))throw TypeError(".proto.AIRichResponseTableMetadata.AIRichResponseTableRow.items: array expected");r.items=[];for(var s=0;s>>3){case 1:{s.data=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseUnifiedResponse)return e;var i=new d.proto.AIRichResponseUnifiedResponse;return e.data!=null&&(typeof e.data=="string"?l.base64.decode(e.data,i.data=l.newBuffer(l.base64.length(e.data)),0):e.data.length>=0&&(i.data=e.data)),i},t.toObject=function(e,i){i||(i={});var A={};return e.data!=null&&e.hasOwnProperty("data")&&(A.data=i.bytes===String?l.base64.encode(e.data,0,e.data.length):i.bytes===Array?Array.prototype.slice.call(e.data):e.data,i.oneofs&&(A._data="data")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseUnifiedResponse"},t})(),n.AIThreadInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.serverInfo=d.proto.AIThreadInfo.AIThreadServerInfo.decode(e,e.uint32());break}case 2:{s.clientInfo=d.proto.AIThreadInfo.AIThreadClientInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIThreadInfo)return e;var i=new d.proto.AIThreadInfo;if(e.serverInfo!=null){if(typeof e.serverInfo!="object")throw TypeError(".proto.AIThreadInfo.serverInfo: object expected");i.serverInfo=d.proto.AIThreadInfo.AIThreadServerInfo.fromObject(e.serverInfo)}if(e.clientInfo!=null){if(typeof e.clientInfo!="object")throw TypeError(".proto.AIThreadInfo.clientInfo: object expected");i.clientInfo=d.proto.AIThreadInfo.AIThreadClientInfo.fromObject(e.clientInfo)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.serverInfo!=null&&e.hasOwnProperty("serverInfo")&&(A.serverInfo=d.proto.AIThreadInfo.AIThreadServerInfo.toObject(e.serverInfo,i),i.oneofs&&(A._serverInfo="serverInfo")),e.clientInfo!=null&&e.hasOwnProperty("clientInfo")&&(A.clientInfo=d.proto.AIThreadInfo.AIThreadClientInfo.toObject(e.clientInfo,i),i.oneofs&&(A._clientInfo="clientInfo")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIThreadInfo"},t.AIThreadClientInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIThreadInfo.AIThreadClientInfo)return A;var r=new d.proto.AIThreadInfo.AIThreadClientInfo;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"DEFAULT":case 1:r.type=1;break;case"INCOGNITO":case 2:r.type=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.AIThreadInfo.AIThreadClientInfo.AIThreadType[A.type]===void 0?A.type:d.proto.AIThreadInfo.AIThreadClientInfo.AIThreadType[A.type]:A.type,r.oneofs&&(s._type="type")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIThreadInfo.AIThreadClientInfo"},a.AIThreadType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="DEFAULT"]=1,A[i[2]="INCOGNITO"]=2,A})(),a})(),t.AIThreadServerInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.title=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIThreadInfo.AIThreadServerInfo)return A;var r=new d.proto.AIThreadInfo.AIThreadServerInfo;return A.title!=null&&(r.title=String(A.title)),r},a.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIThreadInfo.AIThreadServerInfo"},a})(),t})(),n.Account=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.lid=e.string();break}case 2:{s.username=e.string();break}case 3:{s.countryCode=e.string();break}case 4:{s.isUsernameDeleted=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Account)return e;var i=new d.proto.Account;return e.lid!=null&&(i.lid=String(e.lid)),e.username!=null&&(i.username=String(e.username)),e.countryCode!=null&&(i.countryCode=String(e.countryCode)),e.isUsernameDeleted!=null&&(i.isUsernameDeleted=!!e.isUsernameDeleted),i},t.toObject=function(e,i){i||(i={});var A={};return e.lid!=null&&e.hasOwnProperty("lid")&&(A.lid=e.lid,i.oneofs&&(A._lid="lid")),e.username!=null&&e.hasOwnProperty("username")&&(A.username=e.username,i.oneofs&&(A._username="username")),e.countryCode!=null&&e.hasOwnProperty("countryCode")&&(A.countryCode=e.countryCode,i.oneofs&&(A._countryCode="countryCode")),e.isUsernameDeleted!=null&&e.hasOwnProperty("isUsernameDeleted")&&(A.isUsernameDeleted=e.isUsernameDeleted,i.oneofs&&(A._isUsernameDeleted="isUsernameDeleted")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Account"},t})(),n.ActionLink=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.url=e.string();break}case 2:{s.buttonTitle=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ActionLink)return e;var i=new d.proto.ActionLink;return e.url!=null&&(i.url=String(e.url)),e.buttonTitle!=null&&(i.buttonTitle=String(e.buttonTitle)),i},t.toObject=function(e,i){i||(i={});var A={};return e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,i.oneofs&&(A._url="url")),e.buttonTitle!=null&&e.hasOwnProperty("buttonTitle")&&(A.buttonTitle=e.buttonTitle,i.oneofs&&(A._buttonTitle="buttonTitle")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ActionLink"},t})(),n.AutoDownloadSettings=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.downloadImages=e.bool();break}case 2:{s.downloadAudio=e.bool();break}case 3:{s.downloadVideo=e.bool();break}case 4:{s.downloadDocuments=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AutoDownloadSettings)return e;var i=new d.proto.AutoDownloadSettings;return e.downloadImages!=null&&(i.downloadImages=!!e.downloadImages),e.downloadAudio!=null&&(i.downloadAudio=!!e.downloadAudio),e.downloadVideo!=null&&(i.downloadVideo=!!e.downloadVideo),e.downloadDocuments!=null&&(i.downloadDocuments=!!e.downloadDocuments),i},t.toObject=function(e,i){i||(i={});var A={};return e.downloadImages!=null&&e.hasOwnProperty("downloadImages")&&(A.downloadImages=e.downloadImages,i.oneofs&&(A._downloadImages="downloadImages")),e.downloadAudio!=null&&e.hasOwnProperty("downloadAudio")&&(A.downloadAudio=e.downloadAudio,i.oneofs&&(A._downloadAudio="downloadAudio")),e.downloadVideo!=null&&e.hasOwnProperty("downloadVideo")&&(A.downloadVideo=e.downloadVideo,i.oneofs&&(A._downloadVideo="downloadVideo")),e.downloadDocuments!=null&&e.hasOwnProperty("downloadDocuments")&&(A.downloadDocuments=e.downloadDocuments,i.oneofs&&(A._downloadDocuments="downloadDocuments")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AutoDownloadSettings"},t})(),n.AvatarUserSettings=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.fbid=e.string();break}case 2:{s.password=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AvatarUserSettings)return e;var i=new d.proto.AvatarUserSettings;return e.fbid!=null&&(i.fbid=String(e.fbid)),e.password!=null&&(i.password=String(e.password)),i},t.toObject=function(e,i){i||(i={});var A={};return e.fbid!=null&&e.hasOwnProperty("fbid")&&(A.fbid=e.fbid,i.oneofs&&(A._fbid="fbid")),e.password!=null&&e.hasOwnProperty("password")&&(A.password=e.password,i.oneofs&&(A._password="password")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AvatarUserSettings"},t})(),n.BizAccountLinkInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.whatsappBizAcctFbid=e.uint64();break}case 2:{s.whatsappAcctNumber=e.string();break}case 3:{s.issueTime=e.uint64();break}case 4:{s.hostStorage=e.int32();break}case 5:{s.accountType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BizAccountLinkInfo)return e;var i=new d.proto.BizAccountLinkInfo;switch(e.whatsappBizAcctFbid!=null&&(l.Long?(i.whatsappBizAcctFbid=l.Long.fromValue(e.whatsappBizAcctFbid)).unsigned=!0:typeof e.whatsappBizAcctFbid=="string"?i.whatsappBizAcctFbid=parseInt(e.whatsappBizAcctFbid,10):typeof e.whatsappBizAcctFbid=="number"?i.whatsappBizAcctFbid=e.whatsappBizAcctFbid:typeof e.whatsappBizAcctFbid=="object"&&(i.whatsappBizAcctFbid=new l.LongBits(e.whatsappBizAcctFbid.low>>>0,e.whatsappBizAcctFbid.high>>>0).toNumber(!0))),e.whatsappAcctNumber!=null&&(i.whatsappAcctNumber=String(e.whatsappAcctNumber)),e.issueTime!=null&&(l.Long?(i.issueTime=l.Long.fromValue(e.issueTime)).unsigned=!0:typeof e.issueTime=="string"?i.issueTime=parseInt(e.issueTime,10):typeof e.issueTime=="number"?i.issueTime=e.issueTime:typeof e.issueTime=="object"&&(i.issueTime=new l.LongBits(e.issueTime.low>>>0,e.issueTime.high>>>0).toNumber(!0))),e.hostStorage){default:if(typeof e.hostStorage=="number"){i.hostStorage=e.hostStorage;break}break;case"ON_PREMISE":case 0:i.hostStorage=0;break;case"FACEBOOK":case 1:i.hostStorage=1;break}switch(e.accountType){default:if(typeof e.accountType=="number"){i.accountType=e.accountType;break}break;case"ENTERPRISE":case 0:i.accountType=0;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.whatsappBizAcctFbid!=null&&e.hasOwnProperty("whatsappBizAcctFbid")&&(typeof e.whatsappBizAcctFbid=="number"?A.whatsappBizAcctFbid=i.longs===String?String(e.whatsappBizAcctFbid):e.whatsappBizAcctFbid:A.whatsappBizAcctFbid=i.longs===String?ge(e.whatsappBizAcctFbid,!0):i.longs===Number?ce(e.whatsappBizAcctFbid,!0):e.whatsappBizAcctFbid,i.oneofs&&(A._whatsappBizAcctFbid="whatsappBizAcctFbid")),e.whatsappAcctNumber!=null&&e.hasOwnProperty("whatsappAcctNumber")&&(A.whatsappAcctNumber=e.whatsappAcctNumber,i.oneofs&&(A._whatsappAcctNumber="whatsappAcctNumber")),e.issueTime!=null&&e.hasOwnProperty("issueTime")&&(typeof e.issueTime=="number"?A.issueTime=i.longs===String?String(e.issueTime):e.issueTime:A.issueTime=i.longs===String?ge(e.issueTime,!0):i.longs===Number?ce(e.issueTime,!0):e.issueTime,i.oneofs&&(A._issueTime="issueTime")),e.hostStorage!=null&&e.hasOwnProperty("hostStorage")&&(A.hostStorage=i.enums===String?d.proto.BizAccountLinkInfo.HostStorageType[e.hostStorage]===void 0?e.hostStorage:d.proto.BizAccountLinkInfo.HostStorageType[e.hostStorage]:e.hostStorage,i.oneofs&&(A._hostStorage="hostStorage")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=i.enums===String?d.proto.BizAccountLinkInfo.AccountType[e.accountType]===void 0?e.accountType:d.proto.BizAccountLinkInfo.AccountType[e.accountType]:e.accountType,i.oneofs&&(A._accountType="accountType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizAccountLinkInfo"},t.AccountType=(function(){let a={},e=Object.create(a);return e[a[0]="ENTERPRISE"]=0,e})(),t.HostStorageType=(function(){let a={},e=Object.create(a);return e[a[0]="ON_PREMISE"]=0,e[a[1]="FACEBOOK"]=1,e})(),t})(),n.BizAccountPayload=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.vnameCert=d.proto.VerifiedNameCertificate.decode(e,e.uint32());break}case 2:{s.bizAcctLinkInfo=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BizAccountPayload)return e;var i=new d.proto.BizAccountPayload;if(e.vnameCert!=null){if(typeof e.vnameCert!="object")throw TypeError(".proto.BizAccountPayload.vnameCert: object expected");i.vnameCert=d.proto.VerifiedNameCertificate.fromObject(e.vnameCert)}return e.bizAcctLinkInfo!=null&&(typeof e.bizAcctLinkInfo=="string"?l.base64.decode(e.bizAcctLinkInfo,i.bizAcctLinkInfo=l.newBuffer(l.base64.length(e.bizAcctLinkInfo)),0):e.bizAcctLinkInfo.length>=0&&(i.bizAcctLinkInfo=e.bizAcctLinkInfo)),i},t.toObject=function(e,i){i||(i={});var A={};return e.vnameCert!=null&&e.hasOwnProperty("vnameCert")&&(A.vnameCert=d.proto.VerifiedNameCertificate.toObject(e.vnameCert,i),i.oneofs&&(A._vnameCert="vnameCert")),e.bizAcctLinkInfo!=null&&e.hasOwnProperty("bizAcctLinkInfo")&&(A.bizAcctLinkInfo=i.bytes===String?l.base64.encode(e.bizAcctLinkInfo,0,e.bizAcctLinkInfo.length):i.bytes===Array?Array.prototype.slice.call(e.bizAcctLinkInfo):e.bizAcctLinkInfo,i.oneofs&&(A._bizAcctLinkInfo="bizAcctLinkInfo")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizAccountPayload"},t})(),n.BizIdentityInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.vlevel=e.int32();break}case 2:{s.vnameCert=d.proto.VerifiedNameCertificate.decode(e,e.uint32());break}case 3:{s.signed=e.bool();break}case 4:{s.revoked=e.bool();break}case 5:{s.hostStorage=e.int32();break}case 6:{s.actualActors=e.int32();break}case 7:{s.privacyModeTs=e.uint64();break}case 8:{s.featureControls=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BizIdentityInfo)return e;var i=new d.proto.BizIdentityInfo;switch(e.vlevel){default:if(typeof e.vlevel=="number"){i.vlevel=e.vlevel;break}break;case"UNKNOWN":case 0:i.vlevel=0;break;case"LOW":case 1:i.vlevel=1;break;case"HIGH":case 2:i.vlevel=2;break}if(e.vnameCert!=null){if(typeof e.vnameCert!="object")throw TypeError(".proto.BizIdentityInfo.vnameCert: object expected");i.vnameCert=d.proto.VerifiedNameCertificate.fromObject(e.vnameCert)}switch(e.signed!=null&&(i.signed=!!e.signed),e.revoked!=null&&(i.revoked=!!e.revoked),e.hostStorage){default:if(typeof e.hostStorage=="number"){i.hostStorage=e.hostStorage;break}break;case"ON_PREMISE":case 0:i.hostStorage=0;break;case"FACEBOOK":case 1:i.hostStorage=1;break}switch(e.actualActors){default:if(typeof e.actualActors=="number"){i.actualActors=e.actualActors;break}break;case"SELF":case 0:i.actualActors=0;break;case"BSP":case 1:i.actualActors=1;break}return e.privacyModeTs!=null&&(l.Long?(i.privacyModeTs=l.Long.fromValue(e.privacyModeTs)).unsigned=!0:typeof e.privacyModeTs=="string"?i.privacyModeTs=parseInt(e.privacyModeTs,10):typeof e.privacyModeTs=="number"?i.privacyModeTs=e.privacyModeTs:typeof e.privacyModeTs=="object"&&(i.privacyModeTs=new l.LongBits(e.privacyModeTs.low>>>0,e.privacyModeTs.high>>>0).toNumber(!0))),e.featureControls!=null&&(l.Long?(i.featureControls=l.Long.fromValue(e.featureControls)).unsigned=!0:typeof e.featureControls=="string"?i.featureControls=parseInt(e.featureControls,10):typeof e.featureControls=="number"?i.featureControls=e.featureControls:typeof e.featureControls=="object"&&(i.featureControls=new l.LongBits(e.featureControls.low>>>0,e.featureControls.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};return e.vlevel!=null&&e.hasOwnProperty("vlevel")&&(A.vlevel=i.enums===String?d.proto.BizIdentityInfo.VerifiedLevelValue[e.vlevel]===void 0?e.vlevel:d.proto.BizIdentityInfo.VerifiedLevelValue[e.vlevel]:e.vlevel,i.oneofs&&(A._vlevel="vlevel")),e.vnameCert!=null&&e.hasOwnProperty("vnameCert")&&(A.vnameCert=d.proto.VerifiedNameCertificate.toObject(e.vnameCert,i),i.oneofs&&(A._vnameCert="vnameCert")),e.signed!=null&&e.hasOwnProperty("signed")&&(A.signed=e.signed,i.oneofs&&(A._signed="signed")),e.revoked!=null&&e.hasOwnProperty("revoked")&&(A.revoked=e.revoked,i.oneofs&&(A._revoked="revoked")),e.hostStorage!=null&&e.hasOwnProperty("hostStorage")&&(A.hostStorage=i.enums===String?d.proto.BizIdentityInfo.HostStorageType[e.hostStorage]===void 0?e.hostStorage:d.proto.BizIdentityInfo.HostStorageType[e.hostStorage]:e.hostStorage,i.oneofs&&(A._hostStorage="hostStorage")),e.actualActors!=null&&e.hasOwnProperty("actualActors")&&(A.actualActors=i.enums===String?d.proto.BizIdentityInfo.ActualActorsType[e.actualActors]===void 0?e.actualActors:d.proto.BizIdentityInfo.ActualActorsType[e.actualActors]:e.actualActors,i.oneofs&&(A._actualActors="actualActors")),e.privacyModeTs!=null&&e.hasOwnProperty("privacyModeTs")&&(typeof e.privacyModeTs=="number"?A.privacyModeTs=i.longs===String?String(e.privacyModeTs):e.privacyModeTs:A.privacyModeTs=i.longs===String?ge(e.privacyModeTs,!0):i.longs===Number?ce(e.privacyModeTs,!0):e.privacyModeTs,i.oneofs&&(A._privacyModeTs="privacyModeTs")),e.featureControls!=null&&e.hasOwnProperty("featureControls")&&(typeof e.featureControls=="number"?A.featureControls=i.longs===String?String(e.featureControls):e.featureControls:A.featureControls=i.longs===String?ge(e.featureControls,!0):i.longs===Number?ce(e.featureControls,!0):e.featureControls,i.oneofs&&(A._featureControls="featureControls")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizIdentityInfo"},t.ActualActorsType=(function(){let a={},e=Object.create(a);return e[a[0]="SELF"]=0,e[a[1]="BSP"]=1,e})(),t.HostStorageType=(function(){let a={},e=Object.create(a);return e[a[0]="ON_PREMISE"]=0,e[a[1]="FACEBOOK"]=1,e})(),t.VerifiedLevelValue=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="LOW"]=1,e[a[2]="HIGH"]=2,e})(),t})(),n.BotAgeCollectionMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.ageCollectionEligible=e.bool();break}case 2:{s.shouldTriggerAgeCollectionOnClient=e.bool();break}case 3:{s.ageCollectionType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotAgeCollectionMetadata)return e;var i=new d.proto.BotAgeCollectionMetadata;switch(e.ageCollectionEligible!=null&&(i.ageCollectionEligible=!!e.ageCollectionEligible),e.shouldTriggerAgeCollectionOnClient!=null&&(i.shouldTriggerAgeCollectionOnClient=!!e.shouldTriggerAgeCollectionOnClient),e.ageCollectionType){default:if(typeof e.ageCollectionType=="number"){i.ageCollectionType=e.ageCollectionType;break}break;case"O18_BINARY":case 0:i.ageCollectionType=0;break;case"WAFFLE":case 1:i.ageCollectionType=1;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.ageCollectionEligible!=null&&e.hasOwnProperty("ageCollectionEligible")&&(A.ageCollectionEligible=e.ageCollectionEligible,i.oneofs&&(A._ageCollectionEligible="ageCollectionEligible")),e.shouldTriggerAgeCollectionOnClient!=null&&e.hasOwnProperty("shouldTriggerAgeCollectionOnClient")&&(A.shouldTriggerAgeCollectionOnClient=e.shouldTriggerAgeCollectionOnClient,i.oneofs&&(A._shouldTriggerAgeCollectionOnClient="shouldTriggerAgeCollectionOnClient")),e.ageCollectionType!=null&&e.hasOwnProperty("ageCollectionType")&&(A.ageCollectionType=i.enums===String?d.proto.BotAgeCollectionMetadata.AgeCollectionType[e.ageCollectionType]===void 0?e.ageCollectionType:d.proto.BotAgeCollectionMetadata.AgeCollectionType[e.ageCollectionType]:e.ageCollectionType,i.oneofs&&(A._ageCollectionType="ageCollectionType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotAgeCollectionMetadata"},t.AgeCollectionType=(function(){let a={},e=Object.create(a);return e[a[0]="O18_BINARY"]=0,e[a[1]="WAFFLE"]=1,e})(),t})(),n.BotAvatarMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.sentiment=e.uint32();break}case 2:{s.behaviorGraph=e.string();break}case 3:{s.action=e.uint32();break}case 4:{s.intensity=e.uint32();break}case 5:{s.wordCount=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotAvatarMetadata)return e;var i=new d.proto.BotAvatarMetadata;return e.sentiment!=null&&(i.sentiment=e.sentiment>>>0),e.behaviorGraph!=null&&(i.behaviorGraph=String(e.behaviorGraph)),e.action!=null&&(i.action=e.action>>>0),e.intensity!=null&&(i.intensity=e.intensity>>>0),e.wordCount!=null&&(i.wordCount=e.wordCount>>>0),i},t.toObject=function(e,i){i||(i={});var A={};return e.sentiment!=null&&e.hasOwnProperty("sentiment")&&(A.sentiment=e.sentiment,i.oneofs&&(A._sentiment="sentiment")),e.behaviorGraph!=null&&e.hasOwnProperty("behaviorGraph")&&(A.behaviorGraph=e.behaviorGraph,i.oneofs&&(A._behaviorGraph="behaviorGraph")),e.action!=null&&e.hasOwnProperty("action")&&(A.action=e.action,i.oneofs&&(A._action="action")),e.intensity!=null&&e.hasOwnProperty("intensity")&&(A.intensity=e.intensity,i.oneofs&&(A._intensity="intensity")),e.wordCount!=null&&e.hasOwnProperty("wordCount")&&(A.wordCount=e.wordCount,i.oneofs&&(A._wordCount="wordCount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotAvatarMetadata"},t})(),n.BotCapabilityMetadata=(function(){function t(o){if(this.capabilities=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{if(r.capabilities&&r.capabilities.length||(r.capabilities=[]),(s&7)===2)for(var g=a.uint32()+a.pos;a.pos>>3){case 1:{s.messageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.kind=e.int32();break}case 3:{s.text=e.string();break}case 4:{s.kindNegative=e.uint64();break}case 5:{s.kindPositive=e.uint64();break}case 6:{s.kindReport=e.int32();break}case 7:{s.sideBySideSurveyMetadata=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotFeedbackMessage)return e;var i=new d.proto.BotFeedbackMessage;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.BotFeedbackMessage.messageKey: object expected");i.messageKey=d.proto.MessageKey.fromObject(e.messageKey)}switch(e.kind){default:if(typeof e.kind=="number"){i.kind=e.kind;break}break;case"BOT_FEEDBACK_POSITIVE":case 0:i.kind=0;break;case"BOT_FEEDBACK_NEGATIVE_GENERIC":case 1:i.kind=1;break;case"BOT_FEEDBACK_NEGATIVE_HELPFUL":case 2:i.kind=2;break;case"BOT_FEEDBACK_NEGATIVE_INTERESTING":case 3:i.kind=3;break;case"BOT_FEEDBACK_NEGATIVE_ACCURATE":case 4:i.kind=4;break;case"BOT_FEEDBACK_NEGATIVE_SAFE":case 5:i.kind=5;break;case"BOT_FEEDBACK_NEGATIVE_OTHER":case 6:i.kind=6;break;case"BOT_FEEDBACK_NEGATIVE_REFUSED":case 7:i.kind=7;break;case"BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING":case 8:i.kind=8;break;case"BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT":case 9:i.kind=9;break;case"BOT_FEEDBACK_NEGATIVE_PERSONALIZED":case 10:i.kind=10;break;case"BOT_FEEDBACK_NEGATIVE_CLARITY":case 11:i.kind=11;break;case"BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON":case 12:i.kind=12;break;case"BOT_FEEDBACK_NEGATIVE_HALLUCINATION_INTERNAL_ONLY":case 13:i.kind=13;break;case"BOT_FEEDBACK_NEGATIVE":case 14:i.kind=14;break}switch(e.text!=null&&(i.text=String(e.text)),e.kindNegative!=null&&(l.Long?(i.kindNegative=l.Long.fromValue(e.kindNegative)).unsigned=!0:typeof e.kindNegative=="string"?i.kindNegative=parseInt(e.kindNegative,10):typeof e.kindNegative=="number"?i.kindNegative=e.kindNegative:typeof e.kindNegative=="object"&&(i.kindNegative=new l.LongBits(e.kindNegative.low>>>0,e.kindNegative.high>>>0).toNumber(!0))),e.kindPositive!=null&&(l.Long?(i.kindPositive=l.Long.fromValue(e.kindPositive)).unsigned=!0:typeof e.kindPositive=="string"?i.kindPositive=parseInt(e.kindPositive,10):typeof e.kindPositive=="number"?i.kindPositive=e.kindPositive:typeof e.kindPositive=="object"&&(i.kindPositive=new l.LongBits(e.kindPositive.low>>>0,e.kindPositive.high>>>0).toNumber(!0))),e.kindReport){default:if(typeof e.kindReport=="number"){i.kindReport=e.kindReport;break}break;case"NONE":case 0:i.kindReport=0;break;case"GENERIC":case 1:i.kindReport=1;break}if(e.sideBySideSurveyMetadata!=null){if(typeof e.sideBySideSurveyMetadata!="object")throw TypeError(".proto.BotFeedbackMessage.sideBySideSurveyMetadata: object expected");i.sideBySideSurveyMetadata=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.fromObject(e.sideBySideSurveyMetadata)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=d.proto.MessageKey.toObject(e.messageKey,i),i.oneofs&&(A._messageKey="messageKey")),e.kind!=null&&e.hasOwnProperty("kind")&&(A.kind=i.enums===String?d.proto.BotFeedbackMessage.BotFeedbackKind[e.kind]===void 0?e.kind:d.proto.BotFeedbackMessage.BotFeedbackKind[e.kind]:e.kind,i.oneofs&&(A._kind="kind")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,i.oneofs&&(A._text="text")),e.kindNegative!=null&&e.hasOwnProperty("kindNegative")&&(typeof e.kindNegative=="number"?A.kindNegative=i.longs===String?String(e.kindNegative):e.kindNegative:A.kindNegative=i.longs===String?ge(e.kindNegative,!0):i.longs===Number?ce(e.kindNegative,!0):e.kindNegative,i.oneofs&&(A._kindNegative="kindNegative")),e.kindPositive!=null&&e.hasOwnProperty("kindPositive")&&(typeof e.kindPositive=="number"?A.kindPositive=i.longs===String?String(e.kindPositive):e.kindPositive:A.kindPositive=i.longs===String?ge(e.kindPositive,!0):i.longs===Number?ce(e.kindPositive,!0):e.kindPositive,i.oneofs&&(A._kindPositive="kindPositive")),e.kindReport!=null&&e.hasOwnProperty("kindReport")&&(A.kindReport=i.enums===String?d.proto.BotFeedbackMessage.ReportKind[e.kindReport]===void 0?e.kindReport:d.proto.BotFeedbackMessage.ReportKind[e.kindReport]:e.kindReport,i.oneofs&&(A._kindReport="kindReport")),e.sideBySideSurveyMetadata!=null&&e.hasOwnProperty("sideBySideSurveyMetadata")&&(A.sideBySideSurveyMetadata=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.toObject(e.sideBySideSurveyMetadata,i),i.oneofs&&(A._sideBySideSurveyMetadata="sideBySideSurveyMetadata")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotFeedbackMessage"},t.BotFeedbackKind=(function(){let a={},e=Object.create(a);return e[a[0]="BOT_FEEDBACK_POSITIVE"]=0,e[a[1]="BOT_FEEDBACK_NEGATIVE_GENERIC"]=1,e[a[2]="BOT_FEEDBACK_NEGATIVE_HELPFUL"]=2,e[a[3]="BOT_FEEDBACK_NEGATIVE_INTERESTING"]=3,e[a[4]="BOT_FEEDBACK_NEGATIVE_ACCURATE"]=4,e[a[5]="BOT_FEEDBACK_NEGATIVE_SAFE"]=5,e[a[6]="BOT_FEEDBACK_NEGATIVE_OTHER"]=6,e[a[7]="BOT_FEEDBACK_NEGATIVE_REFUSED"]=7,e[a[8]="BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING"]=8,e[a[9]="BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT"]=9,e[a[10]="BOT_FEEDBACK_NEGATIVE_PERSONALIZED"]=10,e[a[11]="BOT_FEEDBACK_NEGATIVE_CLARITY"]=11,e[a[12]="BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON"]=12,e[a[13]="BOT_FEEDBACK_NEGATIVE_HALLUCINATION_INTERNAL_ONLY"]=13,e[a[14]="BOT_FEEDBACK_NEGATIVE"]=14,e})(),t.BotFeedbackKindMultipleNegative=(function(){let a={},e=Object.create(a);return e[a[1]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_GENERIC"]=1,e[a[2]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_HELPFUL"]=2,e[a[4]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_INTERESTING"]=4,e[a[8]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_ACCURATE"]=8,e[a[16]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_SAFE"]=16,e[a[32]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_OTHER"]=32,e[a[64]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_REFUSED"]=64,e[a[128]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_VISUALLY_APPEALING"]=128,e[a[256]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_RELEVANT_TO_TEXT"]=256,e})(),t.BotFeedbackKindMultiplePositive=(function(){let a={},e=Object.create(a);return e[a[1]="BOT_FEEDBACK_MULTIPLE_POSITIVE_GENERIC"]=1,e})(),t.ReportKind=(function(){let a={},e=Object.create(a);return e[a[0]="NONE"]=0,e[a[1]="GENERIC"]=1,e})(),t.SideBySideSurveyMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.selectedRequestId=A.string();break}case 2:{c.surveyId=A.uint32();break}case 3:{c.simonSessionFbid=A.string();break}case 4:{c.responseOtid=A.string();break}case 5:{c.responseTimestampMsString=A.string();break}case 6:{c.isSelectedResponsePrimary=A.bool();break}case 7:{c.messageIdToEdit=A.string();break}case 8:{c.analyticsData=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.decode(A,A.uint32());break}case 9:{c.metaAiAnalyticsData=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata)return A;var r=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata;if(A.selectedRequestId!=null&&(r.selectedRequestId=String(A.selectedRequestId)),A.surveyId!=null&&(r.surveyId=A.surveyId>>>0),A.simonSessionFbid!=null&&(r.simonSessionFbid=String(A.simonSessionFbid)),A.responseOtid!=null&&(r.responseOtid=String(A.responseOtid)),A.responseTimestampMsString!=null&&(r.responseTimestampMsString=String(A.responseTimestampMsString)),A.isSelectedResponsePrimary!=null&&(r.isSelectedResponsePrimary=!!A.isSelectedResponsePrimary),A.messageIdToEdit!=null&&(r.messageIdToEdit=String(A.messageIdToEdit)),A.analyticsData!=null){if(typeof A.analyticsData!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.analyticsData: object expected");r.analyticsData=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.fromObject(A.analyticsData)}if(A.metaAiAnalyticsData!=null){if(typeof A.metaAiAnalyticsData!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.metaAiAnalyticsData: object expected");r.metaAiAnalyticsData=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.fromObject(A.metaAiAnalyticsData)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.selectedRequestId!=null&&A.hasOwnProperty("selectedRequestId")&&(s.selectedRequestId=A.selectedRequestId,r.oneofs&&(s._selectedRequestId="selectedRequestId")),A.surveyId!=null&&A.hasOwnProperty("surveyId")&&(s.surveyId=A.surveyId,r.oneofs&&(s._surveyId="surveyId")),A.simonSessionFbid!=null&&A.hasOwnProperty("simonSessionFbid")&&(s.simonSessionFbid=A.simonSessionFbid,r.oneofs&&(s._simonSessionFbid="simonSessionFbid")),A.responseOtid!=null&&A.hasOwnProperty("responseOtid")&&(s.responseOtid=A.responseOtid,r.oneofs&&(s._responseOtid="responseOtid")),A.responseTimestampMsString!=null&&A.hasOwnProperty("responseTimestampMsString")&&(s.responseTimestampMsString=A.responseTimestampMsString,r.oneofs&&(s._responseTimestampMsString="responseTimestampMsString")),A.isSelectedResponsePrimary!=null&&A.hasOwnProperty("isSelectedResponsePrimary")&&(s.isSelectedResponsePrimary=A.isSelectedResponsePrimary,r.oneofs&&(s._isSelectedResponsePrimary="isSelectedResponsePrimary")),A.messageIdToEdit!=null&&A.hasOwnProperty("messageIdToEdit")&&(s.messageIdToEdit=A.messageIdToEdit,r.oneofs&&(s._messageIdToEdit="messageIdToEdit")),A.analyticsData!=null&&A.hasOwnProperty("analyticsData")&&(s.analyticsData=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.toObject(A.analyticsData,r),r.oneofs&&(s._analyticsData="analyticsData")),A.metaAiAnalyticsData!=null&&A.hasOwnProperty("metaAiAnalyticsData")&&(s.metaAiAnalyticsData=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.toObject(A.metaAiAnalyticsData,r),r.oneofs&&(s._metaAiAnalyticsData="metaAiAnalyticsData")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata"},a.SideBySideSurveyAnalyticsData=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.tessaEvent=s.string();break}case 2:{p.tessaSessionFbid=s.string();break}case 3:{p.simonSessionFbid=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData)return s;var g=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData;return s.tessaEvent!=null&&(g.tessaEvent=String(s.tessaEvent)),s.tessaSessionFbid!=null&&(g.tessaSessionFbid=String(s.tessaSessionFbid)),s.simonSessionFbid!=null&&(g.simonSessionFbid=String(s.simonSessionFbid)),g},i.toObject=function(s,g){g||(g={});var c={};return s.tessaEvent!=null&&s.hasOwnProperty("tessaEvent")&&(c.tessaEvent=s.tessaEvent,g.oneofs&&(c._tessaEvent="tessaEvent")),s.tessaSessionFbid!=null&&s.hasOwnProperty("tessaSessionFbid")&&(c.tessaSessionFbid=s.tessaSessionFbid,g.oneofs&&(c._tessaSessionFbid="tessaSessionFbid")),s.simonSessionFbid!=null&&s.hasOwnProperty("simonSessionFbid")&&(c.simonSessionFbid=s.simonSessionFbid,g.oneofs&&(c._simonSessionFbid="simonSessionFbid")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData"},i})(),a.SidebySideSurveyMetaAiAnalyticsData=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.surveyId=s.uint32();break}case 2:{p.primaryResponseId=s.string();break}case 3:{p.testArmName=s.string();break}case 4:{p.timestampMsString=s.string();break}case 5:{p.ctaImpressionEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.decode(s,s.uint32());break}case 6:{p.ctaClickEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.decode(s,s.uint32());break}case 7:{p.cardImpressionEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.decode(s,s.uint32());break}case 8:{p.responseEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.decode(s,s.uint32());break}case 9:{p.abandonEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData)return s;var g=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData;if(s.surveyId!=null&&(g.surveyId=s.surveyId>>>0),s.primaryResponseId!=null&&(g.primaryResponseId=String(s.primaryResponseId)),s.testArmName!=null&&(g.testArmName=String(s.testArmName)),s.timestampMsString!=null&&(g.timestampMsString=String(s.timestampMsString)),s.ctaImpressionEvent!=null){if(typeof s.ctaImpressionEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.ctaImpressionEvent: object expected");g.ctaImpressionEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.fromObject(s.ctaImpressionEvent)}if(s.ctaClickEvent!=null){if(typeof s.ctaClickEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.ctaClickEvent: object expected");g.ctaClickEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.fromObject(s.ctaClickEvent)}if(s.cardImpressionEvent!=null){if(typeof s.cardImpressionEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.cardImpressionEvent: object expected");g.cardImpressionEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.fromObject(s.cardImpressionEvent)}if(s.responseEvent!=null){if(typeof s.responseEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.responseEvent: object expected");g.responseEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.fromObject(s.responseEvent)}if(s.abandonEvent!=null){if(typeof s.abandonEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.abandonEvent: object expected");g.abandonEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.fromObject(s.abandonEvent)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.surveyId!=null&&s.hasOwnProperty("surveyId")&&(c.surveyId=s.surveyId,g.oneofs&&(c._surveyId="surveyId")),s.primaryResponseId!=null&&s.hasOwnProperty("primaryResponseId")&&(c.primaryResponseId=s.primaryResponseId,g.oneofs&&(c._primaryResponseId="primaryResponseId")),s.testArmName!=null&&s.hasOwnProperty("testArmName")&&(c.testArmName=s.testArmName,g.oneofs&&(c._testArmName="testArmName")),s.timestampMsString!=null&&s.hasOwnProperty("timestampMsString")&&(c.timestampMsString=s.timestampMsString,g.oneofs&&(c._timestampMsString="timestampMsString")),s.ctaImpressionEvent!=null&&s.hasOwnProperty("ctaImpressionEvent")&&(c.ctaImpressionEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.toObject(s.ctaImpressionEvent,g),g.oneofs&&(c._ctaImpressionEvent="ctaImpressionEvent")),s.ctaClickEvent!=null&&s.hasOwnProperty("ctaClickEvent")&&(c.ctaClickEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.toObject(s.ctaClickEvent,g),g.oneofs&&(c._ctaClickEvent="ctaClickEvent")),s.cardImpressionEvent!=null&&s.hasOwnProperty("cardImpressionEvent")&&(c.cardImpressionEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.toObject(s.cardImpressionEvent,g),g.oneofs&&(c._cardImpressionEvent="cardImpressionEvent")),s.responseEvent!=null&&s.hasOwnProperty("responseEvent")&&(c.responseEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.toObject(s.responseEvent,g),g.oneofs&&(c._responseEvent="responseEvent")),s.abandonEvent!=null&&s.hasOwnProperty("abandonEvent")&&(c.abandonEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.toObject(s.abandonEvent,g),g.oneofs&&(c._abandonEvent="abandonEvent")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData"},i.SideBySideSurveyAbandonEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.abandonDwellTimeMsString=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData)return c;var I=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData;return c.abandonDwellTimeMsString!=null&&(I.abandonDwellTimeMsString=String(c.abandonDwellTimeMsString)),I},r.toObject=function(c,I){I||(I={});var p={};return c.abandonDwellTimeMsString!=null&&c.hasOwnProperty("abandonDwellTimeMsString")&&(p.abandonDwellTimeMsString=c.abandonDwellTimeMsString,I.oneofs&&(p._abandonDwellTimeMsString="abandonDwellTimeMsString")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData"},r})(),i.SideBySideSurveyCTAClickEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.isSurveyExpired=c.bool();break}case 2:{f.clickDwellTimeMsString=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData)return c;var I=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData;return c.isSurveyExpired!=null&&(I.isSurveyExpired=!!c.isSurveyExpired),c.clickDwellTimeMsString!=null&&(I.clickDwellTimeMsString=String(c.clickDwellTimeMsString)),I},r.toObject=function(c,I){I||(I={});var p={};return c.isSurveyExpired!=null&&c.hasOwnProperty("isSurveyExpired")&&(p.isSurveyExpired=c.isSurveyExpired,I.oneofs&&(p._isSurveyExpired="isSurveyExpired")),c.clickDwellTimeMsString!=null&&c.hasOwnProperty("clickDwellTimeMsString")&&(p.clickDwellTimeMsString=c.clickDwellTimeMsString,I.oneofs&&(p._clickDwellTimeMsString="clickDwellTimeMsString")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData"},r})(),i.SideBySideSurveyCTAImpressionEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.isSurveyExpired=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData)return c;var I=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData;return c.isSurveyExpired!=null&&(I.isSurveyExpired=!!c.isSurveyExpired),I},r.toObject=function(c,I){I||(I={});var p={};return c.isSurveyExpired!=null&&c.hasOwnProperty("isSurveyExpired")&&(p.isSurveyExpired=c.isSurveyExpired,I.oneofs&&(p._isSurveyExpired="isSurveyExpired")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData"},r})(),i.SideBySideSurveyCardImpressionEventData=(function(){function r(s){if(s)for(var g=Object.keys(s),c=0;c>>3){default:g.skipType(f&7);break}}return B},r.fromObject=function(g){return g instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData?g:new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData},r.toObject=function(){return{}},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(g){return g===void 0&&(g="type.googleapis.com"),g+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData"},r})(),i.SideBySideSurveyResponseEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.responseDwellTimeMsString=c.string();break}case 2:{f.selectedResponseId=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData)return c;var I=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData;return c.responseDwellTimeMsString!=null&&(I.responseDwellTimeMsString=String(c.responseDwellTimeMsString)),c.selectedResponseId!=null&&(I.selectedResponseId=String(c.selectedResponseId)),I},r.toObject=function(c,I){I||(I={});var p={};return c.responseDwellTimeMsString!=null&&c.hasOwnProperty("responseDwellTimeMsString")&&(p.responseDwellTimeMsString=c.responseDwellTimeMsString,I.oneofs&&(p._responseDwellTimeMsString="responseDwellTimeMsString")),c.selectedResponseId!=null&&c.hasOwnProperty("selectedResponseId")&&(p.selectedResponseId=c.selectedResponseId,I.oneofs&&(p._selectedResponseId="selectedResponseId")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData"},r})(),i})(),a})(),t})(),n.BotImagineMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.imagineType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotImagineMetadata)return e;var i=new d.proto.BotImagineMetadata;switch(e.imagineType){default:if(typeof e.imagineType=="number"){i.imagineType=e.imagineType;break}break;case"UNKNOWN":case 0:i.imagineType=0;break;case"IMAGINE":case 1:i.imagineType=1;break;case"MEMU":case 2:i.imagineType=2;break;case"FLASH":case 3:i.imagineType=3;break;case"EDIT":case 4:i.imagineType=4;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.imagineType!=null&&e.hasOwnProperty("imagineType")&&(A.imagineType=i.enums===String?d.proto.BotImagineMetadata.ImagineType[e.imagineType]===void 0?e.imagineType:d.proto.BotImagineMetadata.ImagineType[e.imagineType]:e.imagineType,i.oneofs&&(A._imagineType="imagineType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotImagineMetadata"},t.ImagineType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="IMAGINE"]=1,e[a[2]="MEMU"]=2,e[a[3]="FLASH"]=3,e[a[4]="EDIT"]=4,e})(),t})(),n.BotLinkedAccount=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotLinkedAccount)return e;var i=new d.proto.BotLinkedAccount;switch(e.type){default:if(typeof e.type=="number"){i.type=e.type;break}break;case"BOT_LINKED_ACCOUNT_TYPE_1P":case 0:i.type=0;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=i.enums===String?d.proto.BotLinkedAccount.BotLinkedAccountType[e.type]===void 0?e.type:d.proto.BotLinkedAccount.BotLinkedAccountType[e.type]:e.type,i.oneofs&&(A._type="type")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotLinkedAccount"},t.BotLinkedAccountType=(function(){let a={},e=Object.create(a);return e[a[0]="BOT_LINKED_ACCOUNT_TYPE_1P"]=0,e})(),t})(),n.BotLinkedAccountsMetadata=(function(){function t(a){if(this.accounts=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.accounts&&s.accounts.length||(s.accounts=[]),s.accounts.push(d.proto.BotLinkedAccount.decode(e,e.uint32()));break}case 2:{s.acAuthTokens=e.bytes();break}case 3:{s.acErrorCode=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotLinkedAccountsMetadata)return e;var i=new d.proto.BotLinkedAccountsMetadata;if(e.accounts){if(!Array.isArray(e.accounts))throw TypeError(".proto.BotLinkedAccountsMetadata.accounts: array expected");i.accounts=[];for(var A=0;A=0&&(i.acAuthTokens=e.acAuthTokens)),e.acErrorCode!=null&&(i.acErrorCode=e.acErrorCode|0),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.accounts=[]),e.accounts&&e.accounts.length){A.accounts=[];for(var r=0;r>>3){case 1:{s.fileSha256=e.string();break}case 2:{s.mediaKey=e.string();break}case 3:{s.fileEncSha256=e.string();break}case 4:{s.directPath=e.string();break}case 5:{s.mediaKeyTimestamp=e.int64();break}case 6:{s.mimetype=e.string();break}case 7:{s.orientationType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMediaMetadata)return e;var i=new d.proto.BotMediaMetadata;switch(e.fileSha256!=null&&(i.fileSha256=String(e.fileSha256)),e.mediaKey!=null&&(i.mediaKey=String(e.mediaKey)),e.fileEncSha256!=null&&(i.fileEncSha256=String(e.fileEncSha256)),e.directPath!=null&&(i.directPath=String(e.directPath)),e.mediaKeyTimestamp!=null&&(l.Long?(i.mediaKeyTimestamp=l.Long.fromValue(e.mediaKeyTimestamp)).unsigned=!1:typeof e.mediaKeyTimestamp=="string"?i.mediaKeyTimestamp=parseInt(e.mediaKeyTimestamp,10):typeof e.mediaKeyTimestamp=="number"?i.mediaKeyTimestamp=e.mediaKeyTimestamp:typeof e.mediaKeyTimestamp=="object"&&(i.mediaKeyTimestamp=new l.LongBits(e.mediaKeyTimestamp.low>>>0,e.mediaKeyTimestamp.high>>>0).toNumber())),e.mimetype!=null&&(i.mimetype=String(e.mimetype)),e.orientationType){default:if(typeof e.orientationType=="number"){i.orientationType=e.orientationType;break}break;case"CENTER":case 1:i.orientationType=1;break;case"LEFT":case 2:i.orientationType=2;break;case"RIGHT":case 3:i.orientationType=3;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=e.fileSha256,i.oneofs&&(A._fileSha256="fileSha256")),e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=e.mediaKey,i.oneofs&&(A._mediaKey="mediaKey")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=e.fileEncSha256,i.oneofs&&(A._fileEncSha256="fileEncSha256")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,i.oneofs&&(A._directPath="directPath")),e.mediaKeyTimestamp!=null&&e.hasOwnProperty("mediaKeyTimestamp")&&(typeof e.mediaKeyTimestamp=="number"?A.mediaKeyTimestamp=i.longs===String?String(e.mediaKeyTimestamp):e.mediaKeyTimestamp:A.mediaKeyTimestamp=i.longs===String?ge(e.mediaKeyTimestamp):i.longs===Number?ce(e.mediaKeyTimestamp):e.mediaKeyTimestamp,i.oneofs&&(A._mediaKeyTimestamp="mediaKeyTimestamp")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,i.oneofs&&(A._mimetype="mimetype")),e.orientationType!=null&&e.hasOwnProperty("orientationType")&&(A.orientationType=i.enums===String?d.proto.BotMediaMetadata.OrientationType[e.orientationType]===void 0?e.orientationType:d.proto.BotMediaMetadata.OrientationType[e.orientationType]:e.orientationType,i.oneofs&&(A._orientationType="orientationType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMediaMetadata"},t.OrientationType=(function(){let a={},e=Object.create(a);return e[a[1]="CENTER"]=1,e[a[2]="LEFT"]=2,e[a[3]="RIGHT"]=3,e})(),t})(),n.BotMemoryFact=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.fact=e.string();break}case 2:{s.factId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMemoryFact)return e;var i=new d.proto.BotMemoryFact;return e.fact!=null&&(i.fact=String(e.fact)),e.factId!=null&&(i.factId=String(e.factId)),i},t.toObject=function(e,i){i||(i={});var A={};return e.fact!=null&&e.hasOwnProperty("fact")&&(A.fact=e.fact,i.oneofs&&(A._fact="fact")),e.factId!=null&&e.hasOwnProperty("factId")&&(A.factId=e.factId,i.oneofs&&(A._factId="factId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMemoryFact"},t})(),n.BotMemoryMetadata=(function(){function t(a){if(this.addedFacts=[],this.removedFacts=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.addedFacts&&s.addedFacts.length||(s.addedFacts=[]),s.addedFacts.push(d.proto.BotMemoryFact.decode(e,e.uint32()));break}case 2:{s.removedFacts&&s.removedFacts.length||(s.removedFacts=[]),s.removedFacts.push(d.proto.BotMemoryFact.decode(e,e.uint32()));break}case 3:{s.disclaimer=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMemoryMetadata)return e;var i=new d.proto.BotMemoryMetadata;if(e.addedFacts){if(!Array.isArray(e.addedFacts))throw TypeError(".proto.BotMemoryMetadata.addedFacts: array expected");i.addedFacts=[];for(var A=0;A>>3){case 1:{r.faceImages&&r.faceImages.length||(r.faceImages=[]),r.faceImages.push(d.proto.BotMediaMetadata.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotMemuMetadata)return a;var e=new d.proto.BotMemuMetadata;if(a.faceImages){if(!Array.isArray(a.faceImages))throw TypeError(".proto.BotMemuMetadata.faceImages: array expected");e.faceImages=[];for(var i=0;i>>3){case 1:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMessageOrigin)return e;var i=new d.proto.BotMessageOrigin;switch(e.type){default:if(typeof e.type=="number"){i.type=e.type;break}break;case"BOT_MESSAGE_ORIGIN_TYPE_AI_INITIATED":case 0:i.type=0;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=i.enums===String?d.proto.BotMessageOrigin.BotMessageOriginType[e.type]===void 0?e.type:d.proto.BotMessageOrigin.BotMessageOriginType[e.type]:e.type,i.oneofs&&(A._type="type")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMessageOrigin"},t.BotMessageOriginType=(function(){let a={},e=Object.create(a);return e[a[0]="BOT_MESSAGE_ORIGIN_TYPE_AI_INITIATED"]=0,e})(),t})(),n.BotMessageOriginMetadata=(function(){function t(o){if(this.origins=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.origins&&r.origins.length||(r.origins=[]),r.origins.push(d.proto.BotMessageOrigin.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotMessageOriginMetadata)return a;var e=new d.proto.BotMessageOriginMetadata;if(a.origins){if(!Array.isArray(a.origins))throw TypeError(".proto.BotMessageOriginMetadata.origins: array expected");e.origins=[];for(var i=0;i>>3){case 1:{s.botEntryPointOrigin=e.int32();break}case 2:{s.forwardScore=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMessageSharingInfo)return e;var i=new d.proto.BotMessageSharingInfo;switch(e.botEntryPointOrigin){default:if(typeof e.botEntryPointOrigin=="number"){i.botEntryPointOrigin=e.botEntryPointOrigin;break}break;case"UNDEFINED_ENTRY_POINT":case 0:i.botEntryPointOrigin=0;break;case"FAVICON":case 1:i.botEntryPointOrigin=1;break;case"CHATLIST":case 2:i.botEntryPointOrigin=2;break;case"AISEARCH_NULL_STATE_PAPER_PLANE":case 3:i.botEntryPointOrigin=3;break;case"AISEARCH_NULL_STATE_SUGGESTION":case 4:i.botEntryPointOrigin=4;break;case"AISEARCH_TYPE_AHEAD_SUGGESTION":case 5:i.botEntryPointOrigin=5;break;case"AISEARCH_TYPE_AHEAD_PAPER_PLANE":case 6:i.botEntryPointOrigin=6;break;case"AISEARCH_TYPE_AHEAD_RESULT_CHATLIST":case 7:i.botEntryPointOrigin=7;break;case"AISEARCH_TYPE_AHEAD_RESULT_MESSAGES":case 8:i.botEntryPointOrigin=8;break;case"AIVOICE_SEARCH_BAR":case 9:i.botEntryPointOrigin=9;break;case"AIVOICE_FAVICON":case 10:i.botEntryPointOrigin=10;break;case"AISTUDIO":case 11:i.botEntryPointOrigin=11;break;case"DEEPLINK":case 12:i.botEntryPointOrigin=12;break;case"NOTIFICATION":case 13:i.botEntryPointOrigin=13;break;case"PROFILE_MESSAGE_BUTTON":case 14:i.botEntryPointOrigin=14;break;case"FORWARD":case 15:i.botEntryPointOrigin=15;break;case"APP_SHORTCUT":case 16:i.botEntryPointOrigin=16;break;case"FF_FAMILY":case 17:i.botEntryPointOrigin=17;break;case"AI_TAB":case 18:i.botEntryPointOrigin=18;break;case"AI_HOME":case 19:i.botEntryPointOrigin=19;break;case"AI_DEEPLINK_IMMERSIVE":case 20:i.botEntryPointOrigin=20;break;case"AI_DEEPLINK":case 21:i.botEntryPointOrigin=21;break;case"META_AI_CHAT_SHORTCUT_AI_STUDIO":case 22:i.botEntryPointOrigin=22;break;case"UGC_CHAT_SHORTCUT_AI_STUDIO":case 23:i.botEntryPointOrigin=23;break;case"NEW_CHAT_AI_STUDIO":case 24:i.botEntryPointOrigin=24;break;case"AIVOICE_FAVICON_CALL_HISTORY":case 25:i.botEntryPointOrigin=25;break;case"ASK_META_AI_CONTEXT_MENU":case 26:i.botEntryPointOrigin=26;break;case"ASK_META_AI_CONTEXT_MENU_1ON1":case 27:i.botEntryPointOrigin=27;break;case"ASK_META_AI_CONTEXT_MENU_GROUP":case 28:i.botEntryPointOrigin=28;break;case"INVOKE_META_AI_1ON1":case 29:i.botEntryPointOrigin=29;break;case"INVOKE_META_AI_GROUP":case 30:i.botEntryPointOrigin=30;break;case"META_AI_FORWARD":case 31:i.botEntryPointOrigin=31;break;case"NEW_CHAT_AI_CONTACT":case 32:i.botEntryPointOrigin=32;break;case"MESSAGE_QUICK_ACTION_1_ON_1_CHAT":case 33:i.botEntryPointOrigin=33;break;case"MESSAGE_QUICK_ACTION_GROUP_CHAT":case 34:i.botEntryPointOrigin=34;break;case"ATTACHMENT_TRAY_1_ON_1_CHAT":case 35:i.botEntryPointOrigin=35;break;case"ATTACHMENT_TRAY_GROUP_CHAT":case 36:i.botEntryPointOrigin=36;break;case"ASK_META_AI_MEDIA_VIEWER_1ON1":case 37:i.botEntryPointOrigin=37;break;case"ASK_META_AI_MEDIA_VIEWER_GROUP":case 38:i.botEntryPointOrigin=38;break}return e.forwardScore!=null&&(i.forwardScore=e.forwardScore>>>0),i},t.toObject=function(e,i){i||(i={});var A={};return e.botEntryPointOrigin!=null&&e.hasOwnProperty("botEntryPointOrigin")&&(A.botEntryPointOrigin=i.enums===String?d.proto.BotMetricsEntryPoint[e.botEntryPointOrigin]===void 0?e.botEntryPointOrigin:d.proto.BotMetricsEntryPoint[e.botEntryPointOrigin]:e.botEntryPointOrigin,i.oneofs&&(A._botEntryPointOrigin="botEntryPointOrigin")),e.forwardScore!=null&&e.hasOwnProperty("forwardScore")&&(A.forwardScore=e.forwardScore,i.oneofs&&(A._forwardScore="forwardScore")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMessageSharingInfo"},t})(),n.BotMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.avatarMetadata=d.proto.BotAvatarMetadata.decode(e,e.uint32());break}case 2:{s.personaId=e.string();break}case 3:{s.pluginMetadata=d.proto.BotPluginMetadata.decode(e,e.uint32());break}case 4:{s.suggestedPromptMetadata=d.proto.BotSuggestedPromptMetadata.decode(e,e.uint32());break}case 5:{s.invokerJid=e.string();break}case 6:{s.sessionMetadata=d.proto.BotSessionMetadata.decode(e,e.uint32());break}case 7:{s.memuMetadata=d.proto.BotMemuMetadata.decode(e,e.uint32());break}case 8:{s.timezone=e.string();break}case 9:{s.reminderMetadata=d.proto.BotReminderMetadata.decode(e,e.uint32());break}case 10:{s.modelMetadata=d.proto.BotModelMetadata.decode(e,e.uint32());break}case 11:{s.messageDisclaimerText=e.string();break}case 12:{s.progressIndicatorMetadata=d.proto.BotProgressIndicatorMetadata.decode(e,e.uint32());break}case 13:{s.capabilityMetadata=d.proto.BotCapabilityMetadata.decode(e,e.uint32());break}case 14:{s.imagineMetadata=d.proto.BotImagineMetadata.decode(e,e.uint32());break}case 15:{s.memoryMetadata=d.proto.BotMemoryMetadata.decode(e,e.uint32());break}case 16:{s.renderingMetadata=d.proto.BotRenderingMetadata.decode(e,e.uint32());break}case 17:{s.botMetricsMetadata=d.proto.BotMetricsMetadata.decode(e,e.uint32());break}case 18:{s.botLinkedAccountsMetadata=d.proto.BotLinkedAccountsMetadata.decode(e,e.uint32());break}case 19:{s.richResponseSourcesMetadata=d.proto.BotSourcesMetadata.decode(e,e.uint32());break}case 20:{s.aiConversationContext=e.bytes();break}case 21:{s.botPromotionMessageMetadata=d.proto.BotPromotionMessageMetadata.decode(e,e.uint32());break}case 22:{s.botModeSelectionMetadata=d.proto.BotModeSelectionMetadata.decode(e,e.uint32());break}case 23:{s.botQuotaMetadata=d.proto.BotQuotaMetadata.decode(e,e.uint32());break}case 24:{s.botAgeCollectionMetadata=d.proto.BotAgeCollectionMetadata.decode(e,e.uint32());break}case 25:{s.conversationStarterPromptId=e.string();break}case 26:{s.botResponseId=e.string();break}case 27:{s.verificationMetadata=d.proto.BotSignatureVerificationMetadata.decode(e,e.uint32());break}case 28:{s.unifiedResponseMutation=d.proto.BotUnifiedResponseMutation.decode(e,e.uint32());break}case 29:{s.botMessageOriginMetadata=d.proto.BotMessageOriginMetadata.decode(e,e.uint32());break}case 30:{s.inThreadSurveyMetadata=d.proto.InThreadSurveyMetadata.decode(e,e.uint32());break}case 31:{s.botThreadInfo=d.proto.AIThreadInfo.decode(e,e.uint32());break}case 32:{s.regenerateMetadata=d.proto.AIRegenerateMetadata.decode(e,e.uint32());break}case 33:{s.sessionTransparencyMetadata=d.proto.SessionTransparencyMetadata.decode(e,e.uint32());break}case 999:{s.internalMetadata=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMetadata)return e;var i=new d.proto.BotMetadata;if(e.avatarMetadata!=null){if(typeof e.avatarMetadata!="object")throw TypeError(".proto.BotMetadata.avatarMetadata: object expected");i.avatarMetadata=d.proto.BotAvatarMetadata.fromObject(e.avatarMetadata)}if(e.personaId!=null&&(i.personaId=String(e.personaId)),e.pluginMetadata!=null){if(typeof e.pluginMetadata!="object")throw TypeError(".proto.BotMetadata.pluginMetadata: object expected");i.pluginMetadata=d.proto.BotPluginMetadata.fromObject(e.pluginMetadata)}if(e.suggestedPromptMetadata!=null){if(typeof e.suggestedPromptMetadata!="object")throw TypeError(".proto.BotMetadata.suggestedPromptMetadata: object expected");i.suggestedPromptMetadata=d.proto.BotSuggestedPromptMetadata.fromObject(e.suggestedPromptMetadata)}if(e.invokerJid!=null&&(i.invokerJid=String(e.invokerJid)),e.sessionMetadata!=null){if(typeof e.sessionMetadata!="object")throw TypeError(".proto.BotMetadata.sessionMetadata: object expected");i.sessionMetadata=d.proto.BotSessionMetadata.fromObject(e.sessionMetadata)}if(e.memuMetadata!=null){if(typeof e.memuMetadata!="object")throw TypeError(".proto.BotMetadata.memuMetadata: object expected");i.memuMetadata=d.proto.BotMemuMetadata.fromObject(e.memuMetadata)}if(e.timezone!=null&&(i.timezone=String(e.timezone)),e.reminderMetadata!=null){if(typeof e.reminderMetadata!="object")throw TypeError(".proto.BotMetadata.reminderMetadata: object expected");i.reminderMetadata=d.proto.BotReminderMetadata.fromObject(e.reminderMetadata)}if(e.modelMetadata!=null){if(typeof e.modelMetadata!="object")throw TypeError(".proto.BotMetadata.modelMetadata: object expected");i.modelMetadata=d.proto.BotModelMetadata.fromObject(e.modelMetadata)}if(e.messageDisclaimerText!=null&&(i.messageDisclaimerText=String(e.messageDisclaimerText)),e.progressIndicatorMetadata!=null){if(typeof e.progressIndicatorMetadata!="object")throw TypeError(".proto.BotMetadata.progressIndicatorMetadata: object expected");i.progressIndicatorMetadata=d.proto.BotProgressIndicatorMetadata.fromObject(e.progressIndicatorMetadata)}if(e.capabilityMetadata!=null){if(typeof e.capabilityMetadata!="object")throw TypeError(".proto.BotMetadata.capabilityMetadata: object expected");i.capabilityMetadata=d.proto.BotCapabilityMetadata.fromObject(e.capabilityMetadata)}if(e.imagineMetadata!=null){if(typeof e.imagineMetadata!="object")throw TypeError(".proto.BotMetadata.imagineMetadata: object expected");i.imagineMetadata=d.proto.BotImagineMetadata.fromObject(e.imagineMetadata)}if(e.memoryMetadata!=null){if(typeof e.memoryMetadata!="object")throw TypeError(".proto.BotMetadata.memoryMetadata: object expected");i.memoryMetadata=d.proto.BotMemoryMetadata.fromObject(e.memoryMetadata)}if(e.renderingMetadata!=null){if(typeof e.renderingMetadata!="object")throw TypeError(".proto.BotMetadata.renderingMetadata: object expected");i.renderingMetadata=d.proto.BotRenderingMetadata.fromObject(e.renderingMetadata)}if(e.botMetricsMetadata!=null){if(typeof e.botMetricsMetadata!="object")throw TypeError(".proto.BotMetadata.botMetricsMetadata: object expected");i.botMetricsMetadata=d.proto.BotMetricsMetadata.fromObject(e.botMetricsMetadata)}if(e.botLinkedAccountsMetadata!=null){if(typeof e.botLinkedAccountsMetadata!="object")throw TypeError(".proto.BotMetadata.botLinkedAccountsMetadata: object expected");i.botLinkedAccountsMetadata=d.proto.BotLinkedAccountsMetadata.fromObject(e.botLinkedAccountsMetadata)}if(e.richResponseSourcesMetadata!=null){if(typeof e.richResponseSourcesMetadata!="object")throw TypeError(".proto.BotMetadata.richResponseSourcesMetadata: object expected");i.richResponseSourcesMetadata=d.proto.BotSourcesMetadata.fromObject(e.richResponseSourcesMetadata)}if(e.aiConversationContext!=null&&(typeof e.aiConversationContext=="string"?l.base64.decode(e.aiConversationContext,i.aiConversationContext=l.newBuffer(l.base64.length(e.aiConversationContext)),0):e.aiConversationContext.length>=0&&(i.aiConversationContext=e.aiConversationContext)),e.botPromotionMessageMetadata!=null){if(typeof e.botPromotionMessageMetadata!="object")throw TypeError(".proto.BotMetadata.botPromotionMessageMetadata: object expected");i.botPromotionMessageMetadata=d.proto.BotPromotionMessageMetadata.fromObject(e.botPromotionMessageMetadata)}if(e.botModeSelectionMetadata!=null){if(typeof e.botModeSelectionMetadata!="object")throw TypeError(".proto.BotMetadata.botModeSelectionMetadata: object expected");i.botModeSelectionMetadata=d.proto.BotModeSelectionMetadata.fromObject(e.botModeSelectionMetadata)}if(e.botQuotaMetadata!=null){if(typeof e.botQuotaMetadata!="object")throw TypeError(".proto.BotMetadata.botQuotaMetadata: object expected");i.botQuotaMetadata=d.proto.BotQuotaMetadata.fromObject(e.botQuotaMetadata)}if(e.botAgeCollectionMetadata!=null){if(typeof e.botAgeCollectionMetadata!="object")throw TypeError(".proto.BotMetadata.botAgeCollectionMetadata: object expected");i.botAgeCollectionMetadata=d.proto.BotAgeCollectionMetadata.fromObject(e.botAgeCollectionMetadata)}if(e.conversationStarterPromptId!=null&&(i.conversationStarterPromptId=String(e.conversationStarterPromptId)),e.botResponseId!=null&&(i.botResponseId=String(e.botResponseId)),e.verificationMetadata!=null){if(typeof e.verificationMetadata!="object")throw TypeError(".proto.BotMetadata.verificationMetadata: object expected");i.verificationMetadata=d.proto.BotSignatureVerificationMetadata.fromObject(e.verificationMetadata)}if(e.unifiedResponseMutation!=null){if(typeof e.unifiedResponseMutation!="object")throw TypeError(".proto.BotMetadata.unifiedResponseMutation: object expected");i.unifiedResponseMutation=d.proto.BotUnifiedResponseMutation.fromObject(e.unifiedResponseMutation)}if(e.botMessageOriginMetadata!=null){if(typeof e.botMessageOriginMetadata!="object")throw TypeError(".proto.BotMetadata.botMessageOriginMetadata: object expected");i.botMessageOriginMetadata=d.proto.BotMessageOriginMetadata.fromObject(e.botMessageOriginMetadata)}if(e.inThreadSurveyMetadata!=null){if(typeof e.inThreadSurveyMetadata!="object")throw TypeError(".proto.BotMetadata.inThreadSurveyMetadata: object expected");i.inThreadSurveyMetadata=d.proto.InThreadSurveyMetadata.fromObject(e.inThreadSurveyMetadata)}if(e.botThreadInfo!=null){if(typeof e.botThreadInfo!="object")throw TypeError(".proto.BotMetadata.botThreadInfo: object expected");i.botThreadInfo=d.proto.AIThreadInfo.fromObject(e.botThreadInfo)}if(e.regenerateMetadata!=null){if(typeof e.regenerateMetadata!="object")throw TypeError(".proto.BotMetadata.regenerateMetadata: object expected");i.regenerateMetadata=d.proto.AIRegenerateMetadata.fromObject(e.regenerateMetadata)}if(e.sessionTransparencyMetadata!=null){if(typeof e.sessionTransparencyMetadata!="object")throw TypeError(".proto.BotMetadata.sessionTransparencyMetadata: object expected");i.sessionTransparencyMetadata=d.proto.SessionTransparencyMetadata.fromObject(e.sessionTransparencyMetadata)}return e.internalMetadata!=null&&(typeof e.internalMetadata=="string"?l.base64.decode(e.internalMetadata,i.internalMetadata=l.newBuffer(l.base64.length(e.internalMetadata)),0):e.internalMetadata.length>=0&&(i.internalMetadata=e.internalMetadata)),i},t.toObject=function(e,i){i||(i={});var A={};return e.avatarMetadata!=null&&e.hasOwnProperty("avatarMetadata")&&(A.avatarMetadata=d.proto.BotAvatarMetadata.toObject(e.avatarMetadata,i),i.oneofs&&(A._avatarMetadata="avatarMetadata")),e.personaId!=null&&e.hasOwnProperty("personaId")&&(A.personaId=e.personaId,i.oneofs&&(A._personaId="personaId")),e.pluginMetadata!=null&&e.hasOwnProperty("pluginMetadata")&&(A.pluginMetadata=d.proto.BotPluginMetadata.toObject(e.pluginMetadata,i),i.oneofs&&(A._pluginMetadata="pluginMetadata")),e.suggestedPromptMetadata!=null&&e.hasOwnProperty("suggestedPromptMetadata")&&(A.suggestedPromptMetadata=d.proto.BotSuggestedPromptMetadata.toObject(e.suggestedPromptMetadata,i),i.oneofs&&(A._suggestedPromptMetadata="suggestedPromptMetadata")),e.invokerJid!=null&&e.hasOwnProperty("invokerJid")&&(A.invokerJid=e.invokerJid,i.oneofs&&(A._invokerJid="invokerJid")),e.sessionMetadata!=null&&e.hasOwnProperty("sessionMetadata")&&(A.sessionMetadata=d.proto.BotSessionMetadata.toObject(e.sessionMetadata,i),i.oneofs&&(A._sessionMetadata="sessionMetadata")),e.memuMetadata!=null&&e.hasOwnProperty("memuMetadata")&&(A.memuMetadata=d.proto.BotMemuMetadata.toObject(e.memuMetadata,i),i.oneofs&&(A._memuMetadata="memuMetadata")),e.timezone!=null&&e.hasOwnProperty("timezone")&&(A.timezone=e.timezone,i.oneofs&&(A._timezone="timezone")),e.reminderMetadata!=null&&e.hasOwnProperty("reminderMetadata")&&(A.reminderMetadata=d.proto.BotReminderMetadata.toObject(e.reminderMetadata,i),i.oneofs&&(A._reminderMetadata="reminderMetadata")),e.modelMetadata!=null&&e.hasOwnProperty("modelMetadata")&&(A.modelMetadata=d.proto.BotModelMetadata.toObject(e.modelMetadata,i),i.oneofs&&(A._modelMetadata="modelMetadata")),e.messageDisclaimerText!=null&&e.hasOwnProperty("messageDisclaimerText")&&(A.messageDisclaimerText=e.messageDisclaimerText,i.oneofs&&(A._messageDisclaimerText="messageDisclaimerText")),e.progressIndicatorMetadata!=null&&e.hasOwnProperty("progressIndicatorMetadata")&&(A.progressIndicatorMetadata=d.proto.BotProgressIndicatorMetadata.toObject(e.progressIndicatorMetadata,i),i.oneofs&&(A._progressIndicatorMetadata="progressIndicatorMetadata")),e.capabilityMetadata!=null&&e.hasOwnProperty("capabilityMetadata")&&(A.capabilityMetadata=d.proto.BotCapabilityMetadata.toObject(e.capabilityMetadata,i),i.oneofs&&(A._capabilityMetadata="capabilityMetadata")),e.imagineMetadata!=null&&e.hasOwnProperty("imagineMetadata")&&(A.imagineMetadata=d.proto.BotImagineMetadata.toObject(e.imagineMetadata,i),i.oneofs&&(A._imagineMetadata="imagineMetadata")),e.memoryMetadata!=null&&e.hasOwnProperty("memoryMetadata")&&(A.memoryMetadata=d.proto.BotMemoryMetadata.toObject(e.memoryMetadata,i),i.oneofs&&(A._memoryMetadata="memoryMetadata")),e.renderingMetadata!=null&&e.hasOwnProperty("renderingMetadata")&&(A.renderingMetadata=d.proto.BotRenderingMetadata.toObject(e.renderingMetadata,i),i.oneofs&&(A._renderingMetadata="renderingMetadata")),e.botMetricsMetadata!=null&&e.hasOwnProperty("botMetricsMetadata")&&(A.botMetricsMetadata=d.proto.BotMetricsMetadata.toObject(e.botMetricsMetadata,i),i.oneofs&&(A._botMetricsMetadata="botMetricsMetadata")),e.botLinkedAccountsMetadata!=null&&e.hasOwnProperty("botLinkedAccountsMetadata")&&(A.botLinkedAccountsMetadata=d.proto.BotLinkedAccountsMetadata.toObject(e.botLinkedAccountsMetadata,i),i.oneofs&&(A._botLinkedAccountsMetadata="botLinkedAccountsMetadata")),e.richResponseSourcesMetadata!=null&&e.hasOwnProperty("richResponseSourcesMetadata")&&(A.richResponseSourcesMetadata=d.proto.BotSourcesMetadata.toObject(e.richResponseSourcesMetadata,i),i.oneofs&&(A._richResponseSourcesMetadata="richResponseSourcesMetadata")),e.aiConversationContext!=null&&e.hasOwnProperty("aiConversationContext")&&(A.aiConversationContext=i.bytes===String?l.base64.encode(e.aiConversationContext,0,e.aiConversationContext.length):i.bytes===Array?Array.prototype.slice.call(e.aiConversationContext):e.aiConversationContext,i.oneofs&&(A._aiConversationContext="aiConversationContext")),e.botPromotionMessageMetadata!=null&&e.hasOwnProperty("botPromotionMessageMetadata")&&(A.botPromotionMessageMetadata=d.proto.BotPromotionMessageMetadata.toObject(e.botPromotionMessageMetadata,i),i.oneofs&&(A._botPromotionMessageMetadata="botPromotionMessageMetadata")),e.botModeSelectionMetadata!=null&&e.hasOwnProperty("botModeSelectionMetadata")&&(A.botModeSelectionMetadata=d.proto.BotModeSelectionMetadata.toObject(e.botModeSelectionMetadata,i),i.oneofs&&(A._botModeSelectionMetadata="botModeSelectionMetadata")),e.botQuotaMetadata!=null&&e.hasOwnProperty("botQuotaMetadata")&&(A.botQuotaMetadata=d.proto.BotQuotaMetadata.toObject(e.botQuotaMetadata,i),i.oneofs&&(A._botQuotaMetadata="botQuotaMetadata")),e.botAgeCollectionMetadata!=null&&e.hasOwnProperty("botAgeCollectionMetadata")&&(A.botAgeCollectionMetadata=d.proto.BotAgeCollectionMetadata.toObject(e.botAgeCollectionMetadata,i),i.oneofs&&(A._botAgeCollectionMetadata="botAgeCollectionMetadata")),e.conversationStarterPromptId!=null&&e.hasOwnProperty("conversationStarterPromptId")&&(A.conversationStarterPromptId=e.conversationStarterPromptId,i.oneofs&&(A._conversationStarterPromptId="conversationStarterPromptId")),e.botResponseId!=null&&e.hasOwnProperty("botResponseId")&&(A.botResponseId=e.botResponseId,i.oneofs&&(A._botResponseId="botResponseId")),e.verificationMetadata!=null&&e.hasOwnProperty("verificationMetadata")&&(A.verificationMetadata=d.proto.BotSignatureVerificationMetadata.toObject(e.verificationMetadata,i),i.oneofs&&(A._verificationMetadata="verificationMetadata")),e.unifiedResponseMutation!=null&&e.hasOwnProperty("unifiedResponseMutation")&&(A.unifiedResponseMutation=d.proto.BotUnifiedResponseMutation.toObject(e.unifiedResponseMutation,i),i.oneofs&&(A._unifiedResponseMutation="unifiedResponseMutation")),e.botMessageOriginMetadata!=null&&e.hasOwnProperty("botMessageOriginMetadata")&&(A.botMessageOriginMetadata=d.proto.BotMessageOriginMetadata.toObject(e.botMessageOriginMetadata,i),i.oneofs&&(A._botMessageOriginMetadata="botMessageOriginMetadata")),e.inThreadSurveyMetadata!=null&&e.hasOwnProperty("inThreadSurveyMetadata")&&(A.inThreadSurveyMetadata=d.proto.InThreadSurveyMetadata.toObject(e.inThreadSurveyMetadata,i),i.oneofs&&(A._inThreadSurveyMetadata="inThreadSurveyMetadata")),e.botThreadInfo!=null&&e.hasOwnProperty("botThreadInfo")&&(A.botThreadInfo=d.proto.AIThreadInfo.toObject(e.botThreadInfo,i),i.oneofs&&(A._botThreadInfo="botThreadInfo")),e.regenerateMetadata!=null&&e.hasOwnProperty("regenerateMetadata")&&(A.regenerateMetadata=d.proto.AIRegenerateMetadata.toObject(e.regenerateMetadata,i),i.oneofs&&(A._regenerateMetadata="regenerateMetadata")),e.sessionTransparencyMetadata!=null&&e.hasOwnProperty("sessionTransparencyMetadata")&&(A.sessionTransparencyMetadata=d.proto.SessionTransparencyMetadata.toObject(e.sessionTransparencyMetadata,i),i.oneofs&&(A._sessionTransparencyMetadata="sessionTransparencyMetadata")),e.internalMetadata!=null&&e.hasOwnProperty("internalMetadata")&&(A.internalMetadata=i.bytes===String?l.base64.encode(e.internalMetadata,0,e.internalMetadata.length):i.bytes===Array?Array.prototype.slice.call(e.internalMetadata):e.internalMetadata,i.oneofs&&(A._internalMetadata="internalMetadata")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMetadata"},t})(),n.BotMetricsEntryPoint=(function(){let t={},o=Object.create(t);return o[t[0]="UNDEFINED_ENTRY_POINT"]=0,o[t[1]="FAVICON"]=1,o[t[2]="CHATLIST"]=2,o[t[3]="AISEARCH_NULL_STATE_PAPER_PLANE"]=3,o[t[4]="AISEARCH_NULL_STATE_SUGGESTION"]=4,o[t[5]="AISEARCH_TYPE_AHEAD_SUGGESTION"]=5,o[t[6]="AISEARCH_TYPE_AHEAD_PAPER_PLANE"]=6,o[t[7]="AISEARCH_TYPE_AHEAD_RESULT_CHATLIST"]=7,o[t[8]="AISEARCH_TYPE_AHEAD_RESULT_MESSAGES"]=8,o[t[9]="AIVOICE_SEARCH_BAR"]=9,o[t[10]="AIVOICE_FAVICON"]=10,o[t[11]="AISTUDIO"]=11,o[t[12]="DEEPLINK"]=12,o[t[13]="NOTIFICATION"]=13,o[t[14]="PROFILE_MESSAGE_BUTTON"]=14,o[t[15]="FORWARD"]=15,o[t[16]="APP_SHORTCUT"]=16,o[t[17]="FF_FAMILY"]=17,o[t[18]="AI_TAB"]=18,o[t[19]="AI_HOME"]=19,o[t[20]="AI_DEEPLINK_IMMERSIVE"]=20,o[t[21]="AI_DEEPLINK"]=21,o[t[22]="META_AI_CHAT_SHORTCUT_AI_STUDIO"]=22,o[t[23]="UGC_CHAT_SHORTCUT_AI_STUDIO"]=23,o[t[24]="NEW_CHAT_AI_STUDIO"]=24,o[t[25]="AIVOICE_FAVICON_CALL_HISTORY"]=25,o[t[26]="ASK_META_AI_CONTEXT_MENU"]=26,o[t[27]="ASK_META_AI_CONTEXT_MENU_1ON1"]=27,o[t[28]="ASK_META_AI_CONTEXT_MENU_GROUP"]=28,o[t[29]="INVOKE_META_AI_1ON1"]=29,o[t[30]="INVOKE_META_AI_GROUP"]=30,o[t[31]="META_AI_FORWARD"]=31,o[t[32]="NEW_CHAT_AI_CONTACT"]=32,o[t[33]="MESSAGE_QUICK_ACTION_1_ON_1_CHAT"]=33,o[t[34]="MESSAGE_QUICK_ACTION_GROUP_CHAT"]=34,o[t[35]="ATTACHMENT_TRAY_1_ON_1_CHAT"]=35,o[t[36]="ATTACHMENT_TRAY_GROUP_CHAT"]=36,o[t[37]="ASK_META_AI_MEDIA_VIEWER_1ON1"]=37,o[t[38]="ASK_META_AI_MEDIA_VIEWER_GROUP"]=38,o})(),n.BotMetricsMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.destinationId=e.string();break}case 2:{s.destinationEntryPoint=e.int32();break}case 3:{s.threadOrigin=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMetricsMetadata)return e;var i=new d.proto.BotMetricsMetadata;switch(e.destinationId!=null&&(i.destinationId=String(e.destinationId)),e.destinationEntryPoint){default:if(typeof e.destinationEntryPoint=="number"){i.destinationEntryPoint=e.destinationEntryPoint;break}break;case"UNDEFINED_ENTRY_POINT":case 0:i.destinationEntryPoint=0;break;case"FAVICON":case 1:i.destinationEntryPoint=1;break;case"CHATLIST":case 2:i.destinationEntryPoint=2;break;case"AISEARCH_NULL_STATE_PAPER_PLANE":case 3:i.destinationEntryPoint=3;break;case"AISEARCH_NULL_STATE_SUGGESTION":case 4:i.destinationEntryPoint=4;break;case"AISEARCH_TYPE_AHEAD_SUGGESTION":case 5:i.destinationEntryPoint=5;break;case"AISEARCH_TYPE_AHEAD_PAPER_PLANE":case 6:i.destinationEntryPoint=6;break;case"AISEARCH_TYPE_AHEAD_RESULT_CHATLIST":case 7:i.destinationEntryPoint=7;break;case"AISEARCH_TYPE_AHEAD_RESULT_MESSAGES":case 8:i.destinationEntryPoint=8;break;case"AIVOICE_SEARCH_BAR":case 9:i.destinationEntryPoint=9;break;case"AIVOICE_FAVICON":case 10:i.destinationEntryPoint=10;break;case"AISTUDIO":case 11:i.destinationEntryPoint=11;break;case"DEEPLINK":case 12:i.destinationEntryPoint=12;break;case"NOTIFICATION":case 13:i.destinationEntryPoint=13;break;case"PROFILE_MESSAGE_BUTTON":case 14:i.destinationEntryPoint=14;break;case"FORWARD":case 15:i.destinationEntryPoint=15;break;case"APP_SHORTCUT":case 16:i.destinationEntryPoint=16;break;case"FF_FAMILY":case 17:i.destinationEntryPoint=17;break;case"AI_TAB":case 18:i.destinationEntryPoint=18;break;case"AI_HOME":case 19:i.destinationEntryPoint=19;break;case"AI_DEEPLINK_IMMERSIVE":case 20:i.destinationEntryPoint=20;break;case"AI_DEEPLINK":case 21:i.destinationEntryPoint=21;break;case"META_AI_CHAT_SHORTCUT_AI_STUDIO":case 22:i.destinationEntryPoint=22;break;case"UGC_CHAT_SHORTCUT_AI_STUDIO":case 23:i.destinationEntryPoint=23;break;case"NEW_CHAT_AI_STUDIO":case 24:i.destinationEntryPoint=24;break;case"AIVOICE_FAVICON_CALL_HISTORY":case 25:i.destinationEntryPoint=25;break;case"ASK_META_AI_CONTEXT_MENU":case 26:i.destinationEntryPoint=26;break;case"ASK_META_AI_CONTEXT_MENU_1ON1":case 27:i.destinationEntryPoint=27;break;case"ASK_META_AI_CONTEXT_MENU_GROUP":case 28:i.destinationEntryPoint=28;break;case"INVOKE_META_AI_1ON1":case 29:i.destinationEntryPoint=29;break;case"INVOKE_META_AI_GROUP":case 30:i.destinationEntryPoint=30;break;case"META_AI_FORWARD":case 31:i.destinationEntryPoint=31;break;case"NEW_CHAT_AI_CONTACT":case 32:i.destinationEntryPoint=32;break;case"MESSAGE_QUICK_ACTION_1_ON_1_CHAT":case 33:i.destinationEntryPoint=33;break;case"MESSAGE_QUICK_ACTION_GROUP_CHAT":case 34:i.destinationEntryPoint=34;break;case"ATTACHMENT_TRAY_1_ON_1_CHAT":case 35:i.destinationEntryPoint=35;break;case"ATTACHMENT_TRAY_GROUP_CHAT":case 36:i.destinationEntryPoint=36;break;case"ASK_META_AI_MEDIA_VIEWER_1ON1":case 37:i.destinationEntryPoint=37;break;case"ASK_META_AI_MEDIA_VIEWER_GROUP":case 38:i.destinationEntryPoint=38;break}switch(e.threadOrigin){default:if(typeof e.threadOrigin=="number"){i.threadOrigin=e.threadOrigin;break}break;case"AI_TAB_THREAD":case 1:i.threadOrigin=1;break;case"AI_HOME_THREAD":case 2:i.threadOrigin=2;break;case"AI_DEEPLINK_IMMERSIVE_THREAD":case 3:i.threadOrigin=3;break;case"AI_DEEPLINK_THREAD":case 4:i.threadOrigin=4;break;case"ASK_META_AI_CONTEXT_MENU_THREAD":case 5:i.threadOrigin=5;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.destinationId!=null&&e.hasOwnProperty("destinationId")&&(A.destinationId=e.destinationId,i.oneofs&&(A._destinationId="destinationId")),e.destinationEntryPoint!=null&&e.hasOwnProperty("destinationEntryPoint")&&(A.destinationEntryPoint=i.enums===String?d.proto.BotMetricsEntryPoint[e.destinationEntryPoint]===void 0?e.destinationEntryPoint:d.proto.BotMetricsEntryPoint[e.destinationEntryPoint]:e.destinationEntryPoint,i.oneofs&&(A._destinationEntryPoint="destinationEntryPoint")),e.threadOrigin!=null&&e.hasOwnProperty("threadOrigin")&&(A.threadOrigin=i.enums===String?d.proto.BotMetricsThreadEntryPoint[e.threadOrigin]===void 0?e.threadOrigin:d.proto.BotMetricsThreadEntryPoint[e.threadOrigin]:e.threadOrigin,i.oneofs&&(A._threadOrigin="threadOrigin")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMetricsMetadata"},t})(),n.BotMetricsThreadEntryPoint=(function(){let t={},o=Object.create(t);return o[t[1]="AI_TAB_THREAD"]=1,o[t[2]="AI_HOME_THREAD"]=2,o[t[3]="AI_DEEPLINK_IMMERSIVE_THREAD"]=3,o[t[4]="AI_DEEPLINK_THREAD"]=4,o[t[5]="ASK_META_AI_CONTEXT_MENU_THREAD"]=5,o})(),n.BotModeSelectionMetadata=(function(){function t(o){if(this.mode=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{if(r.mode&&r.mode.length||(r.mode=[]),(s&7)===2)for(var g=a.uint32()+a.pos;a.pos>>3){case 1:{s.modelType=e.int32();break}case 2:{s.premiumModelStatus=e.int32();break}case 3:{s.modelNameOverride=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotModelMetadata)return e;var i=new d.proto.BotModelMetadata;switch(e.modelType){default:if(typeof e.modelType=="number"){i.modelType=e.modelType;break}break;case"UNKNOWN_TYPE":case 0:i.modelType=0;break;case"LLAMA_PROD":case 1:i.modelType=1;break;case"LLAMA_PROD_PREMIUM":case 2:i.modelType=2;break}switch(e.premiumModelStatus){default:if(typeof e.premiumModelStatus=="number"){i.premiumModelStatus=e.premiumModelStatus;break}break;case"UNKNOWN_STATUS":case 0:i.premiumModelStatus=0;break;case"AVAILABLE":case 1:i.premiumModelStatus=1;break;case"QUOTA_EXCEED_LIMIT":case 2:i.premiumModelStatus=2;break}return e.modelNameOverride!=null&&(i.modelNameOverride=String(e.modelNameOverride)),i},t.toObject=function(e,i){i||(i={});var A={};return e.modelType!=null&&e.hasOwnProperty("modelType")&&(A.modelType=i.enums===String?d.proto.BotModelMetadata.ModelType[e.modelType]===void 0?e.modelType:d.proto.BotModelMetadata.ModelType[e.modelType]:e.modelType,i.oneofs&&(A._modelType="modelType")),e.premiumModelStatus!=null&&e.hasOwnProperty("premiumModelStatus")&&(A.premiumModelStatus=i.enums===String?d.proto.BotModelMetadata.PremiumModelStatus[e.premiumModelStatus]===void 0?e.premiumModelStatus:d.proto.BotModelMetadata.PremiumModelStatus[e.premiumModelStatus]:e.premiumModelStatus,i.oneofs&&(A._premiumModelStatus="premiumModelStatus")),e.modelNameOverride!=null&&e.hasOwnProperty("modelNameOverride")&&(A.modelNameOverride=e.modelNameOverride,i.oneofs&&(A._modelNameOverride="modelNameOverride")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotModelMetadata"},t.ModelType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_TYPE"]=0,e[a[1]="LLAMA_PROD"]=1,e[a[2]="LLAMA_PROD_PREMIUM"]=2,e})(),t.PremiumModelStatus=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_STATUS"]=0,e[a[1]="AVAILABLE"]=1,e[a[2]="QUOTA_EXCEED_LIMIT"]=2,e})(),t})(),n.BotPluginMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.provider=e.int32();break}case 2:{s.pluginType=e.int32();break}case 3:{s.thumbnailCdnUrl=e.string();break}case 4:{s.profilePhotoCdnUrl=e.string();break}case 5:{s.searchProviderUrl=e.string();break}case 6:{s.referenceIndex=e.uint32();break}case 7:{s.expectedLinksCount=e.uint32();break}case 9:{s.searchQuery=e.string();break}case 10:{s.parentPluginMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 11:{s.deprecatedField=e.int32();break}case 12:{s.parentPluginType=e.int32();break}case 13:{s.faviconCdnUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotPluginMetadata)return e;var i=new d.proto.BotPluginMetadata;switch(e.provider){default:if(typeof e.provider=="number"){i.provider=e.provider;break}break;case"UNKNOWN":case 0:i.provider=0;break;case"BING":case 1:i.provider=1;break;case"GOOGLE":case 2:i.provider=2;break;case"SUPPORT":case 3:i.provider=3;break}switch(e.pluginType){default:if(typeof e.pluginType=="number"){i.pluginType=e.pluginType;break}break;case"UNKNOWN_PLUGIN":case 0:i.pluginType=0;break;case"REELS":case 1:i.pluginType=1;break;case"SEARCH":case 2:i.pluginType=2;break}if(e.thumbnailCdnUrl!=null&&(i.thumbnailCdnUrl=String(e.thumbnailCdnUrl)),e.profilePhotoCdnUrl!=null&&(i.profilePhotoCdnUrl=String(e.profilePhotoCdnUrl)),e.searchProviderUrl!=null&&(i.searchProviderUrl=String(e.searchProviderUrl)),e.referenceIndex!=null&&(i.referenceIndex=e.referenceIndex>>>0),e.expectedLinksCount!=null&&(i.expectedLinksCount=e.expectedLinksCount>>>0),e.searchQuery!=null&&(i.searchQuery=String(e.searchQuery)),e.parentPluginMessageKey!=null){if(typeof e.parentPluginMessageKey!="object")throw TypeError(".proto.BotPluginMetadata.parentPluginMessageKey: object expected");i.parentPluginMessageKey=d.proto.MessageKey.fromObject(e.parentPluginMessageKey)}switch(e.deprecatedField){default:if(typeof e.deprecatedField=="number"){i.deprecatedField=e.deprecatedField;break}break;case"UNKNOWN_PLUGIN":case 0:i.deprecatedField=0;break;case"REELS":case 1:i.deprecatedField=1;break;case"SEARCH":case 2:i.deprecatedField=2;break}switch(e.parentPluginType){default:if(typeof e.parentPluginType=="number"){i.parentPluginType=e.parentPluginType;break}break;case"UNKNOWN_PLUGIN":case 0:i.parentPluginType=0;break;case"REELS":case 1:i.parentPluginType=1;break;case"SEARCH":case 2:i.parentPluginType=2;break}return e.faviconCdnUrl!=null&&(i.faviconCdnUrl=String(e.faviconCdnUrl)),i},t.toObject=function(e,i){i||(i={});var A={};return e.provider!=null&&e.hasOwnProperty("provider")&&(A.provider=i.enums===String?d.proto.BotPluginMetadata.SearchProvider[e.provider]===void 0?e.provider:d.proto.BotPluginMetadata.SearchProvider[e.provider]:e.provider,i.oneofs&&(A._provider="provider")),e.pluginType!=null&&e.hasOwnProperty("pluginType")&&(A.pluginType=i.enums===String?d.proto.BotPluginMetadata.PluginType[e.pluginType]===void 0?e.pluginType:d.proto.BotPluginMetadata.PluginType[e.pluginType]:e.pluginType,i.oneofs&&(A._pluginType="pluginType")),e.thumbnailCdnUrl!=null&&e.hasOwnProperty("thumbnailCdnUrl")&&(A.thumbnailCdnUrl=e.thumbnailCdnUrl,i.oneofs&&(A._thumbnailCdnUrl="thumbnailCdnUrl")),e.profilePhotoCdnUrl!=null&&e.hasOwnProperty("profilePhotoCdnUrl")&&(A.profilePhotoCdnUrl=e.profilePhotoCdnUrl,i.oneofs&&(A._profilePhotoCdnUrl="profilePhotoCdnUrl")),e.searchProviderUrl!=null&&e.hasOwnProperty("searchProviderUrl")&&(A.searchProviderUrl=e.searchProviderUrl,i.oneofs&&(A._searchProviderUrl="searchProviderUrl")),e.referenceIndex!=null&&e.hasOwnProperty("referenceIndex")&&(A.referenceIndex=e.referenceIndex,i.oneofs&&(A._referenceIndex="referenceIndex")),e.expectedLinksCount!=null&&e.hasOwnProperty("expectedLinksCount")&&(A.expectedLinksCount=e.expectedLinksCount,i.oneofs&&(A._expectedLinksCount="expectedLinksCount")),e.searchQuery!=null&&e.hasOwnProperty("searchQuery")&&(A.searchQuery=e.searchQuery,i.oneofs&&(A._searchQuery="searchQuery")),e.parentPluginMessageKey!=null&&e.hasOwnProperty("parentPluginMessageKey")&&(A.parentPluginMessageKey=d.proto.MessageKey.toObject(e.parentPluginMessageKey,i),i.oneofs&&(A._parentPluginMessageKey="parentPluginMessageKey")),e.deprecatedField!=null&&e.hasOwnProperty("deprecatedField")&&(A.deprecatedField=i.enums===String?d.proto.BotPluginMetadata.PluginType[e.deprecatedField]===void 0?e.deprecatedField:d.proto.BotPluginMetadata.PluginType[e.deprecatedField]:e.deprecatedField,i.oneofs&&(A._deprecatedField="deprecatedField")),e.parentPluginType!=null&&e.hasOwnProperty("parentPluginType")&&(A.parentPluginType=i.enums===String?d.proto.BotPluginMetadata.PluginType[e.parentPluginType]===void 0?e.parentPluginType:d.proto.BotPluginMetadata.PluginType[e.parentPluginType]:e.parentPluginType,i.oneofs&&(A._parentPluginType="parentPluginType")),e.faviconCdnUrl!=null&&e.hasOwnProperty("faviconCdnUrl")&&(A.faviconCdnUrl=e.faviconCdnUrl,i.oneofs&&(A._faviconCdnUrl="faviconCdnUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPluginMetadata"},t.PluginType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_PLUGIN"]=0,e[a[1]="REELS"]=1,e[a[2]="SEARCH"]=2,e})(),t.SearchProvider=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="BING"]=1,e[a[2]="GOOGLE"]=2,e[a[3]="SUPPORT"]=3,e})(),t})(),n.BotProgressIndicatorMetadata=(function(){function t(a){if(this.stepsMetadata=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.progressDescription=e.string();break}case 2:{s.stepsMetadata&&s.stepsMetadata.length||(s.stepsMetadata=[]),s.stepsMetadata.push(d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotProgressIndicatorMetadata)return e;var i=new d.proto.BotProgressIndicatorMetadata;if(e.progressDescription!=null&&(i.progressDescription=String(e.progressDescription)),e.stepsMetadata){if(!Array.isArray(e.stepsMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.stepsMetadata: array expected");i.stepsMetadata=[];for(var A=0;A>>3){case 1:{c.statusTitle=A.string();break}case 2:{c.statusBody=A.string();break}case 3:{c.sourcesMetadata&&c.sourcesMetadata.length||(c.sourcesMetadata=[]),c.sourcesMetadata.push(d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.decode(A,A.uint32()));break}case 4:{c.status=A.int32();break}case 5:{c.isReasoning=A.bool();break}case 6:{c.isEnhancedSearch=A.bool();break}case 7:{c.sections&&c.sections.length||(c.sections=[]),c.sections.push(d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata)return A;var r=new d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata;if(A.statusTitle!=null&&(r.statusTitle=String(A.statusTitle)),A.statusBody!=null&&(r.statusBody=String(A.statusBody)),A.sourcesMetadata){if(!Array.isArray(A.sourcesMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.sourcesMetadata: array expected");r.sourcesMetadata=[];for(var s=0;s>>3){case 1:{p.title=s.string();break}case 2:{p.provider=s.int32();break}case 3:{p.sourceUrl=s.string();break}case 4:{p.favIconUrl=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata)return s;var g=new d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata;switch(s.title!=null&&(g.title=String(s.title)),s.provider){default:if(typeof s.provider=="number"){g.provider=s.provider;break}break;case"UNKNOWN_PROVIDER":case 0:g.provider=0;break;case"OTHER":case 1:g.provider=1;break;case"GOOGLE":case 2:g.provider=2;break;case"BING":case 3:g.provider=3;break}return s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.favIconUrl!=null&&(g.favIconUrl=String(s.favIconUrl)),g},i.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.provider!=null&&s.hasOwnProperty("provider")&&(c.provider=g.enums===String?d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[s.provider]===void 0?s.provider:d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[s.provider]:s.provider,g.oneofs&&(c._provider="provider")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.favIconUrl!=null&&s.hasOwnProperty("favIconUrl")&&(c.favIconUrl=s.favIconUrl,g.oneofs&&(c._favIconUrl="favIconUrl")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata"},i})(),a.BotPlanningSearchSourcesMetadata=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.sourceTitle=s.string();break}case 2:{p.provider=s.int32();break}case 3:{p.sourceUrl=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata)return s;var g=new d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata;switch(s.sourceTitle!=null&&(g.sourceTitle=String(s.sourceTitle)),s.provider){default:if(typeof s.provider=="number"){g.provider=s.provider;break}break;case"UNKNOWN":case 0:g.provider=0;break;case"OTHER":case 1:g.provider=1;break;case"GOOGLE":case 2:g.provider=2;break;case"BING":case 3:g.provider=3;break}return s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),g},i.toObject=function(s,g){g||(g={});var c={};return s.sourceTitle!=null&&s.hasOwnProperty("sourceTitle")&&(c.sourceTitle=s.sourceTitle,g.oneofs&&(c._sourceTitle="sourceTitle")),s.provider!=null&&s.hasOwnProperty("provider")&&(c.provider=g.enums===String?d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[s.provider]===void 0?s.provider:d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[s.provider]:s.provider,g.oneofs&&(c._provider="provider")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata"},i.BotPlanningSearchSourceProvider=(function(){let r={},s=Object.create(r);return s[r[0]="UNKNOWN"]=0,s[r[1]="OTHER"]=1,s[r[2]="GOOGLE"]=2,s[r[3]="BING"]=3,s})(),i})(),a.BotPlanningStepSectionMetadata=(function(){function i(r){if(this.sourcesMetadata=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.sectionTitle=s.string();break}case 2:{p.sectionBody=s.string();break}case 3:{p.sourcesMetadata&&p.sourcesMetadata.length||(p.sourcesMetadata=[]),p.sourcesMetadata.push(d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata)return s;var g=new d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata;if(s.sectionTitle!=null&&(g.sectionTitle=String(s.sectionTitle)),s.sectionBody!=null&&(g.sectionBody=String(s.sectionBody)),s.sourcesMetadata){if(!Array.isArray(s.sourcesMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.sourcesMetadata: array expected");g.sourcesMetadata=[];for(var c=0;c>>3){case 1:{s.promotionType=e.int32();break}case 2:{s.buttonTitle=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotPromotionMessageMetadata)return e;var i=new d.proto.BotPromotionMessageMetadata;switch(e.promotionType){default:if(typeof e.promotionType=="number"){i.promotionType=e.promotionType;break}break;case"UNKNOWN_TYPE":case 0:i.promotionType=0;break;case"C50":case 1:i.promotionType=1;break;case"SURVEY_PLATFORM":case 2:i.promotionType=2;break}return e.buttonTitle!=null&&(i.buttonTitle=String(e.buttonTitle)),i},t.toObject=function(e,i){i||(i={});var A={};return e.promotionType!=null&&e.hasOwnProperty("promotionType")&&(A.promotionType=i.enums===String?d.proto.BotPromotionMessageMetadata.BotPromotionType[e.promotionType]===void 0?e.promotionType:d.proto.BotPromotionMessageMetadata.BotPromotionType[e.promotionType]:e.promotionType,i.oneofs&&(A._promotionType="promotionType")),e.buttonTitle!=null&&e.hasOwnProperty("buttonTitle")&&(A.buttonTitle=e.buttonTitle,i.oneofs&&(A._buttonTitle="buttonTitle")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPromotionMessageMetadata"},t.BotPromotionType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_TYPE"]=0,e[a[1]="C50"]=1,e[a[2]="SURVEY_PLATFORM"]=2,e})(),t})(),n.BotPromptSuggestion=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.prompt=e.string();break}case 2:{s.promptId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotPromptSuggestion)return e;var i=new d.proto.BotPromptSuggestion;return e.prompt!=null&&(i.prompt=String(e.prompt)),e.promptId!=null&&(i.promptId=String(e.promptId)),i},t.toObject=function(e,i){i||(i={});var A={};return e.prompt!=null&&e.hasOwnProperty("prompt")&&(A.prompt=e.prompt,i.oneofs&&(A._prompt="prompt")),e.promptId!=null&&e.hasOwnProperty("promptId")&&(A.promptId=e.promptId,i.oneofs&&(A._promptId="promptId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPromptSuggestion"},t})(),n.BotPromptSuggestions=(function(){function t(o){if(this.suggestions=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.suggestions&&r.suggestions.length||(r.suggestions=[]),r.suggestions.push(d.proto.BotPromptSuggestion.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotPromptSuggestions)return a;var e=new d.proto.BotPromptSuggestions;if(a.suggestions){if(!Array.isArray(a.suggestions))throw TypeError(".proto.BotPromptSuggestions.suggestions: array expected");e.suggestions=[];for(var i=0;i>>3){case 1:{r.botFeatureQuotaMetadata&&r.botFeatureQuotaMetadata.length||(r.botFeatureQuotaMetadata=[]),r.botFeatureQuotaMetadata.push(d.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotQuotaMetadata)return a;var e=new d.proto.BotQuotaMetadata;if(a.botFeatureQuotaMetadata){if(!Array.isArray(a.botFeatureQuotaMetadata))throw TypeError(".proto.BotQuotaMetadata.botFeatureQuotaMetadata: array expected");e.botFeatureQuotaMetadata=[];for(var i=0;i>>3){case 1:{g.featureType=i.int32();break}case 2:{g.remainingQuota=i.uint32();break}case 3:{g.expirationTimestamp=i.uint64();break}default:i.skipType(c&7);break}}return g},o.fromObject=function(i){if(i instanceof d.proto.BotQuotaMetadata.BotFeatureQuotaMetadata)return i;var A=new d.proto.BotQuotaMetadata.BotFeatureQuotaMetadata;switch(i.featureType){default:if(typeof i.featureType=="number"){A.featureType=i.featureType;break}break;case"UNKNOWN_FEATURE":case 0:A.featureType=0;break;case"REASONING_FEATURE":case 1:A.featureType=1;break}return i.remainingQuota!=null&&(A.remainingQuota=i.remainingQuota>>>0),i.expirationTimestamp!=null&&(l.Long?(A.expirationTimestamp=l.Long.fromValue(i.expirationTimestamp)).unsigned=!0:typeof i.expirationTimestamp=="string"?A.expirationTimestamp=parseInt(i.expirationTimestamp,10):typeof i.expirationTimestamp=="number"?A.expirationTimestamp=i.expirationTimestamp:typeof i.expirationTimestamp=="object"&&(A.expirationTimestamp=new l.LongBits(i.expirationTimestamp.low>>>0,i.expirationTimestamp.high>>>0).toNumber(!0))),A},o.toObject=function(i,A){A||(A={});var r={};return i.featureType!=null&&i.hasOwnProperty("featureType")&&(r.featureType=A.enums===String?d.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[i.featureType]===void 0?i.featureType:d.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[i.featureType]:i.featureType,A.oneofs&&(r._featureType="featureType")),i.remainingQuota!=null&&i.hasOwnProperty("remainingQuota")&&(r.remainingQuota=i.remainingQuota,A.oneofs&&(r._remainingQuota="remainingQuota")),i.expirationTimestamp!=null&&i.hasOwnProperty("expirationTimestamp")&&(typeof i.expirationTimestamp=="number"?r.expirationTimestamp=A.longs===String?String(i.expirationTimestamp):i.expirationTimestamp:r.expirationTimestamp=A.longs===String?ge(i.expirationTimestamp,!0):A.longs===Number?ce(i.expirationTimestamp,!0):i.expirationTimestamp,A.oneofs&&(r._expirationTimestamp="expirationTimestamp")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},o.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.BotQuotaMetadata.BotFeatureQuotaMetadata"},o.BotFeatureType=(function(){let e={},i=Object.create(e);return i[e[0]="UNKNOWN_FEATURE"]=0,i[e[1]="REASONING_FEATURE"]=1,i})(),o})(),t})(),n.BotReminderMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.requestMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.action=e.int32();break}case 3:{s.name=e.string();break}case 4:{s.nextTriggerTimestamp=e.uint64();break}case 5:{s.frequency=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotReminderMetadata)return e;var i=new d.proto.BotReminderMetadata;if(e.requestMessageKey!=null){if(typeof e.requestMessageKey!="object")throw TypeError(".proto.BotReminderMetadata.requestMessageKey: object expected");i.requestMessageKey=d.proto.MessageKey.fromObject(e.requestMessageKey)}switch(e.action){default:if(typeof e.action=="number"){i.action=e.action;break}break;case"NOTIFY":case 1:i.action=1;break;case"CREATE":case 2:i.action=2;break;case"DELETE":case 3:i.action=3;break;case"UPDATE":case 4:i.action=4;break}switch(e.name!=null&&(i.name=String(e.name)),e.nextTriggerTimestamp!=null&&(l.Long?(i.nextTriggerTimestamp=l.Long.fromValue(e.nextTriggerTimestamp)).unsigned=!0:typeof e.nextTriggerTimestamp=="string"?i.nextTriggerTimestamp=parseInt(e.nextTriggerTimestamp,10):typeof e.nextTriggerTimestamp=="number"?i.nextTriggerTimestamp=e.nextTriggerTimestamp:typeof e.nextTriggerTimestamp=="object"&&(i.nextTriggerTimestamp=new l.LongBits(e.nextTriggerTimestamp.low>>>0,e.nextTriggerTimestamp.high>>>0).toNumber(!0))),e.frequency){default:if(typeof e.frequency=="number"){i.frequency=e.frequency;break}break;case"ONCE":case 1:i.frequency=1;break;case"DAILY":case 2:i.frequency=2;break;case"WEEKLY":case 3:i.frequency=3;break;case"BIWEEKLY":case 4:i.frequency=4;break;case"MONTHLY":case 5:i.frequency=5;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.requestMessageKey!=null&&e.hasOwnProperty("requestMessageKey")&&(A.requestMessageKey=d.proto.MessageKey.toObject(e.requestMessageKey,i),i.oneofs&&(A._requestMessageKey="requestMessageKey")),e.action!=null&&e.hasOwnProperty("action")&&(A.action=i.enums===String?d.proto.BotReminderMetadata.ReminderAction[e.action]===void 0?e.action:d.proto.BotReminderMetadata.ReminderAction[e.action]:e.action,i.oneofs&&(A._action="action")),e.name!=null&&e.hasOwnProperty("name")&&(A.name=e.name,i.oneofs&&(A._name="name")),e.nextTriggerTimestamp!=null&&e.hasOwnProperty("nextTriggerTimestamp")&&(typeof e.nextTriggerTimestamp=="number"?A.nextTriggerTimestamp=i.longs===String?String(e.nextTriggerTimestamp):e.nextTriggerTimestamp:A.nextTriggerTimestamp=i.longs===String?ge(e.nextTriggerTimestamp,!0):i.longs===Number?ce(e.nextTriggerTimestamp,!0):e.nextTriggerTimestamp,i.oneofs&&(A._nextTriggerTimestamp="nextTriggerTimestamp")),e.frequency!=null&&e.hasOwnProperty("frequency")&&(A.frequency=i.enums===String?d.proto.BotReminderMetadata.ReminderFrequency[e.frequency]===void 0?e.frequency:d.proto.BotReminderMetadata.ReminderFrequency[e.frequency]:e.frequency,i.oneofs&&(A._frequency="frequency")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotReminderMetadata"},t.ReminderAction=(function(){let a={},e=Object.create(a);return e[a[1]="NOTIFY"]=1,e[a[2]="CREATE"]=2,e[a[3]="DELETE"]=3,e[a[4]="UPDATE"]=4,e})(),t.ReminderFrequency=(function(){let a={},e=Object.create(a);return e[a[1]="ONCE"]=1,e[a[2]="DAILY"]=2,e[a[3]="WEEKLY"]=3,e[a[4]="BIWEEKLY"]=4,e[a[5]="MONTHLY"]=5,e})(),t})(),n.BotRenderingMetadata=(function(){function t(o){if(this.keywords=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.keywords&&r.keywords.length||(r.keywords=[]),r.keywords.push(d.proto.BotRenderingMetadata.Keyword.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotRenderingMetadata)return a;var e=new d.proto.BotRenderingMetadata;if(a.keywords){if(!Array.isArray(a.keywords))throw TypeError(".proto.BotRenderingMetadata.keywords: array expected");e.keywords=[];for(var i=0;i>>3){case 1:{g.value=i.string();break}case 2:{g.associatedPrompts&&g.associatedPrompts.length||(g.associatedPrompts=[]),g.associatedPrompts.push(i.string());break}default:i.skipType(c&7);break}}return g},o.fromObject=function(i){if(i instanceof d.proto.BotRenderingMetadata.Keyword)return i;var A=new d.proto.BotRenderingMetadata.Keyword;if(i.value!=null&&(A.value=String(i.value)),i.associatedPrompts){if(!Array.isArray(i.associatedPrompts))throw TypeError(".proto.BotRenderingMetadata.Keyword.associatedPrompts: array expected");A.associatedPrompts=[];for(var r=0;r>>3){case 1:{s.sessionId=e.string();break}case 2:{s.sessionSource=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotSessionMetadata)return e;var i=new d.proto.BotSessionMetadata;switch(e.sessionId!=null&&(i.sessionId=String(e.sessionId)),e.sessionSource){default:if(typeof e.sessionSource=="number"){i.sessionSource=e.sessionSource;break}break;case"NONE":case 0:i.sessionSource=0;break;case"NULL_STATE":case 1:i.sessionSource=1;break;case"TYPEAHEAD":case 2:i.sessionSource=2;break;case"USER_INPUT":case 3:i.sessionSource=3;break;case"EMU_FLASH":case 4:i.sessionSource=4;break;case"EMU_FLASH_FOLLOWUP":case 5:i.sessionSource=5;break;case"VOICE":case 6:i.sessionSource=6;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.sessionId!=null&&e.hasOwnProperty("sessionId")&&(A.sessionId=e.sessionId,i.oneofs&&(A._sessionId="sessionId")),e.sessionSource!=null&&e.hasOwnProperty("sessionSource")&&(A.sessionSource=i.enums===String?d.proto.BotSessionSource[e.sessionSource]===void 0?e.sessionSource:d.proto.BotSessionSource[e.sessionSource]:e.sessionSource,i.oneofs&&(A._sessionSource="sessionSource")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotSessionMetadata"},t})(),n.BotSessionSource=(function(){let t={},o=Object.create(t);return o[t[0]="NONE"]=0,o[t[1]="NULL_STATE"]=1,o[t[2]="TYPEAHEAD"]=2,o[t[3]="USER_INPUT"]=3,o[t[4]="EMU_FLASH"]=4,o[t[5]="EMU_FLASH_FOLLOWUP"]=5,o[t[6]="VOICE"]=6,o})(),n.BotSignatureVerificationMetadata=(function(){function t(o){if(this.proofs=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.proofs&&r.proofs.length||(r.proofs=[]),r.proofs.push(d.proto.BotSignatureVerificationUseCaseProof.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotSignatureVerificationMetadata)return a;var e=new d.proto.BotSignatureVerificationMetadata;if(a.proofs){if(!Array.isArray(a.proofs))throw TypeError(".proto.BotSignatureVerificationMetadata.proofs: array expected");e.proofs=[];for(var i=0;i>>3){case 1:{s.version=e.int32();break}case 2:{s.useCase=e.int32();break}case 3:{s.signature=e.bytes();break}case 4:{s.certificateChain&&s.certificateChain.length||(s.certificateChain=[]),s.certificateChain.push(e.bytes());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotSignatureVerificationUseCaseProof)return e;var i=new d.proto.BotSignatureVerificationUseCaseProof;switch(e.version!=null&&(i.version=e.version|0),e.useCase){default:if(typeof e.useCase=="number"){i.useCase=e.useCase;break}break;case"UNSPECIFIED":case 0:i.useCase=0;break;case"WA_BOT_MSG":case 1:i.useCase=1;break}if(e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,i.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(i.signature=e.signature)),e.certificateChain){if(!Array.isArray(e.certificateChain))throw TypeError(".proto.BotSignatureVerificationUseCaseProof.certificateChain: array expected");i.certificateChain=[];for(var A=0;A=0&&(i.certificateChain[A]=e.certificateChain[A])}return i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.certificateChain=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,i.oneofs&&(A._version="version")),e.useCase!=null&&e.hasOwnProperty("useCase")&&(A.useCase=i.enums===String?d.proto.BotSignatureVerificationUseCaseProof.BotSignatureUseCase[e.useCase]===void 0?e.useCase:d.proto.BotSignatureVerificationUseCaseProof.BotSignatureUseCase[e.useCase]:e.useCase,i.oneofs&&(A._useCase="useCase")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=i.bytes===String?l.base64.encode(e.signature,0,e.signature.length):i.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,i.oneofs&&(A._signature="signature")),e.certificateChain&&e.certificateChain.length){A.certificateChain=[];for(var r=0;r>>3){case 1:{r.sources&&r.sources.length||(r.sources=[]),r.sources.push(d.proto.BotSourcesMetadata.BotSourceItem.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotSourcesMetadata)return a;var e=new d.proto.BotSourcesMetadata;if(a.sources){if(!Array.isArray(a.sources))throw TypeError(".proto.BotSourcesMetadata.sources: array expected");e.sources=[];for(var i=0;i>>3){case 1:{g.provider=i.int32();break}case 2:{g.thumbnailCdnUrl=i.string();break}case 3:{g.sourceProviderUrl=i.string();break}case 4:{g.sourceQuery=i.string();break}case 5:{g.faviconCdnUrl=i.string();break}case 6:{g.citationNumber=i.uint32();break}case 7:{g.sourceTitle=i.string();break}default:i.skipType(c&7);break}}return g},o.fromObject=function(i){if(i instanceof d.proto.BotSourcesMetadata.BotSourceItem)return i;var A=new d.proto.BotSourcesMetadata.BotSourceItem;switch(i.provider){default:if(typeof i.provider=="number"){A.provider=i.provider;break}break;case"UNKNOWN":case 0:A.provider=0;break;case"BING":case 1:A.provider=1;break;case"GOOGLE":case 2:A.provider=2;break;case"SUPPORT":case 3:A.provider=3;break;case"OTHER":case 4:A.provider=4;break}return i.thumbnailCdnUrl!=null&&(A.thumbnailCdnUrl=String(i.thumbnailCdnUrl)),i.sourceProviderUrl!=null&&(A.sourceProviderUrl=String(i.sourceProviderUrl)),i.sourceQuery!=null&&(A.sourceQuery=String(i.sourceQuery)),i.faviconCdnUrl!=null&&(A.faviconCdnUrl=String(i.faviconCdnUrl)),i.citationNumber!=null&&(A.citationNumber=i.citationNumber>>>0),i.sourceTitle!=null&&(A.sourceTitle=String(i.sourceTitle)),A},o.toObject=function(i,A){A||(A={});var r={};return i.provider!=null&&i.hasOwnProperty("provider")&&(r.provider=A.enums===String?d.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[i.provider]===void 0?i.provider:d.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[i.provider]:i.provider,A.oneofs&&(r._provider="provider")),i.thumbnailCdnUrl!=null&&i.hasOwnProperty("thumbnailCdnUrl")&&(r.thumbnailCdnUrl=i.thumbnailCdnUrl,A.oneofs&&(r._thumbnailCdnUrl="thumbnailCdnUrl")),i.sourceProviderUrl!=null&&i.hasOwnProperty("sourceProviderUrl")&&(r.sourceProviderUrl=i.sourceProviderUrl,A.oneofs&&(r._sourceProviderUrl="sourceProviderUrl")),i.sourceQuery!=null&&i.hasOwnProperty("sourceQuery")&&(r.sourceQuery=i.sourceQuery,A.oneofs&&(r._sourceQuery="sourceQuery")),i.faviconCdnUrl!=null&&i.hasOwnProperty("faviconCdnUrl")&&(r.faviconCdnUrl=i.faviconCdnUrl,A.oneofs&&(r._faviconCdnUrl="faviconCdnUrl")),i.citationNumber!=null&&i.hasOwnProperty("citationNumber")&&(r.citationNumber=i.citationNumber,A.oneofs&&(r._citationNumber="citationNumber")),i.sourceTitle!=null&&i.hasOwnProperty("sourceTitle")&&(r.sourceTitle=i.sourceTitle,A.oneofs&&(r._sourceTitle="sourceTitle")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},o.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.BotSourcesMetadata.BotSourceItem"},o.SourceProvider=(function(){let e={},i=Object.create(e);return i[e[0]="UNKNOWN"]=0,i[e[1]="BING"]=1,i[e[2]="GOOGLE"]=2,i[e[3]="SUPPORT"]=3,i[e[4]="OTHER"]=4,i})(),o})(),t})(),n.BotSuggestedPromptMetadata=(function(){function t(a){if(this.suggestedPrompts=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.suggestedPrompts&&s.suggestedPrompts.length||(s.suggestedPrompts=[]),s.suggestedPrompts.push(e.string());break}case 2:{s.selectedPromptIndex=e.uint32();break}case 3:{s.promptSuggestions=d.proto.BotPromptSuggestions.decode(e,e.uint32());break}case 4:{s.selectedPromptId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotSuggestedPromptMetadata)return e;var i=new d.proto.BotSuggestedPromptMetadata;if(e.suggestedPrompts){if(!Array.isArray(e.suggestedPrompts))throw TypeError(".proto.BotSuggestedPromptMetadata.suggestedPrompts: array expected");i.suggestedPrompts=[];for(var A=0;A>>0),e.promptSuggestions!=null){if(typeof e.promptSuggestions!="object")throw TypeError(".proto.BotSuggestedPromptMetadata.promptSuggestions: object expected");i.promptSuggestions=d.proto.BotPromptSuggestions.fromObject(e.promptSuggestions)}return e.selectedPromptId!=null&&(i.selectedPromptId=String(e.selectedPromptId)),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.suggestedPrompts=[]),e.suggestedPrompts&&e.suggestedPrompts.length){A.suggestedPrompts=[];for(var r=0;r>>3){case 1:{s.sbsMetadata=d.proto.BotUnifiedResponseMutation.SideBySideMetadata.decode(e,e.uint32());break}case 2:{s.mediaDetailsMetadataList&&s.mediaDetailsMetadataList.length||(s.mediaDetailsMetadataList=[]),s.mediaDetailsMetadataList.push(d.proto.BotUnifiedResponseMutation.MediaDetailsMetadata.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotUnifiedResponseMutation)return e;var i=new d.proto.BotUnifiedResponseMutation;if(e.sbsMetadata!=null){if(typeof e.sbsMetadata!="object")throw TypeError(".proto.BotUnifiedResponseMutation.sbsMetadata: object expected");i.sbsMetadata=d.proto.BotUnifiedResponseMutation.SideBySideMetadata.fromObject(e.sbsMetadata)}if(e.mediaDetailsMetadataList){if(!Array.isArray(e.mediaDetailsMetadataList))throw TypeError(".proto.BotUnifiedResponseMutation.mediaDetailsMetadataList: array expected");i.mediaDetailsMetadataList=[];for(var A=0;A>>3){case 1:{c.id=A.string();break}case 2:{c.highResMedia=d.proto.BotMediaMetadata.decode(A,A.uint32());break}case 3:{c.previewMedia=d.proto.BotMediaMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.BotUnifiedResponseMutation.MediaDetailsMetadata)return A;var r=new d.proto.BotUnifiedResponseMutation.MediaDetailsMetadata;if(A.id!=null&&(r.id=String(A.id)),A.highResMedia!=null){if(typeof A.highResMedia!="object")throw TypeError(".proto.BotUnifiedResponseMutation.MediaDetailsMetadata.highResMedia: object expected");r.highResMedia=d.proto.BotMediaMetadata.fromObject(A.highResMedia)}if(A.previewMedia!=null){if(typeof A.previewMedia!="object")throw TypeError(".proto.BotUnifiedResponseMutation.MediaDetailsMetadata.previewMedia: object expected");r.previewMedia=d.proto.BotMediaMetadata.fromObject(A.previewMedia)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),A.highResMedia!=null&&A.hasOwnProperty("highResMedia")&&(s.highResMedia=d.proto.BotMediaMetadata.toObject(A.highResMedia,r),r.oneofs&&(s._highResMedia="highResMedia")),A.previewMedia!=null&&A.hasOwnProperty("previewMedia")&&(s.previewMedia=d.proto.BotMediaMetadata.toObject(A.previewMedia,r),r.oneofs&&(s._previewMedia="previewMedia")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotUnifiedResponseMutation.MediaDetailsMetadata"},a})(),t.SideBySideMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.primaryResponseId=A.string();break}case 2:{c.surveyCtaHasRendered=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.BotUnifiedResponseMutation.SideBySideMetadata)return A;var r=new d.proto.BotUnifiedResponseMutation.SideBySideMetadata;return A.primaryResponseId!=null&&(r.primaryResponseId=String(A.primaryResponseId)),A.surveyCtaHasRendered!=null&&(r.surveyCtaHasRendered=!!A.surveyCtaHasRendered),r},a.toObject=function(A,r){r||(r={});var s={};return A.primaryResponseId!=null&&A.hasOwnProperty("primaryResponseId")&&(s.primaryResponseId=A.primaryResponseId,r.oneofs&&(s._primaryResponseId="primaryResponseId")),A.surveyCtaHasRendered!=null&&A.hasOwnProperty("surveyCtaHasRendered")&&(s.surveyCtaHasRendered=A.surveyCtaHasRendered,r.oneofs&&(s._surveyCtaHasRendered="surveyCtaHasRendered")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotUnifiedResponseMutation.SideBySideMetadata"},a})(),t})(),n.CallLogRecord=(function(){function t(a){if(this.participants=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.callResult=e.int32();break}case 2:{s.isDndMode=e.bool();break}case 3:{s.silenceReason=e.int32();break}case 4:{s.duration=e.int64();break}case 5:{s.startTime=e.int64();break}case 6:{s.isIncoming=e.bool();break}case 7:{s.isVideo=e.bool();break}case 8:{s.isCallLink=e.bool();break}case 9:{s.callLinkToken=e.string();break}case 10:{s.scheduledCallId=e.string();break}case 11:{s.callId=e.string();break}case 12:{s.callCreatorJid=e.string();break}case 13:{s.groupJid=e.string();break}case 14:{s.participants&&s.participants.length||(s.participants=[]),s.participants.push(d.proto.CallLogRecord.ParticipantInfo.decode(e,e.uint32()));break}case 15:{s.callType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.CallLogRecord)return e;var i=new d.proto.CallLogRecord;switch(e.callResult){default:if(typeof e.callResult=="number"){i.callResult=e.callResult;break}break;case"CONNECTED":case 0:i.callResult=0;break;case"REJECTED":case 1:i.callResult=1;break;case"CANCELLED":case 2:i.callResult=2;break;case"ACCEPTEDELSEWHERE":case 3:i.callResult=3;break;case"MISSED":case 4:i.callResult=4;break;case"INVALID":case 5:i.callResult=5;break;case"UNAVAILABLE":case 6:i.callResult=6;break;case"UPCOMING":case 7:i.callResult=7;break;case"FAILED":case 8:i.callResult=8;break;case"ABANDONED":case 9:i.callResult=9;break;case"ONGOING":case 10:i.callResult=10;break}switch(e.isDndMode!=null&&(i.isDndMode=!!e.isDndMode),e.silenceReason){default:if(typeof e.silenceReason=="number"){i.silenceReason=e.silenceReason;break}break;case"NONE":case 0:i.silenceReason=0;break;case"SCHEDULED":case 1:i.silenceReason=1;break;case"PRIVACY":case 2:i.silenceReason=2;break;case"LIGHTWEIGHT":case 3:i.silenceReason=3;break}if(e.duration!=null&&(l.Long?(i.duration=l.Long.fromValue(e.duration)).unsigned=!1:typeof e.duration=="string"?i.duration=parseInt(e.duration,10):typeof e.duration=="number"?i.duration=e.duration:typeof e.duration=="object"&&(i.duration=new l.LongBits(e.duration.low>>>0,e.duration.high>>>0).toNumber())),e.startTime!=null&&(l.Long?(i.startTime=l.Long.fromValue(e.startTime)).unsigned=!1:typeof e.startTime=="string"?i.startTime=parseInt(e.startTime,10):typeof e.startTime=="number"?i.startTime=e.startTime:typeof e.startTime=="object"&&(i.startTime=new l.LongBits(e.startTime.low>>>0,e.startTime.high>>>0).toNumber())),e.isIncoming!=null&&(i.isIncoming=!!e.isIncoming),e.isVideo!=null&&(i.isVideo=!!e.isVideo),e.isCallLink!=null&&(i.isCallLink=!!e.isCallLink),e.callLinkToken!=null&&(i.callLinkToken=String(e.callLinkToken)),e.scheduledCallId!=null&&(i.scheduledCallId=String(e.scheduledCallId)),e.callId!=null&&(i.callId=String(e.callId)),e.callCreatorJid!=null&&(i.callCreatorJid=String(e.callCreatorJid)),e.groupJid!=null&&(i.groupJid=String(e.groupJid)),e.participants){if(!Array.isArray(e.participants))throw TypeError(".proto.CallLogRecord.participants: array expected");i.participants=[];for(var A=0;A>>3){case 1:{c.userJid=A.string();break}case 2:{c.callResult=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.CallLogRecord.ParticipantInfo)return A;var r=new d.proto.CallLogRecord.ParticipantInfo;switch(A.userJid!=null&&(r.userJid=String(A.userJid)),A.callResult){default:if(typeof A.callResult=="number"){r.callResult=A.callResult;break}break;case"CONNECTED":case 0:r.callResult=0;break;case"REJECTED":case 1:r.callResult=1;break;case"CANCELLED":case 2:r.callResult=2;break;case"ACCEPTEDELSEWHERE":case 3:r.callResult=3;break;case"MISSED":case 4:r.callResult=4;break;case"INVALID":case 5:r.callResult=5;break;case"UNAVAILABLE":case 6:r.callResult=6;break;case"UPCOMING":case 7:r.callResult=7;break;case"FAILED":case 8:r.callResult=8;break;case"ABANDONED":case 9:r.callResult=9;break;case"ONGOING":case 10:r.callResult=10;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.userJid!=null&&A.hasOwnProperty("userJid")&&(s.userJid=A.userJid,r.oneofs&&(s._userJid="userJid")),A.callResult!=null&&A.hasOwnProperty("callResult")&&(s.callResult=r.enums===String?d.proto.CallLogRecord.CallResult[A.callResult]===void 0?A.callResult:d.proto.CallLogRecord.CallResult[A.callResult]:A.callResult,r.oneofs&&(s._callResult="callResult")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.CallLogRecord.ParticipantInfo"},a})(),t.SilenceReason=(function(){let a={},e=Object.create(a);return e[a[0]="NONE"]=0,e[a[1]="SCHEDULED"]=1,e[a[2]="PRIVACY"]=2,e[a[3]="LIGHTWEIGHT"]=3,e})(),t})(),n.CertChain=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.leaf=d.proto.CertChain.NoiseCertificate.decode(e,e.uint32());break}case 2:{s.intermediate=d.proto.CertChain.NoiseCertificate.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.CertChain)return e;var i=new d.proto.CertChain;if(e.leaf!=null){if(typeof e.leaf!="object")throw TypeError(".proto.CertChain.leaf: object expected");i.leaf=d.proto.CertChain.NoiseCertificate.fromObject(e.leaf)}if(e.intermediate!=null){if(typeof e.intermediate!="object")throw TypeError(".proto.CertChain.intermediate: object expected");i.intermediate=d.proto.CertChain.NoiseCertificate.fromObject(e.intermediate)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.leaf!=null&&e.hasOwnProperty("leaf")&&(A.leaf=d.proto.CertChain.NoiseCertificate.toObject(e.leaf,i),i.oneofs&&(A._leaf="leaf")),e.intermediate!=null&&e.hasOwnProperty("intermediate")&&(A.intermediate=d.proto.CertChain.NoiseCertificate.toObject(e.intermediate,i),i.oneofs&&(A._intermediate="intermediate")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CertChain"},t.NoiseCertificate=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.details=A.bytes();break}case 2:{c.signature=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.CertChain.NoiseCertificate)return A;var r=new d.proto.CertChain.NoiseCertificate;return A.details!=null&&(typeof A.details=="string"?l.base64.decode(A.details,r.details=l.newBuffer(l.base64.length(A.details)),0):A.details.length>=0&&(r.details=A.details)),A.signature!=null&&(typeof A.signature=="string"?l.base64.decode(A.signature,r.signature=l.newBuffer(l.base64.length(A.signature)),0):A.signature.length>=0&&(r.signature=A.signature)),r},a.toObject=function(A,r){r||(r={});var s={};return A.details!=null&&A.hasOwnProperty("details")&&(s.details=r.bytes===String?l.base64.encode(A.details,0,A.details.length):r.bytes===Array?Array.prototype.slice.call(A.details):A.details,r.oneofs&&(s._details="details")),A.signature!=null&&A.hasOwnProperty("signature")&&(s.signature=r.bytes===String?l.base64.encode(A.signature,0,A.signature.length):r.bytes===Array?Array.prototype.slice.call(A.signature):A.signature,r.oneofs&&(s._signature="signature")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.CertChain.NoiseCertificate"},a.Details=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.serial=s.uint32();break}case 2:{p.issuerSerial=s.uint32();break}case 3:{p.key=s.bytes();break}case 4:{p.notBefore=s.uint64();break}case 5:{p.notAfter=s.uint64();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.CertChain.NoiseCertificate.Details)return s;var g=new d.proto.CertChain.NoiseCertificate.Details;return s.serial!=null&&(g.serial=s.serial>>>0),s.issuerSerial!=null&&(g.issuerSerial=s.issuerSerial>>>0),s.key!=null&&(typeof s.key=="string"?l.base64.decode(s.key,g.key=l.newBuffer(l.base64.length(s.key)),0):s.key.length>=0&&(g.key=s.key)),s.notBefore!=null&&(l.Long?(g.notBefore=l.Long.fromValue(s.notBefore)).unsigned=!0:typeof s.notBefore=="string"?g.notBefore=parseInt(s.notBefore,10):typeof s.notBefore=="number"?g.notBefore=s.notBefore:typeof s.notBefore=="object"&&(g.notBefore=new l.LongBits(s.notBefore.low>>>0,s.notBefore.high>>>0).toNumber(!0))),s.notAfter!=null&&(l.Long?(g.notAfter=l.Long.fromValue(s.notAfter)).unsigned=!0:typeof s.notAfter=="string"?g.notAfter=parseInt(s.notAfter,10):typeof s.notAfter=="number"?g.notAfter=s.notAfter:typeof s.notAfter=="object"&&(g.notAfter=new l.LongBits(s.notAfter.low>>>0,s.notAfter.high>>>0).toNumber(!0))),g},i.toObject=function(s,g){g||(g={});var c={};return s.serial!=null&&s.hasOwnProperty("serial")&&(c.serial=s.serial,g.oneofs&&(c._serial="serial")),s.issuerSerial!=null&&s.hasOwnProperty("issuerSerial")&&(c.issuerSerial=s.issuerSerial,g.oneofs&&(c._issuerSerial="issuerSerial")),s.key!=null&&s.hasOwnProperty("key")&&(c.key=g.bytes===String?l.base64.encode(s.key,0,s.key.length):g.bytes===Array?Array.prototype.slice.call(s.key):s.key,g.oneofs&&(c._key="key")),s.notBefore!=null&&s.hasOwnProperty("notBefore")&&(typeof s.notBefore=="number"?c.notBefore=g.longs===String?String(s.notBefore):s.notBefore:c.notBefore=g.longs===String?ge(s.notBefore,!0):g.longs===Number?ce(s.notBefore,!0):s.notBefore,g.oneofs&&(c._notBefore="notBefore")),s.notAfter!=null&&s.hasOwnProperty("notAfter")&&(typeof s.notAfter=="number"?c.notAfter=g.longs===String?String(s.notAfter):s.notAfter:c.notAfter=g.longs===String?ge(s.notAfter,!0):g.longs===Number?ce(s.notAfter,!0):s.notAfter,g.oneofs&&(c._notAfter="notAfter")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.CertChain.NoiseCertificate.Details"},i})(),a})(),t})(),n.ChatLockSettings=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.hideLockedChats=e.bool();break}case 2:{s.secretCode=d.proto.UserPassword.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ChatLockSettings)return e;var i=new d.proto.ChatLockSettings;if(e.hideLockedChats!=null&&(i.hideLockedChats=!!e.hideLockedChats),e.secretCode!=null){if(typeof e.secretCode!="object")throw TypeError(".proto.ChatLockSettings.secretCode: object expected");i.secretCode=d.proto.UserPassword.fromObject(e.secretCode)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.hideLockedChats!=null&&e.hasOwnProperty("hideLockedChats")&&(A.hideLockedChats=e.hideLockedChats,i.oneofs&&(A._hideLockedChats="hideLockedChats")),e.secretCode!=null&&e.hasOwnProperty("secretCode")&&(A.secretCode=d.proto.UserPassword.toObject(e.secretCode,i),i.oneofs&&(A._secretCode="secretCode")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ChatLockSettings"},t})(),n.ChatRowOpaqueData=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.draftMessage=d.proto.ChatRowOpaqueData.DraftMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ChatRowOpaqueData)return e;var i=new d.proto.ChatRowOpaqueData;if(e.draftMessage!=null){if(typeof e.draftMessage!="object")throw TypeError(".proto.ChatRowOpaqueData.draftMessage: object expected");i.draftMessage=d.proto.ChatRowOpaqueData.DraftMessage.fromObject(e.draftMessage)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.draftMessage!=null&&e.hasOwnProperty("draftMessage")&&(A.draftMessage=d.proto.ChatRowOpaqueData.DraftMessage.toObject(e.draftMessage,i),i.oneofs&&(A._draftMessage="draftMessage")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ChatRowOpaqueData"},t.DraftMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.text=A.string();break}case 2:{c.omittedUrl=A.string();break}case 3:{c.ctwaContextLinkData=d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.decode(A,A.uint32());break}case 4:{c.ctwaContext=d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.decode(A,A.uint32());break}case 5:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ChatRowOpaqueData.DraftMessage)return A;var r=new d.proto.ChatRowOpaqueData.DraftMessage;if(A.text!=null&&(r.text=String(A.text)),A.omittedUrl!=null&&(r.omittedUrl=String(A.omittedUrl)),A.ctwaContextLinkData!=null){if(typeof A.ctwaContextLinkData!="object")throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContextLinkData: object expected");r.ctwaContextLinkData=d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.fromObject(A.ctwaContextLinkData)}if(A.ctwaContext!=null){if(typeof A.ctwaContext!="object")throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContext: object expected");r.ctwaContext=d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.fromObject(A.ctwaContext)}return A.timestamp!=null&&(l.Long?(r.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?r.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?r.timestamp=A.timestamp:typeof A.timestamp=="object"&&(r.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.omittedUrl!=null&&A.hasOwnProperty("omittedUrl")&&(s.omittedUrl=A.omittedUrl,r.oneofs&&(s._omittedUrl="omittedUrl")),A.ctwaContextLinkData!=null&&A.hasOwnProperty("ctwaContextLinkData")&&(s.ctwaContextLinkData=d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.toObject(A.ctwaContextLinkData,r),r.oneofs&&(s._ctwaContextLinkData="ctwaContextLinkData")),A.ctwaContext!=null&&A.hasOwnProperty("ctwaContext")&&(s.ctwaContext=d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.toObject(A.ctwaContext,r),r.oneofs&&(s._ctwaContext="ctwaContext")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=r.longs===String?String(A.timestamp):A.timestamp:s.timestamp=r.longs===String?ge(A.timestamp):r.longs===Number?ce(A.timestamp):A.timestamp,r.oneofs&&(s._timestamp="timestamp")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ChatRowOpaqueData.DraftMessage"},a.CtwaContextData=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.conversionSource=s.string();break}case 2:{p.conversionData=s.bytes();break}case 3:{p.sourceUrl=s.string();break}case 4:{p.sourceId=s.string();break}case 5:{p.sourceType=s.string();break}case 6:{p.title=s.string();break}case 7:{p.description=s.string();break}case 8:{p.thumbnail=s.string();break}case 9:{p.thumbnailUrl=s.string();break}case 10:{p.mediaType=s.int32();break}case 11:{p.mediaUrl=s.string();break}case 12:{p.isSuspiciousLink=s.bool();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData)return s;var g=new d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData;switch(s.conversionSource!=null&&(g.conversionSource=String(s.conversionSource)),s.conversionData!=null&&(typeof s.conversionData=="string"?l.base64.decode(s.conversionData,g.conversionData=l.newBuffer(l.base64.length(s.conversionData)),0):s.conversionData.length>=0&&(g.conversionData=s.conversionData)),s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.sourceId!=null&&(g.sourceId=String(s.sourceId)),s.sourceType!=null&&(g.sourceType=String(s.sourceType)),s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.thumbnail!=null&&(g.thumbnail=String(s.thumbnail)),s.thumbnailUrl!=null&&(g.thumbnailUrl=String(s.thumbnailUrl)),s.mediaType){default:if(typeof s.mediaType=="number"){g.mediaType=s.mediaType;break}break;case"NONE":case 0:g.mediaType=0;break;case"IMAGE":case 1:g.mediaType=1;break;case"VIDEO":case 2:g.mediaType=2;break}return s.mediaUrl!=null&&(g.mediaUrl=String(s.mediaUrl)),s.isSuspiciousLink!=null&&(g.isSuspiciousLink=!!s.isSuspiciousLink),g},i.toObject=function(s,g){g||(g={});var c={};return s.conversionSource!=null&&s.hasOwnProperty("conversionSource")&&(c.conversionSource=s.conversionSource,g.oneofs&&(c._conversionSource="conversionSource")),s.conversionData!=null&&s.hasOwnProperty("conversionData")&&(c.conversionData=g.bytes===String?l.base64.encode(s.conversionData,0,s.conversionData.length):g.bytes===Array?Array.prototype.slice.call(s.conversionData):s.conversionData,g.oneofs&&(c._conversionData="conversionData")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.sourceId!=null&&s.hasOwnProperty("sourceId")&&(c.sourceId=s.sourceId,g.oneofs&&(c._sourceId="sourceId")),s.sourceType!=null&&s.hasOwnProperty("sourceType")&&(c.sourceType=s.sourceType,g.oneofs&&(c._sourceType="sourceType")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.thumbnail!=null&&s.hasOwnProperty("thumbnail")&&(c.thumbnail=s.thumbnail,g.oneofs&&(c._thumbnail="thumbnail")),s.thumbnailUrl!=null&&s.hasOwnProperty("thumbnailUrl")&&(c.thumbnailUrl=s.thumbnailUrl,g.oneofs&&(c._thumbnailUrl="thumbnailUrl")),s.mediaType!=null&&s.hasOwnProperty("mediaType")&&(c.mediaType=g.enums===String?d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[s.mediaType]===void 0?s.mediaType:d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[s.mediaType]:s.mediaType,g.oneofs&&(c._mediaType="mediaType")),s.mediaUrl!=null&&s.hasOwnProperty("mediaUrl")&&(c.mediaUrl=s.mediaUrl,g.oneofs&&(c._mediaUrl="mediaUrl")),s.isSuspiciousLink!=null&&s.hasOwnProperty("isSuspiciousLink")&&(c.isSuspiciousLink=s.isSuspiciousLink,g.oneofs&&(c._isSuspiciousLink="isSuspiciousLink")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ChatRowOpaqueData.DraftMessage.CtwaContextData"},i.ContextInfoExternalAdReplyInfoMediaType=(function(){let r={},s=Object.create(r);return s[r[0]="NONE"]=0,s[r[1]="IMAGE"]=1,s[r[2]="VIDEO"]=2,s})(),i})(),a.CtwaContextLinkData=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.context=s.string();break}case 2:{p.sourceUrl=s.string();break}case 3:{p.icebreaker=s.string();break}case 4:{p.phone=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData)return s;var g=new d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData;return s.context!=null&&(g.context=String(s.context)),s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.icebreaker!=null&&(g.icebreaker=String(s.icebreaker)),s.phone!=null&&(g.phone=String(s.phone)),g},i.toObject=function(s,g){g||(g={});var c={};return s.context!=null&&s.hasOwnProperty("context")&&(c.context=s.context,g.oneofs&&(c._context="context")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.icebreaker!=null&&s.hasOwnProperty("icebreaker")&&(c.icebreaker=s.icebreaker,g.oneofs&&(c._icebreaker="icebreaker")),s.phone!=null&&s.hasOwnProperty("phone")&&(c.phone=s.phone,g.oneofs&&(c._phone="phone")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData"},i})(),a})(),t})(),n.Citation=(function(){function t(o){if(o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.title=a.string();break}case 2:{r.subtitle=a.string();break}case 3:{r.cmsId=a.string();break}case 4:{r.imageUrl=a.string();break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.Citation)return a;var e=new d.proto.Citation;return a.title!=null&&(e.title=String(a.title)),a.subtitle!=null&&(e.subtitle=String(a.subtitle)),a.cmsId!=null&&(e.cmsId=String(a.cmsId)),a.imageUrl!=null&&(e.imageUrl=String(a.imageUrl)),e},t.toObject=function(a,e){e||(e={});var i={};return e.defaults&&(i.title="",i.subtitle="",i.cmsId="",i.imageUrl=""),a.title!=null&&a.hasOwnProperty("title")&&(i.title=a.title),a.subtitle!=null&&a.hasOwnProperty("subtitle")&&(i.subtitle=a.subtitle),a.cmsId!=null&&a.hasOwnProperty("cmsId")&&(i.cmsId=a.cmsId),a.imageUrl!=null&&a.hasOwnProperty("imageUrl")&&(i.imageUrl=a.imageUrl),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.Citation"},t})(),n.ClientPairingProps=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.isChatDbLidMigrated=e.bool();break}case 2:{s.isSyncdPureLidSession=e.bool();break}case 3:{s.isSyncdSnapshotRecoveryEnabled=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ClientPairingProps)return e;var i=new d.proto.ClientPairingProps;return e.isChatDbLidMigrated!=null&&(i.isChatDbLidMigrated=!!e.isChatDbLidMigrated),e.isSyncdPureLidSession!=null&&(i.isSyncdPureLidSession=!!e.isSyncdPureLidSession),e.isSyncdSnapshotRecoveryEnabled!=null&&(i.isSyncdSnapshotRecoveryEnabled=!!e.isSyncdSnapshotRecoveryEnabled),i},t.toObject=function(e,i){i||(i={});var A={};return e.isChatDbLidMigrated!=null&&e.hasOwnProperty("isChatDbLidMigrated")&&(A.isChatDbLidMigrated=e.isChatDbLidMigrated,i.oneofs&&(A._isChatDbLidMigrated="isChatDbLidMigrated")),e.isSyncdPureLidSession!=null&&e.hasOwnProperty("isSyncdPureLidSession")&&(A.isSyncdPureLidSession=e.isSyncdPureLidSession,i.oneofs&&(A._isSyncdPureLidSession="isSyncdPureLidSession")),e.isSyncdSnapshotRecoveryEnabled!=null&&e.hasOwnProperty("isSyncdSnapshotRecoveryEnabled")&&(A.isSyncdSnapshotRecoveryEnabled=e.isSyncdSnapshotRecoveryEnabled,i.oneofs&&(A._isSyncdSnapshotRecoveryEnabled="isSyncdSnapshotRecoveryEnabled")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ClientPairingProps"},t})(),n.ClientPayload=(function(){function t(a){if(this.shards=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.username=e.uint64();break}case 3:{s.passive=e.bool();break}case 5:{s.userAgent=d.proto.ClientPayload.UserAgent.decode(e,e.uint32());break}case 6:{s.webInfo=d.proto.ClientPayload.WebInfo.decode(e,e.uint32());break}case 7:{s.pushName=e.string();break}case 9:{s.sessionId=e.sfixed32();break}case 10:{s.shortConnect=e.bool();break}case 12:{s.connectType=e.int32();break}case 13:{s.connectReason=e.int32();break}case 14:{if(s.shards&&s.shards.length||(s.shards=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos>>0,e.username.high>>>0).toNumber(!0))),e.passive!=null&&(i.passive=!!e.passive),e.userAgent!=null){if(typeof e.userAgent!="object")throw TypeError(".proto.ClientPayload.userAgent: object expected");i.userAgent=d.proto.ClientPayload.UserAgent.fromObject(e.userAgent)}if(e.webInfo!=null){if(typeof e.webInfo!="object")throw TypeError(".proto.ClientPayload.webInfo: object expected");i.webInfo=d.proto.ClientPayload.WebInfo.fromObject(e.webInfo)}switch(e.pushName!=null&&(i.pushName=String(e.pushName)),e.sessionId!=null&&(i.sessionId=e.sessionId|0),e.shortConnect!=null&&(i.shortConnect=!!e.shortConnect),e.connectType){default:if(typeof e.connectType=="number"){i.connectType=e.connectType;break}break;case"CELLULAR_UNKNOWN":case 0:i.connectType=0;break;case"WIFI_UNKNOWN":case 1:i.connectType=1;break;case"CELLULAR_EDGE":case 100:i.connectType=100;break;case"CELLULAR_IDEN":case 101:i.connectType=101;break;case"CELLULAR_UMTS":case 102:i.connectType=102;break;case"CELLULAR_EVDO":case 103:i.connectType=103;break;case"CELLULAR_GPRS":case 104:i.connectType=104;break;case"CELLULAR_HSDPA":case 105:i.connectType=105;break;case"CELLULAR_HSUPA":case 106:i.connectType=106;break;case"CELLULAR_HSPA":case 107:i.connectType=107;break;case"CELLULAR_CDMA":case 108:i.connectType=108;break;case"CELLULAR_1XRTT":case 109:i.connectType=109;break;case"CELLULAR_EHRPD":case 110:i.connectType=110;break;case"CELLULAR_LTE":case 111:i.connectType=111;break;case"CELLULAR_HSPAP":case 112:i.connectType=112;break}switch(e.connectReason){default:if(typeof e.connectReason=="number"){i.connectReason=e.connectReason;break}break;case"PUSH":case 0:i.connectReason=0;break;case"USER_ACTIVATED":case 1:i.connectReason=1;break;case"SCHEDULED":case 2:i.connectReason=2;break;case"ERROR_RECONNECT":case 3:i.connectReason=3;break;case"NETWORK_SWITCH":case 4:i.connectReason=4;break;case"PING_RECONNECT":case 5:i.connectReason=5;break;case"UNKNOWN":case 6:i.connectReason=6;break}if(e.shards){if(!Array.isArray(e.shards))throw TypeError(".proto.ClientPayload.shards: array expected");i.shards=[];for(var A=0;A>>0),e.device!=null&&(i.device=e.device>>>0),e.devicePairingData!=null){if(typeof e.devicePairingData!="object")throw TypeError(".proto.ClientPayload.devicePairingData: object expected");i.devicePairingData=d.proto.ClientPayload.DevicePairingRegistrationData.fromObject(e.devicePairingData)}switch(e.product){default:if(typeof e.product=="number"){i.product=e.product;break}break;case"WHATSAPP":case 0:i.product=0;break;case"MESSENGER":case 1:i.product=1;break;case"INTEROP":case 2:i.product=2;break;case"INTEROP_MSGR":case 3:i.product=3;break;case"WHATSAPP_LID":case 4:i.product=4;break}switch(e.fbCat!=null&&(typeof e.fbCat=="string"?l.base64.decode(e.fbCat,i.fbCat=l.newBuffer(l.base64.length(e.fbCat)),0):e.fbCat.length>=0&&(i.fbCat=e.fbCat)),e.fbUserAgent!=null&&(typeof e.fbUserAgent=="string"?l.base64.decode(e.fbUserAgent,i.fbUserAgent=l.newBuffer(l.base64.length(e.fbUserAgent)),0):e.fbUserAgent.length>=0&&(i.fbUserAgent=e.fbUserAgent)),e.oc!=null&&(i.oc=!!e.oc),e.lc!=null&&(i.lc=e.lc|0),e.iosAppExtension){default:if(typeof e.iosAppExtension=="number"){i.iosAppExtension=e.iosAppExtension;break}break;case"SHARE_EXTENSION":case 0:i.iosAppExtension=0;break;case"SERVICE_EXTENSION":case 1:i.iosAppExtension=1;break;case"INTENTS_EXTENSION":case 2:i.iosAppExtension=2;break}if(e.fbAppId!=null&&(l.Long?(i.fbAppId=l.Long.fromValue(e.fbAppId)).unsigned=!0:typeof e.fbAppId=="string"?i.fbAppId=parseInt(e.fbAppId,10):typeof e.fbAppId=="number"?i.fbAppId=e.fbAppId:typeof e.fbAppId=="object"&&(i.fbAppId=new l.LongBits(e.fbAppId.low>>>0,e.fbAppId.high>>>0).toNumber(!0))),e.fbDeviceId!=null&&(typeof e.fbDeviceId=="string"?l.base64.decode(e.fbDeviceId,i.fbDeviceId=l.newBuffer(l.base64.length(e.fbDeviceId)),0):e.fbDeviceId.length>=0&&(i.fbDeviceId=e.fbDeviceId)),e.pull!=null&&(i.pull=!!e.pull),e.paddingBytes!=null&&(typeof e.paddingBytes=="string"?l.base64.decode(e.paddingBytes,i.paddingBytes=l.newBuffer(l.base64.length(e.paddingBytes)),0):e.paddingBytes.length>=0&&(i.paddingBytes=e.paddingBytes)),e.yearClass!=null&&(i.yearClass=e.yearClass|0),e.memClass!=null&&(i.memClass=e.memClass|0),e.interopData!=null){if(typeof e.interopData!="object")throw TypeError(".proto.ClientPayload.interopData: object expected");i.interopData=d.proto.ClientPayload.InteropData.fromObject(e.interopData)}switch(e.trafficAnonymization){default:if(typeof e.trafficAnonymization=="number"){i.trafficAnonymization=e.trafficAnonymization;break}break;case"OFF":case 0:i.trafficAnonymization=0;break;case"STANDARD":case 1:i.trafficAnonymization=1;break}switch(e.lidDbMigrated!=null&&(i.lidDbMigrated=!!e.lidDbMigrated),e.accountType){default:if(typeof e.accountType=="number"){i.accountType=e.accountType;break}break;case"DEFAULT":case 0:i.accountType=0;break;case"GUEST":case 1:i.accountType=1;break}return e.connectionSequenceInfo!=null&&(i.connectionSequenceInfo=e.connectionSequenceInfo|0),e.paaLink!=null&&(i.paaLink=!!e.paaLink),e.preacksCount!=null&&(i.preacksCount=e.preacksCount|0),e.processingQueueSize!=null&&(i.processingQueueSize=e.processingQueueSize|0),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.shards=[]),e.username!=null&&e.hasOwnProperty("username")&&(typeof e.username=="number"?A.username=i.longs===String?String(e.username):e.username:A.username=i.longs===String?ge(e.username,!0):i.longs===Number?ce(e.username,!0):e.username,i.oneofs&&(A._username="username")),e.passive!=null&&e.hasOwnProperty("passive")&&(A.passive=e.passive,i.oneofs&&(A._passive="passive")),e.userAgent!=null&&e.hasOwnProperty("userAgent")&&(A.userAgent=d.proto.ClientPayload.UserAgent.toObject(e.userAgent,i),i.oneofs&&(A._userAgent="userAgent")),e.webInfo!=null&&e.hasOwnProperty("webInfo")&&(A.webInfo=d.proto.ClientPayload.WebInfo.toObject(e.webInfo,i),i.oneofs&&(A._webInfo="webInfo")),e.pushName!=null&&e.hasOwnProperty("pushName")&&(A.pushName=e.pushName,i.oneofs&&(A._pushName="pushName")),e.sessionId!=null&&e.hasOwnProperty("sessionId")&&(A.sessionId=e.sessionId,i.oneofs&&(A._sessionId="sessionId")),e.shortConnect!=null&&e.hasOwnProperty("shortConnect")&&(A.shortConnect=e.shortConnect,i.oneofs&&(A._shortConnect="shortConnect")),e.connectType!=null&&e.hasOwnProperty("connectType")&&(A.connectType=i.enums===String?d.proto.ClientPayload.ConnectType[e.connectType]===void 0?e.connectType:d.proto.ClientPayload.ConnectType[e.connectType]:e.connectType,i.oneofs&&(A._connectType="connectType")),e.connectReason!=null&&e.hasOwnProperty("connectReason")&&(A.connectReason=i.enums===String?d.proto.ClientPayload.ConnectReason[e.connectReason]===void 0?e.connectReason:d.proto.ClientPayload.ConnectReason[e.connectReason]:e.connectReason,i.oneofs&&(A._connectReason="connectReason")),e.shards&&e.shards.length){A.shards=[];for(var r=0;r>>3){case 15:{c.dnsMethod=A.int32();break}case 16:{c.appCached=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ClientPayload.DNSSource)return A;var r=new d.proto.ClientPayload.DNSSource;switch(A.dnsMethod){default:if(typeof A.dnsMethod=="number"){r.dnsMethod=A.dnsMethod;break}break;case"SYSTEM":case 0:r.dnsMethod=0;break;case"GOOGLE":case 1:r.dnsMethod=1;break;case"HARDCODED":case 2:r.dnsMethod=2;break;case"OVERRIDE":case 3:r.dnsMethod=3;break;case"FALLBACK":case 4:r.dnsMethod=4;break;case"MNS":case 5:r.dnsMethod=5;break}return A.appCached!=null&&(r.appCached=!!A.appCached),r},a.toObject=function(A,r){r||(r={});var s={};return A.dnsMethod!=null&&A.hasOwnProperty("dnsMethod")&&(s.dnsMethod=r.enums===String?d.proto.ClientPayload.DNSSource.DNSResolutionMethod[A.dnsMethod]===void 0?A.dnsMethod:d.proto.ClientPayload.DNSSource.DNSResolutionMethod[A.dnsMethod]:A.dnsMethod,r.oneofs&&(s._dnsMethod="dnsMethod")),A.appCached!=null&&A.hasOwnProperty("appCached")&&(s.appCached=A.appCached,r.oneofs&&(s._appCached="appCached")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.DNSSource"},a.DNSResolutionMethod=(function(){let i={},A=Object.create(i);return A[i[0]="SYSTEM"]=0,A[i[1]="GOOGLE"]=1,A[i[2]="HARDCODED"]=2,A[i[3]="OVERRIDE"]=3,A[i[4]="FALLBACK"]=4,A[i[5]="MNS"]=5,A})(),a})(),t.DevicePairingRegistrationData=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.eRegid=A.bytes();break}case 2:{c.eKeytype=A.bytes();break}case 3:{c.eIdent=A.bytes();break}case 4:{c.eSkeyId=A.bytes();break}case 5:{c.eSkeyVal=A.bytes();break}case 6:{c.eSkeySig=A.bytes();break}case 7:{c.buildHash=A.bytes();break}case 8:{c.deviceProps=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ClientPayload.DevicePairingRegistrationData)return A;var r=new d.proto.ClientPayload.DevicePairingRegistrationData;return A.eRegid!=null&&(typeof A.eRegid=="string"?l.base64.decode(A.eRegid,r.eRegid=l.newBuffer(l.base64.length(A.eRegid)),0):A.eRegid.length>=0&&(r.eRegid=A.eRegid)),A.eKeytype!=null&&(typeof A.eKeytype=="string"?l.base64.decode(A.eKeytype,r.eKeytype=l.newBuffer(l.base64.length(A.eKeytype)),0):A.eKeytype.length>=0&&(r.eKeytype=A.eKeytype)),A.eIdent!=null&&(typeof A.eIdent=="string"?l.base64.decode(A.eIdent,r.eIdent=l.newBuffer(l.base64.length(A.eIdent)),0):A.eIdent.length>=0&&(r.eIdent=A.eIdent)),A.eSkeyId!=null&&(typeof A.eSkeyId=="string"?l.base64.decode(A.eSkeyId,r.eSkeyId=l.newBuffer(l.base64.length(A.eSkeyId)),0):A.eSkeyId.length>=0&&(r.eSkeyId=A.eSkeyId)),A.eSkeyVal!=null&&(typeof A.eSkeyVal=="string"?l.base64.decode(A.eSkeyVal,r.eSkeyVal=l.newBuffer(l.base64.length(A.eSkeyVal)),0):A.eSkeyVal.length>=0&&(r.eSkeyVal=A.eSkeyVal)),A.eSkeySig!=null&&(typeof A.eSkeySig=="string"?l.base64.decode(A.eSkeySig,r.eSkeySig=l.newBuffer(l.base64.length(A.eSkeySig)),0):A.eSkeySig.length>=0&&(r.eSkeySig=A.eSkeySig)),A.buildHash!=null&&(typeof A.buildHash=="string"?l.base64.decode(A.buildHash,r.buildHash=l.newBuffer(l.base64.length(A.buildHash)),0):A.buildHash.length>=0&&(r.buildHash=A.buildHash)),A.deviceProps!=null&&(typeof A.deviceProps=="string"?l.base64.decode(A.deviceProps,r.deviceProps=l.newBuffer(l.base64.length(A.deviceProps)),0):A.deviceProps.length>=0&&(r.deviceProps=A.deviceProps)),r},a.toObject=function(A,r){r||(r={});var s={};return A.eRegid!=null&&A.hasOwnProperty("eRegid")&&(s.eRegid=r.bytes===String?l.base64.encode(A.eRegid,0,A.eRegid.length):r.bytes===Array?Array.prototype.slice.call(A.eRegid):A.eRegid,r.oneofs&&(s._eRegid="eRegid")),A.eKeytype!=null&&A.hasOwnProperty("eKeytype")&&(s.eKeytype=r.bytes===String?l.base64.encode(A.eKeytype,0,A.eKeytype.length):r.bytes===Array?Array.prototype.slice.call(A.eKeytype):A.eKeytype,r.oneofs&&(s._eKeytype="eKeytype")),A.eIdent!=null&&A.hasOwnProperty("eIdent")&&(s.eIdent=r.bytes===String?l.base64.encode(A.eIdent,0,A.eIdent.length):r.bytes===Array?Array.prototype.slice.call(A.eIdent):A.eIdent,r.oneofs&&(s._eIdent="eIdent")),A.eSkeyId!=null&&A.hasOwnProperty("eSkeyId")&&(s.eSkeyId=r.bytes===String?l.base64.encode(A.eSkeyId,0,A.eSkeyId.length):r.bytes===Array?Array.prototype.slice.call(A.eSkeyId):A.eSkeyId,r.oneofs&&(s._eSkeyId="eSkeyId")),A.eSkeyVal!=null&&A.hasOwnProperty("eSkeyVal")&&(s.eSkeyVal=r.bytes===String?l.base64.encode(A.eSkeyVal,0,A.eSkeyVal.length):r.bytes===Array?Array.prototype.slice.call(A.eSkeyVal):A.eSkeyVal,r.oneofs&&(s._eSkeyVal="eSkeyVal")),A.eSkeySig!=null&&A.hasOwnProperty("eSkeySig")&&(s.eSkeySig=r.bytes===String?l.base64.encode(A.eSkeySig,0,A.eSkeySig.length):r.bytes===Array?Array.prototype.slice.call(A.eSkeySig):A.eSkeySig,r.oneofs&&(s._eSkeySig="eSkeySig")),A.buildHash!=null&&A.hasOwnProperty("buildHash")&&(s.buildHash=r.bytes===String?l.base64.encode(A.buildHash,0,A.buildHash.length):r.bytes===Array?Array.prototype.slice.call(A.buildHash):A.buildHash,r.oneofs&&(s._buildHash="buildHash")),A.deviceProps!=null&&A.hasOwnProperty("deviceProps")&&(s.deviceProps=r.bytes===String?l.base64.encode(A.deviceProps,0,A.deviceProps.length):r.bytes===Array?Array.prototype.slice.call(A.deviceProps):A.deviceProps,r.oneofs&&(s._deviceProps="deviceProps")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.DevicePairingRegistrationData"},a})(),t.IOSAppExtension=(function(){let a={},e=Object.create(a);return e[a[0]="SHARE_EXTENSION"]=0,e[a[1]="SERVICE_EXTENSION"]=1,e[a[2]="INTENTS_EXTENSION"]=2,e})(),t.InteropData=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.accountId=A.uint64();break}case 2:{c.token=A.bytes();break}case 3:{c.enableReadReceipts=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ClientPayload.InteropData)return A;var r=new d.proto.ClientPayload.InteropData;return A.accountId!=null&&(l.Long?(r.accountId=l.Long.fromValue(A.accountId)).unsigned=!0:typeof A.accountId=="string"?r.accountId=parseInt(A.accountId,10):typeof A.accountId=="number"?r.accountId=A.accountId:typeof A.accountId=="object"&&(r.accountId=new l.LongBits(A.accountId.low>>>0,A.accountId.high>>>0).toNumber(!0))),A.token!=null&&(typeof A.token=="string"?l.base64.decode(A.token,r.token=l.newBuffer(l.base64.length(A.token)),0):A.token.length>=0&&(r.token=A.token)),A.enableReadReceipts!=null&&(r.enableReadReceipts=!!A.enableReadReceipts),r},a.toObject=function(A,r){r||(r={});var s={};return A.accountId!=null&&A.hasOwnProperty("accountId")&&(typeof A.accountId=="number"?s.accountId=r.longs===String?String(A.accountId):A.accountId:s.accountId=r.longs===String?ge(A.accountId,!0):r.longs===Number?ce(A.accountId,!0):A.accountId,r.oneofs&&(s._accountId="accountId")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=r.bytes===String?l.base64.encode(A.token,0,A.token.length):r.bytes===Array?Array.prototype.slice.call(A.token):A.token,r.oneofs&&(s._token="token")),A.enableReadReceipts!=null&&A.hasOwnProperty("enableReadReceipts")&&(s.enableReadReceipts=A.enableReadReceipts,r.oneofs&&(s._enableReadReceipts="enableReadReceipts")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.InteropData"},a})(),t.Product=(function(){let a={},e=Object.create(a);return e[a[0]="WHATSAPP"]=0,e[a[1]="MESSENGER"]=1,e[a[2]="INTEROP"]=2,e[a[3]="INTEROP_MSGR"]=3,e[a[4]="WHATSAPP_LID"]=4,e})(),t.TrafficAnonymization=(function(){let a={},e=Object.create(a);return e[a[0]="OFF"]=0,e[a[1]="STANDARD"]=1,e})(),t.UserAgent=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.platform=A.int32();break}case 2:{c.appVersion=d.proto.ClientPayload.UserAgent.AppVersion.decode(A,A.uint32());break}case 3:{c.mcc=A.string();break}case 4:{c.mnc=A.string();break}case 5:{c.osVersion=A.string();break}case 6:{c.manufacturer=A.string();break}case 7:{c.device=A.string();break}case 8:{c.osBuildNumber=A.string();break}case 9:{c.phoneId=A.string();break}case 10:{c.releaseChannel=A.int32();break}case 11:{c.localeLanguageIso6391=A.string();break}case 12:{c.localeCountryIso31661Alpha2=A.string();break}case 13:{c.deviceBoard=A.string();break}case 14:{c.deviceExpId=A.string();break}case 15:{c.deviceType=A.int32();break}case 16:{c.deviceModelType=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ClientPayload.UserAgent)return A;var r=new d.proto.ClientPayload.UserAgent;switch(A.platform){default:if(typeof A.platform=="number"){r.platform=A.platform;break}break;case"ANDROID":case 0:r.platform=0;break;case"IOS":case 1:r.platform=1;break;case"WINDOWS_PHONE":case 2:r.platform=2;break;case"BLACKBERRY":case 3:r.platform=3;break;case"BLACKBERRYX":case 4:r.platform=4;break;case"S40":case 5:r.platform=5;break;case"S60":case 6:r.platform=6;break;case"PYTHON_CLIENT":case 7:r.platform=7;break;case"TIZEN":case 8:r.platform=8;break;case"ENTERPRISE":case 9:r.platform=9;break;case"SMB_ANDROID":case 10:r.platform=10;break;case"KAIOS":case 11:r.platform=11;break;case"SMB_IOS":case 12:r.platform=12;break;case"WINDOWS":case 13:r.platform=13;break;case"WEB":case 14:r.platform=14;break;case"PORTAL":case 15:r.platform=15;break;case"GREEN_ANDROID":case 16:r.platform=16;break;case"GREEN_IPHONE":case 17:r.platform=17;break;case"BLUE_ANDROID":case 18:r.platform=18;break;case"BLUE_IPHONE":case 19:r.platform=19;break;case"FBLITE_ANDROID":case 20:r.platform=20;break;case"MLITE_ANDROID":case 21:r.platform=21;break;case"IGLITE_ANDROID":case 22:r.platform=22;break;case"PAGE":case 23:r.platform=23;break;case"MACOS":case 24:r.platform=24;break;case"OCULUS_MSG":case 25:r.platform=25;break;case"OCULUS_CALL":case 26:r.platform=26;break;case"MILAN":case 27:r.platform=27;break;case"CAPI":case 28:r.platform=28;break;case"WEAROS":case 29:r.platform=29;break;case"ARDEVICE":case 30:r.platform=30;break;case"VRDEVICE":case 31:r.platform=31;break;case"BLUE_WEB":case 32:r.platform=32;break;case"IPAD":case 33:r.platform=33;break;case"TEST":case 34:r.platform=34;break;case"SMART_GLASSES":case 35:r.platform=35;break;case"BLUE_VR":case 36:r.platform=36;break;case"AR_WRIST":case 37:r.platform=37;break}if(A.appVersion!=null){if(typeof A.appVersion!="object")throw TypeError(".proto.ClientPayload.UserAgent.appVersion: object expected");r.appVersion=d.proto.ClientPayload.UserAgent.AppVersion.fromObject(A.appVersion)}switch(A.mcc!=null&&(r.mcc=String(A.mcc)),A.mnc!=null&&(r.mnc=String(A.mnc)),A.osVersion!=null&&(r.osVersion=String(A.osVersion)),A.manufacturer!=null&&(r.manufacturer=String(A.manufacturer)),A.device!=null&&(r.device=String(A.device)),A.osBuildNumber!=null&&(r.osBuildNumber=String(A.osBuildNumber)),A.phoneId!=null&&(r.phoneId=String(A.phoneId)),A.releaseChannel){default:if(typeof A.releaseChannel=="number"){r.releaseChannel=A.releaseChannel;break}break;case"RELEASE":case 0:r.releaseChannel=0;break;case"BETA":case 1:r.releaseChannel=1;break;case"ALPHA":case 2:r.releaseChannel=2;break;case"DEBUG":case 3:r.releaseChannel=3;break}switch(A.localeLanguageIso6391!=null&&(r.localeLanguageIso6391=String(A.localeLanguageIso6391)),A.localeCountryIso31661Alpha2!=null&&(r.localeCountryIso31661Alpha2=String(A.localeCountryIso31661Alpha2)),A.deviceBoard!=null&&(r.deviceBoard=String(A.deviceBoard)),A.deviceExpId!=null&&(r.deviceExpId=String(A.deviceExpId)),A.deviceType){default:if(typeof A.deviceType=="number"){r.deviceType=A.deviceType;break}break;case"PHONE":case 0:r.deviceType=0;break;case"TABLET":case 1:r.deviceType=1;break;case"DESKTOP":case 2:r.deviceType=2;break;case"WEARABLE":case 3:r.deviceType=3;break;case"VR":case 4:r.deviceType=4;break}return A.deviceModelType!=null&&(r.deviceModelType=String(A.deviceModelType)),r},a.toObject=function(A,r){r||(r={});var s={};return A.platform!=null&&A.hasOwnProperty("platform")&&(s.platform=r.enums===String?d.proto.ClientPayload.UserAgent.Platform[A.platform]===void 0?A.platform:d.proto.ClientPayload.UserAgent.Platform[A.platform]:A.platform,r.oneofs&&(s._platform="platform")),A.appVersion!=null&&A.hasOwnProperty("appVersion")&&(s.appVersion=d.proto.ClientPayload.UserAgent.AppVersion.toObject(A.appVersion,r),r.oneofs&&(s._appVersion="appVersion")),A.mcc!=null&&A.hasOwnProperty("mcc")&&(s.mcc=A.mcc,r.oneofs&&(s._mcc="mcc")),A.mnc!=null&&A.hasOwnProperty("mnc")&&(s.mnc=A.mnc,r.oneofs&&(s._mnc="mnc")),A.osVersion!=null&&A.hasOwnProperty("osVersion")&&(s.osVersion=A.osVersion,r.oneofs&&(s._osVersion="osVersion")),A.manufacturer!=null&&A.hasOwnProperty("manufacturer")&&(s.manufacturer=A.manufacturer,r.oneofs&&(s._manufacturer="manufacturer")),A.device!=null&&A.hasOwnProperty("device")&&(s.device=A.device,r.oneofs&&(s._device="device")),A.osBuildNumber!=null&&A.hasOwnProperty("osBuildNumber")&&(s.osBuildNumber=A.osBuildNumber,r.oneofs&&(s._osBuildNumber="osBuildNumber")),A.phoneId!=null&&A.hasOwnProperty("phoneId")&&(s.phoneId=A.phoneId,r.oneofs&&(s._phoneId="phoneId")),A.releaseChannel!=null&&A.hasOwnProperty("releaseChannel")&&(s.releaseChannel=r.enums===String?d.proto.ClientPayload.UserAgent.ReleaseChannel[A.releaseChannel]===void 0?A.releaseChannel:d.proto.ClientPayload.UserAgent.ReleaseChannel[A.releaseChannel]:A.releaseChannel,r.oneofs&&(s._releaseChannel="releaseChannel")),A.localeLanguageIso6391!=null&&A.hasOwnProperty("localeLanguageIso6391")&&(s.localeLanguageIso6391=A.localeLanguageIso6391,r.oneofs&&(s._localeLanguageIso6391="localeLanguageIso6391")),A.localeCountryIso31661Alpha2!=null&&A.hasOwnProperty("localeCountryIso31661Alpha2")&&(s.localeCountryIso31661Alpha2=A.localeCountryIso31661Alpha2,r.oneofs&&(s._localeCountryIso31661Alpha2="localeCountryIso31661Alpha2")),A.deviceBoard!=null&&A.hasOwnProperty("deviceBoard")&&(s.deviceBoard=A.deviceBoard,r.oneofs&&(s._deviceBoard="deviceBoard")),A.deviceExpId!=null&&A.hasOwnProperty("deviceExpId")&&(s.deviceExpId=A.deviceExpId,r.oneofs&&(s._deviceExpId="deviceExpId")),A.deviceType!=null&&A.hasOwnProperty("deviceType")&&(s.deviceType=r.enums===String?d.proto.ClientPayload.UserAgent.DeviceType[A.deviceType]===void 0?A.deviceType:d.proto.ClientPayload.UserAgent.DeviceType[A.deviceType]:A.deviceType,r.oneofs&&(s._deviceType="deviceType")),A.deviceModelType!=null&&A.hasOwnProperty("deviceModelType")&&(s.deviceModelType=A.deviceModelType,r.oneofs&&(s._deviceModelType="deviceModelType")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.UserAgent"},a.AppVersion=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.primary=s.uint32();break}case 2:{p.secondary=s.uint32();break}case 3:{p.tertiary=s.uint32();break}case 4:{p.quaternary=s.uint32();break}case 5:{p.quinary=s.uint32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.ClientPayload.UserAgent.AppVersion)return s;var g=new d.proto.ClientPayload.UserAgent.AppVersion;return s.primary!=null&&(g.primary=s.primary>>>0),s.secondary!=null&&(g.secondary=s.secondary>>>0),s.tertiary!=null&&(g.tertiary=s.tertiary>>>0),s.quaternary!=null&&(g.quaternary=s.quaternary>>>0),s.quinary!=null&&(g.quinary=s.quinary>>>0),g},i.toObject=function(s,g){g||(g={});var c={};return s.primary!=null&&s.hasOwnProperty("primary")&&(c.primary=s.primary,g.oneofs&&(c._primary="primary")),s.secondary!=null&&s.hasOwnProperty("secondary")&&(c.secondary=s.secondary,g.oneofs&&(c._secondary="secondary")),s.tertiary!=null&&s.hasOwnProperty("tertiary")&&(c.tertiary=s.tertiary,g.oneofs&&(c._tertiary="tertiary")),s.quaternary!=null&&s.hasOwnProperty("quaternary")&&(c.quaternary=s.quaternary,g.oneofs&&(c._quaternary="quaternary")),s.quinary!=null&&s.hasOwnProperty("quinary")&&(c.quinary=s.quinary,g.oneofs&&(c._quinary="quinary")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ClientPayload.UserAgent.AppVersion"},i})(),a.DeviceType=(function(){let i={},A=Object.create(i);return A[i[0]="PHONE"]=0,A[i[1]="TABLET"]=1,A[i[2]="DESKTOP"]=2,A[i[3]="WEARABLE"]=3,A[i[4]="VR"]=4,A})(),a.Platform=(function(){let i={},A=Object.create(i);return A[i[0]="ANDROID"]=0,A[i[1]="IOS"]=1,A[i[2]="WINDOWS_PHONE"]=2,A[i[3]="BLACKBERRY"]=3,A[i[4]="BLACKBERRYX"]=4,A[i[5]="S40"]=5,A[i[6]="S60"]=6,A[i[7]="PYTHON_CLIENT"]=7,A[i[8]="TIZEN"]=8,A[i[9]="ENTERPRISE"]=9,A[i[10]="SMB_ANDROID"]=10,A[i[11]="KAIOS"]=11,A[i[12]="SMB_IOS"]=12,A[i[13]="WINDOWS"]=13,A[i[14]="WEB"]=14,A[i[15]="PORTAL"]=15,A[i[16]="GREEN_ANDROID"]=16,A[i[17]="GREEN_IPHONE"]=17,A[i[18]="BLUE_ANDROID"]=18,A[i[19]="BLUE_IPHONE"]=19,A[i[20]="FBLITE_ANDROID"]=20,A[i[21]="MLITE_ANDROID"]=21,A[i[22]="IGLITE_ANDROID"]=22,A[i[23]="PAGE"]=23,A[i[24]="MACOS"]=24,A[i[25]="OCULUS_MSG"]=25,A[i[26]="OCULUS_CALL"]=26,A[i[27]="MILAN"]=27,A[i[28]="CAPI"]=28,A[i[29]="WEAROS"]=29,A[i[30]="ARDEVICE"]=30,A[i[31]="VRDEVICE"]=31,A[i[32]="BLUE_WEB"]=32,A[i[33]="IPAD"]=33,A[i[34]="TEST"]=34,A[i[35]="SMART_GLASSES"]=35,A[i[36]="BLUE_VR"]=36,A[i[37]="AR_WRIST"]=37,A})(),a.ReleaseChannel=(function(){let i={},A=Object.create(i);return A[i[0]="RELEASE"]=0,A[i[1]="BETA"]=1,A[i[2]="ALPHA"]=2,A[i[3]="DEBUG"]=3,A})(),a})(),t.WebInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.refToken=A.string();break}case 2:{c.version=A.string();break}case 3:{c.webdPayload=d.proto.ClientPayload.WebInfo.WebdPayload.decode(A,A.uint32());break}case 4:{c.webSubPlatform=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ClientPayload.WebInfo)return A;var r=new d.proto.ClientPayload.WebInfo;if(A.refToken!=null&&(r.refToken=String(A.refToken)),A.version!=null&&(r.version=String(A.version)),A.webdPayload!=null){if(typeof A.webdPayload!="object")throw TypeError(".proto.ClientPayload.WebInfo.webdPayload: object expected");r.webdPayload=d.proto.ClientPayload.WebInfo.WebdPayload.fromObject(A.webdPayload)}switch(A.webSubPlatform){default:if(typeof A.webSubPlatform=="number"){r.webSubPlatform=A.webSubPlatform;break}break;case"WEB_BROWSER":case 0:r.webSubPlatform=0;break;case"APP_STORE":case 1:r.webSubPlatform=1;break;case"WIN_STORE":case 2:r.webSubPlatform=2;break;case"DARWIN":case 3:r.webSubPlatform=3;break;case"WIN32":case 4:r.webSubPlatform=4;break;case"WIN_HYBRID":case 5:r.webSubPlatform=5;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.refToken!=null&&A.hasOwnProperty("refToken")&&(s.refToken=A.refToken,r.oneofs&&(s._refToken="refToken")),A.version!=null&&A.hasOwnProperty("version")&&(s.version=A.version,r.oneofs&&(s._version="version")),A.webdPayload!=null&&A.hasOwnProperty("webdPayload")&&(s.webdPayload=d.proto.ClientPayload.WebInfo.WebdPayload.toObject(A.webdPayload,r),r.oneofs&&(s._webdPayload="webdPayload")),A.webSubPlatform!=null&&A.hasOwnProperty("webSubPlatform")&&(s.webSubPlatform=r.enums===String?d.proto.ClientPayload.WebInfo.WebSubPlatform[A.webSubPlatform]===void 0?A.webSubPlatform:d.proto.ClientPayload.WebInfo.WebSubPlatform[A.webSubPlatform]:A.webSubPlatform,r.oneofs&&(s._webSubPlatform="webSubPlatform")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.WebInfo"},a.WebSubPlatform=(function(){let i={},A=Object.create(i);return A[i[0]="WEB_BROWSER"]=0,A[i[1]="APP_STORE"]=1,A[i[2]="WIN_STORE"]=2,A[i[3]="DARWIN"]=3,A[i[4]="WIN32"]=4,A[i[5]="WIN_HYBRID"]=5,A})(),a.WebdPayload=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.usesParticipantInKey=s.bool();break}case 2:{p.supportsStarredMessages=s.bool();break}case 3:{p.supportsDocumentMessages=s.bool();break}case 4:{p.supportsUrlMessages=s.bool();break}case 5:{p.supportsMediaRetry=s.bool();break}case 6:{p.supportsE2EImage=s.bool();break}case 7:{p.supportsE2EVideo=s.bool();break}case 8:{p.supportsE2EAudio=s.bool();break}case 9:{p.supportsE2EDocument=s.bool();break}case 10:{p.documentTypes=s.string();break}case 11:{p.features=s.bytes();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.ClientPayload.WebInfo.WebdPayload)return s;var g=new d.proto.ClientPayload.WebInfo.WebdPayload;return s.usesParticipantInKey!=null&&(g.usesParticipantInKey=!!s.usesParticipantInKey),s.supportsStarredMessages!=null&&(g.supportsStarredMessages=!!s.supportsStarredMessages),s.supportsDocumentMessages!=null&&(g.supportsDocumentMessages=!!s.supportsDocumentMessages),s.supportsUrlMessages!=null&&(g.supportsUrlMessages=!!s.supportsUrlMessages),s.supportsMediaRetry!=null&&(g.supportsMediaRetry=!!s.supportsMediaRetry),s.supportsE2EImage!=null&&(g.supportsE2EImage=!!s.supportsE2EImage),s.supportsE2EVideo!=null&&(g.supportsE2EVideo=!!s.supportsE2EVideo),s.supportsE2EAudio!=null&&(g.supportsE2EAudio=!!s.supportsE2EAudio),s.supportsE2EDocument!=null&&(g.supportsE2EDocument=!!s.supportsE2EDocument),s.documentTypes!=null&&(g.documentTypes=String(s.documentTypes)),s.features!=null&&(typeof s.features=="string"?l.base64.decode(s.features,g.features=l.newBuffer(l.base64.length(s.features)),0):s.features.length>=0&&(g.features=s.features)),g},i.toObject=function(s,g){g||(g={});var c={};return s.usesParticipantInKey!=null&&s.hasOwnProperty("usesParticipantInKey")&&(c.usesParticipantInKey=s.usesParticipantInKey,g.oneofs&&(c._usesParticipantInKey="usesParticipantInKey")),s.supportsStarredMessages!=null&&s.hasOwnProperty("supportsStarredMessages")&&(c.supportsStarredMessages=s.supportsStarredMessages,g.oneofs&&(c._supportsStarredMessages="supportsStarredMessages")),s.supportsDocumentMessages!=null&&s.hasOwnProperty("supportsDocumentMessages")&&(c.supportsDocumentMessages=s.supportsDocumentMessages,g.oneofs&&(c._supportsDocumentMessages="supportsDocumentMessages")),s.supportsUrlMessages!=null&&s.hasOwnProperty("supportsUrlMessages")&&(c.supportsUrlMessages=s.supportsUrlMessages,g.oneofs&&(c._supportsUrlMessages="supportsUrlMessages")),s.supportsMediaRetry!=null&&s.hasOwnProperty("supportsMediaRetry")&&(c.supportsMediaRetry=s.supportsMediaRetry,g.oneofs&&(c._supportsMediaRetry="supportsMediaRetry")),s.supportsE2EImage!=null&&s.hasOwnProperty("supportsE2EImage")&&(c.supportsE2EImage=s.supportsE2EImage,g.oneofs&&(c._supportsE2EImage="supportsE2EImage")),s.supportsE2EVideo!=null&&s.hasOwnProperty("supportsE2EVideo")&&(c.supportsE2EVideo=s.supportsE2EVideo,g.oneofs&&(c._supportsE2EVideo="supportsE2EVideo")),s.supportsE2EAudio!=null&&s.hasOwnProperty("supportsE2EAudio")&&(c.supportsE2EAudio=s.supportsE2EAudio,g.oneofs&&(c._supportsE2EAudio="supportsE2EAudio")),s.supportsE2EDocument!=null&&s.hasOwnProperty("supportsE2EDocument")&&(c.supportsE2EDocument=s.supportsE2EDocument,g.oneofs&&(c._supportsE2EDocument="supportsE2EDocument")),s.documentTypes!=null&&s.hasOwnProperty("documentTypes")&&(c.documentTypes=s.documentTypes,g.oneofs&&(c._documentTypes="documentTypes")),s.features!=null&&s.hasOwnProperty("features")&&(c.features=g.bytes===String?l.base64.encode(s.features,0,s.features.length):g.bytes===Array?Array.prototype.slice.call(s.features):s.features,g.oneofs&&(c._features="features")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ClientPayload.WebInfo.WebdPayload"},i})(),a})(),t})(),n.CollectionName=(function(){let t={},o=Object.create(t);return o[t[0]="COLLECTION_NAME_UNKNOWN"]=0,o[t[1]="REGULAR"]=1,o[t[2]="REGULAR_LOW"]=2,o[t[3]="REGULAR_HIGH"]=3,o[t[4]="CRITICAL_BLOCK"]=4,o[t[5]="CRITICAL_UNBLOCK_LOW"]=5,o})(),n.CommentMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.commentParentKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.replyCount=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.CommentMetadata)return e;var i=new d.proto.CommentMetadata;if(e.commentParentKey!=null){if(typeof e.commentParentKey!="object")throw TypeError(".proto.CommentMetadata.commentParentKey: object expected");i.commentParentKey=d.proto.MessageKey.fromObject(e.commentParentKey)}return e.replyCount!=null&&(i.replyCount=e.replyCount>>>0),i},t.toObject=function(e,i){i||(i={});var A={};return e.commentParentKey!=null&&e.hasOwnProperty("commentParentKey")&&(A.commentParentKey=d.proto.MessageKey.toObject(e.commentParentKey,i),i.oneofs&&(A._commentParentKey="commentParentKey")),e.replyCount!=null&&e.hasOwnProperty("replyCount")&&(A.replyCount=e.replyCount,i.oneofs&&(A._replyCount="replyCount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CommentMetadata"},t})(),n.CompanionCommitment=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.hash=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.CompanionCommitment)return e;var i=new d.proto.CompanionCommitment;return e.hash!=null&&(typeof e.hash=="string"?l.base64.decode(e.hash,i.hash=l.newBuffer(l.base64.length(e.hash)),0):e.hash.length>=0&&(i.hash=e.hash)),i},t.toObject=function(e,i){i||(i={});var A={};return e.hash!=null&&e.hasOwnProperty("hash")&&(A.hash=i.bytes===String?l.base64.encode(e.hash,0,e.hash.length):i.bytes===Array?Array.prototype.slice.call(e.hash):e.hash,i.oneofs&&(A._hash="hash")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CompanionCommitment"},t})(),n.CompanionEphemeralIdentity=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.deviceType=e.int32();break}case 3:{s.ref=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.CompanionEphemeralIdentity)return e;var i=new d.proto.CompanionEphemeralIdentity;switch(e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,i.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(i.publicKey=e.publicKey)),e.deviceType){default:if(typeof e.deviceType=="number"){i.deviceType=e.deviceType;break}break;case"UNKNOWN":case 0:i.deviceType=0;break;case"CHROME":case 1:i.deviceType=1;break;case"FIREFOX":case 2:i.deviceType=2;break;case"IE":case 3:i.deviceType=3;break;case"OPERA":case 4:i.deviceType=4;break;case"SAFARI":case 5:i.deviceType=5;break;case"EDGE":case 6:i.deviceType=6;break;case"DESKTOP":case 7:i.deviceType=7;break;case"IPAD":case 8:i.deviceType=8;break;case"ANDROID_TABLET":case 9:i.deviceType=9;break;case"OHANA":case 10:i.deviceType=10;break;case"ALOHA":case 11:i.deviceType=11;break;case"CATALINA":case 12:i.deviceType=12;break;case"TCL_TV":case 13:i.deviceType=13;break;case"IOS_PHONE":case 14:i.deviceType=14;break;case"IOS_CATALYST":case 15:i.deviceType=15;break;case"ANDROID_PHONE":case 16:i.deviceType=16;break;case"ANDROID_AMBIGUOUS":case 17:i.deviceType=17;break;case"WEAR_OS":case 18:i.deviceType=18;break;case"AR_WRIST":case 19:i.deviceType=19;break;case"AR_DEVICE":case 20:i.deviceType=20;break;case"UWP":case 21:i.deviceType=21;break;case"VR":case 22:i.deviceType=22;break;case"CLOUD_API":case 23:i.deviceType=23;break;case"SMARTGLASSES":case 24:i.deviceType=24;break}return e.ref!=null&&(i.ref=String(e.ref)),i},t.toObject=function(e,i){i||(i={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=i.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):i.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,i.oneofs&&(A._publicKey="publicKey")),e.deviceType!=null&&e.hasOwnProperty("deviceType")&&(A.deviceType=i.enums===String?d.proto.DeviceProps.PlatformType[e.deviceType]===void 0?e.deviceType:d.proto.DeviceProps.PlatformType[e.deviceType]:e.deviceType,i.oneofs&&(A._deviceType="deviceType")),e.ref!=null&&e.hasOwnProperty("ref")&&(A.ref=e.ref,i.oneofs&&(A._ref="ref")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CompanionEphemeralIdentity"},t})(),n.Config=(function(){function t(a){if(this.field={},a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.field===l.emptyObject&&(s.field={});var p=e.uint32()+e.pos;for(g=0,c=null;e.pos>>3){case 1:g=e.uint32();break;case 2:c=d.proto.Field.decode(e,e.uint32());break;default:e.skipType(B&7);break}}s.field[g]=c;break}case 2:{s.version=e.uint32();break}default:e.skipType(I&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Config)return e;var i=new d.proto.Config;if(e.field){if(typeof e.field!="object")throw TypeError(".proto.Config.field: object expected");i.field={};for(var A=Object.keys(e.field),r=0;r>>0),i},t.toObject=function(e,i){i||(i={});var A={};(i.objects||i.defaults)&&(A.field={});var r;if(e.field&&(r=Object.keys(e.field)).length){A.field={};for(var s=0;s>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.participant=e.string();break}case 3:{s.quotedMessage=d.proto.Message.decode(e,e.uint32());break}case 4:{s.remoteJid=e.string();break}case 15:{s.mentionedJid&&s.mentionedJid.length||(s.mentionedJid=[]),s.mentionedJid.push(e.string());break}case 18:{s.conversionSource=e.string();break}case 19:{s.conversionData=e.bytes();break}case 20:{s.conversionDelaySeconds=e.uint32();break}case 21:{s.forwardingScore=e.uint32();break}case 22:{s.isForwarded=e.bool();break}case 23:{s.quotedAd=d.proto.ContextInfo.AdReplyInfo.decode(e,e.uint32());break}case 24:{s.placeholderKey=d.proto.MessageKey.decode(e,e.uint32());break}case 25:{s.expiration=e.uint32();break}case 26:{s.ephemeralSettingTimestamp=e.int64();break}case 27:{s.ephemeralSharedSecret=e.bytes();break}case 28:{s.externalAdReply=d.proto.ContextInfo.ExternalAdReplyInfo.decode(e,e.uint32());break}case 29:{s.entryPointConversionSource=e.string();break}case 30:{s.entryPointConversionApp=e.string();break}case 31:{s.entryPointConversionDelaySeconds=e.uint32();break}case 32:{s.disappearingMode=d.proto.DisappearingMode.decode(e,e.uint32());break}case 33:{s.actionLink=d.proto.ActionLink.decode(e,e.uint32());break}case 34:{s.groupSubject=e.string();break}case 35:{s.parentGroupJid=e.string();break}case 37:{s.trustBannerType=e.string();break}case 38:{s.trustBannerAction=e.uint32();break}case 39:{s.isSampled=e.bool();break}case 40:{s.groupMentions&&s.groupMentions.length||(s.groupMentions=[]),s.groupMentions.push(d.proto.GroupMention.decode(e,e.uint32()));break}case 41:{s.utm=d.proto.ContextInfo.UTMInfo.decode(e,e.uint32());break}case 43:{s.forwardedNewsletterMessageInfo=d.proto.ContextInfo.ForwardedNewsletterMessageInfo.decode(e,e.uint32());break}case 44:{s.businessMessageForwardInfo=d.proto.ContextInfo.BusinessMessageForwardInfo.decode(e,e.uint32());break}case 45:{s.smbClientCampaignId=e.string();break}case 46:{s.smbServerCampaignId=e.string();break}case 47:{s.dataSharingContext=d.proto.ContextInfo.DataSharingContext.decode(e,e.uint32());break}case 48:{s.alwaysShowAdAttribution=e.bool();break}case 49:{s.featureEligibilities=d.proto.ContextInfo.FeatureEligibilities.decode(e,e.uint32());break}case 50:{s.entryPointConversionExternalSource=e.string();break}case 51:{s.entryPointConversionExternalMedium=e.string();break}case 54:{s.ctwaSignals=e.string();break}case 55:{s.ctwaPayload=e.bytes();break}case 56:{s.forwardedAiBotMessageInfo=d.proto.ForwardedAIBotMessageInfo.decode(e,e.uint32());break}case 57:{s.statusAttributionType=e.int32();break}case 58:{s.urlTrackingMap=d.proto.UrlTrackingMap.decode(e,e.uint32());break}case 59:{s.pairedMediaType=e.int32();break}case 60:{s.rankingVersion=e.uint32();break}case 62:{s.memberLabel=d.proto.MemberLabel.decode(e,e.uint32());break}case 63:{s.isQuestion=e.bool();break}case 64:{s.statusSourceType=e.int32();break}case 65:{s.statusAttributions&&s.statusAttributions.length||(s.statusAttributions=[]),s.statusAttributions.push(d.proto.StatusAttribution.decode(e,e.uint32()));break}case 66:{s.isGroupStatus=e.bool();break}case 67:{s.forwardOrigin=e.int32();break}case 68:{s.questionReplyQuotedMessage=d.proto.ContextInfo.QuestionReplyQuotedMessage.decode(e,e.uint32());break}case 69:{s.statusAudienceMetadata=d.proto.ContextInfo.StatusAudienceMetadata.decode(e,e.uint32());break}case 70:{s.nonJidMentions=e.uint32();break}case 71:{s.quotedType=e.int32();break}case 72:{s.botMessageSharingInfo=d.proto.BotMessageSharingInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ContextInfo)return e;var i=new d.proto.ContextInfo;if(e.stanzaId!=null&&(i.stanzaId=String(e.stanzaId)),e.participant!=null&&(i.participant=String(e.participant)),e.quotedMessage!=null){if(typeof e.quotedMessage!="object")throw TypeError(".proto.ContextInfo.quotedMessage: object expected");i.quotedMessage=d.proto.Message.fromObject(e.quotedMessage)}if(e.remoteJid!=null&&(i.remoteJid=String(e.remoteJid)),e.mentionedJid){if(!Array.isArray(e.mentionedJid))throw TypeError(".proto.ContextInfo.mentionedJid: array expected");i.mentionedJid=[];for(var A=0;A=0&&(i.conversionData=e.conversionData)),e.conversionDelaySeconds!=null&&(i.conversionDelaySeconds=e.conversionDelaySeconds>>>0),e.forwardingScore!=null&&(i.forwardingScore=e.forwardingScore>>>0),e.isForwarded!=null&&(i.isForwarded=!!e.isForwarded),e.quotedAd!=null){if(typeof e.quotedAd!="object")throw TypeError(".proto.ContextInfo.quotedAd: object expected");i.quotedAd=d.proto.ContextInfo.AdReplyInfo.fromObject(e.quotedAd)}if(e.placeholderKey!=null){if(typeof e.placeholderKey!="object")throw TypeError(".proto.ContextInfo.placeholderKey: object expected");i.placeholderKey=d.proto.MessageKey.fromObject(e.placeholderKey)}if(e.expiration!=null&&(i.expiration=e.expiration>>>0),e.ephemeralSettingTimestamp!=null&&(l.Long?(i.ephemeralSettingTimestamp=l.Long.fromValue(e.ephemeralSettingTimestamp)).unsigned=!1:typeof e.ephemeralSettingTimestamp=="string"?i.ephemeralSettingTimestamp=parseInt(e.ephemeralSettingTimestamp,10):typeof e.ephemeralSettingTimestamp=="number"?i.ephemeralSettingTimestamp=e.ephemeralSettingTimestamp:typeof e.ephemeralSettingTimestamp=="object"&&(i.ephemeralSettingTimestamp=new l.LongBits(e.ephemeralSettingTimestamp.low>>>0,e.ephemeralSettingTimestamp.high>>>0).toNumber())),e.ephemeralSharedSecret!=null&&(typeof e.ephemeralSharedSecret=="string"?l.base64.decode(e.ephemeralSharedSecret,i.ephemeralSharedSecret=l.newBuffer(l.base64.length(e.ephemeralSharedSecret)),0):e.ephemeralSharedSecret.length>=0&&(i.ephemeralSharedSecret=e.ephemeralSharedSecret)),e.externalAdReply!=null){if(typeof e.externalAdReply!="object")throw TypeError(".proto.ContextInfo.externalAdReply: object expected");i.externalAdReply=d.proto.ContextInfo.ExternalAdReplyInfo.fromObject(e.externalAdReply)}if(e.entryPointConversionSource!=null&&(i.entryPointConversionSource=String(e.entryPointConversionSource)),e.entryPointConversionApp!=null&&(i.entryPointConversionApp=String(e.entryPointConversionApp)),e.entryPointConversionDelaySeconds!=null&&(i.entryPointConversionDelaySeconds=e.entryPointConversionDelaySeconds>>>0),e.disappearingMode!=null){if(typeof e.disappearingMode!="object")throw TypeError(".proto.ContextInfo.disappearingMode: object expected");i.disappearingMode=d.proto.DisappearingMode.fromObject(e.disappearingMode)}if(e.actionLink!=null){if(typeof e.actionLink!="object")throw TypeError(".proto.ContextInfo.actionLink: object expected");i.actionLink=d.proto.ActionLink.fromObject(e.actionLink)}if(e.groupSubject!=null&&(i.groupSubject=String(e.groupSubject)),e.parentGroupJid!=null&&(i.parentGroupJid=String(e.parentGroupJid)),e.trustBannerType!=null&&(i.trustBannerType=String(e.trustBannerType)),e.trustBannerAction!=null&&(i.trustBannerAction=e.trustBannerAction>>>0),e.isSampled!=null&&(i.isSampled=!!e.isSampled),e.groupMentions){if(!Array.isArray(e.groupMentions))throw TypeError(".proto.ContextInfo.groupMentions: array expected");i.groupMentions=[];for(var A=0;A=0&&(i.ctwaPayload=e.ctwaPayload)),e.forwardedAiBotMessageInfo!=null){if(typeof e.forwardedAiBotMessageInfo!="object")throw TypeError(".proto.ContextInfo.forwardedAiBotMessageInfo: object expected");i.forwardedAiBotMessageInfo=d.proto.ForwardedAIBotMessageInfo.fromObject(e.forwardedAiBotMessageInfo)}switch(e.statusAttributionType){default:if(typeof e.statusAttributionType=="number"){i.statusAttributionType=e.statusAttributionType;break}break;case"NONE":case 0:i.statusAttributionType=0;break;case"RESHARED_FROM_MENTION":case 1:i.statusAttributionType=1;break;case"RESHARED_FROM_POST":case 2:i.statusAttributionType=2;break;case"RESHARED_FROM_POST_MANY_TIMES":case 3:i.statusAttributionType=3;break;case"FORWARDED_FROM_STATUS":case 4:i.statusAttributionType=4;break}if(e.urlTrackingMap!=null){if(typeof e.urlTrackingMap!="object")throw TypeError(".proto.ContextInfo.urlTrackingMap: object expected");i.urlTrackingMap=d.proto.UrlTrackingMap.fromObject(e.urlTrackingMap)}switch(e.pairedMediaType){default:if(typeof e.pairedMediaType=="number"){i.pairedMediaType=e.pairedMediaType;break}break;case"NOT_PAIRED_MEDIA":case 0:i.pairedMediaType=0;break;case"SD_VIDEO_PARENT":case 1:i.pairedMediaType=1;break;case"HD_VIDEO_CHILD":case 2:i.pairedMediaType=2;break;case"SD_IMAGE_PARENT":case 3:i.pairedMediaType=3;break;case"HD_IMAGE_CHILD":case 4:i.pairedMediaType=4;break;case"MOTION_PHOTO_PARENT":case 5:i.pairedMediaType=5;break;case"MOTION_PHOTO_CHILD":case 6:i.pairedMediaType=6;break;case"HEVC_VIDEO_PARENT":case 7:i.pairedMediaType=7;break;case"HEVC_VIDEO_CHILD":case 8:i.pairedMediaType=8;break}if(e.rankingVersion!=null&&(i.rankingVersion=e.rankingVersion>>>0),e.memberLabel!=null){if(typeof e.memberLabel!="object")throw TypeError(".proto.ContextInfo.memberLabel: object expected");i.memberLabel=d.proto.MemberLabel.fromObject(e.memberLabel)}switch(e.isQuestion!=null&&(i.isQuestion=!!e.isQuestion),e.statusSourceType){default:if(typeof e.statusSourceType=="number"){i.statusSourceType=e.statusSourceType;break}break;case"IMAGE":case 0:i.statusSourceType=0;break;case"VIDEO":case 1:i.statusSourceType=1;break;case"GIF":case 2:i.statusSourceType=2;break;case"AUDIO":case 3:i.statusSourceType=3;break;case"TEXT":case 4:i.statusSourceType=4;break;case"MUSIC_STANDALONE":case 5:i.statusSourceType=5;break}if(e.statusAttributions){if(!Array.isArray(e.statusAttributions))throw TypeError(".proto.ContextInfo.statusAttributions: array expected");i.statusAttributions=[];for(var A=0;A>>0),e.quotedType){default:if(typeof e.quotedType=="number"){i.quotedType=e.quotedType;break}break;case"EXPLICIT":case 0:i.quotedType=0;break;case"AUTO":case 1:i.quotedType=1;break}if(e.botMessageSharingInfo!=null){if(typeof e.botMessageSharingInfo!="object")throw TypeError(".proto.ContextInfo.botMessageSharingInfo: object expected");i.botMessageSharingInfo=d.proto.BotMessageSharingInfo.fromObject(e.botMessageSharingInfo)}return i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.mentionedJid=[],A.groupMentions=[],A.statusAttributions=[]),e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,i.oneofs&&(A._stanzaId="stanzaId")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,i.oneofs&&(A._participant="participant")),e.quotedMessage!=null&&e.hasOwnProperty("quotedMessage")&&(A.quotedMessage=d.proto.Message.toObject(e.quotedMessage,i),i.oneofs&&(A._quotedMessage="quotedMessage")),e.remoteJid!=null&&e.hasOwnProperty("remoteJid")&&(A.remoteJid=e.remoteJid,i.oneofs&&(A._remoteJid="remoteJid")),e.mentionedJid&&e.mentionedJid.length){A.mentionedJid=[];for(var r=0;r>>3){case 1:{c.advertiserName=A.string();break}case 2:{c.mediaType=A.int32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.caption=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.AdReplyInfo)return A;var r=new d.proto.ContextInfo.AdReplyInfo;switch(A.advertiserName!=null&&(r.advertiserName=String(A.advertiserName)),A.mediaType){default:if(typeof A.mediaType=="number"){r.mediaType=A.mediaType;break}break;case"NONE":case 0:r.mediaType=0;break;case"IMAGE":case 1:r.mediaType=1;break;case"VIDEO":case 2:r.mediaType=2;break}return A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),r},a.toObject=function(A,r){r||(r={});var s={};return A.advertiserName!=null&&A.hasOwnProperty("advertiserName")&&(s.advertiserName=A.advertiserName,r.oneofs&&(s._advertiserName="advertiserName")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=r.enums===String?d.proto.ContextInfo.AdReplyInfo.MediaType[A.mediaType]===void 0?A.mediaType:d.proto.ContextInfo.AdReplyInfo.MediaType[A.mediaType]:A.mediaType,r.oneofs&&(s._mediaType="mediaType")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.AdReplyInfo"},a.MediaType=(function(){let i={},A=Object.create(i);return A[i[0]="NONE"]=0,A[i[1]="IMAGE"]=1,A[i[2]="VIDEO"]=2,A})(),a})(),t.BusinessMessageForwardInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.businessOwnerJid=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.BusinessMessageForwardInfo)return A;var r=new d.proto.ContextInfo.BusinessMessageForwardInfo;return A.businessOwnerJid!=null&&(r.businessOwnerJid=String(A.businessOwnerJid)),r},a.toObject=function(A,r){r||(r={});var s={};return A.businessOwnerJid!=null&&A.hasOwnProperty("businessOwnerJid")&&(s.businessOwnerJid=A.businessOwnerJid,r.oneofs&&(s._businessOwnerJid="businessOwnerJid")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.BusinessMessageForwardInfo"},a})(),t.DataSharingContext=(function(){function a(i){if(this.parameters=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.showMmDisclosure=A.bool();break}case 2:{c.encryptedSignalTokenConsented=A.string();break}case 3:{c.parameters&&c.parameters.length||(c.parameters=[]),c.parameters.push(d.proto.ContextInfo.DataSharingContext.Parameters.decode(A,A.uint32()));break}case 4:{c.dataSharingFlags=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.DataSharingContext)return A;var r=new d.proto.ContextInfo.DataSharingContext;if(A.showMmDisclosure!=null&&(r.showMmDisclosure=!!A.showMmDisclosure),A.encryptedSignalTokenConsented!=null&&(r.encryptedSignalTokenConsented=String(A.encryptedSignalTokenConsented)),A.parameters){if(!Array.isArray(A.parameters))throw TypeError(".proto.ContextInfo.DataSharingContext.parameters: array expected");r.parameters=[];for(var s=0;s>>3){case 1:{p.key=s.string();break}case 2:{p.stringData=s.string();break}case 3:{p.intData=s.int64();break}case 4:{p.floatData=s.float();break}case 5:{p.contents=d.proto.ContextInfo.DataSharingContext.Parameters.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.ContextInfo.DataSharingContext.Parameters)return s;var g=new d.proto.ContextInfo.DataSharingContext.Parameters;if(s.key!=null&&(g.key=String(s.key)),s.stringData!=null&&(g.stringData=String(s.stringData)),s.intData!=null&&(l.Long?(g.intData=l.Long.fromValue(s.intData)).unsigned=!1:typeof s.intData=="string"?g.intData=parseInt(s.intData,10):typeof s.intData=="number"?g.intData=s.intData:typeof s.intData=="object"&&(g.intData=new l.LongBits(s.intData.low>>>0,s.intData.high>>>0).toNumber())),s.floatData!=null&&(g.floatData=Number(s.floatData)),s.contents!=null){if(typeof s.contents!="object")throw TypeError(".proto.ContextInfo.DataSharingContext.Parameters.contents: object expected");g.contents=d.proto.ContextInfo.DataSharingContext.Parameters.fromObject(s.contents)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.key!=null&&s.hasOwnProperty("key")&&(c.key=s.key,g.oneofs&&(c._key="key")),s.stringData!=null&&s.hasOwnProperty("stringData")&&(c.stringData=s.stringData,g.oneofs&&(c._stringData="stringData")),s.intData!=null&&s.hasOwnProperty("intData")&&(typeof s.intData=="number"?c.intData=g.longs===String?String(s.intData):s.intData:c.intData=g.longs===String?ge(s.intData):g.longs===Number?ce(s.intData):s.intData,g.oneofs&&(c._intData="intData")),s.floatData!=null&&s.hasOwnProperty("floatData")&&(c.floatData=g.json&&!isFinite(s.floatData)?String(s.floatData):s.floatData,g.oneofs&&(c._floatData="floatData")),s.contents!=null&&s.hasOwnProperty("contents")&&(c.contents=d.proto.ContextInfo.DataSharingContext.Parameters.toObject(s.contents,g),g.oneofs&&(c._contents="contents")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ContextInfo.DataSharingContext.Parameters"},i})(),a})(),t.ExternalAdReplyInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.title=A.string();break}case 2:{c.body=A.string();break}case 3:{c.mediaType=A.int32();break}case 4:{c.thumbnailUrl=A.string();break}case 5:{c.mediaUrl=A.string();break}case 6:{c.thumbnail=A.bytes();break}case 7:{c.sourceType=A.string();break}case 8:{c.sourceId=A.string();break}case 9:{c.sourceUrl=A.string();break}case 10:{c.containsAutoReply=A.bool();break}case 11:{c.renderLargerThumbnail=A.bool();break}case 12:{c.showAdAttribution=A.bool();break}case 13:{c.ctwaClid=A.string();break}case 14:{c.ref=A.string();break}case 15:{c.clickToWhatsappCall=A.bool();break}case 16:{c.adContextPreviewDismissed=A.bool();break}case 17:{c.sourceApp=A.string();break}case 18:{c.automatedGreetingMessageShown=A.bool();break}case 19:{c.greetingMessageBody=A.string();break}case 20:{c.ctaPayload=A.string();break}case 21:{c.disableNudge=A.bool();break}case 22:{c.originalImageUrl=A.string();break}case 23:{c.automatedGreetingMessageCtaType=A.string();break}case 24:{c.wtwaAdFormat=A.bool();break}case 25:{c.adType=A.int32();break}case 26:{c.wtwaWebsiteUrl=A.string();break}case 27:{c.adPreviewUrl=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.ExternalAdReplyInfo)return A;var r=new d.proto.ContextInfo.ExternalAdReplyInfo;switch(A.title!=null&&(r.title=String(A.title)),A.body!=null&&(r.body=String(A.body)),A.mediaType){default:if(typeof A.mediaType=="number"){r.mediaType=A.mediaType;break}break;case"NONE":case 0:r.mediaType=0;break;case"IMAGE":case 1:r.mediaType=1;break;case"VIDEO":case 2:r.mediaType=2;break}switch(A.thumbnailUrl!=null&&(r.thumbnailUrl=String(A.thumbnailUrl)),A.mediaUrl!=null&&(r.mediaUrl=String(A.mediaUrl)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,r.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(r.thumbnail=A.thumbnail)),A.sourceType!=null&&(r.sourceType=String(A.sourceType)),A.sourceId!=null&&(r.sourceId=String(A.sourceId)),A.sourceUrl!=null&&(r.sourceUrl=String(A.sourceUrl)),A.containsAutoReply!=null&&(r.containsAutoReply=!!A.containsAutoReply),A.renderLargerThumbnail!=null&&(r.renderLargerThumbnail=!!A.renderLargerThumbnail),A.showAdAttribution!=null&&(r.showAdAttribution=!!A.showAdAttribution),A.ctwaClid!=null&&(r.ctwaClid=String(A.ctwaClid)),A.ref!=null&&(r.ref=String(A.ref)),A.clickToWhatsappCall!=null&&(r.clickToWhatsappCall=!!A.clickToWhatsappCall),A.adContextPreviewDismissed!=null&&(r.adContextPreviewDismissed=!!A.adContextPreviewDismissed),A.sourceApp!=null&&(r.sourceApp=String(A.sourceApp)),A.automatedGreetingMessageShown!=null&&(r.automatedGreetingMessageShown=!!A.automatedGreetingMessageShown),A.greetingMessageBody!=null&&(r.greetingMessageBody=String(A.greetingMessageBody)),A.ctaPayload!=null&&(r.ctaPayload=String(A.ctaPayload)),A.disableNudge!=null&&(r.disableNudge=!!A.disableNudge),A.originalImageUrl!=null&&(r.originalImageUrl=String(A.originalImageUrl)),A.automatedGreetingMessageCtaType!=null&&(r.automatedGreetingMessageCtaType=String(A.automatedGreetingMessageCtaType)),A.wtwaAdFormat!=null&&(r.wtwaAdFormat=!!A.wtwaAdFormat),A.adType){default:if(typeof A.adType=="number"){r.adType=A.adType;break}break;case"CTWA":case 0:r.adType=0;break;case"CAWC":case 1:r.adType=1;break}return A.wtwaWebsiteUrl!=null&&(r.wtwaWebsiteUrl=String(A.wtwaWebsiteUrl)),A.adPreviewUrl!=null&&(r.adPreviewUrl=String(A.adPreviewUrl)),r},a.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,r.oneofs&&(s._body="body")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=r.enums===String?d.proto.ContextInfo.ExternalAdReplyInfo.MediaType[A.mediaType]===void 0?A.mediaType:d.proto.ContextInfo.ExternalAdReplyInfo.MediaType[A.mediaType]:A.mediaType,r.oneofs&&(s._mediaType="mediaType")),A.thumbnailUrl!=null&&A.hasOwnProperty("thumbnailUrl")&&(s.thumbnailUrl=A.thumbnailUrl,r.oneofs&&(s._thumbnailUrl="thumbnailUrl")),A.mediaUrl!=null&&A.hasOwnProperty("mediaUrl")&&(s.mediaUrl=A.mediaUrl,r.oneofs&&(s._mediaUrl="mediaUrl")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=r.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,r.oneofs&&(s._thumbnail="thumbnail")),A.sourceType!=null&&A.hasOwnProperty("sourceType")&&(s.sourceType=A.sourceType,r.oneofs&&(s._sourceType="sourceType")),A.sourceId!=null&&A.hasOwnProperty("sourceId")&&(s.sourceId=A.sourceId,r.oneofs&&(s._sourceId="sourceId")),A.sourceUrl!=null&&A.hasOwnProperty("sourceUrl")&&(s.sourceUrl=A.sourceUrl,r.oneofs&&(s._sourceUrl="sourceUrl")),A.containsAutoReply!=null&&A.hasOwnProperty("containsAutoReply")&&(s.containsAutoReply=A.containsAutoReply,r.oneofs&&(s._containsAutoReply="containsAutoReply")),A.renderLargerThumbnail!=null&&A.hasOwnProperty("renderLargerThumbnail")&&(s.renderLargerThumbnail=A.renderLargerThumbnail,r.oneofs&&(s._renderLargerThumbnail="renderLargerThumbnail")),A.showAdAttribution!=null&&A.hasOwnProperty("showAdAttribution")&&(s.showAdAttribution=A.showAdAttribution,r.oneofs&&(s._showAdAttribution="showAdAttribution")),A.ctwaClid!=null&&A.hasOwnProperty("ctwaClid")&&(s.ctwaClid=A.ctwaClid,r.oneofs&&(s._ctwaClid="ctwaClid")),A.ref!=null&&A.hasOwnProperty("ref")&&(s.ref=A.ref,r.oneofs&&(s._ref="ref")),A.clickToWhatsappCall!=null&&A.hasOwnProperty("clickToWhatsappCall")&&(s.clickToWhatsappCall=A.clickToWhatsappCall,r.oneofs&&(s._clickToWhatsappCall="clickToWhatsappCall")),A.adContextPreviewDismissed!=null&&A.hasOwnProperty("adContextPreviewDismissed")&&(s.adContextPreviewDismissed=A.adContextPreviewDismissed,r.oneofs&&(s._adContextPreviewDismissed="adContextPreviewDismissed")),A.sourceApp!=null&&A.hasOwnProperty("sourceApp")&&(s.sourceApp=A.sourceApp,r.oneofs&&(s._sourceApp="sourceApp")),A.automatedGreetingMessageShown!=null&&A.hasOwnProperty("automatedGreetingMessageShown")&&(s.automatedGreetingMessageShown=A.automatedGreetingMessageShown,r.oneofs&&(s._automatedGreetingMessageShown="automatedGreetingMessageShown")),A.greetingMessageBody!=null&&A.hasOwnProperty("greetingMessageBody")&&(s.greetingMessageBody=A.greetingMessageBody,r.oneofs&&(s._greetingMessageBody="greetingMessageBody")),A.ctaPayload!=null&&A.hasOwnProperty("ctaPayload")&&(s.ctaPayload=A.ctaPayload,r.oneofs&&(s._ctaPayload="ctaPayload")),A.disableNudge!=null&&A.hasOwnProperty("disableNudge")&&(s.disableNudge=A.disableNudge,r.oneofs&&(s._disableNudge="disableNudge")),A.originalImageUrl!=null&&A.hasOwnProperty("originalImageUrl")&&(s.originalImageUrl=A.originalImageUrl,r.oneofs&&(s._originalImageUrl="originalImageUrl")),A.automatedGreetingMessageCtaType!=null&&A.hasOwnProperty("automatedGreetingMessageCtaType")&&(s.automatedGreetingMessageCtaType=A.automatedGreetingMessageCtaType,r.oneofs&&(s._automatedGreetingMessageCtaType="automatedGreetingMessageCtaType")),A.wtwaAdFormat!=null&&A.hasOwnProperty("wtwaAdFormat")&&(s.wtwaAdFormat=A.wtwaAdFormat,r.oneofs&&(s._wtwaAdFormat="wtwaAdFormat")),A.adType!=null&&A.hasOwnProperty("adType")&&(s.adType=r.enums===String?d.proto.ContextInfo.ExternalAdReplyInfo.AdType[A.adType]===void 0?A.adType:d.proto.ContextInfo.ExternalAdReplyInfo.AdType[A.adType]:A.adType,r.oneofs&&(s._adType="adType")),A.wtwaWebsiteUrl!=null&&A.hasOwnProperty("wtwaWebsiteUrl")&&(s.wtwaWebsiteUrl=A.wtwaWebsiteUrl,r.oneofs&&(s._wtwaWebsiteUrl="wtwaWebsiteUrl")),A.adPreviewUrl!=null&&A.hasOwnProperty("adPreviewUrl")&&(s.adPreviewUrl=A.adPreviewUrl,r.oneofs&&(s._adPreviewUrl="adPreviewUrl")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.ExternalAdReplyInfo"},a.AdType=(function(){let i={},A=Object.create(i);return A[i[0]="CTWA"]=0,A[i[1]="CAWC"]=1,A})(),a.MediaType=(function(){let i={},A=Object.create(i);return A[i[0]="NONE"]=0,A[i[1]="IMAGE"]=1,A[i[2]="VIDEO"]=2,A})(),a})(),t.FeatureEligibilities=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.cannotBeReactedTo=A.bool();break}case 2:{c.cannotBeRanked=A.bool();break}case 3:{c.canRequestFeedback=A.bool();break}case 4:{c.canBeReshared=A.bool();break}case 5:{c.canReceiveMultiReact=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.FeatureEligibilities)return A;var r=new d.proto.ContextInfo.FeatureEligibilities;return A.cannotBeReactedTo!=null&&(r.cannotBeReactedTo=!!A.cannotBeReactedTo),A.cannotBeRanked!=null&&(r.cannotBeRanked=!!A.cannotBeRanked),A.canRequestFeedback!=null&&(r.canRequestFeedback=!!A.canRequestFeedback),A.canBeReshared!=null&&(r.canBeReshared=!!A.canBeReshared),A.canReceiveMultiReact!=null&&(r.canReceiveMultiReact=!!A.canReceiveMultiReact),r},a.toObject=function(A,r){r||(r={});var s={};return A.cannotBeReactedTo!=null&&A.hasOwnProperty("cannotBeReactedTo")&&(s.cannotBeReactedTo=A.cannotBeReactedTo,r.oneofs&&(s._cannotBeReactedTo="cannotBeReactedTo")),A.cannotBeRanked!=null&&A.hasOwnProperty("cannotBeRanked")&&(s.cannotBeRanked=A.cannotBeRanked,r.oneofs&&(s._cannotBeRanked="cannotBeRanked")),A.canRequestFeedback!=null&&A.hasOwnProperty("canRequestFeedback")&&(s.canRequestFeedback=A.canRequestFeedback,r.oneofs&&(s._canRequestFeedback="canRequestFeedback")),A.canBeReshared!=null&&A.hasOwnProperty("canBeReshared")&&(s.canBeReshared=A.canBeReshared,r.oneofs&&(s._canBeReshared="canBeReshared")),A.canReceiveMultiReact!=null&&A.hasOwnProperty("canReceiveMultiReact")&&(s.canReceiveMultiReact=A.canReceiveMultiReact,r.oneofs&&(s._canReceiveMultiReact="canReceiveMultiReact")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.FeatureEligibilities"},a})(),t.ForwardOrigin=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="CHAT"]=1,e[a[2]="STATUS"]=2,e[a[3]="CHANNELS"]=3,e[a[4]="META_AI"]=4,e[a[5]="UGC"]=5,e})(),t.ForwardedNewsletterMessageInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.serverMessageId=A.int32();break}case 3:{c.newsletterName=A.string();break}case 4:{c.contentType=A.int32();break}case 5:{c.accessibilityText=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.ForwardedNewsletterMessageInfo)return A;var r=new d.proto.ContextInfo.ForwardedNewsletterMessageInfo;switch(A.newsletterJid!=null&&(r.newsletterJid=String(A.newsletterJid)),A.serverMessageId!=null&&(r.serverMessageId=A.serverMessageId|0),A.newsletterName!=null&&(r.newsletterName=String(A.newsletterName)),A.contentType){default:if(typeof A.contentType=="number"){r.contentType=A.contentType;break}break;case"UPDATE":case 1:r.contentType=1;break;case"UPDATE_CARD":case 2:r.contentType=2;break;case"LINK_CARD":case 3:r.contentType=3;break}return A.accessibilityText!=null&&(r.accessibilityText=String(A.accessibilityText)),r},a.toObject=function(A,r){r||(r={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,r.oneofs&&(s._newsletterJid="newsletterJid")),A.serverMessageId!=null&&A.hasOwnProperty("serverMessageId")&&(s.serverMessageId=A.serverMessageId,r.oneofs&&(s._serverMessageId="serverMessageId")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,r.oneofs&&(s._newsletterName="newsletterName")),A.contentType!=null&&A.hasOwnProperty("contentType")&&(s.contentType=r.enums===String?d.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[A.contentType]===void 0?A.contentType:d.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[A.contentType]:A.contentType,r.oneofs&&(s._contentType="contentType")),A.accessibilityText!=null&&A.hasOwnProperty("accessibilityText")&&(s.accessibilityText=A.accessibilityText,r.oneofs&&(s._accessibilityText="accessibilityText")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.ForwardedNewsletterMessageInfo"},a.ContentType=(function(){let i={},A=Object.create(i);return A[i[1]="UPDATE"]=1,A[i[2]="UPDATE_CARD"]=2,A[i[3]="LINK_CARD"]=3,A})(),a})(),t.PairedMediaType=(function(){let a={},e=Object.create(a);return e[a[0]="NOT_PAIRED_MEDIA"]=0,e[a[1]="SD_VIDEO_PARENT"]=1,e[a[2]="HD_VIDEO_CHILD"]=2,e[a[3]="SD_IMAGE_PARENT"]=3,e[a[4]="HD_IMAGE_CHILD"]=4,e[a[5]="MOTION_PHOTO_PARENT"]=5,e[a[6]="MOTION_PHOTO_CHILD"]=6,e[a[7]="HEVC_VIDEO_PARENT"]=7,e[a[8]="HEVC_VIDEO_CHILD"]=8,e})(),t.QuestionReplyQuotedMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.serverQuestionId=A.int32();break}case 2:{c.quotedQuestion=d.proto.Message.decode(A,A.uint32());break}case 3:{c.quotedResponse=d.proto.Message.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.QuestionReplyQuotedMessage)return A;var r=new d.proto.ContextInfo.QuestionReplyQuotedMessage;if(A.serverQuestionId!=null&&(r.serverQuestionId=A.serverQuestionId|0),A.quotedQuestion!=null){if(typeof A.quotedQuestion!="object")throw TypeError(".proto.ContextInfo.QuestionReplyQuotedMessage.quotedQuestion: object expected");r.quotedQuestion=d.proto.Message.fromObject(A.quotedQuestion)}if(A.quotedResponse!=null){if(typeof A.quotedResponse!="object")throw TypeError(".proto.ContextInfo.QuestionReplyQuotedMessage.quotedResponse: object expected");r.quotedResponse=d.proto.Message.fromObject(A.quotedResponse)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.serverQuestionId!=null&&A.hasOwnProperty("serverQuestionId")&&(s.serverQuestionId=A.serverQuestionId,r.oneofs&&(s._serverQuestionId="serverQuestionId")),A.quotedQuestion!=null&&A.hasOwnProperty("quotedQuestion")&&(s.quotedQuestion=d.proto.Message.toObject(A.quotedQuestion,r),r.oneofs&&(s._quotedQuestion="quotedQuestion")),A.quotedResponse!=null&&A.hasOwnProperty("quotedResponse")&&(s.quotedResponse=d.proto.Message.toObject(A.quotedResponse,r),r.oneofs&&(s._quotedResponse="quotedResponse")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.QuestionReplyQuotedMessage"},a})(),t.QuotedType=(function(){let a={},e=Object.create(a);return e[a[0]="EXPLICIT"]=0,e[a[1]="AUTO"]=1,e})(),t.StatusAttributionType=(function(){let a={},e=Object.create(a);return e[a[0]="NONE"]=0,e[a[1]="RESHARED_FROM_MENTION"]=1,e[a[2]="RESHARED_FROM_POST"]=2,e[a[3]="RESHARED_FROM_POST_MANY_TIMES"]=3,e[a[4]="FORWARDED_FROM_STATUS"]=4,e})(),t.StatusAudienceMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.audienceType=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.StatusAudienceMetadata)return A;var r=new d.proto.ContextInfo.StatusAudienceMetadata;switch(A.audienceType){default:if(typeof A.audienceType=="number"){r.audienceType=A.audienceType;break}break;case"UNKNOWN":case 0:r.audienceType=0;break;case"CLOSE_FRIENDS":case 1:r.audienceType=1;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.audienceType!=null&&A.hasOwnProperty("audienceType")&&(s.audienceType=r.enums===String?d.proto.ContextInfo.StatusAudienceMetadata.AudienceType[A.audienceType]===void 0?A.audienceType:d.proto.ContextInfo.StatusAudienceMetadata.AudienceType[A.audienceType]:A.audienceType,r.oneofs&&(s._audienceType="audienceType")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.StatusAudienceMetadata"},a.AudienceType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="CLOSE_FRIENDS"]=1,A})(),a})(),t.StatusSourceType=(function(){let a={},e=Object.create(a);return e[a[0]="IMAGE"]=0,e[a[1]="VIDEO"]=1,e[a[2]="GIF"]=2,e[a[3]="AUDIO"]=3,e[a[4]="TEXT"]=4,e[a[5]="MUSIC_STANDALONE"]=5,e})(),t.UTMInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.utmSource=A.string();break}case 2:{c.utmCampaign=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.UTMInfo)return A;var r=new d.proto.ContextInfo.UTMInfo;return A.utmSource!=null&&(r.utmSource=String(A.utmSource)),A.utmCampaign!=null&&(r.utmCampaign=String(A.utmCampaign)),r},a.toObject=function(A,r){r||(r={});var s={};return A.utmSource!=null&&A.hasOwnProperty("utmSource")&&(s.utmSource=A.utmSource,r.oneofs&&(s._utmSource="utmSource")),A.utmCampaign!=null&&A.hasOwnProperty("utmCampaign")&&(s.utmCampaign=A.utmCampaign,r.oneofs&&(s._utmCampaign="utmCampaign")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.UTMInfo"},a})(),t})(),n.Conversation=(function(){function t(a){if(this.messages=[],this.participant=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.string();break}case 2:{s.messages&&s.messages.length||(s.messages=[]),s.messages.push(d.proto.HistorySyncMsg.decode(e,e.uint32()));break}case 3:{s.newJid=e.string();break}case 4:{s.oldJid=e.string();break}case 5:{s.lastMsgTimestamp=e.uint64();break}case 6:{s.unreadCount=e.uint32();break}case 7:{s.readOnly=e.bool();break}case 8:{s.endOfHistoryTransfer=e.bool();break}case 9:{s.ephemeralExpiration=e.uint32();break}case 10:{s.ephemeralSettingTimestamp=e.int64();break}case 11:{s.endOfHistoryTransferType=e.int32();break}case 12:{s.conversationTimestamp=e.uint64();break}case 13:{s.name=e.string();break}case 14:{s.pHash=e.string();break}case 15:{s.notSpam=e.bool();break}case 16:{s.archived=e.bool();break}case 17:{s.disappearingMode=d.proto.DisappearingMode.decode(e,e.uint32());break}case 18:{s.unreadMentionCount=e.uint32();break}case 19:{s.markedAsUnread=e.bool();break}case 20:{s.participant&&s.participant.length||(s.participant=[]),s.participant.push(d.proto.GroupParticipant.decode(e,e.uint32()));break}case 21:{s.tcToken=e.bytes();break}case 22:{s.tcTokenTimestamp=e.uint64();break}case 23:{s.contactPrimaryIdentityKey=e.bytes();break}case 24:{s.pinned=e.uint32();break}case 25:{s.muteEndTime=e.uint64();break}case 26:{s.wallpaper=d.proto.WallpaperSettings.decode(e,e.uint32());break}case 27:{s.mediaVisibility=e.int32();break}case 28:{s.tcTokenSenderTimestamp=e.uint64();break}case 29:{s.suspended=e.bool();break}case 30:{s.terminated=e.bool();break}case 31:{s.createdAt=e.uint64();break}case 32:{s.createdBy=e.string();break}case 33:{s.description=e.string();break}case 34:{s.support=e.bool();break}case 35:{s.isParentGroup=e.bool();break}case 37:{s.parentGroupId=e.string();break}case 36:{s.isDefaultSubgroup=e.bool();break}case 38:{s.displayName=e.string();break}case 39:{s.pnJid=e.string();break}case 40:{s.shareOwnPn=e.bool();break}case 41:{s.pnhDuplicateLidThread=e.bool();break}case 42:{s.lidJid=e.string();break}case 43:{s.username=e.string();break}case 44:{s.lidOriginType=e.string();break}case 45:{s.commentsCount=e.uint32();break}case 46:{s.locked=e.bool();break}case 47:{s.systemMessageToInsert=e.int32();break}case 48:{s.capiCreatedGroup=e.bool();break}case 49:{s.accountLid=e.string();break}case 50:{s.limitSharing=e.bool();break}case 51:{s.limitSharingSettingTimestamp=e.int64();break}case 52:{s.limitSharingTrigger=e.int32();break}case 53:{s.limitSharingInitiatedByMe=e.bool();break}case 54:{s.maibaAiThreadEnabled=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Conversation)return e;var i=new d.proto.Conversation;if(e.id!=null&&(i.id=String(e.id)),e.messages){if(!Array.isArray(e.messages))throw TypeError(".proto.Conversation.messages: array expected");i.messages=[];for(var A=0;A>>0,e.lastMsgTimestamp.high>>>0).toNumber(!0))),e.unreadCount!=null&&(i.unreadCount=e.unreadCount>>>0),e.readOnly!=null&&(i.readOnly=!!e.readOnly),e.endOfHistoryTransfer!=null&&(i.endOfHistoryTransfer=!!e.endOfHistoryTransfer),e.ephemeralExpiration!=null&&(i.ephemeralExpiration=e.ephemeralExpiration>>>0),e.ephemeralSettingTimestamp!=null&&(l.Long?(i.ephemeralSettingTimestamp=l.Long.fromValue(e.ephemeralSettingTimestamp)).unsigned=!1:typeof e.ephemeralSettingTimestamp=="string"?i.ephemeralSettingTimestamp=parseInt(e.ephemeralSettingTimestamp,10):typeof e.ephemeralSettingTimestamp=="number"?i.ephemeralSettingTimestamp=e.ephemeralSettingTimestamp:typeof e.ephemeralSettingTimestamp=="object"&&(i.ephemeralSettingTimestamp=new l.LongBits(e.ephemeralSettingTimestamp.low>>>0,e.ephemeralSettingTimestamp.high>>>0).toNumber())),e.endOfHistoryTransferType){default:if(typeof e.endOfHistoryTransferType=="number"){i.endOfHistoryTransferType=e.endOfHistoryTransferType;break}break;case"COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY":case 0:i.endOfHistoryTransferType=0;break;case"COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY":case 1:i.endOfHistoryTransferType=1;break;case"COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY":case 2:i.endOfHistoryTransferType=2;break}if(e.conversationTimestamp!=null&&(l.Long?(i.conversationTimestamp=l.Long.fromValue(e.conversationTimestamp)).unsigned=!0:typeof e.conversationTimestamp=="string"?i.conversationTimestamp=parseInt(e.conversationTimestamp,10):typeof e.conversationTimestamp=="number"?i.conversationTimestamp=e.conversationTimestamp:typeof e.conversationTimestamp=="object"&&(i.conversationTimestamp=new l.LongBits(e.conversationTimestamp.low>>>0,e.conversationTimestamp.high>>>0).toNumber(!0))),e.name!=null&&(i.name=String(e.name)),e.pHash!=null&&(i.pHash=String(e.pHash)),e.notSpam!=null&&(i.notSpam=!!e.notSpam),e.archived!=null&&(i.archived=!!e.archived),e.disappearingMode!=null){if(typeof e.disappearingMode!="object")throw TypeError(".proto.Conversation.disappearingMode: object expected");i.disappearingMode=d.proto.DisappearingMode.fromObject(e.disappearingMode)}if(e.unreadMentionCount!=null&&(i.unreadMentionCount=e.unreadMentionCount>>>0),e.markedAsUnread!=null&&(i.markedAsUnread=!!e.markedAsUnread),e.participant){if(!Array.isArray(e.participant))throw TypeError(".proto.Conversation.participant: array expected");i.participant=[];for(var A=0;A=0&&(i.tcToken=e.tcToken)),e.tcTokenTimestamp!=null&&(l.Long?(i.tcTokenTimestamp=l.Long.fromValue(e.tcTokenTimestamp)).unsigned=!0:typeof e.tcTokenTimestamp=="string"?i.tcTokenTimestamp=parseInt(e.tcTokenTimestamp,10):typeof e.tcTokenTimestamp=="number"?i.tcTokenTimestamp=e.tcTokenTimestamp:typeof e.tcTokenTimestamp=="object"&&(i.tcTokenTimestamp=new l.LongBits(e.tcTokenTimestamp.low>>>0,e.tcTokenTimestamp.high>>>0).toNumber(!0))),e.contactPrimaryIdentityKey!=null&&(typeof e.contactPrimaryIdentityKey=="string"?l.base64.decode(e.contactPrimaryIdentityKey,i.contactPrimaryIdentityKey=l.newBuffer(l.base64.length(e.contactPrimaryIdentityKey)),0):e.contactPrimaryIdentityKey.length>=0&&(i.contactPrimaryIdentityKey=e.contactPrimaryIdentityKey)),e.pinned!=null&&(i.pinned=e.pinned>>>0),e.muteEndTime!=null&&(l.Long?(i.muteEndTime=l.Long.fromValue(e.muteEndTime)).unsigned=!0:typeof e.muteEndTime=="string"?i.muteEndTime=parseInt(e.muteEndTime,10):typeof e.muteEndTime=="number"?i.muteEndTime=e.muteEndTime:typeof e.muteEndTime=="object"&&(i.muteEndTime=new l.LongBits(e.muteEndTime.low>>>0,e.muteEndTime.high>>>0).toNumber(!0))),e.wallpaper!=null){if(typeof e.wallpaper!="object")throw TypeError(".proto.Conversation.wallpaper: object expected");i.wallpaper=d.proto.WallpaperSettings.fromObject(e.wallpaper)}switch(e.mediaVisibility){default:if(typeof e.mediaVisibility=="number"){i.mediaVisibility=e.mediaVisibility;break}break;case"DEFAULT":case 0:i.mediaVisibility=0;break;case"OFF":case 1:i.mediaVisibility=1;break;case"ON":case 2:i.mediaVisibility=2;break}switch(e.tcTokenSenderTimestamp!=null&&(l.Long?(i.tcTokenSenderTimestamp=l.Long.fromValue(e.tcTokenSenderTimestamp)).unsigned=!0:typeof e.tcTokenSenderTimestamp=="string"?i.tcTokenSenderTimestamp=parseInt(e.tcTokenSenderTimestamp,10):typeof e.tcTokenSenderTimestamp=="number"?i.tcTokenSenderTimestamp=e.tcTokenSenderTimestamp:typeof e.tcTokenSenderTimestamp=="object"&&(i.tcTokenSenderTimestamp=new l.LongBits(e.tcTokenSenderTimestamp.low>>>0,e.tcTokenSenderTimestamp.high>>>0).toNumber(!0))),e.suspended!=null&&(i.suspended=!!e.suspended),e.terminated!=null&&(i.terminated=!!e.terminated),e.createdAt!=null&&(l.Long?(i.createdAt=l.Long.fromValue(e.createdAt)).unsigned=!0:typeof e.createdAt=="string"?i.createdAt=parseInt(e.createdAt,10):typeof e.createdAt=="number"?i.createdAt=e.createdAt:typeof e.createdAt=="object"&&(i.createdAt=new l.LongBits(e.createdAt.low>>>0,e.createdAt.high>>>0).toNumber(!0))),e.createdBy!=null&&(i.createdBy=String(e.createdBy)),e.description!=null&&(i.description=String(e.description)),e.support!=null&&(i.support=!!e.support),e.isParentGroup!=null&&(i.isParentGroup=!!e.isParentGroup),e.parentGroupId!=null&&(i.parentGroupId=String(e.parentGroupId)),e.isDefaultSubgroup!=null&&(i.isDefaultSubgroup=!!e.isDefaultSubgroup),e.displayName!=null&&(i.displayName=String(e.displayName)),e.pnJid!=null&&(i.pnJid=String(e.pnJid)),e.shareOwnPn!=null&&(i.shareOwnPn=!!e.shareOwnPn),e.pnhDuplicateLidThread!=null&&(i.pnhDuplicateLidThread=!!e.pnhDuplicateLidThread),e.lidJid!=null&&(i.lidJid=String(e.lidJid)),e.username!=null&&(i.username=String(e.username)),e.lidOriginType!=null&&(i.lidOriginType=String(e.lidOriginType)),e.commentsCount!=null&&(i.commentsCount=e.commentsCount>>>0),e.locked!=null&&(i.locked=!!e.locked),e.systemMessageToInsert){default:if(typeof e.systemMessageToInsert=="number"){i.systemMessageToInsert=e.systemMessageToInsert;break}break;case"E2EE_MSG":case 1:i.systemMessageToInsert=1;break;case"NE2EE_SELF":case 2:i.systemMessageToInsert=2;break;case"NE2EE_OTHER":case 3:i.systemMessageToInsert=3;break}switch(e.capiCreatedGroup!=null&&(i.capiCreatedGroup=!!e.capiCreatedGroup),e.accountLid!=null&&(i.accountLid=String(e.accountLid)),e.limitSharing!=null&&(i.limitSharing=!!e.limitSharing),e.limitSharingSettingTimestamp!=null&&(l.Long?(i.limitSharingSettingTimestamp=l.Long.fromValue(e.limitSharingSettingTimestamp)).unsigned=!1:typeof e.limitSharingSettingTimestamp=="string"?i.limitSharingSettingTimestamp=parseInt(e.limitSharingSettingTimestamp,10):typeof e.limitSharingSettingTimestamp=="number"?i.limitSharingSettingTimestamp=e.limitSharingSettingTimestamp:typeof e.limitSharingSettingTimestamp=="object"&&(i.limitSharingSettingTimestamp=new l.LongBits(e.limitSharingSettingTimestamp.low>>>0,e.limitSharingSettingTimestamp.high>>>0).toNumber())),e.limitSharingTrigger){default:if(typeof e.limitSharingTrigger=="number"){i.limitSharingTrigger=e.limitSharingTrigger;break}break;case"UNKNOWN":case 0:i.limitSharingTrigger=0;break;case"CHAT_SETTING":case 1:i.limitSharingTrigger=1;break;case"BIZ_SUPPORTS_FB_HOSTING":case 2:i.limitSharingTrigger=2;break;case"UNKNOWN_GROUP":case 3:i.limitSharingTrigger=3;break}return e.limitSharingInitiatedByMe!=null&&(i.limitSharingInitiatedByMe=!!e.limitSharingInitiatedByMe),e.maibaAiThreadEnabled!=null&&(i.maibaAiThreadEnabled=!!e.maibaAiThreadEnabled),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.messages=[],A.participant=[]),i.defaults&&(A.id=""),e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id),e.messages&&e.messages.length){A.messages=[];for(var r=0;r>>3){case 1:{s.chatLockSupportLevel=e.int32();break}case 2:{s.lidMigration=d.proto.DeviceCapabilities.LIDMigration.decode(e,e.uint32());break}case 3:{s.businessBroadcast=d.proto.DeviceCapabilities.BusinessBroadcast.decode(e,e.uint32());break}case 4:{s.userHasAvatar=d.proto.DeviceCapabilities.UserHasAvatar.decode(e,e.uint32());break}case 5:{s.memberNameTagPrimarySupport=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.DeviceCapabilities)return e;var i=new d.proto.DeviceCapabilities;switch(e.chatLockSupportLevel){default:if(typeof e.chatLockSupportLevel=="number"){i.chatLockSupportLevel=e.chatLockSupportLevel;break}break;case"NONE":case 0:i.chatLockSupportLevel=0;break;case"MINIMAL":case 1:i.chatLockSupportLevel=1;break;case"FULL":case 2:i.chatLockSupportLevel=2;break}if(e.lidMigration!=null){if(typeof e.lidMigration!="object")throw TypeError(".proto.DeviceCapabilities.lidMigration: object expected");i.lidMigration=d.proto.DeviceCapabilities.LIDMigration.fromObject(e.lidMigration)}if(e.businessBroadcast!=null){if(typeof e.businessBroadcast!="object")throw TypeError(".proto.DeviceCapabilities.businessBroadcast: object expected");i.businessBroadcast=d.proto.DeviceCapabilities.BusinessBroadcast.fromObject(e.businessBroadcast)}if(e.userHasAvatar!=null){if(typeof e.userHasAvatar!="object")throw TypeError(".proto.DeviceCapabilities.userHasAvatar: object expected");i.userHasAvatar=d.proto.DeviceCapabilities.UserHasAvatar.fromObject(e.userHasAvatar)}switch(e.memberNameTagPrimarySupport){default:if(typeof e.memberNameTagPrimarySupport=="number"){i.memberNameTagPrimarySupport=e.memberNameTagPrimarySupport;break}break;case"DISABLED":case 0:i.memberNameTagPrimarySupport=0;break;case"RECEIVER_ENABLED":case 1:i.memberNameTagPrimarySupport=1;break;case"SENDER_ENABLED":case 2:i.memberNameTagPrimarySupport=2;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.chatLockSupportLevel!=null&&e.hasOwnProperty("chatLockSupportLevel")&&(A.chatLockSupportLevel=i.enums===String?d.proto.DeviceCapabilities.ChatLockSupportLevel[e.chatLockSupportLevel]===void 0?e.chatLockSupportLevel:d.proto.DeviceCapabilities.ChatLockSupportLevel[e.chatLockSupportLevel]:e.chatLockSupportLevel,i.oneofs&&(A._chatLockSupportLevel="chatLockSupportLevel")),e.lidMigration!=null&&e.hasOwnProperty("lidMigration")&&(A.lidMigration=d.proto.DeviceCapabilities.LIDMigration.toObject(e.lidMigration,i),i.oneofs&&(A._lidMigration="lidMigration")),e.businessBroadcast!=null&&e.hasOwnProperty("businessBroadcast")&&(A.businessBroadcast=d.proto.DeviceCapabilities.BusinessBroadcast.toObject(e.businessBroadcast,i),i.oneofs&&(A._businessBroadcast="businessBroadcast")),e.userHasAvatar!=null&&e.hasOwnProperty("userHasAvatar")&&(A.userHasAvatar=d.proto.DeviceCapabilities.UserHasAvatar.toObject(e.userHasAvatar,i),i.oneofs&&(A._userHasAvatar="userHasAvatar")),e.memberNameTagPrimarySupport!=null&&e.hasOwnProperty("memberNameTagPrimarySupport")&&(A.memberNameTagPrimarySupport=i.enums===String?d.proto.DeviceCapabilities.MemberNameTagPrimarySupport[e.memberNameTagPrimarySupport]===void 0?e.memberNameTagPrimarySupport:d.proto.DeviceCapabilities.MemberNameTagPrimarySupport[e.memberNameTagPrimarySupport]:e.memberNameTagPrimarySupport,i.oneofs&&(A._memberNameTagPrimarySupport="memberNameTagPrimarySupport")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceCapabilities"},t.BusinessBroadcast=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.importListEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.DeviceCapabilities.BusinessBroadcast)return A;var r=new d.proto.DeviceCapabilities.BusinessBroadcast;return A.importListEnabled!=null&&(r.importListEnabled=!!A.importListEnabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.importListEnabled!=null&&A.hasOwnProperty("importListEnabled")&&(s.importListEnabled=A.importListEnabled,r.oneofs&&(s._importListEnabled="importListEnabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.BusinessBroadcast"},a})(),t.ChatLockSupportLevel=(function(){let a={},e=Object.create(a);return e[a[0]="NONE"]=0,e[a[1]="MINIMAL"]=1,e[a[2]="FULL"]=2,e})(),t.LIDMigration=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.chatDbMigrationTimestamp=A.uint64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.DeviceCapabilities.LIDMigration)return A;var r=new d.proto.DeviceCapabilities.LIDMigration;return A.chatDbMigrationTimestamp!=null&&(l.Long?(r.chatDbMigrationTimestamp=l.Long.fromValue(A.chatDbMigrationTimestamp)).unsigned=!0:typeof A.chatDbMigrationTimestamp=="string"?r.chatDbMigrationTimestamp=parseInt(A.chatDbMigrationTimestamp,10):typeof A.chatDbMigrationTimestamp=="number"?r.chatDbMigrationTimestamp=A.chatDbMigrationTimestamp:typeof A.chatDbMigrationTimestamp=="object"&&(r.chatDbMigrationTimestamp=new l.LongBits(A.chatDbMigrationTimestamp.low>>>0,A.chatDbMigrationTimestamp.high>>>0).toNumber(!0))),r},a.toObject=function(A,r){r||(r={});var s={};return A.chatDbMigrationTimestamp!=null&&A.hasOwnProperty("chatDbMigrationTimestamp")&&(typeof A.chatDbMigrationTimestamp=="number"?s.chatDbMigrationTimestamp=r.longs===String?String(A.chatDbMigrationTimestamp):A.chatDbMigrationTimestamp:s.chatDbMigrationTimestamp=r.longs===String?ge(A.chatDbMigrationTimestamp,!0):r.longs===Number?ce(A.chatDbMigrationTimestamp,!0):A.chatDbMigrationTimestamp,r.oneofs&&(s._chatDbMigrationTimestamp="chatDbMigrationTimestamp")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.LIDMigration"},a})(),t.MemberNameTagPrimarySupport=(function(){let a={},e=Object.create(a);return e[a[0]="DISABLED"]=0,e[a[1]="RECEIVER_ENABLED"]=1,e[a[2]="SENDER_ENABLED"]=2,e})(),t.UserHasAvatar=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.userHasAvatar=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.DeviceCapabilities.UserHasAvatar)return A;var r=new d.proto.DeviceCapabilities.UserHasAvatar;return A.userHasAvatar!=null&&(r.userHasAvatar=!!A.userHasAvatar),r},a.toObject=function(A,r){r||(r={});var s={};return A.userHasAvatar!=null&&A.hasOwnProperty("userHasAvatar")&&(s.userHasAvatar=A.userHasAvatar,r.oneofs&&(s._userHasAvatar="userHasAvatar")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.UserHasAvatar"},a})(),t})(),n.DeviceConsistencyCodeMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.generation=e.uint32();break}case 2:{s.signature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.DeviceConsistencyCodeMessage)return e;var i=new d.proto.DeviceConsistencyCodeMessage;return e.generation!=null&&(i.generation=e.generation>>>0),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,i.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(i.signature=e.signature)),i},t.toObject=function(e,i){i||(i={});var A={};return e.generation!=null&&e.hasOwnProperty("generation")&&(A.generation=e.generation,i.oneofs&&(A._generation="generation")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=i.bytes===String?l.base64.encode(e.signature,0,e.signature.length):i.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,i.oneofs&&(A._signature="signature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceConsistencyCodeMessage"},t})(),n.DeviceListMetadata=(function(){function t(a){if(this.senderKeyIndexes=[],this.recipientKeyIndexes=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.senderKeyHash=e.bytes();break}case 2:{s.senderTimestamp=e.uint64();break}case 3:{if(s.senderKeyIndexes&&s.senderKeyIndexes.length||(s.senderKeyIndexes=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos=0&&(i.senderKeyHash=e.senderKeyHash)),e.senderTimestamp!=null&&(l.Long?(i.senderTimestamp=l.Long.fromValue(e.senderTimestamp)).unsigned=!0:typeof e.senderTimestamp=="string"?i.senderTimestamp=parseInt(e.senderTimestamp,10):typeof e.senderTimestamp=="number"?i.senderTimestamp=e.senderTimestamp:typeof e.senderTimestamp=="object"&&(i.senderTimestamp=new l.LongBits(e.senderTimestamp.low>>>0,e.senderTimestamp.high>>>0).toNumber(!0))),e.senderKeyIndexes){if(!Array.isArray(e.senderKeyIndexes))throw TypeError(".proto.DeviceListMetadata.senderKeyIndexes: array expected");i.senderKeyIndexes=[];for(var A=0;A>>0}switch(e.senderAccountType){default:if(typeof e.senderAccountType=="number"){i.senderAccountType=e.senderAccountType;break}break;case"E2EE":case 0:i.senderAccountType=0;break;case"HOSTED":case 1:i.senderAccountType=1;break}switch(e.receiverAccountType){default:if(typeof e.receiverAccountType=="number"){i.receiverAccountType=e.receiverAccountType;break}break;case"E2EE":case 0:i.receiverAccountType=0;break;case"HOSTED":case 1:i.receiverAccountType=1;break}if(e.recipientKeyHash!=null&&(typeof e.recipientKeyHash=="string"?l.base64.decode(e.recipientKeyHash,i.recipientKeyHash=l.newBuffer(l.base64.length(e.recipientKeyHash)),0):e.recipientKeyHash.length>=0&&(i.recipientKeyHash=e.recipientKeyHash)),e.recipientTimestamp!=null&&(l.Long?(i.recipientTimestamp=l.Long.fromValue(e.recipientTimestamp)).unsigned=!0:typeof e.recipientTimestamp=="string"?i.recipientTimestamp=parseInt(e.recipientTimestamp,10):typeof e.recipientTimestamp=="number"?i.recipientTimestamp=e.recipientTimestamp:typeof e.recipientTimestamp=="object"&&(i.recipientTimestamp=new l.LongBits(e.recipientTimestamp.low>>>0,e.recipientTimestamp.high>>>0).toNumber(!0))),e.recipientKeyIndexes){if(!Array.isArray(e.recipientKeyIndexes))throw TypeError(".proto.DeviceListMetadata.recipientKeyIndexes: array expected");i.recipientKeyIndexes=[];for(var A=0;A>>0}return i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.senderKeyIndexes=[],A.recipientKeyIndexes=[]),e.senderKeyHash!=null&&e.hasOwnProperty("senderKeyHash")&&(A.senderKeyHash=i.bytes===String?l.base64.encode(e.senderKeyHash,0,e.senderKeyHash.length):i.bytes===Array?Array.prototype.slice.call(e.senderKeyHash):e.senderKeyHash,i.oneofs&&(A._senderKeyHash="senderKeyHash")),e.senderTimestamp!=null&&e.hasOwnProperty("senderTimestamp")&&(typeof e.senderTimestamp=="number"?A.senderTimestamp=i.longs===String?String(e.senderTimestamp):e.senderTimestamp:A.senderTimestamp=i.longs===String?ge(e.senderTimestamp,!0):i.longs===Number?ce(e.senderTimestamp,!0):e.senderTimestamp,i.oneofs&&(A._senderTimestamp="senderTimestamp")),e.senderKeyIndexes&&e.senderKeyIndexes.length){A.senderKeyIndexes=[];for(var r=0;r>>3){case 1:{s.os=e.string();break}case 2:{s.version=d.proto.DeviceProps.AppVersion.decode(e,e.uint32());break}case 3:{s.platformType=e.int32();break}case 4:{s.requireFullSync=e.bool();break}case 5:{s.historySyncConfig=d.proto.DeviceProps.HistorySyncConfig.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.DeviceProps)return e;var i=new d.proto.DeviceProps;if(e.os!=null&&(i.os=String(e.os)),e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.DeviceProps.version: object expected");i.version=d.proto.DeviceProps.AppVersion.fromObject(e.version)}switch(e.platformType){default:if(typeof e.platformType=="number"){i.platformType=e.platformType;break}break;case"UNKNOWN":case 0:i.platformType=0;break;case"CHROME":case 1:i.platformType=1;break;case"FIREFOX":case 2:i.platformType=2;break;case"IE":case 3:i.platformType=3;break;case"OPERA":case 4:i.platformType=4;break;case"SAFARI":case 5:i.platformType=5;break;case"EDGE":case 6:i.platformType=6;break;case"DESKTOP":case 7:i.platformType=7;break;case"IPAD":case 8:i.platformType=8;break;case"ANDROID_TABLET":case 9:i.platformType=9;break;case"OHANA":case 10:i.platformType=10;break;case"ALOHA":case 11:i.platformType=11;break;case"CATALINA":case 12:i.platformType=12;break;case"TCL_TV":case 13:i.platformType=13;break;case"IOS_PHONE":case 14:i.platformType=14;break;case"IOS_CATALYST":case 15:i.platformType=15;break;case"ANDROID_PHONE":case 16:i.platformType=16;break;case"ANDROID_AMBIGUOUS":case 17:i.platformType=17;break;case"WEAR_OS":case 18:i.platformType=18;break;case"AR_WRIST":case 19:i.platformType=19;break;case"AR_DEVICE":case 20:i.platformType=20;break;case"UWP":case 21:i.platformType=21;break;case"VR":case 22:i.platformType=22;break;case"CLOUD_API":case 23:i.platformType=23;break;case"SMARTGLASSES":case 24:i.platformType=24;break}if(e.requireFullSync!=null&&(i.requireFullSync=!!e.requireFullSync),e.historySyncConfig!=null){if(typeof e.historySyncConfig!="object")throw TypeError(".proto.DeviceProps.historySyncConfig: object expected");i.historySyncConfig=d.proto.DeviceProps.HistorySyncConfig.fromObject(e.historySyncConfig)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.os!=null&&e.hasOwnProperty("os")&&(A.os=e.os,i.oneofs&&(A._os="os")),e.version!=null&&e.hasOwnProperty("version")&&(A.version=d.proto.DeviceProps.AppVersion.toObject(e.version,i),i.oneofs&&(A._version="version")),e.platformType!=null&&e.hasOwnProperty("platformType")&&(A.platformType=i.enums===String?d.proto.DeviceProps.PlatformType[e.platformType]===void 0?e.platformType:d.proto.DeviceProps.PlatformType[e.platformType]:e.platformType,i.oneofs&&(A._platformType="platformType")),e.requireFullSync!=null&&e.hasOwnProperty("requireFullSync")&&(A.requireFullSync=e.requireFullSync,i.oneofs&&(A._requireFullSync="requireFullSync")),e.historySyncConfig!=null&&e.hasOwnProperty("historySyncConfig")&&(A.historySyncConfig=d.proto.DeviceProps.HistorySyncConfig.toObject(e.historySyncConfig,i),i.oneofs&&(A._historySyncConfig="historySyncConfig")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceProps"},t.AppVersion=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.primary=A.uint32();break}case 2:{c.secondary=A.uint32();break}case 3:{c.tertiary=A.uint32();break}case 4:{c.quaternary=A.uint32();break}case 5:{c.quinary=A.uint32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.DeviceProps.AppVersion)return A;var r=new d.proto.DeviceProps.AppVersion;return A.primary!=null&&(r.primary=A.primary>>>0),A.secondary!=null&&(r.secondary=A.secondary>>>0),A.tertiary!=null&&(r.tertiary=A.tertiary>>>0),A.quaternary!=null&&(r.quaternary=A.quaternary>>>0),A.quinary!=null&&(r.quinary=A.quinary>>>0),r},a.toObject=function(A,r){r||(r={});var s={};return A.primary!=null&&A.hasOwnProperty("primary")&&(s.primary=A.primary,r.oneofs&&(s._primary="primary")),A.secondary!=null&&A.hasOwnProperty("secondary")&&(s.secondary=A.secondary,r.oneofs&&(s._secondary="secondary")),A.tertiary!=null&&A.hasOwnProperty("tertiary")&&(s.tertiary=A.tertiary,r.oneofs&&(s._tertiary="tertiary")),A.quaternary!=null&&A.hasOwnProperty("quaternary")&&(s.quaternary=A.quaternary,r.oneofs&&(s._quaternary="quaternary")),A.quinary!=null&&A.hasOwnProperty("quinary")&&(s.quinary=A.quinary,r.oneofs&&(s._quinary="quinary")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceProps.AppVersion"},a})(),t.HistorySyncConfig=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.fullSyncDaysLimit=A.uint32();break}case 2:{c.fullSyncSizeMbLimit=A.uint32();break}case 3:{c.storageQuotaMb=A.uint32();break}case 4:{c.inlineInitialPayloadInE2EeMsg=A.bool();break}case 5:{c.recentSyncDaysLimit=A.uint32();break}case 6:{c.supportCallLogHistory=A.bool();break}case 7:{c.supportBotUserAgentChatHistory=A.bool();break}case 8:{c.supportCagReactionsAndPolls=A.bool();break}case 9:{c.supportBizHostedMsg=A.bool();break}case 10:{c.supportRecentSyncChunkMessageCountTuning=A.bool();break}case 11:{c.supportHostedGroupMsg=A.bool();break}case 12:{c.supportFbidBotChatHistory=A.bool();break}case 13:{c.supportAddOnHistorySyncMigration=A.bool();break}case 14:{c.supportMessageAssociation=A.bool();break}case 15:{c.supportGroupHistory=A.bool();break}case 16:{c.onDemandReady=A.bool();break}case 17:{c.supportGuestChat=A.bool();break}case 18:{c.completeOnDemandReady=A.bool();break}case 19:{c.thumbnailSyncDaysLimit=A.uint32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.DeviceProps.HistorySyncConfig)return A;var r=new d.proto.DeviceProps.HistorySyncConfig;return A.fullSyncDaysLimit!=null&&(r.fullSyncDaysLimit=A.fullSyncDaysLimit>>>0),A.fullSyncSizeMbLimit!=null&&(r.fullSyncSizeMbLimit=A.fullSyncSizeMbLimit>>>0),A.storageQuotaMb!=null&&(r.storageQuotaMb=A.storageQuotaMb>>>0),A.inlineInitialPayloadInE2EeMsg!=null&&(r.inlineInitialPayloadInE2EeMsg=!!A.inlineInitialPayloadInE2EeMsg),A.recentSyncDaysLimit!=null&&(r.recentSyncDaysLimit=A.recentSyncDaysLimit>>>0),A.supportCallLogHistory!=null&&(r.supportCallLogHistory=!!A.supportCallLogHistory),A.supportBotUserAgentChatHistory!=null&&(r.supportBotUserAgentChatHistory=!!A.supportBotUserAgentChatHistory),A.supportCagReactionsAndPolls!=null&&(r.supportCagReactionsAndPolls=!!A.supportCagReactionsAndPolls),A.supportBizHostedMsg!=null&&(r.supportBizHostedMsg=!!A.supportBizHostedMsg),A.supportRecentSyncChunkMessageCountTuning!=null&&(r.supportRecentSyncChunkMessageCountTuning=!!A.supportRecentSyncChunkMessageCountTuning),A.supportHostedGroupMsg!=null&&(r.supportHostedGroupMsg=!!A.supportHostedGroupMsg),A.supportFbidBotChatHistory!=null&&(r.supportFbidBotChatHistory=!!A.supportFbidBotChatHistory),A.supportAddOnHistorySyncMigration!=null&&(r.supportAddOnHistorySyncMigration=!!A.supportAddOnHistorySyncMigration),A.supportMessageAssociation!=null&&(r.supportMessageAssociation=!!A.supportMessageAssociation),A.supportGroupHistory!=null&&(r.supportGroupHistory=!!A.supportGroupHistory),A.onDemandReady!=null&&(r.onDemandReady=!!A.onDemandReady),A.supportGuestChat!=null&&(r.supportGuestChat=!!A.supportGuestChat),A.completeOnDemandReady!=null&&(r.completeOnDemandReady=!!A.completeOnDemandReady),A.thumbnailSyncDaysLimit!=null&&(r.thumbnailSyncDaysLimit=A.thumbnailSyncDaysLimit>>>0),r},a.toObject=function(A,r){r||(r={});var s={};return A.fullSyncDaysLimit!=null&&A.hasOwnProperty("fullSyncDaysLimit")&&(s.fullSyncDaysLimit=A.fullSyncDaysLimit,r.oneofs&&(s._fullSyncDaysLimit="fullSyncDaysLimit")),A.fullSyncSizeMbLimit!=null&&A.hasOwnProperty("fullSyncSizeMbLimit")&&(s.fullSyncSizeMbLimit=A.fullSyncSizeMbLimit,r.oneofs&&(s._fullSyncSizeMbLimit="fullSyncSizeMbLimit")),A.storageQuotaMb!=null&&A.hasOwnProperty("storageQuotaMb")&&(s.storageQuotaMb=A.storageQuotaMb,r.oneofs&&(s._storageQuotaMb="storageQuotaMb")),A.inlineInitialPayloadInE2EeMsg!=null&&A.hasOwnProperty("inlineInitialPayloadInE2EeMsg")&&(s.inlineInitialPayloadInE2EeMsg=A.inlineInitialPayloadInE2EeMsg,r.oneofs&&(s._inlineInitialPayloadInE2EeMsg="inlineInitialPayloadInE2EeMsg")),A.recentSyncDaysLimit!=null&&A.hasOwnProperty("recentSyncDaysLimit")&&(s.recentSyncDaysLimit=A.recentSyncDaysLimit,r.oneofs&&(s._recentSyncDaysLimit="recentSyncDaysLimit")),A.supportCallLogHistory!=null&&A.hasOwnProperty("supportCallLogHistory")&&(s.supportCallLogHistory=A.supportCallLogHistory,r.oneofs&&(s._supportCallLogHistory="supportCallLogHistory")),A.supportBotUserAgentChatHistory!=null&&A.hasOwnProperty("supportBotUserAgentChatHistory")&&(s.supportBotUserAgentChatHistory=A.supportBotUserAgentChatHistory,r.oneofs&&(s._supportBotUserAgentChatHistory="supportBotUserAgentChatHistory")),A.supportCagReactionsAndPolls!=null&&A.hasOwnProperty("supportCagReactionsAndPolls")&&(s.supportCagReactionsAndPolls=A.supportCagReactionsAndPolls,r.oneofs&&(s._supportCagReactionsAndPolls="supportCagReactionsAndPolls")),A.supportBizHostedMsg!=null&&A.hasOwnProperty("supportBizHostedMsg")&&(s.supportBizHostedMsg=A.supportBizHostedMsg,r.oneofs&&(s._supportBizHostedMsg="supportBizHostedMsg")),A.supportRecentSyncChunkMessageCountTuning!=null&&A.hasOwnProperty("supportRecentSyncChunkMessageCountTuning")&&(s.supportRecentSyncChunkMessageCountTuning=A.supportRecentSyncChunkMessageCountTuning,r.oneofs&&(s._supportRecentSyncChunkMessageCountTuning="supportRecentSyncChunkMessageCountTuning")),A.supportHostedGroupMsg!=null&&A.hasOwnProperty("supportHostedGroupMsg")&&(s.supportHostedGroupMsg=A.supportHostedGroupMsg,r.oneofs&&(s._supportHostedGroupMsg="supportHostedGroupMsg")),A.supportFbidBotChatHistory!=null&&A.hasOwnProperty("supportFbidBotChatHistory")&&(s.supportFbidBotChatHistory=A.supportFbidBotChatHistory,r.oneofs&&(s._supportFbidBotChatHistory="supportFbidBotChatHistory")),A.supportAddOnHistorySyncMigration!=null&&A.hasOwnProperty("supportAddOnHistorySyncMigration")&&(s.supportAddOnHistorySyncMigration=A.supportAddOnHistorySyncMigration,r.oneofs&&(s._supportAddOnHistorySyncMigration="supportAddOnHistorySyncMigration")),A.supportMessageAssociation!=null&&A.hasOwnProperty("supportMessageAssociation")&&(s.supportMessageAssociation=A.supportMessageAssociation,r.oneofs&&(s._supportMessageAssociation="supportMessageAssociation")),A.supportGroupHistory!=null&&A.hasOwnProperty("supportGroupHistory")&&(s.supportGroupHistory=A.supportGroupHistory,r.oneofs&&(s._supportGroupHistory="supportGroupHistory")),A.onDemandReady!=null&&A.hasOwnProperty("onDemandReady")&&(s.onDemandReady=A.onDemandReady,r.oneofs&&(s._onDemandReady="onDemandReady")),A.supportGuestChat!=null&&A.hasOwnProperty("supportGuestChat")&&(s.supportGuestChat=A.supportGuestChat,r.oneofs&&(s._supportGuestChat="supportGuestChat")),A.completeOnDemandReady!=null&&A.hasOwnProperty("completeOnDemandReady")&&(s.completeOnDemandReady=A.completeOnDemandReady,r.oneofs&&(s._completeOnDemandReady="completeOnDemandReady")),A.thumbnailSyncDaysLimit!=null&&A.hasOwnProperty("thumbnailSyncDaysLimit")&&(s.thumbnailSyncDaysLimit=A.thumbnailSyncDaysLimit,r.oneofs&&(s._thumbnailSyncDaysLimit="thumbnailSyncDaysLimit")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceProps.HistorySyncConfig"},a})(),t.PlatformType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="CHROME"]=1,e[a[2]="FIREFOX"]=2,e[a[3]="IE"]=3,e[a[4]="OPERA"]=4,e[a[5]="SAFARI"]=5,e[a[6]="EDGE"]=6,e[a[7]="DESKTOP"]=7,e[a[8]="IPAD"]=8,e[a[9]="ANDROID_TABLET"]=9,e[a[10]="OHANA"]=10,e[a[11]="ALOHA"]=11,e[a[12]="CATALINA"]=12,e[a[13]="TCL_TV"]=13,e[a[14]="IOS_PHONE"]=14,e[a[15]="IOS_CATALYST"]=15,e[a[16]="ANDROID_PHONE"]=16,e[a[17]="ANDROID_AMBIGUOUS"]=17,e[a[18]="WEAR_OS"]=18,e[a[19]="AR_WRIST"]=19,e[a[20]="AR_DEVICE"]=20,e[a[21]="UWP"]=21,e[a[22]="VR"]=22,e[a[23]="CLOUD_API"]=23,e[a[24]="SMARTGLASSES"]=24,e})(),t})(),n.DisappearingMode=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.initiator=e.int32();break}case 2:{s.trigger=e.int32();break}case 3:{s.initiatorDeviceJid=e.string();break}case 4:{s.initiatedByMe=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.DisappearingMode)return e;var i=new d.proto.DisappearingMode;switch(e.initiator){default:if(typeof e.initiator=="number"){i.initiator=e.initiator;break}break;case"CHANGED_IN_CHAT":case 0:i.initiator=0;break;case"INITIATED_BY_ME":case 1:i.initiator=1;break;case"INITIATED_BY_OTHER":case 2:i.initiator=2;break;case"BIZ_UPGRADE_FB_HOSTING":case 3:i.initiator=3;break}switch(e.trigger){default:if(typeof e.trigger=="number"){i.trigger=e.trigger;break}break;case"UNKNOWN":case 0:i.trigger=0;break;case"CHAT_SETTING":case 1:i.trigger=1;break;case"ACCOUNT_SETTING":case 2:i.trigger=2;break;case"BULK_CHANGE":case 3:i.trigger=3;break;case"BIZ_SUPPORTS_FB_HOSTING":case 4:i.trigger=4;break;case"UNKNOWN_GROUPS":case 5:i.trigger=5;break}return e.initiatorDeviceJid!=null&&(i.initiatorDeviceJid=String(e.initiatorDeviceJid)),e.initiatedByMe!=null&&(i.initiatedByMe=!!e.initiatedByMe),i},t.toObject=function(e,i){i||(i={});var A={};return e.initiator!=null&&e.hasOwnProperty("initiator")&&(A.initiator=i.enums===String?d.proto.DisappearingMode.Initiator[e.initiator]===void 0?e.initiator:d.proto.DisappearingMode.Initiator[e.initiator]:e.initiator,i.oneofs&&(A._initiator="initiator")),e.trigger!=null&&e.hasOwnProperty("trigger")&&(A.trigger=i.enums===String?d.proto.DisappearingMode.Trigger[e.trigger]===void 0?e.trigger:d.proto.DisappearingMode.Trigger[e.trigger]:e.trigger,i.oneofs&&(A._trigger="trigger")),e.initiatorDeviceJid!=null&&e.hasOwnProperty("initiatorDeviceJid")&&(A.initiatorDeviceJid=e.initiatorDeviceJid,i.oneofs&&(A._initiatorDeviceJid="initiatorDeviceJid")),e.initiatedByMe!=null&&e.hasOwnProperty("initiatedByMe")&&(A.initiatedByMe=e.initiatedByMe,i.oneofs&&(A._initiatedByMe="initiatedByMe")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DisappearingMode"},t.Initiator=(function(){let a={},e=Object.create(a);return e[a[0]="CHANGED_IN_CHAT"]=0,e[a[1]="INITIATED_BY_ME"]=1,e[a[2]="INITIATED_BY_OTHER"]=2,e[a[3]="BIZ_UPGRADE_FB_HOSTING"]=3,e})(),t.Trigger=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="CHAT_SETTING"]=1,e[a[2]="ACCOUNT_SETTING"]=2,e[a[3]="BULK_CHANGE"]=3,e[a[4]="BIZ_SUPPORTS_FB_HOSTING"]=4,e[a[5]="UNKNOWN_GROUPS"]=5,e})(),t})(),n.EmbeddedContent=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.embeddedMessage=d.proto.EmbeddedMessage.decode(e,e.uint32());break}case 2:{s.embeddedMusic=d.proto.EmbeddedMusic.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EmbeddedContent)return e;var i=new d.proto.EmbeddedContent;if(e.embeddedMessage!=null){if(typeof e.embeddedMessage!="object")throw TypeError(".proto.EmbeddedContent.embeddedMessage: object expected");i.embeddedMessage=d.proto.EmbeddedMessage.fromObject(e.embeddedMessage)}if(e.embeddedMusic!=null){if(typeof e.embeddedMusic!="object")throw TypeError(".proto.EmbeddedContent.embeddedMusic: object expected");i.embeddedMusic=d.proto.EmbeddedMusic.fromObject(e.embeddedMusic)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.embeddedMessage!=null&&e.hasOwnProperty("embeddedMessage")&&(A.embeddedMessage=d.proto.EmbeddedMessage.toObject(e.embeddedMessage,i),i.oneofs&&(A.content="embeddedMessage")),e.embeddedMusic!=null&&e.hasOwnProperty("embeddedMusic")&&(A.embeddedMusic=d.proto.EmbeddedMusic.toObject(e.embeddedMusic,i),i.oneofs&&(A.content="embeddedMusic")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedContent"},t})(),n.EmbeddedMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.message=d.proto.Message.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EmbeddedMessage)return e;var i=new d.proto.EmbeddedMessage;if(e.stanzaId!=null&&(i.stanzaId=String(e.stanzaId)),e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.EmbeddedMessage.message: object expected");i.message=d.proto.Message.fromObject(e.message)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,i.oneofs&&(A._stanzaId="stanzaId")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=d.proto.Message.toObject(e.message,i),i.oneofs&&(A._message="message")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedMessage"},t})(),n.EmbeddedMusic=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.musicContentMediaId=e.string();break}case 2:{s.songId=e.string();break}case 3:{s.author=e.string();break}case 4:{s.title=e.string();break}case 5:{s.artworkDirectPath=e.string();break}case 6:{s.artworkSha256=e.bytes();break}case 7:{s.artworkEncSha256=e.bytes();break}case 8:{s.artistAttribution=e.string();break}case 9:{s.countryBlocklist=e.bytes();break}case 10:{s.isExplicit=e.bool();break}case 11:{s.artworkMediaKey=e.bytes();break}case 12:{s.musicSongStartTimeInMs=e.int64();break}case 13:{s.derivedContentStartTimeInMs=e.int64();break}case 14:{s.overlapDurationInMs=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EmbeddedMusic)return e;var i=new d.proto.EmbeddedMusic;return e.musicContentMediaId!=null&&(i.musicContentMediaId=String(e.musicContentMediaId)),e.songId!=null&&(i.songId=String(e.songId)),e.author!=null&&(i.author=String(e.author)),e.title!=null&&(i.title=String(e.title)),e.artworkDirectPath!=null&&(i.artworkDirectPath=String(e.artworkDirectPath)),e.artworkSha256!=null&&(typeof e.artworkSha256=="string"?l.base64.decode(e.artworkSha256,i.artworkSha256=l.newBuffer(l.base64.length(e.artworkSha256)),0):e.artworkSha256.length>=0&&(i.artworkSha256=e.artworkSha256)),e.artworkEncSha256!=null&&(typeof e.artworkEncSha256=="string"?l.base64.decode(e.artworkEncSha256,i.artworkEncSha256=l.newBuffer(l.base64.length(e.artworkEncSha256)),0):e.artworkEncSha256.length>=0&&(i.artworkEncSha256=e.artworkEncSha256)),e.artistAttribution!=null&&(i.artistAttribution=String(e.artistAttribution)),e.countryBlocklist!=null&&(typeof e.countryBlocklist=="string"?l.base64.decode(e.countryBlocklist,i.countryBlocklist=l.newBuffer(l.base64.length(e.countryBlocklist)),0):e.countryBlocklist.length>=0&&(i.countryBlocklist=e.countryBlocklist)),e.isExplicit!=null&&(i.isExplicit=!!e.isExplicit),e.artworkMediaKey!=null&&(typeof e.artworkMediaKey=="string"?l.base64.decode(e.artworkMediaKey,i.artworkMediaKey=l.newBuffer(l.base64.length(e.artworkMediaKey)),0):e.artworkMediaKey.length>=0&&(i.artworkMediaKey=e.artworkMediaKey)),e.musicSongStartTimeInMs!=null&&(l.Long?(i.musicSongStartTimeInMs=l.Long.fromValue(e.musicSongStartTimeInMs)).unsigned=!1:typeof e.musicSongStartTimeInMs=="string"?i.musicSongStartTimeInMs=parseInt(e.musicSongStartTimeInMs,10):typeof e.musicSongStartTimeInMs=="number"?i.musicSongStartTimeInMs=e.musicSongStartTimeInMs:typeof e.musicSongStartTimeInMs=="object"&&(i.musicSongStartTimeInMs=new l.LongBits(e.musicSongStartTimeInMs.low>>>0,e.musicSongStartTimeInMs.high>>>0).toNumber())),e.derivedContentStartTimeInMs!=null&&(l.Long?(i.derivedContentStartTimeInMs=l.Long.fromValue(e.derivedContentStartTimeInMs)).unsigned=!1:typeof e.derivedContentStartTimeInMs=="string"?i.derivedContentStartTimeInMs=parseInt(e.derivedContentStartTimeInMs,10):typeof e.derivedContentStartTimeInMs=="number"?i.derivedContentStartTimeInMs=e.derivedContentStartTimeInMs:typeof e.derivedContentStartTimeInMs=="object"&&(i.derivedContentStartTimeInMs=new l.LongBits(e.derivedContentStartTimeInMs.low>>>0,e.derivedContentStartTimeInMs.high>>>0).toNumber())),e.overlapDurationInMs!=null&&(l.Long?(i.overlapDurationInMs=l.Long.fromValue(e.overlapDurationInMs)).unsigned=!1:typeof e.overlapDurationInMs=="string"?i.overlapDurationInMs=parseInt(e.overlapDurationInMs,10):typeof e.overlapDurationInMs=="number"?i.overlapDurationInMs=e.overlapDurationInMs:typeof e.overlapDurationInMs=="object"&&(i.overlapDurationInMs=new l.LongBits(e.overlapDurationInMs.low>>>0,e.overlapDurationInMs.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.musicContentMediaId!=null&&e.hasOwnProperty("musicContentMediaId")&&(A.musicContentMediaId=e.musicContentMediaId,i.oneofs&&(A._musicContentMediaId="musicContentMediaId")),e.songId!=null&&e.hasOwnProperty("songId")&&(A.songId=e.songId,i.oneofs&&(A._songId="songId")),e.author!=null&&e.hasOwnProperty("author")&&(A.author=e.author,i.oneofs&&(A._author="author")),e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,i.oneofs&&(A._title="title")),e.artworkDirectPath!=null&&e.hasOwnProperty("artworkDirectPath")&&(A.artworkDirectPath=e.artworkDirectPath,i.oneofs&&(A._artworkDirectPath="artworkDirectPath")),e.artworkSha256!=null&&e.hasOwnProperty("artworkSha256")&&(A.artworkSha256=i.bytes===String?l.base64.encode(e.artworkSha256,0,e.artworkSha256.length):i.bytes===Array?Array.prototype.slice.call(e.artworkSha256):e.artworkSha256,i.oneofs&&(A._artworkSha256="artworkSha256")),e.artworkEncSha256!=null&&e.hasOwnProperty("artworkEncSha256")&&(A.artworkEncSha256=i.bytes===String?l.base64.encode(e.artworkEncSha256,0,e.artworkEncSha256.length):i.bytes===Array?Array.prototype.slice.call(e.artworkEncSha256):e.artworkEncSha256,i.oneofs&&(A._artworkEncSha256="artworkEncSha256")),e.artistAttribution!=null&&e.hasOwnProperty("artistAttribution")&&(A.artistAttribution=e.artistAttribution,i.oneofs&&(A._artistAttribution="artistAttribution")),e.countryBlocklist!=null&&e.hasOwnProperty("countryBlocklist")&&(A.countryBlocklist=i.bytes===String?l.base64.encode(e.countryBlocklist,0,e.countryBlocklist.length):i.bytes===Array?Array.prototype.slice.call(e.countryBlocklist):e.countryBlocklist,i.oneofs&&(A._countryBlocklist="countryBlocklist")),e.isExplicit!=null&&e.hasOwnProperty("isExplicit")&&(A.isExplicit=e.isExplicit,i.oneofs&&(A._isExplicit="isExplicit")),e.artworkMediaKey!=null&&e.hasOwnProperty("artworkMediaKey")&&(A.artworkMediaKey=i.bytes===String?l.base64.encode(e.artworkMediaKey,0,e.artworkMediaKey.length):i.bytes===Array?Array.prototype.slice.call(e.artworkMediaKey):e.artworkMediaKey,i.oneofs&&(A._artworkMediaKey="artworkMediaKey")),e.musicSongStartTimeInMs!=null&&e.hasOwnProperty("musicSongStartTimeInMs")&&(typeof e.musicSongStartTimeInMs=="number"?A.musicSongStartTimeInMs=i.longs===String?String(e.musicSongStartTimeInMs):e.musicSongStartTimeInMs:A.musicSongStartTimeInMs=i.longs===String?ge(e.musicSongStartTimeInMs):i.longs===Number?ce(e.musicSongStartTimeInMs):e.musicSongStartTimeInMs,i.oneofs&&(A._musicSongStartTimeInMs="musicSongStartTimeInMs")),e.derivedContentStartTimeInMs!=null&&e.hasOwnProperty("derivedContentStartTimeInMs")&&(typeof e.derivedContentStartTimeInMs=="number"?A.derivedContentStartTimeInMs=i.longs===String?String(e.derivedContentStartTimeInMs):e.derivedContentStartTimeInMs:A.derivedContentStartTimeInMs=i.longs===String?ge(e.derivedContentStartTimeInMs):i.longs===Number?ce(e.derivedContentStartTimeInMs):e.derivedContentStartTimeInMs,i.oneofs&&(A._derivedContentStartTimeInMs="derivedContentStartTimeInMs")),e.overlapDurationInMs!=null&&e.hasOwnProperty("overlapDurationInMs")&&(typeof e.overlapDurationInMs=="number"?A.overlapDurationInMs=i.longs===String?String(e.overlapDurationInMs):e.overlapDurationInMs:A.overlapDurationInMs=i.longs===String?ge(e.overlapDurationInMs):i.longs===Number?ce(e.overlapDurationInMs):e.overlapDurationInMs,i.oneofs&&(A._overlapDurationInMs="overlapDurationInMs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedMusic"},t})(),n.EncryptedPairingRequest=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.encryptedPayload=e.bytes();break}case 2:{s.iv=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EncryptedPairingRequest)return e;var i=new d.proto.EncryptedPairingRequest;return e.encryptedPayload!=null&&(typeof e.encryptedPayload=="string"?l.base64.decode(e.encryptedPayload,i.encryptedPayload=l.newBuffer(l.base64.length(e.encryptedPayload)),0):e.encryptedPayload.length>=0&&(i.encryptedPayload=e.encryptedPayload)),e.iv!=null&&(typeof e.iv=="string"?l.base64.decode(e.iv,i.iv=l.newBuffer(l.base64.length(e.iv)),0):e.iv.length>=0&&(i.iv=e.iv)),i},t.toObject=function(e,i){i||(i={});var A={};return e.encryptedPayload!=null&&e.hasOwnProperty("encryptedPayload")&&(A.encryptedPayload=i.bytes===String?l.base64.encode(e.encryptedPayload,0,e.encryptedPayload.length):i.bytes===Array?Array.prototype.slice.call(e.encryptedPayload):e.encryptedPayload,i.oneofs&&(A._encryptedPayload="encryptedPayload")),e.iv!=null&&e.hasOwnProperty("iv")&&(A.iv=i.bytes===String?l.base64.encode(e.iv,0,e.iv.length):i.bytes===Array?Array.prototype.slice.call(e.iv):e.iv,i.oneofs&&(A._iv="iv")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EncryptedPairingRequest"},t})(),n.EphemeralSetting=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.duration=e.sfixed32();break}case 2:{s.timestamp=e.sfixed64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EphemeralSetting)return e;var i=new d.proto.EphemeralSetting;return e.duration!=null&&(i.duration=e.duration|0),e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.duration!=null&&e.hasOwnProperty("duration")&&(A.duration=e.duration,i.oneofs&&(A._duration="duration")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=i.longs===String?String(e.timestamp):e.timestamp:A.timestamp=i.longs===String?ge(e.timestamp):i.longs===Number?ce(e.timestamp):e.timestamp,i.oneofs&&(A._timestamp="timestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EphemeralSetting"},t})(),n.EventAdditionalMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.isStale=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EventAdditionalMetadata)return e;var i=new d.proto.EventAdditionalMetadata;return e.isStale!=null&&(i.isStale=!!e.isStale),i},t.toObject=function(e,i){i||(i={});var A={};return e.isStale!=null&&e.hasOwnProperty("isStale")&&(A.isStale=e.isStale,i.oneofs&&(A._isStale="isStale")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EventAdditionalMetadata"},t})(),n.EventResponse=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.eventResponseMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.timestampMs=e.int64();break}case 3:{s.eventResponseMessage=d.proto.Message.EventResponseMessage.decode(e,e.uint32());break}case 4:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EventResponse)return e;var i=new d.proto.EventResponse;if(e.eventResponseMessageKey!=null){if(typeof e.eventResponseMessageKey!="object")throw TypeError(".proto.EventResponse.eventResponseMessageKey: object expected");i.eventResponseMessageKey=d.proto.MessageKey.fromObject(e.eventResponseMessageKey)}if(e.timestampMs!=null&&(l.Long?(i.timestampMs=l.Long.fromValue(e.timestampMs)).unsigned=!1:typeof e.timestampMs=="string"?i.timestampMs=parseInt(e.timestampMs,10):typeof e.timestampMs=="number"?i.timestampMs=e.timestampMs:typeof e.timestampMs=="object"&&(i.timestampMs=new l.LongBits(e.timestampMs.low>>>0,e.timestampMs.high>>>0).toNumber())),e.eventResponseMessage!=null){if(typeof e.eventResponseMessage!="object")throw TypeError(".proto.EventResponse.eventResponseMessage: object expected");i.eventResponseMessage=d.proto.Message.EventResponseMessage.fromObject(e.eventResponseMessage)}return e.unread!=null&&(i.unread=!!e.unread),i},t.toObject=function(e,i){i||(i={});var A={};return e.eventResponseMessageKey!=null&&e.hasOwnProperty("eventResponseMessageKey")&&(A.eventResponseMessageKey=d.proto.MessageKey.toObject(e.eventResponseMessageKey,i),i.oneofs&&(A._eventResponseMessageKey="eventResponseMessageKey")),e.timestampMs!=null&&e.hasOwnProperty("timestampMs")&&(typeof e.timestampMs=="number"?A.timestampMs=i.longs===String?String(e.timestampMs):e.timestampMs:A.timestampMs=i.longs===String?ge(e.timestampMs):i.longs===Number?ce(e.timestampMs):e.timestampMs,i.oneofs&&(A._timestampMs="timestampMs")),e.eventResponseMessage!=null&&e.hasOwnProperty("eventResponseMessage")&&(A.eventResponseMessage=d.proto.Message.EventResponseMessage.toObject(e.eventResponseMessage,i),i.oneofs&&(A._eventResponseMessage="eventResponseMessage")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,i.oneofs&&(A._unread="unread")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EventResponse"},t})(),n.ExitCode=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.code=e.uint64();break}case 2:{s.text=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ExitCode)return e;var i=new d.proto.ExitCode;return e.code!=null&&(l.Long?(i.code=l.Long.fromValue(e.code)).unsigned=!0:typeof e.code=="string"?i.code=parseInt(e.code,10):typeof e.code=="number"?i.code=e.code:typeof e.code=="object"&&(i.code=new l.LongBits(e.code.low>>>0,e.code.high>>>0).toNumber(!0))),e.text!=null&&(i.text=String(e.text)),i},t.toObject=function(e,i){i||(i={});var A={};return e.code!=null&&e.hasOwnProperty("code")&&(typeof e.code=="number"?A.code=i.longs===String?String(e.code):e.code:A.code=i.longs===String?ge(e.code,!0):i.longs===Number?ce(e.code,!0):e.code,i.oneofs&&(A._code="code")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,i.oneofs&&(A._text="text")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ExitCode"},t})(),n.ExternalBlobReference=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.mediaKey=e.bytes();break}case 2:{s.directPath=e.string();break}case 3:{s.handle=e.string();break}case 4:{s.fileSizeBytes=e.uint64();break}case 5:{s.fileSha256=e.bytes();break}case 6:{s.fileEncSha256=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ExternalBlobReference)return e;var i=new d.proto.ExternalBlobReference;return e.mediaKey!=null&&(typeof e.mediaKey=="string"?l.base64.decode(e.mediaKey,i.mediaKey=l.newBuffer(l.base64.length(e.mediaKey)),0):e.mediaKey.length>=0&&(i.mediaKey=e.mediaKey)),e.directPath!=null&&(i.directPath=String(e.directPath)),e.handle!=null&&(i.handle=String(e.handle)),e.fileSizeBytes!=null&&(l.Long?(i.fileSizeBytes=l.Long.fromValue(e.fileSizeBytes)).unsigned=!0:typeof e.fileSizeBytes=="string"?i.fileSizeBytes=parseInt(e.fileSizeBytes,10):typeof e.fileSizeBytes=="number"?i.fileSizeBytes=e.fileSizeBytes:typeof e.fileSizeBytes=="object"&&(i.fileSizeBytes=new l.LongBits(e.fileSizeBytes.low>>>0,e.fileSizeBytes.high>>>0).toNumber(!0))),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,i.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(i.fileSha256=e.fileSha256)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,i.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(i.fileEncSha256=e.fileEncSha256)),i},t.toObject=function(e,i){i||(i={});var A={};return e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=i.bytes===String?l.base64.encode(e.mediaKey,0,e.mediaKey.length):i.bytes===Array?Array.prototype.slice.call(e.mediaKey):e.mediaKey,i.oneofs&&(A._mediaKey="mediaKey")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,i.oneofs&&(A._directPath="directPath")),e.handle!=null&&e.hasOwnProperty("handle")&&(A.handle=e.handle,i.oneofs&&(A._handle="handle")),e.fileSizeBytes!=null&&e.hasOwnProperty("fileSizeBytes")&&(typeof e.fileSizeBytes=="number"?A.fileSizeBytes=i.longs===String?String(e.fileSizeBytes):e.fileSizeBytes:A.fileSizeBytes=i.longs===String?ge(e.fileSizeBytes,!0):i.longs===Number?ce(e.fileSizeBytes,!0):e.fileSizeBytes,i.oneofs&&(A._fileSizeBytes="fileSizeBytes")),e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=i.bytes===String?l.base64.encode(e.fileSha256,0,e.fileSha256.length):i.bytes===Array?Array.prototype.slice.call(e.fileSha256):e.fileSha256,i.oneofs&&(A._fileSha256="fileSha256")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=i.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):i.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,i.oneofs&&(A._fileEncSha256="fileEncSha256")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ExternalBlobReference"},t})(),n.Field=(function(){function t(a){if(this.subfield={},a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.minVersion=e.uint32();break}case 2:{s.maxVersion=e.uint32();break}case 3:{s.notReportableMinVersion=e.uint32();break}case 4:{s.isMessage=e.bool();break}case 5:{s.subfield===l.emptyObject&&(s.subfield={});var p=e.uint32()+e.pos;for(g=0,c=null;e.pos>>3){case 1:g=e.uint32();break;case 2:c=d.proto.Field.decode(e,e.uint32());break;default:e.skipType(B&7);break}}s.subfield[g]=c;break}default:e.skipType(I&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Field)return e;var i=new d.proto.Field;if(e.minVersion!=null&&(i.minVersion=e.minVersion>>>0),e.maxVersion!=null&&(i.maxVersion=e.maxVersion>>>0),e.notReportableMinVersion!=null&&(i.notReportableMinVersion=e.notReportableMinVersion>>>0),e.isMessage!=null&&(i.isMessage=!!e.isMessage),e.subfield){if(typeof e.subfield!="object")throw TypeError(".proto.Field.subfield: object expected");i.subfield={};for(var A=Object.keys(e.subfield),r=0;r>>3){case 1:{s.botName=e.string();break}case 2:{s.botJid=e.string();break}case 3:{s.creatorName=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ForwardedAIBotMessageInfo)return e;var i=new d.proto.ForwardedAIBotMessageInfo;return e.botName!=null&&(i.botName=String(e.botName)),e.botJid!=null&&(i.botJid=String(e.botJid)),e.creatorName!=null&&(i.creatorName=String(e.creatorName)),i},t.toObject=function(e,i){i||(i={});var A={};return e.botName!=null&&e.hasOwnProperty("botName")&&(A.botName=e.botName,i.oneofs&&(A._botName="botName")),e.botJid!=null&&e.hasOwnProperty("botJid")&&(A.botJid=e.botJid,i.oneofs&&(A._botJid="botJid")),e.creatorName!=null&&e.hasOwnProperty("creatorName")&&(A.creatorName=e.creatorName,i.oneofs&&(A._creatorName="creatorName")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ForwardedAIBotMessageInfo"},t})(),n.GlobalSettings=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.lightThemeWallpaper=d.proto.WallpaperSettings.decode(e,e.uint32());break}case 2:{s.mediaVisibility=e.int32();break}case 3:{s.darkThemeWallpaper=d.proto.WallpaperSettings.decode(e,e.uint32());break}case 4:{s.autoDownloadWiFi=d.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 5:{s.autoDownloadCellular=d.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 6:{s.autoDownloadRoaming=d.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 7:{s.showIndividualNotificationsPreview=e.bool();break}case 8:{s.showGroupNotificationsPreview=e.bool();break}case 9:{s.disappearingModeDuration=e.int32();break}case 10:{s.disappearingModeTimestamp=e.int64();break}case 11:{s.avatarUserSettings=d.proto.AvatarUserSettings.decode(e,e.uint32());break}case 12:{s.fontSize=e.int32();break}case 13:{s.securityNotifications=e.bool();break}case 14:{s.autoUnarchiveChats=e.bool();break}case 15:{s.videoQualityMode=e.int32();break}case 16:{s.photoQualityMode=e.int32();break}case 17:{s.individualNotificationSettings=d.proto.NotificationSettings.decode(e,e.uint32());break}case 18:{s.groupNotificationSettings=d.proto.NotificationSettings.decode(e,e.uint32());break}case 19:{s.chatLockSettings=d.proto.ChatLockSettings.decode(e,e.uint32());break}case 20:{s.chatDbLidMigrationTimestamp=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.GlobalSettings)return e;var i=new d.proto.GlobalSettings;if(e.lightThemeWallpaper!=null){if(typeof e.lightThemeWallpaper!="object")throw TypeError(".proto.GlobalSettings.lightThemeWallpaper: object expected");i.lightThemeWallpaper=d.proto.WallpaperSettings.fromObject(e.lightThemeWallpaper)}switch(e.mediaVisibility){default:if(typeof e.mediaVisibility=="number"){i.mediaVisibility=e.mediaVisibility;break}break;case"DEFAULT":case 0:i.mediaVisibility=0;break;case"OFF":case 1:i.mediaVisibility=1;break;case"ON":case 2:i.mediaVisibility=2;break}if(e.darkThemeWallpaper!=null){if(typeof e.darkThemeWallpaper!="object")throw TypeError(".proto.GlobalSettings.darkThemeWallpaper: object expected");i.darkThemeWallpaper=d.proto.WallpaperSettings.fromObject(e.darkThemeWallpaper)}if(e.autoDownloadWiFi!=null){if(typeof e.autoDownloadWiFi!="object")throw TypeError(".proto.GlobalSettings.autoDownloadWiFi: object expected");i.autoDownloadWiFi=d.proto.AutoDownloadSettings.fromObject(e.autoDownloadWiFi)}if(e.autoDownloadCellular!=null){if(typeof e.autoDownloadCellular!="object")throw TypeError(".proto.GlobalSettings.autoDownloadCellular: object expected");i.autoDownloadCellular=d.proto.AutoDownloadSettings.fromObject(e.autoDownloadCellular)}if(e.autoDownloadRoaming!=null){if(typeof e.autoDownloadRoaming!="object")throw TypeError(".proto.GlobalSettings.autoDownloadRoaming: object expected");i.autoDownloadRoaming=d.proto.AutoDownloadSettings.fromObject(e.autoDownloadRoaming)}if(e.showIndividualNotificationsPreview!=null&&(i.showIndividualNotificationsPreview=!!e.showIndividualNotificationsPreview),e.showGroupNotificationsPreview!=null&&(i.showGroupNotificationsPreview=!!e.showGroupNotificationsPreview),e.disappearingModeDuration!=null&&(i.disappearingModeDuration=e.disappearingModeDuration|0),e.disappearingModeTimestamp!=null&&(l.Long?(i.disappearingModeTimestamp=l.Long.fromValue(e.disappearingModeTimestamp)).unsigned=!1:typeof e.disappearingModeTimestamp=="string"?i.disappearingModeTimestamp=parseInt(e.disappearingModeTimestamp,10):typeof e.disappearingModeTimestamp=="number"?i.disappearingModeTimestamp=e.disappearingModeTimestamp:typeof e.disappearingModeTimestamp=="object"&&(i.disappearingModeTimestamp=new l.LongBits(e.disappearingModeTimestamp.low>>>0,e.disappearingModeTimestamp.high>>>0).toNumber())),e.avatarUserSettings!=null){if(typeof e.avatarUserSettings!="object")throw TypeError(".proto.GlobalSettings.avatarUserSettings: object expected");i.avatarUserSettings=d.proto.AvatarUserSettings.fromObject(e.avatarUserSettings)}if(e.fontSize!=null&&(i.fontSize=e.fontSize|0),e.securityNotifications!=null&&(i.securityNotifications=!!e.securityNotifications),e.autoUnarchiveChats!=null&&(i.autoUnarchiveChats=!!e.autoUnarchiveChats),e.videoQualityMode!=null&&(i.videoQualityMode=e.videoQualityMode|0),e.photoQualityMode!=null&&(i.photoQualityMode=e.photoQualityMode|0),e.individualNotificationSettings!=null){if(typeof e.individualNotificationSettings!="object")throw TypeError(".proto.GlobalSettings.individualNotificationSettings: object expected");i.individualNotificationSettings=d.proto.NotificationSettings.fromObject(e.individualNotificationSettings)}if(e.groupNotificationSettings!=null){if(typeof e.groupNotificationSettings!="object")throw TypeError(".proto.GlobalSettings.groupNotificationSettings: object expected");i.groupNotificationSettings=d.proto.NotificationSettings.fromObject(e.groupNotificationSettings)}if(e.chatLockSettings!=null){if(typeof e.chatLockSettings!="object")throw TypeError(".proto.GlobalSettings.chatLockSettings: object expected");i.chatLockSettings=d.proto.ChatLockSettings.fromObject(e.chatLockSettings)}return e.chatDbLidMigrationTimestamp!=null&&(l.Long?(i.chatDbLidMigrationTimestamp=l.Long.fromValue(e.chatDbLidMigrationTimestamp)).unsigned=!1:typeof e.chatDbLidMigrationTimestamp=="string"?i.chatDbLidMigrationTimestamp=parseInt(e.chatDbLidMigrationTimestamp,10):typeof e.chatDbLidMigrationTimestamp=="number"?i.chatDbLidMigrationTimestamp=e.chatDbLidMigrationTimestamp:typeof e.chatDbLidMigrationTimestamp=="object"&&(i.chatDbLidMigrationTimestamp=new l.LongBits(e.chatDbLidMigrationTimestamp.low>>>0,e.chatDbLidMigrationTimestamp.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.lightThemeWallpaper!=null&&e.hasOwnProperty("lightThemeWallpaper")&&(A.lightThemeWallpaper=d.proto.WallpaperSettings.toObject(e.lightThemeWallpaper,i),i.oneofs&&(A._lightThemeWallpaper="lightThemeWallpaper")),e.mediaVisibility!=null&&e.hasOwnProperty("mediaVisibility")&&(A.mediaVisibility=i.enums===String?d.proto.MediaVisibility[e.mediaVisibility]===void 0?e.mediaVisibility:d.proto.MediaVisibility[e.mediaVisibility]:e.mediaVisibility,i.oneofs&&(A._mediaVisibility="mediaVisibility")),e.darkThemeWallpaper!=null&&e.hasOwnProperty("darkThemeWallpaper")&&(A.darkThemeWallpaper=d.proto.WallpaperSettings.toObject(e.darkThemeWallpaper,i),i.oneofs&&(A._darkThemeWallpaper="darkThemeWallpaper")),e.autoDownloadWiFi!=null&&e.hasOwnProperty("autoDownloadWiFi")&&(A.autoDownloadWiFi=d.proto.AutoDownloadSettings.toObject(e.autoDownloadWiFi,i),i.oneofs&&(A._autoDownloadWiFi="autoDownloadWiFi")),e.autoDownloadCellular!=null&&e.hasOwnProperty("autoDownloadCellular")&&(A.autoDownloadCellular=d.proto.AutoDownloadSettings.toObject(e.autoDownloadCellular,i),i.oneofs&&(A._autoDownloadCellular="autoDownloadCellular")),e.autoDownloadRoaming!=null&&e.hasOwnProperty("autoDownloadRoaming")&&(A.autoDownloadRoaming=d.proto.AutoDownloadSettings.toObject(e.autoDownloadRoaming,i),i.oneofs&&(A._autoDownloadRoaming="autoDownloadRoaming")),e.showIndividualNotificationsPreview!=null&&e.hasOwnProperty("showIndividualNotificationsPreview")&&(A.showIndividualNotificationsPreview=e.showIndividualNotificationsPreview,i.oneofs&&(A._showIndividualNotificationsPreview="showIndividualNotificationsPreview")),e.showGroupNotificationsPreview!=null&&e.hasOwnProperty("showGroupNotificationsPreview")&&(A.showGroupNotificationsPreview=e.showGroupNotificationsPreview,i.oneofs&&(A._showGroupNotificationsPreview="showGroupNotificationsPreview")),e.disappearingModeDuration!=null&&e.hasOwnProperty("disappearingModeDuration")&&(A.disappearingModeDuration=e.disappearingModeDuration,i.oneofs&&(A._disappearingModeDuration="disappearingModeDuration")),e.disappearingModeTimestamp!=null&&e.hasOwnProperty("disappearingModeTimestamp")&&(typeof e.disappearingModeTimestamp=="number"?A.disappearingModeTimestamp=i.longs===String?String(e.disappearingModeTimestamp):e.disappearingModeTimestamp:A.disappearingModeTimestamp=i.longs===String?ge(e.disappearingModeTimestamp):i.longs===Number?ce(e.disappearingModeTimestamp):e.disappearingModeTimestamp,i.oneofs&&(A._disappearingModeTimestamp="disappearingModeTimestamp")),e.avatarUserSettings!=null&&e.hasOwnProperty("avatarUserSettings")&&(A.avatarUserSettings=d.proto.AvatarUserSettings.toObject(e.avatarUserSettings,i),i.oneofs&&(A._avatarUserSettings="avatarUserSettings")),e.fontSize!=null&&e.hasOwnProperty("fontSize")&&(A.fontSize=e.fontSize,i.oneofs&&(A._fontSize="fontSize")),e.securityNotifications!=null&&e.hasOwnProperty("securityNotifications")&&(A.securityNotifications=e.securityNotifications,i.oneofs&&(A._securityNotifications="securityNotifications")),e.autoUnarchiveChats!=null&&e.hasOwnProperty("autoUnarchiveChats")&&(A.autoUnarchiveChats=e.autoUnarchiveChats,i.oneofs&&(A._autoUnarchiveChats="autoUnarchiveChats")),e.videoQualityMode!=null&&e.hasOwnProperty("videoQualityMode")&&(A.videoQualityMode=e.videoQualityMode,i.oneofs&&(A._videoQualityMode="videoQualityMode")),e.photoQualityMode!=null&&e.hasOwnProperty("photoQualityMode")&&(A.photoQualityMode=e.photoQualityMode,i.oneofs&&(A._photoQualityMode="photoQualityMode")),e.individualNotificationSettings!=null&&e.hasOwnProperty("individualNotificationSettings")&&(A.individualNotificationSettings=d.proto.NotificationSettings.toObject(e.individualNotificationSettings,i),i.oneofs&&(A._individualNotificationSettings="individualNotificationSettings")),e.groupNotificationSettings!=null&&e.hasOwnProperty("groupNotificationSettings")&&(A.groupNotificationSettings=d.proto.NotificationSettings.toObject(e.groupNotificationSettings,i),i.oneofs&&(A._groupNotificationSettings="groupNotificationSettings")),e.chatLockSettings!=null&&e.hasOwnProperty("chatLockSettings")&&(A.chatLockSettings=d.proto.ChatLockSettings.toObject(e.chatLockSettings,i),i.oneofs&&(A._chatLockSettings="chatLockSettings")),e.chatDbLidMigrationTimestamp!=null&&e.hasOwnProperty("chatDbLidMigrationTimestamp")&&(typeof e.chatDbLidMigrationTimestamp=="number"?A.chatDbLidMigrationTimestamp=i.longs===String?String(e.chatDbLidMigrationTimestamp):e.chatDbLidMigrationTimestamp:A.chatDbLidMigrationTimestamp=i.longs===String?ge(e.chatDbLidMigrationTimestamp):i.longs===Number?ce(e.chatDbLidMigrationTimestamp):e.chatDbLidMigrationTimestamp,i.oneofs&&(A._chatDbLidMigrationTimestamp="chatDbLidMigrationTimestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GlobalSettings"},t})(),n.GroupHistoryBundleInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.deprecatedMessageHistoryBundle=d.proto.Message.MessageHistoryBundle.decode(e,e.uint32());break}case 2:{s.processState=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.GroupHistoryBundleInfo)return e;var i=new d.proto.GroupHistoryBundleInfo;if(e.deprecatedMessageHistoryBundle!=null){if(typeof e.deprecatedMessageHistoryBundle!="object")throw TypeError(".proto.GroupHistoryBundleInfo.deprecatedMessageHistoryBundle: object expected");i.deprecatedMessageHistoryBundle=d.proto.Message.MessageHistoryBundle.fromObject(e.deprecatedMessageHistoryBundle)}switch(e.processState){default:if(typeof e.processState=="number"){i.processState=e.processState;break}break;case"NOT_INJECTED":case 0:i.processState=0;break;case"INJECTED":case 1:i.processState=1;break;case"INJECTED_PARTIAL":case 2:i.processState=2;break;case"INJECTION_FAILED":case 3:i.processState=3;break;case"INJECTION_FAILED_NO_RETRY":case 4:i.processState=4;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.deprecatedMessageHistoryBundle!=null&&e.hasOwnProperty("deprecatedMessageHistoryBundle")&&(A.deprecatedMessageHistoryBundle=d.proto.Message.MessageHistoryBundle.toObject(e.deprecatedMessageHistoryBundle,i),i.oneofs&&(A._deprecatedMessageHistoryBundle="deprecatedMessageHistoryBundle")),e.processState!=null&&e.hasOwnProperty("processState")&&(A.processState=i.enums===String?d.proto.GroupHistoryBundleInfo.ProcessState[e.processState]===void 0?e.processState:d.proto.GroupHistoryBundleInfo.ProcessState[e.processState]:e.processState,i.oneofs&&(A._processState="processState")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupHistoryBundleInfo"},t.ProcessState=(function(){let a={},e=Object.create(a);return e[a[0]="NOT_INJECTED"]=0,e[a[1]="INJECTED"]=1,e[a[2]="INJECTED_PARTIAL"]=2,e[a[3]="INJECTION_FAILED"]=3,e[a[4]="INJECTION_FAILED_NO_RETRY"]=4,e})(),t})(),n.GroupHistoryIndividualMessageInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.bundleMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.editedAfterReceivedAsHistory=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.GroupHistoryIndividualMessageInfo)return e;var i=new d.proto.GroupHistoryIndividualMessageInfo;if(e.bundleMessageKey!=null){if(typeof e.bundleMessageKey!="object")throw TypeError(".proto.GroupHistoryIndividualMessageInfo.bundleMessageKey: object expected");i.bundleMessageKey=d.proto.MessageKey.fromObject(e.bundleMessageKey)}return e.editedAfterReceivedAsHistory!=null&&(i.editedAfterReceivedAsHistory=!!e.editedAfterReceivedAsHistory),i},t.toObject=function(e,i){i||(i={});var A={};return e.bundleMessageKey!=null&&e.hasOwnProperty("bundleMessageKey")&&(A.bundleMessageKey=d.proto.MessageKey.toObject(e.bundleMessageKey,i),i.oneofs&&(A._bundleMessageKey="bundleMessageKey")),e.editedAfterReceivedAsHistory!=null&&e.hasOwnProperty("editedAfterReceivedAsHistory")&&(A.editedAfterReceivedAsHistory=e.editedAfterReceivedAsHistory,i.oneofs&&(A._editedAfterReceivedAsHistory="editedAfterReceivedAsHistory")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupHistoryIndividualMessageInfo"},t})(),n.GroupMention=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.groupJid=e.string();break}case 2:{s.groupSubject=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.GroupMention)return e;var i=new d.proto.GroupMention;return e.groupJid!=null&&(i.groupJid=String(e.groupJid)),e.groupSubject!=null&&(i.groupSubject=String(e.groupSubject)),i},t.toObject=function(e,i){i||(i={});var A={};return e.groupJid!=null&&e.hasOwnProperty("groupJid")&&(A.groupJid=e.groupJid,i.oneofs&&(A._groupJid="groupJid")),e.groupSubject!=null&&e.hasOwnProperty("groupSubject")&&(A.groupSubject=e.groupSubject,i.oneofs&&(A._groupSubject="groupSubject")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupMention"},t})(),n.GroupParticipant=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.userJid=e.string();break}case 2:{s.rank=e.int32();break}case 3:{s.memberLabel=d.proto.MemberLabel.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.GroupParticipant)return e;var i=new d.proto.GroupParticipant;switch(e.userJid!=null&&(i.userJid=String(e.userJid)),e.rank){default:if(typeof e.rank=="number"){i.rank=e.rank;break}break;case"REGULAR":case 0:i.rank=0;break;case"ADMIN":case 1:i.rank=1;break;case"SUPERADMIN":case 2:i.rank=2;break}if(e.memberLabel!=null){if(typeof e.memberLabel!="object")throw TypeError(".proto.GroupParticipant.memberLabel: object expected");i.memberLabel=d.proto.MemberLabel.fromObject(e.memberLabel)}return i},t.toObject=function(e,i){i||(i={});var A={};return i.defaults&&(A.userJid=""),e.userJid!=null&&e.hasOwnProperty("userJid")&&(A.userJid=e.userJid),e.rank!=null&&e.hasOwnProperty("rank")&&(A.rank=i.enums===String?d.proto.GroupParticipant.Rank[e.rank]===void 0?e.rank:d.proto.GroupParticipant.Rank[e.rank]:e.rank,i.oneofs&&(A._rank="rank")),e.memberLabel!=null&&e.hasOwnProperty("memberLabel")&&(A.memberLabel=d.proto.MemberLabel.toObject(e.memberLabel,i),i.oneofs&&(A._memberLabel="memberLabel")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupParticipant"},t.Rank=(function(){let a={},e=Object.create(a);return e[a[0]="REGULAR"]=0,e[a[1]="ADMIN"]=1,e[a[2]="SUPERADMIN"]=2,e})(),t})(),n.HandshakeMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 2:{s.clientHello=d.proto.HandshakeMessage.ClientHello.decode(e,e.uint32());break}case 3:{s.serverHello=d.proto.HandshakeMessage.ServerHello.decode(e,e.uint32());break}case 4:{s.clientFinish=d.proto.HandshakeMessage.ClientFinish.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.HandshakeMessage)return e;var i=new d.proto.HandshakeMessage;if(e.clientHello!=null){if(typeof e.clientHello!="object")throw TypeError(".proto.HandshakeMessage.clientHello: object expected");i.clientHello=d.proto.HandshakeMessage.ClientHello.fromObject(e.clientHello)}if(e.serverHello!=null){if(typeof e.serverHello!="object")throw TypeError(".proto.HandshakeMessage.serverHello: object expected");i.serverHello=d.proto.HandshakeMessage.ServerHello.fromObject(e.serverHello)}if(e.clientFinish!=null){if(typeof e.clientFinish!="object")throw TypeError(".proto.HandshakeMessage.clientFinish: object expected");i.clientFinish=d.proto.HandshakeMessage.ClientFinish.fromObject(e.clientFinish)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.clientHello!=null&&e.hasOwnProperty("clientHello")&&(A.clientHello=d.proto.HandshakeMessage.ClientHello.toObject(e.clientHello,i),i.oneofs&&(A._clientHello="clientHello")),e.serverHello!=null&&e.hasOwnProperty("serverHello")&&(A.serverHello=d.proto.HandshakeMessage.ServerHello.toObject(e.serverHello,i),i.oneofs&&(A._serverHello="serverHello")),e.clientFinish!=null&&e.hasOwnProperty("clientFinish")&&(A.clientFinish=d.proto.HandshakeMessage.ClientFinish.toObject(e.clientFinish,i),i.oneofs&&(A._clientFinish="clientFinish")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HandshakeMessage"},t.ClientFinish=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.static=A.bytes();break}case 2:{c.payload=A.bytes();break}case 3:{c.extendedCiphertext=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.HandshakeMessage.ClientFinish)return A;var r=new d.proto.HandshakeMessage.ClientFinish;return A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,r.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(r.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,r.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(r.payload=A.payload)),A.extendedCiphertext!=null&&(typeof A.extendedCiphertext=="string"?l.base64.decode(A.extendedCiphertext,r.extendedCiphertext=l.newBuffer(l.base64.length(A.extendedCiphertext)),0):A.extendedCiphertext.length>=0&&(r.extendedCiphertext=A.extendedCiphertext)),r},a.toObject=function(A,r){r||(r={});var s={};return A.static!=null&&A.hasOwnProperty("static")&&(s.static=r.bytes===String?l.base64.encode(A.static,0,A.static.length):r.bytes===Array?Array.prototype.slice.call(A.static):A.static,r.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=r.bytes===String?l.base64.encode(A.payload,0,A.payload.length):r.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,r.oneofs&&(s._payload="payload")),A.extendedCiphertext!=null&&A.hasOwnProperty("extendedCiphertext")&&(s.extendedCiphertext=r.bytes===String?l.base64.encode(A.extendedCiphertext,0,A.extendedCiphertext.length):r.bytes===Array?Array.prototype.slice.call(A.extendedCiphertext):A.extendedCiphertext,r.oneofs&&(s._extendedCiphertext="extendedCiphertext")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ClientFinish"},a})(),t.ClientHello=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.ephemeral=A.bytes();break}case 2:{c.static=A.bytes();break}case 3:{c.payload=A.bytes();break}case 4:{c.useExtended=A.bool();break}case 5:{c.extendedCiphertext=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.HandshakeMessage.ClientHello)return A;var r=new d.proto.HandshakeMessage.ClientHello;return A.ephemeral!=null&&(typeof A.ephemeral=="string"?l.base64.decode(A.ephemeral,r.ephemeral=l.newBuffer(l.base64.length(A.ephemeral)),0):A.ephemeral.length>=0&&(r.ephemeral=A.ephemeral)),A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,r.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(r.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,r.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(r.payload=A.payload)),A.useExtended!=null&&(r.useExtended=!!A.useExtended),A.extendedCiphertext!=null&&(typeof A.extendedCiphertext=="string"?l.base64.decode(A.extendedCiphertext,r.extendedCiphertext=l.newBuffer(l.base64.length(A.extendedCiphertext)),0):A.extendedCiphertext.length>=0&&(r.extendedCiphertext=A.extendedCiphertext)),r},a.toObject=function(A,r){r||(r={});var s={};return A.ephemeral!=null&&A.hasOwnProperty("ephemeral")&&(s.ephemeral=r.bytes===String?l.base64.encode(A.ephemeral,0,A.ephemeral.length):r.bytes===Array?Array.prototype.slice.call(A.ephemeral):A.ephemeral,r.oneofs&&(s._ephemeral="ephemeral")),A.static!=null&&A.hasOwnProperty("static")&&(s.static=r.bytes===String?l.base64.encode(A.static,0,A.static.length):r.bytes===Array?Array.prototype.slice.call(A.static):A.static,r.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=r.bytes===String?l.base64.encode(A.payload,0,A.payload.length):r.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,r.oneofs&&(s._payload="payload")),A.useExtended!=null&&A.hasOwnProperty("useExtended")&&(s.useExtended=A.useExtended,r.oneofs&&(s._useExtended="useExtended")),A.extendedCiphertext!=null&&A.hasOwnProperty("extendedCiphertext")&&(s.extendedCiphertext=r.bytes===String?l.base64.encode(A.extendedCiphertext,0,A.extendedCiphertext.length):r.bytes===Array?Array.prototype.slice.call(A.extendedCiphertext):A.extendedCiphertext,r.oneofs&&(s._extendedCiphertext="extendedCiphertext")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ClientHello"},a})(),t.ServerHello=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.ephemeral=A.bytes();break}case 2:{c.static=A.bytes();break}case 3:{c.payload=A.bytes();break}case 4:{c.extendedStatic=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.HandshakeMessage.ServerHello)return A;var r=new d.proto.HandshakeMessage.ServerHello;return A.ephemeral!=null&&(typeof A.ephemeral=="string"?l.base64.decode(A.ephemeral,r.ephemeral=l.newBuffer(l.base64.length(A.ephemeral)),0):A.ephemeral.length>=0&&(r.ephemeral=A.ephemeral)),A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,r.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(r.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,r.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(r.payload=A.payload)),A.extendedStatic!=null&&(typeof A.extendedStatic=="string"?l.base64.decode(A.extendedStatic,r.extendedStatic=l.newBuffer(l.base64.length(A.extendedStatic)),0):A.extendedStatic.length>=0&&(r.extendedStatic=A.extendedStatic)),r},a.toObject=function(A,r){r||(r={});var s={};return A.ephemeral!=null&&A.hasOwnProperty("ephemeral")&&(s.ephemeral=r.bytes===String?l.base64.encode(A.ephemeral,0,A.ephemeral.length):r.bytes===Array?Array.prototype.slice.call(A.ephemeral):A.ephemeral,r.oneofs&&(s._ephemeral="ephemeral")),A.static!=null&&A.hasOwnProperty("static")&&(s.static=r.bytes===String?l.base64.encode(A.static,0,A.static.length):r.bytes===Array?Array.prototype.slice.call(A.static):A.static,r.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=r.bytes===String?l.base64.encode(A.payload,0,A.payload.length):r.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,r.oneofs&&(s._payload="payload")),A.extendedStatic!=null&&A.hasOwnProperty("extendedStatic")&&(s.extendedStatic=r.bytes===String?l.base64.encode(A.extendedStatic,0,A.extendedStatic.length):r.bytes===Array?Array.prototype.slice.call(A.extendedStatic):A.extendedStatic,r.oneofs&&(s._extendedStatic="extendedStatic")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ServerHello"},a})(),t})(),n.HistorySync=(function(){function t(a){if(this.conversations=[],this.statusV3Messages=[],this.pushnames=[],this.recentStickers=[],this.pastParticipants=[],this.callLogRecords=[],this.phoneNumberToLidMappings=[],this.accounts=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.syncType=e.int32();break}case 2:{s.conversations&&s.conversations.length||(s.conversations=[]),s.conversations.push(d.proto.Conversation.decode(e,e.uint32()));break}case 3:{s.statusV3Messages&&s.statusV3Messages.length||(s.statusV3Messages=[]),s.statusV3Messages.push(d.proto.WebMessageInfo.decode(e,e.uint32()));break}case 5:{s.chunkOrder=e.uint32();break}case 6:{s.progress=e.uint32();break}case 7:{s.pushnames&&s.pushnames.length||(s.pushnames=[]),s.pushnames.push(d.proto.Pushname.decode(e,e.uint32()));break}case 8:{s.globalSettings=d.proto.GlobalSettings.decode(e,e.uint32());break}case 9:{s.threadIdUserSecret=e.bytes();break}case 10:{s.threadDsTimeframeOffset=e.uint32();break}case 11:{s.recentStickers&&s.recentStickers.length||(s.recentStickers=[]),s.recentStickers.push(d.proto.StickerMetadata.decode(e,e.uint32()));break}case 12:{s.pastParticipants&&s.pastParticipants.length||(s.pastParticipants=[]),s.pastParticipants.push(d.proto.PastParticipants.decode(e,e.uint32()));break}case 13:{s.callLogRecords&&s.callLogRecords.length||(s.callLogRecords=[]),s.callLogRecords.push(d.proto.CallLogRecord.decode(e,e.uint32()));break}case 14:{s.aiWaitListState=e.int32();break}case 15:{s.phoneNumberToLidMappings&&s.phoneNumberToLidMappings.length||(s.phoneNumberToLidMappings=[]),s.phoneNumberToLidMappings.push(d.proto.PhoneNumberToLIDMapping.decode(e,e.uint32()));break}case 16:{s.companionMetaNonce=e.string();break}case 17:{s.shareableChatIdentifierEncryptionKey=e.bytes();break}case 18:{s.accounts&&s.accounts.length||(s.accounts=[]),s.accounts.push(d.proto.Account.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.HistorySync)return e;var i=new d.proto.HistorySync;switch(e.syncType){default:if(typeof e.syncType=="number"){i.syncType=e.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:i.syncType=0;break;case"INITIAL_STATUS_V3":case 1:i.syncType=1;break;case"FULL":case 2:i.syncType=2;break;case"RECENT":case 3:i.syncType=3;break;case"PUSH_NAME":case 4:i.syncType=4;break;case"NON_BLOCKING_DATA":case 5:i.syncType=5;break;case"ON_DEMAND":case 6:i.syncType=6;break}if(e.conversations){if(!Array.isArray(e.conversations))throw TypeError(".proto.HistorySync.conversations: array expected");i.conversations=[];for(var A=0;A>>0),e.progress!=null&&(i.progress=e.progress>>>0),e.pushnames){if(!Array.isArray(e.pushnames))throw TypeError(".proto.HistorySync.pushnames: array expected");i.pushnames=[];for(var A=0;A=0&&(i.threadIdUserSecret=e.threadIdUserSecret)),e.threadDsTimeframeOffset!=null&&(i.threadDsTimeframeOffset=e.threadDsTimeframeOffset>>>0),e.recentStickers){if(!Array.isArray(e.recentStickers))throw TypeError(".proto.HistorySync.recentStickers: array expected");i.recentStickers=[];for(var A=0;A=0&&(i.shareableChatIdentifierEncryptionKey=e.shareableChatIdentifierEncryptionKey)),e.accounts){if(!Array.isArray(e.accounts))throw TypeError(".proto.HistorySync.accounts: array expected");i.accounts=[];for(var A=0;A>>3){case 1:{s.message=d.proto.WebMessageInfo.decode(e,e.uint32());break}case 2:{s.msgOrderId=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.HistorySyncMsg)return e;var i=new d.proto.HistorySyncMsg;if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.HistorySyncMsg.message: object expected");i.message=d.proto.WebMessageInfo.fromObject(e.message)}return e.msgOrderId!=null&&(l.Long?(i.msgOrderId=l.Long.fromValue(e.msgOrderId)).unsigned=!0:typeof e.msgOrderId=="string"?i.msgOrderId=parseInt(e.msgOrderId,10):typeof e.msgOrderId=="number"?i.msgOrderId=e.msgOrderId:typeof e.msgOrderId=="object"&&(i.msgOrderId=new l.LongBits(e.msgOrderId.low>>>0,e.msgOrderId.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};return e.message!=null&&e.hasOwnProperty("message")&&(A.message=d.proto.WebMessageInfo.toObject(e.message,i),i.oneofs&&(A._message="message")),e.msgOrderId!=null&&e.hasOwnProperty("msgOrderId")&&(typeof e.msgOrderId=="number"?A.msgOrderId=i.longs===String?String(e.msgOrderId):e.msgOrderId:A.msgOrderId=i.longs===String?ge(e.msgOrderId,!0):i.longs===Number?ce(e.msgOrderId,!0):e.msgOrderId,i.oneofs&&(A._msgOrderId="msgOrderId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HistorySyncMsg"},t})(),n.HydratedTemplateButton=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 4:{s.index=e.uint32();break}case 1:{s.quickReplyButton=d.proto.HydratedTemplateButton.HydratedQuickReplyButton.decode(e,e.uint32());break}case 2:{s.urlButton=d.proto.HydratedTemplateButton.HydratedURLButton.decode(e,e.uint32());break}case 3:{s.callButton=d.proto.HydratedTemplateButton.HydratedCallButton.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.HydratedTemplateButton)return e;var i=new d.proto.HydratedTemplateButton;if(e.index!=null&&(i.index=e.index>>>0),e.quickReplyButton!=null){if(typeof e.quickReplyButton!="object")throw TypeError(".proto.HydratedTemplateButton.quickReplyButton: object expected");i.quickReplyButton=d.proto.HydratedTemplateButton.HydratedQuickReplyButton.fromObject(e.quickReplyButton)}if(e.urlButton!=null){if(typeof e.urlButton!="object")throw TypeError(".proto.HydratedTemplateButton.urlButton: object expected");i.urlButton=d.proto.HydratedTemplateButton.HydratedURLButton.fromObject(e.urlButton)}if(e.callButton!=null){if(typeof e.callButton!="object")throw TypeError(".proto.HydratedTemplateButton.callButton: object expected");i.callButton=d.proto.HydratedTemplateButton.HydratedCallButton.fromObject(e.callButton)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.quickReplyButton!=null&&e.hasOwnProperty("quickReplyButton")&&(A.quickReplyButton=d.proto.HydratedTemplateButton.HydratedQuickReplyButton.toObject(e.quickReplyButton,i),i.oneofs&&(A.hydratedButton="quickReplyButton")),e.urlButton!=null&&e.hasOwnProperty("urlButton")&&(A.urlButton=d.proto.HydratedTemplateButton.HydratedURLButton.toObject(e.urlButton,i),i.oneofs&&(A.hydratedButton="urlButton")),e.callButton!=null&&e.hasOwnProperty("callButton")&&(A.callButton=d.proto.HydratedTemplateButton.HydratedCallButton.toObject(e.callButton,i),i.oneofs&&(A.hydratedButton="callButton")),e.index!=null&&e.hasOwnProperty("index")&&(A.index=e.index,i.oneofs&&(A._index="index")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HydratedTemplateButton"},t.HydratedCallButton=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayText=A.string();break}case 2:{c.phoneNumber=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.HydratedTemplateButton.HydratedCallButton)return A;var r=new d.proto.HydratedTemplateButton.HydratedCallButton;return A.displayText!=null&&(r.displayText=String(A.displayText)),A.phoneNumber!=null&&(r.phoneNumber=String(A.phoneNumber)),r},a.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,r.oneofs&&(s._displayText="displayText")),A.phoneNumber!=null&&A.hasOwnProperty("phoneNumber")&&(s.phoneNumber=A.phoneNumber,r.oneofs&&(s._phoneNumber="phoneNumber")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedCallButton"},a})(),t.HydratedQuickReplyButton=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayText=A.string();break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.HydratedTemplateButton.HydratedQuickReplyButton)return A;var r=new d.proto.HydratedTemplateButton.HydratedQuickReplyButton;return A.displayText!=null&&(r.displayText=String(A.displayText)),A.id!=null&&(r.id=String(A.id)),r},a.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,r.oneofs&&(s._displayText="displayText")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedQuickReplyButton"},a})(),t.HydratedURLButton=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayText=A.string();break}case 2:{c.url=A.string();break}case 3:{c.consentedUsersUrl=A.string();break}case 4:{c.webviewPresentation=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.HydratedTemplateButton.HydratedURLButton)return A;var r=new d.proto.HydratedTemplateButton.HydratedURLButton;switch(A.displayText!=null&&(r.displayText=String(A.displayText)),A.url!=null&&(r.url=String(A.url)),A.consentedUsersUrl!=null&&(r.consentedUsersUrl=String(A.consentedUsersUrl)),A.webviewPresentation){default:if(typeof A.webviewPresentation=="number"){r.webviewPresentation=A.webviewPresentation;break}break;case"FULL":case 1:r.webviewPresentation=1;break;case"TALL":case 2:r.webviewPresentation=2;break;case"COMPACT":case 3:r.webviewPresentation=3;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,r.oneofs&&(s._displayText="displayText")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.consentedUsersUrl!=null&&A.hasOwnProperty("consentedUsersUrl")&&(s.consentedUsersUrl=A.consentedUsersUrl,r.oneofs&&(s._consentedUsersUrl="consentedUsersUrl")),A.webviewPresentation!=null&&A.hasOwnProperty("webviewPresentation")&&(s.webviewPresentation=r.enums===String?d.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[A.webviewPresentation]===void 0?A.webviewPresentation:d.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[A.webviewPresentation]:A.webviewPresentation,r.oneofs&&(s._webviewPresentation="webviewPresentation")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedURLButton"},a.WebviewPresentationType=(function(){let i={},A=Object.create(i);return A[i[1]="FULL"]=1,A[i[2]="TALL"]=2,A[i[3]="COMPACT"]=3,A})(),a})(),t})(),n.IdentityKeyPairStructure=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.privateKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.IdentityKeyPairStructure)return e;var i=new d.proto.IdentityKeyPairStructure;return e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,i.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(i.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,i.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(i.privateKey=e.privateKey)),i},t.toObject=function(e,i){i||(i={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=i.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):i.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,i.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=i.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):i.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,i.oneofs&&(A._privateKey="privateKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.IdentityKeyPairStructure"},t})(),n.InThreadSurveyMetadata=(function(){function t(a){if(this.questions=[],this.privacyStatementParts=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.tessaSessionId=e.string();break}case 2:{s.simonSessionId=e.string();break}case 3:{s.simonSurveyId=e.string();break}case 4:{s.tessaRootId=e.string();break}case 5:{s.requestId=e.string();break}case 6:{s.tessaEvent=e.string();break}case 7:{s.invitationHeaderText=e.string();break}case 8:{s.invitationBodyText=e.string();break}case 9:{s.invitationCtaText=e.string();break}case 10:{s.invitationCtaUrl=e.string();break}case 11:{s.surveyTitle=e.string();break}case 12:{s.questions&&s.questions.length||(s.questions=[]),s.questions.push(d.proto.InThreadSurveyMetadata.InThreadSurveyQuestion.decode(e,e.uint32()));break}case 13:{s.surveyContinueButtonText=e.string();break}case 14:{s.surveySubmitButtonText=e.string();break}case 15:{s.privacyStatementFull=e.string();break}case 16:{s.privacyStatementParts&&s.privacyStatementParts.length||(s.privacyStatementParts=[]),s.privacyStatementParts.push(d.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart.decode(e,e.uint32()));break}case 17:{s.feedbackToastText=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.InThreadSurveyMetadata)return e;var i=new d.proto.InThreadSurveyMetadata;if(e.tessaSessionId!=null&&(i.tessaSessionId=String(e.tessaSessionId)),e.simonSessionId!=null&&(i.simonSessionId=String(e.simonSessionId)),e.simonSurveyId!=null&&(i.simonSurveyId=String(e.simonSurveyId)),e.tessaRootId!=null&&(i.tessaRootId=String(e.tessaRootId)),e.requestId!=null&&(i.requestId=String(e.requestId)),e.tessaEvent!=null&&(i.tessaEvent=String(e.tessaEvent)),e.invitationHeaderText!=null&&(i.invitationHeaderText=String(e.invitationHeaderText)),e.invitationBodyText!=null&&(i.invitationBodyText=String(e.invitationBodyText)),e.invitationCtaText!=null&&(i.invitationCtaText=String(e.invitationCtaText)),e.invitationCtaUrl!=null&&(i.invitationCtaUrl=String(e.invitationCtaUrl)),e.surveyTitle!=null&&(i.surveyTitle=String(e.surveyTitle)),e.questions){if(!Array.isArray(e.questions))throw TypeError(".proto.InThreadSurveyMetadata.questions: array expected");i.questions=[];for(var A=0;A>>3){case 1:{c.stringValue=A.string();break}case 2:{c.numericValue=A.uint32();break}case 3:{c.textTranslated=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.InThreadSurveyMetadata.InThreadSurveyOption)return A;var r=new d.proto.InThreadSurveyMetadata.InThreadSurveyOption;return A.stringValue!=null&&(r.stringValue=String(A.stringValue)),A.numericValue!=null&&(r.numericValue=A.numericValue>>>0),A.textTranslated!=null&&(r.textTranslated=String(A.textTranslated)),r},a.toObject=function(A,r){r||(r={});var s={};return A.stringValue!=null&&A.hasOwnProperty("stringValue")&&(s.stringValue=A.stringValue,r.oneofs&&(s._stringValue="stringValue")),A.numericValue!=null&&A.hasOwnProperty("numericValue")&&(s.numericValue=A.numericValue,r.oneofs&&(s._numericValue="numericValue")),A.textTranslated!=null&&A.hasOwnProperty("textTranslated")&&(s.textTranslated=A.textTranslated,r.oneofs&&(s._textTranslated="textTranslated")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.InThreadSurveyMetadata.InThreadSurveyOption"},a})(),t.InThreadSurveyPrivacyStatementPart=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.text=A.string();break}case 2:{c.url=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart)return A;var r=new d.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart;return A.text!=null&&(r.text=String(A.text)),A.url!=null&&(r.url=String(A.url)),r},a.toObject=function(A,r){r||(r={});var s={};return A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart"},a})(),t.InThreadSurveyQuestion=(function(){function a(i){if(this.questionOptions=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.questionText=A.string();break}case 2:{c.questionId=A.string();break}case 3:{c.questionOptions&&c.questionOptions.length||(c.questionOptions=[]),c.questionOptions.push(d.proto.InThreadSurveyMetadata.InThreadSurveyOption.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.InThreadSurveyMetadata.InThreadSurveyQuestion)return A;var r=new d.proto.InThreadSurveyMetadata.InThreadSurveyQuestion;if(A.questionText!=null&&(r.questionText=String(A.questionText)),A.questionId!=null&&(r.questionId=String(A.questionId)),A.questionOptions){if(!Array.isArray(A.questionOptions))throw TypeError(".proto.InThreadSurveyMetadata.InThreadSurveyQuestion.questionOptions: array expected");r.questionOptions=[];for(var s=0;s>>3){case 1:{s.polygonVertices&&s.polygonVertices.length||(s.polygonVertices=[]),s.polygonVertices.push(d.proto.Point.decode(e,e.uint32()));break}case 4:{s.shouldSkipConfirmation=e.bool();break}case 5:{s.embeddedContent=d.proto.EmbeddedContent.decode(e,e.uint32());break}case 8:{s.statusLinkType=e.int32();break}case 2:{s.location=d.proto.Location.decode(e,e.uint32());break}case 3:{s.newsletter=d.proto.ContextInfo.ForwardedNewsletterMessageInfo.decode(e,e.uint32());break}case 6:{s.embeddedAction=e.bool();break}case 7:{s.tapAction=d.proto.TapLinkAction.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.InteractiveAnnotation)return e;var i=new d.proto.InteractiveAnnotation;if(e.polygonVertices){if(!Array.isArray(e.polygonVertices))throw TypeError(".proto.InteractiveAnnotation.polygonVertices: array expected");i.polygonVertices=[];for(var A=0;A>>3){case 1:{s.isGalaxyFlowCompleted=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.InteractiveMessageAdditionalMetadata)return e;var i=new d.proto.InteractiveMessageAdditionalMetadata;return e.isGalaxyFlowCompleted!=null&&(i.isGalaxyFlowCompleted=!!e.isGalaxyFlowCompleted),i},t.toObject=function(e,i){i||(i={});var A={};return e.isGalaxyFlowCompleted!=null&&e.hasOwnProperty("isGalaxyFlowCompleted")&&(A.isGalaxyFlowCompleted=e.isGalaxyFlowCompleted,i.oneofs&&(A._isGalaxyFlowCompleted="isGalaxyFlowCompleted")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.InteractiveMessageAdditionalMetadata"},t})(),n.KeepInChat=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.keepType=e.int32();break}case 2:{s.serverTimestamp=e.int64();break}case 3:{s.key=d.proto.MessageKey.decode(e,e.uint32());break}case 4:{s.deviceJid=e.string();break}case 5:{s.clientTimestampMs=e.int64();break}case 6:{s.serverTimestampMs=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.KeepInChat)return e;var i=new d.proto.KeepInChat;switch(e.keepType){default:if(typeof e.keepType=="number"){i.keepType=e.keepType;break}break;case"UNKNOWN":case 0:i.keepType=0;break;case"KEEP_FOR_ALL":case 1:i.keepType=1;break;case"UNDO_KEEP_FOR_ALL":case 2:i.keepType=2;break}if(e.serverTimestamp!=null&&(l.Long?(i.serverTimestamp=l.Long.fromValue(e.serverTimestamp)).unsigned=!1:typeof e.serverTimestamp=="string"?i.serverTimestamp=parseInt(e.serverTimestamp,10):typeof e.serverTimestamp=="number"?i.serverTimestamp=e.serverTimestamp:typeof e.serverTimestamp=="object"&&(i.serverTimestamp=new l.LongBits(e.serverTimestamp.low>>>0,e.serverTimestamp.high>>>0).toNumber())),e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.KeepInChat.key: object expected");i.key=d.proto.MessageKey.fromObject(e.key)}return e.deviceJid!=null&&(i.deviceJid=String(e.deviceJid)),e.clientTimestampMs!=null&&(l.Long?(i.clientTimestampMs=l.Long.fromValue(e.clientTimestampMs)).unsigned=!1:typeof e.clientTimestampMs=="string"?i.clientTimestampMs=parseInt(e.clientTimestampMs,10):typeof e.clientTimestampMs=="number"?i.clientTimestampMs=e.clientTimestampMs:typeof e.clientTimestampMs=="object"&&(i.clientTimestampMs=new l.LongBits(e.clientTimestampMs.low>>>0,e.clientTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(i.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?i.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?i.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(i.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.keepType!=null&&e.hasOwnProperty("keepType")&&(A.keepType=i.enums===String?d.proto.KeepType[e.keepType]===void 0?e.keepType:d.proto.KeepType[e.keepType]:e.keepType,i.oneofs&&(A._keepType="keepType")),e.serverTimestamp!=null&&e.hasOwnProperty("serverTimestamp")&&(typeof e.serverTimestamp=="number"?A.serverTimestamp=i.longs===String?String(e.serverTimestamp):e.serverTimestamp:A.serverTimestamp=i.longs===String?ge(e.serverTimestamp):i.longs===Number?ce(e.serverTimestamp):e.serverTimestamp,i.oneofs&&(A._serverTimestamp="serverTimestamp")),e.key!=null&&e.hasOwnProperty("key")&&(A.key=d.proto.MessageKey.toObject(e.key,i),i.oneofs&&(A._key="key")),e.deviceJid!=null&&e.hasOwnProperty("deviceJid")&&(A.deviceJid=e.deviceJid,i.oneofs&&(A._deviceJid="deviceJid")),e.clientTimestampMs!=null&&e.hasOwnProperty("clientTimestampMs")&&(typeof e.clientTimestampMs=="number"?A.clientTimestampMs=i.longs===String?String(e.clientTimestampMs):e.clientTimestampMs:A.clientTimestampMs=i.longs===String?ge(e.clientTimestampMs):i.longs===Number?ce(e.clientTimestampMs):e.clientTimestampMs,i.oneofs&&(A._clientTimestampMs="clientTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=i.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=i.longs===String?ge(e.serverTimestampMs):i.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,i.oneofs&&(A._serverTimestampMs="serverTimestampMs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeepInChat"},t})(),n.KeepType=(function(){let t={},o=Object.create(t);return o[t[0]="UNKNOWN"]=0,o[t[1]="KEEP_FOR_ALL"]=1,o[t[2]="UNDO_KEEP_FOR_ALL"]=2,o})(),n.KeyExchangeMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.uint32();break}case 2:{s.baseKey=e.bytes();break}case 3:{s.ratchetKey=e.bytes();break}case 4:{s.identityKey=e.bytes();break}case 5:{s.baseKeySignature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.KeyExchangeMessage)return e;var i=new d.proto.KeyExchangeMessage;return e.id!=null&&(i.id=e.id>>>0),e.baseKey!=null&&(typeof e.baseKey=="string"?l.base64.decode(e.baseKey,i.baseKey=l.newBuffer(l.base64.length(e.baseKey)),0):e.baseKey.length>=0&&(i.baseKey=e.baseKey)),e.ratchetKey!=null&&(typeof e.ratchetKey=="string"?l.base64.decode(e.ratchetKey,i.ratchetKey=l.newBuffer(l.base64.length(e.ratchetKey)),0):e.ratchetKey.length>=0&&(i.ratchetKey=e.ratchetKey)),e.identityKey!=null&&(typeof e.identityKey=="string"?l.base64.decode(e.identityKey,i.identityKey=l.newBuffer(l.base64.length(e.identityKey)),0):e.identityKey.length>=0&&(i.identityKey=e.identityKey)),e.baseKeySignature!=null&&(typeof e.baseKeySignature=="string"?l.base64.decode(e.baseKeySignature,i.baseKeySignature=l.newBuffer(l.base64.length(e.baseKeySignature)),0):e.baseKeySignature.length>=0&&(i.baseKeySignature=e.baseKeySignature)),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.baseKey!=null&&e.hasOwnProperty("baseKey")&&(A.baseKey=i.bytes===String?l.base64.encode(e.baseKey,0,e.baseKey.length):i.bytes===Array?Array.prototype.slice.call(e.baseKey):e.baseKey,i.oneofs&&(A._baseKey="baseKey")),e.ratchetKey!=null&&e.hasOwnProperty("ratchetKey")&&(A.ratchetKey=i.bytes===String?l.base64.encode(e.ratchetKey,0,e.ratchetKey.length):i.bytes===Array?Array.prototype.slice.call(e.ratchetKey):e.ratchetKey,i.oneofs&&(A._ratchetKey="ratchetKey")),e.identityKey!=null&&e.hasOwnProperty("identityKey")&&(A.identityKey=i.bytes===String?l.base64.encode(e.identityKey,0,e.identityKey.length):i.bytes===Array?Array.prototype.slice.call(e.identityKey):e.identityKey,i.oneofs&&(A._identityKey="identityKey")),e.baseKeySignature!=null&&e.hasOwnProperty("baseKeySignature")&&(A.baseKeySignature=i.bytes===String?l.base64.encode(e.baseKeySignature,0,e.baseKeySignature.length):i.bytes===Array?Array.prototype.slice.call(e.baseKeySignature):e.baseKeySignature,i.oneofs&&(A._baseKeySignature="baseKeySignature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeyExchangeMessage"},t})(),n.KeyId=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.KeyId)return e;var i=new d.proto.KeyId;return e.id!=null&&(typeof e.id=="string"?l.base64.decode(e.id,i.id=l.newBuffer(l.base64.length(e.id)),0):e.id.length>=0&&(i.id=e.id)),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=i.bytes===String?l.base64.encode(e.id,0,e.id.length):i.bytes===Array?Array.prototype.slice.call(e.id):e.id,i.oneofs&&(A._id="id")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeyId"},t})(),n.LIDMigrationMapping=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.pn=e.uint64();break}case 2:{s.assignedLid=e.uint64();break}case 3:{s.latestLid=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.LIDMigrationMapping)return e;var i=new d.proto.LIDMigrationMapping;return e.pn!=null&&(l.Long?(i.pn=l.Long.fromValue(e.pn)).unsigned=!0:typeof e.pn=="string"?i.pn=parseInt(e.pn,10):typeof e.pn=="number"?i.pn=e.pn:typeof e.pn=="object"&&(i.pn=new l.LongBits(e.pn.low>>>0,e.pn.high>>>0).toNumber(!0))),e.assignedLid!=null&&(l.Long?(i.assignedLid=l.Long.fromValue(e.assignedLid)).unsigned=!0:typeof e.assignedLid=="string"?i.assignedLid=parseInt(e.assignedLid,10):typeof e.assignedLid=="number"?i.assignedLid=e.assignedLid:typeof e.assignedLid=="object"&&(i.assignedLid=new l.LongBits(e.assignedLid.low>>>0,e.assignedLid.high>>>0).toNumber(!0))),e.latestLid!=null&&(l.Long?(i.latestLid=l.Long.fromValue(e.latestLid)).unsigned=!0:typeof e.latestLid=="string"?i.latestLid=parseInt(e.latestLid,10):typeof e.latestLid=="number"?i.latestLid=e.latestLid:typeof e.latestLid=="object"&&(i.latestLid=new l.LongBits(e.latestLid.low>>>0,e.latestLid.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};if(i.defaults){if(l.Long){var r=new l.Long(0,0,!0);A.pn=i.longs===String?r.toString():i.longs===Number?r.toNumber():r}else A.pn=i.longs===String?"0":0;if(l.Long){var r=new l.Long(0,0,!0);A.assignedLid=i.longs===String?r.toString():i.longs===Number?r.toNumber():r}else A.assignedLid=i.longs===String?"0":0}return e.pn!=null&&e.hasOwnProperty("pn")&&(typeof e.pn=="number"?A.pn=i.longs===String?String(e.pn):e.pn:A.pn=i.longs===String?ge(e.pn,!0):i.longs===Number?ce(e.pn,!0):e.pn),e.assignedLid!=null&&e.hasOwnProperty("assignedLid")&&(typeof e.assignedLid=="number"?A.assignedLid=i.longs===String?String(e.assignedLid):e.assignedLid:A.assignedLid=i.longs===String?ge(e.assignedLid,!0):i.longs===Number?ce(e.assignedLid,!0):e.assignedLid),e.latestLid!=null&&e.hasOwnProperty("latestLid")&&(typeof e.latestLid=="number"?A.latestLid=i.longs===String?String(e.latestLid):e.latestLid:A.latestLid=i.longs===String?ge(e.latestLid,!0):i.longs===Number?ce(e.latestLid,!0):e.latestLid,i.oneofs&&(A._latestLid="latestLid")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LIDMigrationMapping"},t})(),n.LIDMigrationMappingSyncMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.encodedMappingPayload=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.LIDMigrationMappingSyncMessage)return e;var i=new d.proto.LIDMigrationMappingSyncMessage;return e.encodedMappingPayload!=null&&(typeof e.encodedMappingPayload=="string"?l.base64.decode(e.encodedMappingPayload,i.encodedMappingPayload=l.newBuffer(l.base64.length(e.encodedMappingPayload)),0):e.encodedMappingPayload.length>=0&&(i.encodedMappingPayload=e.encodedMappingPayload)),i},t.toObject=function(e,i){i||(i={});var A={};return e.encodedMappingPayload!=null&&e.hasOwnProperty("encodedMappingPayload")&&(A.encodedMappingPayload=i.bytes===String?l.base64.encode(e.encodedMappingPayload,0,e.encodedMappingPayload.length):i.bytes===Array?Array.prototype.slice.call(e.encodedMappingPayload):e.encodedMappingPayload,i.oneofs&&(A._encodedMappingPayload="encodedMappingPayload")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LIDMigrationMappingSyncMessage"},t})(),n.LIDMigrationMappingSyncPayload=(function(){function t(a){if(this.pnToLidMappings=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.pnToLidMappings&&s.pnToLidMappings.length||(s.pnToLidMappings=[]),s.pnToLidMappings.push(d.proto.LIDMigrationMapping.decode(e,e.uint32()));break}case 2:{s.chatDbMigrationTimestamp=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.LIDMigrationMappingSyncPayload)return e;var i=new d.proto.LIDMigrationMappingSyncPayload;if(e.pnToLidMappings){if(!Array.isArray(e.pnToLidMappings))throw TypeError(".proto.LIDMigrationMappingSyncPayload.pnToLidMappings: array expected");i.pnToLidMappings=[];for(var A=0;A>>0,e.chatDbMigrationTimestamp.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.pnToLidMappings=[]),e.pnToLidMappings&&e.pnToLidMappings.length){A.pnToLidMappings=[];for(var r=0;r>>3){case 1:{s.eventResponseMessage=d.proto.Message.EventResponseMessage.decode(e,e.uint32());break}case 2:{s.pollVote=d.proto.Message.PollVoteMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.LegacyMessage)return e;var i=new d.proto.LegacyMessage;if(e.eventResponseMessage!=null){if(typeof e.eventResponseMessage!="object")throw TypeError(".proto.LegacyMessage.eventResponseMessage: object expected");i.eventResponseMessage=d.proto.Message.EventResponseMessage.fromObject(e.eventResponseMessage)}if(e.pollVote!=null){if(typeof e.pollVote!="object")throw TypeError(".proto.LegacyMessage.pollVote: object expected");i.pollVote=d.proto.Message.PollVoteMessage.fromObject(e.pollVote)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.eventResponseMessage!=null&&e.hasOwnProperty("eventResponseMessage")&&(A.eventResponseMessage=d.proto.Message.EventResponseMessage.toObject(e.eventResponseMessage,i),i.oneofs&&(A._eventResponseMessage="eventResponseMessage")),e.pollVote!=null&&e.hasOwnProperty("pollVote")&&(A.pollVote=d.proto.Message.PollVoteMessage.toObject(e.pollVote,i),i.oneofs&&(A._pollVote="pollVote")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LegacyMessage"},t})(),n.LimitSharing=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.sharingLimited=e.bool();break}case 2:{s.trigger=e.int32();break}case 3:{s.limitSharingSettingTimestamp=e.int64();break}case 4:{s.initiatedByMe=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.LimitSharing)return e;var i=new d.proto.LimitSharing;switch(e.sharingLimited!=null&&(i.sharingLimited=!!e.sharingLimited),e.trigger){default:if(typeof e.trigger=="number"){i.trigger=e.trigger;break}break;case"UNKNOWN":case 0:i.trigger=0;break;case"CHAT_SETTING":case 1:i.trigger=1;break;case"BIZ_SUPPORTS_FB_HOSTING":case 2:i.trigger=2;break;case"UNKNOWN_GROUP":case 3:i.trigger=3;break}return e.limitSharingSettingTimestamp!=null&&(l.Long?(i.limitSharingSettingTimestamp=l.Long.fromValue(e.limitSharingSettingTimestamp)).unsigned=!1:typeof e.limitSharingSettingTimestamp=="string"?i.limitSharingSettingTimestamp=parseInt(e.limitSharingSettingTimestamp,10):typeof e.limitSharingSettingTimestamp=="number"?i.limitSharingSettingTimestamp=e.limitSharingSettingTimestamp:typeof e.limitSharingSettingTimestamp=="object"&&(i.limitSharingSettingTimestamp=new l.LongBits(e.limitSharingSettingTimestamp.low>>>0,e.limitSharingSettingTimestamp.high>>>0).toNumber())),e.initiatedByMe!=null&&(i.initiatedByMe=!!e.initiatedByMe),i},t.toObject=function(e,i){i||(i={});var A={};return e.sharingLimited!=null&&e.hasOwnProperty("sharingLimited")&&(A.sharingLimited=e.sharingLimited,i.oneofs&&(A._sharingLimited="sharingLimited")),e.trigger!=null&&e.hasOwnProperty("trigger")&&(A.trigger=i.enums===String?d.proto.LimitSharing.TriggerType[e.trigger]===void 0?e.trigger:d.proto.LimitSharing.TriggerType[e.trigger]:e.trigger,i.oneofs&&(A._trigger="trigger")),e.limitSharingSettingTimestamp!=null&&e.hasOwnProperty("limitSharingSettingTimestamp")&&(typeof e.limitSharingSettingTimestamp=="number"?A.limitSharingSettingTimestamp=i.longs===String?String(e.limitSharingSettingTimestamp):e.limitSharingSettingTimestamp:A.limitSharingSettingTimestamp=i.longs===String?ge(e.limitSharingSettingTimestamp):i.longs===Number?ce(e.limitSharingSettingTimestamp):e.limitSharingSettingTimestamp,i.oneofs&&(A._limitSharingSettingTimestamp="limitSharingSettingTimestamp")),e.initiatedByMe!=null&&e.hasOwnProperty("initiatedByMe")&&(A.initiatedByMe=e.initiatedByMe,i.oneofs&&(A._initiatedByMe="initiatedByMe")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LimitSharing"},t.TriggerType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="CHAT_SETTING"]=1,e[a[2]="BIZ_SUPPORTS_FB_HOSTING"]=2,e[a[3]="UNKNOWN_GROUP"]=3,e})(),t})(),n.LocalizedName=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.lg=e.string();break}case 2:{s.lc=e.string();break}case 3:{s.verifiedName=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.LocalizedName)return e;var i=new d.proto.LocalizedName;return e.lg!=null&&(i.lg=String(e.lg)),e.lc!=null&&(i.lc=String(e.lc)),e.verifiedName!=null&&(i.verifiedName=String(e.verifiedName)),i},t.toObject=function(e,i){i||(i={});var A={};return e.lg!=null&&e.hasOwnProperty("lg")&&(A.lg=e.lg,i.oneofs&&(A._lg="lg")),e.lc!=null&&e.hasOwnProperty("lc")&&(A.lc=e.lc,i.oneofs&&(A._lc="lc")),e.verifiedName!=null&&e.hasOwnProperty("verifiedName")&&(A.verifiedName=e.verifiedName,i.oneofs&&(A._verifiedName="verifiedName")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LocalizedName"},t})(),n.Location=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.degreesLatitude=e.double();break}case 2:{s.degreesLongitude=e.double();break}case 3:{s.name=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Location)return e;var i=new d.proto.Location;return e.degreesLatitude!=null&&(i.degreesLatitude=Number(e.degreesLatitude)),e.degreesLongitude!=null&&(i.degreesLongitude=Number(e.degreesLongitude)),e.name!=null&&(i.name=String(e.name)),i},t.toObject=function(e,i){i||(i={});var A={};return e.degreesLatitude!=null&&e.hasOwnProperty("degreesLatitude")&&(A.degreesLatitude=i.json&&!isFinite(e.degreesLatitude)?String(e.degreesLatitude):e.degreesLatitude,i.oneofs&&(A._degreesLatitude="degreesLatitude")),e.degreesLongitude!=null&&e.hasOwnProperty("degreesLongitude")&&(A.degreesLongitude=i.json&&!isFinite(e.degreesLongitude)?String(e.degreesLongitude):e.degreesLongitude,i.oneofs&&(A._degreesLongitude="degreesLongitude")),e.name!=null&&e.hasOwnProperty("name")&&(A.name=e.name,i.oneofs&&(A._name="name")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Location"},t})(),n.MediaData=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.localPath=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MediaData)return e;var i=new d.proto.MediaData;return e.localPath!=null&&(i.localPath=String(e.localPath)),i},t.toObject=function(e,i){i||(i={});var A={};return e.localPath!=null&&e.hasOwnProperty("localPath")&&(A.localPath=e.localPath,i.oneofs&&(A._localPath="localPath")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaData"},t})(),n.MediaNotifyMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.expressPathUrl=e.string();break}case 2:{s.fileEncSha256=e.bytes();break}case 3:{s.fileLength=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MediaNotifyMessage)return e;var i=new d.proto.MediaNotifyMessage;return e.expressPathUrl!=null&&(i.expressPathUrl=String(e.expressPathUrl)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,i.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(i.fileEncSha256=e.fileEncSha256)),e.fileLength!=null&&(l.Long?(i.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?i.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?i.fileLength=e.fileLength:typeof e.fileLength=="object"&&(i.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};return e.expressPathUrl!=null&&e.hasOwnProperty("expressPathUrl")&&(A.expressPathUrl=e.expressPathUrl,i.oneofs&&(A._expressPathUrl="expressPathUrl")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=i.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):i.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,i.oneofs&&(A._fileEncSha256="fileEncSha256")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=i.longs===String?String(e.fileLength):e.fileLength:A.fileLength=i.longs===String?ge(e.fileLength,!0):i.longs===Number?ce(e.fileLength,!0):e.fileLength,i.oneofs&&(A._fileLength="fileLength")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaNotifyMessage"},t})(),n.MediaRetryNotification=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.directPath=e.string();break}case 3:{s.result=e.int32();break}case 4:{s.messageSecret=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MediaRetryNotification)return e;var i=new d.proto.MediaRetryNotification;switch(e.stanzaId!=null&&(i.stanzaId=String(e.stanzaId)),e.directPath!=null&&(i.directPath=String(e.directPath)),e.result){default:if(typeof e.result=="number"){i.result=e.result;break}break;case"GENERAL_ERROR":case 0:i.result=0;break;case"SUCCESS":case 1:i.result=1;break;case"NOT_FOUND":case 2:i.result=2;break;case"DECRYPTION_ERROR":case 3:i.result=3;break}return e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,i.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(i.messageSecret=e.messageSecret)),i},t.toObject=function(e,i){i||(i={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,i.oneofs&&(A._stanzaId="stanzaId")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,i.oneofs&&(A._directPath="directPath")),e.result!=null&&e.hasOwnProperty("result")&&(A.result=i.enums===String?d.proto.MediaRetryNotification.ResultType[e.result]===void 0?e.result:d.proto.MediaRetryNotification.ResultType[e.result]:e.result,i.oneofs&&(A._result="result")),e.messageSecret!=null&&e.hasOwnProperty("messageSecret")&&(A.messageSecret=i.bytes===String?l.base64.encode(e.messageSecret,0,e.messageSecret.length):i.bytes===Array?Array.prototype.slice.call(e.messageSecret):e.messageSecret,i.oneofs&&(A._messageSecret="messageSecret")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaRetryNotification"},t.ResultType=(function(){let a={},e=Object.create(a);return e[a[0]="GENERAL_ERROR"]=0,e[a[1]="SUCCESS"]=1,e[a[2]="NOT_FOUND"]=2,e[a[3]="DECRYPTION_ERROR"]=3,e})(),t})(),n.MediaVisibility=(function(){let t={},o=Object.create(t);return o[t[0]="DEFAULT"]=0,o[t[1]="OFF"]=1,o[t[2]="ON"]=2,o})(),n.MemberLabel=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.label=e.string();break}case 2:{s.labelTimestamp=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MemberLabel)return e;var i=new d.proto.MemberLabel;return e.label!=null&&(i.label=String(e.label)),e.labelTimestamp!=null&&(l.Long?(i.labelTimestamp=l.Long.fromValue(e.labelTimestamp)).unsigned=!1:typeof e.labelTimestamp=="string"?i.labelTimestamp=parseInt(e.labelTimestamp,10):typeof e.labelTimestamp=="number"?i.labelTimestamp=e.labelTimestamp:typeof e.labelTimestamp=="object"&&(i.labelTimestamp=new l.LongBits(e.labelTimestamp.low>>>0,e.labelTimestamp.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.label!=null&&e.hasOwnProperty("label")&&(A.label=e.label,i.oneofs&&(A._label="label")),e.labelTimestamp!=null&&e.hasOwnProperty("labelTimestamp")&&(typeof e.labelTimestamp=="number"?A.labelTimestamp=i.longs===String?String(e.labelTimestamp):e.labelTimestamp:A.labelTimestamp=i.longs===String?ge(e.labelTimestamp):i.longs===Number?ce(e.labelTimestamp):e.labelTimestamp,i.oneofs&&(A._labelTimestamp="labelTimestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MemberLabel"},t})(),n.Message=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.conversation=e.string();break}case 2:{s.senderKeyDistributionMessage=d.proto.Message.SenderKeyDistributionMessage.decode(e,e.uint32());break}case 3:{s.imageMessage=d.proto.Message.ImageMessage.decode(e,e.uint32());break}case 4:{s.contactMessage=d.proto.Message.ContactMessage.decode(e,e.uint32());break}case 5:{s.locationMessage=d.proto.Message.LocationMessage.decode(e,e.uint32());break}case 6:{s.extendedTextMessage=d.proto.Message.ExtendedTextMessage.decode(e,e.uint32());break}case 7:{s.documentMessage=d.proto.Message.DocumentMessage.decode(e,e.uint32());break}case 8:{s.audioMessage=d.proto.Message.AudioMessage.decode(e,e.uint32());break}case 9:{s.videoMessage=d.proto.Message.VideoMessage.decode(e,e.uint32());break}case 10:{s.call=d.proto.Message.Call.decode(e,e.uint32());break}case 11:{s.chat=d.proto.Message.Chat.decode(e,e.uint32());break}case 12:{s.protocolMessage=d.proto.Message.ProtocolMessage.decode(e,e.uint32());break}case 13:{s.contactsArrayMessage=d.proto.Message.ContactsArrayMessage.decode(e,e.uint32());break}case 14:{s.highlyStructuredMessage=d.proto.Message.HighlyStructuredMessage.decode(e,e.uint32());break}case 15:{s.fastRatchetKeySenderKeyDistributionMessage=d.proto.Message.SenderKeyDistributionMessage.decode(e,e.uint32());break}case 16:{s.sendPaymentMessage=d.proto.Message.SendPaymentMessage.decode(e,e.uint32());break}case 18:{s.liveLocationMessage=d.proto.Message.LiveLocationMessage.decode(e,e.uint32());break}case 22:{s.requestPaymentMessage=d.proto.Message.RequestPaymentMessage.decode(e,e.uint32());break}case 23:{s.declinePaymentRequestMessage=d.proto.Message.DeclinePaymentRequestMessage.decode(e,e.uint32());break}case 24:{s.cancelPaymentRequestMessage=d.proto.Message.CancelPaymentRequestMessage.decode(e,e.uint32());break}case 25:{s.templateMessage=d.proto.Message.TemplateMessage.decode(e,e.uint32());break}case 26:{s.stickerMessage=d.proto.Message.StickerMessage.decode(e,e.uint32());break}case 28:{s.groupInviteMessage=d.proto.Message.GroupInviteMessage.decode(e,e.uint32());break}case 29:{s.templateButtonReplyMessage=d.proto.Message.TemplateButtonReplyMessage.decode(e,e.uint32());break}case 30:{s.productMessage=d.proto.Message.ProductMessage.decode(e,e.uint32());break}case 31:{s.deviceSentMessage=d.proto.Message.DeviceSentMessage.decode(e,e.uint32());break}case 35:{s.messageContextInfo=d.proto.MessageContextInfo.decode(e,e.uint32());break}case 36:{s.listMessage=d.proto.Message.ListMessage.decode(e,e.uint32());break}case 37:{s.viewOnceMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 38:{s.orderMessage=d.proto.Message.OrderMessage.decode(e,e.uint32());break}case 39:{s.listResponseMessage=d.proto.Message.ListResponseMessage.decode(e,e.uint32());break}case 40:{s.ephemeralMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 41:{s.invoiceMessage=d.proto.Message.InvoiceMessage.decode(e,e.uint32());break}case 42:{s.buttonsMessage=d.proto.Message.ButtonsMessage.decode(e,e.uint32());break}case 43:{s.buttonsResponseMessage=d.proto.Message.ButtonsResponseMessage.decode(e,e.uint32());break}case 44:{s.paymentInviteMessage=d.proto.Message.PaymentInviteMessage.decode(e,e.uint32());break}case 45:{s.interactiveMessage=d.proto.Message.InteractiveMessage.decode(e,e.uint32());break}case 46:{s.reactionMessage=d.proto.Message.ReactionMessage.decode(e,e.uint32());break}case 47:{s.stickerSyncRmrMessage=d.proto.Message.StickerSyncRMRMessage.decode(e,e.uint32());break}case 48:{s.interactiveResponseMessage=d.proto.Message.InteractiveResponseMessage.decode(e,e.uint32());break}case 49:{s.pollCreationMessage=d.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 50:{s.pollUpdateMessage=d.proto.Message.PollUpdateMessage.decode(e,e.uint32());break}case 51:{s.keepInChatMessage=d.proto.Message.KeepInChatMessage.decode(e,e.uint32());break}case 53:{s.documentWithCaptionMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 54:{s.requestPhoneNumberMessage=d.proto.Message.RequestPhoneNumberMessage.decode(e,e.uint32());break}case 55:{s.viewOnceMessageV2=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 56:{s.encReactionMessage=d.proto.Message.EncReactionMessage.decode(e,e.uint32());break}case 58:{s.editedMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 59:{s.viewOnceMessageV2Extension=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 60:{s.pollCreationMessageV2=d.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 61:{s.scheduledCallCreationMessage=d.proto.Message.ScheduledCallCreationMessage.decode(e,e.uint32());break}case 62:{s.groupMentionedMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 63:{s.pinInChatMessage=d.proto.Message.PinInChatMessage.decode(e,e.uint32());break}case 64:{s.pollCreationMessageV3=d.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 65:{s.scheduledCallEditMessage=d.proto.Message.ScheduledCallEditMessage.decode(e,e.uint32());break}case 66:{s.ptvMessage=d.proto.Message.VideoMessage.decode(e,e.uint32());break}case 67:{s.botInvokeMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 69:{s.callLogMesssage=d.proto.Message.CallLogMessage.decode(e,e.uint32());break}case 70:{s.messageHistoryBundle=d.proto.Message.MessageHistoryBundle.decode(e,e.uint32());break}case 71:{s.encCommentMessage=d.proto.Message.EncCommentMessage.decode(e,e.uint32());break}case 72:{s.bcallMessage=d.proto.Message.BCallMessage.decode(e,e.uint32());break}case 74:{s.lottieStickerMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 75:{s.eventMessage=d.proto.Message.EventMessage.decode(e,e.uint32());break}case 76:{s.encEventResponseMessage=d.proto.Message.EncEventResponseMessage.decode(e,e.uint32());break}case 77:{s.commentMessage=d.proto.Message.CommentMessage.decode(e,e.uint32());break}case 78:{s.newsletterAdminInviteMessage=d.proto.Message.NewsletterAdminInviteMessage.decode(e,e.uint32());break}case 80:{s.placeholderMessage=d.proto.Message.PlaceholderMessage.decode(e,e.uint32());break}case 82:{s.secretEncryptedMessage=d.proto.Message.SecretEncryptedMessage.decode(e,e.uint32());break}case 83:{s.albumMessage=d.proto.Message.AlbumMessage.decode(e,e.uint32());break}case 85:{s.eventCoverImage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 86:{s.stickerPackMessage=d.proto.Message.StickerPackMessage.decode(e,e.uint32());break}case 87:{s.statusMentionMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 88:{s.pollResultSnapshotMessage=d.proto.Message.PollResultSnapshotMessage.decode(e,e.uint32());break}case 90:{s.pollCreationOptionImageMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 91:{s.associatedChildMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 92:{s.groupStatusMentionMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 93:{s.pollCreationMessageV4=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 95:{s.statusAddYours=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 96:{s.groupStatusMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 97:{s.richResponseMessage=d.proto.AIRichResponseMessage.decode(e,e.uint32());break}case 98:{s.statusNotificationMessage=d.proto.Message.StatusNotificationMessage.decode(e,e.uint32());break}case 99:{s.limitSharingMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 100:{s.botTaskMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 101:{s.questionMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 102:{s.messageHistoryNotice=d.proto.Message.MessageHistoryNotice.decode(e,e.uint32());break}case 103:{s.groupStatusMessageV2=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 104:{s.botForwardedMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 105:{s.statusQuestionAnswerMessage=d.proto.Message.StatusQuestionAnswerMessage.decode(e,e.uint32());break}case 106:{s.questionReplyMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 107:{s.questionResponseMessage=d.proto.Message.QuestionResponseMessage.decode(e,e.uint32());break}case 109:{s.statusQuotedMessage=d.proto.Message.StatusQuotedMessage.decode(e,e.uint32());break}case 110:{s.statusStickerInteractionMessage=d.proto.Message.StatusStickerInteractionMessage.decode(e,e.uint32());break}case 111:{s.pollCreationMessageV5=d.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 113:{s.newsletterFollowerInviteMessageV2=d.proto.Message.NewsletterFollowerInviteMessage.decode(e,e.uint32());break}case 114:{s.pollResultSnapshotMessageV3=d.proto.Message.PollResultSnapshotMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Message)return e;var i=new d.proto.Message;if(e.conversation!=null&&(i.conversation=String(e.conversation)),e.senderKeyDistributionMessage!=null){if(typeof e.senderKeyDistributionMessage!="object")throw TypeError(".proto.Message.senderKeyDistributionMessage: object expected");i.senderKeyDistributionMessage=d.proto.Message.SenderKeyDistributionMessage.fromObject(e.senderKeyDistributionMessage)}if(e.imageMessage!=null){if(typeof e.imageMessage!="object")throw TypeError(".proto.Message.imageMessage: object expected");i.imageMessage=d.proto.Message.ImageMessage.fromObject(e.imageMessage)}if(e.contactMessage!=null){if(typeof e.contactMessage!="object")throw TypeError(".proto.Message.contactMessage: object expected");i.contactMessage=d.proto.Message.ContactMessage.fromObject(e.contactMessage)}if(e.locationMessage!=null){if(typeof e.locationMessage!="object")throw TypeError(".proto.Message.locationMessage: object expected");i.locationMessage=d.proto.Message.LocationMessage.fromObject(e.locationMessage)}if(e.extendedTextMessage!=null){if(typeof e.extendedTextMessage!="object")throw TypeError(".proto.Message.extendedTextMessage: object expected");i.extendedTextMessage=d.proto.Message.ExtendedTextMessage.fromObject(e.extendedTextMessage)}if(e.documentMessage!=null){if(typeof e.documentMessage!="object")throw TypeError(".proto.Message.documentMessage: object expected");i.documentMessage=d.proto.Message.DocumentMessage.fromObject(e.documentMessage)}if(e.audioMessage!=null){if(typeof e.audioMessage!="object")throw TypeError(".proto.Message.audioMessage: object expected");i.audioMessage=d.proto.Message.AudioMessage.fromObject(e.audioMessage)}if(e.videoMessage!=null){if(typeof e.videoMessage!="object")throw TypeError(".proto.Message.videoMessage: object expected");i.videoMessage=d.proto.Message.VideoMessage.fromObject(e.videoMessage)}if(e.call!=null){if(typeof e.call!="object")throw TypeError(".proto.Message.call: object expected");i.call=d.proto.Message.Call.fromObject(e.call)}if(e.chat!=null){if(typeof e.chat!="object")throw TypeError(".proto.Message.chat: object expected");i.chat=d.proto.Message.Chat.fromObject(e.chat)}if(e.protocolMessage!=null){if(typeof e.protocolMessage!="object")throw TypeError(".proto.Message.protocolMessage: object expected");i.protocolMessage=d.proto.Message.ProtocolMessage.fromObject(e.protocolMessage)}if(e.contactsArrayMessage!=null){if(typeof e.contactsArrayMessage!="object")throw TypeError(".proto.Message.contactsArrayMessage: object expected");i.contactsArrayMessage=d.proto.Message.ContactsArrayMessage.fromObject(e.contactsArrayMessage)}if(e.highlyStructuredMessage!=null){if(typeof e.highlyStructuredMessage!="object")throw TypeError(".proto.Message.highlyStructuredMessage: object expected");i.highlyStructuredMessage=d.proto.Message.HighlyStructuredMessage.fromObject(e.highlyStructuredMessage)}if(e.fastRatchetKeySenderKeyDistributionMessage!=null){if(typeof e.fastRatchetKeySenderKeyDistributionMessage!="object")throw TypeError(".proto.Message.fastRatchetKeySenderKeyDistributionMessage: object expected");i.fastRatchetKeySenderKeyDistributionMessage=d.proto.Message.SenderKeyDistributionMessage.fromObject(e.fastRatchetKeySenderKeyDistributionMessage)}if(e.sendPaymentMessage!=null){if(typeof e.sendPaymentMessage!="object")throw TypeError(".proto.Message.sendPaymentMessage: object expected");i.sendPaymentMessage=d.proto.Message.SendPaymentMessage.fromObject(e.sendPaymentMessage)}if(e.liveLocationMessage!=null){if(typeof e.liveLocationMessage!="object")throw TypeError(".proto.Message.liveLocationMessage: object expected");i.liveLocationMessage=d.proto.Message.LiveLocationMessage.fromObject(e.liveLocationMessage)}if(e.requestPaymentMessage!=null){if(typeof e.requestPaymentMessage!="object")throw TypeError(".proto.Message.requestPaymentMessage: object expected");i.requestPaymentMessage=d.proto.Message.RequestPaymentMessage.fromObject(e.requestPaymentMessage)}if(e.declinePaymentRequestMessage!=null){if(typeof e.declinePaymentRequestMessage!="object")throw TypeError(".proto.Message.declinePaymentRequestMessage: object expected");i.declinePaymentRequestMessage=d.proto.Message.DeclinePaymentRequestMessage.fromObject(e.declinePaymentRequestMessage)}if(e.cancelPaymentRequestMessage!=null){if(typeof e.cancelPaymentRequestMessage!="object")throw TypeError(".proto.Message.cancelPaymentRequestMessage: object expected");i.cancelPaymentRequestMessage=d.proto.Message.CancelPaymentRequestMessage.fromObject(e.cancelPaymentRequestMessage)}if(e.templateMessage!=null){if(typeof e.templateMessage!="object")throw TypeError(".proto.Message.templateMessage: object expected");i.templateMessage=d.proto.Message.TemplateMessage.fromObject(e.templateMessage)}if(e.stickerMessage!=null){if(typeof e.stickerMessage!="object")throw TypeError(".proto.Message.stickerMessage: object expected");i.stickerMessage=d.proto.Message.StickerMessage.fromObject(e.stickerMessage)}if(e.groupInviteMessage!=null){if(typeof e.groupInviteMessage!="object")throw TypeError(".proto.Message.groupInviteMessage: object expected");i.groupInviteMessage=d.proto.Message.GroupInviteMessage.fromObject(e.groupInviteMessage)}if(e.templateButtonReplyMessage!=null){if(typeof e.templateButtonReplyMessage!="object")throw TypeError(".proto.Message.templateButtonReplyMessage: object expected");i.templateButtonReplyMessage=d.proto.Message.TemplateButtonReplyMessage.fromObject(e.templateButtonReplyMessage)}if(e.productMessage!=null){if(typeof e.productMessage!="object")throw TypeError(".proto.Message.productMessage: object expected");i.productMessage=d.proto.Message.ProductMessage.fromObject(e.productMessage)}if(e.deviceSentMessage!=null){if(typeof e.deviceSentMessage!="object")throw TypeError(".proto.Message.deviceSentMessage: object expected");i.deviceSentMessage=d.proto.Message.DeviceSentMessage.fromObject(e.deviceSentMessage)}if(e.messageContextInfo!=null){if(typeof e.messageContextInfo!="object")throw TypeError(".proto.Message.messageContextInfo: object expected");i.messageContextInfo=d.proto.MessageContextInfo.fromObject(e.messageContextInfo)}if(e.listMessage!=null){if(typeof e.listMessage!="object")throw TypeError(".proto.Message.listMessage: object expected");i.listMessage=d.proto.Message.ListMessage.fromObject(e.listMessage)}if(e.viewOnceMessage!=null){if(typeof e.viewOnceMessage!="object")throw TypeError(".proto.Message.viewOnceMessage: object expected");i.viewOnceMessage=d.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessage)}if(e.orderMessage!=null){if(typeof e.orderMessage!="object")throw TypeError(".proto.Message.orderMessage: object expected");i.orderMessage=d.proto.Message.OrderMessage.fromObject(e.orderMessage)}if(e.listResponseMessage!=null){if(typeof e.listResponseMessage!="object")throw TypeError(".proto.Message.listResponseMessage: object expected");i.listResponseMessage=d.proto.Message.ListResponseMessage.fromObject(e.listResponseMessage)}if(e.ephemeralMessage!=null){if(typeof e.ephemeralMessage!="object")throw TypeError(".proto.Message.ephemeralMessage: object expected");i.ephemeralMessage=d.proto.Message.FutureProofMessage.fromObject(e.ephemeralMessage)}if(e.invoiceMessage!=null){if(typeof e.invoiceMessage!="object")throw TypeError(".proto.Message.invoiceMessage: object expected");i.invoiceMessage=d.proto.Message.InvoiceMessage.fromObject(e.invoiceMessage)}if(e.buttonsMessage!=null){if(typeof e.buttonsMessage!="object")throw TypeError(".proto.Message.buttonsMessage: object expected");i.buttonsMessage=d.proto.Message.ButtonsMessage.fromObject(e.buttonsMessage)}if(e.buttonsResponseMessage!=null){if(typeof e.buttonsResponseMessage!="object")throw TypeError(".proto.Message.buttonsResponseMessage: object expected");i.buttonsResponseMessage=d.proto.Message.ButtonsResponseMessage.fromObject(e.buttonsResponseMessage)}if(e.paymentInviteMessage!=null){if(typeof e.paymentInviteMessage!="object")throw TypeError(".proto.Message.paymentInviteMessage: object expected");i.paymentInviteMessage=d.proto.Message.PaymentInviteMessage.fromObject(e.paymentInviteMessage)}if(e.interactiveMessage!=null){if(typeof e.interactiveMessage!="object")throw TypeError(".proto.Message.interactiveMessage: object expected");i.interactiveMessage=d.proto.Message.InteractiveMessage.fromObject(e.interactiveMessage)}if(e.reactionMessage!=null){if(typeof e.reactionMessage!="object")throw TypeError(".proto.Message.reactionMessage: object expected");i.reactionMessage=d.proto.Message.ReactionMessage.fromObject(e.reactionMessage)}if(e.stickerSyncRmrMessage!=null){if(typeof e.stickerSyncRmrMessage!="object")throw TypeError(".proto.Message.stickerSyncRmrMessage: object expected");i.stickerSyncRmrMessage=d.proto.Message.StickerSyncRMRMessage.fromObject(e.stickerSyncRmrMessage)}if(e.interactiveResponseMessage!=null){if(typeof e.interactiveResponseMessage!="object")throw TypeError(".proto.Message.interactiveResponseMessage: object expected");i.interactiveResponseMessage=d.proto.Message.InteractiveResponseMessage.fromObject(e.interactiveResponseMessage)}if(e.pollCreationMessage!=null){if(typeof e.pollCreationMessage!="object")throw TypeError(".proto.Message.pollCreationMessage: object expected");i.pollCreationMessage=d.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessage)}if(e.pollUpdateMessage!=null){if(typeof e.pollUpdateMessage!="object")throw TypeError(".proto.Message.pollUpdateMessage: object expected");i.pollUpdateMessage=d.proto.Message.PollUpdateMessage.fromObject(e.pollUpdateMessage)}if(e.keepInChatMessage!=null){if(typeof e.keepInChatMessage!="object")throw TypeError(".proto.Message.keepInChatMessage: object expected");i.keepInChatMessage=d.proto.Message.KeepInChatMessage.fromObject(e.keepInChatMessage)}if(e.documentWithCaptionMessage!=null){if(typeof e.documentWithCaptionMessage!="object")throw TypeError(".proto.Message.documentWithCaptionMessage: object expected");i.documentWithCaptionMessage=d.proto.Message.FutureProofMessage.fromObject(e.documentWithCaptionMessage)}if(e.requestPhoneNumberMessage!=null){if(typeof e.requestPhoneNumberMessage!="object")throw TypeError(".proto.Message.requestPhoneNumberMessage: object expected");i.requestPhoneNumberMessage=d.proto.Message.RequestPhoneNumberMessage.fromObject(e.requestPhoneNumberMessage)}if(e.viewOnceMessageV2!=null){if(typeof e.viewOnceMessageV2!="object")throw TypeError(".proto.Message.viewOnceMessageV2: object expected");i.viewOnceMessageV2=d.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessageV2)}if(e.encReactionMessage!=null){if(typeof e.encReactionMessage!="object")throw TypeError(".proto.Message.encReactionMessage: object expected");i.encReactionMessage=d.proto.Message.EncReactionMessage.fromObject(e.encReactionMessage)}if(e.editedMessage!=null){if(typeof e.editedMessage!="object")throw TypeError(".proto.Message.editedMessage: object expected");i.editedMessage=d.proto.Message.FutureProofMessage.fromObject(e.editedMessage)}if(e.viewOnceMessageV2Extension!=null){if(typeof e.viewOnceMessageV2Extension!="object")throw TypeError(".proto.Message.viewOnceMessageV2Extension: object expected");i.viewOnceMessageV2Extension=d.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessageV2Extension)}if(e.pollCreationMessageV2!=null){if(typeof e.pollCreationMessageV2!="object")throw TypeError(".proto.Message.pollCreationMessageV2: object expected");i.pollCreationMessageV2=d.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV2)}if(e.scheduledCallCreationMessage!=null){if(typeof e.scheduledCallCreationMessage!="object")throw TypeError(".proto.Message.scheduledCallCreationMessage: object expected");i.scheduledCallCreationMessage=d.proto.Message.ScheduledCallCreationMessage.fromObject(e.scheduledCallCreationMessage)}if(e.groupMentionedMessage!=null){if(typeof e.groupMentionedMessage!="object")throw TypeError(".proto.Message.groupMentionedMessage: object expected");i.groupMentionedMessage=d.proto.Message.FutureProofMessage.fromObject(e.groupMentionedMessage)}if(e.pinInChatMessage!=null){if(typeof e.pinInChatMessage!="object")throw TypeError(".proto.Message.pinInChatMessage: object expected");i.pinInChatMessage=d.proto.Message.PinInChatMessage.fromObject(e.pinInChatMessage)}if(e.pollCreationMessageV3!=null){if(typeof e.pollCreationMessageV3!="object")throw TypeError(".proto.Message.pollCreationMessageV3: object expected");i.pollCreationMessageV3=d.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV3)}if(e.scheduledCallEditMessage!=null){if(typeof e.scheduledCallEditMessage!="object")throw TypeError(".proto.Message.scheduledCallEditMessage: object expected");i.scheduledCallEditMessage=d.proto.Message.ScheduledCallEditMessage.fromObject(e.scheduledCallEditMessage)}if(e.ptvMessage!=null){if(typeof e.ptvMessage!="object")throw TypeError(".proto.Message.ptvMessage: object expected");i.ptvMessage=d.proto.Message.VideoMessage.fromObject(e.ptvMessage)}if(e.botInvokeMessage!=null){if(typeof e.botInvokeMessage!="object")throw TypeError(".proto.Message.botInvokeMessage: object expected");i.botInvokeMessage=d.proto.Message.FutureProofMessage.fromObject(e.botInvokeMessage)}if(e.callLogMesssage!=null){if(typeof e.callLogMesssage!="object")throw TypeError(".proto.Message.callLogMesssage: object expected");i.callLogMesssage=d.proto.Message.CallLogMessage.fromObject(e.callLogMesssage)}if(e.messageHistoryBundle!=null){if(typeof e.messageHistoryBundle!="object")throw TypeError(".proto.Message.messageHistoryBundle: object expected");i.messageHistoryBundle=d.proto.Message.MessageHistoryBundle.fromObject(e.messageHistoryBundle)}if(e.encCommentMessage!=null){if(typeof e.encCommentMessage!="object")throw TypeError(".proto.Message.encCommentMessage: object expected");i.encCommentMessage=d.proto.Message.EncCommentMessage.fromObject(e.encCommentMessage)}if(e.bcallMessage!=null){if(typeof e.bcallMessage!="object")throw TypeError(".proto.Message.bcallMessage: object expected");i.bcallMessage=d.proto.Message.BCallMessage.fromObject(e.bcallMessage)}if(e.lottieStickerMessage!=null){if(typeof e.lottieStickerMessage!="object")throw TypeError(".proto.Message.lottieStickerMessage: object expected");i.lottieStickerMessage=d.proto.Message.FutureProofMessage.fromObject(e.lottieStickerMessage)}if(e.eventMessage!=null){if(typeof e.eventMessage!="object")throw TypeError(".proto.Message.eventMessage: object expected");i.eventMessage=d.proto.Message.EventMessage.fromObject(e.eventMessage)}if(e.encEventResponseMessage!=null){if(typeof e.encEventResponseMessage!="object")throw TypeError(".proto.Message.encEventResponseMessage: object expected");i.encEventResponseMessage=d.proto.Message.EncEventResponseMessage.fromObject(e.encEventResponseMessage)}if(e.commentMessage!=null){if(typeof e.commentMessage!="object")throw TypeError(".proto.Message.commentMessage: object expected");i.commentMessage=d.proto.Message.CommentMessage.fromObject(e.commentMessage)}if(e.newsletterAdminInviteMessage!=null){if(typeof e.newsletterAdminInviteMessage!="object")throw TypeError(".proto.Message.newsletterAdminInviteMessage: object expected");i.newsletterAdminInviteMessage=d.proto.Message.NewsletterAdminInviteMessage.fromObject(e.newsletterAdminInviteMessage)}if(e.placeholderMessage!=null){if(typeof e.placeholderMessage!="object")throw TypeError(".proto.Message.placeholderMessage: object expected");i.placeholderMessage=d.proto.Message.PlaceholderMessage.fromObject(e.placeholderMessage)}if(e.secretEncryptedMessage!=null){if(typeof e.secretEncryptedMessage!="object")throw TypeError(".proto.Message.secretEncryptedMessage: object expected");i.secretEncryptedMessage=d.proto.Message.SecretEncryptedMessage.fromObject(e.secretEncryptedMessage)}if(e.albumMessage!=null){if(typeof e.albumMessage!="object")throw TypeError(".proto.Message.albumMessage: object expected");i.albumMessage=d.proto.Message.AlbumMessage.fromObject(e.albumMessage)}if(e.eventCoverImage!=null){if(typeof e.eventCoverImage!="object")throw TypeError(".proto.Message.eventCoverImage: object expected");i.eventCoverImage=d.proto.Message.FutureProofMessage.fromObject(e.eventCoverImage)}if(e.stickerPackMessage!=null){if(typeof e.stickerPackMessage!="object")throw TypeError(".proto.Message.stickerPackMessage: object expected");i.stickerPackMessage=d.proto.Message.StickerPackMessage.fromObject(e.stickerPackMessage)}if(e.statusMentionMessage!=null){if(typeof e.statusMentionMessage!="object")throw TypeError(".proto.Message.statusMentionMessage: object expected");i.statusMentionMessage=d.proto.Message.FutureProofMessage.fromObject(e.statusMentionMessage)}if(e.pollResultSnapshotMessage!=null){if(typeof e.pollResultSnapshotMessage!="object")throw TypeError(".proto.Message.pollResultSnapshotMessage: object expected");i.pollResultSnapshotMessage=d.proto.Message.PollResultSnapshotMessage.fromObject(e.pollResultSnapshotMessage)}if(e.pollCreationOptionImageMessage!=null){if(typeof e.pollCreationOptionImageMessage!="object")throw TypeError(".proto.Message.pollCreationOptionImageMessage: object expected");i.pollCreationOptionImageMessage=d.proto.Message.FutureProofMessage.fromObject(e.pollCreationOptionImageMessage)}if(e.associatedChildMessage!=null){if(typeof e.associatedChildMessage!="object")throw TypeError(".proto.Message.associatedChildMessage: object expected");i.associatedChildMessage=d.proto.Message.FutureProofMessage.fromObject(e.associatedChildMessage)}if(e.groupStatusMentionMessage!=null){if(typeof e.groupStatusMentionMessage!="object")throw TypeError(".proto.Message.groupStatusMentionMessage: object expected");i.groupStatusMentionMessage=d.proto.Message.FutureProofMessage.fromObject(e.groupStatusMentionMessage)}if(e.pollCreationMessageV4!=null){if(typeof e.pollCreationMessageV4!="object")throw TypeError(".proto.Message.pollCreationMessageV4: object expected");i.pollCreationMessageV4=d.proto.Message.FutureProofMessage.fromObject(e.pollCreationMessageV4)}if(e.statusAddYours!=null){if(typeof e.statusAddYours!="object")throw TypeError(".proto.Message.statusAddYours: object expected");i.statusAddYours=d.proto.Message.FutureProofMessage.fromObject(e.statusAddYours)}if(e.groupStatusMessage!=null){if(typeof e.groupStatusMessage!="object")throw TypeError(".proto.Message.groupStatusMessage: object expected");i.groupStatusMessage=d.proto.Message.FutureProofMessage.fromObject(e.groupStatusMessage)}if(e.richResponseMessage!=null){if(typeof e.richResponseMessage!="object")throw TypeError(".proto.Message.richResponseMessage: object expected");i.richResponseMessage=d.proto.AIRichResponseMessage.fromObject(e.richResponseMessage)}if(e.statusNotificationMessage!=null){if(typeof e.statusNotificationMessage!="object")throw TypeError(".proto.Message.statusNotificationMessage: object expected");i.statusNotificationMessage=d.proto.Message.StatusNotificationMessage.fromObject(e.statusNotificationMessage)}if(e.limitSharingMessage!=null){if(typeof e.limitSharingMessage!="object")throw TypeError(".proto.Message.limitSharingMessage: object expected");i.limitSharingMessage=d.proto.Message.FutureProofMessage.fromObject(e.limitSharingMessage)}if(e.botTaskMessage!=null){if(typeof e.botTaskMessage!="object")throw TypeError(".proto.Message.botTaskMessage: object expected");i.botTaskMessage=d.proto.Message.FutureProofMessage.fromObject(e.botTaskMessage)}if(e.questionMessage!=null){if(typeof e.questionMessage!="object")throw TypeError(".proto.Message.questionMessage: object expected");i.questionMessage=d.proto.Message.FutureProofMessage.fromObject(e.questionMessage)}if(e.messageHistoryNotice!=null){if(typeof e.messageHistoryNotice!="object")throw TypeError(".proto.Message.messageHistoryNotice: object expected");i.messageHistoryNotice=d.proto.Message.MessageHistoryNotice.fromObject(e.messageHistoryNotice)}if(e.groupStatusMessageV2!=null){if(typeof e.groupStatusMessageV2!="object")throw TypeError(".proto.Message.groupStatusMessageV2: object expected");i.groupStatusMessageV2=d.proto.Message.FutureProofMessage.fromObject(e.groupStatusMessageV2)}if(e.botForwardedMessage!=null){if(typeof e.botForwardedMessage!="object")throw TypeError(".proto.Message.botForwardedMessage: object expected");i.botForwardedMessage=d.proto.Message.FutureProofMessage.fromObject(e.botForwardedMessage)}if(e.statusQuestionAnswerMessage!=null){if(typeof e.statusQuestionAnswerMessage!="object")throw TypeError(".proto.Message.statusQuestionAnswerMessage: object expected");i.statusQuestionAnswerMessage=d.proto.Message.StatusQuestionAnswerMessage.fromObject(e.statusQuestionAnswerMessage)}if(e.questionReplyMessage!=null){if(typeof e.questionReplyMessage!="object")throw TypeError(".proto.Message.questionReplyMessage: object expected");i.questionReplyMessage=d.proto.Message.FutureProofMessage.fromObject(e.questionReplyMessage)}if(e.questionResponseMessage!=null){if(typeof e.questionResponseMessage!="object")throw TypeError(".proto.Message.questionResponseMessage: object expected");i.questionResponseMessage=d.proto.Message.QuestionResponseMessage.fromObject(e.questionResponseMessage)}if(e.statusQuotedMessage!=null){if(typeof e.statusQuotedMessage!="object")throw TypeError(".proto.Message.statusQuotedMessage: object expected");i.statusQuotedMessage=d.proto.Message.StatusQuotedMessage.fromObject(e.statusQuotedMessage)}if(e.statusStickerInteractionMessage!=null){if(typeof e.statusStickerInteractionMessage!="object")throw TypeError(".proto.Message.statusStickerInteractionMessage: object expected");i.statusStickerInteractionMessage=d.proto.Message.StatusStickerInteractionMessage.fromObject(e.statusStickerInteractionMessage)}if(e.pollCreationMessageV5!=null){if(typeof e.pollCreationMessageV5!="object")throw TypeError(".proto.Message.pollCreationMessageV5: object expected");i.pollCreationMessageV5=d.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV5)}if(e.newsletterFollowerInviteMessageV2!=null){if(typeof e.newsletterFollowerInviteMessageV2!="object")throw TypeError(".proto.Message.newsletterFollowerInviteMessageV2: object expected");i.newsletterFollowerInviteMessageV2=d.proto.Message.NewsletterFollowerInviteMessage.fromObject(e.newsletterFollowerInviteMessageV2)}if(e.pollResultSnapshotMessageV3!=null){if(typeof e.pollResultSnapshotMessageV3!="object")throw TypeError(".proto.Message.pollResultSnapshotMessageV3: object expected");i.pollResultSnapshotMessageV3=d.proto.Message.PollResultSnapshotMessage.fromObject(e.pollResultSnapshotMessageV3)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.conversation!=null&&e.hasOwnProperty("conversation")&&(A.conversation=e.conversation,i.oneofs&&(A._conversation="conversation")),e.senderKeyDistributionMessage!=null&&e.hasOwnProperty("senderKeyDistributionMessage")&&(A.senderKeyDistributionMessage=d.proto.Message.SenderKeyDistributionMessage.toObject(e.senderKeyDistributionMessage,i),i.oneofs&&(A._senderKeyDistributionMessage="senderKeyDistributionMessage")),e.imageMessage!=null&&e.hasOwnProperty("imageMessage")&&(A.imageMessage=d.proto.Message.ImageMessage.toObject(e.imageMessage,i),i.oneofs&&(A._imageMessage="imageMessage")),e.contactMessage!=null&&e.hasOwnProperty("contactMessage")&&(A.contactMessage=d.proto.Message.ContactMessage.toObject(e.contactMessage,i),i.oneofs&&(A._contactMessage="contactMessage")),e.locationMessage!=null&&e.hasOwnProperty("locationMessage")&&(A.locationMessage=d.proto.Message.LocationMessage.toObject(e.locationMessage,i),i.oneofs&&(A._locationMessage="locationMessage")),e.extendedTextMessage!=null&&e.hasOwnProperty("extendedTextMessage")&&(A.extendedTextMessage=d.proto.Message.ExtendedTextMessage.toObject(e.extendedTextMessage,i),i.oneofs&&(A._extendedTextMessage="extendedTextMessage")),e.documentMessage!=null&&e.hasOwnProperty("documentMessage")&&(A.documentMessage=d.proto.Message.DocumentMessage.toObject(e.documentMessage,i),i.oneofs&&(A._documentMessage="documentMessage")),e.audioMessage!=null&&e.hasOwnProperty("audioMessage")&&(A.audioMessage=d.proto.Message.AudioMessage.toObject(e.audioMessage,i),i.oneofs&&(A._audioMessage="audioMessage")),e.videoMessage!=null&&e.hasOwnProperty("videoMessage")&&(A.videoMessage=d.proto.Message.VideoMessage.toObject(e.videoMessage,i),i.oneofs&&(A._videoMessage="videoMessage")),e.call!=null&&e.hasOwnProperty("call")&&(A.call=d.proto.Message.Call.toObject(e.call,i),i.oneofs&&(A._call="call")),e.chat!=null&&e.hasOwnProperty("chat")&&(A.chat=d.proto.Message.Chat.toObject(e.chat,i),i.oneofs&&(A._chat="chat")),e.protocolMessage!=null&&e.hasOwnProperty("protocolMessage")&&(A.protocolMessage=d.proto.Message.ProtocolMessage.toObject(e.protocolMessage,i),i.oneofs&&(A._protocolMessage="protocolMessage")),e.contactsArrayMessage!=null&&e.hasOwnProperty("contactsArrayMessage")&&(A.contactsArrayMessage=d.proto.Message.ContactsArrayMessage.toObject(e.contactsArrayMessage,i),i.oneofs&&(A._contactsArrayMessage="contactsArrayMessage")),e.highlyStructuredMessage!=null&&e.hasOwnProperty("highlyStructuredMessage")&&(A.highlyStructuredMessage=d.proto.Message.HighlyStructuredMessage.toObject(e.highlyStructuredMessage,i),i.oneofs&&(A._highlyStructuredMessage="highlyStructuredMessage")),e.fastRatchetKeySenderKeyDistributionMessage!=null&&e.hasOwnProperty("fastRatchetKeySenderKeyDistributionMessage")&&(A.fastRatchetKeySenderKeyDistributionMessage=d.proto.Message.SenderKeyDistributionMessage.toObject(e.fastRatchetKeySenderKeyDistributionMessage,i),i.oneofs&&(A._fastRatchetKeySenderKeyDistributionMessage="fastRatchetKeySenderKeyDistributionMessage")),e.sendPaymentMessage!=null&&e.hasOwnProperty("sendPaymentMessage")&&(A.sendPaymentMessage=d.proto.Message.SendPaymentMessage.toObject(e.sendPaymentMessage,i),i.oneofs&&(A._sendPaymentMessage="sendPaymentMessage")),e.liveLocationMessage!=null&&e.hasOwnProperty("liveLocationMessage")&&(A.liveLocationMessage=d.proto.Message.LiveLocationMessage.toObject(e.liveLocationMessage,i),i.oneofs&&(A._liveLocationMessage="liveLocationMessage")),e.requestPaymentMessage!=null&&e.hasOwnProperty("requestPaymentMessage")&&(A.requestPaymentMessage=d.proto.Message.RequestPaymentMessage.toObject(e.requestPaymentMessage,i),i.oneofs&&(A._requestPaymentMessage="requestPaymentMessage")),e.declinePaymentRequestMessage!=null&&e.hasOwnProperty("declinePaymentRequestMessage")&&(A.declinePaymentRequestMessage=d.proto.Message.DeclinePaymentRequestMessage.toObject(e.declinePaymentRequestMessage,i),i.oneofs&&(A._declinePaymentRequestMessage="declinePaymentRequestMessage")),e.cancelPaymentRequestMessage!=null&&e.hasOwnProperty("cancelPaymentRequestMessage")&&(A.cancelPaymentRequestMessage=d.proto.Message.CancelPaymentRequestMessage.toObject(e.cancelPaymentRequestMessage,i),i.oneofs&&(A._cancelPaymentRequestMessage="cancelPaymentRequestMessage")),e.templateMessage!=null&&e.hasOwnProperty("templateMessage")&&(A.templateMessage=d.proto.Message.TemplateMessage.toObject(e.templateMessage,i),i.oneofs&&(A._templateMessage="templateMessage")),e.stickerMessage!=null&&e.hasOwnProperty("stickerMessage")&&(A.stickerMessage=d.proto.Message.StickerMessage.toObject(e.stickerMessage,i),i.oneofs&&(A._stickerMessage="stickerMessage")),e.groupInviteMessage!=null&&e.hasOwnProperty("groupInviteMessage")&&(A.groupInviteMessage=d.proto.Message.GroupInviteMessage.toObject(e.groupInviteMessage,i),i.oneofs&&(A._groupInviteMessage="groupInviteMessage")),e.templateButtonReplyMessage!=null&&e.hasOwnProperty("templateButtonReplyMessage")&&(A.templateButtonReplyMessage=d.proto.Message.TemplateButtonReplyMessage.toObject(e.templateButtonReplyMessage,i),i.oneofs&&(A._templateButtonReplyMessage="templateButtonReplyMessage")),e.productMessage!=null&&e.hasOwnProperty("productMessage")&&(A.productMessage=d.proto.Message.ProductMessage.toObject(e.productMessage,i),i.oneofs&&(A._productMessage="productMessage")),e.deviceSentMessage!=null&&e.hasOwnProperty("deviceSentMessage")&&(A.deviceSentMessage=d.proto.Message.DeviceSentMessage.toObject(e.deviceSentMessage,i),i.oneofs&&(A._deviceSentMessage="deviceSentMessage")),e.messageContextInfo!=null&&e.hasOwnProperty("messageContextInfo")&&(A.messageContextInfo=d.proto.MessageContextInfo.toObject(e.messageContextInfo,i),i.oneofs&&(A._messageContextInfo="messageContextInfo")),e.listMessage!=null&&e.hasOwnProperty("listMessage")&&(A.listMessage=d.proto.Message.ListMessage.toObject(e.listMessage,i),i.oneofs&&(A._listMessage="listMessage")),e.viewOnceMessage!=null&&e.hasOwnProperty("viewOnceMessage")&&(A.viewOnceMessage=d.proto.Message.FutureProofMessage.toObject(e.viewOnceMessage,i),i.oneofs&&(A._viewOnceMessage="viewOnceMessage")),e.orderMessage!=null&&e.hasOwnProperty("orderMessage")&&(A.orderMessage=d.proto.Message.OrderMessage.toObject(e.orderMessage,i),i.oneofs&&(A._orderMessage="orderMessage")),e.listResponseMessage!=null&&e.hasOwnProperty("listResponseMessage")&&(A.listResponseMessage=d.proto.Message.ListResponseMessage.toObject(e.listResponseMessage,i),i.oneofs&&(A._listResponseMessage="listResponseMessage")),e.ephemeralMessage!=null&&e.hasOwnProperty("ephemeralMessage")&&(A.ephemeralMessage=d.proto.Message.FutureProofMessage.toObject(e.ephemeralMessage,i),i.oneofs&&(A._ephemeralMessage="ephemeralMessage")),e.invoiceMessage!=null&&e.hasOwnProperty("invoiceMessage")&&(A.invoiceMessage=d.proto.Message.InvoiceMessage.toObject(e.invoiceMessage,i),i.oneofs&&(A._invoiceMessage="invoiceMessage")),e.buttonsMessage!=null&&e.hasOwnProperty("buttonsMessage")&&(A.buttonsMessage=d.proto.Message.ButtonsMessage.toObject(e.buttonsMessage,i),i.oneofs&&(A._buttonsMessage="buttonsMessage")),e.buttonsResponseMessage!=null&&e.hasOwnProperty("buttonsResponseMessage")&&(A.buttonsResponseMessage=d.proto.Message.ButtonsResponseMessage.toObject(e.buttonsResponseMessage,i),i.oneofs&&(A._buttonsResponseMessage="buttonsResponseMessage")),e.paymentInviteMessage!=null&&e.hasOwnProperty("paymentInviteMessage")&&(A.paymentInviteMessage=d.proto.Message.PaymentInviteMessage.toObject(e.paymentInviteMessage,i),i.oneofs&&(A._paymentInviteMessage="paymentInviteMessage")),e.interactiveMessage!=null&&e.hasOwnProperty("interactiveMessage")&&(A.interactiveMessage=d.proto.Message.InteractiveMessage.toObject(e.interactiveMessage,i),i.oneofs&&(A._interactiveMessage="interactiveMessage")),e.reactionMessage!=null&&e.hasOwnProperty("reactionMessage")&&(A.reactionMessage=d.proto.Message.ReactionMessage.toObject(e.reactionMessage,i),i.oneofs&&(A._reactionMessage="reactionMessage")),e.stickerSyncRmrMessage!=null&&e.hasOwnProperty("stickerSyncRmrMessage")&&(A.stickerSyncRmrMessage=d.proto.Message.StickerSyncRMRMessage.toObject(e.stickerSyncRmrMessage,i),i.oneofs&&(A._stickerSyncRmrMessage="stickerSyncRmrMessage")),e.interactiveResponseMessage!=null&&e.hasOwnProperty("interactiveResponseMessage")&&(A.interactiveResponseMessage=d.proto.Message.InteractiveResponseMessage.toObject(e.interactiveResponseMessage,i),i.oneofs&&(A._interactiveResponseMessage="interactiveResponseMessage")),e.pollCreationMessage!=null&&e.hasOwnProperty("pollCreationMessage")&&(A.pollCreationMessage=d.proto.Message.PollCreationMessage.toObject(e.pollCreationMessage,i),i.oneofs&&(A._pollCreationMessage="pollCreationMessage")),e.pollUpdateMessage!=null&&e.hasOwnProperty("pollUpdateMessage")&&(A.pollUpdateMessage=d.proto.Message.PollUpdateMessage.toObject(e.pollUpdateMessage,i),i.oneofs&&(A._pollUpdateMessage="pollUpdateMessage")),e.keepInChatMessage!=null&&e.hasOwnProperty("keepInChatMessage")&&(A.keepInChatMessage=d.proto.Message.KeepInChatMessage.toObject(e.keepInChatMessage,i),i.oneofs&&(A._keepInChatMessage="keepInChatMessage")),e.documentWithCaptionMessage!=null&&e.hasOwnProperty("documentWithCaptionMessage")&&(A.documentWithCaptionMessage=d.proto.Message.FutureProofMessage.toObject(e.documentWithCaptionMessage,i),i.oneofs&&(A._documentWithCaptionMessage="documentWithCaptionMessage")),e.requestPhoneNumberMessage!=null&&e.hasOwnProperty("requestPhoneNumberMessage")&&(A.requestPhoneNumberMessage=d.proto.Message.RequestPhoneNumberMessage.toObject(e.requestPhoneNumberMessage,i),i.oneofs&&(A._requestPhoneNumberMessage="requestPhoneNumberMessage")),e.viewOnceMessageV2!=null&&e.hasOwnProperty("viewOnceMessageV2")&&(A.viewOnceMessageV2=d.proto.Message.FutureProofMessage.toObject(e.viewOnceMessageV2,i),i.oneofs&&(A._viewOnceMessageV2="viewOnceMessageV2")),e.encReactionMessage!=null&&e.hasOwnProperty("encReactionMessage")&&(A.encReactionMessage=d.proto.Message.EncReactionMessage.toObject(e.encReactionMessage,i),i.oneofs&&(A._encReactionMessage="encReactionMessage")),e.editedMessage!=null&&e.hasOwnProperty("editedMessage")&&(A.editedMessage=d.proto.Message.FutureProofMessage.toObject(e.editedMessage,i),i.oneofs&&(A._editedMessage="editedMessage")),e.viewOnceMessageV2Extension!=null&&e.hasOwnProperty("viewOnceMessageV2Extension")&&(A.viewOnceMessageV2Extension=d.proto.Message.FutureProofMessage.toObject(e.viewOnceMessageV2Extension,i),i.oneofs&&(A._viewOnceMessageV2Extension="viewOnceMessageV2Extension")),e.pollCreationMessageV2!=null&&e.hasOwnProperty("pollCreationMessageV2")&&(A.pollCreationMessageV2=d.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV2,i),i.oneofs&&(A._pollCreationMessageV2="pollCreationMessageV2")),e.scheduledCallCreationMessage!=null&&e.hasOwnProperty("scheduledCallCreationMessage")&&(A.scheduledCallCreationMessage=d.proto.Message.ScheduledCallCreationMessage.toObject(e.scheduledCallCreationMessage,i),i.oneofs&&(A._scheduledCallCreationMessage="scheduledCallCreationMessage")),e.groupMentionedMessage!=null&&e.hasOwnProperty("groupMentionedMessage")&&(A.groupMentionedMessage=d.proto.Message.FutureProofMessage.toObject(e.groupMentionedMessage,i),i.oneofs&&(A._groupMentionedMessage="groupMentionedMessage")),e.pinInChatMessage!=null&&e.hasOwnProperty("pinInChatMessage")&&(A.pinInChatMessage=d.proto.Message.PinInChatMessage.toObject(e.pinInChatMessage,i),i.oneofs&&(A._pinInChatMessage="pinInChatMessage")),e.pollCreationMessageV3!=null&&e.hasOwnProperty("pollCreationMessageV3")&&(A.pollCreationMessageV3=d.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV3,i),i.oneofs&&(A._pollCreationMessageV3="pollCreationMessageV3")),e.scheduledCallEditMessage!=null&&e.hasOwnProperty("scheduledCallEditMessage")&&(A.scheduledCallEditMessage=d.proto.Message.ScheduledCallEditMessage.toObject(e.scheduledCallEditMessage,i),i.oneofs&&(A._scheduledCallEditMessage="scheduledCallEditMessage")),e.ptvMessage!=null&&e.hasOwnProperty("ptvMessage")&&(A.ptvMessage=d.proto.Message.VideoMessage.toObject(e.ptvMessage,i),i.oneofs&&(A._ptvMessage="ptvMessage")),e.botInvokeMessage!=null&&e.hasOwnProperty("botInvokeMessage")&&(A.botInvokeMessage=d.proto.Message.FutureProofMessage.toObject(e.botInvokeMessage,i),i.oneofs&&(A._botInvokeMessage="botInvokeMessage")),e.callLogMesssage!=null&&e.hasOwnProperty("callLogMesssage")&&(A.callLogMesssage=d.proto.Message.CallLogMessage.toObject(e.callLogMesssage,i),i.oneofs&&(A._callLogMesssage="callLogMesssage")),e.messageHistoryBundle!=null&&e.hasOwnProperty("messageHistoryBundle")&&(A.messageHistoryBundle=d.proto.Message.MessageHistoryBundle.toObject(e.messageHistoryBundle,i),i.oneofs&&(A._messageHistoryBundle="messageHistoryBundle")),e.encCommentMessage!=null&&e.hasOwnProperty("encCommentMessage")&&(A.encCommentMessage=d.proto.Message.EncCommentMessage.toObject(e.encCommentMessage,i),i.oneofs&&(A._encCommentMessage="encCommentMessage")),e.bcallMessage!=null&&e.hasOwnProperty("bcallMessage")&&(A.bcallMessage=d.proto.Message.BCallMessage.toObject(e.bcallMessage,i),i.oneofs&&(A._bcallMessage="bcallMessage")),e.lottieStickerMessage!=null&&e.hasOwnProperty("lottieStickerMessage")&&(A.lottieStickerMessage=d.proto.Message.FutureProofMessage.toObject(e.lottieStickerMessage,i),i.oneofs&&(A._lottieStickerMessage="lottieStickerMessage")),e.eventMessage!=null&&e.hasOwnProperty("eventMessage")&&(A.eventMessage=d.proto.Message.EventMessage.toObject(e.eventMessage,i),i.oneofs&&(A._eventMessage="eventMessage")),e.encEventResponseMessage!=null&&e.hasOwnProperty("encEventResponseMessage")&&(A.encEventResponseMessage=d.proto.Message.EncEventResponseMessage.toObject(e.encEventResponseMessage,i),i.oneofs&&(A._encEventResponseMessage="encEventResponseMessage")),e.commentMessage!=null&&e.hasOwnProperty("commentMessage")&&(A.commentMessage=d.proto.Message.CommentMessage.toObject(e.commentMessage,i),i.oneofs&&(A._commentMessage="commentMessage")),e.newsletterAdminInviteMessage!=null&&e.hasOwnProperty("newsletterAdminInviteMessage")&&(A.newsletterAdminInviteMessage=d.proto.Message.NewsletterAdminInviteMessage.toObject(e.newsletterAdminInviteMessage,i),i.oneofs&&(A._newsletterAdminInviteMessage="newsletterAdminInviteMessage")),e.placeholderMessage!=null&&e.hasOwnProperty("placeholderMessage")&&(A.placeholderMessage=d.proto.Message.PlaceholderMessage.toObject(e.placeholderMessage,i),i.oneofs&&(A._placeholderMessage="placeholderMessage")),e.secretEncryptedMessage!=null&&e.hasOwnProperty("secretEncryptedMessage")&&(A.secretEncryptedMessage=d.proto.Message.SecretEncryptedMessage.toObject(e.secretEncryptedMessage,i),i.oneofs&&(A._secretEncryptedMessage="secretEncryptedMessage")),e.albumMessage!=null&&e.hasOwnProperty("albumMessage")&&(A.albumMessage=d.proto.Message.AlbumMessage.toObject(e.albumMessage,i),i.oneofs&&(A._albumMessage="albumMessage")),e.eventCoverImage!=null&&e.hasOwnProperty("eventCoverImage")&&(A.eventCoverImage=d.proto.Message.FutureProofMessage.toObject(e.eventCoverImage,i),i.oneofs&&(A._eventCoverImage="eventCoverImage")),e.stickerPackMessage!=null&&e.hasOwnProperty("stickerPackMessage")&&(A.stickerPackMessage=d.proto.Message.StickerPackMessage.toObject(e.stickerPackMessage,i),i.oneofs&&(A._stickerPackMessage="stickerPackMessage")),e.statusMentionMessage!=null&&e.hasOwnProperty("statusMentionMessage")&&(A.statusMentionMessage=d.proto.Message.FutureProofMessage.toObject(e.statusMentionMessage,i),i.oneofs&&(A._statusMentionMessage="statusMentionMessage")),e.pollResultSnapshotMessage!=null&&e.hasOwnProperty("pollResultSnapshotMessage")&&(A.pollResultSnapshotMessage=d.proto.Message.PollResultSnapshotMessage.toObject(e.pollResultSnapshotMessage,i),i.oneofs&&(A._pollResultSnapshotMessage="pollResultSnapshotMessage")),e.pollCreationOptionImageMessage!=null&&e.hasOwnProperty("pollCreationOptionImageMessage")&&(A.pollCreationOptionImageMessage=d.proto.Message.FutureProofMessage.toObject(e.pollCreationOptionImageMessage,i),i.oneofs&&(A._pollCreationOptionImageMessage="pollCreationOptionImageMessage")),e.associatedChildMessage!=null&&e.hasOwnProperty("associatedChildMessage")&&(A.associatedChildMessage=d.proto.Message.FutureProofMessage.toObject(e.associatedChildMessage,i),i.oneofs&&(A._associatedChildMessage="associatedChildMessage")),e.groupStatusMentionMessage!=null&&e.hasOwnProperty("groupStatusMentionMessage")&&(A.groupStatusMentionMessage=d.proto.Message.FutureProofMessage.toObject(e.groupStatusMentionMessage,i),i.oneofs&&(A._groupStatusMentionMessage="groupStatusMentionMessage")),e.pollCreationMessageV4!=null&&e.hasOwnProperty("pollCreationMessageV4")&&(A.pollCreationMessageV4=d.proto.Message.FutureProofMessage.toObject(e.pollCreationMessageV4,i),i.oneofs&&(A._pollCreationMessageV4="pollCreationMessageV4")),e.statusAddYours!=null&&e.hasOwnProperty("statusAddYours")&&(A.statusAddYours=d.proto.Message.FutureProofMessage.toObject(e.statusAddYours,i),i.oneofs&&(A._statusAddYours="statusAddYours")),e.groupStatusMessage!=null&&e.hasOwnProperty("groupStatusMessage")&&(A.groupStatusMessage=d.proto.Message.FutureProofMessage.toObject(e.groupStatusMessage,i),i.oneofs&&(A._groupStatusMessage="groupStatusMessage")),e.richResponseMessage!=null&&e.hasOwnProperty("richResponseMessage")&&(A.richResponseMessage=d.proto.AIRichResponseMessage.toObject(e.richResponseMessage,i),i.oneofs&&(A._richResponseMessage="richResponseMessage")),e.statusNotificationMessage!=null&&e.hasOwnProperty("statusNotificationMessage")&&(A.statusNotificationMessage=d.proto.Message.StatusNotificationMessage.toObject(e.statusNotificationMessage,i),i.oneofs&&(A._statusNotificationMessage="statusNotificationMessage")),e.limitSharingMessage!=null&&e.hasOwnProperty("limitSharingMessage")&&(A.limitSharingMessage=d.proto.Message.FutureProofMessage.toObject(e.limitSharingMessage,i),i.oneofs&&(A._limitSharingMessage="limitSharingMessage")),e.botTaskMessage!=null&&e.hasOwnProperty("botTaskMessage")&&(A.botTaskMessage=d.proto.Message.FutureProofMessage.toObject(e.botTaskMessage,i),i.oneofs&&(A._botTaskMessage="botTaskMessage")),e.questionMessage!=null&&e.hasOwnProperty("questionMessage")&&(A.questionMessage=d.proto.Message.FutureProofMessage.toObject(e.questionMessage,i),i.oneofs&&(A._questionMessage="questionMessage")),e.messageHistoryNotice!=null&&e.hasOwnProperty("messageHistoryNotice")&&(A.messageHistoryNotice=d.proto.Message.MessageHistoryNotice.toObject(e.messageHistoryNotice,i),i.oneofs&&(A._messageHistoryNotice="messageHistoryNotice")),e.groupStatusMessageV2!=null&&e.hasOwnProperty("groupStatusMessageV2")&&(A.groupStatusMessageV2=d.proto.Message.FutureProofMessage.toObject(e.groupStatusMessageV2,i),i.oneofs&&(A._groupStatusMessageV2="groupStatusMessageV2")),e.botForwardedMessage!=null&&e.hasOwnProperty("botForwardedMessage")&&(A.botForwardedMessage=d.proto.Message.FutureProofMessage.toObject(e.botForwardedMessage,i),i.oneofs&&(A._botForwardedMessage="botForwardedMessage")),e.statusQuestionAnswerMessage!=null&&e.hasOwnProperty("statusQuestionAnswerMessage")&&(A.statusQuestionAnswerMessage=d.proto.Message.StatusQuestionAnswerMessage.toObject(e.statusQuestionAnswerMessage,i),i.oneofs&&(A._statusQuestionAnswerMessage="statusQuestionAnswerMessage")),e.questionReplyMessage!=null&&e.hasOwnProperty("questionReplyMessage")&&(A.questionReplyMessage=d.proto.Message.FutureProofMessage.toObject(e.questionReplyMessage,i),i.oneofs&&(A._questionReplyMessage="questionReplyMessage")),e.questionResponseMessage!=null&&e.hasOwnProperty("questionResponseMessage")&&(A.questionResponseMessage=d.proto.Message.QuestionResponseMessage.toObject(e.questionResponseMessage,i),i.oneofs&&(A._questionResponseMessage="questionResponseMessage")),e.statusQuotedMessage!=null&&e.hasOwnProperty("statusQuotedMessage")&&(A.statusQuotedMessage=d.proto.Message.StatusQuotedMessage.toObject(e.statusQuotedMessage,i),i.oneofs&&(A._statusQuotedMessage="statusQuotedMessage")),e.statusStickerInteractionMessage!=null&&e.hasOwnProperty("statusStickerInteractionMessage")&&(A.statusStickerInteractionMessage=d.proto.Message.StatusStickerInteractionMessage.toObject(e.statusStickerInteractionMessage,i),i.oneofs&&(A._statusStickerInteractionMessage="statusStickerInteractionMessage")),e.pollCreationMessageV5!=null&&e.hasOwnProperty("pollCreationMessageV5")&&(A.pollCreationMessageV5=d.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV5,i),i.oneofs&&(A._pollCreationMessageV5="pollCreationMessageV5")),e.newsletterFollowerInviteMessageV2!=null&&e.hasOwnProperty("newsletterFollowerInviteMessageV2")&&(A.newsletterFollowerInviteMessageV2=d.proto.Message.NewsletterFollowerInviteMessage.toObject(e.newsletterFollowerInviteMessageV2,i),i.oneofs&&(A._newsletterFollowerInviteMessageV2="newsletterFollowerInviteMessageV2")),e.pollResultSnapshotMessageV3!=null&&e.hasOwnProperty("pollResultSnapshotMessageV3")&&(A.pollResultSnapshotMessageV3=d.proto.Message.PollResultSnapshotMessage.toObject(e.pollResultSnapshotMessageV3,i),i.oneofs&&(A._pollResultSnapshotMessageV3="pollResultSnapshotMessageV3")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Message"},t.AlbumMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 2:{c.expectedImageCount=A.uint32();break}case 3:{c.expectedVideoCount=A.uint32();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.AlbumMessage)return A;var r=new d.proto.Message.AlbumMessage;if(A.expectedImageCount!=null&&(r.expectedImageCount=A.expectedImageCount>>>0),A.expectedVideoCount!=null&&(r.expectedVideoCount=A.expectedVideoCount>>>0),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.AlbumMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.expectedImageCount!=null&&A.hasOwnProperty("expectedImageCount")&&(s.expectedImageCount=A.expectedImageCount,r.oneofs&&(s._expectedImageCount="expectedImageCount")),A.expectedVideoCount!=null&&A.hasOwnProperty("expectedVideoCount")&&(s.expectedVideoCount=A.expectedVideoCount,r.oneofs&&(s._expectedVideoCount="expectedVideoCount")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AlbumMessage"},a})(),t.AppStateFatalExceptionNotification=(function(){function a(i){if(this.collectionNames=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.collectionNames&&c.collectionNames.length||(c.collectionNames=[]),c.collectionNames.push(A.string());break}case 2:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.AppStateFatalExceptionNotification)return A;var r=new d.proto.Message.AppStateFatalExceptionNotification;if(A.collectionNames){if(!Array.isArray(A.collectionNames))throw TypeError(".proto.Message.AppStateFatalExceptionNotification.collectionNames: array expected");r.collectionNames=[];for(var s=0;s>>0,A.timestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.collectionNames=[]),A.collectionNames&&A.collectionNames.length){s.collectionNames=[];for(var g=0;g>>3){case 1:{c.keyId=d.proto.Message.AppStateSyncKeyId.decode(A,A.uint32());break}case 2:{c.keyData=d.proto.Message.AppStateSyncKeyData.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.AppStateSyncKey)return A;var r=new d.proto.Message.AppStateSyncKey;if(A.keyId!=null){if(typeof A.keyId!="object")throw TypeError(".proto.Message.AppStateSyncKey.keyId: object expected");r.keyId=d.proto.Message.AppStateSyncKeyId.fromObject(A.keyId)}if(A.keyData!=null){if(typeof A.keyData!="object")throw TypeError(".proto.Message.AppStateSyncKey.keyData: object expected");r.keyData=d.proto.Message.AppStateSyncKeyData.fromObject(A.keyData)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.keyId!=null&&A.hasOwnProperty("keyId")&&(s.keyId=d.proto.Message.AppStateSyncKeyId.toObject(A.keyId,r),r.oneofs&&(s._keyId="keyId")),A.keyData!=null&&A.hasOwnProperty("keyData")&&(s.keyData=d.proto.Message.AppStateSyncKeyData.toObject(A.keyData,r),r.oneofs&&(s._keyData="keyData")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKey"},a})(),t.AppStateSyncKeyData=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.keyData=A.bytes();break}case 2:{c.fingerprint=d.proto.Message.AppStateSyncKeyFingerprint.decode(A,A.uint32());break}case 3:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.AppStateSyncKeyData)return A;var r=new d.proto.Message.AppStateSyncKeyData;if(A.keyData!=null&&(typeof A.keyData=="string"?l.base64.decode(A.keyData,r.keyData=l.newBuffer(l.base64.length(A.keyData)),0):A.keyData.length>=0&&(r.keyData=A.keyData)),A.fingerprint!=null){if(typeof A.fingerprint!="object")throw TypeError(".proto.Message.AppStateSyncKeyData.fingerprint: object expected");r.fingerprint=d.proto.Message.AppStateSyncKeyFingerprint.fromObject(A.fingerprint)}return A.timestamp!=null&&(l.Long?(r.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?r.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?r.timestamp=A.timestamp:typeof A.timestamp=="object"&&(r.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.keyData!=null&&A.hasOwnProperty("keyData")&&(s.keyData=r.bytes===String?l.base64.encode(A.keyData,0,A.keyData.length):r.bytes===Array?Array.prototype.slice.call(A.keyData):A.keyData,r.oneofs&&(s._keyData="keyData")),A.fingerprint!=null&&A.hasOwnProperty("fingerprint")&&(s.fingerprint=d.proto.Message.AppStateSyncKeyFingerprint.toObject(A.fingerprint,r),r.oneofs&&(s._fingerprint="fingerprint")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=r.longs===String?String(A.timestamp):A.timestamp:s.timestamp=r.longs===String?ge(A.timestamp):r.longs===Number?ce(A.timestamp):A.timestamp,r.oneofs&&(s._timestamp="timestamp")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKeyData"},a})(),t.AppStateSyncKeyFingerprint=(function(){function a(i){if(this.deviceIndexes=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.rawId=A.uint32();break}case 2:{c.currentIndex=A.uint32();break}case 3:{if(c.deviceIndexes&&c.deviceIndexes.length||(c.deviceIndexes=[]),(I&7)===2)for(var p=A.uint32()+A.pos;A.pos>>0),A.currentIndex!=null&&(r.currentIndex=A.currentIndex>>>0),A.deviceIndexes){if(!Array.isArray(A.deviceIndexes))throw TypeError(".proto.Message.AppStateSyncKeyFingerprint.deviceIndexes: array expected");r.deviceIndexes=[];for(var s=0;s>>0}return r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.deviceIndexes=[]),A.rawId!=null&&A.hasOwnProperty("rawId")&&(s.rawId=A.rawId,r.oneofs&&(s._rawId="rawId")),A.currentIndex!=null&&A.hasOwnProperty("currentIndex")&&(s.currentIndex=A.currentIndex,r.oneofs&&(s._currentIndex="currentIndex")),A.deviceIndexes&&A.deviceIndexes.length){s.deviceIndexes=[];for(var g=0;g>>3){case 1:{c.keyId=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.AppStateSyncKeyId)return A;var r=new d.proto.Message.AppStateSyncKeyId;return A.keyId!=null&&(typeof A.keyId=="string"?l.base64.decode(A.keyId,r.keyId=l.newBuffer(l.base64.length(A.keyId)),0):A.keyId.length>=0&&(r.keyId=A.keyId)),r},a.toObject=function(A,r){r||(r={});var s={};return A.keyId!=null&&A.hasOwnProperty("keyId")&&(s.keyId=r.bytes===String?l.base64.encode(A.keyId,0,A.keyId.length):r.bytes===Array?Array.prototype.slice.call(A.keyId):A.keyId,r.oneofs&&(s._keyId="keyId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKeyId"},a})(),t.AppStateSyncKeyRequest=(function(){function a(e){if(this.keyIds=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.keyIds&&g.keyIds.length||(g.keyIds=[]),g.keyIds.push(d.proto.Message.AppStateSyncKeyId.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.Message.AppStateSyncKeyRequest)return i;var A=new d.proto.Message.AppStateSyncKeyRequest;if(i.keyIds){if(!Array.isArray(i.keyIds))throw TypeError(".proto.Message.AppStateSyncKeyRequest.keyIds: array expected");A.keyIds=[];for(var r=0;r>>3){case 1:{g.keys&&g.keys.length||(g.keys=[]),g.keys.push(d.proto.Message.AppStateSyncKey.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.Message.AppStateSyncKeyShare)return i;var A=new d.proto.Message.AppStateSyncKeyShare;if(i.keys){if(!Array.isArray(i.keys))throw TypeError(".proto.Message.AppStateSyncKeyShare.keys: array expected");A.keys=[];for(var r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileLength=A.uint64();break}case 5:{c.seconds=A.uint32();break}case 6:{c.ptt=A.bool();break}case 7:{c.mediaKey=A.bytes();break}case 8:{c.fileEncSha256=A.bytes();break}case 9:{c.directPath=A.string();break}case 10:{c.mediaKeyTimestamp=A.int64();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.streamingSidecar=A.bytes();break}case 19:{c.waveform=A.bytes();break}case 20:{c.backgroundArgb=A.fixed32();break}case 21:{c.viewOnce=A.bool();break}case 22:{c.accessibilityLabel=A.string();break}case 23:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.AudioMessage)return A;var r=new d.proto.Message.AudioMessage;if(A.url!=null&&(r.url=String(A.url)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.seconds!=null&&(r.seconds=A.seconds>>>0),A.ptt!=null&&(r.ptt=!!A.ptt),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.AudioMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.streamingSidecar!=null&&(typeof A.streamingSidecar=="string"?l.base64.decode(A.streamingSidecar,r.streamingSidecar=l.newBuffer(l.base64.length(A.streamingSidecar)),0):A.streamingSidecar.length>=0&&(r.streamingSidecar=A.streamingSidecar)),A.waveform!=null&&(typeof A.waveform=="string"?l.base64.decode(A.waveform,r.waveform=l.newBuffer(l.base64.length(A.waveform)),0):A.waveform.length>=0&&(r.waveform=A.waveform)),A.backgroundArgb!=null&&(r.backgroundArgb=A.backgroundArgb>>>0),A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.accessibilityLabel!=null&&(r.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.seconds!=null&&A.hasOwnProperty("seconds")&&(s.seconds=A.seconds,r.oneofs&&(s._seconds="seconds")),A.ptt!=null&&A.hasOwnProperty("ptt")&&(s.ptt=A.ptt,r.oneofs&&(s._ptt="ptt")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.streamingSidecar!=null&&A.hasOwnProperty("streamingSidecar")&&(s.streamingSidecar=r.bytes===String?l.base64.encode(A.streamingSidecar,0,A.streamingSidecar.length):r.bytes===Array?Array.prototype.slice.call(A.streamingSidecar):A.streamingSidecar,r.oneofs&&(s._streamingSidecar="streamingSidecar")),A.waveform!=null&&A.hasOwnProperty("waveform")&&(s.waveform=r.bytes===String?l.base64.encode(A.waveform,0,A.waveform.length):r.bytes===Array?Array.prototype.slice.call(A.waveform):A.waveform,r.oneofs&&(s._waveform="waveform")),A.backgroundArgb!=null&&A.hasOwnProperty("backgroundArgb")&&(s.backgroundArgb=A.backgroundArgb,r.oneofs&&(s._backgroundArgb="backgroundArgb")),A.viewOnce!=null&&A.hasOwnProperty("viewOnce")&&(s.viewOnce=A.viewOnce,r.oneofs&&(s._viewOnce="viewOnce")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,r.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AudioMessage"},a})(),t.BCallMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.sessionId=A.string();break}case 2:{c.mediaType=A.int32();break}case 3:{c.masterKey=A.bytes();break}case 4:{c.caption=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.BCallMessage)return A;var r=new d.proto.Message.BCallMessage;switch(A.sessionId!=null&&(r.sessionId=String(A.sessionId)),A.mediaType){default:if(typeof A.mediaType=="number"){r.mediaType=A.mediaType;break}break;case"UNKNOWN":case 0:r.mediaType=0;break;case"AUDIO":case 1:r.mediaType=1;break;case"VIDEO":case 2:r.mediaType=2;break}return A.masterKey!=null&&(typeof A.masterKey=="string"?l.base64.decode(A.masterKey,r.masterKey=l.newBuffer(l.base64.length(A.masterKey)),0):A.masterKey.length>=0&&(r.masterKey=A.masterKey)),A.caption!=null&&(r.caption=String(A.caption)),r},a.toObject=function(A,r){r||(r={});var s={};return A.sessionId!=null&&A.hasOwnProperty("sessionId")&&(s.sessionId=A.sessionId,r.oneofs&&(s._sessionId="sessionId")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=r.enums===String?d.proto.Message.BCallMessage.MediaType[A.mediaType]===void 0?A.mediaType:d.proto.Message.BCallMessage.MediaType[A.mediaType]:A.mediaType,r.oneofs&&(s._mediaType="mediaType")),A.masterKey!=null&&A.hasOwnProperty("masterKey")&&(s.masterKey=r.bytes===String?l.base64.encode(A.masterKey,0,A.masterKey.length):r.bytes===Array?Array.prototype.slice.call(A.masterKey):A.masterKey,r.oneofs&&(s._masterKey="masterKey")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.BCallMessage"},a.MediaType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="AUDIO"]=1,A[i[2]="VIDEO"]=2,A})(),a})(),t.ButtonsMessage=(function(){function a(i){if(this.buttons=[],i)for(var A=Object.keys(i),r=0;r>>3){case 6:{c.contentText=A.string();break}case 7:{c.footerText=A.string();break}case 8:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 9:{c.buttons&&c.buttons.length||(c.buttons=[]),c.buttons.push(d.proto.Message.ButtonsMessage.Button.decode(A,A.uint32()));break}case 10:{c.headerType=A.int32();break}case 1:{c.text=A.string();break}case 2:{c.documentMessage=d.proto.Message.DocumentMessage.decode(A,A.uint32());break}case 3:{c.imageMessage=d.proto.Message.ImageMessage.decode(A,A.uint32());break}case 4:{c.videoMessage=d.proto.Message.VideoMessage.decode(A,A.uint32());break}case 5:{c.locationMessage=d.proto.Message.LocationMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ButtonsMessage)return A;var r=new d.proto.Message.ButtonsMessage;if(A.contentText!=null&&(r.contentText=String(A.contentText)),A.footerText!=null&&(r.footerText=String(A.footerText)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ButtonsMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.buttons){if(!Array.isArray(A.buttons))throw TypeError(".proto.Message.ButtonsMessage.buttons: array expected");r.buttons=[];for(var s=0;s>>3){case 1:{p.buttonId=s.string();break}case 2:{p.buttonText=d.proto.Message.ButtonsMessage.Button.ButtonText.decode(s,s.uint32());break}case 3:{p.type=s.int32();break}case 4:{p.nativeFlowInfo=d.proto.Message.ButtonsMessage.Button.NativeFlowInfo.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ButtonsMessage.Button)return s;var g=new d.proto.Message.ButtonsMessage.Button;if(s.buttonId!=null&&(g.buttonId=String(s.buttonId)),s.buttonText!=null){if(typeof s.buttonText!="object")throw TypeError(".proto.Message.ButtonsMessage.Button.buttonText: object expected");g.buttonText=d.proto.Message.ButtonsMessage.Button.ButtonText.fromObject(s.buttonText)}switch(s.type){default:if(typeof s.type=="number"){g.type=s.type;break}break;case"UNKNOWN":case 0:g.type=0;break;case"RESPONSE":case 1:g.type=1;break;case"NATIVE_FLOW":case 2:g.type=2;break}if(s.nativeFlowInfo!=null){if(typeof s.nativeFlowInfo!="object")throw TypeError(".proto.Message.ButtonsMessage.Button.nativeFlowInfo: object expected");g.nativeFlowInfo=d.proto.Message.ButtonsMessage.Button.NativeFlowInfo.fromObject(s.nativeFlowInfo)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.buttonId!=null&&s.hasOwnProperty("buttonId")&&(c.buttonId=s.buttonId,g.oneofs&&(c._buttonId="buttonId")),s.buttonText!=null&&s.hasOwnProperty("buttonText")&&(c.buttonText=d.proto.Message.ButtonsMessage.Button.ButtonText.toObject(s.buttonText,g),g.oneofs&&(c._buttonText="buttonText")),s.type!=null&&s.hasOwnProperty("type")&&(c.type=g.enums===String?d.proto.Message.ButtonsMessage.Button.Type[s.type]===void 0?s.type:d.proto.Message.ButtonsMessage.Button.Type[s.type]:s.type,g.oneofs&&(c._type="type")),s.nativeFlowInfo!=null&&s.hasOwnProperty("nativeFlowInfo")&&(c.nativeFlowInfo=d.proto.Message.ButtonsMessage.Button.NativeFlowInfo.toObject(s.nativeFlowInfo,g),g.oneofs&&(c._nativeFlowInfo="nativeFlowInfo")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ButtonsMessage.Button"},i.ButtonText=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.displayText=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.ButtonsMessage.Button.ButtonText)return c;var I=new d.proto.Message.ButtonsMessage.Button.ButtonText;return c.displayText!=null&&(I.displayText=String(c.displayText)),I},r.toObject=function(c,I){I||(I={});var p={};return c.displayText!=null&&c.hasOwnProperty("displayText")&&(p.displayText=c.displayText,I.oneofs&&(p._displayText="displayText")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.ButtonsMessage.Button.ButtonText"},r})(),i.NativeFlowInfo=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.name=c.string();break}case 2:{f.paramsJson=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.ButtonsMessage.Button.NativeFlowInfo)return c;var I=new d.proto.Message.ButtonsMessage.Button.NativeFlowInfo;return c.name!=null&&(I.name=String(c.name)),c.paramsJson!=null&&(I.paramsJson=String(c.paramsJson)),I},r.toObject=function(c,I){I||(I={});var p={};return c.name!=null&&c.hasOwnProperty("name")&&(p.name=c.name,I.oneofs&&(p._name="name")),c.paramsJson!=null&&c.hasOwnProperty("paramsJson")&&(p.paramsJson=c.paramsJson,I.oneofs&&(p._paramsJson="paramsJson")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.ButtonsMessage.Button.NativeFlowInfo"},r})(),i.Type=(function(){let r={},s=Object.create(r);return s[r[0]="UNKNOWN"]=0,s[r[1]="RESPONSE"]=1,s[r[2]="NATIVE_FLOW"]=2,s})(),i})(),a.HeaderType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="EMPTY"]=1,A[i[2]="TEXT"]=2,A[i[3]="DOCUMENT"]=3,A[i[4]="IMAGE"]=4,A[i[5]="VIDEO"]=5,A[i[6]="LOCATION"]=6,A})(),a})(),t.ButtonsResponseMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.selectedButtonId=A.string();break}case 3:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.type=A.int32();break}case 2:{c.selectedDisplayText=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ButtonsResponseMessage)return A;var r=new d.proto.Message.ButtonsResponseMessage;if(A.selectedButtonId!=null&&(r.selectedButtonId=String(A.selectedButtonId)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ButtonsResponseMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"DISPLAY_TEXT":case 1:r.type=1;break}return A.selectedDisplayText!=null&&(r.selectedDisplayText=String(A.selectedDisplayText)),r},a.toObject=function(A,r){r||(r={});var s={};return A.selectedButtonId!=null&&A.hasOwnProperty("selectedButtonId")&&(s.selectedButtonId=A.selectedButtonId,r.oneofs&&(s._selectedButtonId="selectedButtonId")),A.selectedDisplayText!=null&&A.hasOwnProperty("selectedDisplayText")&&(s.selectedDisplayText=A.selectedDisplayText,r.oneofs&&(s.response="selectedDisplayText")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.ButtonsResponseMessage.Type[A.type]===void 0?A.type:d.proto.Message.ButtonsResponseMessage.Type[A.type]:A.type,r.oneofs&&(s._type="type")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ButtonsResponseMessage"},a.Type=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="DISPLAY_TEXT"]=1,A})(),a})(),t.Call=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.callKey=A.bytes();break}case 2:{c.conversionSource=A.string();break}case 3:{c.conversionData=A.bytes();break}case 4:{c.conversionDelaySeconds=A.uint32();break}case 5:{c.ctwaSignals=A.string();break}case 6:{c.ctwaPayload=A.bytes();break}case 7:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.nativeFlowCallButtonPayload=A.string();break}case 9:{c.deeplinkPayload=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.Call)return A;var r=new d.proto.Message.Call;if(A.callKey!=null&&(typeof A.callKey=="string"?l.base64.decode(A.callKey,r.callKey=l.newBuffer(l.base64.length(A.callKey)),0):A.callKey.length>=0&&(r.callKey=A.callKey)),A.conversionSource!=null&&(r.conversionSource=String(A.conversionSource)),A.conversionData!=null&&(typeof A.conversionData=="string"?l.base64.decode(A.conversionData,r.conversionData=l.newBuffer(l.base64.length(A.conversionData)),0):A.conversionData.length>=0&&(r.conversionData=A.conversionData)),A.conversionDelaySeconds!=null&&(r.conversionDelaySeconds=A.conversionDelaySeconds>>>0),A.ctwaSignals!=null&&(r.ctwaSignals=String(A.ctwaSignals)),A.ctwaPayload!=null&&(typeof A.ctwaPayload=="string"?l.base64.decode(A.ctwaPayload,r.ctwaPayload=l.newBuffer(l.base64.length(A.ctwaPayload)),0):A.ctwaPayload.length>=0&&(r.ctwaPayload=A.ctwaPayload)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.Call.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return A.nativeFlowCallButtonPayload!=null&&(r.nativeFlowCallButtonPayload=String(A.nativeFlowCallButtonPayload)),A.deeplinkPayload!=null&&(r.deeplinkPayload=String(A.deeplinkPayload)),r},a.toObject=function(A,r){r||(r={});var s={};return A.callKey!=null&&A.hasOwnProperty("callKey")&&(s.callKey=r.bytes===String?l.base64.encode(A.callKey,0,A.callKey.length):r.bytes===Array?Array.prototype.slice.call(A.callKey):A.callKey,r.oneofs&&(s._callKey="callKey")),A.conversionSource!=null&&A.hasOwnProperty("conversionSource")&&(s.conversionSource=A.conversionSource,r.oneofs&&(s._conversionSource="conversionSource")),A.conversionData!=null&&A.hasOwnProperty("conversionData")&&(s.conversionData=r.bytes===String?l.base64.encode(A.conversionData,0,A.conversionData.length):r.bytes===Array?Array.prototype.slice.call(A.conversionData):A.conversionData,r.oneofs&&(s._conversionData="conversionData")),A.conversionDelaySeconds!=null&&A.hasOwnProperty("conversionDelaySeconds")&&(s.conversionDelaySeconds=A.conversionDelaySeconds,r.oneofs&&(s._conversionDelaySeconds="conversionDelaySeconds")),A.ctwaSignals!=null&&A.hasOwnProperty("ctwaSignals")&&(s.ctwaSignals=A.ctwaSignals,r.oneofs&&(s._ctwaSignals="ctwaSignals")),A.ctwaPayload!=null&&A.hasOwnProperty("ctwaPayload")&&(s.ctwaPayload=r.bytes===String?l.base64.encode(A.ctwaPayload,0,A.ctwaPayload.length):r.bytes===Array?Array.prototype.slice.call(A.ctwaPayload):A.ctwaPayload,r.oneofs&&(s._ctwaPayload="ctwaPayload")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.nativeFlowCallButtonPayload!=null&&A.hasOwnProperty("nativeFlowCallButtonPayload")&&(s.nativeFlowCallButtonPayload=A.nativeFlowCallButtonPayload,r.oneofs&&(s._nativeFlowCallButtonPayload="nativeFlowCallButtonPayload")),A.deeplinkPayload!=null&&A.hasOwnProperty("deeplinkPayload")&&(s.deeplinkPayload=A.deeplinkPayload,r.oneofs&&(s._deeplinkPayload="deeplinkPayload")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.Call"},a})(),t.CallLogMessage=(function(){function a(i){if(this.participants=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isVideo=A.bool();break}case 2:{c.callOutcome=A.int32();break}case 3:{c.durationSecs=A.int64();break}case 4:{c.callType=A.int32();break}case 5:{c.participants&&c.participants.length||(c.participants=[]),c.participants.push(d.proto.Message.CallLogMessage.CallParticipant.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.CallLogMessage)return A;var r=new d.proto.Message.CallLogMessage;switch(A.isVideo!=null&&(r.isVideo=!!A.isVideo),A.callOutcome){default:if(typeof A.callOutcome=="number"){r.callOutcome=A.callOutcome;break}break;case"CONNECTED":case 0:r.callOutcome=0;break;case"MISSED":case 1:r.callOutcome=1;break;case"FAILED":case 2:r.callOutcome=2;break;case"REJECTED":case 3:r.callOutcome=3;break;case"ACCEPTED_ELSEWHERE":case 4:r.callOutcome=4;break;case"ONGOING":case 5:r.callOutcome=5;break;case"SILENCED_BY_DND":case 6:r.callOutcome=6;break;case"SILENCED_UNKNOWN_CALLER":case 7:r.callOutcome=7;break}switch(A.durationSecs!=null&&(l.Long?(r.durationSecs=l.Long.fromValue(A.durationSecs)).unsigned=!1:typeof A.durationSecs=="string"?r.durationSecs=parseInt(A.durationSecs,10):typeof A.durationSecs=="number"?r.durationSecs=A.durationSecs:typeof A.durationSecs=="object"&&(r.durationSecs=new l.LongBits(A.durationSecs.low>>>0,A.durationSecs.high>>>0).toNumber())),A.callType){default:if(typeof A.callType=="number"){r.callType=A.callType;break}break;case"REGULAR":case 0:r.callType=0;break;case"SCHEDULED_CALL":case 1:r.callType=1;break;case"VOICE_CHAT":case 2:r.callType=2;break}if(A.participants){if(!Array.isArray(A.participants))throw TypeError(".proto.Message.CallLogMessage.participants: array expected");r.participants=[];for(var s=0;s>>3){case 1:{p.jid=s.string();break}case 2:{p.callOutcome=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.CallLogMessage.CallParticipant)return s;var g=new d.proto.Message.CallLogMessage.CallParticipant;switch(s.jid!=null&&(g.jid=String(s.jid)),s.callOutcome){default:if(typeof s.callOutcome=="number"){g.callOutcome=s.callOutcome;break}break;case"CONNECTED":case 0:g.callOutcome=0;break;case"MISSED":case 1:g.callOutcome=1;break;case"FAILED":case 2:g.callOutcome=2;break;case"REJECTED":case 3:g.callOutcome=3;break;case"ACCEPTED_ELSEWHERE":case 4:g.callOutcome=4;break;case"ONGOING":case 5:g.callOutcome=5;break;case"SILENCED_BY_DND":case 6:g.callOutcome=6;break;case"SILENCED_UNKNOWN_CALLER":case 7:g.callOutcome=7;break}return g},i.toObject=function(s,g){g||(g={});var c={};return s.jid!=null&&s.hasOwnProperty("jid")&&(c.jid=s.jid,g.oneofs&&(c._jid="jid")),s.callOutcome!=null&&s.hasOwnProperty("callOutcome")&&(c.callOutcome=g.enums===String?d.proto.Message.CallLogMessage.CallOutcome[s.callOutcome]===void 0?s.callOutcome:d.proto.Message.CallLogMessage.CallOutcome[s.callOutcome]:s.callOutcome,g.oneofs&&(c._callOutcome="callOutcome")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.CallLogMessage.CallParticipant"},i})(),a.CallType=(function(){let i={},A=Object.create(i);return A[i[0]="REGULAR"]=0,A[i[1]="SCHEDULED_CALL"]=1,A[i[2]="VOICE_CHAT"]=2,A})(),a})(),t.CancelPaymentRequestMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.CancelPaymentRequestMessage)return A;var r=new d.proto.Message.CancelPaymentRequestMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.CancelPaymentRequestMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CancelPaymentRequestMessage"},a})(),t.Chat=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayName=A.string();break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.Chat)return A;var r=new d.proto.Message.Chat;return A.displayName!=null&&(r.displayName=String(A.displayName)),A.id!=null&&(r.id=String(A.id)),r},a.toObject=function(A,r){r||(r={});var s={};return A.displayName!=null&&A.hasOwnProperty("displayName")&&(s.displayName=A.displayName,r.oneofs&&(s._displayName="displayName")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.Chat"},a})(),t.CloudAPIThreadControlNotification=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.status=A.int32();break}case 2:{c.senderNotificationTimestampMs=A.int64();break}case 3:{c.consumerLid=A.string();break}case 4:{c.consumerPhoneNumber=A.string();break}case 5:{c.notificationContent=d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.decode(A,A.uint32());break}case 6:{c.shouldSuppressNotification=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.CloudAPIThreadControlNotification)return A;var r=new d.proto.Message.CloudAPIThreadControlNotification;switch(A.status){default:if(typeof A.status=="number"){r.status=A.status;break}break;case"UNKNOWN":case 0:r.status=0;break;case"CONTROL_PASSED":case 1:r.status=1;break;case"CONTROL_TAKEN":case 2:r.status=2;break}if(A.senderNotificationTimestampMs!=null&&(l.Long?(r.senderNotificationTimestampMs=l.Long.fromValue(A.senderNotificationTimestampMs)).unsigned=!1:typeof A.senderNotificationTimestampMs=="string"?r.senderNotificationTimestampMs=parseInt(A.senderNotificationTimestampMs,10):typeof A.senderNotificationTimestampMs=="number"?r.senderNotificationTimestampMs=A.senderNotificationTimestampMs:typeof A.senderNotificationTimestampMs=="object"&&(r.senderNotificationTimestampMs=new l.LongBits(A.senderNotificationTimestampMs.low>>>0,A.senderNotificationTimestampMs.high>>>0).toNumber())),A.consumerLid!=null&&(r.consumerLid=String(A.consumerLid)),A.consumerPhoneNumber!=null&&(r.consumerPhoneNumber=String(A.consumerPhoneNumber)),A.notificationContent!=null){if(typeof A.notificationContent!="object")throw TypeError(".proto.Message.CloudAPIThreadControlNotification.notificationContent: object expected");r.notificationContent=d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.fromObject(A.notificationContent)}return A.shouldSuppressNotification!=null&&(r.shouldSuppressNotification=!!A.shouldSuppressNotification),r},a.toObject=function(A,r){r||(r={});var s={};return A.status!=null&&A.hasOwnProperty("status")&&(s.status=r.enums===String?d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[A.status]===void 0?A.status:d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[A.status]:A.status,r.oneofs&&(s._status="status")),A.senderNotificationTimestampMs!=null&&A.hasOwnProperty("senderNotificationTimestampMs")&&(typeof A.senderNotificationTimestampMs=="number"?s.senderNotificationTimestampMs=r.longs===String?String(A.senderNotificationTimestampMs):A.senderNotificationTimestampMs:s.senderNotificationTimestampMs=r.longs===String?ge(A.senderNotificationTimestampMs):r.longs===Number?ce(A.senderNotificationTimestampMs):A.senderNotificationTimestampMs,r.oneofs&&(s._senderNotificationTimestampMs="senderNotificationTimestampMs")),A.consumerLid!=null&&A.hasOwnProperty("consumerLid")&&(s.consumerLid=A.consumerLid,r.oneofs&&(s._consumerLid="consumerLid")),A.consumerPhoneNumber!=null&&A.hasOwnProperty("consumerPhoneNumber")&&(s.consumerPhoneNumber=A.consumerPhoneNumber,r.oneofs&&(s._consumerPhoneNumber="consumerPhoneNumber")),A.notificationContent!=null&&A.hasOwnProperty("notificationContent")&&(s.notificationContent=d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.toObject(A.notificationContent,r),r.oneofs&&(s._notificationContent="notificationContent")),A.shouldSuppressNotification!=null&&A.hasOwnProperty("shouldSuppressNotification")&&(s.shouldSuppressNotification=A.shouldSuppressNotification,r.oneofs&&(s._shouldSuppressNotification="shouldSuppressNotification")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CloudAPIThreadControlNotification"},a.CloudAPIThreadControl=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="CONTROL_PASSED"]=1,A[i[2]="CONTROL_TAKEN"]=2,A})(),a.CloudAPIThreadControlNotificationContent=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.handoffNotificationText=s.string();break}case 2:{p.extraJson=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent)return s;var g=new d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent;return s.handoffNotificationText!=null&&(g.handoffNotificationText=String(s.handoffNotificationText)),s.extraJson!=null&&(g.extraJson=String(s.extraJson)),g},i.toObject=function(s,g){g||(g={});var c={};return s.handoffNotificationText!=null&&s.hasOwnProperty("handoffNotificationText")&&(c.handoffNotificationText=s.handoffNotificationText,g.oneofs&&(c._handoffNotificationText="handoffNotificationText")),s.extraJson!=null&&s.hasOwnProperty("extraJson")&&(c.extraJson=s.extraJson,g.oneofs&&(c._extraJson="extraJson")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent"},i})(),a})(),t.CommentMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.message=d.proto.Message.decode(A,A.uint32());break}case 2:{c.targetMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.CommentMessage)return A;var r=new d.proto.Message.CommentMessage;if(A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.CommentMessage.message: object expected");r.message=d.proto.Message.fromObject(A.message)}if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.CommentMessage.targetMessageKey: object expected");r.targetMessageKey=d.proto.MessageKey.fromObject(A.targetMessageKey)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.message!=null&&A.hasOwnProperty("message")&&(s.message=d.proto.Message.toObject(A.message,r),r.oneofs&&(s._message="message")),A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=d.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CommentMessage"},a})(),t.ContactMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayName=A.string();break}case 16:{c.vcard=A.string();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ContactMessage)return A;var r=new d.proto.Message.ContactMessage;if(A.displayName!=null&&(r.displayName=String(A.displayName)),A.vcard!=null&&(r.vcard=String(A.vcard)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ContactMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.displayName!=null&&A.hasOwnProperty("displayName")&&(s.displayName=A.displayName,r.oneofs&&(s._displayName="displayName")),A.vcard!=null&&A.hasOwnProperty("vcard")&&(s.vcard=A.vcard,r.oneofs&&(s._vcard="vcard")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ContactMessage"},a})(),t.ContactsArrayMessage=(function(){function a(i){if(this.contacts=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayName=A.string();break}case 2:{c.contacts&&c.contacts.length||(c.contacts=[]),c.contacts.push(d.proto.Message.ContactMessage.decode(A,A.uint32()));break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ContactsArrayMessage)return A;var r=new d.proto.Message.ContactsArrayMessage;if(A.displayName!=null&&(r.displayName=String(A.displayName)),A.contacts){if(!Array.isArray(A.contacts))throw TypeError(".proto.Message.ContactsArrayMessage.contacts: array expected");r.contacts=[];for(var s=0;s>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.DeclinePaymentRequestMessage)return A;var r=new d.proto.Message.DeclinePaymentRequestMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.DeclinePaymentRequestMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DeclinePaymentRequestMessage"},a})(),t.DeviceSentMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.destinationJid=A.string();break}case 2:{c.message=d.proto.Message.decode(A,A.uint32());break}case 3:{c.phash=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.DeviceSentMessage)return A;var r=new d.proto.Message.DeviceSentMessage;if(A.destinationJid!=null&&(r.destinationJid=String(A.destinationJid)),A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.DeviceSentMessage.message: object expected");r.message=d.proto.Message.fromObject(A.message)}return A.phash!=null&&(r.phash=String(A.phash)),r},a.toObject=function(A,r){r||(r={});var s={};return A.destinationJid!=null&&A.hasOwnProperty("destinationJid")&&(s.destinationJid=A.destinationJid,r.oneofs&&(s._destinationJid="destinationJid")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=d.proto.Message.toObject(A.message,r),r.oneofs&&(s._message="message")),A.phash!=null&&A.hasOwnProperty("phash")&&(s.phash=A.phash,r.oneofs&&(s._phash="phash")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DeviceSentMessage"},a})(),t.DocumentMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.title=A.string();break}case 4:{c.fileSha256=A.bytes();break}case 5:{c.fileLength=A.uint64();break}case 6:{c.pageCount=A.uint32();break}case 7:{c.mediaKey=A.bytes();break}case 8:{c.fileName=A.string();break}case 9:{c.fileEncSha256=A.bytes();break}case 10:{c.directPath=A.string();break}case 11:{c.mediaKeyTimestamp=A.int64();break}case 12:{c.contactVcard=A.bool();break}case 13:{c.thumbnailDirectPath=A.string();break}case 14:{c.thumbnailSha256=A.bytes();break}case 15:{c.thumbnailEncSha256=A.bytes();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.thumbnailHeight=A.uint32();break}case 19:{c.thumbnailWidth=A.uint32();break}case 20:{c.caption=A.string();break}case 21:{c.accessibilityLabel=A.string();break}case 22:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.DocumentMessage)return A;var r=new d.proto.Message.DocumentMessage;if(A.url!=null&&(r.url=String(A.url)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.title!=null&&(r.title=String(A.title)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.pageCount!=null&&(r.pageCount=A.pageCount>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileName!=null&&(r.fileName=String(A.fileName)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contactVcard!=null&&(r.contactVcard=!!A.contactVcard),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.DocumentMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.caption!=null&&(r.caption=String(A.caption)),A.accessibilityLabel!=null&&(r.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.pageCount!=null&&A.hasOwnProperty("pageCount")&&(s.pageCount=A.pageCount,r.oneofs&&(s._pageCount="pageCount")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileName!=null&&A.hasOwnProperty("fileName")&&(s.fileName=A.fileName,r.oneofs&&(s._fileName="fileName")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contactVcard!=null&&A.hasOwnProperty("contactVcard")&&(s.contactVcard=A.contactVcard,r.oneofs&&(s._contactVcard="contactVcard")),A.thumbnailDirectPath!=null&&A.hasOwnProperty("thumbnailDirectPath")&&(s.thumbnailDirectPath=A.thumbnailDirectPath,r.oneofs&&(s._thumbnailDirectPath="thumbnailDirectPath")),A.thumbnailSha256!=null&&A.hasOwnProperty("thumbnailSha256")&&(s.thumbnailSha256=r.bytes===String?l.base64.encode(A.thumbnailSha256,0,A.thumbnailSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailSha256):A.thumbnailSha256,r.oneofs&&(s._thumbnailSha256="thumbnailSha256")),A.thumbnailEncSha256!=null&&A.hasOwnProperty("thumbnailEncSha256")&&(s.thumbnailEncSha256=r.bytes===String?l.base64.encode(A.thumbnailEncSha256,0,A.thumbnailEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailEncSha256):A.thumbnailEncSha256,r.oneofs&&(s._thumbnailEncSha256="thumbnailEncSha256")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.thumbnailHeight!=null&&A.hasOwnProperty("thumbnailHeight")&&(s.thumbnailHeight=A.thumbnailHeight,r.oneofs&&(s._thumbnailHeight="thumbnailHeight")),A.thumbnailWidth!=null&&A.hasOwnProperty("thumbnailWidth")&&(s.thumbnailWidth=A.thumbnailWidth,r.oneofs&&(s._thumbnailWidth="thumbnailWidth")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,r.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DocumentMessage"},a})(),t.EncCommentMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.targetMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.EncCommentMessage)return A;var r=new d.proto.Message.EncCommentMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.EncCommentMessage.targetMessageKey: object expected");r.targetMessageKey=d.proto.MessageKey.fromObject(A.targetMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},a.toObject=function(A,r){r||(r={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=d.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncCommentMessage"},a})(),t.EncEventResponseMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.eventCreationMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.EncEventResponseMessage)return A;var r=new d.proto.Message.EncEventResponseMessage;if(A.eventCreationMessageKey!=null){if(typeof A.eventCreationMessageKey!="object")throw TypeError(".proto.Message.EncEventResponseMessage.eventCreationMessageKey: object expected");r.eventCreationMessageKey=d.proto.MessageKey.fromObject(A.eventCreationMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},a.toObject=function(A,r){r||(r={});var s={};return A.eventCreationMessageKey!=null&&A.hasOwnProperty("eventCreationMessageKey")&&(s.eventCreationMessageKey=d.proto.MessageKey.toObject(A.eventCreationMessageKey,r),r.oneofs&&(s._eventCreationMessageKey="eventCreationMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncEventResponseMessage"},a})(),t.EncReactionMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.targetMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.EncReactionMessage)return A;var r=new d.proto.Message.EncReactionMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.EncReactionMessage.targetMessageKey: object expected");r.targetMessageKey=d.proto.MessageKey.fromObject(A.targetMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},a.toObject=function(A,r){r||(r={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=d.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncReactionMessage"},a})(),t.EventMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.isCanceled=A.bool();break}case 3:{c.name=A.string();break}case 4:{c.description=A.string();break}case 5:{c.location=d.proto.Message.LocationMessage.decode(A,A.uint32());break}case 6:{c.joinLink=A.string();break}case 7:{c.startTime=A.int64();break}case 8:{c.endTime=A.int64();break}case 9:{c.extraGuestsAllowed=A.bool();break}case 10:{c.isScheduleCall=A.bool();break}case 11:{c.hasReminder=A.bool();break}case 12:{c.reminderOffsetSec=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.EventMessage)return A;var r=new d.proto.Message.EventMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.EventMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.isCanceled!=null&&(r.isCanceled=!!A.isCanceled),A.name!=null&&(r.name=String(A.name)),A.description!=null&&(r.description=String(A.description)),A.location!=null){if(typeof A.location!="object")throw TypeError(".proto.Message.EventMessage.location: object expected");r.location=d.proto.Message.LocationMessage.fromObject(A.location)}return A.joinLink!=null&&(r.joinLink=String(A.joinLink)),A.startTime!=null&&(l.Long?(r.startTime=l.Long.fromValue(A.startTime)).unsigned=!1:typeof A.startTime=="string"?r.startTime=parseInt(A.startTime,10):typeof A.startTime=="number"?r.startTime=A.startTime:typeof A.startTime=="object"&&(r.startTime=new l.LongBits(A.startTime.low>>>0,A.startTime.high>>>0).toNumber())),A.endTime!=null&&(l.Long?(r.endTime=l.Long.fromValue(A.endTime)).unsigned=!1:typeof A.endTime=="string"?r.endTime=parseInt(A.endTime,10):typeof A.endTime=="number"?r.endTime=A.endTime:typeof A.endTime=="object"&&(r.endTime=new l.LongBits(A.endTime.low>>>0,A.endTime.high>>>0).toNumber())),A.extraGuestsAllowed!=null&&(r.extraGuestsAllowed=!!A.extraGuestsAllowed),A.isScheduleCall!=null&&(r.isScheduleCall=!!A.isScheduleCall),A.hasReminder!=null&&(r.hasReminder=!!A.hasReminder),A.reminderOffsetSec!=null&&(l.Long?(r.reminderOffsetSec=l.Long.fromValue(A.reminderOffsetSec)).unsigned=!1:typeof A.reminderOffsetSec=="string"?r.reminderOffsetSec=parseInt(A.reminderOffsetSec,10):typeof A.reminderOffsetSec=="number"?r.reminderOffsetSec=A.reminderOffsetSec:typeof A.reminderOffsetSec=="object"&&(r.reminderOffsetSec=new l.LongBits(A.reminderOffsetSec.low>>>0,A.reminderOffsetSec.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.isCanceled!=null&&A.hasOwnProperty("isCanceled")&&(s.isCanceled=A.isCanceled,r.oneofs&&(s._isCanceled="isCanceled")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.description!=null&&A.hasOwnProperty("description")&&(s.description=A.description,r.oneofs&&(s._description="description")),A.location!=null&&A.hasOwnProperty("location")&&(s.location=d.proto.Message.LocationMessage.toObject(A.location,r),r.oneofs&&(s._location="location")),A.joinLink!=null&&A.hasOwnProperty("joinLink")&&(s.joinLink=A.joinLink,r.oneofs&&(s._joinLink="joinLink")),A.startTime!=null&&A.hasOwnProperty("startTime")&&(typeof A.startTime=="number"?s.startTime=r.longs===String?String(A.startTime):A.startTime:s.startTime=r.longs===String?ge(A.startTime):r.longs===Number?ce(A.startTime):A.startTime,r.oneofs&&(s._startTime="startTime")),A.endTime!=null&&A.hasOwnProperty("endTime")&&(typeof A.endTime=="number"?s.endTime=r.longs===String?String(A.endTime):A.endTime:s.endTime=r.longs===String?ge(A.endTime):r.longs===Number?ce(A.endTime):A.endTime,r.oneofs&&(s._endTime="endTime")),A.extraGuestsAllowed!=null&&A.hasOwnProperty("extraGuestsAllowed")&&(s.extraGuestsAllowed=A.extraGuestsAllowed,r.oneofs&&(s._extraGuestsAllowed="extraGuestsAllowed")),A.isScheduleCall!=null&&A.hasOwnProperty("isScheduleCall")&&(s.isScheduleCall=A.isScheduleCall,r.oneofs&&(s._isScheduleCall="isScheduleCall")),A.hasReminder!=null&&A.hasOwnProperty("hasReminder")&&(s.hasReminder=A.hasReminder,r.oneofs&&(s._hasReminder="hasReminder")),A.reminderOffsetSec!=null&&A.hasOwnProperty("reminderOffsetSec")&&(typeof A.reminderOffsetSec=="number"?s.reminderOffsetSec=r.longs===String?String(A.reminderOffsetSec):A.reminderOffsetSec:s.reminderOffsetSec=r.longs===String?ge(A.reminderOffsetSec):r.longs===Number?ce(A.reminderOffsetSec):A.reminderOffsetSec,r.oneofs&&(s._reminderOffsetSec="reminderOffsetSec")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EventMessage"},a})(),t.EventResponseMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.response=A.int32();break}case 2:{c.timestampMs=A.int64();break}case 3:{c.extraGuestCount=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.EventResponseMessage)return A;var r=new d.proto.Message.EventResponseMessage;switch(A.response){default:if(typeof A.response=="number"){r.response=A.response;break}break;case"UNKNOWN":case 0:r.response=0;break;case"GOING":case 1:r.response=1;break;case"NOT_GOING":case 2:r.response=2;break;case"MAYBE":case 3:r.response=3;break}return A.timestampMs!=null&&(l.Long?(r.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?r.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?r.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(r.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),A.extraGuestCount!=null&&(r.extraGuestCount=A.extraGuestCount|0),r},a.toObject=function(A,r){r||(r={});var s={};return A.response!=null&&A.hasOwnProperty("response")&&(s.response=r.enums===String?d.proto.Message.EventResponseMessage.EventResponseType[A.response]===void 0?A.response:d.proto.Message.EventResponseMessage.EventResponseType[A.response]:A.response,r.oneofs&&(s._response="response")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=r.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=r.longs===String?ge(A.timestampMs):r.longs===Number?ce(A.timestampMs):A.timestampMs,r.oneofs&&(s._timestampMs="timestampMs")),A.extraGuestCount!=null&&A.hasOwnProperty("extraGuestCount")&&(s.extraGuestCount=A.extraGuestCount,r.oneofs&&(s._extraGuestCount="extraGuestCount")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EventResponseMessage"},a.EventResponseType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="GOING"]=1,A[i[2]="NOT_GOING"]=2,A[i[3]="MAYBE"]=3,A})(),a})(),t.ExtendedTextMessage=(function(){function a(i){if(this.endCardTiles=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.text=A.string();break}case 2:{c.matchedText=A.string();break}case 5:{c.description=A.string();break}case 6:{c.title=A.string();break}case 7:{c.textArgb=A.fixed32();break}case 8:{c.backgroundArgb=A.fixed32();break}case 9:{c.font=A.int32();break}case 10:{c.previewType=A.int32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.doNotPlayInline=A.bool();break}case 19:{c.thumbnailDirectPath=A.string();break}case 20:{c.thumbnailSha256=A.bytes();break}case 21:{c.thumbnailEncSha256=A.bytes();break}case 22:{c.mediaKey=A.bytes();break}case 23:{c.mediaKeyTimestamp=A.int64();break}case 24:{c.thumbnailHeight=A.uint32();break}case 25:{c.thumbnailWidth=A.uint32();break}case 26:{c.inviteLinkGroupType=A.int32();break}case 27:{c.inviteLinkParentGroupSubjectV2=A.string();break}case 28:{c.inviteLinkParentGroupThumbnailV2=A.bytes();break}case 29:{c.inviteLinkGroupTypeV2=A.int32();break}case 30:{c.viewOnce=A.bool();break}case 31:{c.videoHeight=A.uint32();break}case 32:{c.videoWidth=A.uint32();break}case 33:{c.faviconMMSMetadata=d.proto.Message.MMSThumbnailMetadata.decode(A,A.uint32());break}case 34:{c.linkPreviewMetadata=d.proto.Message.LinkPreviewMetadata.decode(A,A.uint32());break}case 35:{c.paymentLinkMetadata=d.proto.Message.PaymentLinkMetadata.decode(A,A.uint32());break}case 36:{c.endCardTiles&&c.endCardTiles.length||(c.endCardTiles=[]),c.endCardTiles.push(d.proto.Message.VideoEndCard.decode(A,A.uint32()));break}case 37:{c.videoContentUrl=A.string();break}case 38:{c.musicMetadata=d.proto.EmbeddedMusic.decode(A,A.uint32());break}case 39:{c.paymentExtendedMetadata=d.proto.Message.PaymentExtendedMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ExtendedTextMessage)return A;var r=new d.proto.Message.ExtendedTextMessage;switch(A.text!=null&&(r.text=String(A.text)),A.matchedText!=null&&(r.matchedText=String(A.matchedText)),A.description!=null&&(r.description=String(A.description)),A.title!=null&&(r.title=String(A.title)),A.textArgb!=null&&(r.textArgb=A.textArgb>>>0),A.backgroundArgb!=null&&(r.backgroundArgb=A.backgroundArgb>>>0),A.font){default:if(typeof A.font=="number"){r.font=A.font;break}break;case"SYSTEM":case 0:r.font=0;break;case"SYSTEM_TEXT":case 1:r.font=1;break;case"FB_SCRIPT":case 2:r.font=2;break;case"SYSTEM_BOLD":case 6:r.font=6;break;case"MORNINGBREEZE_REGULAR":case 7:r.font=7;break;case"CALISTOGA_REGULAR":case 8:r.font=8;break;case"EXO2_EXTRABOLD":case 9:r.font=9;break;case"COURIERPRIME_BOLD":case 10:r.font=10;break}switch(A.previewType){default:if(typeof A.previewType=="number"){r.previewType=A.previewType;break}break;case"NONE":case 0:r.previewType=0;break;case"VIDEO":case 1:r.previewType=1;break;case"PLACEHOLDER":case 4:r.previewType=4;break;case"IMAGE":case 5:r.previewType=5;break;case"PAYMENT_LINKS":case 6:r.previewType=6;break;case"PROFILE":case 7:r.previewType=7;break}if(A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ExtendedTextMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.doNotPlayInline!=null&&(r.doNotPlayInline=!!A.doNotPlayInline),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.inviteLinkGroupType){default:if(typeof A.inviteLinkGroupType=="number"){r.inviteLinkGroupType=A.inviteLinkGroupType;break}break;case"DEFAULT":case 0:r.inviteLinkGroupType=0;break;case"PARENT":case 1:r.inviteLinkGroupType=1;break;case"SUB":case 2:r.inviteLinkGroupType=2;break;case"DEFAULT_SUB":case 3:r.inviteLinkGroupType=3;break}switch(A.inviteLinkParentGroupSubjectV2!=null&&(r.inviteLinkParentGroupSubjectV2=String(A.inviteLinkParentGroupSubjectV2)),A.inviteLinkParentGroupThumbnailV2!=null&&(typeof A.inviteLinkParentGroupThumbnailV2=="string"?l.base64.decode(A.inviteLinkParentGroupThumbnailV2,r.inviteLinkParentGroupThumbnailV2=l.newBuffer(l.base64.length(A.inviteLinkParentGroupThumbnailV2)),0):A.inviteLinkParentGroupThumbnailV2.length>=0&&(r.inviteLinkParentGroupThumbnailV2=A.inviteLinkParentGroupThumbnailV2)),A.inviteLinkGroupTypeV2){default:if(typeof A.inviteLinkGroupTypeV2=="number"){r.inviteLinkGroupTypeV2=A.inviteLinkGroupTypeV2;break}break;case"DEFAULT":case 0:r.inviteLinkGroupTypeV2=0;break;case"PARENT":case 1:r.inviteLinkGroupTypeV2=1;break;case"SUB":case 2:r.inviteLinkGroupTypeV2=2;break;case"DEFAULT_SUB":case 3:r.inviteLinkGroupTypeV2=3;break}if(A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.videoHeight!=null&&(r.videoHeight=A.videoHeight>>>0),A.videoWidth!=null&&(r.videoWidth=A.videoWidth>>>0),A.faviconMMSMetadata!=null){if(typeof A.faviconMMSMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.faviconMMSMetadata: object expected");r.faviconMMSMetadata=d.proto.Message.MMSThumbnailMetadata.fromObject(A.faviconMMSMetadata)}if(A.linkPreviewMetadata!=null){if(typeof A.linkPreviewMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.linkPreviewMetadata: object expected");r.linkPreviewMetadata=d.proto.Message.LinkPreviewMetadata.fromObject(A.linkPreviewMetadata)}if(A.paymentLinkMetadata!=null){if(typeof A.paymentLinkMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.paymentLinkMetadata: object expected");r.paymentLinkMetadata=d.proto.Message.PaymentLinkMetadata.fromObject(A.paymentLinkMetadata)}if(A.endCardTiles){if(!Array.isArray(A.endCardTiles))throw TypeError(".proto.Message.ExtendedTextMessage.endCardTiles: array expected");r.endCardTiles=[];for(var s=0;s>>3){case 1:{c.requestId=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.FullHistorySyncOnDemandRequestMetadata)return A;var r=new d.proto.Message.FullHistorySyncOnDemandRequestMetadata;return A.requestId!=null&&(r.requestId=String(A.requestId)),r},a.toObject=function(A,r){r||(r={});var s={};return A.requestId!=null&&A.hasOwnProperty("requestId")&&(s.requestId=A.requestId,r.oneofs&&(s._requestId="requestId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.FullHistorySyncOnDemandRequestMetadata"},a})(),t.FutureProofMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.message=d.proto.Message.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.FutureProofMessage)return A;var r=new d.proto.Message.FutureProofMessage;if(A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.FutureProofMessage.message: object expected");r.message=d.proto.Message.fromObject(A.message)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.message!=null&&A.hasOwnProperty("message")&&(s.message=d.proto.Message.toObject(A.message,r),r.oneofs&&(s._message="message")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.FutureProofMessage"},a})(),t.GroupInviteMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.groupJid=A.string();break}case 2:{c.inviteCode=A.string();break}case 3:{c.inviteExpiration=A.int64();break}case 4:{c.groupName=A.string();break}case 5:{c.jpegThumbnail=A.bytes();break}case 6:{c.caption=A.string();break}case 7:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.groupType=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.GroupInviteMessage)return A;var r=new d.proto.Message.GroupInviteMessage;if(A.groupJid!=null&&(r.groupJid=String(A.groupJid)),A.inviteCode!=null&&(r.inviteCode=String(A.inviteCode)),A.inviteExpiration!=null&&(l.Long?(r.inviteExpiration=l.Long.fromValue(A.inviteExpiration)).unsigned=!1:typeof A.inviteExpiration=="string"?r.inviteExpiration=parseInt(A.inviteExpiration,10):typeof A.inviteExpiration=="number"?r.inviteExpiration=A.inviteExpiration:typeof A.inviteExpiration=="object"&&(r.inviteExpiration=new l.LongBits(A.inviteExpiration.low>>>0,A.inviteExpiration.high>>>0).toNumber())),A.groupName!=null&&(r.groupName=String(A.groupName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.GroupInviteMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.groupType){default:if(typeof A.groupType=="number"){r.groupType=A.groupType;break}break;case"DEFAULT":case 0:r.groupType=0;break;case"PARENT":case 1:r.groupType=1;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.groupJid!=null&&A.hasOwnProperty("groupJid")&&(s.groupJid=A.groupJid,r.oneofs&&(s._groupJid="groupJid")),A.inviteCode!=null&&A.hasOwnProperty("inviteCode")&&(s.inviteCode=A.inviteCode,r.oneofs&&(s._inviteCode="inviteCode")),A.inviteExpiration!=null&&A.hasOwnProperty("inviteExpiration")&&(typeof A.inviteExpiration=="number"?s.inviteExpiration=r.longs===String?String(A.inviteExpiration):A.inviteExpiration:s.inviteExpiration=r.longs===String?ge(A.inviteExpiration):r.longs===Number?ce(A.inviteExpiration):A.inviteExpiration,r.oneofs&&(s._inviteExpiration="inviteExpiration")),A.groupName!=null&&A.hasOwnProperty("groupName")&&(s.groupName=A.groupName,r.oneofs&&(s._groupName="groupName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.groupType!=null&&A.hasOwnProperty("groupType")&&(s.groupType=r.enums===String?d.proto.Message.GroupInviteMessage.GroupType[A.groupType]===void 0?A.groupType:d.proto.Message.GroupInviteMessage.GroupType[A.groupType]:A.groupType,r.oneofs&&(s._groupType="groupType")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.GroupInviteMessage"},a.GroupType=(function(){let i={},A=Object.create(i);return A[i[0]="DEFAULT"]=0,A[i[1]="PARENT"]=1,A})(),a})(),t.HighlyStructuredMessage=(function(){function a(i){if(this.params=[],this.localizableParams=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.namespace=A.string();break}case 2:{c.elementName=A.string();break}case 3:{c.params&&c.params.length||(c.params=[]),c.params.push(A.string());break}case 4:{c.fallbackLg=A.string();break}case 5:{c.fallbackLc=A.string();break}case 6:{c.localizableParams&&c.localizableParams.length||(c.localizableParams=[]),c.localizableParams.push(d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.decode(A,A.uint32()));break}case 7:{c.deterministicLg=A.string();break}case 8:{c.deterministicLc=A.string();break}case 9:{c.hydratedHsm=d.proto.Message.TemplateMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.HighlyStructuredMessage)return A;var r=new d.proto.Message.HighlyStructuredMessage;if(A.namespace!=null&&(r.namespace=String(A.namespace)),A.elementName!=null&&(r.elementName=String(A.elementName)),A.params){if(!Array.isArray(A.params))throw TypeError(".proto.Message.HighlyStructuredMessage.params: array expected");r.params=[];for(var s=0;s>>3){case 1:{p.default=s.string();break}case 2:{p.currency=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.decode(s,s.uint32());break}case 3:{p.dateTime=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter)return s;var g=new d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter;if(s.default!=null&&(g.default=String(s.default)),s.currency!=null){if(typeof s.currency!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.currency: object expected");g.currency=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.fromObject(s.currency)}if(s.dateTime!=null){if(typeof s.dateTime!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.dateTime: object expected");g.dateTime=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.fromObject(s.dateTime)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.default!=null&&s.hasOwnProperty("default")&&(c.default=s.default,g.oneofs&&(c._default="default")),s.currency!=null&&s.hasOwnProperty("currency")&&(c.currency=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.toObject(s.currency,g),g.oneofs&&(c.paramOneof="currency")),s.dateTime!=null&&s.hasOwnProperty("dateTime")&&(c.dateTime=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.toObject(s.dateTime,g),g.oneofs&&(c.paramOneof="dateTime")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter"},i.HSMCurrency=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.currencyCode=c.string();break}case 2:{f.amount1000=c.int64();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency)return c;var I=new d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency;return c.currencyCode!=null&&(I.currencyCode=String(c.currencyCode)),c.amount1000!=null&&(l.Long?(I.amount1000=l.Long.fromValue(c.amount1000)).unsigned=!1:typeof c.amount1000=="string"?I.amount1000=parseInt(c.amount1000,10):typeof c.amount1000=="number"?I.amount1000=c.amount1000:typeof c.amount1000=="object"&&(I.amount1000=new l.LongBits(c.amount1000.low>>>0,c.amount1000.high>>>0).toNumber())),I},r.toObject=function(c,I){I||(I={});var p={};return c.currencyCode!=null&&c.hasOwnProperty("currencyCode")&&(p.currencyCode=c.currencyCode,I.oneofs&&(p._currencyCode="currencyCode")),c.amount1000!=null&&c.hasOwnProperty("amount1000")&&(typeof c.amount1000=="number"?p.amount1000=I.longs===String?String(c.amount1000):c.amount1000:p.amount1000=I.longs===String?ge(c.amount1000):I.longs===Number?ce(c.amount1000):c.amount1000,I.oneofs&&(p._amount1000="amount1000")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency"},r})(),i.HSMDateTime=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.component=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.decode(c,c.uint32());break}case 2:{f.unixEpoch=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.decode(c,c.uint32());break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime)return c;var I=new d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime;if(c.component!=null){if(typeof c.component!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.component: object expected");I.component=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.fromObject(c.component)}if(c.unixEpoch!=null){if(typeof c.unixEpoch!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.unixEpoch: object expected");I.unixEpoch=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.fromObject(c.unixEpoch)}return I},r.toObject=function(c,I){I||(I={});var p={};return c.component!=null&&c.hasOwnProperty("component")&&(p.component=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.toObject(c.component,I),I.oneofs&&(p.datetimeOneof="component")),c.unixEpoch!=null&&c.hasOwnProperty("unixEpoch")&&(p.unixEpoch=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.toObject(c.unixEpoch,I),I.oneofs&&(p.datetimeOneof="unixEpoch")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime"},r.HSMDateTimeComponent=(function(){function g(I){if(I)for(var p=Object.keys(I),B=0;B>>3){case 1:{y.dayOfWeek=p.int32();break}case 2:{y.year=p.uint32();break}case 3:{y.month=p.uint32();break}case 4:{y.dayOfMonth=p.uint32();break}case 5:{y.hour=p.uint32();break}case 6:{y.minute=p.uint32();break}case 7:{y.calendar=p.int32();break}default:p.skipType(m&7);break}}return y},g.fromObject=function(p){if(p instanceof d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent)return p;var B=new d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent;switch(p.dayOfWeek){default:if(typeof p.dayOfWeek=="number"){B.dayOfWeek=p.dayOfWeek;break}break;case"MONDAY":case 1:B.dayOfWeek=1;break;case"TUESDAY":case 2:B.dayOfWeek=2;break;case"WEDNESDAY":case 3:B.dayOfWeek=3;break;case"THURSDAY":case 4:B.dayOfWeek=4;break;case"FRIDAY":case 5:B.dayOfWeek=5;break;case"SATURDAY":case 6:B.dayOfWeek=6;break;case"SUNDAY":case 7:B.dayOfWeek=7;break}switch(p.year!=null&&(B.year=p.year>>>0),p.month!=null&&(B.month=p.month>>>0),p.dayOfMonth!=null&&(B.dayOfMonth=p.dayOfMonth>>>0),p.hour!=null&&(B.hour=p.hour>>>0),p.minute!=null&&(B.minute=p.minute>>>0),p.calendar){default:if(typeof p.calendar=="number"){B.calendar=p.calendar;break}break;case"GREGORIAN":case 1:B.calendar=1;break;case"SOLAR_HIJRI":case 2:B.calendar=2;break}return B},g.toObject=function(p,B){B||(B={});var f={};return p.dayOfWeek!=null&&p.hasOwnProperty("dayOfWeek")&&(f.dayOfWeek=B.enums===String?d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[p.dayOfWeek]===void 0?p.dayOfWeek:d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[p.dayOfWeek]:p.dayOfWeek,B.oneofs&&(f._dayOfWeek="dayOfWeek")),p.year!=null&&p.hasOwnProperty("year")&&(f.year=p.year,B.oneofs&&(f._year="year")),p.month!=null&&p.hasOwnProperty("month")&&(f.month=p.month,B.oneofs&&(f._month="month")),p.dayOfMonth!=null&&p.hasOwnProperty("dayOfMonth")&&(f.dayOfMonth=p.dayOfMonth,B.oneofs&&(f._dayOfMonth="dayOfMonth")),p.hour!=null&&p.hasOwnProperty("hour")&&(f.hour=p.hour,B.oneofs&&(f._hour="hour")),p.minute!=null&&p.hasOwnProperty("minute")&&(f.minute=p.minute,B.oneofs&&(f._minute="minute")),p.calendar!=null&&p.hasOwnProperty("calendar")&&(f.calendar=B.enums===String?d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[p.calendar]===void 0?p.calendar:d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[p.calendar]:p.calendar,B.oneofs&&(f._calendar="calendar")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(p){return p===void 0&&(p="type.googleapis.com"),p+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent"},g.CalendarType=(function(){let I={},p=Object.create(I);return p[I[1]="GREGORIAN"]=1,p[I[2]="SOLAR_HIJRI"]=2,p})(),g.DayOfWeekType=(function(){let I={},p=Object.create(I);return p[I[1]="MONDAY"]=1,p[I[2]="TUESDAY"]=2,p[I[3]="WEDNESDAY"]=3,p[I[4]="THURSDAY"]=4,p[I[5]="FRIDAY"]=5,p[I[6]="SATURDAY"]=6,p[I[7]="SUNDAY"]=7,p})(),g})(),r.HSMDateTimeUnixEpoch=(function(){function g(I){if(I)for(var p=Object.keys(I),B=0;B>>3){case 1:{y.timestamp=p.int64();break}default:p.skipType(m&7);break}}return y},g.fromObject=function(p){if(p instanceof d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch)return p;var B=new d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch;return p.timestamp!=null&&(l.Long?(B.timestamp=l.Long.fromValue(p.timestamp)).unsigned=!1:typeof p.timestamp=="string"?B.timestamp=parseInt(p.timestamp,10):typeof p.timestamp=="number"?B.timestamp=p.timestamp:typeof p.timestamp=="object"&&(B.timestamp=new l.LongBits(p.timestamp.low>>>0,p.timestamp.high>>>0).toNumber())),B},g.toObject=function(p,B){B||(B={});var f={};return p.timestamp!=null&&p.hasOwnProperty("timestamp")&&(typeof p.timestamp=="number"?f.timestamp=B.longs===String?String(p.timestamp):p.timestamp:f.timestamp=B.longs===String?ge(p.timestamp):B.longs===Number?ce(p.timestamp):p.timestamp,B.oneofs&&(f._timestamp="timestamp")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(p){return p===void 0&&(p="type.googleapis.com"),p+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch"},g})(),r})(),i})(),a})(),t.HistorySyncMessageAccessStatus=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.completeAccessGranted=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.HistorySyncMessageAccessStatus)return A;var r=new d.proto.Message.HistorySyncMessageAccessStatus;return A.completeAccessGranted!=null&&(r.completeAccessGranted=!!A.completeAccessGranted),r},a.toObject=function(A,r){r||(r={});var s={};return A.completeAccessGranted!=null&&A.hasOwnProperty("completeAccessGranted")&&(s.completeAccessGranted=A.completeAccessGranted,r.oneofs&&(s._completeAccessGranted="completeAccessGranted")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.HistorySyncMessageAccessStatus"},a})(),t.HistorySyncNotification=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.fileSha256=A.bytes();break}case 2:{c.fileLength=A.uint64();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}case 6:{c.syncType=A.int32();break}case 7:{c.chunkOrder=A.uint32();break}case 8:{c.originalMessageId=A.string();break}case 9:{c.progress=A.uint32();break}case 10:{c.oldestMsgInChunkTimestampSec=A.int64();break}case 11:{c.initialHistBootstrapInlinePayload=A.bytes();break}case 12:{c.peerDataRequestSessionId=A.string();break}case 13:{c.fullHistorySyncOnDemandRequestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(A,A.uint32());break}case 14:{c.encHandle=A.string();break}case 15:{c.messageAccessStatus=d.proto.Message.HistorySyncMessageAccessStatus.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.HistorySyncNotification)return A;var r=new d.proto.Message.HistorySyncNotification;switch(A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.syncType){default:if(typeof A.syncType=="number"){r.syncType=A.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:r.syncType=0;break;case"INITIAL_STATUS_V3":case 1:r.syncType=1;break;case"FULL":case 2:r.syncType=2;break;case"RECENT":case 3:r.syncType=3;break;case"PUSH_NAME":case 4:r.syncType=4;break;case"NON_BLOCKING_DATA":case 5:r.syncType=5;break;case"ON_DEMAND":case 6:r.syncType=6;break;case"NO_HISTORY":case 7:r.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:r.syncType=8;break}if(A.chunkOrder!=null&&(r.chunkOrder=A.chunkOrder>>>0),A.originalMessageId!=null&&(r.originalMessageId=String(A.originalMessageId)),A.progress!=null&&(r.progress=A.progress>>>0),A.oldestMsgInChunkTimestampSec!=null&&(l.Long?(r.oldestMsgInChunkTimestampSec=l.Long.fromValue(A.oldestMsgInChunkTimestampSec)).unsigned=!1:typeof A.oldestMsgInChunkTimestampSec=="string"?r.oldestMsgInChunkTimestampSec=parseInt(A.oldestMsgInChunkTimestampSec,10):typeof A.oldestMsgInChunkTimestampSec=="number"?r.oldestMsgInChunkTimestampSec=A.oldestMsgInChunkTimestampSec:typeof A.oldestMsgInChunkTimestampSec=="object"&&(r.oldestMsgInChunkTimestampSec=new l.LongBits(A.oldestMsgInChunkTimestampSec.low>>>0,A.oldestMsgInChunkTimestampSec.high>>>0).toNumber())),A.initialHistBootstrapInlinePayload!=null&&(typeof A.initialHistBootstrapInlinePayload=="string"?l.base64.decode(A.initialHistBootstrapInlinePayload,r.initialHistBootstrapInlinePayload=l.newBuffer(l.base64.length(A.initialHistBootstrapInlinePayload)),0):A.initialHistBootstrapInlinePayload.length>=0&&(r.initialHistBootstrapInlinePayload=A.initialHistBootstrapInlinePayload)),A.peerDataRequestSessionId!=null&&(r.peerDataRequestSessionId=String(A.peerDataRequestSessionId)),A.fullHistorySyncOnDemandRequestMetadata!=null){if(typeof A.fullHistorySyncOnDemandRequestMetadata!="object")throw TypeError(".proto.Message.HistorySyncNotification.fullHistorySyncOnDemandRequestMetadata: object expected");r.fullHistorySyncOnDemandRequestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(A.fullHistorySyncOnDemandRequestMetadata)}if(A.encHandle!=null&&(r.encHandle=String(A.encHandle)),A.messageAccessStatus!=null){if(typeof A.messageAccessStatus!="object")throw TypeError(".proto.Message.HistorySyncNotification.messageAccessStatus: object expected");r.messageAccessStatus=d.proto.Message.HistorySyncMessageAccessStatus.fromObject(A.messageAccessStatus)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.syncType!=null&&A.hasOwnProperty("syncType")&&(s.syncType=r.enums===String?d.proto.Message.HistorySyncType[A.syncType]===void 0?A.syncType:d.proto.Message.HistorySyncType[A.syncType]:A.syncType,r.oneofs&&(s._syncType="syncType")),A.chunkOrder!=null&&A.hasOwnProperty("chunkOrder")&&(s.chunkOrder=A.chunkOrder,r.oneofs&&(s._chunkOrder="chunkOrder")),A.originalMessageId!=null&&A.hasOwnProperty("originalMessageId")&&(s.originalMessageId=A.originalMessageId,r.oneofs&&(s._originalMessageId="originalMessageId")),A.progress!=null&&A.hasOwnProperty("progress")&&(s.progress=A.progress,r.oneofs&&(s._progress="progress")),A.oldestMsgInChunkTimestampSec!=null&&A.hasOwnProperty("oldestMsgInChunkTimestampSec")&&(typeof A.oldestMsgInChunkTimestampSec=="number"?s.oldestMsgInChunkTimestampSec=r.longs===String?String(A.oldestMsgInChunkTimestampSec):A.oldestMsgInChunkTimestampSec:s.oldestMsgInChunkTimestampSec=r.longs===String?ge(A.oldestMsgInChunkTimestampSec):r.longs===Number?ce(A.oldestMsgInChunkTimestampSec):A.oldestMsgInChunkTimestampSec,r.oneofs&&(s._oldestMsgInChunkTimestampSec="oldestMsgInChunkTimestampSec")),A.initialHistBootstrapInlinePayload!=null&&A.hasOwnProperty("initialHistBootstrapInlinePayload")&&(s.initialHistBootstrapInlinePayload=r.bytes===String?l.base64.encode(A.initialHistBootstrapInlinePayload,0,A.initialHistBootstrapInlinePayload.length):r.bytes===Array?Array.prototype.slice.call(A.initialHistBootstrapInlinePayload):A.initialHistBootstrapInlinePayload,r.oneofs&&(s._initialHistBootstrapInlinePayload="initialHistBootstrapInlinePayload")),A.peerDataRequestSessionId!=null&&A.hasOwnProperty("peerDataRequestSessionId")&&(s.peerDataRequestSessionId=A.peerDataRequestSessionId,r.oneofs&&(s._peerDataRequestSessionId="peerDataRequestSessionId")),A.fullHistorySyncOnDemandRequestMetadata!=null&&A.hasOwnProperty("fullHistorySyncOnDemandRequestMetadata")&&(s.fullHistorySyncOnDemandRequestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(A.fullHistorySyncOnDemandRequestMetadata,r),r.oneofs&&(s._fullHistorySyncOnDemandRequestMetadata="fullHistorySyncOnDemandRequestMetadata")),A.encHandle!=null&&A.hasOwnProperty("encHandle")&&(s.encHandle=A.encHandle,r.oneofs&&(s._encHandle="encHandle")),A.messageAccessStatus!=null&&A.hasOwnProperty("messageAccessStatus")&&(s.messageAccessStatus=d.proto.Message.HistorySyncMessageAccessStatus.toObject(A.messageAccessStatus,r),r.oneofs&&(s._messageAccessStatus="messageAccessStatus")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.HistorySyncNotification"},a})(),t.HistorySyncType=(function(){let a={},e=Object.create(a);return e[a[0]="INITIAL_BOOTSTRAP"]=0,e[a[1]="INITIAL_STATUS_V3"]=1,e[a[2]="FULL"]=2,e[a[3]="RECENT"]=3,e[a[4]="PUSH_NAME"]=4,e[a[5]="NON_BLOCKING_DATA"]=5,e[a[6]="ON_DEMAND"]=6,e[a[7]="NO_HISTORY"]=7,e[a[8]="MESSAGE_ACCESS_STATUS"]=8,e})(),t.ImageMessage=(function(){function a(i){if(this.interactiveAnnotations=[],this.scanLengths=[],this.annotations=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.caption=A.string();break}case 4:{c.fileSha256=A.bytes();break}case 5:{c.fileLength=A.uint64();break}case 6:{c.height=A.uint32();break}case 7:{c.width=A.uint32();break}case 8:{c.mediaKey=A.bytes();break}case 9:{c.fileEncSha256=A.bytes();break}case 10:{c.interactiveAnnotations&&c.interactiveAnnotations.length||(c.interactiveAnnotations=[]),c.interactiveAnnotations.push(d.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 11:{c.directPath=A.string();break}case 12:{c.mediaKeyTimestamp=A.int64();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.firstScanSidecar=A.bytes();break}case 19:{c.firstScanLength=A.uint32();break}case 20:{c.experimentGroupId=A.uint32();break}case 21:{c.scansSidecar=A.bytes();break}case 22:{if(c.scanLengths&&c.scanLengths.length||(c.scanLengths=[]),(I&7)===2)for(var p=A.uint32()+A.pos;A.pos=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.interactiveAnnotations){if(!Array.isArray(A.interactiveAnnotations))throw TypeError(".proto.Message.ImageMessage.interactiveAnnotations: array expected");r.interactiveAnnotations=[];for(var s=0;s>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ImageMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.firstScanSidecar!=null&&(typeof A.firstScanSidecar=="string"?l.base64.decode(A.firstScanSidecar,r.firstScanSidecar=l.newBuffer(l.base64.length(A.firstScanSidecar)),0):A.firstScanSidecar.length>=0&&(r.firstScanSidecar=A.firstScanSidecar)),A.firstScanLength!=null&&(r.firstScanLength=A.firstScanLength>>>0),A.experimentGroupId!=null&&(r.experimentGroupId=A.experimentGroupId>>>0),A.scansSidecar!=null&&(typeof A.scansSidecar=="string"?l.base64.decode(A.scansSidecar,r.scansSidecar=l.newBuffer(l.base64.length(A.scansSidecar)),0):A.scansSidecar.length>=0&&(r.scansSidecar=A.scansSidecar)),A.scanLengths){if(!Array.isArray(A.scanLengths))throw TypeError(".proto.Message.ImageMessage.scanLengths: array expected");r.scanLengths=[];for(var s=0;s>>0}if(A.midQualityFileSha256!=null&&(typeof A.midQualityFileSha256=="string"?l.base64.decode(A.midQualityFileSha256,r.midQualityFileSha256=l.newBuffer(l.base64.length(A.midQualityFileSha256)),0):A.midQualityFileSha256.length>=0&&(r.midQualityFileSha256=A.midQualityFileSha256)),A.midQualityFileEncSha256!=null&&(typeof A.midQualityFileEncSha256=="string"?l.base64.decode(A.midQualityFileEncSha256,r.midQualityFileEncSha256=l.newBuffer(l.base64.length(A.midQualityFileEncSha256)),0):A.midQualityFileEncSha256.length>=0&&(r.midQualityFileEncSha256=A.midQualityFileEncSha256)),A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.staticUrl!=null&&(r.staticUrl=String(A.staticUrl)),A.annotations){if(!Array.isArray(A.annotations))throw TypeError(".proto.Message.ImageMessage.annotations: array expected");r.annotations=[];for(var s=0;s>>3){case 1:{c.securityNotificationEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.InitialSecurityNotificationSettingSync)return A;var r=new d.proto.Message.InitialSecurityNotificationSettingSync;return A.securityNotificationEnabled!=null&&(r.securityNotificationEnabled=!!A.securityNotificationEnabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.securityNotificationEnabled!=null&&A.hasOwnProperty("securityNotificationEnabled")&&(s.securityNotificationEnabled=A.securityNotificationEnabled,r.oneofs&&(s._securityNotificationEnabled="securityNotificationEnabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InitialSecurityNotificationSettingSync"},a})(),t.InteractiveMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.header=d.proto.Message.InteractiveMessage.Header.decode(A,A.uint32());break}case 2:{c.body=d.proto.Message.InteractiveMessage.Body.decode(A,A.uint32());break}case 3:{c.footer=d.proto.Message.InteractiveMessage.Footer.decode(A,A.uint32());break}case 15:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 16:{c.urlTrackingMap=d.proto.UrlTrackingMap.decode(A,A.uint32());break}case 4:{c.shopStorefrontMessage=d.proto.Message.InteractiveMessage.ShopMessage.decode(A,A.uint32());break}case 5:{c.collectionMessage=d.proto.Message.InteractiveMessage.CollectionMessage.decode(A,A.uint32());break}case 6:{c.nativeFlowMessage=d.proto.Message.InteractiveMessage.NativeFlowMessage.decode(A,A.uint32());break}case 7:{c.carouselMessage=d.proto.Message.InteractiveMessage.CarouselMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.InteractiveMessage)return A;var r=new d.proto.Message.InteractiveMessage;if(A.header!=null){if(typeof A.header!="object")throw TypeError(".proto.Message.InteractiveMessage.header: object expected");r.header=d.proto.Message.InteractiveMessage.Header.fromObject(A.header)}if(A.body!=null){if(typeof A.body!="object")throw TypeError(".proto.Message.InteractiveMessage.body: object expected");r.body=d.proto.Message.InteractiveMessage.Body.fromObject(A.body)}if(A.footer!=null){if(typeof A.footer!="object")throw TypeError(".proto.Message.InteractiveMessage.footer: object expected");r.footer=d.proto.Message.InteractiveMessage.Footer.fromObject(A.footer)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.InteractiveMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.urlTrackingMap!=null){if(typeof A.urlTrackingMap!="object")throw TypeError(".proto.Message.InteractiveMessage.urlTrackingMap: object expected");r.urlTrackingMap=d.proto.UrlTrackingMap.fromObject(A.urlTrackingMap)}if(A.shopStorefrontMessage!=null){if(typeof A.shopStorefrontMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.shopStorefrontMessage: object expected");r.shopStorefrontMessage=d.proto.Message.InteractiveMessage.ShopMessage.fromObject(A.shopStorefrontMessage)}if(A.collectionMessage!=null){if(typeof A.collectionMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.collectionMessage: object expected");r.collectionMessage=d.proto.Message.InteractiveMessage.CollectionMessage.fromObject(A.collectionMessage)}if(A.nativeFlowMessage!=null){if(typeof A.nativeFlowMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.nativeFlowMessage: object expected");r.nativeFlowMessage=d.proto.Message.InteractiveMessage.NativeFlowMessage.fromObject(A.nativeFlowMessage)}if(A.carouselMessage!=null){if(typeof A.carouselMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.carouselMessage: object expected");r.carouselMessage=d.proto.Message.InteractiveMessage.CarouselMessage.fromObject(A.carouselMessage)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.header!=null&&A.hasOwnProperty("header")&&(s.header=d.proto.Message.InteractiveMessage.Header.toObject(A.header,r),r.oneofs&&(s._header="header")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=d.proto.Message.InteractiveMessage.Body.toObject(A.body,r),r.oneofs&&(s._body="body")),A.footer!=null&&A.hasOwnProperty("footer")&&(s.footer=d.proto.Message.InteractiveMessage.Footer.toObject(A.footer,r),r.oneofs&&(s._footer="footer")),A.shopStorefrontMessage!=null&&A.hasOwnProperty("shopStorefrontMessage")&&(s.shopStorefrontMessage=d.proto.Message.InteractiveMessage.ShopMessage.toObject(A.shopStorefrontMessage,r),r.oneofs&&(s.interactiveMessage="shopStorefrontMessage")),A.collectionMessage!=null&&A.hasOwnProperty("collectionMessage")&&(s.collectionMessage=d.proto.Message.InteractiveMessage.CollectionMessage.toObject(A.collectionMessage,r),r.oneofs&&(s.interactiveMessage="collectionMessage")),A.nativeFlowMessage!=null&&A.hasOwnProperty("nativeFlowMessage")&&(s.nativeFlowMessage=d.proto.Message.InteractiveMessage.NativeFlowMessage.toObject(A.nativeFlowMessage,r),r.oneofs&&(s.interactiveMessage="nativeFlowMessage")),A.carouselMessage!=null&&A.hasOwnProperty("carouselMessage")&&(s.carouselMessage=d.proto.Message.InteractiveMessage.CarouselMessage.toObject(A.carouselMessage,r),r.oneofs&&(s.interactiveMessage="carouselMessage")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.urlTrackingMap!=null&&A.hasOwnProperty("urlTrackingMap")&&(s.urlTrackingMap=d.proto.UrlTrackingMap.toObject(A.urlTrackingMap,r),r.oneofs&&(s._urlTrackingMap="urlTrackingMap")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InteractiveMessage"},a.Body=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.text=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.Body)return s;var g=new d.proto.Message.InteractiveMessage.Body;return s.text!=null&&(g.text=String(s.text)),g},i.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Body"},i})(),a.CarouselMessage=(function(){function i(r){if(this.cards=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.cards&&p.cards.length||(p.cards=[]),p.cards.push(d.proto.Message.InteractiveMessage.decode(s,s.uint32()));break}case 2:{p.messageVersion=s.int32();break}case 3:{p.carouselCardType=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.CarouselMessage)return s;var g=new d.proto.Message.InteractiveMessage.CarouselMessage;if(s.cards){if(!Array.isArray(s.cards))throw TypeError(".proto.Message.InteractiveMessage.CarouselMessage.cards: array expected");g.cards=[];for(var c=0;c>>3){case 1:{p.bizJid=s.string();break}case 2:{p.id=s.string();break}case 3:{p.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.CollectionMessage)return s;var g=new d.proto.Message.InteractiveMessage.CollectionMessage;return s.bizJid!=null&&(g.bizJid=String(s.bizJid)),s.id!=null&&(g.id=String(s.id)),s.messageVersion!=null&&(g.messageVersion=s.messageVersion|0),g},i.toObject=function(s,g){g||(g={});var c={};return s.bizJid!=null&&s.hasOwnProperty("bizJid")&&(c.bizJid=s.bizJid,g.oneofs&&(c._bizJid="bizJid")),s.id!=null&&s.hasOwnProperty("id")&&(c.id=s.id,g.oneofs&&(c._id="id")),s.messageVersion!=null&&s.hasOwnProperty("messageVersion")&&(c.messageVersion=s.messageVersion,g.oneofs&&(c._messageVersion="messageVersion")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.CollectionMessage"},i})(),a.Footer=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.text=s.string();break}case 3:{p.hasMediaAttachment=s.bool();break}case 2:{p.audioMessage=d.proto.Message.AudioMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.Footer)return s;var g=new d.proto.Message.InteractiveMessage.Footer;if(s.text!=null&&(g.text=String(s.text)),s.hasMediaAttachment!=null&&(g.hasMediaAttachment=!!s.hasMediaAttachment),s.audioMessage!=null){if(typeof s.audioMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Footer.audioMessage: object expected");g.audioMessage=d.proto.Message.AudioMessage.fromObject(s.audioMessage)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),s.audioMessage!=null&&s.hasOwnProperty("audioMessage")&&(c.audioMessage=d.proto.Message.AudioMessage.toObject(s.audioMessage,g),g.oneofs&&(c.media="audioMessage")),s.hasMediaAttachment!=null&&s.hasOwnProperty("hasMediaAttachment")&&(c.hasMediaAttachment=s.hasMediaAttachment,g.oneofs&&(c._hasMediaAttachment="hasMediaAttachment")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Footer"},i})(),a.Header=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.title=s.string();break}case 2:{p.subtitle=s.string();break}case 5:{p.hasMediaAttachment=s.bool();break}case 3:{p.documentMessage=d.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 4:{p.imageMessage=d.proto.Message.ImageMessage.decode(s,s.uint32());break}case 6:{p.jpegThumbnail=s.bytes();break}case 7:{p.videoMessage=d.proto.Message.VideoMessage.decode(s,s.uint32());break}case 8:{p.locationMessage=d.proto.Message.LocationMessage.decode(s,s.uint32());break}case 9:{p.productMessage=d.proto.Message.ProductMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.Header)return s;var g=new d.proto.Message.InteractiveMessage.Header;if(s.title!=null&&(g.title=String(s.title)),s.subtitle!=null&&(g.subtitle=String(s.subtitle)),s.hasMediaAttachment!=null&&(g.hasMediaAttachment=!!s.hasMediaAttachment),s.documentMessage!=null){if(typeof s.documentMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.documentMessage: object expected");g.documentMessage=d.proto.Message.DocumentMessage.fromObject(s.documentMessage)}if(s.imageMessage!=null){if(typeof s.imageMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.imageMessage: object expected");g.imageMessage=d.proto.Message.ImageMessage.fromObject(s.imageMessage)}if(s.jpegThumbnail!=null&&(typeof s.jpegThumbnail=="string"?l.base64.decode(s.jpegThumbnail,g.jpegThumbnail=l.newBuffer(l.base64.length(s.jpegThumbnail)),0):s.jpegThumbnail.length>=0&&(g.jpegThumbnail=s.jpegThumbnail)),s.videoMessage!=null){if(typeof s.videoMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.videoMessage: object expected");g.videoMessage=d.proto.Message.VideoMessage.fromObject(s.videoMessage)}if(s.locationMessage!=null){if(typeof s.locationMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.locationMessage: object expected");g.locationMessage=d.proto.Message.LocationMessage.fromObject(s.locationMessage)}if(s.productMessage!=null){if(typeof s.productMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.productMessage: object expected");g.productMessage=d.proto.Message.ProductMessage.fromObject(s.productMessage)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.subtitle!=null&&s.hasOwnProperty("subtitle")&&(c.subtitle=s.subtitle,g.oneofs&&(c._subtitle="subtitle")),s.documentMessage!=null&&s.hasOwnProperty("documentMessage")&&(c.documentMessage=d.proto.Message.DocumentMessage.toObject(s.documentMessage,g),g.oneofs&&(c.media="documentMessage")),s.imageMessage!=null&&s.hasOwnProperty("imageMessage")&&(c.imageMessage=d.proto.Message.ImageMessage.toObject(s.imageMessage,g),g.oneofs&&(c.media="imageMessage")),s.hasMediaAttachment!=null&&s.hasOwnProperty("hasMediaAttachment")&&(c.hasMediaAttachment=s.hasMediaAttachment,g.oneofs&&(c._hasMediaAttachment="hasMediaAttachment")),s.jpegThumbnail!=null&&s.hasOwnProperty("jpegThumbnail")&&(c.jpegThumbnail=g.bytes===String?l.base64.encode(s.jpegThumbnail,0,s.jpegThumbnail.length):g.bytes===Array?Array.prototype.slice.call(s.jpegThumbnail):s.jpegThumbnail,g.oneofs&&(c.media="jpegThumbnail")),s.videoMessage!=null&&s.hasOwnProperty("videoMessage")&&(c.videoMessage=d.proto.Message.VideoMessage.toObject(s.videoMessage,g),g.oneofs&&(c.media="videoMessage")),s.locationMessage!=null&&s.hasOwnProperty("locationMessage")&&(c.locationMessage=d.proto.Message.LocationMessage.toObject(s.locationMessage,g),g.oneofs&&(c.media="locationMessage")),s.productMessage!=null&&s.hasOwnProperty("productMessage")&&(c.productMessage=d.proto.Message.ProductMessage.toObject(s.productMessage,g),g.oneofs&&(c.media="productMessage")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Header"},i})(),a.NativeFlowMessage=(function(){function i(r){if(this.buttons=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.buttons&&p.buttons.length||(p.buttons=[]),p.buttons.push(d.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton.decode(s,s.uint32()));break}case 2:{p.messageParamsJson=s.string();break}case 3:{p.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.NativeFlowMessage)return s;var g=new d.proto.Message.InteractiveMessage.NativeFlowMessage;if(s.buttons){if(!Array.isArray(s.buttons))throw TypeError(".proto.Message.InteractiveMessage.NativeFlowMessage.buttons: array expected");g.buttons=[];for(var c=0;c>>3){case 1:{f.name=c.string();break}case 2:{f.buttonParamsJson=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton)return c;var I=new d.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton;return c.name!=null&&(I.name=String(c.name)),c.buttonParamsJson!=null&&(I.buttonParamsJson=String(c.buttonParamsJson)),I},r.toObject=function(c,I){I||(I={});var p={};return c.name!=null&&c.hasOwnProperty("name")&&(p.name=c.name,I.oneofs&&(p._name="name")),c.buttonParamsJson!=null&&c.hasOwnProperty("buttonParamsJson")&&(p.buttonParamsJson=c.buttonParamsJson,I.oneofs&&(p._buttonParamsJson="buttonParamsJson")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton"},r})(),i})(),a.ShopMessage=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.id=s.string();break}case 2:{p.surface=s.int32();break}case 3:{p.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.ShopMessage)return s;var g=new d.proto.Message.InteractiveMessage.ShopMessage;switch(s.id!=null&&(g.id=String(s.id)),s.surface){default:if(typeof s.surface=="number"){g.surface=s.surface;break}break;case"UNKNOWN_SURFACE":case 0:g.surface=0;break;case"FB":case 1:g.surface=1;break;case"IG":case 2:g.surface=2;break;case"WA":case 3:g.surface=3;break}return s.messageVersion!=null&&(g.messageVersion=s.messageVersion|0),g},i.toObject=function(s,g){g||(g={});var c={};return s.id!=null&&s.hasOwnProperty("id")&&(c.id=s.id,g.oneofs&&(c._id="id")),s.surface!=null&&s.hasOwnProperty("surface")&&(c.surface=g.enums===String?d.proto.Message.InteractiveMessage.ShopMessage.Surface[s.surface]===void 0?s.surface:d.proto.Message.InteractiveMessage.ShopMessage.Surface[s.surface]:s.surface,g.oneofs&&(c._surface="surface")),s.messageVersion!=null&&s.hasOwnProperty("messageVersion")&&(c.messageVersion=s.messageVersion,g.oneofs&&(c._messageVersion="messageVersion")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.ShopMessage"},i.Surface=(function(){let r={},s=Object.create(r);return s[r[0]="UNKNOWN_SURFACE"]=0,s[r[1]="FB"]=1,s[r[2]="IG"]=2,s[r[3]="WA"]=3,s})(),i})(),a})(),t.InteractiveResponseMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.body=d.proto.Message.InteractiveResponseMessage.Body.decode(A,A.uint32());break}case 15:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.nativeFlowResponseMessage=d.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.InteractiveResponseMessage)return A;var r=new d.proto.Message.InteractiveResponseMessage;if(A.body!=null){if(typeof A.body!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.body: object expected");r.body=d.proto.Message.InteractiveResponseMessage.Body.fromObject(A.body)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.nativeFlowResponseMessage!=null){if(typeof A.nativeFlowResponseMessage!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.nativeFlowResponseMessage: object expected");r.nativeFlowResponseMessage=d.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.fromObject(A.nativeFlowResponseMessage)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.body!=null&&A.hasOwnProperty("body")&&(s.body=d.proto.Message.InteractiveResponseMessage.Body.toObject(A.body,r),r.oneofs&&(s._body="body")),A.nativeFlowResponseMessage!=null&&A.hasOwnProperty("nativeFlowResponseMessage")&&(s.nativeFlowResponseMessage=d.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.toObject(A.nativeFlowResponseMessage,r),r.oneofs&&(s.interactiveResponseMessage="nativeFlowResponseMessage")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InteractiveResponseMessage"},a.Body=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.text=s.string();break}case 2:{p.format=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveResponseMessage.Body)return s;var g=new d.proto.Message.InteractiveResponseMessage.Body;switch(s.text!=null&&(g.text=String(s.text)),s.format){default:if(typeof s.format=="number"){g.format=s.format;break}break;case"DEFAULT":case 0:g.format=0;break;case"EXTENSIONS_1":case 1:g.format=1;break}return g},i.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),s.format!=null&&s.hasOwnProperty("format")&&(c.format=g.enums===String?d.proto.Message.InteractiveResponseMessage.Body.Format[s.format]===void 0?s.format:d.proto.Message.InteractiveResponseMessage.Body.Format[s.format]:s.format,g.oneofs&&(c._format="format")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveResponseMessage.Body"},i.Format=(function(){let r={},s=Object.create(r);return s[r[0]="DEFAULT"]=0,s[r[1]="EXTENSIONS_1"]=1,s})(),i})(),a.NativeFlowResponseMessage=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.name=s.string();break}case 2:{p.paramsJson=s.string();break}case 3:{p.version=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage)return s;var g=new d.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage;return s.name!=null&&(g.name=String(s.name)),s.paramsJson!=null&&(g.paramsJson=String(s.paramsJson)),s.version!=null&&(g.version=s.version|0),g},i.toObject=function(s,g){g||(g={});var c={};return s.name!=null&&s.hasOwnProperty("name")&&(c.name=s.name,g.oneofs&&(c._name="name")),s.paramsJson!=null&&s.hasOwnProperty("paramsJson")&&(c.paramsJson=s.paramsJson,g.oneofs&&(c._paramsJson="paramsJson")),s.version!=null&&s.hasOwnProperty("version")&&(c.version=s.version,g.oneofs&&(c._version="version")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage"},i})(),a})(),t.InvoiceMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.note=A.string();break}case 2:{c.token=A.string();break}case 3:{c.attachmentType=A.int32();break}case 4:{c.attachmentMimetype=A.string();break}case 5:{c.attachmentMediaKey=A.bytes();break}case 6:{c.attachmentMediaKeyTimestamp=A.int64();break}case 7:{c.attachmentFileSha256=A.bytes();break}case 8:{c.attachmentFileEncSha256=A.bytes();break}case 9:{c.attachmentDirectPath=A.string();break}case 10:{c.attachmentJpegThumbnail=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.InvoiceMessage)return A;var r=new d.proto.Message.InvoiceMessage;switch(A.note!=null&&(r.note=String(A.note)),A.token!=null&&(r.token=String(A.token)),A.attachmentType){default:if(typeof A.attachmentType=="number"){r.attachmentType=A.attachmentType;break}break;case"IMAGE":case 0:r.attachmentType=0;break;case"PDF":case 1:r.attachmentType=1;break}return A.attachmentMimetype!=null&&(r.attachmentMimetype=String(A.attachmentMimetype)),A.attachmentMediaKey!=null&&(typeof A.attachmentMediaKey=="string"?l.base64.decode(A.attachmentMediaKey,r.attachmentMediaKey=l.newBuffer(l.base64.length(A.attachmentMediaKey)),0):A.attachmentMediaKey.length>=0&&(r.attachmentMediaKey=A.attachmentMediaKey)),A.attachmentMediaKeyTimestamp!=null&&(l.Long?(r.attachmentMediaKeyTimestamp=l.Long.fromValue(A.attachmentMediaKeyTimestamp)).unsigned=!1:typeof A.attachmentMediaKeyTimestamp=="string"?r.attachmentMediaKeyTimestamp=parseInt(A.attachmentMediaKeyTimestamp,10):typeof A.attachmentMediaKeyTimestamp=="number"?r.attachmentMediaKeyTimestamp=A.attachmentMediaKeyTimestamp:typeof A.attachmentMediaKeyTimestamp=="object"&&(r.attachmentMediaKeyTimestamp=new l.LongBits(A.attachmentMediaKeyTimestamp.low>>>0,A.attachmentMediaKeyTimestamp.high>>>0).toNumber())),A.attachmentFileSha256!=null&&(typeof A.attachmentFileSha256=="string"?l.base64.decode(A.attachmentFileSha256,r.attachmentFileSha256=l.newBuffer(l.base64.length(A.attachmentFileSha256)),0):A.attachmentFileSha256.length>=0&&(r.attachmentFileSha256=A.attachmentFileSha256)),A.attachmentFileEncSha256!=null&&(typeof A.attachmentFileEncSha256=="string"?l.base64.decode(A.attachmentFileEncSha256,r.attachmentFileEncSha256=l.newBuffer(l.base64.length(A.attachmentFileEncSha256)),0):A.attachmentFileEncSha256.length>=0&&(r.attachmentFileEncSha256=A.attachmentFileEncSha256)),A.attachmentDirectPath!=null&&(r.attachmentDirectPath=String(A.attachmentDirectPath)),A.attachmentJpegThumbnail!=null&&(typeof A.attachmentJpegThumbnail=="string"?l.base64.decode(A.attachmentJpegThumbnail,r.attachmentJpegThumbnail=l.newBuffer(l.base64.length(A.attachmentJpegThumbnail)),0):A.attachmentJpegThumbnail.length>=0&&(r.attachmentJpegThumbnail=A.attachmentJpegThumbnail)),r},a.toObject=function(A,r){r||(r={});var s={};return A.note!=null&&A.hasOwnProperty("note")&&(s.note=A.note,r.oneofs&&(s._note="note")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=A.token,r.oneofs&&(s._token="token")),A.attachmentType!=null&&A.hasOwnProperty("attachmentType")&&(s.attachmentType=r.enums===String?d.proto.Message.InvoiceMessage.AttachmentType[A.attachmentType]===void 0?A.attachmentType:d.proto.Message.InvoiceMessage.AttachmentType[A.attachmentType]:A.attachmentType,r.oneofs&&(s._attachmentType="attachmentType")),A.attachmentMimetype!=null&&A.hasOwnProperty("attachmentMimetype")&&(s.attachmentMimetype=A.attachmentMimetype,r.oneofs&&(s._attachmentMimetype="attachmentMimetype")),A.attachmentMediaKey!=null&&A.hasOwnProperty("attachmentMediaKey")&&(s.attachmentMediaKey=r.bytes===String?l.base64.encode(A.attachmentMediaKey,0,A.attachmentMediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentMediaKey):A.attachmentMediaKey,r.oneofs&&(s._attachmentMediaKey="attachmentMediaKey")),A.attachmentMediaKeyTimestamp!=null&&A.hasOwnProperty("attachmentMediaKeyTimestamp")&&(typeof A.attachmentMediaKeyTimestamp=="number"?s.attachmentMediaKeyTimestamp=r.longs===String?String(A.attachmentMediaKeyTimestamp):A.attachmentMediaKeyTimestamp:s.attachmentMediaKeyTimestamp=r.longs===String?ge(A.attachmentMediaKeyTimestamp):r.longs===Number?ce(A.attachmentMediaKeyTimestamp):A.attachmentMediaKeyTimestamp,r.oneofs&&(s._attachmentMediaKeyTimestamp="attachmentMediaKeyTimestamp")),A.attachmentFileSha256!=null&&A.hasOwnProperty("attachmentFileSha256")&&(s.attachmentFileSha256=r.bytes===String?l.base64.encode(A.attachmentFileSha256,0,A.attachmentFileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentFileSha256):A.attachmentFileSha256,r.oneofs&&(s._attachmentFileSha256="attachmentFileSha256")),A.attachmentFileEncSha256!=null&&A.hasOwnProperty("attachmentFileEncSha256")&&(s.attachmentFileEncSha256=r.bytes===String?l.base64.encode(A.attachmentFileEncSha256,0,A.attachmentFileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentFileEncSha256):A.attachmentFileEncSha256,r.oneofs&&(s._attachmentFileEncSha256="attachmentFileEncSha256")),A.attachmentDirectPath!=null&&A.hasOwnProperty("attachmentDirectPath")&&(s.attachmentDirectPath=A.attachmentDirectPath,r.oneofs&&(s._attachmentDirectPath="attachmentDirectPath")),A.attachmentJpegThumbnail!=null&&A.hasOwnProperty("attachmentJpegThumbnail")&&(s.attachmentJpegThumbnail=r.bytes===String?l.base64.encode(A.attachmentJpegThumbnail,0,A.attachmentJpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentJpegThumbnail):A.attachmentJpegThumbnail,r.oneofs&&(s._attachmentJpegThumbnail="attachmentJpegThumbnail")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InvoiceMessage"},a.AttachmentType=(function(){let i={},A=Object.create(i);return A[i[0]="IMAGE"]=0,A[i[1]="PDF"]=1,A})(),a})(),t.KeepInChatMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.keepType=A.int32();break}case 3:{c.timestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.KeepInChatMessage)return A;var r=new d.proto.Message.KeepInChatMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.KeepInChatMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}switch(A.keepType){default:if(typeof A.keepType=="number"){r.keepType=A.keepType;break}break;case"UNKNOWN":case 0:r.keepType=0;break;case"KEEP_FOR_ALL":case 1:r.keepType=1;break;case"UNDO_KEEP_FOR_ALL":case 2:r.keepType=2;break}return A.timestampMs!=null&&(l.Long?(r.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?r.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?r.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(r.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.keepType!=null&&A.hasOwnProperty("keepType")&&(s.keepType=r.enums===String?d.proto.KeepType[A.keepType]===void 0?A.keepType:d.proto.KeepType[A.keepType]:A.keepType,r.oneofs&&(s._keepType="keepType")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=r.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=r.longs===String?ge(A.timestampMs):r.longs===Number?ce(A.timestampMs):A.timestampMs,r.oneofs&&(s._timestampMs="timestampMs")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.KeepInChatMessage"},a})(),t.LinkPreviewMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.paymentLinkMetadata=d.proto.Message.PaymentLinkMetadata.decode(A,A.uint32());break}case 2:{c.urlMetadata=d.proto.Message.URLMetadata.decode(A,A.uint32());break}case 3:{c.fbExperimentId=A.uint32();break}case 4:{c.linkMediaDuration=A.uint32();break}case 5:{c.socialMediaPostType=A.int32();break}case 6:{c.linkInlineVideoMuted=A.bool();break}case 7:{c.videoContentUrl=A.string();break}case 8:{c.musicMetadata=d.proto.EmbeddedMusic.decode(A,A.uint32());break}case 9:{c.videoContentCaption=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.LinkPreviewMetadata)return A;var r=new d.proto.Message.LinkPreviewMetadata;if(A.paymentLinkMetadata!=null){if(typeof A.paymentLinkMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.paymentLinkMetadata: object expected");r.paymentLinkMetadata=d.proto.Message.PaymentLinkMetadata.fromObject(A.paymentLinkMetadata)}if(A.urlMetadata!=null){if(typeof A.urlMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.urlMetadata: object expected");r.urlMetadata=d.proto.Message.URLMetadata.fromObject(A.urlMetadata)}switch(A.fbExperimentId!=null&&(r.fbExperimentId=A.fbExperimentId>>>0),A.linkMediaDuration!=null&&(r.linkMediaDuration=A.linkMediaDuration>>>0),A.socialMediaPostType){default:if(typeof A.socialMediaPostType=="number"){r.socialMediaPostType=A.socialMediaPostType;break}break;case"NONE":case 0:r.socialMediaPostType=0;break;case"REEL":case 1:r.socialMediaPostType=1;break;case"LIVE_VIDEO":case 2:r.socialMediaPostType=2;break;case"LONG_VIDEO":case 3:r.socialMediaPostType=3;break;case"SINGLE_IMAGE":case 4:r.socialMediaPostType=4;break;case"CAROUSEL":case 5:r.socialMediaPostType=5;break}if(A.linkInlineVideoMuted!=null&&(r.linkInlineVideoMuted=!!A.linkInlineVideoMuted),A.videoContentUrl!=null&&(r.videoContentUrl=String(A.videoContentUrl)),A.musicMetadata!=null){if(typeof A.musicMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.musicMetadata: object expected");r.musicMetadata=d.proto.EmbeddedMusic.fromObject(A.musicMetadata)}return A.videoContentCaption!=null&&(r.videoContentCaption=String(A.videoContentCaption)),r},a.toObject=function(A,r){r||(r={});var s={};return A.paymentLinkMetadata!=null&&A.hasOwnProperty("paymentLinkMetadata")&&(s.paymentLinkMetadata=d.proto.Message.PaymentLinkMetadata.toObject(A.paymentLinkMetadata,r),r.oneofs&&(s._paymentLinkMetadata="paymentLinkMetadata")),A.urlMetadata!=null&&A.hasOwnProperty("urlMetadata")&&(s.urlMetadata=d.proto.Message.URLMetadata.toObject(A.urlMetadata,r),r.oneofs&&(s._urlMetadata="urlMetadata")),A.fbExperimentId!=null&&A.hasOwnProperty("fbExperimentId")&&(s.fbExperimentId=A.fbExperimentId,r.oneofs&&(s._fbExperimentId="fbExperimentId")),A.linkMediaDuration!=null&&A.hasOwnProperty("linkMediaDuration")&&(s.linkMediaDuration=A.linkMediaDuration,r.oneofs&&(s._linkMediaDuration="linkMediaDuration")),A.socialMediaPostType!=null&&A.hasOwnProperty("socialMediaPostType")&&(s.socialMediaPostType=r.enums===String?d.proto.Message.LinkPreviewMetadata.SocialMediaPostType[A.socialMediaPostType]===void 0?A.socialMediaPostType:d.proto.Message.LinkPreviewMetadata.SocialMediaPostType[A.socialMediaPostType]:A.socialMediaPostType,r.oneofs&&(s._socialMediaPostType="socialMediaPostType")),A.linkInlineVideoMuted!=null&&A.hasOwnProperty("linkInlineVideoMuted")&&(s.linkInlineVideoMuted=A.linkInlineVideoMuted,r.oneofs&&(s._linkInlineVideoMuted="linkInlineVideoMuted")),A.videoContentUrl!=null&&A.hasOwnProperty("videoContentUrl")&&(s.videoContentUrl=A.videoContentUrl,r.oneofs&&(s._videoContentUrl="videoContentUrl")),A.musicMetadata!=null&&A.hasOwnProperty("musicMetadata")&&(s.musicMetadata=d.proto.EmbeddedMusic.toObject(A.musicMetadata,r),r.oneofs&&(s._musicMetadata="musicMetadata")),A.videoContentCaption!=null&&A.hasOwnProperty("videoContentCaption")&&(s.videoContentCaption=A.videoContentCaption,r.oneofs&&(s._videoContentCaption="videoContentCaption")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LinkPreviewMetadata"},a.SocialMediaPostType=(function(){let i={},A=Object.create(i);return A[i[0]="NONE"]=0,A[i[1]="REEL"]=1,A[i[2]="LIVE_VIDEO"]=2,A[i[3]="LONG_VIDEO"]=3,A[i[4]="SINGLE_IMAGE"]=4,A[i[5]="CAROUSEL"]=5,A})(),a})(),t.ListMessage=(function(){function a(i){if(this.sections=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.title=A.string();break}case 2:{c.description=A.string();break}case 3:{c.buttonText=A.string();break}case 4:{c.listType=A.int32();break}case 5:{c.sections&&c.sections.length||(c.sections=[]),c.sections.push(d.proto.Message.ListMessage.Section.decode(A,A.uint32()));break}case 6:{c.productListInfo=d.proto.Message.ListMessage.ProductListInfo.decode(A,A.uint32());break}case 7:{c.footerText=A.string();break}case 8:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ListMessage)return A;var r=new d.proto.Message.ListMessage;switch(A.title!=null&&(r.title=String(A.title)),A.description!=null&&(r.description=String(A.description)),A.buttonText!=null&&(r.buttonText=String(A.buttonText)),A.listType){default:if(typeof A.listType=="number"){r.listType=A.listType;break}break;case"UNKNOWN":case 0:r.listType=0;break;case"SINGLE_SELECT":case 1:r.listType=1;break;case"PRODUCT_LIST":case 2:r.listType=2;break}if(A.sections){if(!Array.isArray(A.sections))throw TypeError(".proto.Message.ListMessage.sections: array expected");r.sections=[];for(var s=0;s>>3){case 1:{p.productId=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListMessage.Product)return s;var g=new d.proto.Message.ListMessage.Product;return s.productId!=null&&(g.productId=String(s.productId)),g},i.toObject=function(s,g){g||(g={});var c={};return s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.Product"},i})(),a.ProductListHeaderImage=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.productId=s.string();break}case 2:{p.jpegThumbnail=s.bytes();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListMessage.ProductListHeaderImage)return s;var g=new d.proto.Message.ListMessage.ProductListHeaderImage;return s.productId!=null&&(g.productId=String(s.productId)),s.jpegThumbnail!=null&&(typeof s.jpegThumbnail=="string"?l.base64.decode(s.jpegThumbnail,g.jpegThumbnail=l.newBuffer(l.base64.length(s.jpegThumbnail)),0):s.jpegThumbnail.length>=0&&(g.jpegThumbnail=s.jpegThumbnail)),g},i.toObject=function(s,g){g||(g={});var c={};return s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),s.jpegThumbnail!=null&&s.hasOwnProperty("jpegThumbnail")&&(c.jpegThumbnail=g.bytes===String?l.base64.encode(s.jpegThumbnail,0,s.jpegThumbnail.length):g.bytes===Array?Array.prototype.slice.call(s.jpegThumbnail):s.jpegThumbnail,g.oneofs&&(c._jpegThumbnail="jpegThumbnail")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.ProductListHeaderImage"},i})(),a.ProductListInfo=(function(){function i(r){if(this.productSections=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.productSections&&p.productSections.length||(p.productSections=[]),p.productSections.push(d.proto.Message.ListMessage.ProductSection.decode(s,s.uint32()));break}case 2:{p.headerImage=d.proto.Message.ListMessage.ProductListHeaderImage.decode(s,s.uint32());break}case 3:{p.businessOwnerJid=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListMessage.ProductListInfo)return s;var g=new d.proto.Message.ListMessage.ProductListInfo;if(s.productSections){if(!Array.isArray(s.productSections))throw TypeError(".proto.Message.ListMessage.ProductListInfo.productSections: array expected");g.productSections=[];for(var c=0;c>>3){case 1:{p.title=s.string();break}case 2:{p.products&&p.products.length||(p.products=[]),p.products.push(d.proto.Message.ListMessage.Product.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListMessage.ProductSection)return s;var g=new d.proto.Message.ListMessage.ProductSection;if(s.title!=null&&(g.title=String(s.title)),s.products){if(!Array.isArray(s.products))throw TypeError(".proto.Message.ListMessage.ProductSection.products: array expected");g.products=[];for(var c=0;c>>3){case 1:{p.title=s.string();break}case 2:{p.description=s.string();break}case 3:{p.rowId=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListMessage.Row)return s;var g=new d.proto.Message.ListMessage.Row;return s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.rowId!=null&&(g.rowId=String(s.rowId)),g},i.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.rowId!=null&&s.hasOwnProperty("rowId")&&(c.rowId=s.rowId,g.oneofs&&(c._rowId="rowId")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.Row"},i})(),a.Section=(function(){function i(r){if(this.rows=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.title=s.string();break}case 2:{p.rows&&p.rows.length||(p.rows=[]),p.rows.push(d.proto.Message.ListMessage.Row.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListMessage.Section)return s;var g=new d.proto.Message.ListMessage.Section;if(s.title!=null&&(g.title=String(s.title)),s.rows){if(!Array.isArray(s.rows))throw TypeError(".proto.Message.ListMessage.Section.rows: array expected");g.rows=[];for(var c=0;c>>3){case 1:{c.title=A.string();break}case 2:{c.listType=A.int32();break}case 3:{c.singleSelectReply=d.proto.Message.ListResponseMessage.SingleSelectReply.decode(A,A.uint32());break}case 4:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 5:{c.description=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ListResponseMessage)return A;var r=new d.proto.Message.ListResponseMessage;switch(A.title!=null&&(r.title=String(A.title)),A.listType){default:if(typeof A.listType=="number"){r.listType=A.listType;break}break;case"UNKNOWN":case 0:r.listType=0;break;case"SINGLE_SELECT":case 1:r.listType=1;break}if(A.singleSelectReply!=null){if(typeof A.singleSelectReply!="object")throw TypeError(".proto.Message.ListResponseMessage.singleSelectReply: object expected");r.singleSelectReply=d.proto.Message.ListResponseMessage.SingleSelectReply.fromObject(A.singleSelectReply)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ListResponseMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return A.description!=null&&(r.description=String(A.description)),r},a.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.listType!=null&&A.hasOwnProperty("listType")&&(s.listType=r.enums===String?d.proto.Message.ListResponseMessage.ListType[A.listType]===void 0?A.listType:d.proto.Message.ListResponseMessage.ListType[A.listType]:A.listType,r.oneofs&&(s._listType="listType")),A.singleSelectReply!=null&&A.hasOwnProperty("singleSelectReply")&&(s.singleSelectReply=d.proto.Message.ListResponseMessage.SingleSelectReply.toObject(A.singleSelectReply,r),r.oneofs&&(s._singleSelectReply="singleSelectReply")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.description!=null&&A.hasOwnProperty("description")&&(s.description=A.description,r.oneofs&&(s._description="description")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ListResponseMessage"},a.ListType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="SINGLE_SELECT"]=1,A})(),a.SingleSelectReply=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.selectedRowId=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListResponseMessage.SingleSelectReply)return s;var g=new d.proto.Message.ListResponseMessage.SingleSelectReply;return s.selectedRowId!=null&&(g.selectedRowId=String(s.selectedRowId)),g},i.toObject=function(s,g){g||(g={});var c={};return s.selectedRowId!=null&&s.hasOwnProperty("selectedRowId")&&(c.selectedRowId=s.selectedRowId,g.oneofs&&(c._selectedRowId="selectedRowId")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListResponseMessage.SingleSelectReply"},i})(),a})(),t.LiveLocationMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.accuracyInMeters=A.uint32();break}case 4:{c.speedInMps=A.float();break}case 5:{c.degreesClockwiseFromMagneticNorth=A.uint32();break}case 6:{c.caption=A.string();break}case 7:{c.sequenceNumber=A.int64();break}case 8:{c.timeOffset=A.uint32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.LiveLocationMessage)return A;var r=new d.proto.Message.LiveLocationMessage;if(A.degreesLatitude!=null&&(r.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(r.degreesLongitude=Number(A.degreesLongitude)),A.accuracyInMeters!=null&&(r.accuracyInMeters=A.accuracyInMeters>>>0),A.speedInMps!=null&&(r.speedInMps=Number(A.speedInMps)),A.degreesClockwiseFromMagneticNorth!=null&&(r.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth>>>0),A.caption!=null&&(r.caption=String(A.caption)),A.sequenceNumber!=null&&(l.Long?(r.sequenceNumber=l.Long.fromValue(A.sequenceNumber)).unsigned=!1:typeof A.sequenceNumber=="string"?r.sequenceNumber=parseInt(A.sequenceNumber,10):typeof A.sequenceNumber=="number"?r.sequenceNumber=A.sequenceNumber:typeof A.sequenceNumber=="object"&&(r.sequenceNumber=new l.LongBits(A.sequenceNumber.low>>>0,A.sequenceNumber.high>>>0).toNumber())),A.timeOffset!=null&&(r.timeOffset=A.timeOffset>>>0),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.LiveLocationMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=r.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,r.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=r.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,r.oneofs&&(s._degreesLongitude="degreesLongitude")),A.accuracyInMeters!=null&&A.hasOwnProperty("accuracyInMeters")&&(s.accuracyInMeters=A.accuracyInMeters,r.oneofs&&(s._accuracyInMeters="accuracyInMeters")),A.speedInMps!=null&&A.hasOwnProperty("speedInMps")&&(s.speedInMps=r.json&&!isFinite(A.speedInMps)?String(A.speedInMps):A.speedInMps,r.oneofs&&(s._speedInMps="speedInMps")),A.degreesClockwiseFromMagneticNorth!=null&&A.hasOwnProperty("degreesClockwiseFromMagneticNorth")&&(s.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth,r.oneofs&&(s._degreesClockwiseFromMagneticNorth="degreesClockwiseFromMagneticNorth")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.sequenceNumber!=null&&A.hasOwnProperty("sequenceNumber")&&(typeof A.sequenceNumber=="number"?s.sequenceNumber=r.longs===String?String(A.sequenceNumber):A.sequenceNumber:s.sequenceNumber=r.longs===String?ge(A.sequenceNumber):r.longs===Number?ce(A.sequenceNumber):A.sequenceNumber,r.oneofs&&(s._sequenceNumber="sequenceNumber")),A.timeOffset!=null&&A.hasOwnProperty("timeOffset")&&(s.timeOffset=A.timeOffset,r.oneofs&&(s._timeOffset="timeOffset")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LiveLocationMessage"},a})(),t.LocationMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.name=A.string();break}case 4:{c.address=A.string();break}case 5:{c.url=A.string();break}case 6:{c.isLive=A.bool();break}case 7:{c.accuracyInMeters=A.uint32();break}case 8:{c.speedInMps=A.float();break}case 9:{c.degreesClockwiseFromMagneticNorth=A.uint32();break}case 11:{c.comment=A.string();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.LocationMessage)return A;var r=new d.proto.Message.LocationMessage;if(A.degreesLatitude!=null&&(r.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(r.degreesLongitude=Number(A.degreesLongitude)),A.name!=null&&(r.name=String(A.name)),A.address!=null&&(r.address=String(A.address)),A.url!=null&&(r.url=String(A.url)),A.isLive!=null&&(r.isLive=!!A.isLive),A.accuracyInMeters!=null&&(r.accuracyInMeters=A.accuracyInMeters>>>0),A.speedInMps!=null&&(r.speedInMps=Number(A.speedInMps)),A.degreesClockwiseFromMagneticNorth!=null&&(r.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth>>>0),A.comment!=null&&(r.comment=String(A.comment)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.LocationMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=r.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,r.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=r.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,r.oneofs&&(s._degreesLongitude="degreesLongitude")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.address!=null&&A.hasOwnProperty("address")&&(s.address=A.address,r.oneofs&&(s._address="address")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.isLive!=null&&A.hasOwnProperty("isLive")&&(s.isLive=A.isLive,r.oneofs&&(s._isLive="isLive")),A.accuracyInMeters!=null&&A.hasOwnProperty("accuracyInMeters")&&(s.accuracyInMeters=A.accuracyInMeters,r.oneofs&&(s._accuracyInMeters="accuracyInMeters")),A.speedInMps!=null&&A.hasOwnProperty("speedInMps")&&(s.speedInMps=r.json&&!isFinite(A.speedInMps)?String(A.speedInMps):A.speedInMps,r.oneofs&&(s._speedInMps="speedInMps")),A.degreesClockwiseFromMagneticNorth!=null&&A.hasOwnProperty("degreesClockwiseFromMagneticNorth")&&(s.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth,r.oneofs&&(s._degreesClockwiseFromMagneticNorth="degreesClockwiseFromMagneticNorth")),A.comment!=null&&A.hasOwnProperty("comment")&&(s.comment=A.comment,r.oneofs&&(s._comment="comment")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LocationMessage"},a})(),t.MMSThumbnailMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.thumbnailDirectPath=A.string();break}case 2:{c.thumbnailSha256=A.bytes();break}case 3:{c.thumbnailEncSha256=A.bytes();break}case 4:{c.mediaKey=A.bytes();break}case 5:{c.mediaKeyTimestamp=A.int64();break}case 6:{c.thumbnailHeight=A.uint32();break}case 7:{c.thumbnailWidth=A.uint32();break}case 8:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.MMSThumbnailMetadata)return A;var r=new d.proto.Message.MMSThumbnailMetadata;switch(A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.thumbnailDirectPath!=null&&A.hasOwnProperty("thumbnailDirectPath")&&(s.thumbnailDirectPath=A.thumbnailDirectPath,r.oneofs&&(s._thumbnailDirectPath="thumbnailDirectPath")),A.thumbnailSha256!=null&&A.hasOwnProperty("thumbnailSha256")&&(s.thumbnailSha256=r.bytes===String?l.base64.encode(A.thumbnailSha256,0,A.thumbnailSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailSha256):A.thumbnailSha256,r.oneofs&&(s._thumbnailSha256="thumbnailSha256")),A.thumbnailEncSha256!=null&&A.hasOwnProperty("thumbnailEncSha256")&&(s.thumbnailEncSha256=r.bytes===String?l.base64.encode(A.thumbnailEncSha256,0,A.thumbnailEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailEncSha256):A.thumbnailEncSha256,r.oneofs&&(s._thumbnailEncSha256="thumbnailEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.thumbnailHeight!=null&&A.hasOwnProperty("thumbnailHeight")&&(s.thumbnailHeight=A.thumbnailHeight,r.oneofs&&(s._thumbnailHeight="thumbnailHeight")),A.thumbnailWidth!=null&&A.hasOwnProperty("thumbnailWidth")&&(s.thumbnailWidth=A.thumbnailWidth,r.oneofs&&(s._thumbnailWidth="thumbnailWidth")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MMSThumbnailMetadata"},a})(),t.MediaKeyDomain=(function(){let a={},e=Object.create(a);return e[a[0]="UNSET"]=0,e[a[1]="E2EE_CHAT"]=1,e[a[2]="STATUS"]=2,e[a[3]="CAPI"]=3,e[a[4]="BOT"]=4,e})(),t.MessageHistoryBundle=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.mimetype=A.string();break}case 2:{c.fileSha256=A.bytes();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}case 6:{c.mediaKeyTimestamp=A.int64();break}case 7:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.messageHistoryMetadata=d.proto.Message.MessageHistoryMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.MessageHistoryBundle)return A;var r=new d.proto.Message.MessageHistoryBundle;if(A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.MessageHistoryBundle.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageHistoryMetadata!=null){if(typeof A.messageHistoryMetadata!="object")throw TypeError(".proto.Message.MessageHistoryBundle.messageHistoryMetadata: object expected");r.messageHistoryMetadata=d.proto.Message.MessageHistoryMetadata.fromObject(A.messageHistoryMetadata)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.messageHistoryMetadata!=null&&A.hasOwnProperty("messageHistoryMetadata")&&(s.messageHistoryMetadata=d.proto.Message.MessageHistoryMetadata.toObject(A.messageHistoryMetadata,r),r.oneofs&&(s._messageHistoryMetadata="messageHistoryMetadata")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MessageHistoryBundle"},a})(),t.MessageHistoryMetadata=(function(){function a(i){if(this.historyReceivers=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.historyReceivers&&c.historyReceivers.length||(c.historyReceivers=[]),c.historyReceivers.push(A.string());break}case 2:{c.oldestMessageTimestamp=A.int64();break}case 3:{c.messageCount=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.MessageHistoryMetadata)return A;var r=new d.proto.Message.MessageHistoryMetadata;if(A.historyReceivers){if(!Array.isArray(A.historyReceivers))throw TypeError(".proto.Message.MessageHistoryMetadata.historyReceivers: array expected");r.historyReceivers=[];for(var s=0;s>>0,A.oldestMessageTimestamp.high>>>0).toNumber())),A.messageCount!=null&&(l.Long?(r.messageCount=l.Long.fromValue(A.messageCount)).unsigned=!1:typeof A.messageCount=="string"?r.messageCount=parseInt(A.messageCount,10):typeof A.messageCount=="number"?r.messageCount=A.messageCount:typeof A.messageCount=="object"&&(r.messageCount=new l.LongBits(A.messageCount.low>>>0,A.messageCount.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.historyReceivers=[]),A.historyReceivers&&A.historyReceivers.length){s.historyReceivers=[];for(var g=0;g>>3){case 1:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.messageHistoryMetadata=d.proto.Message.MessageHistoryMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.MessageHistoryNotice)return A;var r=new d.proto.Message.MessageHistoryNotice;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.MessageHistoryNotice.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageHistoryMetadata!=null){if(typeof A.messageHistoryMetadata!="object")throw TypeError(".proto.Message.MessageHistoryNotice.messageHistoryMetadata: object expected");r.messageHistoryMetadata=d.proto.Message.MessageHistoryMetadata.fromObject(A.messageHistoryMetadata)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.messageHistoryMetadata!=null&&A.hasOwnProperty("messageHistoryMetadata")&&(s.messageHistoryMetadata=d.proto.Message.MessageHistoryMetadata.toObject(A.messageHistoryMetadata,r),r.oneofs&&(s._messageHistoryMetadata="messageHistoryMetadata")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MessageHistoryNotice"},a})(),t.NewsletterAdminInviteMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.newsletterName=A.string();break}case 3:{c.jpegThumbnail=A.bytes();break}case 4:{c.caption=A.string();break}case 5:{c.inviteExpiration=A.int64();break}case 6:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.NewsletterAdminInviteMessage)return A;var r=new d.proto.Message.NewsletterAdminInviteMessage;if(A.newsletterJid!=null&&(r.newsletterJid=String(A.newsletterJid)),A.newsletterName!=null&&(r.newsletterName=String(A.newsletterName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),A.inviteExpiration!=null&&(l.Long?(r.inviteExpiration=l.Long.fromValue(A.inviteExpiration)).unsigned=!1:typeof A.inviteExpiration=="string"?r.inviteExpiration=parseInt(A.inviteExpiration,10):typeof A.inviteExpiration=="number"?r.inviteExpiration=A.inviteExpiration:typeof A.inviteExpiration=="object"&&(r.inviteExpiration=new l.LongBits(A.inviteExpiration.low>>>0,A.inviteExpiration.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.NewsletterAdminInviteMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,r.oneofs&&(s._newsletterJid="newsletterJid")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,r.oneofs&&(s._newsletterName="newsletterName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.inviteExpiration!=null&&A.hasOwnProperty("inviteExpiration")&&(typeof A.inviteExpiration=="number"?s.inviteExpiration=r.longs===String?String(A.inviteExpiration):A.inviteExpiration:s.inviteExpiration=r.longs===String?ge(A.inviteExpiration):r.longs===Number?ce(A.inviteExpiration):A.inviteExpiration,r.oneofs&&(s._inviteExpiration="inviteExpiration")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.NewsletterAdminInviteMessage"},a})(),t.NewsletterFollowerInviteMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.newsletterName=A.string();break}case 3:{c.jpegThumbnail=A.bytes();break}case 4:{c.caption=A.string();break}case 5:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.NewsletterFollowerInviteMessage)return A;var r=new d.proto.Message.NewsletterFollowerInviteMessage;if(A.newsletterJid!=null&&(r.newsletterJid=String(A.newsletterJid)),A.newsletterName!=null&&(r.newsletterName=String(A.newsletterName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.NewsletterFollowerInviteMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,r.oneofs&&(s._newsletterJid="newsletterJid")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,r.oneofs&&(s._newsletterName="newsletterName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.NewsletterFollowerInviteMessage"},a})(),t.OrderMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.orderId=A.string();break}case 2:{c.thumbnail=A.bytes();break}case 3:{c.itemCount=A.int32();break}case 4:{c.status=A.int32();break}case 5:{c.surface=A.int32();break}case 6:{c.message=A.string();break}case 7:{c.orderTitle=A.string();break}case 8:{c.sellerJid=A.string();break}case 9:{c.token=A.string();break}case 10:{c.totalAmount1000=A.int64();break}case 11:{c.totalCurrencyCode=A.string();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 12:{c.messageVersion=A.int32();break}case 13:{c.orderRequestMessageId=d.proto.MessageKey.decode(A,A.uint32());break}case 15:{c.catalogType=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.OrderMessage)return A;var r=new d.proto.Message.OrderMessage;switch(A.orderId!=null&&(r.orderId=String(A.orderId)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,r.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(r.thumbnail=A.thumbnail)),A.itemCount!=null&&(r.itemCount=A.itemCount|0),A.status){default:if(typeof A.status=="number"){r.status=A.status;break}break;case"INQUIRY":case 1:r.status=1;break;case"ACCEPTED":case 2:r.status=2;break;case"DECLINED":case 3:r.status=3;break}switch(A.surface){default:if(typeof A.surface=="number"){r.surface=A.surface;break}break;case"CATALOG":case 1:r.surface=1;break}if(A.message!=null&&(r.message=String(A.message)),A.orderTitle!=null&&(r.orderTitle=String(A.orderTitle)),A.sellerJid!=null&&(r.sellerJid=String(A.sellerJid)),A.token!=null&&(r.token=String(A.token)),A.totalAmount1000!=null&&(l.Long?(r.totalAmount1000=l.Long.fromValue(A.totalAmount1000)).unsigned=!1:typeof A.totalAmount1000=="string"?r.totalAmount1000=parseInt(A.totalAmount1000,10):typeof A.totalAmount1000=="number"?r.totalAmount1000=A.totalAmount1000:typeof A.totalAmount1000=="object"&&(r.totalAmount1000=new l.LongBits(A.totalAmount1000.low>>>0,A.totalAmount1000.high>>>0).toNumber())),A.totalCurrencyCode!=null&&(r.totalCurrencyCode=String(A.totalCurrencyCode)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.OrderMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageVersion!=null&&(r.messageVersion=A.messageVersion|0),A.orderRequestMessageId!=null){if(typeof A.orderRequestMessageId!="object")throw TypeError(".proto.Message.OrderMessage.orderRequestMessageId: object expected");r.orderRequestMessageId=d.proto.MessageKey.fromObject(A.orderRequestMessageId)}return A.catalogType!=null&&(r.catalogType=String(A.catalogType)),r},a.toObject=function(A,r){r||(r={});var s={};return A.orderId!=null&&A.hasOwnProperty("orderId")&&(s.orderId=A.orderId,r.oneofs&&(s._orderId="orderId")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=r.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,r.oneofs&&(s._thumbnail="thumbnail")),A.itemCount!=null&&A.hasOwnProperty("itemCount")&&(s.itemCount=A.itemCount,r.oneofs&&(s._itemCount="itemCount")),A.status!=null&&A.hasOwnProperty("status")&&(s.status=r.enums===String?d.proto.Message.OrderMessage.OrderStatus[A.status]===void 0?A.status:d.proto.Message.OrderMessage.OrderStatus[A.status]:A.status,r.oneofs&&(s._status="status")),A.surface!=null&&A.hasOwnProperty("surface")&&(s.surface=r.enums===String?d.proto.Message.OrderMessage.OrderSurface[A.surface]===void 0?A.surface:d.proto.Message.OrderMessage.OrderSurface[A.surface]:A.surface,r.oneofs&&(s._surface="surface")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=A.message,r.oneofs&&(s._message="message")),A.orderTitle!=null&&A.hasOwnProperty("orderTitle")&&(s.orderTitle=A.orderTitle,r.oneofs&&(s._orderTitle="orderTitle")),A.sellerJid!=null&&A.hasOwnProperty("sellerJid")&&(s.sellerJid=A.sellerJid,r.oneofs&&(s._sellerJid="sellerJid")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=A.token,r.oneofs&&(s._token="token")),A.totalAmount1000!=null&&A.hasOwnProperty("totalAmount1000")&&(typeof A.totalAmount1000=="number"?s.totalAmount1000=r.longs===String?String(A.totalAmount1000):A.totalAmount1000:s.totalAmount1000=r.longs===String?ge(A.totalAmount1000):r.longs===Number?ce(A.totalAmount1000):A.totalAmount1000,r.oneofs&&(s._totalAmount1000="totalAmount1000")),A.totalCurrencyCode!=null&&A.hasOwnProperty("totalCurrencyCode")&&(s.totalCurrencyCode=A.totalCurrencyCode,r.oneofs&&(s._totalCurrencyCode="totalCurrencyCode")),A.messageVersion!=null&&A.hasOwnProperty("messageVersion")&&(s.messageVersion=A.messageVersion,r.oneofs&&(s._messageVersion="messageVersion")),A.orderRequestMessageId!=null&&A.hasOwnProperty("orderRequestMessageId")&&(s.orderRequestMessageId=d.proto.MessageKey.toObject(A.orderRequestMessageId,r),r.oneofs&&(s._orderRequestMessageId="orderRequestMessageId")),A.catalogType!=null&&A.hasOwnProperty("catalogType")&&(s.catalogType=A.catalogType,r.oneofs&&(s._catalogType="catalogType")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.OrderMessage"},a.OrderStatus=(function(){let i={},A=Object.create(i);return A[i[1]="INQUIRY"]=1,A[i[2]="ACCEPTED"]=2,A[i[3]="DECLINED"]=3,A})(),a.OrderSurface=(function(){let i={},A=Object.create(i);return A[i[1]="CATALOG"]=1,A})(),a})(),t.PaymentExtendedMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.type=A.uint32();break}case 2:{c.platform=A.string();break}case 3:{c.messageParamsJson=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PaymentExtendedMetadata)return A;var r=new d.proto.Message.PaymentExtendedMetadata;return A.type!=null&&(r.type=A.type>>>0),A.platform!=null&&(r.platform=String(A.platform)),A.messageParamsJson!=null&&(r.messageParamsJson=String(A.messageParamsJson)),r},a.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=A.type,r.oneofs&&(s._type="type")),A.platform!=null&&A.hasOwnProperty("platform")&&(s.platform=A.platform,r.oneofs&&(s._platform="platform")),A.messageParamsJson!=null&&A.hasOwnProperty("messageParamsJson")&&(s.messageParamsJson=A.messageParamsJson,r.oneofs&&(s._messageParamsJson="messageParamsJson")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentExtendedMetadata"},a})(),t.PaymentInviteMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.serviceType=A.int32();break}case 2:{c.expiryTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PaymentInviteMessage)return A;var r=new d.proto.Message.PaymentInviteMessage;switch(A.serviceType){default:if(typeof A.serviceType=="number"){r.serviceType=A.serviceType;break}break;case"UNKNOWN":case 0:r.serviceType=0;break;case"FBPAY":case 1:r.serviceType=1;break;case"NOVI":case 2:r.serviceType=2;break;case"UPI":case 3:r.serviceType=3;break}return A.expiryTimestamp!=null&&(l.Long?(r.expiryTimestamp=l.Long.fromValue(A.expiryTimestamp)).unsigned=!1:typeof A.expiryTimestamp=="string"?r.expiryTimestamp=parseInt(A.expiryTimestamp,10):typeof A.expiryTimestamp=="number"?r.expiryTimestamp=A.expiryTimestamp:typeof A.expiryTimestamp=="object"&&(r.expiryTimestamp=new l.LongBits(A.expiryTimestamp.low>>>0,A.expiryTimestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.serviceType!=null&&A.hasOwnProperty("serviceType")&&(s.serviceType=r.enums===String?d.proto.Message.PaymentInviteMessage.ServiceType[A.serviceType]===void 0?A.serviceType:d.proto.Message.PaymentInviteMessage.ServiceType[A.serviceType]:A.serviceType,r.oneofs&&(s._serviceType="serviceType")),A.expiryTimestamp!=null&&A.hasOwnProperty("expiryTimestamp")&&(typeof A.expiryTimestamp=="number"?s.expiryTimestamp=r.longs===String?String(A.expiryTimestamp):A.expiryTimestamp:s.expiryTimestamp=r.longs===String?ge(A.expiryTimestamp):r.longs===Number?ce(A.expiryTimestamp):A.expiryTimestamp,r.oneofs&&(s._expiryTimestamp="expiryTimestamp")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentInviteMessage"},a.ServiceType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="FBPAY"]=1,A[i[2]="NOVI"]=2,A[i[3]="UPI"]=3,A})(),a})(),t.PaymentLinkMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.button=d.proto.Message.PaymentLinkMetadata.PaymentLinkButton.decode(A,A.uint32());break}case 2:{c.header=d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.decode(A,A.uint32());break}case 3:{c.provider=d.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PaymentLinkMetadata)return A;var r=new d.proto.Message.PaymentLinkMetadata;if(A.button!=null){if(typeof A.button!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.button: object expected");r.button=d.proto.Message.PaymentLinkMetadata.PaymentLinkButton.fromObject(A.button)}if(A.header!=null){if(typeof A.header!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.header: object expected");r.header=d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.fromObject(A.header)}if(A.provider!=null){if(typeof A.provider!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.provider: object expected");r.provider=d.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.fromObject(A.provider)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.button!=null&&A.hasOwnProperty("button")&&(s.button=d.proto.Message.PaymentLinkMetadata.PaymentLinkButton.toObject(A.button,r),r.oneofs&&(s._button="button")),A.header!=null&&A.hasOwnProperty("header")&&(s.header=d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.toObject(A.header,r),r.oneofs&&(s._header="header")),A.provider!=null&&A.hasOwnProperty("provider")&&(s.provider=d.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.toObject(A.provider,r),r.oneofs&&(s._provider="provider")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentLinkMetadata"},a.PaymentLinkButton=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.displayText=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PaymentLinkMetadata.PaymentLinkButton)return s;var g=new d.proto.Message.PaymentLinkMetadata.PaymentLinkButton;return s.displayText!=null&&(g.displayText=String(s.displayText)),g},i.toObject=function(s,g){g||(g={});var c={};return s.displayText!=null&&s.hasOwnProperty("displayText")&&(c.displayText=s.displayText,g.oneofs&&(c._displayText="displayText")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkButton"},i})(),a.PaymentLinkHeader=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.headerType=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader)return s;var g=new d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader;switch(s.headerType){default:if(typeof s.headerType=="number"){g.headerType=s.headerType;break}break;case"LINK_PREVIEW":case 0:g.headerType=0;break;case"ORDER":case 1:g.headerType=1;break}return g},i.toObject=function(s,g){g||(g={});var c={};return s.headerType!=null&&s.hasOwnProperty("headerType")&&(c.headerType=g.enums===String?d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[s.headerType]===void 0?s.headerType:d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[s.headerType]:s.headerType,g.oneofs&&(c._headerType="headerType")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkHeader"},i.PaymentLinkHeaderType=(function(){let r={},s=Object.create(r);return s[r[0]="LINK_PREVIEW"]=0,s[r[1]="ORDER"]=1,s})(),i})(),a.PaymentLinkProvider=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.paramsJson=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PaymentLinkMetadata.PaymentLinkProvider)return s;var g=new d.proto.Message.PaymentLinkMetadata.PaymentLinkProvider;return s.paramsJson!=null&&(g.paramsJson=String(s.paramsJson)),g},i.toObject=function(s,g){g||(g={});var c={};return s.paramsJson!=null&&s.hasOwnProperty("paramsJson")&&(c.paramsJson=s.paramsJson,g.oneofs&&(c._paramsJson="paramsJson")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkProvider"},i})(),a})(),t.PeerDataOperationRequestMessage=(function(){function a(i){if(this.requestStickerReupload=[],this.requestUrlPreview=[],this.placeholderMessageResendRequest=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.peerDataOperationRequestType=A.int32();break}case 2:{c.requestStickerReupload&&c.requestStickerReupload.length||(c.requestStickerReupload=[]),c.requestStickerReupload.push(d.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload.decode(A,A.uint32()));break}case 3:{c.requestUrlPreview&&c.requestUrlPreview.length||(c.requestUrlPreview=[]),c.requestUrlPreview.push(d.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.decode(A,A.uint32()));break}case 4:{c.historySyncOnDemandRequest=d.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.decode(A,A.uint32());break}case 5:{c.placeholderMessageResendRequest&&c.placeholderMessageResendRequest.length||(c.placeholderMessageResendRequest=[]),c.placeholderMessageResendRequest.push(d.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.decode(A,A.uint32()));break}case 6:{c.fullHistorySyncOnDemandRequest=d.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.decode(A,A.uint32());break}case 7:{c.syncdCollectionFatalRecoveryRequest=d.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest.decode(A,A.uint32());break}case 8:{c.historySyncChunkRetryRequest=d.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest.decode(A,A.uint32());break}case 9:{c.galaxyFlowAction=d.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PeerDataOperationRequestMessage)return A;var r=new d.proto.Message.PeerDataOperationRequestMessage;switch(A.peerDataOperationRequestType){default:if(typeof A.peerDataOperationRequestType=="number"){r.peerDataOperationRequestType=A.peerDataOperationRequestType;break}break;case"UPLOAD_STICKER":case 0:r.peerDataOperationRequestType=0;break;case"SEND_RECENT_STICKER_BOOTSTRAP":case 1:r.peerDataOperationRequestType=1;break;case"GENERATE_LINK_PREVIEW":case 2:r.peerDataOperationRequestType=2;break;case"HISTORY_SYNC_ON_DEMAND":case 3:r.peerDataOperationRequestType=3;break;case"PLACEHOLDER_MESSAGE_RESEND":case 4:r.peerDataOperationRequestType=4;break;case"WAFFLE_LINKING_NONCE_FETCH":case 5:r.peerDataOperationRequestType=5;break;case"FULL_HISTORY_SYNC_ON_DEMAND":case 6:r.peerDataOperationRequestType=6;break;case"COMPANION_META_NONCE_FETCH":case 7:r.peerDataOperationRequestType=7;break;case"COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY":case 8:r.peerDataOperationRequestType=8;break;case"COMPANION_CANONICAL_USER_NONCE_FETCH":case 9:r.peerDataOperationRequestType=9;break;case"HISTORY_SYNC_CHUNK_RETRY":case 10:r.peerDataOperationRequestType=10;break;case"GALAXY_FLOW_ACTION":case 11:r.peerDataOperationRequestType=11;break}if(A.requestStickerReupload){if(!Array.isArray(A.requestStickerReupload))throw TypeError(".proto.Message.PeerDataOperationRequestMessage.requestStickerReupload: array expected");r.requestStickerReupload=[];for(var s=0;s>>3){case 1:{p.requestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(s,s.uint32());break}case 2:{p.historySyncConfig=d.proto.DeviceProps.HistorySyncConfig.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest;if(s.requestMetadata!=null){if(typeof s.requestMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.requestMetadata: object expected");g.requestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(s.requestMetadata)}if(s.historySyncConfig!=null){if(typeof s.historySyncConfig!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.historySyncConfig: object expected");g.historySyncConfig=d.proto.DeviceProps.HistorySyncConfig.fromObject(s.historySyncConfig)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.requestMetadata!=null&&s.hasOwnProperty("requestMetadata")&&(c.requestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(s.requestMetadata,g),g.oneofs&&(c._requestMetadata="requestMetadata")),s.historySyncConfig!=null&&s.hasOwnProperty("historySyncConfig")&&(c.historySyncConfig=d.proto.DeviceProps.HistorySyncConfig.toObject(s.historySyncConfig,g),g.oneofs&&(c._historySyncConfig="historySyncConfig")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest"},i})(),a.GalaxyFlowAction=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.type=s.int32();break}case 2:{p.flowId=s.string();break}case 3:{p.stanzaId=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction;switch(s.type){default:if(typeof s.type=="number"){g.type=s.type;break}break;case"NOTIFY_LAUNCH":case 1:g.type=1;break}return s.flowId!=null&&(g.flowId=String(s.flowId)),s.stanzaId!=null&&(g.stanzaId=String(s.stanzaId)),g},i.toObject=function(s,g){g||(g={});var c={};return s.type!=null&&s.hasOwnProperty("type")&&(c.type=g.enums===String?d.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.GalaxyFlowActionType[s.type]===void 0?s.type:d.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.GalaxyFlowActionType[s.type]:s.type,g.oneofs&&(c._type="type")),s.flowId!=null&&s.hasOwnProperty("flowId")&&(c.flowId=s.flowId,g.oneofs&&(c._flowId="flowId")),s.stanzaId!=null&&s.hasOwnProperty("stanzaId")&&(c.stanzaId=s.stanzaId,g.oneofs&&(c._stanzaId="stanzaId")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction"},i.GalaxyFlowActionType=(function(){let r={},s=Object.create(r);return s[r[1]="NOTIFY_LAUNCH"]=1,s})(),i})(),a.HistorySyncChunkRetryRequest=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.syncType=s.int32();break}case 2:{p.chunkOrder=s.uint32();break}case 3:{p.chunkNotificationId=s.string();break}case 4:{p.regenerateChunk=s.bool();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest;switch(s.syncType){default:if(typeof s.syncType=="number"){g.syncType=s.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:g.syncType=0;break;case"INITIAL_STATUS_V3":case 1:g.syncType=1;break;case"FULL":case 2:g.syncType=2;break;case"RECENT":case 3:g.syncType=3;break;case"PUSH_NAME":case 4:g.syncType=4;break;case"NON_BLOCKING_DATA":case 5:g.syncType=5;break;case"ON_DEMAND":case 6:g.syncType=6;break;case"NO_HISTORY":case 7:g.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:g.syncType=8;break}return s.chunkOrder!=null&&(g.chunkOrder=s.chunkOrder>>>0),s.chunkNotificationId!=null&&(g.chunkNotificationId=String(s.chunkNotificationId)),s.regenerateChunk!=null&&(g.regenerateChunk=!!s.regenerateChunk),g},i.toObject=function(s,g){g||(g={});var c={};return s.syncType!=null&&s.hasOwnProperty("syncType")&&(c.syncType=g.enums===String?d.proto.Message.HistorySyncType[s.syncType]===void 0?s.syncType:d.proto.Message.HistorySyncType[s.syncType]:s.syncType,g.oneofs&&(c._syncType="syncType")),s.chunkOrder!=null&&s.hasOwnProperty("chunkOrder")&&(c.chunkOrder=s.chunkOrder,g.oneofs&&(c._chunkOrder="chunkOrder")),s.chunkNotificationId!=null&&s.hasOwnProperty("chunkNotificationId")&&(c.chunkNotificationId=s.chunkNotificationId,g.oneofs&&(c._chunkNotificationId="chunkNotificationId")),s.regenerateChunk!=null&&s.hasOwnProperty("regenerateChunk")&&(c.regenerateChunk=s.regenerateChunk,g.oneofs&&(c._regenerateChunk="regenerateChunk")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest"},i})(),a.HistorySyncOnDemandRequest=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.chatJid=s.string();break}case 2:{p.oldestMsgId=s.string();break}case 3:{p.oldestMsgFromMe=s.bool();break}case 4:{p.onDemandMsgCount=s.int32();break}case 5:{p.oldestMsgTimestampMs=s.int64();break}case 6:{p.accountLid=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest;return s.chatJid!=null&&(g.chatJid=String(s.chatJid)),s.oldestMsgId!=null&&(g.oldestMsgId=String(s.oldestMsgId)),s.oldestMsgFromMe!=null&&(g.oldestMsgFromMe=!!s.oldestMsgFromMe),s.onDemandMsgCount!=null&&(g.onDemandMsgCount=s.onDemandMsgCount|0),s.oldestMsgTimestampMs!=null&&(l.Long?(g.oldestMsgTimestampMs=l.Long.fromValue(s.oldestMsgTimestampMs)).unsigned=!1:typeof s.oldestMsgTimestampMs=="string"?g.oldestMsgTimestampMs=parseInt(s.oldestMsgTimestampMs,10):typeof s.oldestMsgTimestampMs=="number"?g.oldestMsgTimestampMs=s.oldestMsgTimestampMs:typeof s.oldestMsgTimestampMs=="object"&&(g.oldestMsgTimestampMs=new l.LongBits(s.oldestMsgTimestampMs.low>>>0,s.oldestMsgTimestampMs.high>>>0).toNumber())),s.accountLid!=null&&(g.accountLid=String(s.accountLid)),g},i.toObject=function(s,g){g||(g={});var c={};return s.chatJid!=null&&s.hasOwnProperty("chatJid")&&(c.chatJid=s.chatJid,g.oneofs&&(c._chatJid="chatJid")),s.oldestMsgId!=null&&s.hasOwnProperty("oldestMsgId")&&(c.oldestMsgId=s.oldestMsgId,g.oneofs&&(c._oldestMsgId="oldestMsgId")),s.oldestMsgFromMe!=null&&s.hasOwnProperty("oldestMsgFromMe")&&(c.oldestMsgFromMe=s.oldestMsgFromMe,g.oneofs&&(c._oldestMsgFromMe="oldestMsgFromMe")),s.onDemandMsgCount!=null&&s.hasOwnProperty("onDemandMsgCount")&&(c.onDemandMsgCount=s.onDemandMsgCount,g.oneofs&&(c._onDemandMsgCount="onDemandMsgCount")),s.oldestMsgTimestampMs!=null&&s.hasOwnProperty("oldestMsgTimestampMs")&&(typeof s.oldestMsgTimestampMs=="number"?c.oldestMsgTimestampMs=g.longs===String?String(s.oldestMsgTimestampMs):s.oldestMsgTimestampMs:c.oldestMsgTimestampMs=g.longs===String?ge(s.oldestMsgTimestampMs):g.longs===Number?ce(s.oldestMsgTimestampMs):s.oldestMsgTimestampMs,g.oneofs&&(c._oldestMsgTimestampMs="oldestMsgTimestampMs")),s.accountLid!=null&&s.hasOwnProperty("accountLid")&&(c.accountLid=s.accountLid,g.oneofs&&(c._accountLid="accountLid")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest"},i})(),a.PlaceholderMessageResendRequest=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.messageKey=d.proto.MessageKey.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest;if(s.messageKey!=null){if(typeof s.messageKey!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.messageKey: object expected");g.messageKey=d.proto.MessageKey.fromObject(s.messageKey)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.messageKey!=null&&s.hasOwnProperty("messageKey")&&(c.messageKey=d.proto.MessageKey.toObject(s.messageKey,g),g.oneofs&&(c._messageKey="messageKey")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest"},i})(),a.RequestStickerReupload=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.fileSha256=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload;return s.fileSha256!=null&&(g.fileSha256=String(s.fileSha256)),g},i.toObject=function(s,g){g||(g={});var c={};return s.fileSha256!=null&&s.hasOwnProperty("fileSha256")&&(c.fileSha256=s.fileSha256,g.oneofs&&(c._fileSha256="fileSha256")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload"},i})(),a.RequestUrlPreview=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.url=s.string();break}case 2:{p.includeHqThumbnail=s.bool();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview;return s.url!=null&&(g.url=String(s.url)),s.includeHqThumbnail!=null&&(g.includeHqThumbnail=!!s.includeHqThumbnail),g},i.toObject=function(s,g){g||(g={});var c={};return s.url!=null&&s.hasOwnProperty("url")&&(c.url=s.url,g.oneofs&&(c._url="url")),s.includeHqThumbnail!=null&&s.hasOwnProperty("includeHqThumbnail")&&(c.includeHqThumbnail=s.includeHqThumbnail,g.oneofs&&(c._includeHqThumbnail="includeHqThumbnail")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview"},i})(),a.SyncDCollectionFatalRecoveryRequest=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.collectionName=s.string();break}case 2:{p.timestamp=s.int64();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest;return s.collectionName!=null&&(g.collectionName=String(s.collectionName)),s.timestamp!=null&&(l.Long?(g.timestamp=l.Long.fromValue(s.timestamp)).unsigned=!1:typeof s.timestamp=="string"?g.timestamp=parseInt(s.timestamp,10):typeof s.timestamp=="number"?g.timestamp=s.timestamp:typeof s.timestamp=="object"&&(g.timestamp=new l.LongBits(s.timestamp.low>>>0,s.timestamp.high>>>0).toNumber())),g},i.toObject=function(s,g){g||(g={});var c={};return s.collectionName!=null&&s.hasOwnProperty("collectionName")&&(c.collectionName=s.collectionName,g.oneofs&&(c._collectionName="collectionName")),s.timestamp!=null&&s.hasOwnProperty("timestamp")&&(typeof s.timestamp=="number"?c.timestamp=g.longs===String?String(s.timestamp):s.timestamp:c.timestamp=g.longs===String?ge(s.timestamp):g.longs===Number?ce(s.timestamp):s.timestamp,g.oneofs&&(c._timestamp="timestamp")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest"},i})(),a})(),t.PeerDataOperationRequestResponseMessage=(function(){function a(i){if(this.peerDataOperationResult=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.peerDataOperationRequestType=A.int32();break}case 2:{c.stanzaId=A.string();break}case 3:{c.peerDataOperationResult&&c.peerDataOperationResult.length||(c.peerDataOperationResult=[]),c.peerDataOperationResult.push(d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PeerDataOperationRequestResponseMessage)return A;var r=new d.proto.Message.PeerDataOperationRequestResponseMessage;switch(A.peerDataOperationRequestType){default:if(typeof A.peerDataOperationRequestType=="number"){r.peerDataOperationRequestType=A.peerDataOperationRequestType;break}break;case"UPLOAD_STICKER":case 0:r.peerDataOperationRequestType=0;break;case"SEND_RECENT_STICKER_BOOTSTRAP":case 1:r.peerDataOperationRequestType=1;break;case"GENERATE_LINK_PREVIEW":case 2:r.peerDataOperationRequestType=2;break;case"HISTORY_SYNC_ON_DEMAND":case 3:r.peerDataOperationRequestType=3;break;case"PLACEHOLDER_MESSAGE_RESEND":case 4:r.peerDataOperationRequestType=4;break;case"WAFFLE_LINKING_NONCE_FETCH":case 5:r.peerDataOperationRequestType=5;break;case"FULL_HISTORY_SYNC_ON_DEMAND":case 6:r.peerDataOperationRequestType=6;break;case"COMPANION_META_NONCE_FETCH":case 7:r.peerDataOperationRequestType=7;break;case"COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY":case 8:r.peerDataOperationRequestType=8;break;case"COMPANION_CANONICAL_USER_NONCE_FETCH":case 9:r.peerDataOperationRequestType=9;break;case"HISTORY_SYNC_CHUNK_RETRY":case 10:r.peerDataOperationRequestType=10;break;case"GALAXY_FLOW_ACTION":case 11:r.peerDataOperationRequestType=11;break}if(A.stanzaId!=null&&(r.stanzaId=String(A.stanzaId)),A.peerDataOperationResult){if(!Array.isArray(A.peerDataOperationResult))throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.peerDataOperationResult: array expected");r.peerDataOperationResult=[];for(var s=0;s>>3){case 1:{p.mediaUploadResult=s.int32();break}case 2:{p.stickerMessage=d.proto.Message.StickerMessage.decode(s,s.uint32());break}case 3:{p.linkPreviewResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.decode(s,s.uint32());break}case 4:{p.placeholderMessageResendResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.decode(s,s.uint32());break}case 5:{p.waffleNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.decode(s,s.uint32());break}case 6:{p.fullHistorySyncOnDemandRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.decode(s,s.uint32());break}case 7:{p.companionMetaNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.decode(s,s.uint32());break}case 8:{p.syncdSnapshotFatalRecoveryResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.decode(s,s.uint32());break}case 9:{p.companionCanonicalUserNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.decode(s,s.uint32());break}case 10:{p.historySyncChunkRetryResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult)return s;var g=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult;switch(s.mediaUploadResult){default:if(typeof s.mediaUploadResult=="number"){g.mediaUploadResult=s.mediaUploadResult;break}break;case"GENERAL_ERROR":case 0:g.mediaUploadResult=0;break;case"SUCCESS":case 1:g.mediaUploadResult=1;break;case"NOT_FOUND":case 2:g.mediaUploadResult=2;break;case"DECRYPTION_ERROR":case 3:g.mediaUploadResult=3;break}if(s.stickerMessage!=null){if(typeof s.stickerMessage!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.stickerMessage: object expected");g.stickerMessage=d.proto.Message.StickerMessage.fromObject(s.stickerMessage)}if(s.linkPreviewResponse!=null){if(typeof s.linkPreviewResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.linkPreviewResponse: object expected");g.linkPreviewResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.fromObject(s.linkPreviewResponse)}if(s.placeholderMessageResendResponse!=null){if(typeof s.placeholderMessageResendResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.placeholderMessageResendResponse: object expected");g.placeholderMessageResendResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.fromObject(s.placeholderMessageResendResponse)}if(s.waffleNonceFetchRequestResponse!=null){if(typeof s.waffleNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.waffleNonceFetchRequestResponse: object expected");g.waffleNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.fromObject(s.waffleNonceFetchRequestResponse)}if(s.fullHistorySyncOnDemandRequestResponse!=null){if(typeof s.fullHistorySyncOnDemandRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.fullHistorySyncOnDemandRequestResponse: object expected");g.fullHistorySyncOnDemandRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.fromObject(s.fullHistorySyncOnDemandRequestResponse)}if(s.companionMetaNonceFetchRequestResponse!=null){if(typeof s.companionMetaNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.companionMetaNonceFetchRequestResponse: object expected");g.companionMetaNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.fromObject(s.companionMetaNonceFetchRequestResponse)}if(s.syncdSnapshotFatalRecoveryResponse!=null){if(typeof s.syncdSnapshotFatalRecoveryResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.syncdSnapshotFatalRecoveryResponse: object expected");g.syncdSnapshotFatalRecoveryResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.fromObject(s.syncdSnapshotFatalRecoveryResponse)}if(s.companionCanonicalUserNonceFetchRequestResponse!=null){if(typeof s.companionCanonicalUserNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.companionCanonicalUserNonceFetchRequestResponse: object expected");g.companionCanonicalUserNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.fromObject(s.companionCanonicalUserNonceFetchRequestResponse)}if(s.historySyncChunkRetryResponse!=null){if(typeof s.historySyncChunkRetryResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.historySyncChunkRetryResponse: object expected");g.historySyncChunkRetryResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.fromObject(s.historySyncChunkRetryResponse)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.mediaUploadResult!=null&&s.hasOwnProperty("mediaUploadResult")&&(c.mediaUploadResult=g.enums===String?d.proto.MediaRetryNotification.ResultType[s.mediaUploadResult]===void 0?s.mediaUploadResult:d.proto.MediaRetryNotification.ResultType[s.mediaUploadResult]:s.mediaUploadResult,g.oneofs&&(c._mediaUploadResult="mediaUploadResult")),s.stickerMessage!=null&&s.hasOwnProperty("stickerMessage")&&(c.stickerMessage=d.proto.Message.StickerMessage.toObject(s.stickerMessage,g),g.oneofs&&(c._stickerMessage="stickerMessage")),s.linkPreviewResponse!=null&&s.hasOwnProperty("linkPreviewResponse")&&(c.linkPreviewResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.toObject(s.linkPreviewResponse,g),g.oneofs&&(c._linkPreviewResponse="linkPreviewResponse")),s.placeholderMessageResendResponse!=null&&s.hasOwnProperty("placeholderMessageResendResponse")&&(c.placeholderMessageResendResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.toObject(s.placeholderMessageResendResponse,g),g.oneofs&&(c._placeholderMessageResendResponse="placeholderMessageResendResponse")),s.waffleNonceFetchRequestResponse!=null&&s.hasOwnProperty("waffleNonceFetchRequestResponse")&&(c.waffleNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.toObject(s.waffleNonceFetchRequestResponse,g),g.oneofs&&(c._waffleNonceFetchRequestResponse="waffleNonceFetchRequestResponse")),s.fullHistorySyncOnDemandRequestResponse!=null&&s.hasOwnProperty("fullHistorySyncOnDemandRequestResponse")&&(c.fullHistorySyncOnDemandRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.toObject(s.fullHistorySyncOnDemandRequestResponse,g),g.oneofs&&(c._fullHistorySyncOnDemandRequestResponse="fullHistorySyncOnDemandRequestResponse")),s.companionMetaNonceFetchRequestResponse!=null&&s.hasOwnProperty("companionMetaNonceFetchRequestResponse")&&(c.companionMetaNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.toObject(s.companionMetaNonceFetchRequestResponse,g),g.oneofs&&(c._companionMetaNonceFetchRequestResponse="companionMetaNonceFetchRequestResponse")),s.syncdSnapshotFatalRecoveryResponse!=null&&s.hasOwnProperty("syncdSnapshotFatalRecoveryResponse")&&(c.syncdSnapshotFatalRecoveryResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.toObject(s.syncdSnapshotFatalRecoveryResponse,g),g.oneofs&&(c._syncdSnapshotFatalRecoveryResponse="syncdSnapshotFatalRecoveryResponse")),s.companionCanonicalUserNonceFetchRequestResponse!=null&&s.hasOwnProperty("companionCanonicalUserNonceFetchRequestResponse")&&(c.companionCanonicalUserNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.toObject(s.companionCanonicalUserNonceFetchRequestResponse,g),g.oneofs&&(c._companionCanonicalUserNonceFetchRequestResponse="companionCanonicalUserNonceFetchRequestResponse")),s.historySyncChunkRetryResponse!=null&&s.hasOwnProperty("historySyncChunkRetryResponse")&&(c.historySyncChunkRetryResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.toObject(s.historySyncChunkRetryResponse,g),g.oneofs&&(c._historySyncChunkRetryResponse="historySyncChunkRetryResponse")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult"},i.CompanionCanonicalUserNonceFetchResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}case 2:{f.waFbid=c.string();break}case 3:{f.forceRefresh=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),c.waFbid!=null&&(I.waFbid=String(c.waFbid)),c.forceRefresh!=null&&(I.forceRefresh=!!c.forceRefresh),I},r.toObject=function(c,I){I||(I={});var p={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(p.nonce=c.nonce,I.oneofs&&(p._nonce="nonce")),c.waFbid!=null&&c.hasOwnProperty("waFbid")&&(p.waFbid=c.waFbid,I.oneofs&&(p._waFbid="waFbid")),c.forceRefresh!=null&&c.hasOwnProperty("forceRefresh")&&(p.forceRefresh=c.forceRefresh,I.oneofs&&(p._forceRefresh="forceRefresh")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse"},r})(),i.CompanionMetaNonceFetchResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),I},r.toObject=function(c,I){I||(I={});var p={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(p.nonce=c.nonce,I.oneofs&&(p._nonce="nonce")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse"},r})(),i.FullHistorySyncOnDemandRequestResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.requestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(c,c.uint32());break}case 2:{f.responseCode=c.int32();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse;if(c.requestMetadata!=null){if(typeof c.requestMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.requestMetadata: object expected");I.requestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(c.requestMetadata)}switch(c.responseCode){default:if(typeof c.responseCode=="number"){I.responseCode=c.responseCode;break}break;case"REQUEST_SUCCESS":case 0:I.responseCode=0;break;case"REQUEST_TIME_EXPIRED":case 1:I.responseCode=1;break;case"DECLINED_SHARING_HISTORY":case 2:I.responseCode=2;break;case"GENERIC_ERROR":case 3:I.responseCode=3;break;case"ERROR_REQUEST_ON_NON_SMB_PRIMARY":case 4:I.responseCode=4;break;case"ERROR_HOSTED_DEVICE_NOT_CONNECTED":case 5:I.responseCode=5;break;case"ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET":case 6:I.responseCode=6;break}return I},r.toObject=function(c,I){I||(I={});var p={};return c.requestMetadata!=null&&c.hasOwnProperty("requestMetadata")&&(p.requestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(c.requestMetadata,I),I.oneofs&&(p._requestMetadata="requestMetadata")),c.responseCode!=null&&c.hasOwnProperty("responseCode")&&(p.responseCode=I.enums===String?d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[c.responseCode]===void 0?c.responseCode:d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[c.responseCode]:c.responseCode,I.oneofs&&(p._responseCode="responseCode")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse"},r})(),i.FullHistorySyncOnDemandResponseCode=(function(){let r={},s=Object.create(r);return s[r[0]="REQUEST_SUCCESS"]=0,s[r[1]="REQUEST_TIME_EXPIRED"]=1,s[r[2]="DECLINED_SHARING_HISTORY"]=2,s[r[3]="GENERIC_ERROR"]=3,s[r[4]="ERROR_REQUEST_ON_NON_SMB_PRIMARY"]=4,s[r[5]="ERROR_HOSTED_DEVICE_NOT_CONNECTED"]=5,s[r[6]="ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET"]=6,s})(),i.HistorySyncChunkRetryResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.syncType=c.int32();break}case 2:{f.chunkOrder=c.uint32();break}case 3:{f.requestId=c.string();break}case 4:{f.responseCode=c.int32();break}case 5:{f.canRecover=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse;switch(c.syncType){default:if(typeof c.syncType=="number"){I.syncType=c.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:I.syncType=0;break;case"INITIAL_STATUS_V3":case 1:I.syncType=1;break;case"FULL":case 2:I.syncType=2;break;case"RECENT":case 3:I.syncType=3;break;case"PUSH_NAME":case 4:I.syncType=4;break;case"NON_BLOCKING_DATA":case 5:I.syncType=5;break;case"ON_DEMAND":case 6:I.syncType=6;break;case"NO_HISTORY":case 7:I.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:I.syncType=8;break}switch(c.chunkOrder!=null&&(I.chunkOrder=c.chunkOrder>>>0),c.requestId!=null&&(I.requestId=String(c.requestId)),c.responseCode){default:if(typeof c.responseCode=="number"){I.responseCode=c.responseCode;break}break;case"GENERATION_ERROR":case 1:I.responseCode=1;break;case"CHUNK_CONSUMED":case 2:I.responseCode=2;break;case"TIMEOUT":case 3:I.responseCode=3;break;case"SESSION_EXHAUSTED":case 4:I.responseCode=4;break;case"CHUNK_EXHAUSTED":case 5:I.responseCode=5;break;case"DUPLICATED_REQUEST":case 6:I.responseCode=6;break}return c.canRecover!=null&&(I.canRecover=!!c.canRecover),I},r.toObject=function(c,I){I||(I={});var p={};return c.syncType!=null&&c.hasOwnProperty("syncType")&&(p.syncType=I.enums===String?d.proto.Message.HistorySyncType[c.syncType]===void 0?c.syncType:d.proto.Message.HistorySyncType[c.syncType]:c.syncType,I.oneofs&&(p._syncType="syncType")),c.chunkOrder!=null&&c.hasOwnProperty("chunkOrder")&&(p.chunkOrder=c.chunkOrder,I.oneofs&&(p._chunkOrder="chunkOrder")),c.requestId!=null&&c.hasOwnProperty("requestId")&&(p.requestId=c.requestId,I.oneofs&&(p._requestId="requestId")),c.responseCode!=null&&c.hasOwnProperty("responseCode")&&(p.responseCode=I.enums===String?d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponseCode[c.responseCode]===void 0?c.responseCode:d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponseCode[c.responseCode]:c.responseCode,I.oneofs&&(p._responseCode="responseCode")),c.canRecover!=null&&c.hasOwnProperty("canRecover")&&(p.canRecover=c.canRecover,I.oneofs&&(p._canRecover="canRecover")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse"},r})(),i.HistorySyncChunkRetryResponseCode=(function(){let r={},s=Object.create(r);return s[r[1]="GENERATION_ERROR"]=1,s[r[2]="CHUNK_CONSUMED"]=2,s[r[3]="TIMEOUT"]=3,s[r[4]="SESSION_EXHAUSTED"]=4,s[r[5]="CHUNK_EXHAUSTED"]=5,s[r[6]="DUPLICATED_REQUEST"]=6,s})(),i.LinkPreviewResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.url=c.string();break}case 2:{f.title=c.string();break}case 3:{f.description=c.string();break}case 4:{f.thumbData=c.bytes();break}case 6:{f.matchText=c.string();break}case 7:{f.previewType=c.string();break}case 8:{f.hqThumbnail=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.decode(c,c.uint32());break}case 9:{f.previewMetadata=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.decode(c,c.uint32());break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse;if(c.url!=null&&(I.url=String(c.url)),c.title!=null&&(I.title=String(c.title)),c.description!=null&&(I.description=String(c.description)),c.thumbData!=null&&(typeof c.thumbData=="string"?l.base64.decode(c.thumbData,I.thumbData=l.newBuffer(l.base64.length(c.thumbData)),0):c.thumbData.length>=0&&(I.thumbData=c.thumbData)),c.matchText!=null&&(I.matchText=String(c.matchText)),c.previewType!=null&&(I.previewType=String(c.previewType)),c.hqThumbnail!=null){if(typeof c.hqThumbnail!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.hqThumbnail: object expected");I.hqThumbnail=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.fromObject(c.hqThumbnail)}if(c.previewMetadata!=null){if(typeof c.previewMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.previewMetadata: object expected");I.previewMetadata=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.fromObject(c.previewMetadata)}return I},r.toObject=function(c,I){I||(I={});var p={};return c.url!=null&&c.hasOwnProperty("url")&&(p.url=c.url,I.oneofs&&(p._url="url")),c.title!=null&&c.hasOwnProperty("title")&&(p.title=c.title,I.oneofs&&(p._title="title")),c.description!=null&&c.hasOwnProperty("description")&&(p.description=c.description,I.oneofs&&(p._description="description")),c.thumbData!=null&&c.hasOwnProperty("thumbData")&&(p.thumbData=I.bytes===String?l.base64.encode(c.thumbData,0,c.thumbData.length):I.bytes===Array?Array.prototype.slice.call(c.thumbData):c.thumbData,I.oneofs&&(p._thumbData="thumbData")),c.matchText!=null&&c.hasOwnProperty("matchText")&&(p.matchText=c.matchText,I.oneofs&&(p._matchText="matchText")),c.previewType!=null&&c.hasOwnProperty("previewType")&&(p.previewType=c.previewType,I.oneofs&&(p._previewType="previewType")),c.hqThumbnail!=null&&c.hasOwnProperty("hqThumbnail")&&(p.hqThumbnail=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.toObject(c.hqThumbnail,I),I.oneofs&&(p._hqThumbnail="hqThumbnail")),c.previewMetadata!=null&&c.hasOwnProperty("previewMetadata")&&(p.previewMetadata=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.toObject(c.previewMetadata,I),I.oneofs&&(p._previewMetadata="previewMetadata")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse"},r.LinkPreviewHighQualityThumbnail=(function(){function g(I){if(I)for(var p=Object.keys(I),B=0;B>>3){case 1:{y.directPath=p.string();break}case 2:{y.thumbHash=p.string();break}case 3:{y.encThumbHash=p.string();break}case 4:{y.mediaKey=p.bytes();break}case 5:{y.mediaKeyTimestampMs=p.int64();break}case 6:{y.thumbWidth=p.int32();break}case 7:{y.thumbHeight=p.int32();break}default:p.skipType(m&7);break}}return y},g.fromObject=function(p){if(p instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail)return p;var B=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail;return p.directPath!=null&&(B.directPath=String(p.directPath)),p.thumbHash!=null&&(B.thumbHash=String(p.thumbHash)),p.encThumbHash!=null&&(B.encThumbHash=String(p.encThumbHash)),p.mediaKey!=null&&(typeof p.mediaKey=="string"?l.base64.decode(p.mediaKey,B.mediaKey=l.newBuffer(l.base64.length(p.mediaKey)),0):p.mediaKey.length>=0&&(B.mediaKey=p.mediaKey)),p.mediaKeyTimestampMs!=null&&(l.Long?(B.mediaKeyTimestampMs=l.Long.fromValue(p.mediaKeyTimestampMs)).unsigned=!1:typeof p.mediaKeyTimestampMs=="string"?B.mediaKeyTimestampMs=parseInt(p.mediaKeyTimestampMs,10):typeof p.mediaKeyTimestampMs=="number"?B.mediaKeyTimestampMs=p.mediaKeyTimestampMs:typeof p.mediaKeyTimestampMs=="object"&&(B.mediaKeyTimestampMs=new l.LongBits(p.mediaKeyTimestampMs.low>>>0,p.mediaKeyTimestampMs.high>>>0).toNumber())),p.thumbWidth!=null&&(B.thumbWidth=p.thumbWidth|0),p.thumbHeight!=null&&(B.thumbHeight=p.thumbHeight|0),B},g.toObject=function(p,B){B||(B={});var f={};return p.directPath!=null&&p.hasOwnProperty("directPath")&&(f.directPath=p.directPath,B.oneofs&&(f._directPath="directPath")),p.thumbHash!=null&&p.hasOwnProperty("thumbHash")&&(f.thumbHash=p.thumbHash,B.oneofs&&(f._thumbHash="thumbHash")),p.encThumbHash!=null&&p.hasOwnProperty("encThumbHash")&&(f.encThumbHash=p.encThumbHash,B.oneofs&&(f._encThumbHash="encThumbHash")),p.mediaKey!=null&&p.hasOwnProperty("mediaKey")&&(f.mediaKey=B.bytes===String?l.base64.encode(p.mediaKey,0,p.mediaKey.length):B.bytes===Array?Array.prototype.slice.call(p.mediaKey):p.mediaKey,B.oneofs&&(f._mediaKey="mediaKey")),p.mediaKeyTimestampMs!=null&&p.hasOwnProperty("mediaKeyTimestampMs")&&(typeof p.mediaKeyTimestampMs=="number"?f.mediaKeyTimestampMs=B.longs===String?String(p.mediaKeyTimestampMs):p.mediaKeyTimestampMs:f.mediaKeyTimestampMs=B.longs===String?ge(p.mediaKeyTimestampMs):B.longs===Number?ce(p.mediaKeyTimestampMs):p.mediaKeyTimestampMs,B.oneofs&&(f._mediaKeyTimestampMs="mediaKeyTimestampMs")),p.thumbWidth!=null&&p.hasOwnProperty("thumbWidth")&&(f.thumbWidth=p.thumbWidth,B.oneofs&&(f._thumbWidth="thumbWidth")),p.thumbHeight!=null&&p.hasOwnProperty("thumbHeight")&&(f.thumbHeight=p.thumbHeight,B.oneofs&&(f._thumbHeight="thumbHeight")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(p){return p===void 0&&(p="type.googleapis.com"),p+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail"},g})(),r.PaymentLinkPreviewMetadata=(function(){function g(I){if(I)for(var p=Object.keys(I),B=0;B>>3){case 1:{y.isBusinessVerified=p.bool();break}case 2:{y.providerName=p.string();break}default:p.skipType(m&7);break}}return y},g.fromObject=function(p){if(p instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata)return p;var B=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata;return p.isBusinessVerified!=null&&(B.isBusinessVerified=!!p.isBusinessVerified),p.providerName!=null&&(B.providerName=String(p.providerName)),B},g.toObject=function(p,B){B||(B={});var f={};return p.isBusinessVerified!=null&&p.hasOwnProperty("isBusinessVerified")&&(f.isBusinessVerified=p.isBusinessVerified,B.oneofs&&(f._isBusinessVerified="isBusinessVerified")),p.providerName!=null&&p.hasOwnProperty("providerName")&&(f.providerName=p.providerName,B.oneofs&&(f._providerName="providerName")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(p){return p===void 0&&(p="type.googleapis.com"),p+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata"},g})(),r})(),i.PlaceholderMessageResendResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.webMessageInfoBytes=c.bytes();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse;return c.webMessageInfoBytes!=null&&(typeof c.webMessageInfoBytes=="string"?l.base64.decode(c.webMessageInfoBytes,I.webMessageInfoBytes=l.newBuffer(l.base64.length(c.webMessageInfoBytes)),0):c.webMessageInfoBytes.length>=0&&(I.webMessageInfoBytes=c.webMessageInfoBytes)),I},r.toObject=function(c,I){I||(I={});var p={};return c.webMessageInfoBytes!=null&&c.hasOwnProperty("webMessageInfoBytes")&&(p.webMessageInfoBytes=I.bytes===String?l.base64.encode(c.webMessageInfoBytes,0,c.webMessageInfoBytes.length):I.bytes===Array?Array.prototype.slice.call(c.webMessageInfoBytes):c.webMessageInfoBytes,I.oneofs&&(p._webMessageInfoBytes="webMessageInfoBytes")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse"},r})(),i.SyncDSnapshotFatalRecoveryResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.collectionSnapshot=c.bytes();break}case 2:{f.isCompressed=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse;return c.collectionSnapshot!=null&&(typeof c.collectionSnapshot=="string"?l.base64.decode(c.collectionSnapshot,I.collectionSnapshot=l.newBuffer(l.base64.length(c.collectionSnapshot)),0):c.collectionSnapshot.length>=0&&(I.collectionSnapshot=c.collectionSnapshot)),c.isCompressed!=null&&(I.isCompressed=!!c.isCompressed),I},r.toObject=function(c,I){I||(I={});var p={};return c.collectionSnapshot!=null&&c.hasOwnProperty("collectionSnapshot")&&(p.collectionSnapshot=I.bytes===String?l.base64.encode(c.collectionSnapshot,0,c.collectionSnapshot.length):I.bytes===Array?Array.prototype.slice.call(c.collectionSnapshot):c.collectionSnapshot,I.oneofs&&(p._collectionSnapshot="collectionSnapshot")),c.isCompressed!=null&&c.hasOwnProperty("isCompressed")&&(p.isCompressed=c.isCompressed,I.oneofs&&(p._isCompressed="isCompressed")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse"},r})(),i.WaffleNonceFetchResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}case 2:{f.waEntFbid=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),c.waEntFbid!=null&&(I.waEntFbid=String(c.waEntFbid)),I},r.toObject=function(c,I){I||(I={});var p={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(p.nonce=c.nonce,I.oneofs&&(p._nonce="nonce")),c.waEntFbid!=null&&c.hasOwnProperty("waEntFbid")&&(p.waEntFbid=c.waEntFbid,I.oneofs&&(p._waEntFbid="waEntFbid")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse"},r})(),i})(),a})(),t.PeerDataOperationRequestType=(function(){let a={},e=Object.create(a);return e[a[0]="UPLOAD_STICKER"]=0,e[a[1]="SEND_RECENT_STICKER_BOOTSTRAP"]=1,e[a[2]="GENERATE_LINK_PREVIEW"]=2,e[a[3]="HISTORY_SYNC_ON_DEMAND"]=3,e[a[4]="PLACEHOLDER_MESSAGE_RESEND"]=4,e[a[5]="WAFFLE_LINKING_NONCE_FETCH"]=5,e[a[6]="FULL_HISTORY_SYNC_ON_DEMAND"]=6,e[a[7]="COMPANION_META_NONCE_FETCH"]=7,e[a[8]="COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY"]=8,e[a[9]="COMPANION_CANONICAL_USER_NONCE_FETCH"]=9,e[a[10]="HISTORY_SYNC_CHUNK_RETRY"]=10,e[a[11]="GALAXY_FLOW_ACTION"]=11,e})(),t.PinInChatMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.type=A.int32();break}case 3:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PinInChatMessage)return A;var r=new d.proto.Message.PinInChatMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.PinInChatMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN_TYPE":case 0:r.type=0;break;case"PIN_FOR_ALL":case 1:r.type=1;break;case"UNPIN_FOR_ALL":case 2:r.type=2;break}return A.senderTimestampMs!=null&&(l.Long?(r.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?r.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?r.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(r.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.PinInChatMessage.Type[A.type]===void 0?A.type:d.proto.Message.PinInChatMessage.Type[A.type]:A.type,r.oneofs&&(s._type="type")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=r.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=r.longs===String?ge(A.senderTimestampMs):r.longs===Number?ce(A.senderTimestampMs):A.senderTimestampMs,r.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PinInChatMessage"},a.Type=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN_TYPE"]=0,A[i[1]="PIN_FOR_ALL"]=1,A[i[2]="UNPIN_FOR_ALL"]=2,A})(),a})(),t.PlaceholderMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PlaceholderMessage)return A;var r=new d.proto.Message.PlaceholderMessage;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"MASK_LINKED_DEVICES":case 0:r.type=0;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.PlaceholderMessage.PlaceholderType[A.type]===void 0?A.type:d.proto.Message.PlaceholderMessage.PlaceholderType[A.type]:A.type,r.oneofs&&(s._type="type")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PlaceholderMessage"},a.PlaceholderType=(function(){let i={},A=Object.create(i);return A[i[0]="MASK_LINKED_DEVICES"]=0,A})(),a})(),t.PollContentType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="TEXT"]=1,e[a[2]="IMAGE"]=2,e})(),t.PollCreationMessage=(function(){function a(i){if(this.options=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.encKey=A.bytes();break}case 2:{c.name=A.string();break}case 3:{c.options&&c.options.length||(c.options=[]),c.options.push(d.proto.Message.PollCreationMessage.Option.decode(A,A.uint32()));break}case 4:{c.selectableOptionsCount=A.uint32();break}case 5:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 6:{c.pollContentType=A.int32();break}case 7:{c.pollType=A.int32();break}case 8:{c.correctAnswer=d.proto.Message.PollCreationMessage.Option.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PollCreationMessage)return A;var r=new d.proto.Message.PollCreationMessage;if(A.encKey!=null&&(typeof A.encKey=="string"?l.base64.decode(A.encKey,r.encKey=l.newBuffer(l.base64.length(A.encKey)),0):A.encKey.length>=0&&(r.encKey=A.encKey)),A.name!=null&&(r.name=String(A.name)),A.options){if(!Array.isArray(A.options))throw TypeError(".proto.Message.PollCreationMessage.options: array expected");r.options=[];for(var s=0;s>>0),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.PollCreationMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.pollContentType){default:if(typeof A.pollContentType=="number"){r.pollContentType=A.pollContentType;break}break;case"UNKNOWN":case 0:r.pollContentType=0;break;case"TEXT":case 1:r.pollContentType=1;break;case"IMAGE":case 2:r.pollContentType=2;break}switch(A.pollType){default:if(typeof A.pollType=="number"){r.pollType=A.pollType;break}break;case"POLL":case 0:r.pollType=0;break;case"QUIZ":case 1:r.pollType=1;break}if(A.correctAnswer!=null){if(typeof A.correctAnswer!="object")throw TypeError(".proto.Message.PollCreationMessage.correctAnswer: object expected");r.correctAnswer=d.proto.Message.PollCreationMessage.Option.fromObject(A.correctAnswer)}return r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.options=[]),A.encKey!=null&&A.hasOwnProperty("encKey")&&(s.encKey=r.bytes===String?l.base64.encode(A.encKey,0,A.encKey.length):r.bytes===Array?Array.prototype.slice.call(A.encKey):A.encKey,r.oneofs&&(s._encKey="encKey")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.options&&A.options.length){s.options=[];for(var g=0;g>>3){case 1:{p.optionName=s.string();break}case 2:{p.optionHash=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PollCreationMessage.Option)return s;var g=new d.proto.Message.PollCreationMessage.Option;return s.optionName!=null&&(g.optionName=String(s.optionName)),s.optionHash!=null&&(g.optionHash=String(s.optionHash)),g},i.toObject=function(s,g){g||(g={});var c={};return s.optionName!=null&&s.hasOwnProperty("optionName")&&(c.optionName=s.optionName,g.oneofs&&(c._optionName="optionName")),s.optionHash!=null&&s.hasOwnProperty("optionHash")&&(c.optionHash=s.optionHash,g.oneofs&&(c._optionHash="optionHash")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PollCreationMessage.Option"},i})(),a})(),t.PollEncValue=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.encPayload=A.bytes();break}case 2:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PollEncValue)return A;var r=new d.proto.Message.PollEncValue;return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},a.toObject=function(A,r){r||(r={});var s={};return A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PollEncValue"},a})(),t.PollResultSnapshotMessage=(function(){function a(i){if(this.pollVotes=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.pollVotes&&c.pollVotes.length||(c.pollVotes=[]),c.pollVotes.push(d.proto.Message.PollResultSnapshotMessage.PollVote.decode(A,A.uint32()));break}case 3:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.pollType=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PollResultSnapshotMessage)return A;var r=new d.proto.Message.PollResultSnapshotMessage;if(A.name!=null&&(r.name=String(A.name)),A.pollVotes){if(!Array.isArray(A.pollVotes))throw TypeError(".proto.Message.PollResultSnapshotMessage.pollVotes: array expected");r.pollVotes=[];for(var s=0;s>>3){case 1:{p.optionName=s.string();break}case 2:{p.optionVoteCount=s.int64();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PollResultSnapshotMessage.PollVote)return s;var g=new d.proto.Message.PollResultSnapshotMessage.PollVote;return s.optionName!=null&&(g.optionName=String(s.optionName)),s.optionVoteCount!=null&&(l.Long?(g.optionVoteCount=l.Long.fromValue(s.optionVoteCount)).unsigned=!1:typeof s.optionVoteCount=="string"?g.optionVoteCount=parseInt(s.optionVoteCount,10):typeof s.optionVoteCount=="number"?g.optionVoteCount=s.optionVoteCount:typeof s.optionVoteCount=="object"&&(g.optionVoteCount=new l.LongBits(s.optionVoteCount.low>>>0,s.optionVoteCount.high>>>0).toNumber())),g},i.toObject=function(s,g){g||(g={});var c={};return s.optionName!=null&&s.hasOwnProperty("optionName")&&(c.optionName=s.optionName,g.oneofs&&(c._optionName="optionName")),s.optionVoteCount!=null&&s.hasOwnProperty("optionVoteCount")&&(typeof s.optionVoteCount=="number"?c.optionVoteCount=g.longs===String?String(s.optionVoteCount):s.optionVoteCount:c.optionVoteCount=g.longs===String?ge(s.optionVoteCount):g.longs===Number?ce(s.optionVoteCount):s.optionVoteCount,g.oneofs&&(c._optionVoteCount="optionVoteCount")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PollResultSnapshotMessage.PollVote"},i})(),a})(),t.PollType=(function(){let a={},e=Object.create(a);return e[a[0]="POLL"]=0,e[a[1]="QUIZ"]=1,e})(),t.PollUpdateMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.pollCreationMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.vote=d.proto.Message.PollEncValue.decode(A,A.uint32());break}case 3:{c.metadata=d.proto.Message.PollUpdateMessageMetadata.decode(A,A.uint32());break}case 4:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PollUpdateMessage)return A;var r=new d.proto.Message.PollUpdateMessage;if(A.pollCreationMessageKey!=null){if(typeof A.pollCreationMessageKey!="object")throw TypeError(".proto.Message.PollUpdateMessage.pollCreationMessageKey: object expected");r.pollCreationMessageKey=d.proto.MessageKey.fromObject(A.pollCreationMessageKey)}if(A.vote!=null){if(typeof A.vote!="object")throw TypeError(".proto.Message.PollUpdateMessage.vote: object expected");r.vote=d.proto.Message.PollEncValue.fromObject(A.vote)}if(A.metadata!=null){if(typeof A.metadata!="object")throw TypeError(".proto.Message.PollUpdateMessage.metadata: object expected");r.metadata=d.proto.Message.PollUpdateMessageMetadata.fromObject(A.metadata)}return A.senderTimestampMs!=null&&(l.Long?(r.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?r.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?r.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(r.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.pollCreationMessageKey!=null&&A.hasOwnProperty("pollCreationMessageKey")&&(s.pollCreationMessageKey=d.proto.MessageKey.toObject(A.pollCreationMessageKey,r),r.oneofs&&(s._pollCreationMessageKey="pollCreationMessageKey")),A.vote!=null&&A.hasOwnProperty("vote")&&(s.vote=d.proto.Message.PollEncValue.toObject(A.vote,r),r.oneofs&&(s._vote="vote")),A.metadata!=null&&A.hasOwnProperty("metadata")&&(s.metadata=d.proto.Message.PollUpdateMessageMetadata.toObject(A.metadata,r),r.oneofs&&(s._metadata="metadata")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=r.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=r.longs===String?ge(A.senderTimestampMs):r.longs===Number?ce(A.senderTimestampMs):A.senderTimestampMs,r.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PollUpdateMessage"},a})(),t.PollUpdateMessageMetadata=(function(){function a(e){if(e)for(var i=Object.keys(e),A=0;A>>3){default:i.skipType(c&7);break}}return g},a.fromObject=function(i){return i instanceof d.proto.Message.PollUpdateMessageMetadata?i:new d.proto.Message.PollUpdateMessageMetadata},a.toObject=function(){return{}},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.Message.PollUpdateMessageMetadata"},a})(),t.PollVoteMessage=(function(){function a(e){if(this.selectedOptions=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.selectedOptions&&g.selectedOptions.length||(g.selectedOptions=[]),g.selectedOptions.push(i.bytes());break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.Message.PollVoteMessage)return i;var A=new d.proto.Message.PollVoteMessage;if(i.selectedOptions){if(!Array.isArray(i.selectedOptions))throw TypeError(".proto.Message.PollVoteMessage.selectedOptions: array expected");A.selectedOptions=[];for(var r=0;r=0&&(A.selectedOptions[r]=i.selectedOptions[r])}return A},a.toObject=function(i,A){A||(A={});var r={};if((A.arrays||A.defaults)&&(r.selectedOptions=[]),i.selectedOptions&&i.selectedOptions.length){r.selectedOptions=[];for(var s=0;s>>3){case 1:{c.product=d.proto.Message.ProductMessage.ProductSnapshot.decode(A,A.uint32());break}case 2:{c.businessOwnerJid=A.string();break}case 4:{c.catalog=d.proto.Message.ProductMessage.CatalogSnapshot.decode(A,A.uint32());break}case 5:{c.body=A.string();break}case 6:{c.footer=A.string();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ProductMessage)return A;var r=new d.proto.Message.ProductMessage;if(A.product!=null){if(typeof A.product!="object")throw TypeError(".proto.Message.ProductMessage.product: object expected");r.product=d.proto.Message.ProductMessage.ProductSnapshot.fromObject(A.product)}if(A.businessOwnerJid!=null&&(r.businessOwnerJid=String(A.businessOwnerJid)),A.catalog!=null){if(typeof A.catalog!="object")throw TypeError(".proto.Message.ProductMessage.catalog: object expected");r.catalog=d.proto.Message.ProductMessage.CatalogSnapshot.fromObject(A.catalog)}if(A.body!=null&&(r.body=String(A.body)),A.footer!=null&&(r.footer=String(A.footer)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ProductMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.product!=null&&A.hasOwnProperty("product")&&(s.product=d.proto.Message.ProductMessage.ProductSnapshot.toObject(A.product,r),r.oneofs&&(s._product="product")),A.businessOwnerJid!=null&&A.hasOwnProperty("businessOwnerJid")&&(s.businessOwnerJid=A.businessOwnerJid,r.oneofs&&(s._businessOwnerJid="businessOwnerJid")),A.catalog!=null&&A.hasOwnProperty("catalog")&&(s.catalog=d.proto.Message.ProductMessage.CatalogSnapshot.toObject(A.catalog,r),r.oneofs&&(s._catalog="catalog")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,r.oneofs&&(s._body="body")),A.footer!=null&&A.hasOwnProperty("footer")&&(s.footer=A.footer,r.oneofs&&(s._footer="footer")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ProductMessage"},a.CatalogSnapshot=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.catalogImage=d.proto.Message.ImageMessage.decode(s,s.uint32());break}case 2:{p.title=s.string();break}case 3:{p.description=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ProductMessage.CatalogSnapshot)return s;var g=new d.proto.Message.ProductMessage.CatalogSnapshot;if(s.catalogImage!=null){if(typeof s.catalogImage!="object")throw TypeError(".proto.Message.ProductMessage.CatalogSnapshot.catalogImage: object expected");g.catalogImage=d.proto.Message.ImageMessage.fromObject(s.catalogImage)}return s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),g},i.toObject=function(s,g){g||(g={});var c={};return s.catalogImage!=null&&s.hasOwnProperty("catalogImage")&&(c.catalogImage=d.proto.Message.ImageMessage.toObject(s.catalogImage,g),g.oneofs&&(c._catalogImage="catalogImage")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ProductMessage.CatalogSnapshot"},i})(),a.ProductSnapshot=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.productImage=d.proto.Message.ImageMessage.decode(s,s.uint32());break}case 2:{p.productId=s.string();break}case 3:{p.title=s.string();break}case 4:{p.description=s.string();break}case 5:{p.currencyCode=s.string();break}case 6:{p.priceAmount1000=s.int64();break}case 7:{p.retailerId=s.string();break}case 8:{p.url=s.string();break}case 9:{p.productImageCount=s.uint32();break}case 11:{p.firstImageId=s.string();break}case 12:{p.salePriceAmount1000=s.int64();break}case 13:{p.signedUrl=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ProductMessage.ProductSnapshot)return s;var g=new d.proto.Message.ProductMessage.ProductSnapshot;if(s.productImage!=null){if(typeof s.productImage!="object")throw TypeError(".proto.Message.ProductMessage.ProductSnapshot.productImage: object expected");g.productImage=d.proto.Message.ImageMessage.fromObject(s.productImage)}return s.productId!=null&&(g.productId=String(s.productId)),s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.currencyCode!=null&&(g.currencyCode=String(s.currencyCode)),s.priceAmount1000!=null&&(l.Long?(g.priceAmount1000=l.Long.fromValue(s.priceAmount1000)).unsigned=!1:typeof s.priceAmount1000=="string"?g.priceAmount1000=parseInt(s.priceAmount1000,10):typeof s.priceAmount1000=="number"?g.priceAmount1000=s.priceAmount1000:typeof s.priceAmount1000=="object"&&(g.priceAmount1000=new l.LongBits(s.priceAmount1000.low>>>0,s.priceAmount1000.high>>>0).toNumber())),s.retailerId!=null&&(g.retailerId=String(s.retailerId)),s.url!=null&&(g.url=String(s.url)),s.productImageCount!=null&&(g.productImageCount=s.productImageCount>>>0),s.firstImageId!=null&&(g.firstImageId=String(s.firstImageId)),s.salePriceAmount1000!=null&&(l.Long?(g.salePriceAmount1000=l.Long.fromValue(s.salePriceAmount1000)).unsigned=!1:typeof s.salePriceAmount1000=="string"?g.salePriceAmount1000=parseInt(s.salePriceAmount1000,10):typeof s.salePriceAmount1000=="number"?g.salePriceAmount1000=s.salePriceAmount1000:typeof s.salePriceAmount1000=="object"&&(g.salePriceAmount1000=new l.LongBits(s.salePriceAmount1000.low>>>0,s.salePriceAmount1000.high>>>0).toNumber())),s.signedUrl!=null&&(g.signedUrl=String(s.signedUrl)),g},i.toObject=function(s,g){g||(g={});var c={};return s.productImage!=null&&s.hasOwnProperty("productImage")&&(c.productImage=d.proto.Message.ImageMessage.toObject(s.productImage,g),g.oneofs&&(c._productImage="productImage")),s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.currencyCode!=null&&s.hasOwnProperty("currencyCode")&&(c.currencyCode=s.currencyCode,g.oneofs&&(c._currencyCode="currencyCode")),s.priceAmount1000!=null&&s.hasOwnProperty("priceAmount1000")&&(typeof s.priceAmount1000=="number"?c.priceAmount1000=g.longs===String?String(s.priceAmount1000):s.priceAmount1000:c.priceAmount1000=g.longs===String?ge(s.priceAmount1000):g.longs===Number?ce(s.priceAmount1000):s.priceAmount1000,g.oneofs&&(c._priceAmount1000="priceAmount1000")),s.retailerId!=null&&s.hasOwnProperty("retailerId")&&(c.retailerId=s.retailerId,g.oneofs&&(c._retailerId="retailerId")),s.url!=null&&s.hasOwnProperty("url")&&(c.url=s.url,g.oneofs&&(c._url="url")),s.productImageCount!=null&&s.hasOwnProperty("productImageCount")&&(c.productImageCount=s.productImageCount,g.oneofs&&(c._productImageCount="productImageCount")),s.firstImageId!=null&&s.hasOwnProperty("firstImageId")&&(c.firstImageId=s.firstImageId,g.oneofs&&(c._firstImageId="firstImageId")),s.salePriceAmount1000!=null&&s.hasOwnProperty("salePriceAmount1000")&&(typeof s.salePriceAmount1000=="number"?c.salePriceAmount1000=g.longs===String?String(s.salePriceAmount1000):s.salePriceAmount1000:c.salePriceAmount1000=g.longs===String?ge(s.salePriceAmount1000):g.longs===Number?ce(s.salePriceAmount1000):s.salePriceAmount1000,g.oneofs&&(c._salePriceAmount1000="salePriceAmount1000")),s.signedUrl!=null&&s.hasOwnProperty("signedUrl")&&(c.signedUrl=s.signedUrl,g.oneofs&&(c._signedUrl="signedUrl")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ProductMessage.ProductSnapshot"},i})(),a})(),t.ProtocolMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.type=A.int32();break}case 4:{c.ephemeralExpiration=A.uint32();break}case 5:{c.ephemeralSettingTimestamp=A.int64();break}case 6:{c.historySyncNotification=d.proto.Message.HistorySyncNotification.decode(A,A.uint32());break}case 7:{c.appStateSyncKeyShare=d.proto.Message.AppStateSyncKeyShare.decode(A,A.uint32());break}case 8:{c.appStateSyncKeyRequest=d.proto.Message.AppStateSyncKeyRequest.decode(A,A.uint32());break}case 9:{c.initialSecurityNotificationSettingSync=d.proto.Message.InitialSecurityNotificationSettingSync.decode(A,A.uint32());break}case 10:{c.appStateFatalExceptionNotification=d.proto.Message.AppStateFatalExceptionNotification.decode(A,A.uint32());break}case 11:{c.disappearingMode=d.proto.DisappearingMode.decode(A,A.uint32());break}case 14:{c.editedMessage=d.proto.Message.decode(A,A.uint32());break}case 15:{c.timestampMs=A.int64();break}case 16:{c.peerDataOperationRequestMessage=d.proto.Message.PeerDataOperationRequestMessage.decode(A,A.uint32());break}case 17:{c.peerDataOperationRequestResponseMessage=d.proto.Message.PeerDataOperationRequestResponseMessage.decode(A,A.uint32());break}case 18:{c.botFeedbackMessage=d.proto.BotFeedbackMessage.decode(A,A.uint32());break}case 19:{c.invokerJid=A.string();break}case 20:{c.requestWelcomeMessageMetadata=d.proto.Message.RequestWelcomeMessageMetadata.decode(A,A.uint32());break}case 21:{c.mediaNotifyMessage=d.proto.MediaNotifyMessage.decode(A,A.uint32());break}case 22:{c.cloudApiThreadControlNotification=d.proto.Message.CloudAPIThreadControlNotification.decode(A,A.uint32());break}case 23:{c.lidMigrationMappingSyncMessage=d.proto.LIDMigrationMappingSyncMessage.decode(A,A.uint32());break}case 24:{c.limitSharing=d.proto.LimitSharing.decode(A,A.uint32());break}case 25:{c.aiPsiMetadata=A.bytes();break}case 26:{c.aiQueryFanout=d.proto.AIQueryFanout.decode(A,A.uint32());break}case 27:{c.memberLabel=d.proto.MemberLabel.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ProtocolMessage)return A;var r=new d.proto.Message.ProtocolMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ProtocolMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"REVOKE":case 0:r.type=0;break;case"EPHEMERAL_SETTING":case 3:r.type=3;break;case"EPHEMERAL_SYNC_RESPONSE":case 4:r.type=4;break;case"HISTORY_SYNC_NOTIFICATION":case 5:r.type=5;break;case"APP_STATE_SYNC_KEY_SHARE":case 6:r.type=6;break;case"APP_STATE_SYNC_KEY_REQUEST":case 7:r.type=7;break;case"MSG_FANOUT_BACKFILL_REQUEST":case 8:r.type=8;break;case"INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC":case 9:r.type=9;break;case"APP_STATE_FATAL_EXCEPTION_NOTIFICATION":case 10:r.type=10;break;case"SHARE_PHONE_NUMBER":case 11:r.type=11;break;case"MESSAGE_EDIT":case 14:r.type=14;break;case"PEER_DATA_OPERATION_REQUEST_MESSAGE":case 16:r.type=16;break;case"PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE":case 17:r.type=17;break;case"REQUEST_WELCOME_MESSAGE":case 18:r.type=18;break;case"BOT_FEEDBACK_MESSAGE":case 19:r.type=19;break;case"MEDIA_NOTIFY_MESSAGE":case 20:r.type=20;break;case"CLOUD_API_THREAD_CONTROL_NOTIFICATION":case 21:r.type=21;break;case"LID_MIGRATION_MAPPING_SYNC":case 22:r.type=22;break;case"REMINDER_MESSAGE":case 23:r.type=23;break;case"BOT_MEMU_ONBOARDING_MESSAGE":case 24:r.type=24;break;case"STATUS_MENTION_MESSAGE":case 25:r.type=25;break;case"STOP_GENERATION_MESSAGE":case 26:r.type=26;break;case"LIMIT_SHARING":case 27:r.type=27;break;case"AI_PSI_METADATA":case 28:r.type=28;break;case"AI_QUERY_FANOUT":case 29:r.type=29;break;case"GROUP_MEMBER_LABEL_CHANGE":case 30:r.type=30;break}if(A.ephemeralExpiration!=null&&(r.ephemeralExpiration=A.ephemeralExpiration>>>0),A.ephemeralSettingTimestamp!=null&&(l.Long?(r.ephemeralSettingTimestamp=l.Long.fromValue(A.ephemeralSettingTimestamp)).unsigned=!1:typeof A.ephemeralSettingTimestamp=="string"?r.ephemeralSettingTimestamp=parseInt(A.ephemeralSettingTimestamp,10):typeof A.ephemeralSettingTimestamp=="number"?r.ephemeralSettingTimestamp=A.ephemeralSettingTimestamp:typeof A.ephemeralSettingTimestamp=="object"&&(r.ephemeralSettingTimestamp=new l.LongBits(A.ephemeralSettingTimestamp.low>>>0,A.ephemeralSettingTimestamp.high>>>0).toNumber())),A.historySyncNotification!=null){if(typeof A.historySyncNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.historySyncNotification: object expected");r.historySyncNotification=d.proto.Message.HistorySyncNotification.fromObject(A.historySyncNotification)}if(A.appStateSyncKeyShare!=null){if(typeof A.appStateSyncKeyShare!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyShare: object expected");r.appStateSyncKeyShare=d.proto.Message.AppStateSyncKeyShare.fromObject(A.appStateSyncKeyShare)}if(A.appStateSyncKeyRequest!=null){if(typeof A.appStateSyncKeyRequest!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyRequest: object expected");r.appStateSyncKeyRequest=d.proto.Message.AppStateSyncKeyRequest.fromObject(A.appStateSyncKeyRequest)}if(A.initialSecurityNotificationSettingSync!=null){if(typeof A.initialSecurityNotificationSettingSync!="object")throw TypeError(".proto.Message.ProtocolMessage.initialSecurityNotificationSettingSync: object expected");r.initialSecurityNotificationSettingSync=d.proto.Message.InitialSecurityNotificationSettingSync.fromObject(A.initialSecurityNotificationSettingSync)}if(A.appStateFatalExceptionNotification!=null){if(typeof A.appStateFatalExceptionNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateFatalExceptionNotification: object expected");r.appStateFatalExceptionNotification=d.proto.Message.AppStateFatalExceptionNotification.fromObject(A.appStateFatalExceptionNotification)}if(A.disappearingMode!=null){if(typeof A.disappearingMode!="object")throw TypeError(".proto.Message.ProtocolMessage.disappearingMode: object expected");r.disappearingMode=d.proto.DisappearingMode.fromObject(A.disappearingMode)}if(A.editedMessage!=null){if(typeof A.editedMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.editedMessage: object expected");r.editedMessage=d.proto.Message.fromObject(A.editedMessage)}if(A.timestampMs!=null&&(l.Long?(r.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?r.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?r.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(r.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),A.peerDataOperationRequestMessage!=null){if(typeof A.peerDataOperationRequestMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestMessage: object expected");r.peerDataOperationRequestMessage=d.proto.Message.PeerDataOperationRequestMessage.fromObject(A.peerDataOperationRequestMessage)}if(A.peerDataOperationRequestResponseMessage!=null){if(typeof A.peerDataOperationRequestResponseMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestResponseMessage: object expected");r.peerDataOperationRequestResponseMessage=d.proto.Message.PeerDataOperationRequestResponseMessage.fromObject(A.peerDataOperationRequestResponseMessage)}if(A.botFeedbackMessage!=null){if(typeof A.botFeedbackMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.botFeedbackMessage: object expected");r.botFeedbackMessage=d.proto.BotFeedbackMessage.fromObject(A.botFeedbackMessage)}if(A.invokerJid!=null&&(r.invokerJid=String(A.invokerJid)),A.requestWelcomeMessageMetadata!=null){if(typeof A.requestWelcomeMessageMetadata!="object")throw TypeError(".proto.Message.ProtocolMessage.requestWelcomeMessageMetadata: object expected");r.requestWelcomeMessageMetadata=d.proto.Message.RequestWelcomeMessageMetadata.fromObject(A.requestWelcomeMessageMetadata)}if(A.mediaNotifyMessage!=null){if(typeof A.mediaNotifyMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.mediaNotifyMessage: object expected");r.mediaNotifyMessage=d.proto.MediaNotifyMessage.fromObject(A.mediaNotifyMessage)}if(A.cloudApiThreadControlNotification!=null){if(typeof A.cloudApiThreadControlNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.cloudApiThreadControlNotification: object expected");r.cloudApiThreadControlNotification=d.proto.Message.CloudAPIThreadControlNotification.fromObject(A.cloudApiThreadControlNotification)}if(A.lidMigrationMappingSyncMessage!=null){if(typeof A.lidMigrationMappingSyncMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.lidMigrationMappingSyncMessage: object expected");r.lidMigrationMappingSyncMessage=d.proto.LIDMigrationMappingSyncMessage.fromObject(A.lidMigrationMappingSyncMessage)}if(A.limitSharing!=null){if(typeof A.limitSharing!="object")throw TypeError(".proto.Message.ProtocolMessage.limitSharing: object expected");r.limitSharing=d.proto.LimitSharing.fromObject(A.limitSharing)}if(A.aiPsiMetadata!=null&&(typeof A.aiPsiMetadata=="string"?l.base64.decode(A.aiPsiMetadata,r.aiPsiMetadata=l.newBuffer(l.base64.length(A.aiPsiMetadata)),0):A.aiPsiMetadata.length>=0&&(r.aiPsiMetadata=A.aiPsiMetadata)),A.aiQueryFanout!=null){if(typeof A.aiQueryFanout!="object")throw TypeError(".proto.Message.ProtocolMessage.aiQueryFanout: object expected");r.aiQueryFanout=d.proto.AIQueryFanout.fromObject(A.aiQueryFanout)}if(A.memberLabel!=null){if(typeof A.memberLabel!="object")throw TypeError(".proto.Message.ProtocolMessage.memberLabel: object expected");r.memberLabel=d.proto.MemberLabel.fromObject(A.memberLabel)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.ProtocolMessage.Type[A.type]===void 0?A.type:d.proto.Message.ProtocolMessage.Type[A.type]:A.type,r.oneofs&&(s._type="type")),A.ephemeralExpiration!=null&&A.hasOwnProperty("ephemeralExpiration")&&(s.ephemeralExpiration=A.ephemeralExpiration,r.oneofs&&(s._ephemeralExpiration="ephemeralExpiration")),A.ephemeralSettingTimestamp!=null&&A.hasOwnProperty("ephemeralSettingTimestamp")&&(typeof A.ephemeralSettingTimestamp=="number"?s.ephemeralSettingTimestamp=r.longs===String?String(A.ephemeralSettingTimestamp):A.ephemeralSettingTimestamp:s.ephemeralSettingTimestamp=r.longs===String?ge(A.ephemeralSettingTimestamp):r.longs===Number?ce(A.ephemeralSettingTimestamp):A.ephemeralSettingTimestamp,r.oneofs&&(s._ephemeralSettingTimestamp="ephemeralSettingTimestamp")),A.historySyncNotification!=null&&A.hasOwnProperty("historySyncNotification")&&(s.historySyncNotification=d.proto.Message.HistorySyncNotification.toObject(A.historySyncNotification,r),r.oneofs&&(s._historySyncNotification="historySyncNotification")),A.appStateSyncKeyShare!=null&&A.hasOwnProperty("appStateSyncKeyShare")&&(s.appStateSyncKeyShare=d.proto.Message.AppStateSyncKeyShare.toObject(A.appStateSyncKeyShare,r),r.oneofs&&(s._appStateSyncKeyShare="appStateSyncKeyShare")),A.appStateSyncKeyRequest!=null&&A.hasOwnProperty("appStateSyncKeyRequest")&&(s.appStateSyncKeyRequest=d.proto.Message.AppStateSyncKeyRequest.toObject(A.appStateSyncKeyRequest,r),r.oneofs&&(s._appStateSyncKeyRequest="appStateSyncKeyRequest")),A.initialSecurityNotificationSettingSync!=null&&A.hasOwnProperty("initialSecurityNotificationSettingSync")&&(s.initialSecurityNotificationSettingSync=d.proto.Message.InitialSecurityNotificationSettingSync.toObject(A.initialSecurityNotificationSettingSync,r),r.oneofs&&(s._initialSecurityNotificationSettingSync="initialSecurityNotificationSettingSync")),A.appStateFatalExceptionNotification!=null&&A.hasOwnProperty("appStateFatalExceptionNotification")&&(s.appStateFatalExceptionNotification=d.proto.Message.AppStateFatalExceptionNotification.toObject(A.appStateFatalExceptionNotification,r),r.oneofs&&(s._appStateFatalExceptionNotification="appStateFatalExceptionNotification")),A.disappearingMode!=null&&A.hasOwnProperty("disappearingMode")&&(s.disappearingMode=d.proto.DisappearingMode.toObject(A.disappearingMode,r),r.oneofs&&(s._disappearingMode="disappearingMode")),A.editedMessage!=null&&A.hasOwnProperty("editedMessage")&&(s.editedMessage=d.proto.Message.toObject(A.editedMessage,r),r.oneofs&&(s._editedMessage="editedMessage")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=r.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=r.longs===String?ge(A.timestampMs):r.longs===Number?ce(A.timestampMs):A.timestampMs,r.oneofs&&(s._timestampMs="timestampMs")),A.peerDataOperationRequestMessage!=null&&A.hasOwnProperty("peerDataOperationRequestMessage")&&(s.peerDataOperationRequestMessage=d.proto.Message.PeerDataOperationRequestMessage.toObject(A.peerDataOperationRequestMessage,r),r.oneofs&&(s._peerDataOperationRequestMessage="peerDataOperationRequestMessage")),A.peerDataOperationRequestResponseMessage!=null&&A.hasOwnProperty("peerDataOperationRequestResponseMessage")&&(s.peerDataOperationRequestResponseMessage=d.proto.Message.PeerDataOperationRequestResponseMessage.toObject(A.peerDataOperationRequestResponseMessage,r),r.oneofs&&(s._peerDataOperationRequestResponseMessage="peerDataOperationRequestResponseMessage")),A.botFeedbackMessage!=null&&A.hasOwnProperty("botFeedbackMessage")&&(s.botFeedbackMessage=d.proto.BotFeedbackMessage.toObject(A.botFeedbackMessage,r),r.oneofs&&(s._botFeedbackMessage="botFeedbackMessage")),A.invokerJid!=null&&A.hasOwnProperty("invokerJid")&&(s.invokerJid=A.invokerJid,r.oneofs&&(s._invokerJid="invokerJid")),A.requestWelcomeMessageMetadata!=null&&A.hasOwnProperty("requestWelcomeMessageMetadata")&&(s.requestWelcomeMessageMetadata=d.proto.Message.RequestWelcomeMessageMetadata.toObject(A.requestWelcomeMessageMetadata,r),r.oneofs&&(s._requestWelcomeMessageMetadata="requestWelcomeMessageMetadata")),A.mediaNotifyMessage!=null&&A.hasOwnProperty("mediaNotifyMessage")&&(s.mediaNotifyMessage=d.proto.MediaNotifyMessage.toObject(A.mediaNotifyMessage,r),r.oneofs&&(s._mediaNotifyMessage="mediaNotifyMessage")),A.cloudApiThreadControlNotification!=null&&A.hasOwnProperty("cloudApiThreadControlNotification")&&(s.cloudApiThreadControlNotification=d.proto.Message.CloudAPIThreadControlNotification.toObject(A.cloudApiThreadControlNotification,r),r.oneofs&&(s._cloudApiThreadControlNotification="cloudApiThreadControlNotification")),A.lidMigrationMappingSyncMessage!=null&&A.hasOwnProperty("lidMigrationMappingSyncMessage")&&(s.lidMigrationMappingSyncMessage=d.proto.LIDMigrationMappingSyncMessage.toObject(A.lidMigrationMappingSyncMessage,r),r.oneofs&&(s._lidMigrationMappingSyncMessage="lidMigrationMappingSyncMessage")),A.limitSharing!=null&&A.hasOwnProperty("limitSharing")&&(s.limitSharing=d.proto.LimitSharing.toObject(A.limitSharing,r),r.oneofs&&(s._limitSharing="limitSharing")),A.aiPsiMetadata!=null&&A.hasOwnProperty("aiPsiMetadata")&&(s.aiPsiMetadata=r.bytes===String?l.base64.encode(A.aiPsiMetadata,0,A.aiPsiMetadata.length):r.bytes===Array?Array.prototype.slice.call(A.aiPsiMetadata):A.aiPsiMetadata,r.oneofs&&(s._aiPsiMetadata="aiPsiMetadata")),A.aiQueryFanout!=null&&A.hasOwnProperty("aiQueryFanout")&&(s.aiQueryFanout=d.proto.AIQueryFanout.toObject(A.aiQueryFanout,r),r.oneofs&&(s._aiQueryFanout="aiQueryFanout")),A.memberLabel!=null&&A.hasOwnProperty("memberLabel")&&(s.memberLabel=d.proto.MemberLabel.toObject(A.memberLabel,r),r.oneofs&&(s._memberLabel="memberLabel")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ProtocolMessage"},a.Type=(function(){let i={},A=Object.create(i);return A[i[0]="REVOKE"]=0,A[i[3]="EPHEMERAL_SETTING"]=3,A[i[4]="EPHEMERAL_SYNC_RESPONSE"]=4,A[i[5]="HISTORY_SYNC_NOTIFICATION"]=5,A[i[6]="APP_STATE_SYNC_KEY_SHARE"]=6,A[i[7]="APP_STATE_SYNC_KEY_REQUEST"]=7,A[i[8]="MSG_FANOUT_BACKFILL_REQUEST"]=8,A[i[9]="INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC"]=9,A[i[10]="APP_STATE_FATAL_EXCEPTION_NOTIFICATION"]=10,A[i[11]="SHARE_PHONE_NUMBER"]=11,A[i[14]="MESSAGE_EDIT"]=14,A[i[16]="PEER_DATA_OPERATION_REQUEST_MESSAGE"]=16,A[i[17]="PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE"]=17,A[i[18]="REQUEST_WELCOME_MESSAGE"]=18,A[i[19]="BOT_FEEDBACK_MESSAGE"]=19,A[i[20]="MEDIA_NOTIFY_MESSAGE"]=20,A[i[21]="CLOUD_API_THREAD_CONTROL_NOTIFICATION"]=21,A[i[22]="LID_MIGRATION_MAPPING_SYNC"]=22,A[i[23]="REMINDER_MESSAGE"]=23,A[i[24]="BOT_MEMU_ONBOARDING_MESSAGE"]=24,A[i[25]="STATUS_MENTION_MESSAGE"]=25,A[i[26]="STOP_GENERATION_MESSAGE"]=26,A[i[27]="LIMIT_SHARING"]=27,A[i[28]="AI_PSI_METADATA"]=28,A[i[29]="AI_QUERY_FANOUT"]=29,A[i[30]="GROUP_MEMBER_LABEL_CHANGE"]=30,A})(),a})(),t.QuestionResponseMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.QuestionResponseMessage)return A;var r=new d.proto.Message.QuestionResponseMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.QuestionResponseMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(r.text=String(A.text)),r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.QuestionResponseMessage"},a})(),t.ReactionMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}case 3:{c.groupingKey=A.string();break}case 4:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ReactionMessage)return A;var r=new d.proto.Message.ReactionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ReactionMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(r.text=String(A.text)),A.groupingKey!=null&&(r.groupingKey=String(A.groupingKey)),A.senderTimestampMs!=null&&(l.Long?(r.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?r.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?r.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(r.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.groupingKey!=null&&A.hasOwnProperty("groupingKey")&&(s.groupingKey=A.groupingKey,r.oneofs&&(s._groupingKey="groupingKey")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=r.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=r.longs===String?ge(A.senderTimestampMs):r.longs===Number?ce(A.senderTimestampMs):A.senderTimestampMs,r.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ReactionMessage"},a})(),t.RequestPaymentMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 4:{c.noteMessage=d.proto.Message.decode(A,A.uint32());break}case 1:{c.currencyCodeIso4217=A.string();break}case 2:{c.amount1000=A.uint64();break}case 3:{c.requestFrom=A.string();break}case 5:{c.expiryTimestamp=A.int64();break}case 6:{c.amount=d.proto.Money.decode(A,A.uint32());break}case 7:{c.background=d.proto.PaymentBackground.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.RequestPaymentMessage)return A;var r=new d.proto.Message.RequestPaymentMessage;if(A.noteMessage!=null){if(typeof A.noteMessage!="object")throw TypeError(".proto.Message.RequestPaymentMessage.noteMessage: object expected");r.noteMessage=d.proto.Message.fromObject(A.noteMessage)}if(A.currencyCodeIso4217!=null&&(r.currencyCodeIso4217=String(A.currencyCodeIso4217)),A.amount1000!=null&&(l.Long?(r.amount1000=l.Long.fromValue(A.amount1000)).unsigned=!0:typeof A.amount1000=="string"?r.amount1000=parseInt(A.amount1000,10):typeof A.amount1000=="number"?r.amount1000=A.amount1000:typeof A.amount1000=="object"&&(r.amount1000=new l.LongBits(A.amount1000.low>>>0,A.amount1000.high>>>0).toNumber(!0))),A.requestFrom!=null&&(r.requestFrom=String(A.requestFrom)),A.expiryTimestamp!=null&&(l.Long?(r.expiryTimestamp=l.Long.fromValue(A.expiryTimestamp)).unsigned=!1:typeof A.expiryTimestamp=="string"?r.expiryTimestamp=parseInt(A.expiryTimestamp,10):typeof A.expiryTimestamp=="number"?r.expiryTimestamp=A.expiryTimestamp:typeof A.expiryTimestamp=="object"&&(r.expiryTimestamp=new l.LongBits(A.expiryTimestamp.low>>>0,A.expiryTimestamp.high>>>0).toNumber())),A.amount!=null){if(typeof A.amount!="object")throw TypeError(".proto.Message.RequestPaymentMessage.amount: object expected");r.amount=d.proto.Money.fromObject(A.amount)}if(A.background!=null){if(typeof A.background!="object")throw TypeError(".proto.Message.RequestPaymentMessage.background: object expected");r.background=d.proto.PaymentBackground.fromObject(A.background)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.currencyCodeIso4217!=null&&A.hasOwnProperty("currencyCodeIso4217")&&(s.currencyCodeIso4217=A.currencyCodeIso4217,r.oneofs&&(s._currencyCodeIso4217="currencyCodeIso4217")),A.amount1000!=null&&A.hasOwnProperty("amount1000")&&(typeof A.amount1000=="number"?s.amount1000=r.longs===String?String(A.amount1000):A.amount1000:s.amount1000=r.longs===String?ge(A.amount1000,!0):r.longs===Number?ce(A.amount1000,!0):A.amount1000,r.oneofs&&(s._amount1000="amount1000")),A.requestFrom!=null&&A.hasOwnProperty("requestFrom")&&(s.requestFrom=A.requestFrom,r.oneofs&&(s._requestFrom="requestFrom")),A.noteMessage!=null&&A.hasOwnProperty("noteMessage")&&(s.noteMessage=d.proto.Message.toObject(A.noteMessage,r),r.oneofs&&(s._noteMessage="noteMessage")),A.expiryTimestamp!=null&&A.hasOwnProperty("expiryTimestamp")&&(typeof A.expiryTimestamp=="number"?s.expiryTimestamp=r.longs===String?String(A.expiryTimestamp):A.expiryTimestamp:s.expiryTimestamp=r.longs===String?ge(A.expiryTimestamp):r.longs===Number?ce(A.expiryTimestamp):A.expiryTimestamp,r.oneofs&&(s._expiryTimestamp="expiryTimestamp")),A.amount!=null&&A.hasOwnProperty("amount")&&(s.amount=d.proto.Money.toObject(A.amount,r),r.oneofs&&(s._amount="amount")),A.background!=null&&A.hasOwnProperty("background")&&(s.background=d.proto.PaymentBackground.toObject(A.background,r),r.oneofs&&(s._background="background")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestPaymentMessage"},a})(),t.RequestPhoneNumberMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.RequestPhoneNumberMessage)return A;var r=new d.proto.Message.RequestPhoneNumberMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.RequestPhoneNumberMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestPhoneNumberMessage"},a})(),t.RequestWelcomeMessageMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.localChatState=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.RequestWelcomeMessageMetadata)return A;var r=new d.proto.Message.RequestWelcomeMessageMetadata;switch(A.localChatState){default:if(typeof A.localChatState=="number"){r.localChatState=A.localChatState;break}break;case"EMPTY":case 0:r.localChatState=0;break;case"NON_EMPTY":case 1:r.localChatState=1;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.localChatState!=null&&A.hasOwnProperty("localChatState")&&(s.localChatState=r.enums===String?d.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[A.localChatState]===void 0?A.localChatState:d.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[A.localChatState]:A.localChatState,r.oneofs&&(s._localChatState="localChatState")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestWelcomeMessageMetadata"},a.LocalChatState=(function(){let i={},A=Object.create(i);return A[i[0]="EMPTY"]=0,A[i[1]="NON_EMPTY"]=1,A})(),a})(),t.ScheduledCallCreationMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.scheduledTimestampMs=A.int64();break}case 2:{c.callType=A.int32();break}case 3:{c.title=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ScheduledCallCreationMessage)return A;var r=new d.proto.Message.ScheduledCallCreationMessage;switch(A.scheduledTimestampMs!=null&&(l.Long?(r.scheduledTimestampMs=l.Long.fromValue(A.scheduledTimestampMs)).unsigned=!1:typeof A.scheduledTimestampMs=="string"?r.scheduledTimestampMs=parseInt(A.scheduledTimestampMs,10):typeof A.scheduledTimestampMs=="number"?r.scheduledTimestampMs=A.scheduledTimestampMs:typeof A.scheduledTimestampMs=="object"&&(r.scheduledTimestampMs=new l.LongBits(A.scheduledTimestampMs.low>>>0,A.scheduledTimestampMs.high>>>0).toNumber())),A.callType){default:if(typeof A.callType=="number"){r.callType=A.callType;break}break;case"UNKNOWN":case 0:r.callType=0;break;case"VOICE":case 1:r.callType=1;break;case"VIDEO":case 2:r.callType=2;break}return A.title!=null&&(r.title=String(A.title)),r},a.toObject=function(A,r){r||(r={});var s={};return A.scheduledTimestampMs!=null&&A.hasOwnProperty("scheduledTimestampMs")&&(typeof A.scheduledTimestampMs=="number"?s.scheduledTimestampMs=r.longs===String?String(A.scheduledTimestampMs):A.scheduledTimestampMs:s.scheduledTimestampMs=r.longs===String?ge(A.scheduledTimestampMs):r.longs===Number?ce(A.scheduledTimestampMs):A.scheduledTimestampMs,r.oneofs&&(s._scheduledTimestampMs="scheduledTimestampMs")),A.callType!=null&&A.hasOwnProperty("callType")&&(s.callType=r.enums===String?d.proto.Message.ScheduledCallCreationMessage.CallType[A.callType]===void 0?A.callType:d.proto.Message.ScheduledCallCreationMessage.CallType[A.callType]:A.callType,r.oneofs&&(s._callType="callType")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ScheduledCallCreationMessage"},a.CallType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="VOICE"]=1,A[i[2]="VIDEO"]=2,A})(),a})(),t.ScheduledCallEditMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.editType=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ScheduledCallEditMessage)return A;var r=new d.proto.Message.ScheduledCallEditMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ScheduledCallEditMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}switch(A.editType){default:if(typeof A.editType=="number"){r.editType=A.editType;break}break;case"UNKNOWN":case 0:r.editType=0;break;case"CANCEL":case 1:r.editType=1;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.editType!=null&&A.hasOwnProperty("editType")&&(s.editType=r.enums===String?d.proto.Message.ScheduledCallEditMessage.EditType[A.editType]===void 0?A.editType:d.proto.Message.ScheduledCallEditMessage.EditType[A.editType]:A.editType,r.oneofs&&(s._editType="editType")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ScheduledCallEditMessage"},a.EditType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="CANCEL"]=1,A})(),a})(),t.SecretEncryptedMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.targetMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}case 4:{c.secretEncType=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.SecretEncryptedMessage)return A;var r=new d.proto.Message.SecretEncryptedMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.SecretEncryptedMessage.targetMessageKey: object expected");r.targetMessageKey=d.proto.MessageKey.fromObject(A.targetMessageKey)}switch(A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),A.secretEncType){default:if(typeof A.secretEncType=="number"){r.secretEncType=A.secretEncType;break}break;case"UNKNOWN":case 0:r.secretEncType=0;break;case"EVENT_EDIT":case 1:r.secretEncType=1;break;case"MESSAGE_EDIT":case 2:r.secretEncType=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=d.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),A.secretEncType!=null&&A.hasOwnProperty("secretEncType")&&(s.secretEncType=r.enums===String?d.proto.Message.SecretEncryptedMessage.SecretEncType[A.secretEncType]===void 0?A.secretEncType:d.proto.Message.SecretEncryptedMessage.SecretEncType[A.secretEncType]:A.secretEncType,r.oneofs&&(s._secretEncType="secretEncType")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SecretEncryptedMessage"},a.SecretEncType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="EVENT_EDIT"]=1,A[i[2]="MESSAGE_EDIT"]=2,A})(),a})(),t.SendPaymentMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 2:{c.noteMessage=d.proto.Message.decode(A,A.uint32());break}case 3:{c.requestMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 4:{c.background=d.proto.PaymentBackground.decode(A,A.uint32());break}case 5:{c.transactionData=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.SendPaymentMessage)return A;var r=new d.proto.Message.SendPaymentMessage;if(A.noteMessage!=null){if(typeof A.noteMessage!="object")throw TypeError(".proto.Message.SendPaymentMessage.noteMessage: object expected");r.noteMessage=d.proto.Message.fromObject(A.noteMessage)}if(A.requestMessageKey!=null){if(typeof A.requestMessageKey!="object")throw TypeError(".proto.Message.SendPaymentMessage.requestMessageKey: object expected");r.requestMessageKey=d.proto.MessageKey.fromObject(A.requestMessageKey)}if(A.background!=null){if(typeof A.background!="object")throw TypeError(".proto.Message.SendPaymentMessage.background: object expected");r.background=d.proto.PaymentBackground.fromObject(A.background)}return A.transactionData!=null&&(r.transactionData=String(A.transactionData)),r},a.toObject=function(A,r){r||(r={});var s={};return A.noteMessage!=null&&A.hasOwnProperty("noteMessage")&&(s.noteMessage=d.proto.Message.toObject(A.noteMessage,r),r.oneofs&&(s._noteMessage="noteMessage")),A.requestMessageKey!=null&&A.hasOwnProperty("requestMessageKey")&&(s.requestMessageKey=d.proto.MessageKey.toObject(A.requestMessageKey,r),r.oneofs&&(s._requestMessageKey="requestMessageKey")),A.background!=null&&A.hasOwnProperty("background")&&(s.background=d.proto.PaymentBackground.toObject(A.background,r),r.oneofs&&(s._background="background")),A.transactionData!=null&&A.hasOwnProperty("transactionData")&&(s.transactionData=A.transactionData,r.oneofs&&(s._transactionData="transactionData")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SendPaymentMessage"},a})(),t.SenderKeyDistributionMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.groupId=A.string();break}case 2:{c.axolotlSenderKeyDistributionMessage=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.SenderKeyDistributionMessage)return A;var r=new d.proto.Message.SenderKeyDistributionMessage;return A.groupId!=null&&(r.groupId=String(A.groupId)),A.axolotlSenderKeyDistributionMessage!=null&&(typeof A.axolotlSenderKeyDistributionMessage=="string"?l.base64.decode(A.axolotlSenderKeyDistributionMessage,r.axolotlSenderKeyDistributionMessage=l.newBuffer(l.base64.length(A.axolotlSenderKeyDistributionMessage)),0):A.axolotlSenderKeyDistributionMessage.length>=0&&(r.axolotlSenderKeyDistributionMessage=A.axolotlSenderKeyDistributionMessage)),r},a.toObject=function(A,r){r||(r={});var s={};return A.groupId!=null&&A.hasOwnProperty("groupId")&&(s.groupId=A.groupId,r.oneofs&&(s._groupId="groupId")),A.axolotlSenderKeyDistributionMessage!=null&&A.hasOwnProperty("axolotlSenderKeyDistributionMessage")&&(s.axolotlSenderKeyDistributionMessage=r.bytes===String?l.base64.encode(A.axolotlSenderKeyDistributionMessage,0,A.axolotlSenderKeyDistributionMessage.length):r.bytes===Array?Array.prototype.slice.call(A.axolotlSenderKeyDistributionMessage):A.axolotlSenderKeyDistributionMessage,r.oneofs&&(s._axolotlSenderKeyDistributionMessage="axolotlSenderKeyDistributionMessage")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SenderKeyDistributionMessage"},a})(),t.StatusNotificationMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.responseMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.originalMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 3:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StatusNotificationMessage)return A;var r=new d.proto.Message.StatusNotificationMessage;if(A.responseMessageKey!=null){if(typeof A.responseMessageKey!="object")throw TypeError(".proto.Message.StatusNotificationMessage.responseMessageKey: object expected");r.responseMessageKey=d.proto.MessageKey.fromObject(A.responseMessageKey)}if(A.originalMessageKey!=null){if(typeof A.originalMessageKey!="object")throw TypeError(".proto.Message.StatusNotificationMessage.originalMessageKey: object expected");r.originalMessageKey=d.proto.MessageKey.fromObject(A.originalMessageKey)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"STATUS_ADD_YOURS":case 1:r.type=1;break;case"STATUS_RESHARE":case 2:r.type=2;break;case"STATUS_QUESTION_ANSWER_RESHARE":case 3:r.type=3;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.responseMessageKey!=null&&A.hasOwnProperty("responseMessageKey")&&(s.responseMessageKey=d.proto.MessageKey.toObject(A.responseMessageKey,r),r.oneofs&&(s._responseMessageKey="responseMessageKey")),A.originalMessageKey!=null&&A.hasOwnProperty("originalMessageKey")&&(s.originalMessageKey=d.proto.MessageKey.toObject(A.originalMessageKey,r),r.oneofs&&(s._originalMessageKey="originalMessageKey")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.StatusNotificationMessage.StatusNotificationType[A.type]===void 0?A.type:d.proto.Message.StatusNotificationMessage.StatusNotificationType[A.type]:A.type,r.oneofs&&(s._type="type")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusNotificationMessage"},a.StatusNotificationType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="STATUS_ADD_YOURS"]=1,A[i[2]="STATUS_RESHARE"]=2,A[i[3]="STATUS_QUESTION_ANSWER_RESHARE"]=3,A})(),a})(),t.StatusQuestionAnswerMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StatusQuestionAnswerMessage)return A;var r=new d.proto.Message.StatusQuestionAnswerMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.StatusQuestionAnswerMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(r.text=String(A.text)),r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusQuestionAnswerMessage"},a})(),t.StatusQuotedMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.type=A.int32();break}case 2:{c.text=A.string();break}case 3:{c.thumbnail=A.bytes();break}case 4:{c.originalStatusId=d.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StatusQuotedMessage)return A;var r=new d.proto.Message.StatusQuotedMessage;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"QUESTION_ANSWER":case 1:r.type=1;break}if(A.text!=null&&(r.text=String(A.text)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,r.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(r.thumbnail=A.thumbnail)),A.originalStatusId!=null){if(typeof A.originalStatusId!="object")throw TypeError(".proto.Message.StatusQuotedMessage.originalStatusId: object expected");r.originalStatusId=d.proto.MessageKey.fromObject(A.originalStatusId)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.StatusQuotedMessage.StatusQuotedMessageType[A.type]===void 0?A.type:d.proto.Message.StatusQuotedMessage.StatusQuotedMessageType[A.type]:A.type,r.oneofs&&(s._type="type")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=r.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,r.oneofs&&(s._thumbnail="thumbnail")),A.originalStatusId!=null&&A.hasOwnProperty("originalStatusId")&&(s.originalStatusId=d.proto.MessageKey.toObject(A.originalStatusId,r),r.oneofs&&(s._originalStatusId="originalStatusId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusQuotedMessage"},a.StatusQuotedMessageType=(function(){let i={},A=Object.create(i);return A[i[1]="QUESTION_ANSWER"]=1,A})(),a})(),t.StatusStickerInteractionMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.stickerKey=A.string();break}case 3:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StatusStickerInteractionMessage)return A;var r=new d.proto.Message.StatusStickerInteractionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.StatusStickerInteractionMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}switch(A.stickerKey!=null&&(r.stickerKey=String(A.stickerKey)),A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"REACTION":case 1:r.type=1;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.stickerKey!=null&&A.hasOwnProperty("stickerKey")&&(s.stickerKey=A.stickerKey,r.oneofs&&(s._stickerKey="stickerKey")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.StatusStickerInteractionMessage.StatusStickerType[A.type]===void 0?A.type:d.proto.Message.StatusStickerInteractionMessage.StatusStickerType[A.type]:A.type,r.oneofs&&(s._type="type")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusStickerInteractionMessage"},a.StatusStickerType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="REACTION"]=1,A})(),a})(),t.StickerMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.fileSha256=A.bytes();break}case 3:{c.fileEncSha256=A.bytes();break}case 4:{c.mediaKey=A.bytes();break}case 5:{c.mimetype=A.string();break}case 6:{c.height=A.uint32();break}case 7:{c.width=A.uint32();break}case 8:{c.directPath=A.string();break}case 9:{c.fileLength=A.uint64();break}case 10:{c.mediaKeyTimestamp=A.int64();break}case 11:{c.firstFrameLength=A.uint32();break}case 12:{c.firstFrameSidecar=A.bytes();break}case 13:{c.isAnimated=A.bool();break}case 16:{c.pngThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.stickerSentTs=A.int64();break}case 19:{c.isAvatar=A.bool();break}case 20:{c.isAiSticker=A.bool();break}case 21:{c.isLottie=A.bool();break}case 22:{c.accessibilityLabel=A.string();break}case 23:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StickerMessage)return A;var r=new d.proto.Message.StickerMessage;if(A.url!=null&&(r.url=String(A.url)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.directPath!=null&&(r.directPath=String(A.directPath)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.firstFrameLength!=null&&(r.firstFrameLength=A.firstFrameLength>>>0),A.firstFrameSidecar!=null&&(typeof A.firstFrameSidecar=="string"?l.base64.decode(A.firstFrameSidecar,r.firstFrameSidecar=l.newBuffer(l.base64.length(A.firstFrameSidecar)),0):A.firstFrameSidecar.length>=0&&(r.firstFrameSidecar=A.firstFrameSidecar)),A.isAnimated!=null&&(r.isAnimated=!!A.isAnimated),A.pngThumbnail!=null&&(typeof A.pngThumbnail=="string"?l.base64.decode(A.pngThumbnail,r.pngThumbnail=l.newBuffer(l.base64.length(A.pngThumbnail)),0):A.pngThumbnail.length>=0&&(r.pngThumbnail=A.pngThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.StickerMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.stickerSentTs!=null&&(l.Long?(r.stickerSentTs=l.Long.fromValue(A.stickerSentTs)).unsigned=!1:typeof A.stickerSentTs=="string"?r.stickerSentTs=parseInt(A.stickerSentTs,10):typeof A.stickerSentTs=="number"?r.stickerSentTs=A.stickerSentTs:typeof A.stickerSentTs=="object"&&(r.stickerSentTs=new l.LongBits(A.stickerSentTs.low>>>0,A.stickerSentTs.high>>>0).toNumber())),A.isAvatar!=null&&(r.isAvatar=!!A.isAvatar),A.isAiSticker!=null&&(r.isAiSticker=!!A.isAiSticker),A.isLottie!=null&&(r.isLottie=!!A.isLottie),A.accessibilityLabel!=null&&(r.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,r.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,r.oneofs&&(s._width="width")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.firstFrameLength!=null&&A.hasOwnProperty("firstFrameLength")&&(s.firstFrameLength=A.firstFrameLength,r.oneofs&&(s._firstFrameLength="firstFrameLength")),A.firstFrameSidecar!=null&&A.hasOwnProperty("firstFrameSidecar")&&(s.firstFrameSidecar=r.bytes===String?l.base64.encode(A.firstFrameSidecar,0,A.firstFrameSidecar.length):r.bytes===Array?Array.prototype.slice.call(A.firstFrameSidecar):A.firstFrameSidecar,r.oneofs&&(s._firstFrameSidecar="firstFrameSidecar")),A.isAnimated!=null&&A.hasOwnProperty("isAnimated")&&(s.isAnimated=A.isAnimated,r.oneofs&&(s._isAnimated="isAnimated")),A.pngThumbnail!=null&&A.hasOwnProperty("pngThumbnail")&&(s.pngThumbnail=r.bytes===String?l.base64.encode(A.pngThumbnail,0,A.pngThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.pngThumbnail):A.pngThumbnail,r.oneofs&&(s._pngThumbnail="pngThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.stickerSentTs!=null&&A.hasOwnProperty("stickerSentTs")&&(typeof A.stickerSentTs=="number"?s.stickerSentTs=r.longs===String?String(A.stickerSentTs):A.stickerSentTs:s.stickerSentTs=r.longs===String?ge(A.stickerSentTs):r.longs===Number?ce(A.stickerSentTs):A.stickerSentTs,r.oneofs&&(s._stickerSentTs="stickerSentTs")),A.isAvatar!=null&&A.hasOwnProperty("isAvatar")&&(s.isAvatar=A.isAvatar,r.oneofs&&(s._isAvatar="isAvatar")),A.isAiSticker!=null&&A.hasOwnProperty("isAiSticker")&&(s.isAiSticker=A.isAiSticker,r.oneofs&&(s._isAiSticker="isAiSticker")),A.isLottie!=null&&A.hasOwnProperty("isLottie")&&(s.isLottie=A.isLottie,r.oneofs&&(s._isLottie="isLottie")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,r.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StickerMessage"},a})(),t.StickerPackMessage=(function(){function a(i){if(this.stickers=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.stickerPackId=A.string();break}case 2:{c.name=A.string();break}case 3:{c.publisher=A.string();break}case 4:{c.stickers&&c.stickers.length||(c.stickers=[]),c.stickers.push(d.proto.Message.StickerPackMessage.Sticker.decode(A,A.uint32()));break}case 5:{c.fileLength=A.uint64();break}case 6:{c.fileSha256=A.bytes();break}case 7:{c.fileEncSha256=A.bytes();break}case 8:{c.mediaKey=A.bytes();break}case 9:{c.directPath=A.string();break}case 10:{c.caption=A.string();break}case 11:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 12:{c.packDescription=A.string();break}case 13:{c.mediaKeyTimestamp=A.int64();break}case 14:{c.trayIconFileName=A.string();break}case 15:{c.thumbnailDirectPath=A.string();break}case 16:{c.thumbnailSha256=A.bytes();break}case 17:{c.thumbnailEncSha256=A.bytes();break}case 18:{c.thumbnailHeight=A.uint32();break}case 19:{c.thumbnailWidth=A.uint32();break}case 20:{c.imageDataHash=A.string();break}case 21:{c.stickerPackSize=A.uint64();break}case 22:{c.stickerPackOrigin=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StickerPackMessage)return A;var r=new d.proto.Message.StickerPackMessage;if(A.stickerPackId!=null&&(r.stickerPackId=String(A.stickerPackId)),A.name!=null&&(r.name=String(A.name)),A.publisher!=null&&(r.publisher=String(A.publisher)),A.stickers){if(!Array.isArray(A.stickers))throw TypeError(".proto.Message.StickerPackMessage.stickers: array expected");r.stickers=[];for(var s=0;s>>0,A.fileLength.high>>>0).toNumber(!0))),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.caption!=null&&(r.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.StickerPackMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.packDescription!=null&&(r.packDescription=String(A.packDescription)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.trayIconFileName!=null&&(r.trayIconFileName=String(A.trayIconFileName)),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.imageDataHash!=null&&(r.imageDataHash=String(A.imageDataHash)),A.stickerPackSize!=null&&(l.Long?(r.stickerPackSize=l.Long.fromValue(A.stickerPackSize)).unsigned=!0:typeof A.stickerPackSize=="string"?r.stickerPackSize=parseInt(A.stickerPackSize,10):typeof A.stickerPackSize=="number"?r.stickerPackSize=A.stickerPackSize:typeof A.stickerPackSize=="object"&&(r.stickerPackSize=new l.LongBits(A.stickerPackSize.low>>>0,A.stickerPackSize.high>>>0).toNumber(!0))),A.stickerPackOrigin){default:if(typeof A.stickerPackOrigin=="number"){r.stickerPackOrigin=A.stickerPackOrigin;break}break;case"FIRST_PARTY":case 0:r.stickerPackOrigin=0;break;case"THIRD_PARTY":case 1:r.stickerPackOrigin=1;break;case"USER_CREATED":case 2:r.stickerPackOrigin=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.stickers=[]),A.stickerPackId!=null&&A.hasOwnProperty("stickerPackId")&&(s.stickerPackId=A.stickerPackId,r.oneofs&&(s._stickerPackId="stickerPackId")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.publisher!=null&&A.hasOwnProperty("publisher")&&(s.publisher=A.publisher,r.oneofs&&(s._publisher="publisher")),A.stickers&&A.stickers.length){s.stickers=[];for(var g=0;g>>3){case 1:{p.fileName=s.string();break}case 2:{p.isAnimated=s.bool();break}case 3:{p.emojis&&p.emojis.length||(p.emojis=[]),p.emojis.push(s.string());break}case 4:{p.accessibilityLabel=s.string();break}case 5:{p.isLottie=s.bool();break}case 6:{p.mimetype=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.StickerPackMessage.Sticker)return s;var g=new d.proto.Message.StickerPackMessage.Sticker;if(s.fileName!=null&&(g.fileName=String(s.fileName)),s.isAnimated!=null&&(g.isAnimated=!!s.isAnimated),s.emojis){if(!Array.isArray(s.emojis))throw TypeError(".proto.Message.StickerPackMessage.Sticker.emojis: array expected");g.emojis=[];for(var c=0;c>>3){case 1:{c.filehash&&c.filehash.length||(c.filehash=[]),c.filehash.push(A.string());break}case 2:{c.rmrSource=A.string();break}case 3:{c.requestTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StickerSyncRMRMessage)return A;var r=new d.proto.Message.StickerSyncRMRMessage;if(A.filehash){if(!Array.isArray(A.filehash))throw TypeError(".proto.Message.StickerSyncRMRMessage.filehash: array expected");r.filehash=[];for(var s=0;s>>0,A.requestTimestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.filehash=[]),A.filehash&&A.filehash.length){s.filehash=[];for(var g=0;g>>3){case 1:{c.selectedId=A.string();break}case 2:{c.selectedDisplayText=A.string();break}case 3:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.selectedIndex=A.uint32();break}case 5:{c.selectedCarouselCardIndex=A.uint32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.TemplateButtonReplyMessage)return A;var r=new d.proto.Message.TemplateButtonReplyMessage;if(A.selectedId!=null&&(r.selectedId=String(A.selectedId)),A.selectedDisplayText!=null&&(r.selectedDisplayText=String(A.selectedDisplayText)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.TemplateButtonReplyMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return A.selectedIndex!=null&&(r.selectedIndex=A.selectedIndex>>>0),A.selectedCarouselCardIndex!=null&&(r.selectedCarouselCardIndex=A.selectedCarouselCardIndex>>>0),r},a.toObject=function(A,r){r||(r={});var s={};return A.selectedId!=null&&A.hasOwnProperty("selectedId")&&(s.selectedId=A.selectedId,r.oneofs&&(s._selectedId="selectedId")),A.selectedDisplayText!=null&&A.hasOwnProperty("selectedDisplayText")&&(s.selectedDisplayText=A.selectedDisplayText,r.oneofs&&(s._selectedDisplayText="selectedDisplayText")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.selectedIndex!=null&&A.hasOwnProperty("selectedIndex")&&(s.selectedIndex=A.selectedIndex,r.oneofs&&(s._selectedIndex="selectedIndex")),A.selectedCarouselCardIndex!=null&&A.hasOwnProperty("selectedCarouselCardIndex")&&(s.selectedCarouselCardIndex=A.selectedCarouselCardIndex,r.oneofs&&(s._selectedCarouselCardIndex="selectedCarouselCardIndex")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.TemplateButtonReplyMessage"},a})(),t.TemplateMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 3:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.hydratedTemplate=d.proto.Message.TemplateMessage.HydratedFourRowTemplate.decode(A,A.uint32());break}case 9:{c.templateId=A.string();break}case 1:{c.fourRowTemplate=d.proto.Message.TemplateMessage.FourRowTemplate.decode(A,A.uint32());break}case 2:{c.hydratedFourRowTemplate=d.proto.Message.TemplateMessage.HydratedFourRowTemplate.decode(A,A.uint32());break}case 5:{c.interactiveMessageTemplate=d.proto.Message.InteractiveMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.TemplateMessage)return A;var r=new d.proto.Message.TemplateMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.TemplateMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.hydratedTemplate!=null){if(typeof A.hydratedTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.hydratedTemplate: object expected");r.hydratedTemplate=d.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(A.hydratedTemplate)}if(A.templateId!=null&&(r.templateId=String(A.templateId)),A.fourRowTemplate!=null){if(typeof A.fourRowTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.fourRowTemplate: object expected");r.fourRowTemplate=d.proto.Message.TemplateMessage.FourRowTemplate.fromObject(A.fourRowTemplate)}if(A.hydratedFourRowTemplate!=null){if(typeof A.hydratedFourRowTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.hydratedFourRowTemplate: object expected");r.hydratedFourRowTemplate=d.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(A.hydratedFourRowTemplate)}if(A.interactiveMessageTemplate!=null){if(typeof A.interactiveMessageTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.interactiveMessageTemplate: object expected");r.interactiveMessageTemplate=d.proto.Message.InteractiveMessage.fromObject(A.interactiveMessageTemplate)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.fourRowTemplate!=null&&A.hasOwnProperty("fourRowTemplate")&&(s.fourRowTemplate=d.proto.Message.TemplateMessage.FourRowTemplate.toObject(A.fourRowTemplate,r),r.oneofs&&(s.format="fourRowTemplate")),A.hydratedFourRowTemplate!=null&&A.hasOwnProperty("hydratedFourRowTemplate")&&(s.hydratedFourRowTemplate=d.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(A.hydratedFourRowTemplate,r),r.oneofs&&(s.format="hydratedFourRowTemplate")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.hydratedTemplate!=null&&A.hasOwnProperty("hydratedTemplate")&&(s.hydratedTemplate=d.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(A.hydratedTemplate,r),r.oneofs&&(s._hydratedTemplate="hydratedTemplate")),A.interactiveMessageTemplate!=null&&A.hasOwnProperty("interactiveMessageTemplate")&&(s.interactiveMessageTemplate=d.proto.Message.InteractiveMessage.toObject(A.interactiveMessageTemplate,r),r.oneofs&&(s.format="interactiveMessageTemplate")),A.templateId!=null&&A.hasOwnProperty("templateId")&&(s.templateId=A.templateId,r.oneofs&&(s._templateId="templateId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.TemplateMessage"},a.FourRowTemplate=(function(){function i(r){if(this.buttons=[],r)for(var s=Object.keys(r),g=0;g>>3){case 6:{p.content=d.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 7:{p.footer=d.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 8:{p.buttons&&p.buttons.length||(p.buttons=[]),p.buttons.push(d.proto.TemplateButton.decode(s,s.uint32()));break}case 1:{p.documentMessage=d.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 2:{p.highlyStructuredMessage=d.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 3:{p.imageMessage=d.proto.Message.ImageMessage.decode(s,s.uint32());break}case 4:{p.videoMessage=d.proto.Message.VideoMessage.decode(s,s.uint32());break}case 5:{p.locationMessage=d.proto.Message.LocationMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.TemplateMessage.FourRowTemplate)return s;var g=new d.proto.Message.TemplateMessage.FourRowTemplate;if(s.content!=null){if(typeof s.content!="object")throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.content: object expected");g.content=d.proto.Message.HighlyStructuredMessage.fromObject(s.content)}if(s.footer!=null){if(typeof s.footer!="object")throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.footer: object expected");g.footer=d.proto.Message.HighlyStructuredMessage.fromObject(s.footer)}if(s.buttons){if(!Array.isArray(s.buttons))throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.buttons: array expected");g.buttons=[];for(var c=0;c>>3){case 6:{p.hydratedContentText=s.string();break}case 7:{p.hydratedFooterText=s.string();break}case 8:{p.hydratedButtons&&p.hydratedButtons.length||(p.hydratedButtons=[]),p.hydratedButtons.push(d.proto.HydratedTemplateButton.decode(s,s.uint32()));break}case 9:{p.templateId=s.string();break}case 10:{p.maskLinkedDevices=s.bool();break}case 1:{p.documentMessage=d.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 2:{p.hydratedTitleText=s.string();break}case 3:{p.imageMessage=d.proto.Message.ImageMessage.decode(s,s.uint32());break}case 4:{p.videoMessage=d.proto.Message.VideoMessage.decode(s,s.uint32());break}case 5:{p.locationMessage=d.proto.Message.LocationMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.TemplateMessage.HydratedFourRowTemplate)return s;var g=new d.proto.Message.TemplateMessage.HydratedFourRowTemplate;if(s.hydratedContentText!=null&&(g.hydratedContentText=String(s.hydratedContentText)),s.hydratedFooterText!=null&&(g.hydratedFooterText=String(s.hydratedFooterText)),s.hydratedButtons){if(!Array.isArray(s.hydratedButtons))throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.hydratedButtons: array expected");g.hydratedButtons=[];for(var c=0;c>>3){case 1:{c.fbExperimentId=A.uint32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.URLMetadata)return A;var r=new d.proto.Message.URLMetadata;return A.fbExperimentId!=null&&(r.fbExperimentId=A.fbExperimentId>>>0),r},a.toObject=function(A,r){r||(r={});var s={};return A.fbExperimentId!=null&&A.hasOwnProperty("fbExperimentId")&&(s.fbExperimentId=A.fbExperimentId,r.oneofs&&(s._fbExperimentId="fbExperimentId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.URLMetadata"},a})(),t.VideoEndCard=(function(){function a(e){if(e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.username=i.string();break}case 2:{g.caption=i.string();break}case 3:{g.thumbnailImageUrl=i.string();break}case 4:{g.profilePictureUrl=i.string();break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.Message.VideoEndCard)return i;var A=new d.proto.Message.VideoEndCard;return i.username!=null&&(A.username=String(i.username)),i.caption!=null&&(A.caption=String(i.caption)),i.thumbnailImageUrl!=null&&(A.thumbnailImageUrl=String(i.thumbnailImageUrl)),i.profilePictureUrl!=null&&(A.profilePictureUrl=String(i.profilePictureUrl)),A},a.toObject=function(i,A){A||(A={});var r={};return A.defaults&&(r.username="",r.caption="",r.thumbnailImageUrl="",r.profilePictureUrl=""),i.username!=null&&i.hasOwnProperty("username")&&(r.username=i.username),i.caption!=null&&i.hasOwnProperty("caption")&&(r.caption=i.caption),i.thumbnailImageUrl!=null&&i.hasOwnProperty("thumbnailImageUrl")&&(r.thumbnailImageUrl=i.thumbnailImageUrl),i.profilePictureUrl!=null&&i.hasOwnProperty("profilePictureUrl")&&(r.profilePictureUrl=i.profilePictureUrl),r},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.Message.VideoEndCard"},a})(),t.VideoMessage=(function(){function a(i){if(this.interactiveAnnotations=[],this.annotations=[],this.processedVideos=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileLength=A.uint64();break}case 5:{c.seconds=A.uint32();break}case 6:{c.mediaKey=A.bytes();break}case 7:{c.caption=A.string();break}case 8:{c.gifPlayback=A.bool();break}case 9:{c.height=A.uint32();break}case 10:{c.width=A.uint32();break}case 11:{c.fileEncSha256=A.bytes();break}case 12:{c.interactiveAnnotations&&c.interactiveAnnotations.length||(c.interactiveAnnotations=[]),c.interactiveAnnotations.push(d.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 13:{c.directPath=A.string();break}case 14:{c.mediaKeyTimestamp=A.int64();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.streamingSidecar=A.bytes();break}case 19:{c.gifAttribution=A.int32();break}case 20:{c.viewOnce=A.bool();break}case 21:{c.thumbnailDirectPath=A.string();break}case 22:{c.thumbnailSha256=A.bytes();break}case 23:{c.thumbnailEncSha256=A.bytes();break}case 24:{c.staticUrl=A.string();break}case 25:{c.annotations&&c.annotations.length||(c.annotations=[]),c.annotations.push(d.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 26:{c.accessibilityLabel=A.string();break}case 27:{c.processedVideos&&c.processedVideos.length||(c.processedVideos=[]),c.processedVideos.push(d.proto.ProcessedVideo.decode(A,A.uint32()));break}case 28:{c.externalShareFullVideoDurationInSeconds=A.uint32();break}case 29:{c.motionPhotoPresentationOffsetMs=A.uint64();break}case 30:{c.metadataUrl=A.string();break}case 31:{c.videoSourceType=A.int32();break}case 32:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.VideoMessage)return A;var r=new d.proto.Message.VideoMessage;if(A.url!=null&&(r.url=String(A.url)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.seconds!=null&&(r.seconds=A.seconds>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.caption!=null&&(r.caption=String(A.caption)),A.gifPlayback!=null&&(r.gifPlayback=!!A.gifPlayback),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.interactiveAnnotations){if(!Array.isArray(A.interactiveAnnotations))throw TypeError(".proto.Message.VideoMessage.interactiveAnnotations: array expected");r.interactiveAnnotations=[];for(var s=0;s>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.VideoMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.streamingSidecar!=null&&(typeof A.streamingSidecar=="string"?l.base64.decode(A.streamingSidecar,r.streamingSidecar=l.newBuffer(l.base64.length(A.streamingSidecar)),0):A.streamingSidecar.length>=0&&(r.streamingSidecar=A.streamingSidecar)),A.gifAttribution){default:if(typeof A.gifAttribution=="number"){r.gifAttribution=A.gifAttribution;break}break;case"NONE":case 0:r.gifAttribution=0;break;case"GIPHY":case 1:r.gifAttribution=1;break;case"TENOR":case 2:r.gifAttribution=2;break;case"KLIPY":case 3:r.gifAttribution=3;break}if(A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.staticUrl!=null&&(r.staticUrl=String(A.staticUrl)),A.annotations){if(!Array.isArray(A.annotations))throw TypeError(".proto.Message.VideoMessage.annotations: array expected");r.annotations=[];for(var s=0;s>>0),A.motionPhotoPresentationOffsetMs!=null&&(l.Long?(r.motionPhotoPresentationOffsetMs=l.Long.fromValue(A.motionPhotoPresentationOffsetMs)).unsigned=!0:typeof A.motionPhotoPresentationOffsetMs=="string"?r.motionPhotoPresentationOffsetMs=parseInt(A.motionPhotoPresentationOffsetMs,10):typeof A.motionPhotoPresentationOffsetMs=="number"?r.motionPhotoPresentationOffsetMs=A.motionPhotoPresentationOffsetMs:typeof A.motionPhotoPresentationOffsetMs=="object"&&(r.motionPhotoPresentationOffsetMs=new l.LongBits(A.motionPhotoPresentationOffsetMs.low>>>0,A.motionPhotoPresentationOffsetMs.high>>>0).toNumber(!0))),A.metadataUrl!=null&&(r.metadataUrl=String(A.metadataUrl)),A.videoSourceType){default:if(typeof A.videoSourceType=="number"){r.videoSourceType=A.videoSourceType;break}break;case"USER_VIDEO":case 0:r.videoSourceType=0;break;case"AI_GENERATED":case 1:r.videoSourceType=1;break}switch(A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.interactiveAnnotations=[],s.annotations=[],s.processedVideos=[]),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.seconds!=null&&A.hasOwnProperty("seconds")&&(s.seconds=A.seconds,r.oneofs&&(s._seconds="seconds")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.gifPlayback!=null&&A.hasOwnProperty("gifPlayback")&&(s.gifPlayback=A.gifPlayback,r.oneofs&&(s._gifPlayback="gifPlayback")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,r.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,r.oneofs&&(s._width="width")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.interactiveAnnotations&&A.interactiveAnnotations.length){s.interactiveAnnotations=[];for(var g=0;g>>3){case 1:{s.messageAddOnType=e.int32();break}case 2:{s.messageAddOn=d.proto.Message.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.status=e.int32();break}case 6:{s.addOnContextInfo=d.proto.MessageAddOnContextInfo.decode(e,e.uint32());break}case 7:{s.messageAddOnKey=d.proto.MessageKey.decode(e,e.uint32());break}case 8:{s.legacyMessage=d.proto.LegacyMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MessageAddOn)return e;var i=new d.proto.MessageAddOn;switch(e.messageAddOnType){default:if(typeof e.messageAddOnType=="number"){i.messageAddOnType=e.messageAddOnType;break}break;case"UNDEFINED":case 0:i.messageAddOnType=0;break;case"REACTION":case 1:i.messageAddOnType=1;break;case"EVENT_RESPONSE":case 2:i.messageAddOnType=2;break;case"POLL_UPDATE":case 3:i.messageAddOnType=3;break;case"PIN_IN_CHAT":case 4:i.messageAddOnType=4;break}if(e.messageAddOn!=null){if(typeof e.messageAddOn!="object")throw TypeError(".proto.MessageAddOn.messageAddOn: object expected");i.messageAddOn=d.proto.Message.fromObject(e.messageAddOn)}switch(e.senderTimestampMs!=null&&(l.Long?(i.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?i.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?i.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(i.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(i.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?i.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?i.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(i.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.status){default:if(typeof e.status=="number"){i.status=e.status;break}break;case"ERROR":case 0:i.status=0;break;case"PENDING":case 1:i.status=1;break;case"SERVER_ACK":case 2:i.status=2;break;case"DELIVERY_ACK":case 3:i.status=3;break;case"READ":case 4:i.status=4;break;case"PLAYED":case 5:i.status=5;break}if(e.addOnContextInfo!=null){if(typeof e.addOnContextInfo!="object")throw TypeError(".proto.MessageAddOn.addOnContextInfo: object expected");i.addOnContextInfo=d.proto.MessageAddOnContextInfo.fromObject(e.addOnContextInfo)}if(e.messageAddOnKey!=null){if(typeof e.messageAddOnKey!="object")throw TypeError(".proto.MessageAddOn.messageAddOnKey: object expected");i.messageAddOnKey=d.proto.MessageKey.fromObject(e.messageAddOnKey)}if(e.legacyMessage!=null){if(typeof e.legacyMessage!="object")throw TypeError(".proto.MessageAddOn.legacyMessage: object expected");i.legacyMessage=d.proto.LegacyMessage.fromObject(e.legacyMessage)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.messageAddOnType!=null&&e.hasOwnProperty("messageAddOnType")&&(A.messageAddOnType=i.enums===String?d.proto.MessageAddOn.MessageAddOnType[e.messageAddOnType]===void 0?e.messageAddOnType:d.proto.MessageAddOn.MessageAddOnType[e.messageAddOnType]:e.messageAddOnType,i.oneofs&&(A._messageAddOnType="messageAddOnType")),e.messageAddOn!=null&&e.hasOwnProperty("messageAddOn")&&(A.messageAddOn=d.proto.Message.toObject(e.messageAddOn,i),i.oneofs&&(A._messageAddOn="messageAddOn")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=i.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=i.longs===String?ge(e.senderTimestampMs):i.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,i.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=i.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=i.longs===String?ge(e.serverTimestampMs):i.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,i.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.status!=null&&e.hasOwnProperty("status")&&(A.status=i.enums===String?d.proto.WebMessageInfo.Status[e.status]===void 0?e.status:d.proto.WebMessageInfo.Status[e.status]:e.status,i.oneofs&&(A._status="status")),e.addOnContextInfo!=null&&e.hasOwnProperty("addOnContextInfo")&&(A.addOnContextInfo=d.proto.MessageAddOnContextInfo.toObject(e.addOnContextInfo,i),i.oneofs&&(A._addOnContextInfo="addOnContextInfo")),e.messageAddOnKey!=null&&e.hasOwnProperty("messageAddOnKey")&&(A.messageAddOnKey=d.proto.MessageKey.toObject(e.messageAddOnKey,i),i.oneofs&&(A._messageAddOnKey="messageAddOnKey")),e.legacyMessage!=null&&e.hasOwnProperty("legacyMessage")&&(A.legacyMessage=d.proto.LegacyMessage.toObject(e.legacyMessage,i),i.oneofs&&(A._legacyMessage="legacyMessage")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAddOn"},t.MessageAddOnType=(function(){let a={},e=Object.create(a);return e[a[0]="UNDEFINED"]=0,e[a[1]="REACTION"]=1,e[a[2]="EVENT_RESPONSE"]=2,e[a[3]="POLL_UPDATE"]=3,e[a[4]="PIN_IN_CHAT"]=4,e})(),t})(),n.MessageAddOnContextInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.messageAddOnDurationInSecs=e.uint32();break}case 2:{s.messageAddOnExpiryType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MessageAddOnContextInfo)return e;var i=new d.proto.MessageAddOnContextInfo;switch(e.messageAddOnDurationInSecs!=null&&(i.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs>>>0),e.messageAddOnExpiryType){default:if(typeof e.messageAddOnExpiryType=="number"){i.messageAddOnExpiryType=e.messageAddOnExpiryType;break}break;case"STATIC":case 1:i.messageAddOnExpiryType=1;break;case"DEPENDENT_ON_PARENT":case 2:i.messageAddOnExpiryType=2;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.messageAddOnDurationInSecs!=null&&e.hasOwnProperty("messageAddOnDurationInSecs")&&(A.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs,i.oneofs&&(A._messageAddOnDurationInSecs="messageAddOnDurationInSecs")),e.messageAddOnExpiryType!=null&&e.hasOwnProperty("messageAddOnExpiryType")&&(A.messageAddOnExpiryType=i.enums===String?d.proto.MessageContextInfo.MessageAddonExpiryType[e.messageAddOnExpiryType]===void 0?e.messageAddOnExpiryType:d.proto.MessageContextInfo.MessageAddonExpiryType[e.messageAddOnExpiryType]:e.messageAddOnExpiryType,i.oneofs&&(A._messageAddOnExpiryType="messageAddOnExpiryType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAddOnContextInfo"},t})(),n.MessageAssociation=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.associationType=e.int32();break}case 2:{s.parentMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 3:{s.messageIndex=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MessageAssociation)return e;var i=new d.proto.MessageAssociation;switch(e.associationType){default:if(typeof e.associationType=="number"){i.associationType=e.associationType;break}break;case"UNKNOWN":case 0:i.associationType=0;break;case"MEDIA_ALBUM":case 1:i.associationType=1;break;case"BOT_PLUGIN":case 2:i.associationType=2;break;case"EVENT_COVER_IMAGE":case 3:i.associationType=3;break;case"STATUS_POLL":case 4:i.associationType=4;break;case"HD_VIDEO_DUAL_UPLOAD":case 5:i.associationType=5;break;case"STATUS_EXTERNAL_RESHARE":case 6:i.associationType=6;break;case"MEDIA_POLL":case 7:i.associationType=7;break;case"STATUS_ADD_YOURS":case 8:i.associationType=8;break;case"STATUS_NOTIFICATION":case 9:i.associationType=9;break;case"HD_IMAGE_DUAL_UPLOAD":case 10:i.associationType=10;break;case"STICKER_ANNOTATION":case 11:i.associationType=11;break;case"MOTION_PHOTO":case 12:i.associationType=12;break;case"STATUS_LINK_ACTION":case 13:i.associationType=13;break;case"VIEW_ALL_REPLIES":case 14:i.associationType=14;break;case"STATUS_ADD_YOURS_AI_IMAGINE":case 15:i.associationType=15;break;case"STATUS_QUESTION":case 16:i.associationType=16;break;case"STATUS_ADD_YOURS_DIWALI":case 17:i.associationType=17;break;case"STATUS_REACTION":case 18:i.associationType=18;break;case"HEVC_VIDEO_DUAL_UPLOAD":case 19:i.associationType=19;break}if(e.parentMessageKey!=null){if(typeof e.parentMessageKey!="object")throw TypeError(".proto.MessageAssociation.parentMessageKey: object expected");i.parentMessageKey=d.proto.MessageKey.fromObject(e.parentMessageKey)}return e.messageIndex!=null&&(i.messageIndex=e.messageIndex|0),i},t.toObject=function(e,i){i||(i={});var A={};return e.associationType!=null&&e.hasOwnProperty("associationType")&&(A.associationType=i.enums===String?d.proto.MessageAssociation.AssociationType[e.associationType]===void 0?e.associationType:d.proto.MessageAssociation.AssociationType[e.associationType]:e.associationType,i.oneofs&&(A._associationType="associationType")),e.parentMessageKey!=null&&e.hasOwnProperty("parentMessageKey")&&(A.parentMessageKey=d.proto.MessageKey.toObject(e.parentMessageKey,i),i.oneofs&&(A._parentMessageKey="parentMessageKey")),e.messageIndex!=null&&e.hasOwnProperty("messageIndex")&&(A.messageIndex=e.messageIndex,i.oneofs&&(A._messageIndex="messageIndex")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAssociation"},t.AssociationType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="MEDIA_ALBUM"]=1,e[a[2]="BOT_PLUGIN"]=2,e[a[3]="EVENT_COVER_IMAGE"]=3,e[a[4]="STATUS_POLL"]=4,e[a[5]="HD_VIDEO_DUAL_UPLOAD"]=5,e[a[6]="STATUS_EXTERNAL_RESHARE"]=6,e[a[7]="MEDIA_POLL"]=7,e[a[8]="STATUS_ADD_YOURS"]=8,e[a[9]="STATUS_NOTIFICATION"]=9,e[a[10]="HD_IMAGE_DUAL_UPLOAD"]=10,e[a[11]="STICKER_ANNOTATION"]=11,e[a[12]="MOTION_PHOTO"]=12,e[a[13]="STATUS_LINK_ACTION"]=13,e[a[14]="VIEW_ALL_REPLIES"]=14,e[a[15]="STATUS_ADD_YOURS_AI_IMAGINE"]=15,e[a[16]="STATUS_QUESTION"]=16,e[a[17]="STATUS_ADD_YOURS_DIWALI"]=17,e[a[18]="STATUS_REACTION"]=18,e[a[19]="HEVC_VIDEO_DUAL_UPLOAD"]=19,e})(),t})(),n.MessageContextInfo=(function(){function t(a){if(this.threadId=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.deviceListMetadata=d.proto.DeviceListMetadata.decode(e,e.uint32());break}case 2:{s.deviceListMetadataVersion=e.int32();break}case 3:{s.messageSecret=e.bytes();break}case 4:{s.paddingBytes=e.bytes();break}case 5:{s.messageAddOnDurationInSecs=e.uint32();break}case 6:{s.botMessageSecret=e.bytes();break}case 7:{s.botMetadata=d.proto.BotMetadata.decode(e,e.uint32());break}case 8:{s.reportingTokenVersion=e.int32();break}case 9:{s.messageAddOnExpiryType=e.int32();break}case 10:{s.messageAssociation=d.proto.MessageAssociation.decode(e,e.uint32());break}case 11:{s.capiCreatedGroup=e.bool();break}case 12:{s.supportPayload=e.string();break}case 13:{s.limitSharing=d.proto.LimitSharing.decode(e,e.uint32());break}case 14:{s.limitSharingV2=d.proto.LimitSharing.decode(e,e.uint32());break}case 15:{s.threadId&&s.threadId.length||(s.threadId=[]),s.threadId.push(d.proto.ThreadID.decode(e,e.uint32()));break}case 16:{s.weblinkRenderConfig=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MessageContextInfo)return e;var i=new d.proto.MessageContextInfo;if(e.deviceListMetadata!=null){if(typeof e.deviceListMetadata!="object")throw TypeError(".proto.MessageContextInfo.deviceListMetadata: object expected");i.deviceListMetadata=d.proto.DeviceListMetadata.fromObject(e.deviceListMetadata)}if(e.deviceListMetadataVersion!=null&&(i.deviceListMetadataVersion=e.deviceListMetadataVersion|0),e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,i.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(i.messageSecret=e.messageSecret)),e.paddingBytes!=null&&(typeof e.paddingBytes=="string"?l.base64.decode(e.paddingBytes,i.paddingBytes=l.newBuffer(l.base64.length(e.paddingBytes)),0):e.paddingBytes.length>=0&&(i.paddingBytes=e.paddingBytes)),e.messageAddOnDurationInSecs!=null&&(i.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs>>>0),e.botMessageSecret!=null&&(typeof e.botMessageSecret=="string"?l.base64.decode(e.botMessageSecret,i.botMessageSecret=l.newBuffer(l.base64.length(e.botMessageSecret)),0):e.botMessageSecret.length>=0&&(i.botMessageSecret=e.botMessageSecret)),e.botMetadata!=null){if(typeof e.botMetadata!="object")throw TypeError(".proto.MessageContextInfo.botMetadata: object expected");i.botMetadata=d.proto.BotMetadata.fromObject(e.botMetadata)}switch(e.reportingTokenVersion!=null&&(i.reportingTokenVersion=e.reportingTokenVersion|0),e.messageAddOnExpiryType){default:if(typeof e.messageAddOnExpiryType=="number"){i.messageAddOnExpiryType=e.messageAddOnExpiryType;break}break;case"STATIC":case 1:i.messageAddOnExpiryType=1;break;case"DEPENDENT_ON_PARENT":case 2:i.messageAddOnExpiryType=2;break}if(e.messageAssociation!=null){if(typeof e.messageAssociation!="object")throw TypeError(".proto.MessageContextInfo.messageAssociation: object expected");i.messageAssociation=d.proto.MessageAssociation.fromObject(e.messageAssociation)}if(e.capiCreatedGroup!=null&&(i.capiCreatedGroup=!!e.capiCreatedGroup),e.supportPayload!=null&&(i.supportPayload=String(e.supportPayload)),e.limitSharing!=null){if(typeof e.limitSharing!="object")throw TypeError(".proto.MessageContextInfo.limitSharing: object expected");i.limitSharing=d.proto.LimitSharing.fromObject(e.limitSharing)}if(e.limitSharingV2!=null){if(typeof e.limitSharingV2!="object")throw TypeError(".proto.MessageContextInfo.limitSharingV2: object expected");i.limitSharingV2=d.proto.LimitSharing.fromObject(e.limitSharingV2)}if(e.threadId){if(!Array.isArray(e.threadId))throw TypeError(".proto.MessageContextInfo.threadId: array expected");i.threadId=[];for(var A=0;A>>3){case 1:{s.remoteJid=e.string();break}case 2:{s.fromMe=e.bool();break}case 3:{s.id=e.string();break}case 4:{s.participant=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MessageKey)return e;var i=new d.proto.MessageKey;return e.remoteJid!=null&&(i.remoteJid=String(e.remoteJid)),e.fromMe!=null&&(i.fromMe=!!e.fromMe),e.id!=null&&(i.id=String(e.id)),e.participant!=null&&(i.participant=String(e.participant)),i},t.toObject=function(e,i){i||(i={});var A={};return e.remoteJid!=null&&e.hasOwnProperty("remoteJid")&&(A.remoteJid=e.remoteJid,i.oneofs&&(A._remoteJid="remoteJid")),e.fromMe!=null&&e.hasOwnProperty("fromMe")&&(A.fromMe=e.fromMe,i.oneofs&&(A._fromMe="fromMe")),e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,i.oneofs&&(A._participant="participant")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageKey"},t})(),n.MessageSecretMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.version=e.sfixed32();break}case 2:{s.encIv=e.bytes();break}case 3:{s.encPayload=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MessageSecretMessage)return e;var i=new d.proto.MessageSecretMessage;return e.version!=null&&(i.version=e.version|0),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,i.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(i.encIv=e.encIv)),e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,i.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(i.encPayload=e.encPayload)),i},t.toObject=function(e,i){i||(i={});var A={};return e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,i.oneofs&&(A._version="version")),e.encIv!=null&&e.hasOwnProperty("encIv")&&(A.encIv=i.bytes===String?l.base64.encode(e.encIv,0,e.encIv.length):i.bytes===Array?Array.prototype.slice.call(e.encIv):e.encIv,i.oneofs&&(A._encIv="encIv")),e.encPayload!=null&&e.hasOwnProperty("encPayload")&&(A.encPayload=i.bytes===String?l.base64.encode(e.encPayload,0,e.encPayload.length):i.bytes===Array?Array.prototype.slice.call(e.encPayload):e.encPayload,i.oneofs&&(A._encPayload="encPayload")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageSecretMessage"},t})(),n.Money=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.value=e.int64();break}case 2:{s.offset=e.uint32();break}case 3:{s.currencyCode=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Money)return e;var i=new d.proto.Money;return e.value!=null&&(l.Long?(i.value=l.Long.fromValue(e.value)).unsigned=!1:typeof e.value=="string"?i.value=parseInt(e.value,10):typeof e.value=="number"?i.value=e.value:typeof e.value=="object"&&(i.value=new l.LongBits(e.value.low>>>0,e.value.high>>>0).toNumber())),e.offset!=null&&(i.offset=e.offset>>>0),e.currencyCode!=null&&(i.currencyCode=String(e.currencyCode)),i},t.toObject=function(e,i){i||(i={});var A={};return e.value!=null&&e.hasOwnProperty("value")&&(typeof e.value=="number"?A.value=i.longs===String?String(e.value):e.value:A.value=i.longs===String?ge(e.value):i.longs===Number?ce(e.value):e.value,i.oneofs&&(A._value="value")),e.offset!=null&&e.hasOwnProperty("offset")&&(A.offset=e.offset,i.oneofs&&(A._offset="offset")),e.currencyCode!=null&&e.hasOwnProperty("currencyCode")&&(A.currencyCode=e.currencyCode,i.oneofs&&(A._currencyCode="currencyCode")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Money"},t})(),n.MsgOpaqueData=(function(){function t(a){if(this.pollOptions=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.body=e.string();break}case 3:{s.caption=e.string();break}case 5:{s.lng=e.double();break}case 6:{s.isLive=e.bool();break}case 7:{s.lat=e.double();break}case 8:{s.paymentAmount1000=e.int32();break}case 9:{s.paymentNoteMsgBody=e.string();break}case 11:{s.matchedText=e.string();break}case 12:{s.title=e.string();break}case 13:{s.description=e.string();break}case 14:{s.futureproofBuffer=e.bytes();break}case 15:{s.clientUrl=e.string();break}case 16:{s.loc=e.string();break}case 17:{s.pollName=e.string();break}case 18:{s.pollOptions&&s.pollOptions.length||(s.pollOptions=[]),s.pollOptions.push(d.proto.MsgOpaqueData.PollOption.decode(e,e.uint32()));break}case 20:{s.pollSelectableOptionsCount=e.uint32();break}case 21:{s.messageSecret=e.bytes();break}case 51:{s.originalSelfAuthor=e.string();break}case 22:{s.senderTimestampMs=e.int64();break}case 23:{s.pollUpdateParentKey=e.string();break}case 24:{s.encPollVote=d.proto.PollEncValue.decode(e,e.uint32());break}case 28:{s.isSentCagPollCreation=e.bool();break}case 42:{s.pollContentType=e.int32();break}case 46:{s.pollType=e.int32();break}case 47:{s.correctOptionIndex=e.int32();break}case 41:{s.pollVotesSnapshot=d.proto.MsgOpaqueData.PollVotesSnapshot.decode(e,e.uint32());break}case 25:{s.encReactionTargetMessageKey=e.string();break}case 26:{s.encReactionEncPayload=e.bytes();break}case 27:{s.encReactionEncIv=e.bytes();break}case 29:{s.botMessageSecret=e.bytes();break}case 30:{s.targetMessageKey=e.string();break}case 31:{s.encPayload=e.bytes();break}case 32:{s.encIv=e.bytes();break}case 33:{s.eventName=e.string();break}case 34:{s.isEventCanceled=e.bool();break}case 35:{s.eventDescription=e.string();break}case 36:{s.eventJoinLink=e.string();break}case 37:{s.eventStartTime=e.int64();break}case 38:{s.eventLocation=d.proto.MsgOpaqueData.EventLocation.decode(e,e.uint32());break}case 40:{s.eventEndTime=e.int64();break}case 44:{s.eventIsScheduledCall=e.bool();break}case 45:{s.eventExtraGuestsAllowed=e.bool();break}case 43:{s.plainProtobufBytes=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MsgOpaqueData)return e;var i=new d.proto.MsgOpaqueData;if(e.body!=null&&(i.body=String(e.body)),e.caption!=null&&(i.caption=String(e.caption)),e.lng!=null&&(i.lng=Number(e.lng)),e.isLive!=null&&(i.isLive=!!e.isLive),e.lat!=null&&(i.lat=Number(e.lat)),e.paymentAmount1000!=null&&(i.paymentAmount1000=e.paymentAmount1000|0),e.paymentNoteMsgBody!=null&&(i.paymentNoteMsgBody=String(e.paymentNoteMsgBody)),e.matchedText!=null&&(i.matchedText=String(e.matchedText)),e.title!=null&&(i.title=String(e.title)),e.description!=null&&(i.description=String(e.description)),e.futureproofBuffer!=null&&(typeof e.futureproofBuffer=="string"?l.base64.decode(e.futureproofBuffer,i.futureproofBuffer=l.newBuffer(l.base64.length(e.futureproofBuffer)),0):e.futureproofBuffer.length>=0&&(i.futureproofBuffer=e.futureproofBuffer)),e.clientUrl!=null&&(i.clientUrl=String(e.clientUrl)),e.loc!=null&&(i.loc=String(e.loc)),e.pollName!=null&&(i.pollName=String(e.pollName)),e.pollOptions){if(!Array.isArray(e.pollOptions))throw TypeError(".proto.MsgOpaqueData.pollOptions: array expected");i.pollOptions=[];for(var A=0;A>>0),e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,i.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(i.messageSecret=e.messageSecret)),e.originalSelfAuthor!=null&&(i.originalSelfAuthor=String(e.originalSelfAuthor)),e.senderTimestampMs!=null&&(l.Long?(i.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?i.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?i.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(i.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.pollUpdateParentKey!=null&&(i.pollUpdateParentKey=String(e.pollUpdateParentKey)),e.encPollVote!=null){if(typeof e.encPollVote!="object")throw TypeError(".proto.MsgOpaqueData.encPollVote: object expected");i.encPollVote=d.proto.PollEncValue.fromObject(e.encPollVote)}switch(e.isSentCagPollCreation!=null&&(i.isSentCagPollCreation=!!e.isSentCagPollCreation),e.pollContentType){default:if(typeof e.pollContentType=="number"){i.pollContentType=e.pollContentType;break}break;case"UNKNOWN":case 0:i.pollContentType=0;break;case"TEXT":case 1:i.pollContentType=1;break;case"IMAGE":case 2:i.pollContentType=2;break}switch(e.pollType){default:if(typeof e.pollType=="number"){i.pollType=e.pollType;break}break;case"POLL":case 0:i.pollType=0;break;case"QUIZ":case 1:i.pollType=1;break}if(e.correctOptionIndex!=null&&(i.correctOptionIndex=e.correctOptionIndex|0),e.pollVotesSnapshot!=null){if(typeof e.pollVotesSnapshot!="object")throw TypeError(".proto.MsgOpaqueData.pollVotesSnapshot: object expected");i.pollVotesSnapshot=d.proto.MsgOpaqueData.PollVotesSnapshot.fromObject(e.pollVotesSnapshot)}if(e.encReactionTargetMessageKey!=null&&(i.encReactionTargetMessageKey=String(e.encReactionTargetMessageKey)),e.encReactionEncPayload!=null&&(typeof e.encReactionEncPayload=="string"?l.base64.decode(e.encReactionEncPayload,i.encReactionEncPayload=l.newBuffer(l.base64.length(e.encReactionEncPayload)),0):e.encReactionEncPayload.length>=0&&(i.encReactionEncPayload=e.encReactionEncPayload)),e.encReactionEncIv!=null&&(typeof e.encReactionEncIv=="string"?l.base64.decode(e.encReactionEncIv,i.encReactionEncIv=l.newBuffer(l.base64.length(e.encReactionEncIv)),0):e.encReactionEncIv.length>=0&&(i.encReactionEncIv=e.encReactionEncIv)),e.botMessageSecret!=null&&(typeof e.botMessageSecret=="string"?l.base64.decode(e.botMessageSecret,i.botMessageSecret=l.newBuffer(l.base64.length(e.botMessageSecret)),0):e.botMessageSecret.length>=0&&(i.botMessageSecret=e.botMessageSecret)),e.targetMessageKey!=null&&(i.targetMessageKey=String(e.targetMessageKey)),e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,i.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(i.encPayload=e.encPayload)),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,i.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(i.encIv=e.encIv)),e.eventName!=null&&(i.eventName=String(e.eventName)),e.isEventCanceled!=null&&(i.isEventCanceled=!!e.isEventCanceled),e.eventDescription!=null&&(i.eventDescription=String(e.eventDescription)),e.eventJoinLink!=null&&(i.eventJoinLink=String(e.eventJoinLink)),e.eventStartTime!=null&&(l.Long?(i.eventStartTime=l.Long.fromValue(e.eventStartTime)).unsigned=!1:typeof e.eventStartTime=="string"?i.eventStartTime=parseInt(e.eventStartTime,10):typeof e.eventStartTime=="number"?i.eventStartTime=e.eventStartTime:typeof e.eventStartTime=="object"&&(i.eventStartTime=new l.LongBits(e.eventStartTime.low>>>0,e.eventStartTime.high>>>0).toNumber())),e.eventLocation!=null){if(typeof e.eventLocation!="object")throw TypeError(".proto.MsgOpaqueData.eventLocation: object expected");i.eventLocation=d.proto.MsgOpaqueData.EventLocation.fromObject(e.eventLocation)}return e.eventEndTime!=null&&(l.Long?(i.eventEndTime=l.Long.fromValue(e.eventEndTime)).unsigned=!1:typeof e.eventEndTime=="string"?i.eventEndTime=parseInt(e.eventEndTime,10):typeof e.eventEndTime=="number"?i.eventEndTime=e.eventEndTime:typeof e.eventEndTime=="object"&&(i.eventEndTime=new l.LongBits(e.eventEndTime.low>>>0,e.eventEndTime.high>>>0).toNumber())),e.eventIsScheduledCall!=null&&(i.eventIsScheduledCall=!!e.eventIsScheduledCall),e.eventExtraGuestsAllowed!=null&&(i.eventExtraGuestsAllowed=!!e.eventExtraGuestsAllowed),e.plainProtobufBytes!=null&&(typeof e.plainProtobufBytes=="string"?l.base64.decode(e.plainProtobufBytes,i.plainProtobufBytes=l.newBuffer(l.base64.length(e.plainProtobufBytes)),0):e.plainProtobufBytes.length>=0&&(i.plainProtobufBytes=e.plainProtobufBytes)),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.pollOptions=[]),e.body!=null&&e.hasOwnProperty("body")&&(A.body=e.body,i.oneofs&&(A._body="body")),e.caption!=null&&e.hasOwnProperty("caption")&&(A.caption=e.caption,i.oneofs&&(A._caption="caption")),e.lng!=null&&e.hasOwnProperty("lng")&&(A.lng=i.json&&!isFinite(e.lng)?String(e.lng):e.lng,i.oneofs&&(A._lng="lng")),e.isLive!=null&&e.hasOwnProperty("isLive")&&(A.isLive=e.isLive,i.oneofs&&(A._isLive="isLive")),e.lat!=null&&e.hasOwnProperty("lat")&&(A.lat=i.json&&!isFinite(e.lat)?String(e.lat):e.lat,i.oneofs&&(A._lat="lat")),e.paymentAmount1000!=null&&e.hasOwnProperty("paymentAmount1000")&&(A.paymentAmount1000=e.paymentAmount1000,i.oneofs&&(A._paymentAmount1000="paymentAmount1000")),e.paymentNoteMsgBody!=null&&e.hasOwnProperty("paymentNoteMsgBody")&&(A.paymentNoteMsgBody=e.paymentNoteMsgBody,i.oneofs&&(A._paymentNoteMsgBody="paymentNoteMsgBody")),e.matchedText!=null&&e.hasOwnProperty("matchedText")&&(A.matchedText=e.matchedText,i.oneofs&&(A._matchedText="matchedText")),e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,i.oneofs&&(A._title="title")),e.description!=null&&e.hasOwnProperty("description")&&(A.description=e.description,i.oneofs&&(A._description="description")),e.futureproofBuffer!=null&&e.hasOwnProperty("futureproofBuffer")&&(A.futureproofBuffer=i.bytes===String?l.base64.encode(e.futureproofBuffer,0,e.futureproofBuffer.length):i.bytes===Array?Array.prototype.slice.call(e.futureproofBuffer):e.futureproofBuffer,i.oneofs&&(A._futureproofBuffer="futureproofBuffer")),e.clientUrl!=null&&e.hasOwnProperty("clientUrl")&&(A.clientUrl=e.clientUrl,i.oneofs&&(A._clientUrl="clientUrl")),e.loc!=null&&e.hasOwnProperty("loc")&&(A.loc=e.loc,i.oneofs&&(A._loc="loc")),e.pollName!=null&&e.hasOwnProperty("pollName")&&(A.pollName=e.pollName,i.oneofs&&(A._pollName="pollName")),e.pollOptions&&e.pollOptions.length){A.pollOptions=[];for(var r=0;r>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.name=A.string();break}case 4:{c.address=A.string();break}case 5:{c.url=A.string();break}case 6:{c.jpegThumbnail=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.MsgOpaqueData.EventLocation)return A;var r=new d.proto.MsgOpaqueData.EventLocation;return A.degreesLatitude!=null&&(r.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(r.degreesLongitude=Number(A.degreesLongitude)),A.name!=null&&(r.name=String(A.name)),A.address!=null&&(r.address=String(A.address)),A.url!=null&&(r.url=String(A.url)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),r},a.toObject=function(A,r){r||(r={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=r.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,r.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=r.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,r.oneofs&&(s._degreesLongitude="degreesLongitude")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.address!=null&&A.hasOwnProperty("address")&&(s.address=A.address,r.oneofs&&(s._address="address")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.EventLocation"},a})(),t.PollContentType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="TEXT"]=1,e[a[2]="IMAGE"]=2,e})(),t.PollOption=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.hash=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.MsgOpaqueData.PollOption)return A;var r=new d.proto.MsgOpaqueData.PollOption;return A.name!=null&&(r.name=String(A.name)),A.hash!=null&&(r.hash=String(A.hash)),r},a.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.hash!=null&&A.hasOwnProperty("hash")&&(s.hash=A.hash,r.oneofs&&(s._hash="hash")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.PollOption"},a})(),t.PollType=(function(){let a={},e=Object.create(a);return e[a[0]="POLL"]=0,e[a[1]="QUIZ"]=1,e})(),t.PollVoteSnapshot=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.option=d.proto.MsgOpaqueData.PollOption.decode(A,A.uint32());break}case 2:{c.optionVoteCount=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.MsgOpaqueData.PollVoteSnapshot)return A;var r=new d.proto.MsgOpaqueData.PollVoteSnapshot;if(A.option!=null){if(typeof A.option!="object")throw TypeError(".proto.MsgOpaqueData.PollVoteSnapshot.option: object expected");r.option=d.proto.MsgOpaqueData.PollOption.fromObject(A.option)}return A.optionVoteCount!=null&&(r.optionVoteCount=A.optionVoteCount|0),r},a.toObject=function(A,r){r||(r={});var s={};return A.option!=null&&A.hasOwnProperty("option")&&(s.option=d.proto.MsgOpaqueData.PollOption.toObject(A.option,r),r.oneofs&&(s._option="option")),A.optionVoteCount!=null&&A.hasOwnProperty("optionVoteCount")&&(s.optionVoteCount=A.optionVoteCount,r.oneofs&&(s._optionVoteCount="optionVoteCount")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.PollVoteSnapshot"},a})(),t.PollVotesSnapshot=(function(){function a(e){if(this.pollVotes=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.pollVotes&&g.pollVotes.length||(g.pollVotes=[]),g.pollVotes.push(d.proto.MsgOpaqueData.PollVoteSnapshot.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.MsgOpaqueData.PollVotesSnapshot)return i;var A=new d.proto.MsgOpaqueData.PollVotesSnapshot;if(i.pollVotes){if(!Array.isArray(i.pollVotes))throw TypeError(".proto.MsgOpaqueData.PollVotesSnapshot.pollVotes: array expected");A.pollVotes=[];for(var r=0;r>>3){case 1:{s.currentMsg=d.proto.MsgOpaqueData.decode(e,e.uint32());break}case 2:{s.quotedMsg=d.proto.MsgOpaqueData.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MsgRowOpaqueData)return e;var i=new d.proto.MsgRowOpaqueData;if(e.currentMsg!=null){if(typeof e.currentMsg!="object")throw TypeError(".proto.MsgRowOpaqueData.currentMsg: object expected");i.currentMsg=d.proto.MsgOpaqueData.fromObject(e.currentMsg)}if(e.quotedMsg!=null){if(typeof e.quotedMsg!="object")throw TypeError(".proto.MsgRowOpaqueData.quotedMsg: object expected");i.quotedMsg=d.proto.MsgOpaqueData.fromObject(e.quotedMsg)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.currentMsg!=null&&e.hasOwnProperty("currentMsg")&&(A.currentMsg=d.proto.MsgOpaqueData.toObject(e.currentMsg,i),i.oneofs&&(A._currentMsg="currentMsg")),e.quotedMsg!=null&&e.hasOwnProperty("quotedMsg")&&(A.quotedMsg=d.proto.MsgOpaqueData.toObject(e.quotedMsg,i),i.oneofs&&(A._quotedMsg="quotedMsg")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MsgRowOpaqueData"},t})(),n.MutationProps=(function(){let t={},o=Object.create(t);return o[t[2]="STAR_ACTION"]=2,o[t[3]="CONTACT_ACTION"]=3,o[t[4]="MUTE_ACTION"]=4,o[t[5]="PIN_ACTION"]=5,o[t[6]="SECURITY_NOTIFICATION_SETTING"]=6,o[t[7]="PUSH_NAME_SETTING"]=7,o[t[8]="QUICK_REPLY_ACTION"]=8,o[t[11]="RECENT_EMOJI_WEIGHTS_ACTION"]=11,o[t[13]="LABEL_MESSAGE_ACTION"]=13,o[t[14]="LABEL_EDIT_ACTION"]=14,o[t[15]="LABEL_ASSOCIATION_ACTION"]=15,o[t[16]="LOCALE_SETTING"]=16,o[t[17]="ARCHIVE_CHAT_ACTION"]=17,o[t[18]="DELETE_MESSAGE_FOR_ME_ACTION"]=18,o[t[19]="KEY_EXPIRATION"]=19,o[t[20]="MARK_CHAT_AS_READ_ACTION"]=20,o[t[21]="CLEAR_CHAT_ACTION"]=21,o[t[22]="DELETE_CHAT_ACTION"]=22,o[t[23]="UNARCHIVE_CHATS_SETTING"]=23,o[t[24]="PRIMARY_FEATURE"]=24,o[t[26]="ANDROID_UNSUPPORTED_ACTIONS"]=26,o[t[27]="AGENT_ACTION"]=27,o[t[28]="SUBSCRIPTION_ACTION"]=28,o[t[29]="USER_STATUS_MUTE_ACTION"]=29,o[t[30]="TIME_FORMAT_ACTION"]=30,o[t[31]="NUX_ACTION"]=31,o[t[32]="PRIMARY_VERSION_ACTION"]=32,o[t[33]="STICKER_ACTION"]=33,o[t[34]="REMOVE_RECENT_STICKER_ACTION"]=34,o[t[35]="CHAT_ASSIGNMENT"]=35,o[t[36]="CHAT_ASSIGNMENT_OPENED_STATUS"]=36,o[t[37]="PN_FOR_LID_CHAT_ACTION"]=37,o[t[38]="MARKETING_MESSAGE_ACTION"]=38,o[t[39]="MARKETING_MESSAGE_BROADCAST_ACTION"]=39,o[t[40]="EXTERNAL_WEB_BETA_ACTION"]=40,o[t[41]="PRIVACY_SETTING_RELAY_ALL_CALLS"]=41,o[t[42]="CALL_LOG_ACTION"]=42,o[t[43]="UGC_BOT"]=43,o[t[44]="STATUS_PRIVACY"]=44,o[t[45]="BOT_WELCOME_REQUEST_ACTION"]=45,o[t[46]="DELETE_INDIVIDUAL_CALL_LOG"]=46,o[t[47]="LABEL_REORDERING_ACTION"]=47,o[t[48]="PAYMENT_INFO_ACTION"]=48,o[t[49]="CUSTOM_PAYMENT_METHODS_ACTION"]=49,o[t[50]="LOCK_CHAT_ACTION"]=50,o[t[51]="CHAT_LOCK_SETTINGS"]=51,o[t[52]="WAMO_USER_IDENTIFIER_ACTION"]=52,o[t[53]="PRIVACY_SETTING_DISABLE_LINK_PREVIEWS_ACTION"]=53,o[t[54]="DEVICE_CAPABILITIES"]=54,o[t[55]="NOTE_EDIT_ACTION"]=55,o[t[56]="FAVORITES_ACTION"]=56,o[t[57]="MERCHANT_PAYMENT_PARTNER_ACTION"]=57,o[t[58]="WAFFLE_ACCOUNT_LINK_STATE_ACTION"]=58,o[t[59]="USERNAME_CHAT_START_MODE"]=59,o[t[60]="NOTIFICATION_ACTIVITY_SETTING_ACTION"]=60,o[t[61]="LID_CONTACT_ACTION"]=61,o[t[62]="CTWA_PER_CUSTOMER_DATA_SHARING_ACTION"]=62,o[t[63]="PAYMENT_TOS_ACTION"]=63,o[t[64]="PRIVACY_SETTING_CHANNELS_PERSONALISED_RECOMMENDATION_ACTION"]=64,o[t[65]="BUSINESS_BROADCAST_ASSOCIATION_ACTION"]=65,o[t[66]="DETECTED_OUTCOMES_STATUS_ACTION"]=66,o[t[68]="MAIBA_AI_FEATURES_CONTROL_ACTION"]=68,o[t[69]="BUSINESS_BROADCAST_LIST_ACTION"]=69,o[t[70]="MUSIC_USER_ID_ACTION"]=70,o[t[71]="STATUS_POST_OPT_IN_NOTIFICATION_PREFERENCES_ACTION"]=71,o[t[72]="AVATAR_UPDATED_ACTION"]=72,o[t[73]="GALAXY_FLOW_ACTION"]=73,o[t[74]="PRIVATE_PROCESSING_SETTING_ACTION"]=74,o[t[75]="NEWSLETTER_SAVED_INTERESTS_ACTION"]=75,o[t[76]="AI_THREAD_RENAME_ACTION"]=76,o[t[77]="INTERACTIVE_MESSAGE_ACTION"]=77,o[t[10001]="SHARE_OWN_PN"]=10001,o[t[10002]="BUSINESS_BROADCAST_ACTION"]=10002,o})(),n.NoiseCertificate=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.details=e.bytes();break}case 2:{s.signature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.NoiseCertificate)return e;var i=new d.proto.NoiseCertificate;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,i.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(i.details=e.details)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,i.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(i.signature=e.signature)),i},t.toObject=function(e,i){i||(i={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=i.bytes===String?l.base64.encode(e.details,0,e.details.length):i.bytes===Array?Array.prototype.slice.call(e.details):e.details,i.oneofs&&(A._details="details")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=i.bytes===String?l.base64.encode(e.signature,0,e.signature.length):i.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,i.oneofs&&(A._signature="signature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NoiseCertificate"},t.Details=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.serial=A.uint32();break}case 2:{c.issuer=A.string();break}case 3:{c.expires=A.uint64();break}case 4:{c.subject=A.string();break}case 5:{c.key=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.NoiseCertificate.Details)return A;var r=new d.proto.NoiseCertificate.Details;return A.serial!=null&&(r.serial=A.serial>>>0),A.issuer!=null&&(r.issuer=String(A.issuer)),A.expires!=null&&(l.Long?(r.expires=l.Long.fromValue(A.expires)).unsigned=!0:typeof A.expires=="string"?r.expires=parseInt(A.expires,10):typeof A.expires=="number"?r.expires=A.expires:typeof A.expires=="object"&&(r.expires=new l.LongBits(A.expires.low>>>0,A.expires.high>>>0).toNumber(!0))),A.subject!=null&&(r.subject=String(A.subject)),A.key!=null&&(typeof A.key=="string"?l.base64.decode(A.key,r.key=l.newBuffer(l.base64.length(A.key)),0):A.key.length>=0&&(r.key=A.key)),r},a.toObject=function(A,r){r||(r={});var s={};return A.serial!=null&&A.hasOwnProperty("serial")&&(s.serial=A.serial,r.oneofs&&(s._serial="serial")),A.issuer!=null&&A.hasOwnProperty("issuer")&&(s.issuer=A.issuer,r.oneofs&&(s._issuer="issuer")),A.expires!=null&&A.hasOwnProperty("expires")&&(typeof A.expires=="number"?s.expires=r.longs===String?String(A.expires):A.expires:s.expires=r.longs===String?ge(A.expires,!0):r.longs===Number?ce(A.expires,!0):A.expires,r.oneofs&&(s._expires="expires")),A.subject!=null&&A.hasOwnProperty("subject")&&(s.subject=A.subject,r.oneofs&&(s._subject="subject")),A.key!=null&&A.hasOwnProperty("key")&&(s.key=r.bytes===String?l.base64.encode(A.key,0,A.key.length):r.bytes===Array?Array.prototype.slice.call(A.key):A.key,r.oneofs&&(s._key="key")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.NoiseCertificate.Details"},a})(),t})(),n.NotificationMessageInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.key=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=d.proto.Message.decode(e,e.uint32());break}case 3:{s.messageTimestamp=e.uint64();break}case 4:{s.participant=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.NotificationMessageInfo)return e;var i=new d.proto.NotificationMessageInfo;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.NotificationMessageInfo.key: object expected");i.key=d.proto.MessageKey.fromObject(e.key)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.NotificationMessageInfo.message: object expected");i.message=d.proto.Message.fromObject(e.message)}return e.messageTimestamp!=null&&(l.Long?(i.messageTimestamp=l.Long.fromValue(e.messageTimestamp)).unsigned=!0:typeof e.messageTimestamp=="string"?i.messageTimestamp=parseInt(e.messageTimestamp,10):typeof e.messageTimestamp=="number"?i.messageTimestamp=e.messageTimestamp:typeof e.messageTimestamp=="object"&&(i.messageTimestamp=new l.LongBits(e.messageTimestamp.low>>>0,e.messageTimestamp.high>>>0).toNumber(!0))),e.participant!=null&&(i.participant=String(e.participant)),i},t.toObject=function(e,i){i||(i={});var A={};return e.key!=null&&e.hasOwnProperty("key")&&(A.key=d.proto.MessageKey.toObject(e.key,i),i.oneofs&&(A._key="key")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=d.proto.Message.toObject(e.message,i),i.oneofs&&(A._message="message")),e.messageTimestamp!=null&&e.hasOwnProperty("messageTimestamp")&&(typeof e.messageTimestamp=="number"?A.messageTimestamp=i.longs===String?String(e.messageTimestamp):e.messageTimestamp:A.messageTimestamp=i.longs===String?ge(e.messageTimestamp,!0):i.longs===Number?ce(e.messageTimestamp,!0):e.messageTimestamp,i.oneofs&&(A._messageTimestamp="messageTimestamp")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,i.oneofs&&(A._participant="participant")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NotificationMessageInfo"},t})(),n.NotificationSettings=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.messageVibrate=e.string();break}case 2:{s.messagePopup=e.string();break}case 3:{s.messageLight=e.string();break}case 4:{s.lowPriorityNotifications=e.bool();break}case 5:{s.reactionsMuted=e.bool();break}case 6:{s.callVibrate=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.NotificationSettings)return e;var i=new d.proto.NotificationSettings;return e.messageVibrate!=null&&(i.messageVibrate=String(e.messageVibrate)),e.messagePopup!=null&&(i.messagePopup=String(e.messagePopup)),e.messageLight!=null&&(i.messageLight=String(e.messageLight)),e.lowPriorityNotifications!=null&&(i.lowPriorityNotifications=!!e.lowPriorityNotifications),e.reactionsMuted!=null&&(i.reactionsMuted=!!e.reactionsMuted),e.callVibrate!=null&&(i.callVibrate=String(e.callVibrate)),i},t.toObject=function(e,i){i||(i={});var A={};return e.messageVibrate!=null&&e.hasOwnProperty("messageVibrate")&&(A.messageVibrate=e.messageVibrate,i.oneofs&&(A._messageVibrate="messageVibrate")),e.messagePopup!=null&&e.hasOwnProperty("messagePopup")&&(A.messagePopup=e.messagePopup,i.oneofs&&(A._messagePopup="messagePopup")),e.messageLight!=null&&e.hasOwnProperty("messageLight")&&(A.messageLight=e.messageLight,i.oneofs&&(A._messageLight="messageLight")),e.lowPriorityNotifications!=null&&e.hasOwnProperty("lowPriorityNotifications")&&(A.lowPriorityNotifications=e.lowPriorityNotifications,i.oneofs&&(A._lowPriorityNotifications="lowPriorityNotifications")),e.reactionsMuted!=null&&e.hasOwnProperty("reactionsMuted")&&(A.reactionsMuted=e.reactionsMuted,i.oneofs&&(A._reactionsMuted="reactionsMuted")),e.callVibrate!=null&&e.hasOwnProperty("callVibrate")&&(A.callVibrate=e.callVibrate,i.oneofs&&(A._callVibrate="callVibrate")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NotificationSettings"},t})(),n.PairingRequest=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.companionPublicKey=e.bytes();break}case 2:{s.companionIdentityKey=e.bytes();break}case 3:{s.advSecret=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PairingRequest)return e;var i=new d.proto.PairingRequest;return e.companionPublicKey!=null&&(typeof e.companionPublicKey=="string"?l.base64.decode(e.companionPublicKey,i.companionPublicKey=l.newBuffer(l.base64.length(e.companionPublicKey)),0):e.companionPublicKey.length>=0&&(i.companionPublicKey=e.companionPublicKey)),e.companionIdentityKey!=null&&(typeof e.companionIdentityKey=="string"?l.base64.decode(e.companionIdentityKey,i.companionIdentityKey=l.newBuffer(l.base64.length(e.companionIdentityKey)),0):e.companionIdentityKey.length>=0&&(i.companionIdentityKey=e.companionIdentityKey)),e.advSecret!=null&&(typeof e.advSecret=="string"?l.base64.decode(e.advSecret,i.advSecret=l.newBuffer(l.base64.length(e.advSecret)),0):e.advSecret.length>=0&&(i.advSecret=e.advSecret)),i},t.toObject=function(e,i){i||(i={});var A={};return e.companionPublicKey!=null&&e.hasOwnProperty("companionPublicKey")&&(A.companionPublicKey=i.bytes===String?l.base64.encode(e.companionPublicKey,0,e.companionPublicKey.length):i.bytes===Array?Array.prototype.slice.call(e.companionPublicKey):e.companionPublicKey,i.oneofs&&(A._companionPublicKey="companionPublicKey")),e.companionIdentityKey!=null&&e.hasOwnProperty("companionIdentityKey")&&(A.companionIdentityKey=i.bytes===String?l.base64.encode(e.companionIdentityKey,0,e.companionIdentityKey.length):i.bytes===Array?Array.prototype.slice.call(e.companionIdentityKey):e.companionIdentityKey,i.oneofs&&(A._companionIdentityKey="companionIdentityKey")),e.advSecret!=null&&e.hasOwnProperty("advSecret")&&(A.advSecret=i.bytes===String?l.base64.encode(e.advSecret,0,e.advSecret.length):i.bytes===Array?Array.prototype.slice.call(e.advSecret):e.advSecret,i.oneofs&&(A._advSecret="advSecret")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PairingRequest"},t})(),n.PastParticipant=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.userJid=e.string();break}case 2:{s.leaveReason=e.int32();break}case 3:{s.leaveTs=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PastParticipant)return e;var i=new d.proto.PastParticipant;switch(e.userJid!=null&&(i.userJid=String(e.userJid)),e.leaveReason){default:if(typeof e.leaveReason=="number"){i.leaveReason=e.leaveReason;break}break;case"LEFT":case 0:i.leaveReason=0;break;case"REMOVED":case 1:i.leaveReason=1;break}return e.leaveTs!=null&&(l.Long?(i.leaveTs=l.Long.fromValue(e.leaveTs)).unsigned=!0:typeof e.leaveTs=="string"?i.leaveTs=parseInt(e.leaveTs,10):typeof e.leaveTs=="number"?i.leaveTs=e.leaveTs:typeof e.leaveTs=="object"&&(i.leaveTs=new l.LongBits(e.leaveTs.low>>>0,e.leaveTs.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};return e.userJid!=null&&e.hasOwnProperty("userJid")&&(A.userJid=e.userJid,i.oneofs&&(A._userJid="userJid")),e.leaveReason!=null&&e.hasOwnProperty("leaveReason")&&(A.leaveReason=i.enums===String?d.proto.PastParticipant.LeaveReason[e.leaveReason]===void 0?e.leaveReason:d.proto.PastParticipant.LeaveReason[e.leaveReason]:e.leaveReason,i.oneofs&&(A._leaveReason="leaveReason")),e.leaveTs!=null&&e.hasOwnProperty("leaveTs")&&(typeof e.leaveTs=="number"?A.leaveTs=i.longs===String?String(e.leaveTs):e.leaveTs:A.leaveTs=i.longs===String?ge(e.leaveTs,!0):i.longs===Number?ce(e.leaveTs,!0):e.leaveTs,i.oneofs&&(A._leaveTs="leaveTs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PastParticipant"},t.LeaveReason=(function(){let a={},e=Object.create(a);return e[a[0]="LEFT"]=0,e[a[1]="REMOVED"]=1,e})(),t})(),n.PastParticipants=(function(){function t(a){if(this.pastParticipants=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.groupJid=e.string();break}case 2:{s.pastParticipants&&s.pastParticipants.length||(s.pastParticipants=[]),s.pastParticipants.push(d.proto.PastParticipant.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PastParticipants)return e;var i=new d.proto.PastParticipants;if(e.groupJid!=null&&(i.groupJid=String(e.groupJid)),e.pastParticipants){if(!Array.isArray(e.pastParticipants))throw TypeError(".proto.PastParticipants.pastParticipants: array expected");i.pastParticipants=[];for(var A=0;A>>3){case 1:{s.currentLthash=e.bytes();break}case 2:{s.newLthash=e.bytes();break}case 3:{s.patchVersion=e.bytes();break}case 4:{s.collectionName=e.bytes();break}case 5:{s.firstFourBytesFromAHashOfSnapshotMacKey=e.bytes();break}case 6:{s.newLthashSubtract=e.bytes();break}case 7:{s.numberAdd=e.int32();break}case 8:{s.numberRemove=e.int32();break}case 9:{s.numberOverride=e.int32();break}case 10:{s.senderPlatform=e.int32();break}case 11:{s.isSenderPrimary=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PatchDebugData)return e;var i=new d.proto.PatchDebugData;switch(e.currentLthash!=null&&(typeof e.currentLthash=="string"?l.base64.decode(e.currentLthash,i.currentLthash=l.newBuffer(l.base64.length(e.currentLthash)),0):e.currentLthash.length>=0&&(i.currentLthash=e.currentLthash)),e.newLthash!=null&&(typeof e.newLthash=="string"?l.base64.decode(e.newLthash,i.newLthash=l.newBuffer(l.base64.length(e.newLthash)),0):e.newLthash.length>=0&&(i.newLthash=e.newLthash)),e.patchVersion!=null&&(typeof e.patchVersion=="string"?l.base64.decode(e.patchVersion,i.patchVersion=l.newBuffer(l.base64.length(e.patchVersion)),0):e.patchVersion.length>=0&&(i.patchVersion=e.patchVersion)),e.collectionName!=null&&(typeof e.collectionName=="string"?l.base64.decode(e.collectionName,i.collectionName=l.newBuffer(l.base64.length(e.collectionName)),0):e.collectionName.length>=0&&(i.collectionName=e.collectionName)),e.firstFourBytesFromAHashOfSnapshotMacKey!=null&&(typeof e.firstFourBytesFromAHashOfSnapshotMacKey=="string"?l.base64.decode(e.firstFourBytesFromAHashOfSnapshotMacKey,i.firstFourBytesFromAHashOfSnapshotMacKey=l.newBuffer(l.base64.length(e.firstFourBytesFromAHashOfSnapshotMacKey)),0):e.firstFourBytesFromAHashOfSnapshotMacKey.length>=0&&(i.firstFourBytesFromAHashOfSnapshotMacKey=e.firstFourBytesFromAHashOfSnapshotMacKey)),e.newLthashSubtract!=null&&(typeof e.newLthashSubtract=="string"?l.base64.decode(e.newLthashSubtract,i.newLthashSubtract=l.newBuffer(l.base64.length(e.newLthashSubtract)),0):e.newLthashSubtract.length>=0&&(i.newLthashSubtract=e.newLthashSubtract)),e.numberAdd!=null&&(i.numberAdd=e.numberAdd|0),e.numberRemove!=null&&(i.numberRemove=e.numberRemove|0),e.numberOverride!=null&&(i.numberOverride=e.numberOverride|0),e.senderPlatform){default:if(typeof e.senderPlatform=="number"){i.senderPlatform=e.senderPlatform;break}break;case"ANDROID":case 0:i.senderPlatform=0;break;case"SMBA":case 1:i.senderPlatform=1;break;case"IPHONE":case 2:i.senderPlatform=2;break;case"SMBI":case 3:i.senderPlatform=3;break;case"WEB":case 4:i.senderPlatform=4;break;case"UWP":case 5:i.senderPlatform=5;break;case"DARWIN":case 6:i.senderPlatform=6;break;case"IPAD":case 7:i.senderPlatform=7;break;case"WEAROS":case 8:i.senderPlatform=8;break;case"WASG":case 9:i.senderPlatform=9;break;case"WEARM":case 10:i.senderPlatform=10;break;case"CAPI":case 11:i.senderPlatform=11;break}return e.isSenderPrimary!=null&&(i.isSenderPrimary=!!e.isSenderPrimary),i},t.toObject=function(e,i){i||(i={});var A={};return e.currentLthash!=null&&e.hasOwnProperty("currentLthash")&&(A.currentLthash=i.bytes===String?l.base64.encode(e.currentLthash,0,e.currentLthash.length):i.bytes===Array?Array.prototype.slice.call(e.currentLthash):e.currentLthash,i.oneofs&&(A._currentLthash="currentLthash")),e.newLthash!=null&&e.hasOwnProperty("newLthash")&&(A.newLthash=i.bytes===String?l.base64.encode(e.newLthash,0,e.newLthash.length):i.bytes===Array?Array.prototype.slice.call(e.newLthash):e.newLthash,i.oneofs&&(A._newLthash="newLthash")),e.patchVersion!=null&&e.hasOwnProperty("patchVersion")&&(A.patchVersion=i.bytes===String?l.base64.encode(e.patchVersion,0,e.patchVersion.length):i.bytes===Array?Array.prototype.slice.call(e.patchVersion):e.patchVersion,i.oneofs&&(A._patchVersion="patchVersion")),e.collectionName!=null&&e.hasOwnProperty("collectionName")&&(A.collectionName=i.bytes===String?l.base64.encode(e.collectionName,0,e.collectionName.length):i.bytes===Array?Array.prototype.slice.call(e.collectionName):e.collectionName,i.oneofs&&(A._collectionName="collectionName")),e.firstFourBytesFromAHashOfSnapshotMacKey!=null&&e.hasOwnProperty("firstFourBytesFromAHashOfSnapshotMacKey")&&(A.firstFourBytesFromAHashOfSnapshotMacKey=i.bytes===String?l.base64.encode(e.firstFourBytesFromAHashOfSnapshotMacKey,0,e.firstFourBytesFromAHashOfSnapshotMacKey.length):i.bytes===Array?Array.prototype.slice.call(e.firstFourBytesFromAHashOfSnapshotMacKey):e.firstFourBytesFromAHashOfSnapshotMacKey,i.oneofs&&(A._firstFourBytesFromAHashOfSnapshotMacKey="firstFourBytesFromAHashOfSnapshotMacKey")),e.newLthashSubtract!=null&&e.hasOwnProperty("newLthashSubtract")&&(A.newLthashSubtract=i.bytes===String?l.base64.encode(e.newLthashSubtract,0,e.newLthashSubtract.length):i.bytes===Array?Array.prototype.slice.call(e.newLthashSubtract):e.newLthashSubtract,i.oneofs&&(A._newLthashSubtract="newLthashSubtract")),e.numberAdd!=null&&e.hasOwnProperty("numberAdd")&&(A.numberAdd=e.numberAdd,i.oneofs&&(A._numberAdd="numberAdd")),e.numberRemove!=null&&e.hasOwnProperty("numberRemove")&&(A.numberRemove=e.numberRemove,i.oneofs&&(A._numberRemove="numberRemove")),e.numberOverride!=null&&e.hasOwnProperty("numberOverride")&&(A.numberOverride=e.numberOverride,i.oneofs&&(A._numberOverride="numberOverride")),e.senderPlatform!=null&&e.hasOwnProperty("senderPlatform")&&(A.senderPlatform=i.enums===String?d.proto.PatchDebugData.Platform[e.senderPlatform]===void 0?e.senderPlatform:d.proto.PatchDebugData.Platform[e.senderPlatform]:e.senderPlatform,i.oneofs&&(A._senderPlatform="senderPlatform")),e.isSenderPrimary!=null&&e.hasOwnProperty("isSenderPrimary")&&(A.isSenderPrimary=e.isSenderPrimary,i.oneofs&&(A._isSenderPrimary="isSenderPrimary")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PatchDebugData"},t.Platform=(function(){let a={},e=Object.create(a);return e[a[0]="ANDROID"]=0,e[a[1]="SMBA"]=1,e[a[2]="IPHONE"]=2,e[a[3]="SMBI"]=3,e[a[4]="WEB"]=4,e[a[5]="UWP"]=5,e[a[6]="DARWIN"]=6,e[a[7]="IPAD"]=7,e[a[8]="WEAROS"]=8,e[a[9]="WASG"]=9,e[a[10]="WEARM"]=10,e[a[11]="CAPI"]=11,e})(),t})(),n.PaymentBackground=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.string();break}case 2:{s.fileLength=e.uint64();break}case 3:{s.width=e.uint32();break}case 4:{s.height=e.uint32();break}case 5:{s.mimetype=e.string();break}case 6:{s.placeholderArgb=e.fixed32();break}case 7:{s.textArgb=e.fixed32();break}case 8:{s.subtextArgb=e.fixed32();break}case 9:{s.mediaData=d.proto.PaymentBackground.MediaData.decode(e,e.uint32());break}case 10:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PaymentBackground)return e;var i=new d.proto.PaymentBackground;if(e.id!=null&&(i.id=String(e.id)),e.fileLength!=null&&(l.Long?(i.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?i.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?i.fileLength=e.fileLength:typeof e.fileLength=="object"&&(i.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.width!=null&&(i.width=e.width>>>0),e.height!=null&&(i.height=e.height>>>0),e.mimetype!=null&&(i.mimetype=String(e.mimetype)),e.placeholderArgb!=null&&(i.placeholderArgb=e.placeholderArgb>>>0),e.textArgb!=null&&(i.textArgb=e.textArgb>>>0),e.subtextArgb!=null&&(i.subtextArgb=e.subtextArgb>>>0),e.mediaData!=null){if(typeof e.mediaData!="object")throw TypeError(".proto.PaymentBackground.mediaData: object expected");i.mediaData=d.proto.PaymentBackground.MediaData.fromObject(e.mediaData)}switch(e.type){default:if(typeof e.type=="number"){i.type=e.type;break}break;case"UNKNOWN":case 0:i.type=0;break;case"DEFAULT":case 1:i.type=1;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=i.longs===String?String(e.fileLength):e.fileLength:A.fileLength=i.longs===String?ge(e.fileLength,!0):i.longs===Number?ce(e.fileLength,!0):e.fileLength,i.oneofs&&(A._fileLength="fileLength")),e.width!=null&&e.hasOwnProperty("width")&&(A.width=e.width,i.oneofs&&(A._width="width")),e.height!=null&&e.hasOwnProperty("height")&&(A.height=e.height,i.oneofs&&(A._height="height")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,i.oneofs&&(A._mimetype="mimetype")),e.placeholderArgb!=null&&e.hasOwnProperty("placeholderArgb")&&(A.placeholderArgb=e.placeholderArgb,i.oneofs&&(A._placeholderArgb="placeholderArgb")),e.textArgb!=null&&e.hasOwnProperty("textArgb")&&(A.textArgb=e.textArgb,i.oneofs&&(A._textArgb="textArgb")),e.subtextArgb!=null&&e.hasOwnProperty("subtextArgb")&&(A.subtextArgb=e.subtextArgb,i.oneofs&&(A._subtextArgb="subtextArgb")),e.mediaData!=null&&e.hasOwnProperty("mediaData")&&(A.mediaData=d.proto.PaymentBackground.MediaData.toObject(e.mediaData,i),i.oneofs&&(A._mediaData="mediaData")),e.type!=null&&e.hasOwnProperty("type")&&(A.type=i.enums===String?d.proto.PaymentBackground.Type[e.type]===void 0?e.type:d.proto.PaymentBackground.Type[e.type]:e.type,i.oneofs&&(A._type="type")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PaymentBackground"},t.MediaData=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.mediaKey=A.bytes();break}case 2:{c.mediaKeyTimestamp=A.int64();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.PaymentBackground.MediaData)return A;var r=new d.proto.PaymentBackground.MediaData;return A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),r},a.toObject=function(A,r){r||(r={});var s={};return A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.PaymentBackground.MediaData"},a})(),t.Type=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="DEFAULT"]=1,e})(),t})(),n.PaymentInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.currencyDeprecated=e.int32();break}case 2:{s.amount1000=e.uint64();break}case 3:{s.receiverJid=e.string();break}case 4:{s.status=e.int32();break}case 5:{s.transactionTimestamp=e.uint64();break}case 6:{s.requestMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 7:{s.expiryTimestamp=e.uint64();break}case 8:{s.futureproofed=e.bool();break}case 9:{s.currency=e.string();break}case 10:{s.txnStatus=e.int32();break}case 11:{s.useNoviFiatFormat=e.bool();break}case 12:{s.primaryAmount=d.proto.Money.decode(e,e.uint32());break}case 13:{s.exchangeAmount=d.proto.Money.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PaymentInfo)return e;var i=new d.proto.PaymentInfo;switch(e.currencyDeprecated){default:if(typeof e.currencyDeprecated=="number"){i.currencyDeprecated=e.currencyDeprecated;break}break;case"UNKNOWN_CURRENCY":case 0:i.currencyDeprecated=0;break;case"INR":case 1:i.currencyDeprecated=1;break}switch(e.amount1000!=null&&(l.Long?(i.amount1000=l.Long.fromValue(e.amount1000)).unsigned=!0:typeof e.amount1000=="string"?i.amount1000=parseInt(e.amount1000,10):typeof e.amount1000=="number"?i.amount1000=e.amount1000:typeof e.amount1000=="object"&&(i.amount1000=new l.LongBits(e.amount1000.low>>>0,e.amount1000.high>>>0).toNumber(!0))),e.receiverJid!=null&&(i.receiverJid=String(e.receiverJid)),e.status){default:if(typeof e.status=="number"){i.status=e.status;break}break;case"UNKNOWN_STATUS":case 0:i.status=0;break;case"PROCESSING":case 1:i.status=1;break;case"SENT":case 2:i.status=2;break;case"NEED_TO_ACCEPT":case 3:i.status=3;break;case"COMPLETE":case 4:i.status=4;break;case"COULD_NOT_COMPLETE":case 5:i.status=5;break;case"REFUNDED":case 6:i.status=6;break;case"EXPIRED":case 7:i.status=7;break;case"REJECTED":case 8:i.status=8;break;case"CANCELLED":case 9:i.status=9;break;case"WAITING_FOR_PAYER":case 10:i.status=10;break;case"WAITING":case 11:i.status=11;break}if(e.transactionTimestamp!=null&&(l.Long?(i.transactionTimestamp=l.Long.fromValue(e.transactionTimestamp)).unsigned=!0:typeof e.transactionTimestamp=="string"?i.transactionTimestamp=parseInt(e.transactionTimestamp,10):typeof e.transactionTimestamp=="number"?i.transactionTimestamp=e.transactionTimestamp:typeof e.transactionTimestamp=="object"&&(i.transactionTimestamp=new l.LongBits(e.transactionTimestamp.low>>>0,e.transactionTimestamp.high>>>0).toNumber(!0))),e.requestMessageKey!=null){if(typeof e.requestMessageKey!="object")throw TypeError(".proto.PaymentInfo.requestMessageKey: object expected");i.requestMessageKey=d.proto.MessageKey.fromObject(e.requestMessageKey)}switch(e.expiryTimestamp!=null&&(l.Long?(i.expiryTimestamp=l.Long.fromValue(e.expiryTimestamp)).unsigned=!0:typeof e.expiryTimestamp=="string"?i.expiryTimestamp=parseInt(e.expiryTimestamp,10):typeof e.expiryTimestamp=="number"?i.expiryTimestamp=e.expiryTimestamp:typeof e.expiryTimestamp=="object"&&(i.expiryTimestamp=new l.LongBits(e.expiryTimestamp.low>>>0,e.expiryTimestamp.high>>>0).toNumber(!0))),e.futureproofed!=null&&(i.futureproofed=!!e.futureproofed),e.currency!=null&&(i.currency=String(e.currency)),e.txnStatus){default:if(typeof e.txnStatus=="number"){i.txnStatus=e.txnStatus;break}break;case"UNKNOWN":case 0:i.txnStatus=0;break;case"PENDING_SETUP":case 1:i.txnStatus=1;break;case"PENDING_RECEIVER_SETUP":case 2:i.txnStatus=2;break;case"INIT":case 3:i.txnStatus=3;break;case"SUCCESS":case 4:i.txnStatus=4;break;case"COMPLETED":case 5:i.txnStatus=5;break;case"FAILED":case 6:i.txnStatus=6;break;case"FAILED_RISK":case 7:i.txnStatus=7;break;case"FAILED_PROCESSING":case 8:i.txnStatus=8;break;case"FAILED_RECEIVER_PROCESSING":case 9:i.txnStatus=9;break;case"FAILED_DA":case 10:i.txnStatus=10;break;case"FAILED_DA_FINAL":case 11:i.txnStatus=11;break;case"REFUNDED_TXN":case 12:i.txnStatus=12;break;case"REFUND_FAILED":case 13:i.txnStatus=13;break;case"REFUND_FAILED_PROCESSING":case 14:i.txnStatus=14;break;case"REFUND_FAILED_DA":case 15:i.txnStatus=15;break;case"EXPIRED_TXN":case 16:i.txnStatus=16;break;case"AUTH_CANCELED":case 17:i.txnStatus=17;break;case"AUTH_CANCEL_FAILED_PROCESSING":case 18:i.txnStatus=18;break;case"AUTH_CANCEL_FAILED":case 19:i.txnStatus=19;break;case"COLLECT_INIT":case 20:i.txnStatus=20;break;case"COLLECT_SUCCESS":case 21:i.txnStatus=21;break;case"COLLECT_FAILED":case 22:i.txnStatus=22;break;case"COLLECT_FAILED_RISK":case 23:i.txnStatus=23;break;case"COLLECT_REJECTED":case 24:i.txnStatus=24;break;case"COLLECT_EXPIRED":case 25:i.txnStatus=25;break;case"COLLECT_CANCELED":case 26:i.txnStatus=26;break;case"COLLECT_CANCELLING":case 27:i.txnStatus=27;break;case"IN_REVIEW":case 28:i.txnStatus=28;break;case"REVERSAL_SUCCESS":case 29:i.txnStatus=29;break;case"REVERSAL_PENDING":case 30:i.txnStatus=30;break;case"REFUND_PENDING":case 31:i.txnStatus=31;break}if(e.useNoviFiatFormat!=null&&(i.useNoviFiatFormat=!!e.useNoviFiatFormat),e.primaryAmount!=null){if(typeof e.primaryAmount!="object")throw TypeError(".proto.PaymentInfo.primaryAmount: object expected");i.primaryAmount=d.proto.Money.fromObject(e.primaryAmount)}if(e.exchangeAmount!=null){if(typeof e.exchangeAmount!="object")throw TypeError(".proto.PaymentInfo.exchangeAmount: object expected");i.exchangeAmount=d.proto.Money.fromObject(e.exchangeAmount)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.currencyDeprecated!=null&&e.hasOwnProperty("currencyDeprecated")&&(A.currencyDeprecated=i.enums===String?d.proto.PaymentInfo.Currency[e.currencyDeprecated]===void 0?e.currencyDeprecated:d.proto.PaymentInfo.Currency[e.currencyDeprecated]:e.currencyDeprecated,i.oneofs&&(A._currencyDeprecated="currencyDeprecated")),e.amount1000!=null&&e.hasOwnProperty("amount1000")&&(typeof e.amount1000=="number"?A.amount1000=i.longs===String?String(e.amount1000):e.amount1000:A.amount1000=i.longs===String?ge(e.amount1000,!0):i.longs===Number?ce(e.amount1000,!0):e.amount1000,i.oneofs&&(A._amount1000="amount1000")),e.receiverJid!=null&&e.hasOwnProperty("receiverJid")&&(A.receiverJid=e.receiverJid,i.oneofs&&(A._receiverJid="receiverJid")),e.status!=null&&e.hasOwnProperty("status")&&(A.status=i.enums===String?d.proto.PaymentInfo.Status[e.status]===void 0?e.status:d.proto.PaymentInfo.Status[e.status]:e.status,i.oneofs&&(A._status="status")),e.transactionTimestamp!=null&&e.hasOwnProperty("transactionTimestamp")&&(typeof e.transactionTimestamp=="number"?A.transactionTimestamp=i.longs===String?String(e.transactionTimestamp):e.transactionTimestamp:A.transactionTimestamp=i.longs===String?ge(e.transactionTimestamp,!0):i.longs===Number?ce(e.transactionTimestamp,!0):e.transactionTimestamp,i.oneofs&&(A._transactionTimestamp="transactionTimestamp")),e.requestMessageKey!=null&&e.hasOwnProperty("requestMessageKey")&&(A.requestMessageKey=d.proto.MessageKey.toObject(e.requestMessageKey,i),i.oneofs&&(A._requestMessageKey="requestMessageKey")),e.expiryTimestamp!=null&&e.hasOwnProperty("expiryTimestamp")&&(typeof e.expiryTimestamp=="number"?A.expiryTimestamp=i.longs===String?String(e.expiryTimestamp):e.expiryTimestamp:A.expiryTimestamp=i.longs===String?ge(e.expiryTimestamp,!0):i.longs===Number?ce(e.expiryTimestamp,!0):e.expiryTimestamp,i.oneofs&&(A._expiryTimestamp="expiryTimestamp")),e.futureproofed!=null&&e.hasOwnProperty("futureproofed")&&(A.futureproofed=e.futureproofed,i.oneofs&&(A._futureproofed="futureproofed")),e.currency!=null&&e.hasOwnProperty("currency")&&(A.currency=e.currency,i.oneofs&&(A._currency="currency")),e.txnStatus!=null&&e.hasOwnProperty("txnStatus")&&(A.txnStatus=i.enums===String?d.proto.PaymentInfo.TxnStatus[e.txnStatus]===void 0?e.txnStatus:d.proto.PaymentInfo.TxnStatus[e.txnStatus]:e.txnStatus,i.oneofs&&(A._txnStatus="txnStatus")),e.useNoviFiatFormat!=null&&e.hasOwnProperty("useNoviFiatFormat")&&(A.useNoviFiatFormat=e.useNoviFiatFormat,i.oneofs&&(A._useNoviFiatFormat="useNoviFiatFormat")),e.primaryAmount!=null&&e.hasOwnProperty("primaryAmount")&&(A.primaryAmount=d.proto.Money.toObject(e.primaryAmount,i),i.oneofs&&(A._primaryAmount="primaryAmount")),e.exchangeAmount!=null&&e.hasOwnProperty("exchangeAmount")&&(A.exchangeAmount=d.proto.Money.toObject(e.exchangeAmount,i),i.oneofs&&(A._exchangeAmount="exchangeAmount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PaymentInfo"},t.Currency=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_CURRENCY"]=0,e[a[1]="INR"]=1,e})(),t.Status=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_STATUS"]=0,e[a[1]="PROCESSING"]=1,e[a[2]="SENT"]=2,e[a[3]="NEED_TO_ACCEPT"]=3,e[a[4]="COMPLETE"]=4,e[a[5]="COULD_NOT_COMPLETE"]=5,e[a[6]="REFUNDED"]=6,e[a[7]="EXPIRED"]=7,e[a[8]="REJECTED"]=8,e[a[9]="CANCELLED"]=9,e[a[10]="WAITING_FOR_PAYER"]=10,e[a[11]="WAITING"]=11,e})(),t.TxnStatus=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="PENDING_SETUP"]=1,e[a[2]="PENDING_RECEIVER_SETUP"]=2,e[a[3]="INIT"]=3,e[a[4]="SUCCESS"]=4,e[a[5]="COMPLETED"]=5,e[a[6]="FAILED"]=6,e[a[7]="FAILED_RISK"]=7,e[a[8]="FAILED_PROCESSING"]=8,e[a[9]="FAILED_RECEIVER_PROCESSING"]=9,e[a[10]="FAILED_DA"]=10,e[a[11]="FAILED_DA_FINAL"]=11,e[a[12]="REFUNDED_TXN"]=12,e[a[13]="REFUND_FAILED"]=13,e[a[14]="REFUND_FAILED_PROCESSING"]=14,e[a[15]="REFUND_FAILED_DA"]=15,e[a[16]="EXPIRED_TXN"]=16,e[a[17]="AUTH_CANCELED"]=17,e[a[18]="AUTH_CANCEL_FAILED_PROCESSING"]=18,e[a[19]="AUTH_CANCEL_FAILED"]=19,e[a[20]="COLLECT_INIT"]=20,e[a[21]="COLLECT_SUCCESS"]=21,e[a[22]="COLLECT_FAILED"]=22,e[a[23]="COLLECT_FAILED_RISK"]=23,e[a[24]="COLLECT_REJECTED"]=24,e[a[25]="COLLECT_EXPIRED"]=25,e[a[26]="COLLECT_CANCELED"]=26,e[a[27]="COLLECT_CANCELLING"]=27,e[a[28]="IN_REVIEW"]=28,e[a[29]="REVERSAL_SUCCESS"]=29,e[a[30]="REVERSAL_PENDING"]=30,e[a[31]="REFUND_PENDING"]=31,e})(),t})(),n.PhoneNumberToLIDMapping=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.pnJid=e.string();break}case 2:{s.lidJid=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PhoneNumberToLIDMapping)return e;var i=new d.proto.PhoneNumberToLIDMapping;return e.pnJid!=null&&(i.pnJid=String(e.pnJid)),e.lidJid!=null&&(i.lidJid=String(e.lidJid)),i},t.toObject=function(e,i){i||(i={});var A={};return e.pnJid!=null&&e.hasOwnProperty("pnJid")&&(A.pnJid=e.pnJid,i.oneofs&&(A._pnJid="pnJid")),e.lidJid!=null&&e.hasOwnProperty("lidJid")&&(A.lidJid=e.lidJid,i.oneofs&&(A._lidJid="lidJid")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PhoneNumberToLIDMapping"},t})(),n.PhotoChange=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.oldPhoto=e.bytes();break}case 2:{s.newPhoto=e.bytes();break}case 3:{s.newPhotoId=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PhotoChange)return e;var i=new d.proto.PhotoChange;return e.oldPhoto!=null&&(typeof e.oldPhoto=="string"?l.base64.decode(e.oldPhoto,i.oldPhoto=l.newBuffer(l.base64.length(e.oldPhoto)),0):e.oldPhoto.length>=0&&(i.oldPhoto=e.oldPhoto)),e.newPhoto!=null&&(typeof e.newPhoto=="string"?l.base64.decode(e.newPhoto,i.newPhoto=l.newBuffer(l.base64.length(e.newPhoto)),0):e.newPhoto.length>=0&&(i.newPhoto=e.newPhoto)),e.newPhotoId!=null&&(i.newPhotoId=e.newPhotoId>>>0),i},t.toObject=function(e,i){i||(i={});var A={};return e.oldPhoto!=null&&e.hasOwnProperty("oldPhoto")&&(A.oldPhoto=i.bytes===String?l.base64.encode(e.oldPhoto,0,e.oldPhoto.length):i.bytes===Array?Array.prototype.slice.call(e.oldPhoto):e.oldPhoto,i.oneofs&&(A._oldPhoto="oldPhoto")),e.newPhoto!=null&&e.hasOwnProperty("newPhoto")&&(A.newPhoto=i.bytes===String?l.base64.encode(e.newPhoto,0,e.newPhoto.length):i.bytes===Array?Array.prototype.slice.call(e.newPhoto):e.newPhoto,i.oneofs&&(A._newPhoto="newPhoto")),e.newPhotoId!=null&&e.hasOwnProperty("newPhotoId")&&(A.newPhotoId=e.newPhotoId,i.oneofs&&(A._newPhotoId="newPhotoId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PhotoChange"},t})(),n.PinInChat=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.type=e.int32();break}case 2:{s.key=d.proto.MessageKey.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.messageAddOnContextInfo=d.proto.MessageAddOnContextInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PinInChat)return e;var i=new d.proto.PinInChat;switch(e.type){default:if(typeof e.type=="number"){i.type=e.type;break}break;case"UNKNOWN_TYPE":case 0:i.type=0;break;case"PIN_FOR_ALL":case 1:i.type=1;break;case"UNPIN_FOR_ALL":case 2:i.type=2;break}if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.PinInChat.key: object expected");i.key=d.proto.MessageKey.fromObject(e.key)}if(e.senderTimestampMs!=null&&(l.Long?(i.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?i.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?i.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(i.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(i.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?i.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?i.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(i.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.messageAddOnContextInfo!=null){if(typeof e.messageAddOnContextInfo!="object")throw TypeError(".proto.PinInChat.messageAddOnContextInfo: object expected");i.messageAddOnContextInfo=d.proto.MessageAddOnContextInfo.fromObject(e.messageAddOnContextInfo)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=i.enums===String?d.proto.PinInChat.Type[e.type]===void 0?e.type:d.proto.PinInChat.Type[e.type]:e.type,i.oneofs&&(A._type="type")),e.key!=null&&e.hasOwnProperty("key")&&(A.key=d.proto.MessageKey.toObject(e.key,i),i.oneofs&&(A._key="key")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=i.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=i.longs===String?ge(e.senderTimestampMs):i.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,i.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=i.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=i.longs===String?ge(e.serverTimestampMs):i.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,i.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.messageAddOnContextInfo!=null&&e.hasOwnProperty("messageAddOnContextInfo")&&(A.messageAddOnContextInfo=d.proto.MessageAddOnContextInfo.toObject(e.messageAddOnContextInfo,i),i.oneofs&&(A._messageAddOnContextInfo="messageAddOnContextInfo")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PinInChat"},t.Type=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_TYPE"]=0,e[a[1]="PIN_FOR_ALL"]=1,e[a[2]="UNPIN_FOR_ALL"]=2,e})(),t})(),n.Point=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.xDeprecated=e.int32();break}case 2:{s.yDeprecated=e.int32();break}case 3:{s.x=e.double();break}case 4:{s.y=e.double();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Point)return e;var i=new d.proto.Point;return e.xDeprecated!=null&&(i.xDeprecated=e.xDeprecated|0),e.yDeprecated!=null&&(i.yDeprecated=e.yDeprecated|0),e.x!=null&&(i.x=Number(e.x)),e.y!=null&&(i.y=Number(e.y)),i},t.toObject=function(e,i){i||(i={});var A={};return e.xDeprecated!=null&&e.hasOwnProperty("xDeprecated")&&(A.xDeprecated=e.xDeprecated,i.oneofs&&(A._xDeprecated="xDeprecated")),e.yDeprecated!=null&&e.hasOwnProperty("yDeprecated")&&(A.yDeprecated=e.yDeprecated,i.oneofs&&(A._yDeprecated="yDeprecated")),e.x!=null&&e.hasOwnProperty("x")&&(A.x=i.json&&!isFinite(e.x)?String(e.x):e.x,i.oneofs&&(A._x="x")),e.y!=null&&e.hasOwnProperty("y")&&(A.y=i.json&&!isFinite(e.y)?String(e.y):e.y,i.oneofs&&(A._y="y")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Point"},t})(),n.PollAdditionalMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.pollInvalidated=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PollAdditionalMetadata)return e;var i=new d.proto.PollAdditionalMetadata;return e.pollInvalidated!=null&&(i.pollInvalidated=!!e.pollInvalidated),i},t.toObject=function(e,i){i||(i={});var A={};return e.pollInvalidated!=null&&e.hasOwnProperty("pollInvalidated")&&(A.pollInvalidated=e.pollInvalidated,i.oneofs&&(A._pollInvalidated="pollInvalidated")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollAdditionalMetadata"},t})(),n.PollEncValue=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.encPayload=e.bytes();break}case 2:{s.encIv=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PollEncValue)return e;var i=new d.proto.PollEncValue;return e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,i.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(i.encPayload=e.encPayload)),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,i.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(i.encIv=e.encIv)),i},t.toObject=function(e,i){i||(i={});var A={};return e.encPayload!=null&&e.hasOwnProperty("encPayload")&&(A.encPayload=i.bytes===String?l.base64.encode(e.encPayload,0,e.encPayload.length):i.bytes===Array?Array.prototype.slice.call(e.encPayload):e.encPayload,i.oneofs&&(A._encPayload="encPayload")),e.encIv!=null&&e.hasOwnProperty("encIv")&&(A.encIv=i.bytes===String?l.base64.encode(e.encIv,0,e.encIv.length):i.bytes===Array?Array.prototype.slice.call(e.encIv):e.encIv,i.oneofs&&(A._encIv="encIv")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollEncValue"},t})(),n.PollUpdate=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.pollUpdateMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.vote=d.proto.Message.PollVoteMessage.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PollUpdate)return e;var i=new d.proto.PollUpdate;if(e.pollUpdateMessageKey!=null){if(typeof e.pollUpdateMessageKey!="object")throw TypeError(".proto.PollUpdate.pollUpdateMessageKey: object expected");i.pollUpdateMessageKey=d.proto.MessageKey.fromObject(e.pollUpdateMessageKey)}if(e.vote!=null){if(typeof e.vote!="object")throw TypeError(".proto.PollUpdate.vote: object expected");i.vote=d.proto.Message.PollVoteMessage.fromObject(e.vote)}return e.senderTimestampMs!=null&&(l.Long?(i.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?i.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?i.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(i.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(i.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?i.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?i.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(i.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.unread!=null&&(i.unread=!!e.unread),i},t.toObject=function(e,i){i||(i={});var A={};return e.pollUpdateMessageKey!=null&&e.hasOwnProperty("pollUpdateMessageKey")&&(A.pollUpdateMessageKey=d.proto.MessageKey.toObject(e.pollUpdateMessageKey,i),i.oneofs&&(A._pollUpdateMessageKey="pollUpdateMessageKey")),e.vote!=null&&e.hasOwnProperty("vote")&&(A.vote=d.proto.Message.PollVoteMessage.toObject(e.vote,i),i.oneofs&&(A._vote="vote")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=i.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=i.longs===String?ge(e.senderTimestampMs):i.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,i.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=i.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=i.longs===String?ge(e.serverTimestampMs):i.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,i.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,i.oneofs&&(A._unread="unread")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollUpdate"},t})(),n.PreKeyRecordStructure=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.uint32();break}case 2:{s.publicKey=e.bytes();break}case 3:{s.privateKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PreKeyRecordStructure)return e;var i=new d.proto.PreKeyRecordStructure;return e.id!=null&&(i.id=e.id>>>0),e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,i.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(i.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,i.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(i.privateKey=e.privateKey)),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=i.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):i.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,i.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=i.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):i.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,i.oneofs&&(A._privateKey="privateKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PreKeyRecordStructure"},t})(),n.PreKeySignalMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 5:{s.registrationId=e.uint32();break}case 1:{s.preKeyId=e.uint32();break}case 6:{s.signedPreKeyId=e.uint32();break}case 2:{s.baseKey=e.bytes();break}case 3:{s.identityKey=e.bytes();break}case 4:{s.message=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PreKeySignalMessage)return e;var i=new d.proto.PreKeySignalMessage;return e.registrationId!=null&&(i.registrationId=e.registrationId>>>0),e.preKeyId!=null&&(i.preKeyId=e.preKeyId>>>0),e.signedPreKeyId!=null&&(i.signedPreKeyId=e.signedPreKeyId>>>0),e.baseKey!=null&&(typeof e.baseKey=="string"?l.base64.decode(e.baseKey,i.baseKey=l.newBuffer(l.base64.length(e.baseKey)),0):e.baseKey.length>=0&&(i.baseKey=e.baseKey)),e.identityKey!=null&&(typeof e.identityKey=="string"?l.base64.decode(e.identityKey,i.identityKey=l.newBuffer(l.base64.length(e.identityKey)),0):e.identityKey.length>=0&&(i.identityKey=e.identityKey)),e.message!=null&&(typeof e.message=="string"?l.base64.decode(e.message,i.message=l.newBuffer(l.base64.length(e.message)),0):e.message.length>=0&&(i.message=e.message)),i},t.toObject=function(e,i){i||(i={});var A={};return e.preKeyId!=null&&e.hasOwnProperty("preKeyId")&&(A.preKeyId=e.preKeyId,i.oneofs&&(A._preKeyId="preKeyId")),e.baseKey!=null&&e.hasOwnProperty("baseKey")&&(A.baseKey=i.bytes===String?l.base64.encode(e.baseKey,0,e.baseKey.length):i.bytes===Array?Array.prototype.slice.call(e.baseKey):e.baseKey,i.oneofs&&(A._baseKey="baseKey")),e.identityKey!=null&&e.hasOwnProperty("identityKey")&&(A.identityKey=i.bytes===String?l.base64.encode(e.identityKey,0,e.identityKey.length):i.bytes===Array?Array.prototype.slice.call(e.identityKey):e.identityKey,i.oneofs&&(A._identityKey="identityKey")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=i.bytes===String?l.base64.encode(e.message,0,e.message.length):i.bytes===Array?Array.prototype.slice.call(e.message):e.message,i.oneofs&&(A._message="message")),e.registrationId!=null&&e.hasOwnProperty("registrationId")&&(A.registrationId=e.registrationId,i.oneofs&&(A._registrationId="registrationId")),e.signedPreKeyId!=null&&e.hasOwnProperty("signedPreKeyId")&&(A.signedPreKeyId=e.signedPreKeyId,i.oneofs&&(A._signedPreKeyId="signedPreKeyId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PreKeySignalMessage"},t})(),n.PremiumMessageInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.serverCampaignId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PremiumMessageInfo)return e;var i=new d.proto.PremiumMessageInfo;return e.serverCampaignId!=null&&(i.serverCampaignId=String(e.serverCampaignId)),i},t.toObject=function(e,i){i||(i={});var A={};return e.serverCampaignId!=null&&e.hasOwnProperty("serverCampaignId")&&(A.serverCampaignId=e.serverCampaignId,i.oneofs&&(A._serverCampaignId="serverCampaignId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PremiumMessageInfo"},t})(),n.PrimaryEphemeralIdentity=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.nonce=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PrimaryEphemeralIdentity)return e;var i=new d.proto.PrimaryEphemeralIdentity;return e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,i.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(i.publicKey=e.publicKey)),e.nonce!=null&&(typeof e.nonce=="string"?l.base64.decode(e.nonce,i.nonce=l.newBuffer(l.base64.length(e.nonce)),0):e.nonce.length>=0&&(i.nonce=e.nonce)),i},t.toObject=function(e,i){i||(i={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=i.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):i.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,i.oneofs&&(A._publicKey="publicKey")),e.nonce!=null&&e.hasOwnProperty("nonce")&&(A.nonce=i.bytes===String?l.base64.encode(e.nonce,0,e.nonce.length):i.bytes===Array?Array.prototype.slice.call(e.nonce):e.nonce,i.oneofs&&(A._nonce="nonce")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PrimaryEphemeralIdentity"},t})(),n.PrivacySystemMessage=(function(){let t={},o=Object.create(t);return o[t[1]="E2EE_MSG"]=1,o[t[2]="NE2EE_SELF"]=2,o[t[3]="NE2EE_OTHER"]=3,o})(),n.ProcessedVideo=(function(){function t(a){if(this.capabilities=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.directPath=e.string();break}case 2:{s.fileSha256=e.bytes();break}case 3:{s.height=e.uint32();break}case 4:{s.width=e.uint32();break}case 5:{s.fileLength=e.uint64();break}case 6:{s.bitrate=e.uint32();break}case 7:{s.quality=e.int32();break}case 8:{s.capabilities&&s.capabilities.length||(s.capabilities=[]),s.capabilities.push(e.string());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ProcessedVideo)return e;var i=new d.proto.ProcessedVideo;switch(e.directPath!=null&&(i.directPath=String(e.directPath)),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,i.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(i.fileSha256=e.fileSha256)),e.height!=null&&(i.height=e.height>>>0),e.width!=null&&(i.width=e.width>>>0),e.fileLength!=null&&(l.Long?(i.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?i.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?i.fileLength=e.fileLength:typeof e.fileLength=="object"&&(i.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.bitrate!=null&&(i.bitrate=e.bitrate>>>0),e.quality){default:if(typeof e.quality=="number"){i.quality=e.quality;break}break;case"UNDEFINED":case 0:i.quality=0;break;case"LOW":case 1:i.quality=1;break;case"MID":case 2:i.quality=2;break;case"HIGH":case 3:i.quality=3;break}if(e.capabilities){if(!Array.isArray(e.capabilities))throw TypeError(".proto.ProcessedVideo.capabilities: array expected");i.capabilities=[];for(var A=0;A>>3){case 1:{s.companionEphemeralIdentity=e.bytes();break}case 2:{s.commitment=d.proto.CompanionCommitment.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ProloguePayload)return e;var i=new d.proto.ProloguePayload;if(e.companionEphemeralIdentity!=null&&(typeof e.companionEphemeralIdentity=="string"?l.base64.decode(e.companionEphemeralIdentity,i.companionEphemeralIdentity=l.newBuffer(l.base64.length(e.companionEphemeralIdentity)),0):e.companionEphemeralIdentity.length>=0&&(i.companionEphemeralIdentity=e.companionEphemeralIdentity)),e.commitment!=null){if(typeof e.commitment!="object")throw TypeError(".proto.ProloguePayload.commitment: object expected");i.commitment=d.proto.CompanionCommitment.fromObject(e.commitment)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.companionEphemeralIdentity!=null&&e.hasOwnProperty("companionEphemeralIdentity")&&(A.companionEphemeralIdentity=i.bytes===String?l.base64.encode(e.companionEphemeralIdentity,0,e.companionEphemeralIdentity.length):i.bytes===Array?Array.prototype.slice.call(e.companionEphemeralIdentity):e.companionEphemeralIdentity,i.oneofs&&(A._companionEphemeralIdentity="companionEphemeralIdentity")),e.commitment!=null&&e.hasOwnProperty("commitment")&&(A.commitment=d.proto.CompanionCommitment.toObject(e.commitment,i),i.oneofs&&(A._commitment="commitment")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ProloguePayload"},t})(),n.Pushname=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.string();break}case 2:{s.pushname=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Pushname)return e;var i=new d.proto.Pushname;return e.id!=null&&(i.id=String(e.id)),e.pushname!=null&&(i.pushname=String(e.pushname)),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.pushname!=null&&e.hasOwnProperty("pushname")&&(A.pushname=e.pushname,i.oneofs&&(A._pushname="pushname")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Pushname"},t})(),n.QuarantinedMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.originalData=e.bytes();break}case 2:{s.extractedText=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.QuarantinedMessage)return e;var i=new d.proto.QuarantinedMessage;return e.originalData!=null&&(typeof e.originalData=="string"?l.base64.decode(e.originalData,i.originalData=l.newBuffer(l.base64.length(e.originalData)),0):e.originalData.length>=0&&(i.originalData=e.originalData)),e.extractedText!=null&&(i.extractedText=String(e.extractedText)),i},t.toObject=function(e,i){i||(i={});var A={};return e.originalData!=null&&e.hasOwnProperty("originalData")&&(A.originalData=i.bytes===String?l.base64.encode(e.originalData,0,e.originalData.length):i.bytes===Array?Array.prototype.slice.call(e.originalData):e.originalData,i.oneofs&&(A._originalData="originalData")),e.extractedText!=null&&e.hasOwnProperty("extractedText")&&(A.extractedText=e.extractedText,i.oneofs&&(A._extractedText="extractedText")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.QuarantinedMessage"},t})(),n.Reaction=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.key=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.text=e.string();break}case 3:{s.groupingKey=e.string();break}case 4:{s.senderTimestampMs=e.int64();break}case 5:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Reaction)return e;var i=new d.proto.Reaction;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.Reaction.key: object expected");i.key=d.proto.MessageKey.fromObject(e.key)}return e.text!=null&&(i.text=String(e.text)),e.groupingKey!=null&&(i.groupingKey=String(e.groupingKey)),e.senderTimestampMs!=null&&(l.Long?(i.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?i.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?i.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(i.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.unread!=null&&(i.unread=!!e.unread),i},t.toObject=function(e,i){i||(i={});var A={};return e.key!=null&&e.hasOwnProperty("key")&&(A.key=d.proto.MessageKey.toObject(e.key,i),i.oneofs&&(A._key="key")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,i.oneofs&&(A._text="text")),e.groupingKey!=null&&e.hasOwnProperty("groupingKey")&&(A.groupingKey=e.groupingKey,i.oneofs&&(A._groupingKey="groupingKey")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=i.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=i.longs===String?ge(e.senderTimestampMs):i.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,i.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,i.oneofs&&(A._unread="unread")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Reaction"},t})(),n.RecentEmojiWeight=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.emoji=e.string();break}case 2:{s.weight=e.float();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.RecentEmojiWeight)return e;var i=new d.proto.RecentEmojiWeight;return e.emoji!=null&&(i.emoji=String(e.emoji)),e.weight!=null&&(i.weight=Number(e.weight)),i},t.toObject=function(e,i){i||(i={});var A={};return e.emoji!=null&&e.hasOwnProperty("emoji")&&(A.emoji=e.emoji,i.oneofs&&(A._emoji="emoji")),e.weight!=null&&e.hasOwnProperty("weight")&&(A.weight=i.json&&!isFinite(e.weight)?String(e.weight):e.weight,i.oneofs&&(A._weight="weight")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.RecentEmojiWeight"},t})(),n.RecordStructure=(function(){function t(a){if(this.previousSessions=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.currentSession=d.proto.SessionStructure.decode(e,e.uint32());break}case 2:{s.previousSessions&&s.previousSessions.length||(s.previousSessions=[]),s.previousSessions.push(d.proto.SessionStructure.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.RecordStructure)return e;var i=new d.proto.RecordStructure;if(e.currentSession!=null){if(typeof e.currentSession!="object")throw TypeError(".proto.RecordStructure.currentSession: object expected");i.currentSession=d.proto.SessionStructure.fromObject(e.currentSession)}if(e.previousSessions){if(!Array.isArray(e.previousSessions))throw TypeError(".proto.RecordStructure.previousSessions: array expected");i.previousSessions=[];for(var A=0;A>>3){case 1:{s.minVersion=e.uint32();break}case 2:{s.maxVersion=e.uint32();break}case 3:{s.notReportableMinVersion=e.uint32();break}case 4:{s.never=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Reportable)return e;var i=new d.proto.Reportable;return e.minVersion!=null&&(i.minVersion=e.minVersion>>>0),e.maxVersion!=null&&(i.maxVersion=e.maxVersion>>>0),e.notReportableMinVersion!=null&&(i.notReportableMinVersion=e.notReportableMinVersion>>>0),e.never!=null&&(i.never=!!e.never),i},t.toObject=function(e,i){i||(i={});var A={};return e.minVersion!=null&&e.hasOwnProperty("minVersion")&&(A.minVersion=e.minVersion,i.oneofs&&(A._minVersion="minVersion")),e.maxVersion!=null&&e.hasOwnProperty("maxVersion")&&(A.maxVersion=e.maxVersion,i.oneofs&&(A._maxVersion="maxVersion")),e.notReportableMinVersion!=null&&e.hasOwnProperty("notReportableMinVersion")&&(A.notReportableMinVersion=e.notReportableMinVersion,i.oneofs&&(A._notReportableMinVersion="notReportableMinVersion")),e.never!=null&&e.hasOwnProperty("never")&&(A.never=e.never,i.oneofs&&(A._never="never")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Reportable"},t})(),n.ReportingTokenInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.reportingTag=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ReportingTokenInfo)return e;var i=new d.proto.ReportingTokenInfo;return e.reportingTag!=null&&(typeof e.reportingTag=="string"?l.base64.decode(e.reportingTag,i.reportingTag=l.newBuffer(l.base64.length(e.reportingTag)),0):e.reportingTag.length>=0&&(i.reportingTag=e.reportingTag)),i},t.toObject=function(e,i){i||(i={});var A={};return e.reportingTag!=null&&e.hasOwnProperty("reportingTag")&&(A.reportingTag=i.bytes===String?l.base64.encode(e.reportingTag,0,e.reportingTag.length):i.bytes===Array?Array.prototype.slice.call(e.reportingTag):e.reportingTag,i.oneofs&&(A._reportingTag="reportingTag")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ReportingTokenInfo"},t})(),n.SenderKeyDistributionMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.uint32();break}case 2:{s.iteration=e.uint32();break}case 3:{s.chainKey=e.bytes();break}case 4:{s.signingKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SenderKeyDistributionMessage)return e;var i=new d.proto.SenderKeyDistributionMessage;return e.id!=null&&(i.id=e.id>>>0),e.iteration!=null&&(i.iteration=e.iteration>>>0),e.chainKey!=null&&(typeof e.chainKey=="string"?l.base64.decode(e.chainKey,i.chainKey=l.newBuffer(l.base64.length(e.chainKey)),0):e.chainKey.length>=0&&(i.chainKey=e.chainKey)),e.signingKey!=null&&(typeof e.signingKey=="string"?l.base64.decode(e.signingKey,i.signingKey=l.newBuffer(l.base64.length(e.signingKey)),0):e.signingKey.length>=0&&(i.signingKey=e.signingKey)),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.iteration!=null&&e.hasOwnProperty("iteration")&&(A.iteration=e.iteration,i.oneofs&&(A._iteration="iteration")),e.chainKey!=null&&e.hasOwnProperty("chainKey")&&(A.chainKey=i.bytes===String?l.base64.encode(e.chainKey,0,e.chainKey.length):i.bytes===Array?Array.prototype.slice.call(e.chainKey):e.chainKey,i.oneofs&&(A._chainKey="chainKey")),e.signingKey!=null&&e.hasOwnProperty("signingKey")&&(A.signingKey=i.bytes===String?l.base64.encode(e.signingKey,0,e.signingKey.length):i.bytes===Array?Array.prototype.slice.call(e.signingKey):e.signingKey,i.oneofs&&(A._signingKey="signingKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SenderKeyDistributionMessage"},t})(),n.SenderKeyMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.uint32();break}case 2:{s.iteration=e.uint32();break}case 3:{s.ciphertext=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SenderKeyMessage)return e;var i=new d.proto.SenderKeyMessage;return e.id!=null&&(i.id=e.id>>>0),e.iteration!=null&&(i.iteration=e.iteration>>>0),e.ciphertext!=null&&(typeof e.ciphertext=="string"?l.base64.decode(e.ciphertext,i.ciphertext=l.newBuffer(l.base64.length(e.ciphertext)),0):e.ciphertext.length>=0&&(i.ciphertext=e.ciphertext)),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.iteration!=null&&e.hasOwnProperty("iteration")&&(A.iteration=e.iteration,i.oneofs&&(A._iteration="iteration")),e.ciphertext!=null&&e.hasOwnProperty("ciphertext")&&(A.ciphertext=i.bytes===String?l.base64.encode(e.ciphertext,0,e.ciphertext.length):i.bytes===Array?Array.prototype.slice.call(e.ciphertext):e.ciphertext,i.oneofs&&(A._ciphertext="ciphertext")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SenderKeyMessage"},t})(),n.SenderKeyRecordStructure=(function(){function t(o){if(this.senderKeyStates=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.senderKeyStates&&r.senderKeyStates.length||(r.senderKeyStates=[]),r.senderKeyStates.push(d.proto.SenderKeyStateStructure.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.SenderKeyRecordStructure)return a;var e=new d.proto.SenderKeyRecordStructure;if(a.senderKeyStates){if(!Array.isArray(a.senderKeyStates))throw TypeError(".proto.SenderKeyRecordStructure.senderKeyStates: array expected");e.senderKeyStates=[];for(var i=0;i>>3){case 1:{s.senderKeyId=e.uint32();break}case 2:{s.senderChainKey=d.proto.SenderKeyStateStructure.SenderChainKey.decode(e,e.uint32());break}case 3:{s.senderSigningKey=d.proto.SenderKeyStateStructure.SenderSigningKey.decode(e,e.uint32());break}case 4:{s.senderMessageKeys&&s.senderMessageKeys.length||(s.senderMessageKeys=[]),s.senderMessageKeys.push(d.proto.SenderKeyStateStructure.SenderMessageKey.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SenderKeyStateStructure)return e;var i=new d.proto.SenderKeyStateStructure;if(e.senderKeyId!=null&&(i.senderKeyId=e.senderKeyId>>>0),e.senderChainKey!=null){if(typeof e.senderChainKey!="object")throw TypeError(".proto.SenderKeyStateStructure.senderChainKey: object expected");i.senderChainKey=d.proto.SenderKeyStateStructure.SenderChainKey.fromObject(e.senderChainKey)}if(e.senderSigningKey!=null){if(typeof e.senderSigningKey!="object")throw TypeError(".proto.SenderKeyStateStructure.senderSigningKey: object expected");i.senderSigningKey=d.proto.SenderKeyStateStructure.SenderSigningKey.fromObject(e.senderSigningKey)}if(e.senderMessageKeys){if(!Array.isArray(e.senderMessageKeys))throw TypeError(".proto.SenderKeyStateStructure.senderMessageKeys: array expected");i.senderMessageKeys=[];for(var A=0;A>>3){case 1:{c.iteration=A.uint32();break}case 2:{c.seed=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SenderKeyStateStructure.SenderChainKey)return A;var r=new d.proto.SenderKeyStateStructure.SenderChainKey;return A.iteration!=null&&(r.iteration=A.iteration>>>0),A.seed!=null&&(typeof A.seed=="string"?l.base64.decode(A.seed,r.seed=l.newBuffer(l.base64.length(A.seed)),0):A.seed.length>=0&&(r.seed=A.seed)),r},a.toObject=function(A,r){r||(r={});var s={};return A.iteration!=null&&A.hasOwnProperty("iteration")&&(s.iteration=A.iteration,r.oneofs&&(s._iteration="iteration")),A.seed!=null&&A.hasOwnProperty("seed")&&(s.seed=r.bytes===String?l.base64.encode(A.seed,0,A.seed.length):r.bytes===Array?Array.prototype.slice.call(A.seed):A.seed,r.oneofs&&(s._seed="seed")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderChainKey"},a})(),t.SenderMessageKey=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.iteration=A.uint32();break}case 2:{c.seed=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SenderKeyStateStructure.SenderMessageKey)return A;var r=new d.proto.SenderKeyStateStructure.SenderMessageKey;return A.iteration!=null&&(r.iteration=A.iteration>>>0),A.seed!=null&&(typeof A.seed=="string"?l.base64.decode(A.seed,r.seed=l.newBuffer(l.base64.length(A.seed)),0):A.seed.length>=0&&(r.seed=A.seed)),r},a.toObject=function(A,r){r||(r={});var s={};return A.iteration!=null&&A.hasOwnProperty("iteration")&&(s.iteration=A.iteration,r.oneofs&&(s._iteration="iteration")),A.seed!=null&&A.hasOwnProperty("seed")&&(s.seed=r.bytes===String?l.base64.encode(A.seed,0,A.seed.length):r.bytes===Array?Array.prototype.slice.call(A.seed):A.seed,r.oneofs&&(s._seed="seed")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderMessageKey"},a})(),t.SenderSigningKey=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.public=A.bytes();break}case 2:{c.private=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SenderKeyStateStructure.SenderSigningKey)return A;var r=new d.proto.SenderKeyStateStructure.SenderSigningKey;return A.public!=null&&(typeof A.public=="string"?l.base64.decode(A.public,r.public=l.newBuffer(l.base64.length(A.public)),0):A.public.length>=0&&(r.public=A.public)),A.private!=null&&(typeof A.private=="string"?l.base64.decode(A.private,r.private=l.newBuffer(l.base64.length(A.private)),0):A.private.length>=0&&(r.private=A.private)),r},a.toObject=function(A,r){r||(r={});var s={};return A.public!=null&&A.hasOwnProperty("public")&&(s.public=r.bytes===String?l.base64.encode(A.public,0,A.public.length):r.bytes===Array?Array.prototype.slice.call(A.public):A.public,r.oneofs&&(s._public="public")),A.private!=null&&A.hasOwnProperty("private")&&(s.private=r.bytes===String?l.base64.encode(A.private,0,A.private.length):r.bytes===Array?Array.prototype.slice.call(A.private):A.private,r.oneofs&&(s._private="private")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderSigningKey"},a})(),t})(),n.ServerErrorReceipt=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.stanzaId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ServerErrorReceipt)return e;var i=new d.proto.ServerErrorReceipt;return e.stanzaId!=null&&(i.stanzaId=String(e.stanzaId)),i},t.toObject=function(e,i){i||(i={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,i.oneofs&&(A._stanzaId="stanzaId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ServerErrorReceipt"},t})(),n.SessionStructure=(function(){function t(a){if(this.receiverChains=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.sessionVersion=e.uint32();break}case 2:{s.localIdentityPublic=e.bytes();break}case 3:{s.remoteIdentityPublic=e.bytes();break}case 4:{s.rootKey=e.bytes();break}case 5:{s.previousCounter=e.uint32();break}case 6:{s.senderChain=d.proto.SessionStructure.Chain.decode(e,e.uint32());break}case 7:{s.receiverChains&&s.receiverChains.length||(s.receiverChains=[]),s.receiverChains.push(d.proto.SessionStructure.Chain.decode(e,e.uint32()));break}case 8:{s.pendingKeyExchange=d.proto.SessionStructure.PendingKeyExchange.decode(e,e.uint32());break}case 9:{s.pendingPreKey=d.proto.SessionStructure.PendingPreKey.decode(e,e.uint32());break}case 10:{s.remoteRegistrationId=e.uint32();break}case 11:{s.localRegistrationId=e.uint32();break}case 12:{s.needsRefresh=e.bool();break}case 13:{s.aliceBaseKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SessionStructure)return e;var i=new d.proto.SessionStructure;if(e.sessionVersion!=null&&(i.sessionVersion=e.sessionVersion>>>0),e.localIdentityPublic!=null&&(typeof e.localIdentityPublic=="string"?l.base64.decode(e.localIdentityPublic,i.localIdentityPublic=l.newBuffer(l.base64.length(e.localIdentityPublic)),0):e.localIdentityPublic.length>=0&&(i.localIdentityPublic=e.localIdentityPublic)),e.remoteIdentityPublic!=null&&(typeof e.remoteIdentityPublic=="string"?l.base64.decode(e.remoteIdentityPublic,i.remoteIdentityPublic=l.newBuffer(l.base64.length(e.remoteIdentityPublic)),0):e.remoteIdentityPublic.length>=0&&(i.remoteIdentityPublic=e.remoteIdentityPublic)),e.rootKey!=null&&(typeof e.rootKey=="string"?l.base64.decode(e.rootKey,i.rootKey=l.newBuffer(l.base64.length(e.rootKey)),0):e.rootKey.length>=0&&(i.rootKey=e.rootKey)),e.previousCounter!=null&&(i.previousCounter=e.previousCounter>>>0),e.senderChain!=null){if(typeof e.senderChain!="object")throw TypeError(".proto.SessionStructure.senderChain: object expected");i.senderChain=d.proto.SessionStructure.Chain.fromObject(e.senderChain)}if(e.receiverChains){if(!Array.isArray(e.receiverChains))throw TypeError(".proto.SessionStructure.receiverChains: array expected");i.receiverChains=[];for(var A=0;A>>0),e.localRegistrationId!=null&&(i.localRegistrationId=e.localRegistrationId>>>0),e.needsRefresh!=null&&(i.needsRefresh=!!e.needsRefresh),e.aliceBaseKey!=null&&(typeof e.aliceBaseKey=="string"?l.base64.decode(e.aliceBaseKey,i.aliceBaseKey=l.newBuffer(l.base64.length(e.aliceBaseKey)),0):e.aliceBaseKey.length>=0&&(i.aliceBaseKey=e.aliceBaseKey)),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.receiverChains=[]),e.sessionVersion!=null&&e.hasOwnProperty("sessionVersion")&&(A.sessionVersion=e.sessionVersion,i.oneofs&&(A._sessionVersion="sessionVersion")),e.localIdentityPublic!=null&&e.hasOwnProperty("localIdentityPublic")&&(A.localIdentityPublic=i.bytes===String?l.base64.encode(e.localIdentityPublic,0,e.localIdentityPublic.length):i.bytes===Array?Array.prototype.slice.call(e.localIdentityPublic):e.localIdentityPublic,i.oneofs&&(A._localIdentityPublic="localIdentityPublic")),e.remoteIdentityPublic!=null&&e.hasOwnProperty("remoteIdentityPublic")&&(A.remoteIdentityPublic=i.bytes===String?l.base64.encode(e.remoteIdentityPublic,0,e.remoteIdentityPublic.length):i.bytes===Array?Array.prototype.slice.call(e.remoteIdentityPublic):e.remoteIdentityPublic,i.oneofs&&(A._remoteIdentityPublic="remoteIdentityPublic")),e.rootKey!=null&&e.hasOwnProperty("rootKey")&&(A.rootKey=i.bytes===String?l.base64.encode(e.rootKey,0,e.rootKey.length):i.bytes===Array?Array.prototype.slice.call(e.rootKey):e.rootKey,i.oneofs&&(A._rootKey="rootKey")),e.previousCounter!=null&&e.hasOwnProperty("previousCounter")&&(A.previousCounter=e.previousCounter,i.oneofs&&(A._previousCounter="previousCounter")),e.senderChain!=null&&e.hasOwnProperty("senderChain")&&(A.senderChain=d.proto.SessionStructure.Chain.toObject(e.senderChain,i),i.oneofs&&(A._senderChain="senderChain")),e.receiverChains&&e.receiverChains.length){A.receiverChains=[];for(var r=0;r>>3){case 1:{c.senderRatchetKey=A.bytes();break}case 2:{c.senderRatchetKeyPrivate=A.bytes();break}case 3:{c.chainKey=d.proto.SessionStructure.Chain.ChainKey.decode(A,A.uint32());break}case 4:{c.messageKeys&&c.messageKeys.length||(c.messageKeys=[]),c.messageKeys.push(d.proto.SessionStructure.Chain.MessageKey.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SessionStructure.Chain)return A;var r=new d.proto.SessionStructure.Chain;if(A.senderRatchetKey!=null&&(typeof A.senderRatchetKey=="string"?l.base64.decode(A.senderRatchetKey,r.senderRatchetKey=l.newBuffer(l.base64.length(A.senderRatchetKey)),0):A.senderRatchetKey.length>=0&&(r.senderRatchetKey=A.senderRatchetKey)),A.senderRatchetKeyPrivate!=null&&(typeof A.senderRatchetKeyPrivate=="string"?l.base64.decode(A.senderRatchetKeyPrivate,r.senderRatchetKeyPrivate=l.newBuffer(l.base64.length(A.senderRatchetKeyPrivate)),0):A.senderRatchetKeyPrivate.length>=0&&(r.senderRatchetKeyPrivate=A.senderRatchetKeyPrivate)),A.chainKey!=null){if(typeof A.chainKey!="object")throw TypeError(".proto.SessionStructure.Chain.chainKey: object expected");r.chainKey=d.proto.SessionStructure.Chain.ChainKey.fromObject(A.chainKey)}if(A.messageKeys){if(!Array.isArray(A.messageKeys))throw TypeError(".proto.SessionStructure.Chain.messageKeys: array expected");r.messageKeys=[];for(var s=0;s>>3){case 1:{p.index=s.uint32();break}case 2:{p.key=s.bytes();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.SessionStructure.Chain.ChainKey)return s;var g=new d.proto.SessionStructure.Chain.ChainKey;return s.index!=null&&(g.index=s.index>>>0),s.key!=null&&(typeof s.key=="string"?l.base64.decode(s.key,g.key=l.newBuffer(l.base64.length(s.key)),0):s.key.length>=0&&(g.key=s.key)),g},i.toObject=function(s,g){g||(g={});var c={};return s.index!=null&&s.hasOwnProperty("index")&&(c.index=s.index,g.oneofs&&(c._index="index")),s.key!=null&&s.hasOwnProperty("key")&&(c.key=g.bytes===String?l.base64.encode(s.key,0,s.key.length):g.bytes===Array?Array.prototype.slice.call(s.key):s.key,g.oneofs&&(c._key="key")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.SessionStructure.Chain.ChainKey"},i})(),a.MessageKey=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.index=s.uint32();break}case 2:{p.cipherKey=s.bytes();break}case 3:{p.macKey=s.bytes();break}case 4:{p.iv=s.bytes();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.SessionStructure.Chain.MessageKey)return s;var g=new d.proto.SessionStructure.Chain.MessageKey;return s.index!=null&&(g.index=s.index>>>0),s.cipherKey!=null&&(typeof s.cipherKey=="string"?l.base64.decode(s.cipherKey,g.cipherKey=l.newBuffer(l.base64.length(s.cipherKey)),0):s.cipherKey.length>=0&&(g.cipherKey=s.cipherKey)),s.macKey!=null&&(typeof s.macKey=="string"?l.base64.decode(s.macKey,g.macKey=l.newBuffer(l.base64.length(s.macKey)),0):s.macKey.length>=0&&(g.macKey=s.macKey)),s.iv!=null&&(typeof s.iv=="string"?l.base64.decode(s.iv,g.iv=l.newBuffer(l.base64.length(s.iv)),0):s.iv.length>=0&&(g.iv=s.iv)),g},i.toObject=function(s,g){g||(g={});var c={};return s.index!=null&&s.hasOwnProperty("index")&&(c.index=s.index,g.oneofs&&(c._index="index")),s.cipherKey!=null&&s.hasOwnProperty("cipherKey")&&(c.cipherKey=g.bytes===String?l.base64.encode(s.cipherKey,0,s.cipherKey.length):g.bytes===Array?Array.prototype.slice.call(s.cipherKey):s.cipherKey,g.oneofs&&(c._cipherKey="cipherKey")),s.macKey!=null&&s.hasOwnProperty("macKey")&&(c.macKey=g.bytes===String?l.base64.encode(s.macKey,0,s.macKey.length):g.bytes===Array?Array.prototype.slice.call(s.macKey):s.macKey,g.oneofs&&(c._macKey="macKey")),s.iv!=null&&s.hasOwnProperty("iv")&&(c.iv=g.bytes===String?l.base64.encode(s.iv,0,s.iv.length):g.bytes===Array?Array.prototype.slice.call(s.iv):s.iv,g.oneofs&&(c._iv="iv")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.SessionStructure.Chain.MessageKey"},i})(),a})(),t.PendingKeyExchange=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.sequence=A.uint32();break}case 2:{c.localBaseKey=A.bytes();break}case 3:{c.localBaseKeyPrivate=A.bytes();break}case 4:{c.localRatchetKey=A.bytes();break}case 5:{c.localRatchetKeyPrivate=A.bytes();break}case 7:{c.localIdentityKey=A.bytes();break}case 8:{c.localIdentityKeyPrivate=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SessionStructure.PendingKeyExchange)return A;var r=new d.proto.SessionStructure.PendingKeyExchange;return A.sequence!=null&&(r.sequence=A.sequence>>>0),A.localBaseKey!=null&&(typeof A.localBaseKey=="string"?l.base64.decode(A.localBaseKey,r.localBaseKey=l.newBuffer(l.base64.length(A.localBaseKey)),0):A.localBaseKey.length>=0&&(r.localBaseKey=A.localBaseKey)),A.localBaseKeyPrivate!=null&&(typeof A.localBaseKeyPrivate=="string"?l.base64.decode(A.localBaseKeyPrivate,r.localBaseKeyPrivate=l.newBuffer(l.base64.length(A.localBaseKeyPrivate)),0):A.localBaseKeyPrivate.length>=0&&(r.localBaseKeyPrivate=A.localBaseKeyPrivate)),A.localRatchetKey!=null&&(typeof A.localRatchetKey=="string"?l.base64.decode(A.localRatchetKey,r.localRatchetKey=l.newBuffer(l.base64.length(A.localRatchetKey)),0):A.localRatchetKey.length>=0&&(r.localRatchetKey=A.localRatchetKey)),A.localRatchetKeyPrivate!=null&&(typeof A.localRatchetKeyPrivate=="string"?l.base64.decode(A.localRatchetKeyPrivate,r.localRatchetKeyPrivate=l.newBuffer(l.base64.length(A.localRatchetKeyPrivate)),0):A.localRatchetKeyPrivate.length>=0&&(r.localRatchetKeyPrivate=A.localRatchetKeyPrivate)),A.localIdentityKey!=null&&(typeof A.localIdentityKey=="string"?l.base64.decode(A.localIdentityKey,r.localIdentityKey=l.newBuffer(l.base64.length(A.localIdentityKey)),0):A.localIdentityKey.length>=0&&(r.localIdentityKey=A.localIdentityKey)),A.localIdentityKeyPrivate!=null&&(typeof A.localIdentityKeyPrivate=="string"?l.base64.decode(A.localIdentityKeyPrivate,r.localIdentityKeyPrivate=l.newBuffer(l.base64.length(A.localIdentityKeyPrivate)),0):A.localIdentityKeyPrivate.length>=0&&(r.localIdentityKeyPrivate=A.localIdentityKeyPrivate)),r},a.toObject=function(A,r){r||(r={});var s={};return A.sequence!=null&&A.hasOwnProperty("sequence")&&(s.sequence=A.sequence,r.oneofs&&(s._sequence="sequence")),A.localBaseKey!=null&&A.hasOwnProperty("localBaseKey")&&(s.localBaseKey=r.bytes===String?l.base64.encode(A.localBaseKey,0,A.localBaseKey.length):r.bytes===Array?Array.prototype.slice.call(A.localBaseKey):A.localBaseKey,r.oneofs&&(s._localBaseKey="localBaseKey")),A.localBaseKeyPrivate!=null&&A.hasOwnProperty("localBaseKeyPrivate")&&(s.localBaseKeyPrivate=r.bytes===String?l.base64.encode(A.localBaseKeyPrivate,0,A.localBaseKeyPrivate.length):r.bytes===Array?Array.prototype.slice.call(A.localBaseKeyPrivate):A.localBaseKeyPrivate,r.oneofs&&(s._localBaseKeyPrivate="localBaseKeyPrivate")),A.localRatchetKey!=null&&A.hasOwnProperty("localRatchetKey")&&(s.localRatchetKey=r.bytes===String?l.base64.encode(A.localRatchetKey,0,A.localRatchetKey.length):r.bytes===Array?Array.prototype.slice.call(A.localRatchetKey):A.localRatchetKey,r.oneofs&&(s._localRatchetKey="localRatchetKey")),A.localRatchetKeyPrivate!=null&&A.hasOwnProperty("localRatchetKeyPrivate")&&(s.localRatchetKeyPrivate=r.bytes===String?l.base64.encode(A.localRatchetKeyPrivate,0,A.localRatchetKeyPrivate.length):r.bytes===Array?Array.prototype.slice.call(A.localRatchetKeyPrivate):A.localRatchetKeyPrivate,r.oneofs&&(s._localRatchetKeyPrivate="localRatchetKeyPrivate")),A.localIdentityKey!=null&&A.hasOwnProperty("localIdentityKey")&&(s.localIdentityKey=r.bytes===String?l.base64.encode(A.localIdentityKey,0,A.localIdentityKey.length):r.bytes===Array?Array.prototype.slice.call(A.localIdentityKey):A.localIdentityKey,r.oneofs&&(s._localIdentityKey="localIdentityKey")),A.localIdentityKeyPrivate!=null&&A.hasOwnProperty("localIdentityKeyPrivate")&&(s.localIdentityKeyPrivate=r.bytes===String?l.base64.encode(A.localIdentityKeyPrivate,0,A.localIdentityKeyPrivate.length):r.bytes===Array?Array.prototype.slice.call(A.localIdentityKeyPrivate):A.localIdentityKeyPrivate,r.oneofs&&(s._localIdentityKeyPrivate="localIdentityKeyPrivate")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SessionStructure.PendingKeyExchange"},a})(),t.PendingPreKey=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.preKeyId=A.uint32();break}case 3:{c.signedPreKeyId=A.int32();break}case 2:{c.baseKey=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SessionStructure.PendingPreKey)return A;var r=new d.proto.SessionStructure.PendingPreKey;return A.preKeyId!=null&&(r.preKeyId=A.preKeyId>>>0),A.signedPreKeyId!=null&&(r.signedPreKeyId=A.signedPreKeyId|0),A.baseKey!=null&&(typeof A.baseKey=="string"?l.base64.decode(A.baseKey,r.baseKey=l.newBuffer(l.base64.length(A.baseKey)),0):A.baseKey.length>=0&&(r.baseKey=A.baseKey)),r},a.toObject=function(A,r){r||(r={});var s={};return A.preKeyId!=null&&A.hasOwnProperty("preKeyId")&&(s.preKeyId=A.preKeyId,r.oneofs&&(s._preKeyId="preKeyId")),A.baseKey!=null&&A.hasOwnProperty("baseKey")&&(s.baseKey=r.bytes===String?l.base64.encode(A.baseKey,0,A.baseKey.length):r.bytes===Array?Array.prototype.slice.call(A.baseKey):A.baseKey,r.oneofs&&(s._baseKey="baseKey")),A.signedPreKeyId!=null&&A.hasOwnProperty("signedPreKeyId")&&(s.signedPreKeyId=A.signedPreKeyId,r.oneofs&&(s._signedPreKeyId="signedPreKeyId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SessionStructure.PendingPreKey"},a})(),t})(),n.SessionTransparencyMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.disclaimerText=e.string();break}case 2:{s.hcaId=e.string();break}case 3:{s.sessionTransparencyType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SessionTransparencyMetadata)return e;var i=new d.proto.SessionTransparencyMetadata;switch(e.disclaimerText!=null&&(i.disclaimerText=String(e.disclaimerText)),e.hcaId!=null&&(i.hcaId=String(e.hcaId)),e.sessionTransparencyType){default:if(typeof e.sessionTransparencyType=="number"){i.sessionTransparencyType=e.sessionTransparencyType;break}break;case"UNKNOWN_TYPE":case 0:i.sessionTransparencyType=0;break;case"NY_AI_SAFETY_DISCLAIMER":case 1:i.sessionTransparencyType=1;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.disclaimerText!=null&&e.hasOwnProperty("disclaimerText")&&(A.disclaimerText=e.disclaimerText,i.oneofs&&(A._disclaimerText="disclaimerText")),e.hcaId!=null&&e.hasOwnProperty("hcaId")&&(A.hcaId=e.hcaId,i.oneofs&&(A._hcaId="hcaId")),e.sessionTransparencyType!=null&&e.hasOwnProperty("sessionTransparencyType")&&(A.sessionTransparencyType=i.enums===String?d.proto.SessionTransparencyType[e.sessionTransparencyType]===void 0?e.sessionTransparencyType:d.proto.SessionTransparencyType[e.sessionTransparencyType]:e.sessionTransparencyType,i.oneofs&&(A._sessionTransparencyType="sessionTransparencyType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SessionTransparencyMetadata"},t})(),n.SessionTransparencyType=(function(){let t={},o=Object.create(t);return o[t[0]="UNKNOWN_TYPE"]=0,o[t[1]="NY_AI_SAFETY_DISCLAIMER"]=1,o})(),n.SignalMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.ratchetKey=e.bytes();break}case 2:{s.counter=e.uint32();break}case 3:{s.previousCounter=e.uint32();break}case 4:{s.ciphertext=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SignalMessage)return e;var i=new d.proto.SignalMessage;return e.ratchetKey!=null&&(typeof e.ratchetKey=="string"?l.base64.decode(e.ratchetKey,i.ratchetKey=l.newBuffer(l.base64.length(e.ratchetKey)),0):e.ratchetKey.length>=0&&(i.ratchetKey=e.ratchetKey)),e.counter!=null&&(i.counter=e.counter>>>0),e.previousCounter!=null&&(i.previousCounter=e.previousCounter>>>0),e.ciphertext!=null&&(typeof e.ciphertext=="string"?l.base64.decode(e.ciphertext,i.ciphertext=l.newBuffer(l.base64.length(e.ciphertext)),0):e.ciphertext.length>=0&&(i.ciphertext=e.ciphertext)),i},t.toObject=function(e,i){i||(i={});var A={};return e.ratchetKey!=null&&e.hasOwnProperty("ratchetKey")&&(A.ratchetKey=i.bytes===String?l.base64.encode(e.ratchetKey,0,e.ratchetKey.length):i.bytes===Array?Array.prototype.slice.call(e.ratchetKey):e.ratchetKey,i.oneofs&&(A._ratchetKey="ratchetKey")),e.counter!=null&&e.hasOwnProperty("counter")&&(A.counter=e.counter,i.oneofs&&(A._counter="counter")),e.previousCounter!=null&&e.hasOwnProperty("previousCounter")&&(A.previousCounter=e.previousCounter,i.oneofs&&(A._previousCounter="previousCounter")),e.ciphertext!=null&&e.hasOwnProperty("ciphertext")&&(A.ciphertext=i.bytes===String?l.base64.encode(e.ciphertext,0,e.ciphertext.length):i.bytes===Array?Array.prototype.slice.call(e.ciphertext):e.ciphertext,i.oneofs&&(A._ciphertext="ciphertext")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SignalMessage"},t})(),n.SignedPreKeyRecordStructure=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.uint32();break}case 2:{s.publicKey=e.bytes();break}case 3:{s.privateKey=e.bytes();break}case 4:{s.signature=e.bytes();break}case 5:{s.timestamp=e.fixed64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SignedPreKeyRecordStructure)return e;var i=new d.proto.SignedPreKeyRecordStructure;return e.id!=null&&(i.id=e.id>>>0),e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,i.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(i.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,i.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(i.privateKey=e.privateKey)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,i.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(i.signature=e.signature)),e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=i.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):i.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,i.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=i.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):i.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,i.oneofs&&(A._privateKey="privateKey")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=i.bytes===String?l.base64.encode(e.signature,0,e.signature.length):i.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,i.oneofs&&(A._signature="signature")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=i.longs===String?String(e.timestamp):e.timestamp:A.timestamp=i.longs===String?ge(e.timestamp):i.longs===Number?ce(e.timestamp):e.timestamp,i.oneofs&&(A._timestamp="timestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SignedPreKeyRecordStructure"},t})(),n.StatusAttribution=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.type=e.int32();break}case 2:{s.actionUrl=e.string();break}case 3:{s.statusReshare=d.proto.StatusAttribution.StatusReshare.decode(e,e.uint32());break}case 4:{s.externalShare=d.proto.StatusAttribution.ExternalShare.decode(e,e.uint32());break}case 5:{s.music=d.proto.StatusAttribution.Music.decode(e,e.uint32());break}case 6:{s.groupStatus=d.proto.StatusAttribution.GroupStatus.decode(e,e.uint32());break}case 7:{s.rlAttribution=d.proto.StatusAttribution.RLAttribution.decode(e,e.uint32());break}case 8:{s.aiCreatedAttribution=d.proto.StatusAttribution.AiCreatedAttribution.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.StatusAttribution)return e;var i=new d.proto.StatusAttribution;switch(e.type){default:if(typeof e.type=="number"){i.type=e.type;break}break;case"UNKNOWN":case 0:i.type=0;break;case"RESHARE":case 1:i.type=1;break;case"EXTERNAL_SHARE":case 2:i.type=2;break;case"MUSIC":case 3:i.type=3;break;case"STATUS_MENTION":case 4:i.type=4;break;case"GROUP_STATUS":case 5:i.type=5;break;case"RL_ATTRIBUTION":case 6:i.type=6;break;case"AI_CREATED":case 7:i.type=7;break;case"LAYOUTS":case 8:i.type=8;break}if(e.actionUrl!=null&&(i.actionUrl=String(e.actionUrl)),e.statusReshare!=null){if(typeof e.statusReshare!="object")throw TypeError(".proto.StatusAttribution.statusReshare: object expected");i.statusReshare=d.proto.StatusAttribution.StatusReshare.fromObject(e.statusReshare)}if(e.externalShare!=null){if(typeof e.externalShare!="object")throw TypeError(".proto.StatusAttribution.externalShare: object expected");i.externalShare=d.proto.StatusAttribution.ExternalShare.fromObject(e.externalShare)}if(e.music!=null){if(typeof e.music!="object")throw TypeError(".proto.StatusAttribution.music: object expected");i.music=d.proto.StatusAttribution.Music.fromObject(e.music)}if(e.groupStatus!=null){if(typeof e.groupStatus!="object")throw TypeError(".proto.StatusAttribution.groupStatus: object expected");i.groupStatus=d.proto.StatusAttribution.GroupStatus.fromObject(e.groupStatus)}if(e.rlAttribution!=null){if(typeof e.rlAttribution!="object")throw TypeError(".proto.StatusAttribution.rlAttribution: object expected");i.rlAttribution=d.proto.StatusAttribution.RLAttribution.fromObject(e.rlAttribution)}if(e.aiCreatedAttribution!=null){if(typeof e.aiCreatedAttribution!="object")throw TypeError(".proto.StatusAttribution.aiCreatedAttribution: object expected");i.aiCreatedAttribution=d.proto.StatusAttribution.AiCreatedAttribution.fromObject(e.aiCreatedAttribution)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=i.enums===String?d.proto.StatusAttribution.Type[e.type]===void 0?e.type:d.proto.StatusAttribution.Type[e.type]:e.type,i.oneofs&&(A._type="type")),e.actionUrl!=null&&e.hasOwnProperty("actionUrl")&&(A.actionUrl=e.actionUrl,i.oneofs&&(A._actionUrl="actionUrl")),e.statusReshare!=null&&e.hasOwnProperty("statusReshare")&&(A.statusReshare=d.proto.StatusAttribution.StatusReshare.toObject(e.statusReshare,i),i.oneofs&&(A.attributionData="statusReshare")),e.externalShare!=null&&e.hasOwnProperty("externalShare")&&(A.externalShare=d.proto.StatusAttribution.ExternalShare.toObject(e.externalShare,i),i.oneofs&&(A.attributionData="externalShare")),e.music!=null&&e.hasOwnProperty("music")&&(A.music=d.proto.StatusAttribution.Music.toObject(e.music,i),i.oneofs&&(A.attributionData="music")),e.groupStatus!=null&&e.hasOwnProperty("groupStatus")&&(A.groupStatus=d.proto.StatusAttribution.GroupStatus.toObject(e.groupStatus,i),i.oneofs&&(A.attributionData="groupStatus")),e.rlAttribution!=null&&e.hasOwnProperty("rlAttribution")&&(A.rlAttribution=d.proto.StatusAttribution.RLAttribution.toObject(e.rlAttribution,i),i.oneofs&&(A.attributionData="rlAttribution")),e.aiCreatedAttribution!=null&&e.hasOwnProperty("aiCreatedAttribution")&&(A.aiCreatedAttribution=d.proto.StatusAttribution.AiCreatedAttribution.toObject(e.aiCreatedAttribution,i),i.oneofs&&(A.attributionData="aiCreatedAttribution")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusAttribution"},t.AiCreatedAttribution=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.source=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.StatusAttribution.AiCreatedAttribution)return A;var r=new d.proto.StatusAttribution.AiCreatedAttribution;switch(A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"STATUS_MIMICRY":case 1:r.source=1;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?d.proto.StatusAttribution.AiCreatedAttribution.Source[A.source]===void 0?A.source:d.proto.StatusAttribution.AiCreatedAttribution.Source[A.source]:A.source,r.oneofs&&(s._source="source")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.AiCreatedAttribution"},a.Source=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="STATUS_MIMICRY"]=1,A})(),a})(),t.ExternalShare=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.actionUrl=A.string();break}case 2:{c.source=A.int32();break}case 3:{c.duration=A.int32();break}case 4:{c.actionFallbackUrl=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.StatusAttribution.ExternalShare)return A;var r=new d.proto.StatusAttribution.ExternalShare;switch(A.actionUrl!=null&&(r.actionUrl=String(A.actionUrl)),A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"INSTAGRAM":case 1:r.source=1;break;case"FACEBOOK":case 2:r.source=2;break;case"MESSENGER":case 3:r.source=3;break;case"SPOTIFY":case 4:r.source=4;break;case"YOUTUBE":case 5:r.source=5;break;case"PINTEREST":case 6:r.source=6;break;case"THREADS":case 7:r.source=7;break;case"APPLE_MUSIC":case 8:r.source=8;break;case"SHARECHAT":case 9:r.source=9;break;case"GOOGLE_PHOTOS":case 10:r.source=10;break}return A.duration!=null&&(r.duration=A.duration|0),A.actionFallbackUrl!=null&&(r.actionFallbackUrl=String(A.actionFallbackUrl)),r},a.toObject=function(A,r){r||(r={});var s={};return A.actionUrl!=null&&A.hasOwnProperty("actionUrl")&&(s.actionUrl=A.actionUrl,r.oneofs&&(s._actionUrl="actionUrl")),A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?d.proto.StatusAttribution.ExternalShare.Source[A.source]===void 0?A.source:d.proto.StatusAttribution.ExternalShare.Source[A.source]:A.source,r.oneofs&&(s._source="source")),A.duration!=null&&A.hasOwnProperty("duration")&&(s.duration=A.duration,r.oneofs&&(s._duration="duration")),A.actionFallbackUrl!=null&&A.hasOwnProperty("actionFallbackUrl")&&(s.actionFallbackUrl=A.actionFallbackUrl,r.oneofs&&(s._actionFallbackUrl="actionFallbackUrl")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.ExternalShare"},a.Source=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="INSTAGRAM"]=1,A[i[2]="FACEBOOK"]=2,A[i[3]="MESSENGER"]=3,A[i[4]="SPOTIFY"]=4,A[i[5]="YOUTUBE"]=5,A[i[6]="PINTEREST"]=6,A[i[7]="THREADS"]=7,A[i[8]="APPLE_MUSIC"]=8,A[i[9]="SHARECHAT"]=9,A[i[10]="GOOGLE_PHOTOS"]=10,A})(),a})(),t.GroupStatus=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.authorJid=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.StatusAttribution.GroupStatus)return A;var r=new d.proto.StatusAttribution.GroupStatus;return A.authorJid!=null&&(r.authorJid=String(A.authorJid)),r},a.toObject=function(A,r){r||(r={});var s={};return A.authorJid!=null&&A.hasOwnProperty("authorJid")&&(s.authorJid=A.authorJid,r.oneofs&&(s._authorJid="authorJid")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.GroupStatus"},a})(),t.Music=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.authorName=A.string();break}case 2:{c.songId=A.string();break}case 3:{c.title=A.string();break}case 4:{c.author=A.string();break}case 5:{c.artistAttribution=A.string();break}case 6:{c.isExplicit=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.StatusAttribution.Music)return A;var r=new d.proto.StatusAttribution.Music;return A.authorName!=null&&(r.authorName=String(A.authorName)),A.songId!=null&&(r.songId=String(A.songId)),A.title!=null&&(r.title=String(A.title)),A.author!=null&&(r.author=String(A.author)),A.artistAttribution!=null&&(r.artistAttribution=String(A.artistAttribution)),A.isExplicit!=null&&(r.isExplicit=!!A.isExplicit),r},a.toObject=function(A,r){r||(r={});var s={};return A.authorName!=null&&A.hasOwnProperty("authorName")&&(s.authorName=A.authorName,r.oneofs&&(s._authorName="authorName")),A.songId!=null&&A.hasOwnProperty("songId")&&(s.songId=A.songId,r.oneofs&&(s._songId="songId")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.author!=null&&A.hasOwnProperty("author")&&(s.author=A.author,r.oneofs&&(s._author="author")),A.artistAttribution!=null&&A.hasOwnProperty("artistAttribution")&&(s.artistAttribution=A.artistAttribution,r.oneofs&&(s._artistAttribution="artistAttribution")),A.isExplicit!=null&&A.hasOwnProperty("isExplicit")&&(s.isExplicit=A.isExplicit,r.oneofs&&(s._isExplicit="isExplicit")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.Music"},a})(),t.RLAttribution=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.source=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.StatusAttribution.RLAttribution)return A;var r=new d.proto.StatusAttribution.RLAttribution;switch(A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"RAY_BAN_META_GLASSES":case 1:r.source=1;break;case"OAKLEY_META_GLASSES":case 2:r.source=2;break;case"HYPERNOVA_GLASSES":case 3:r.source=3;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?d.proto.StatusAttribution.RLAttribution.Source[A.source]===void 0?A.source:d.proto.StatusAttribution.RLAttribution.Source[A.source]:A.source,r.oneofs&&(s._source="source")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.RLAttribution"},a.Source=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="RAY_BAN_META_GLASSES"]=1,A[i[2]="OAKLEY_META_GLASSES"]=2,A[i[3]="HYPERNOVA_GLASSES"]=3,A})(),a})(),t.StatusReshare=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.source=A.int32();break}case 2:{c.metadata=d.proto.StatusAttribution.StatusReshare.Metadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.StatusAttribution.StatusReshare)return A;var r=new d.proto.StatusAttribution.StatusReshare;switch(A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"INTERNAL_RESHARE":case 1:r.source=1;break;case"MENTION_RESHARE":case 2:r.source=2;break;case"CHANNEL_RESHARE":case 3:r.source=3;break;case"FORWARD":case 4:r.source=4;break}if(A.metadata!=null){if(typeof A.metadata!="object")throw TypeError(".proto.StatusAttribution.StatusReshare.metadata: object expected");r.metadata=d.proto.StatusAttribution.StatusReshare.Metadata.fromObject(A.metadata)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?d.proto.StatusAttribution.StatusReshare.Source[A.source]===void 0?A.source:d.proto.StatusAttribution.StatusReshare.Source[A.source]:A.source,r.oneofs&&(s._source="source")),A.metadata!=null&&A.hasOwnProperty("metadata")&&(s.metadata=d.proto.StatusAttribution.StatusReshare.Metadata.toObject(A.metadata,r),r.oneofs&&(s._metadata="metadata")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.StatusReshare"},a.Metadata=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.duration=s.int32();break}case 2:{p.channelJid=s.string();break}case 3:{p.channelMessageId=s.int32();break}case 4:{p.hasMultipleReshares=s.bool();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.StatusAttribution.StatusReshare.Metadata)return s;var g=new d.proto.StatusAttribution.StatusReshare.Metadata;return s.duration!=null&&(g.duration=s.duration|0),s.channelJid!=null&&(g.channelJid=String(s.channelJid)),s.channelMessageId!=null&&(g.channelMessageId=s.channelMessageId|0),s.hasMultipleReshares!=null&&(g.hasMultipleReshares=!!s.hasMultipleReshares),g},i.toObject=function(s,g){g||(g={});var c={};return s.duration!=null&&s.hasOwnProperty("duration")&&(c.duration=s.duration,g.oneofs&&(c._duration="duration")),s.channelJid!=null&&s.hasOwnProperty("channelJid")&&(c.channelJid=s.channelJid,g.oneofs&&(c._channelJid="channelJid")),s.channelMessageId!=null&&s.hasOwnProperty("channelMessageId")&&(c.channelMessageId=s.channelMessageId,g.oneofs&&(c._channelMessageId="channelMessageId")),s.hasMultipleReshares!=null&&s.hasOwnProperty("hasMultipleReshares")&&(c.hasMultipleReshares=s.hasMultipleReshares,g.oneofs&&(c._hasMultipleReshares="hasMultipleReshares")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.StatusAttribution.StatusReshare.Metadata"},i})(),a.Source=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="INTERNAL_RESHARE"]=1,A[i[2]="MENTION_RESHARE"]=2,A[i[3]="CHANNEL_RESHARE"]=3,A[i[4]="FORWARD"]=4,A})(),a})(),t.Type=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="RESHARE"]=1,e[a[2]="EXTERNAL_SHARE"]=2,e[a[3]="MUSIC"]=3,e[a[4]="STATUS_MENTION"]=4,e[a[5]="GROUP_STATUS"]=5,e[a[6]="RL_ATTRIBUTION"]=6,e[a[7]="AI_CREATED"]=7,e[a[8]="LAYOUTS"]=8,e})(),t})(),n.StatusMentionMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.quotedStatus=d.proto.Message.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.StatusMentionMessage)return e;var i=new d.proto.StatusMentionMessage;if(e.quotedStatus!=null){if(typeof e.quotedStatus!="object")throw TypeError(".proto.StatusMentionMessage.quotedStatus: object expected");i.quotedStatus=d.proto.Message.fromObject(e.quotedStatus)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.quotedStatus!=null&&e.hasOwnProperty("quotedStatus")&&(A.quotedStatus=d.proto.Message.toObject(e.quotedStatus,i),i.oneofs&&(A._quotedStatus="quotedStatus")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusMentionMessage"},t})(),n.StatusPSA=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 44:{s.campaignId=e.uint64();break}case 45:{s.campaignExpirationTimestamp=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.StatusPSA)return e;var i=new d.proto.StatusPSA;return e.campaignId!=null&&(l.Long?(i.campaignId=l.Long.fromValue(e.campaignId)).unsigned=!0:typeof e.campaignId=="string"?i.campaignId=parseInt(e.campaignId,10):typeof e.campaignId=="number"?i.campaignId=e.campaignId:typeof e.campaignId=="object"&&(i.campaignId=new l.LongBits(e.campaignId.low>>>0,e.campaignId.high>>>0).toNumber(!0))),e.campaignExpirationTimestamp!=null&&(l.Long?(i.campaignExpirationTimestamp=l.Long.fromValue(e.campaignExpirationTimestamp)).unsigned=!0:typeof e.campaignExpirationTimestamp=="string"?i.campaignExpirationTimestamp=parseInt(e.campaignExpirationTimestamp,10):typeof e.campaignExpirationTimestamp=="number"?i.campaignExpirationTimestamp=e.campaignExpirationTimestamp:typeof e.campaignExpirationTimestamp=="object"&&(i.campaignExpirationTimestamp=new l.LongBits(e.campaignExpirationTimestamp.low>>>0,e.campaignExpirationTimestamp.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};if(i.defaults)if(l.Long){var r=new l.Long(0,0,!0);A.campaignId=i.longs===String?r.toString():i.longs===Number?r.toNumber():r}else A.campaignId=i.longs===String?"0":0;return e.campaignId!=null&&e.hasOwnProperty("campaignId")&&(typeof e.campaignId=="number"?A.campaignId=i.longs===String?String(e.campaignId):e.campaignId:A.campaignId=i.longs===String?ge(e.campaignId,!0):i.longs===Number?ce(e.campaignId,!0):e.campaignId),e.campaignExpirationTimestamp!=null&&e.hasOwnProperty("campaignExpirationTimestamp")&&(typeof e.campaignExpirationTimestamp=="number"?A.campaignExpirationTimestamp=i.longs===String?String(e.campaignExpirationTimestamp):e.campaignExpirationTimestamp:A.campaignExpirationTimestamp=i.longs===String?ge(e.campaignExpirationTimestamp,!0):i.longs===Number?ce(e.campaignExpirationTimestamp,!0):e.campaignExpirationTimestamp,i.oneofs&&(A._campaignExpirationTimestamp="campaignExpirationTimestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusPSA"},t})(),n.StickerMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.url=e.string();break}case 2:{s.fileSha256=e.bytes();break}case 3:{s.fileEncSha256=e.bytes();break}case 4:{s.mediaKey=e.bytes();break}case 5:{s.mimetype=e.string();break}case 6:{s.height=e.uint32();break}case 7:{s.width=e.uint32();break}case 8:{s.directPath=e.string();break}case 9:{s.fileLength=e.uint64();break}case 10:{s.weight=e.float();break}case 11:{s.lastStickerSentTs=e.int64();break}case 12:{s.isLottie=e.bool();break}case 13:{s.imageHash=e.string();break}case 14:{s.isAvatarSticker=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.StickerMetadata)return e;var i=new d.proto.StickerMetadata;return e.url!=null&&(i.url=String(e.url)),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,i.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(i.fileSha256=e.fileSha256)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,i.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(i.fileEncSha256=e.fileEncSha256)),e.mediaKey!=null&&(typeof e.mediaKey=="string"?l.base64.decode(e.mediaKey,i.mediaKey=l.newBuffer(l.base64.length(e.mediaKey)),0):e.mediaKey.length>=0&&(i.mediaKey=e.mediaKey)),e.mimetype!=null&&(i.mimetype=String(e.mimetype)),e.height!=null&&(i.height=e.height>>>0),e.width!=null&&(i.width=e.width>>>0),e.directPath!=null&&(i.directPath=String(e.directPath)),e.fileLength!=null&&(l.Long?(i.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?i.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?i.fileLength=e.fileLength:typeof e.fileLength=="object"&&(i.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.weight!=null&&(i.weight=Number(e.weight)),e.lastStickerSentTs!=null&&(l.Long?(i.lastStickerSentTs=l.Long.fromValue(e.lastStickerSentTs)).unsigned=!1:typeof e.lastStickerSentTs=="string"?i.lastStickerSentTs=parseInt(e.lastStickerSentTs,10):typeof e.lastStickerSentTs=="number"?i.lastStickerSentTs=e.lastStickerSentTs:typeof e.lastStickerSentTs=="object"&&(i.lastStickerSentTs=new l.LongBits(e.lastStickerSentTs.low>>>0,e.lastStickerSentTs.high>>>0).toNumber())),e.isLottie!=null&&(i.isLottie=!!e.isLottie),e.imageHash!=null&&(i.imageHash=String(e.imageHash)),e.isAvatarSticker!=null&&(i.isAvatarSticker=!!e.isAvatarSticker),i},t.toObject=function(e,i){i||(i={});var A={};return e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,i.oneofs&&(A._url="url")),e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=i.bytes===String?l.base64.encode(e.fileSha256,0,e.fileSha256.length):i.bytes===Array?Array.prototype.slice.call(e.fileSha256):e.fileSha256,i.oneofs&&(A._fileSha256="fileSha256")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=i.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):i.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,i.oneofs&&(A._fileEncSha256="fileEncSha256")),e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=i.bytes===String?l.base64.encode(e.mediaKey,0,e.mediaKey.length):i.bytes===Array?Array.prototype.slice.call(e.mediaKey):e.mediaKey,i.oneofs&&(A._mediaKey="mediaKey")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,i.oneofs&&(A._mimetype="mimetype")),e.height!=null&&e.hasOwnProperty("height")&&(A.height=e.height,i.oneofs&&(A._height="height")),e.width!=null&&e.hasOwnProperty("width")&&(A.width=e.width,i.oneofs&&(A._width="width")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,i.oneofs&&(A._directPath="directPath")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=i.longs===String?String(e.fileLength):e.fileLength:A.fileLength=i.longs===String?ge(e.fileLength,!0):i.longs===Number?ce(e.fileLength,!0):e.fileLength,i.oneofs&&(A._fileLength="fileLength")),e.weight!=null&&e.hasOwnProperty("weight")&&(A.weight=i.json&&!isFinite(e.weight)?String(e.weight):e.weight,i.oneofs&&(A._weight="weight")),e.lastStickerSentTs!=null&&e.hasOwnProperty("lastStickerSentTs")&&(typeof e.lastStickerSentTs=="number"?A.lastStickerSentTs=i.longs===String?String(e.lastStickerSentTs):e.lastStickerSentTs:A.lastStickerSentTs=i.longs===String?ge(e.lastStickerSentTs):i.longs===Number?ce(e.lastStickerSentTs):e.lastStickerSentTs,i.oneofs&&(A._lastStickerSentTs="lastStickerSentTs")),e.isLottie!=null&&e.hasOwnProperty("isLottie")&&(A.isLottie=e.isLottie,i.oneofs&&(A._isLottie="isLottie")),e.imageHash!=null&&e.hasOwnProperty("imageHash")&&(A.imageHash=e.imageHash,i.oneofs&&(A._imageHash="imageHash")),e.isAvatarSticker!=null&&e.hasOwnProperty("isAvatarSticker")&&(A.isAvatarSticker=e.isAvatarSticker,i.oneofs&&(A._isAvatarSticker="isAvatarSticker")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StickerMetadata"},t})(),n.SyncActionData=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.index=e.bytes();break}case 2:{s.value=d.proto.SyncActionValue.decode(e,e.uint32());break}case 3:{s.padding=e.bytes();break}case 4:{s.version=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncActionData)return e;var i=new d.proto.SyncActionData;if(e.index!=null&&(typeof e.index=="string"?l.base64.decode(e.index,i.index=l.newBuffer(l.base64.length(e.index)),0):e.index.length>=0&&(i.index=e.index)),e.value!=null){if(typeof e.value!="object")throw TypeError(".proto.SyncActionData.value: object expected");i.value=d.proto.SyncActionValue.fromObject(e.value)}return e.padding!=null&&(typeof e.padding=="string"?l.base64.decode(e.padding,i.padding=l.newBuffer(l.base64.length(e.padding)),0):e.padding.length>=0&&(i.padding=e.padding)),e.version!=null&&(i.version=e.version|0),i},t.toObject=function(e,i){i||(i={});var A={};return e.index!=null&&e.hasOwnProperty("index")&&(A.index=i.bytes===String?l.base64.encode(e.index,0,e.index.length):i.bytes===Array?Array.prototype.slice.call(e.index):e.index,i.oneofs&&(A._index="index")),e.value!=null&&e.hasOwnProperty("value")&&(A.value=d.proto.SyncActionValue.toObject(e.value,i),i.oneofs&&(A._value="value")),e.padding!=null&&e.hasOwnProperty("padding")&&(A.padding=i.bytes===String?l.base64.encode(e.padding,0,e.padding.length):i.bytes===Array?Array.prototype.slice.call(e.padding):e.padding,i.oneofs&&(A._padding="padding")),e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,i.oneofs&&(A._version="version")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncActionData"},t})(),n.SyncActionValue=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.timestamp=e.int64();break}case 2:{s.starAction=d.proto.SyncActionValue.StarAction.decode(e,e.uint32());break}case 3:{s.contactAction=d.proto.SyncActionValue.ContactAction.decode(e,e.uint32());break}case 4:{s.muteAction=d.proto.SyncActionValue.MuteAction.decode(e,e.uint32());break}case 5:{s.pinAction=d.proto.SyncActionValue.PinAction.decode(e,e.uint32());break}case 7:{s.pushNameSetting=d.proto.SyncActionValue.PushNameSetting.decode(e,e.uint32());break}case 8:{s.quickReplyAction=d.proto.SyncActionValue.QuickReplyAction.decode(e,e.uint32());break}case 11:{s.recentEmojiWeightsAction=d.proto.SyncActionValue.RecentEmojiWeightsAction.decode(e,e.uint32());break}case 14:{s.labelEditAction=d.proto.SyncActionValue.LabelEditAction.decode(e,e.uint32());break}case 15:{s.labelAssociationAction=d.proto.SyncActionValue.LabelAssociationAction.decode(e,e.uint32());break}case 16:{s.localeSetting=d.proto.SyncActionValue.LocaleSetting.decode(e,e.uint32());break}case 17:{s.archiveChatAction=d.proto.SyncActionValue.ArchiveChatAction.decode(e,e.uint32());break}case 18:{s.deleteMessageForMeAction=d.proto.SyncActionValue.DeleteMessageForMeAction.decode(e,e.uint32());break}case 19:{s.keyExpiration=d.proto.SyncActionValue.KeyExpiration.decode(e,e.uint32());break}case 20:{s.markChatAsReadAction=d.proto.SyncActionValue.MarkChatAsReadAction.decode(e,e.uint32());break}case 21:{s.clearChatAction=d.proto.SyncActionValue.ClearChatAction.decode(e,e.uint32());break}case 22:{s.deleteChatAction=d.proto.SyncActionValue.DeleteChatAction.decode(e,e.uint32());break}case 23:{s.unarchiveChatsSetting=d.proto.SyncActionValue.UnarchiveChatsSetting.decode(e,e.uint32());break}case 24:{s.primaryFeature=d.proto.SyncActionValue.PrimaryFeature.decode(e,e.uint32());break}case 26:{s.androidUnsupportedActions=d.proto.SyncActionValue.AndroidUnsupportedActions.decode(e,e.uint32());break}case 27:{s.agentAction=d.proto.SyncActionValue.AgentAction.decode(e,e.uint32());break}case 28:{s.subscriptionAction=d.proto.SyncActionValue.SubscriptionAction.decode(e,e.uint32());break}case 29:{s.userStatusMuteAction=d.proto.SyncActionValue.UserStatusMuteAction.decode(e,e.uint32());break}case 30:{s.timeFormatAction=d.proto.SyncActionValue.TimeFormatAction.decode(e,e.uint32());break}case 31:{s.nuxAction=d.proto.SyncActionValue.NuxAction.decode(e,e.uint32());break}case 32:{s.primaryVersionAction=d.proto.SyncActionValue.PrimaryVersionAction.decode(e,e.uint32());break}case 33:{s.stickerAction=d.proto.SyncActionValue.StickerAction.decode(e,e.uint32());break}case 34:{s.removeRecentStickerAction=d.proto.SyncActionValue.RemoveRecentStickerAction.decode(e,e.uint32());break}case 35:{s.chatAssignment=d.proto.SyncActionValue.ChatAssignmentAction.decode(e,e.uint32());break}case 36:{s.chatAssignmentOpenedStatus=d.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.decode(e,e.uint32());break}case 37:{s.pnForLidChatAction=d.proto.SyncActionValue.PnForLidChatAction.decode(e,e.uint32());break}case 38:{s.marketingMessageAction=d.proto.SyncActionValue.MarketingMessageAction.decode(e,e.uint32());break}case 39:{s.marketingMessageBroadcastAction=d.proto.SyncActionValue.MarketingMessageBroadcastAction.decode(e,e.uint32());break}case 40:{s.externalWebBetaAction=d.proto.SyncActionValue.ExternalWebBetaAction.decode(e,e.uint32());break}case 41:{s.privacySettingRelayAllCalls=d.proto.SyncActionValue.PrivacySettingRelayAllCalls.decode(e,e.uint32());break}case 42:{s.callLogAction=d.proto.SyncActionValue.CallLogAction.decode(e,e.uint32());break}case 43:{s.ugcBot=d.proto.SyncActionValue.UGCBot.decode(e,e.uint32());break}case 44:{s.statusPrivacy=d.proto.SyncActionValue.StatusPrivacyAction.decode(e,e.uint32());break}case 45:{s.botWelcomeRequestAction=d.proto.SyncActionValue.BotWelcomeRequestAction.decode(e,e.uint32());break}case 46:{s.deleteIndividualCallLog=d.proto.SyncActionValue.DeleteIndividualCallLogAction.decode(e,e.uint32());break}case 47:{s.labelReorderingAction=d.proto.SyncActionValue.LabelReorderingAction.decode(e,e.uint32());break}case 48:{s.paymentInfoAction=d.proto.SyncActionValue.PaymentInfoAction.decode(e,e.uint32());break}case 49:{s.customPaymentMethodsAction=d.proto.SyncActionValue.CustomPaymentMethodsAction.decode(e,e.uint32());break}case 50:{s.lockChatAction=d.proto.SyncActionValue.LockChatAction.decode(e,e.uint32());break}case 51:{s.chatLockSettings=d.proto.ChatLockSettings.decode(e,e.uint32());break}case 52:{s.wamoUserIdentifierAction=d.proto.SyncActionValue.WamoUserIdentifierAction.decode(e,e.uint32());break}case 53:{s.privacySettingDisableLinkPreviewsAction=d.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.decode(e,e.uint32());break}case 54:{s.deviceCapabilities=d.proto.DeviceCapabilities.decode(e,e.uint32());break}case 55:{s.noteEditAction=d.proto.SyncActionValue.NoteEditAction.decode(e,e.uint32());break}case 56:{s.favoritesAction=d.proto.SyncActionValue.FavoritesAction.decode(e,e.uint32());break}case 57:{s.merchantPaymentPartnerAction=d.proto.SyncActionValue.MerchantPaymentPartnerAction.decode(e,e.uint32());break}case 58:{s.waffleAccountLinkStateAction=d.proto.SyncActionValue.WaffleAccountLinkStateAction.decode(e,e.uint32());break}case 59:{s.usernameChatStartMode=d.proto.SyncActionValue.UsernameChatStartModeAction.decode(e,e.uint32());break}case 60:{s.notificationActivitySettingAction=d.proto.SyncActionValue.NotificationActivitySettingAction.decode(e,e.uint32());break}case 61:{s.lidContactAction=d.proto.SyncActionValue.LidContactAction.decode(e,e.uint32());break}case 62:{s.ctwaPerCustomerDataSharingAction=d.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.decode(e,e.uint32());break}case 63:{s.paymentTosAction=d.proto.SyncActionValue.PaymentTosAction.decode(e,e.uint32());break}case 64:{s.privacySettingChannelsPersonalisedRecommendationAction=d.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.decode(e,e.uint32());break}case 65:{s.businessBroadcastAssociationAction=d.proto.SyncActionValue.BusinessBroadcastAssociationAction.decode(e,e.uint32());break}case 66:{s.detectedOutcomesStatusAction=d.proto.SyncActionValue.DetectedOutcomesStatusAction.decode(e,e.uint32());break}case 68:{s.maibaAiFeaturesControlAction=d.proto.SyncActionValue.MaibaAIFeaturesControlAction.decode(e,e.uint32());break}case 69:{s.businessBroadcastListAction=d.proto.SyncActionValue.BusinessBroadcastListAction.decode(e,e.uint32());break}case 70:{s.musicUserIdAction=d.proto.SyncActionValue.MusicUserIdAction.decode(e,e.uint32());break}case 71:{s.statusPostOptInNotificationPreferencesAction=d.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.decode(e,e.uint32());break}case 72:{s.avatarUpdatedAction=d.proto.SyncActionValue.AvatarUpdatedAction.decode(e,e.uint32());break}case 74:{s.privateProcessingSettingAction=d.proto.SyncActionValue.PrivateProcessingSettingAction.decode(e,e.uint32());break}case 75:{s.newsletterSavedInterestsAction=d.proto.SyncActionValue.NewsletterSavedInterestsAction.decode(e,e.uint32());break}case 76:{s.aiThreadRenameAction=d.proto.SyncActionValue.AiThreadRenameAction.decode(e,e.uint32());break}case 77:{s.interactiveMessageAction=d.proto.SyncActionValue.InteractiveMessageAction.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncActionValue)return e;var i=new d.proto.SyncActionValue;if(e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),e.starAction!=null){if(typeof e.starAction!="object")throw TypeError(".proto.SyncActionValue.starAction: object expected");i.starAction=d.proto.SyncActionValue.StarAction.fromObject(e.starAction)}if(e.contactAction!=null){if(typeof e.contactAction!="object")throw TypeError(".proto.SyncActionValue.contactAction: object expected");i.contactAction=d.proto.SyncActionValue.ContactAction.fromObject(e.contactAction)}if(e.muteAction!=null){if(typeof e.muteAction!="object")throw TypeError(".proto.SyncActionValue.muteAction: object expected");i.muteAction=d.proto.SyncActionValue.MuteAction.fromObject(e.muteAction)}if(e.pinAction!=null){if(typeof e.pinAction!="object")throw TypeError(".proto.SyncActionValue.pinAction: object expected");i.pinAction=d.proto.SyncActionValue.PinAction.fromObject(e.pinAction)}if(e.pushNameSetting!=null){if(typeof e.pushNameSetting!="object")throw TypeError(".proto.SyncActionValue.pushNameSetting: object expected");i.pushNameSetting=d.proto.SyncActionValue.PushNameSetting.fromObject(e.pushNameSetting)}if(e.quickReplyAction!=null){if(typeof e.quickReplyAction!="object")throw TypeError(".proto.SyncActionValue.quickReplyAction: object expected");i.quickReplyAction=d.proto.SyncActionValue.QuickReplyAction.fromObject(e.quickReplyAction)}if(e.recentEmojiWeightsAction!=null){if(typeof e.recentEmojiWeightsAction!="object")throw TypeError(".proto.SyncActionValue.recentEmojiWeightsAction: object expected");i.recentEmojiWeightsAction=d.proto.SyncActionValue.RecentEmojiWeightsAction.fromObject(e.recentEmojiWeightsAction)}if(e.labelEditAction!=null){if(typeof e.labelEditAction!="object")throw TypeError(".proto.SyncActionValue.labelEditAction: object expected");i.labelEditAction=d.proto.SyncActionValue.LabelEditAction.fromObject(e.labelEditAction)}if(e.labelAssociationAction!=null){if(typeof e.labelAssociationAction!="object")throw TypeError(".proto.SyncActionValue.labelAssociationAction: object expected");i.labelAssociationAction=d.proto.SyncActionValue.LabelAssociationAction.fromObject(e.labelAssociationAction)}if(e.localeSetting!=null){if(typeof e.localeSetting!="object")throw TypeError(".proto.SyncActionValue.localeSetting: object expected");i.localeSetting=d.proto.SyncActionValue.LocaleSetting.fromObject(e.localeSetting)}if(e.archiveChatAction!=null){if(typeof e.archiveChatAction!="object")throw TypeError(".proto.SyncActionValue.archiveChatAction: object expected");i.archiveChatAction=d.proto.SyncActionValue.ArchiveChatAction.fromObject(e.archiveChatAction)}if(e.deleteMessageForMeAction!=null){if(typeof e.deleteMessageForMeAction!="object")throw TypeError(".proto.SyncActionValue.deleteMessageForMeAction: object expected");i.deleteMessageForMeAction=d.proto.SyncActionValue.DeleteMessageForMeAction.fromObject(e.deleteMessageForMeAction)}if(e.keyExpiration!=null){if(typeof e.keyExpiration!="object")throw TypeError(".proto.SyncActionValue.keyExpiration: object expected");i.keyExpiration=d.proto.SyncActionValue.KeyExpiration.fromObject(e.keyExpiration)}if(e.markChatAsReadAction!=null){if(typeof e.markChatAsReadAction!="object")throw TypeError(".proto.SyncActionValue.markChatAsReadAction: object expected");i.markChatAsReadAction=d.proto.SyncActionValue.MarkChatAsReadAction.fromObject(e.markChatAsReadAction)}if(e.clearChatAction!=null){if(typeof e.clearChatAction!="object")throw TypeError(".proto.SyncActionValue.clearChatAction: object expected");i.clearChatAction=d.proto.SyncActionValue.ClearChatAction.fromObject(e.clearChatAction)}if(e.deleteChatAction!=null){if(typeof e.deleteChatAction!="object")throw TypeError(".proto.SyncActionValue.deleteChatAction: object expected");i.deleteChatAction=d.proto.SyncActionValue.DeleteChatAction.fromObject(e.deleteChatAction)}if(e.unarchiveChatsSetting!=null){if(typeof e.unarchiveChatsSetting!="object")throw TypeError(".proto.SyncActionValue.unarchiveChatsSetting: object expected");i.unarchiveChatsSetting=d.proto.SyncActionValue.UnarchiveChatsSetting.fromObject(e.unarchiveChatsSetting)}if(e.primaryFeature!=null){if(typeof e.primaryFeature!="object")throw TypeError(".proto.SyncActionValue.primaryFeature: object expected");i.primaryFeature=d.proto.SyncActionValue.PrimaryFeature.fromObject(e.primaryFeature)}if(e.androidUnsupportedActions!=null){if(typeof e.androidUnsupportedActions!="object")throw TypeError(".proto.SyncActionValue.androidUnsupportedActions: object expected");i.androidUnsupportedActions=d.proto.SyncActionValue.AndroidUnsupportedActions.fromObject(e.androidUnsupportedActions)}if(e.agentAction!=null){if(typeof e.agentAction!="object")throw TypeError(".proto.SyncActionValue.agentAction: object expected");i.agentAction=d.proto.SyncActionValue.AgentAction.fromObject(e.agentAction)}if(e.subscriptionAction!=null){if(typeof e.subscriptionAction!="object")throw TypeError(".proto.SyncActionValue.subscriptionAction: object expected");i.subscriptionAction=d.proto.SyncActionValue.SubscriptionAction.fromObject(e.subscriptionAction)}if(e.userStatusMuteAction!=null){if(typeof e.userStatusMuteAction!="object")throw TypeError(".proto.SyncActionValue.userStatusMuteAction: object expected");i.userStatusMuteAction=d.proto.SyncActionValue.UserStatusMuteAction.fromObject(e.userStatusMuteAction)}if(e.timeFormatAction!=null){if(typeof e.timeFormatAction!="object")throw TypeError(".proto.SyncActionValue.timeFormatAction: object expected");i.timeFormatAction=d.proto.SyncActionValue.TimeFormatAction.fromObject(e.timeFormatAction)}if(e.nuxAction!=null){if(typeof e.nuxAction!="object")throw TypeError(".proto.SyncActionValue.nuxAction: object expected");i.nuxAction=d.proto.SyncActionValue.NuxAction.fromObject(e.nuxAction)}if(e.primaryVersionAction!=null){if(typeof e.primaryVersionAction!="object")throw TypeError(".proto.SyncActionValue.primaryVersionAction: object expected");i.primaryVersionAction=d.proto.SyncActionValue.PrimaryVersionAction.fromObject(e.primaryVersionAction)}if(e.stickerAction!=null){if(typeof e.stickerAction!="object")throw TypeError(".proto.SyncActionValue.stickerAction: object expected");i.stickerAction=d.proto.SyncActionValue.StickerAction.fromObject(e.stickerAction)}if(e.removeRecentStickerAction!=null){if(typeof e.removeRecentStickerAction!="object")throw TypeError(".proto.SyncActionValue.removeRecentStickerAction: object expected");i.removeRecentStickerAction=d.proto.SyncActionValue.RemoveRecentStickerAction.fromObject(e.removeRecentStickerAction)}if(e.chatAssignment!=null){if(typeof e.chatAssignment!="object")throw TypeError(".proto.SyncActionValue.chatAssignment: object expected");i.chatAssignment=d.proto.SyncActionValue.ChatAssignmentAction.fromObject(e.chatAssignment)}if(e.chatAssignmentOpenedStatus!=null){if(typeof e.chatAssignmentOpenedStatus!="object")throw TypeError(".proto.SyncActionValue.chatAssignmentOpenedStatus: object expected");i.chatAssignmentOpenedStatus=d.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.fromObject(e.chatAssignmentOpenedStatus)}if(e.pnForLidChatAction!=null){if(typeof e.pnForLidChatAction!="object")throw TypeError(".proto.SyncActionValue.pnForLidChatAction: object expected");i.pnForLidChatAction=d.proto.SyncActionValue.PnForLidChatAction.fromObject(e.pnForLidChatAction)}if(e.marketingMessageAction!=null){if(typeof e.marketingMessageAction!="object")throw TypeError(".proto.SyncActionValue.marketingMessageAction: object expected");i.marketingMessageAction=d.proto.SyncActionValue.MarketingMessageAction.fromObject(e.marketingMessageAction)}if(e.marketingMessageBroadcastAction!=null){if(typeof e.marketingMessageBroadcastAction!="object")throw TypeError(".proto.SyncActionValue.marketingMessageBroadcastAction: object expected");i.marketingMessageBroadcastAction=d.proto.SyncActionValue.MarketingMessageBroadcastAction.fromObject(e.marketingMessageBroadcastAction)}if(e.externalWebBetaAction!=null){if(typeof e.externalWebBetaAction!="object")throw TypeError(".proto.SyncActionValue.externalWebBetaAction: object expected");i.externalWebBetaAction=d.proto.SyncActionValue.ExternalWebBetaAction.fromObject(e.externalWebBetaAction)}if(e.privacySettingRelayAllCalls!=null){if(typeof e.privacySettingRelayAllCalls!="object")throw TypeError(".proto.SyncActionValue.privacySettingRelayAllCalls: object expected");i.privacySettingRelayAllCalls=d.proto.SyncActionValue.PrivacySettingRelayAllCalls.fromObject(e.privacySettingRelayAllCalls)}if(e.callLogAction!=null){if(typeof e.callLogAction!="object")throw TypeError(".proto.SyncActionValue.callLogAction: object expected");i.callLogAction=d.proto.SyncActionValue.CallLogAction.fromObject(e.callLogAction)}if(e.ugcBot!=null){if(typeof e.ugcBot!="object")throw TypeError(".proto.SyncActionValue.ugcBot: object expected");i.ugcBot=d.proto.SyncActionValue.UGCBot.fromObject(e.ugcBot)}if(e.statusPrivacy!=null){if(typeof e.statusPrivacy!="object")throw TypeError(".proto.SyncActionValue.statusPrivacy: object expected");i.statusPrivacy=d.proto.SyncActionValue.StatusPrivacyAction.fromObject(e.statusPrivacy)}if(e.botWelcomeRequestAction!=null){if(typeof e.botWelcomeRequestAction!="object")throw TypeError(".proto.SyncActionValue.botWelcomeRequestAction: object expected");i.botWelcomeRequestAction=d.proto.SyncActionValue.BotWelcomeRequestAction.fromObject(e.botWelcomeRequestAction)}if(e.deleteIndividualCallLog!=null){if(typeof e.deleteIndividualCallLog!="object")throw TypeError(".proto.SyncActionValue.deleteIndividualCallLog: object expected");i.deleteIndividualCallLog=d.proto.SyncActionValue.DeleteIndividualCallLogAction.fromObject(e.deleteIndividualCallLog)}if(e.labelReorderingAction!=null){if(typeof e.labelReorderingAction!="object")throw TypeError(".proto.SyncActionValue.labelReorderingAction: object expected");i.labelReorderingAction=d.proto.SyncActionValue.LabelReorderingAction.fromObject(e.labelReorderingAction)}if(e.paymentInfoAction!=null){if(typeof e.paymentInfoAction!="object")throw TypeError(".proto.SyncActionValue.paymentInfoAction: object expected");i.paymentInfoAction=d.proto.SyncActionValue.PaymentInfoAction.fromObject(e.paymentInfoAction)}if(e.customPaymentMethodsAction!=null){if(typeof e.customPaymentMethodsAction!="object")throw TypeError(".proto.SyncActionValue.customPaymentMethodsAction: object expected");i.customPaymentMethodsAction=d.proto.SyncActionValue.CustomPaymentMethodsAction.fromObject(e.customPaymentMethodsAction)}if(e.lockChatAction!=null){if(typeof e.lockChatAction!="object")throw TypeError(".proto.SyncActionValue.lockChatAction: object expected");i.lockChatAction=d.proto.SyncActionValue.LockChatAction.fromObject(e.lockChatAction)}if(e.chatLockSettings!=null){if(typeof e.chatLockSettings!="object")throw TypeError(".proto.SyncActionValue.chatLockSettings: object expected");i.chatLockSettings=d.proto.ChatLockSettings.fromObject(e.chatLockSettings)}if(e.wamoUserIdentifierAction!=null){if(typeof e.wamoUserIdentifierAction!="object")throw TypeError(".proto.SyncActionValue.wamoUserIdentifierAction: object expected");i.wamoUserIdentifierAction=d.proto.SyncActionValue.WamoUserIdentifierAction.fromObject(e.wamoUserIdentifierAction)}if(e.privacySettingDisableLinkPreviewsAction!=null){if(typeof e.privacySettingDisableLinkPreviewsAction!="object")throw TypeError(".proto.SyncActionValue.privacySettingDisableLinkPreviewsAction: object expected");i.privacySettingDisableLinkPreviewsAction=d.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.fromObject(e.privacySettingDisableLinkPreviewsAction)}if(e.deviceCapabilities!=null){if(typeof e.deviceCapabilities!="object")throw TypeError(".proto.SyncActionValue.deviceCapabilities: object expected");i.deviceCapabilities=d.proto.DeviceCapabilities.fromObject(e.deviceCapabilities)}if(e.noteEditAction!=null){if(typeof e.noteEditAction!="object")throw TypeError(".proto.SyncActionValue.noteEditAction: object expected");i.noteEditAction=d.proto.SyncActionValue.NoteEditAction.fromObject(e.noteEditAction)}if(e.favoritesAction!=null){if(typeof e.favoritesAction!="object")throw TypeError(".proto.SyncActionValue.favoritesAction: object expected");i.favoritesAction=d.proto.SyncActionValue.FavoritesAction.fromObject(e.favoritesAction)}if(e.merchantPaymentPartnerAction!=null){if(typeof e.merchantPaymentPartnerAction!="object")throw TypeError(".proto.SyncActionValue.merchantPaymentPartnerAction: object expected");i.merchantPaymentPartnerAction=d.proto.SyncActionValue.MerchantPaymentPartnerAction.fromObject(e.merchantPaymentPartnerAction)}if(e.waffleAccountLinkStateAction!=null){if(typeof e.waffleAccountLinkStateAction!="object")throw TypeError(".proto.SyncActionValue.waffleAccountLinkStateAction: object expected");i.waffleAccountLinkStateAction=d.proto.SyncActionValue.WaffleAccountLinkStateAction.fromObject(e.waffleAccountLinkStateAction)}if(e.usernameChatStartMode!=null){if(typeof e.usernameChatStartMode!="object")throw TypeError(".proto.SyncActionValue.usernameChatStartMode: object expected");i.usernameChatStartMode=d.proto.SyncActionValue.UsernameChatStartModeAction.fromObject(e.usernameChatStartMode)}if(e.notificationActivitySettingAction!=null){if(typeof e.notificationActivitySettingAction!="object")throw TypeError(".proto.SyncActionValue.notificationActivitySettingAction: object expected");i.notificationActivitySettingAction=d.proto.SyncActionValue.NotificationActivitySettingAction.fromObject(e.notificationActivitySettingAction)}if(e.lidContactAction!=null){if(typeof e.lidContactAction!="object")throw TypeError(".proto.SyncActionValue.lidContactAction: object expected");i.lidContactAction=d.proto.SyncActionValue.LidContactAction.fromObject(e.lidContactAction)}if(e.ctwaPerCustomerDataSharingAction!=null){if(typeof e.ctwaPerCustomerDataSharingAction!="object")throw TypeError(".proto.SyncActionValue.ctwaPerCustomerDataSharingAction: object expected");i.ctwaPerCustomerDataSharingAction=d.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.fromObject(e.ctwaPerCustomerDataSharingAction)}if(e.paymentTosAction!=null){if(typeof e.paymentTosAction!="object")throw TypeError(".proto.SyncActionValue.paymentTosAction: object expected");i.paymentTosAction=d.proto.SyncActionValue.PaymentTosAction.fromObject(e.paymentTosAction)}if(e.privacySettingChannelsPersonalisedRecommendationAction!=null){if(typeof e.privacySettingChannelsPersonalisedRecommendationAction!="object")throw TypeError(".proto.SyncActionValue.privacySettingChannelsPersonalisedRecommendationAction: object expected");i.privacySettingChannelsPersonalisedRecommendationAction=d.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.fromObject(e.privacySettingChannelsPersonalisedRecommendationAction)}if(e.businessBroadcastAssociationAction!=null){if(typeof e.businessBroadcastAssociationAction!="object")throw TypeError(".proto.SyncActionValue.businessBroadcastAssociationAction: object expected");i.businessBroadcastAssociationAction=d.proto.SyncActionValue.BusinessBroadcastAssociationAction.fromObject(e.businessBroadcastAssociationAction)}if(e.detectedOutcomesStatusAction!=null){if(typeof e.detectedOutcomesStatusAction!="object")throw TypeError(".proto.SyncActionValue.detectedOutcomesStatusAction: object expected");i.detectedOutcomesStatusAction=d.proto.SyncActionValue.DetectedOutcomesStatusAction.fromObject(e.detectedOutcomesStatusAction)}if(e.maibaAiFeaturesControlAction!=null){if(typeof e.maibaAiFeaturesControlAction!="object")throw TypeError(".proto.SyncActionValue.maibaAiFeaturesControlAction: object expected");i.maibaAiFeaturesControlAction=d.proto.SyncActionValue.MaibaAIFeaturesControlAction.fromObject(e.maibaAiFeaturesControlAction)}if(e.businessBroadcastListAction!=null){if(typeof e.businessBroadcastListAction!="object")throw TypeError(".proto.SyncActionValue.businessBroadcastListAction: object expected");i.businessBroadcastListAction=d.proto.SyncActionValue.BusinessBroadcastListAction.fromObject(e.businessBroadcastListAction)}if(e.musicUserIdAction!=null){if(typeof e.musicUserIdAction!="object")throw TypeError(".proto.SyncActionValue.musicUserIdAction: object expected");i.musicUserIdAction=d.proto.SyncActionValue.MusicUserIdAction.fromObject(e.musicUserIdAction)}if(e.statusPostOptInNotificationPreferencesAction!=null){if(typeof e.statusPostOptInNotificationPreferencesAction!="object")throw TypeError(".proto.SyncActionValue.statusPostOptInNotificationPreferencesAction: object expected");i.statusPostOptInNotificationPreferencesAction=d.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.fromObject(e.statusPostOptInNotificationPreferencesAction)}if(e.avatarUpdatedAction!=null){if(typeof e.avatarUpdatedAction!="object")throw TypeError(".proto.SyncActionValue.avatarUpdatedAction: object expected");i.avatarUpdatedAction=d.proto.SyncActionValue.AvatarUpdatedAction.fromObject(e.avatarUpdatedAction)}if(e.privateProcessingSettingAction!=null){if(typeof e.privateProcessingSettingAction!="object")throw TypeError(".proto.SyncActionValue.privateProcessingSettingAction: object expected");i.privateProcessingSettingAction=d.proto.SyncActionValue.PrivateProcessingSettingAction.fromObject(e.privateProcessingSettingAction)}if(e.newsletterSavedInterestsAction!=null){if(typeof e.newsletterSavedInterestsAction!="object")throw TypeError(".proto.SyncActionValue.newsletterSavedInterestsAction: object expected");i.newsletterSavedInterestsAction=d.proto.SyncActionValue.NewsletterSavedInterestsAction.fromObject(e.newsletterSavedInterestsAction)}if(e.aiThreadRenameAction!=null){if(typeof e.aiThreadRenameAction!="object")throw TypeError(".proto.SyncActionValue.aiThreadRenameAction: object expected");i.aiThreadRenameAction=d.proto.SyncActionValue.AiThreadRenameAction.fromObject(e.aiThreadRenameAction)}if(e.interactiveMessageAction!=null){if(typeof e.interactiveMessageAction!="object")throw TypeError(".proto.SyncActionValue.interactiveMessageAction: object expected");i.interactiveMessageAction=d.proto.SyncActionValue.InteractiveMessageAction.fromObject(e.interactiveMessageAction)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=i.longs===String?String(e.timestamp):e.timestamp:A.timestamp=i.longs===String?ge(e.timestamp):i.longs===Number?ce(e.timestamp):e.timestamp,i.oneofs&&(A._timestamp="timestamp")),e.starAction!=null&&e.hasOwnProperty("starAction")&&(A.starAction=d.proto.SyncActionValue.StarAction.toObject(e.starAction,i),i.oneofs&&(A._starAction="starAction")),e.contactAction!=null&&e.hasOwnProperty("contactAction")&&(A.contactAction=d.proto.SyncActionValue.ContactAction.toObject(e.contactAction,i),i.oneofs&&(A._contactAction="contactAction")),e.muteAction!=null&&e.hasOwnProperty("muteAction")&&(A.muteAction=d.proto.SyncActionValue.MuteAction.toObject(e.muteAction,i),i.oneofs&&(A._muteAction="muteAction")),e.pinAction!=null&&e.hasOwnProperty("pinAction")&&(A.pinAction=d.proto.SyncActionValue.PinAction.toObject(e.pinAction,i),i.oneofs&&(A._pinAction="pinAction")),e.pushNameSetting!=null&&e.hasOwnProperty("pushNameSetting")&&(A.pushNameSetting=d.proto.SyncActionValue.PushNameSetting.toObject(e.pushNameSetting,i),i.oneofs&&(A._pushNameSetting="pushNameSetting")),e.quickReplyAction!=null&&e.hasOwnProperty("quickReplyAction")&&(A.quickReplyAction=d.proto.SyncActionValue.QuickReplyAction.toObject(e.quickReplyAction,i),i.oneofs&&(A._quickReplyAction="quickReplyAction")),e.recentEmojiWeightsAction!=null&&e.hasOwnProperty("recentEmojiWeightsAction")&&(A.recentEmojiWeightsAction=d.proto.SyncActionValue.RecentEmojiWeightsAction.toObject(e.recentEmojiWeightsAction,i),i.oneofs&&(A._recentEmojiWeightsAction="recentEmojiWeightsAction")),e.labelEditAction!=null&&e.hasOwnProperty("labelEditAction")&&(A.labelEditAction=d.proto.SyncActionValue.LabelEditAction.toObject(e.labelEditAction,i),i.oneofs&&(A._labelEditAction="labelEditAction")),e.labelAssociationAction!=null&&e.hasOwnProperty("labelAssociationAction")&&(A.labelAssociationAction=d.proto.SyncActionValue.LabelAssociationAction.toObject(e.labelAssociationAction,i),i.oneofs&&(A._labelAssociationAction="labelAssociationAction")),e.localeSetting!=null&&e.hasOwnProperty("localeSetting")&&(A.localeSetting=d.proto.SyncActionValue.LocaleSetting.toObject(e.localeSetting,i),i.oneofs&&(A._localeSetting="localeSetting")),e.archiveChatAction!=null&&e.hasOwnProperty("archiveChatAction")&&(A.archiveChatAction=d.proto.SyncActionValue.ArchiveChatAction.toObject(e.archiveChatAction,i),i.oneofs&&(A._archiveChatAction="archiveChatAction")),e.deleteMessageForMeAction!=null&&e.hasOwnProperty("deleteMessageForMeAction")&&(A.deleteMessageForMeAction=d.proto.SyncActionValue.DeleteMessageForMeAction.toObject(e.deleteMessageForMeAction,i),i.oneofs&&(A._deleteMessageForMeAction="deleteMessageForMeAction")),e.keyExpiration!=null&&e.hasOwnProperty("keyExpiration")&&(A.keyExpiration=d.proto.SyncActionValue.KeyExpiration.toObject(e.keyExpiration,i),i.oneofs&&(A._keyExpiration="keyExpiration")),e.markChatAsReadAction!=null&&e.hasOwnProperty("markChatAsReadAction")&&(A.markChatAsReadAction=d.proto.SyncActionValue.MarkChatAsReadAction.toObject(e.markChatAsReadAction,i),i.oneofs&&(A._markChatAsReadAction="markChatAsReadAction")),e.clearChatAction!=null&&e.hasOwnProperty("clearChatAction")&&(A.clearChatAction=d.proto.SyncActionValue.ClearChatAction.toObject(e.clearChatAction,i),i.oneofs&&(A._clearChatAction="clearChatAction")),e.deleteChatAction!=null&&e.hasOwnProperty("deleteChatAction")&&(A.deleteChatAction=d.proto.SyncActionValue.DeleteChatAction.toObject(e.deleteChatAction,i),i.oneofs&&(A._deleteChatAction="deleteChatAction")),e.unarchiveChatsSetting!=null&&e.hasOwnProperty("unarchiveChatsSetting")&&(A.unarchiveChatsSetting=d.proto.SyncActionValue.UnarchiveChatsSetting.toObject(e.unarchiveChatsSetting,i),i.oneofs&&(A._unarchiveChatsSetting="unarchiveChatsSetting")),e.primaryFeature!=null&&e.hasOwnProperty("primaryFeature")&&(A.primaryFeature=d.proto.SyncActionValue.PrimaryFeature.toObject(e.primaryFeature,i),i.oneofs&&(A._primaryFeature="primaryFeature")),e.androidUnsupportedActions!=null&&e.hasOwnProperty("androidUnsupportedActions")&&(A.androidUnsupportedActions=d.proto.SyncActionValue.AndroidUnsupportedActions.toObject(e.androidUnsupportedActions,i),i.oneofs&&(A._androidUnsupportedActions="androidUnsupportedActions")),e.agentAction!=null&&e.hasOwnProperty("agentAction")&&(A.agentAction=d.proto.SyncActionValue.AgentAction.toObject(e.agentAction,i),i.oneofs&&(A._agentAction="agentAction")),e.subscriptionAction!=null&&e.hasOwnProperty("subscriptionAction")&&(A.subscriptionAction=d.proto.SyncActionValue.SubscriptionAction.toObject(e.subscriptionAction,i),i.oneofs&&(A._subscriptionAction="subscriptionAction")),e.userStatusMuteAction!=null&&e.hasOwnProperty("userStatusMuteAction")&&(A.userStatusMuteAction=d.proto.SyncActionValue.UserStatusMuteAction.toObject(e.userStatusMuteAction,i),i.oneofs&&(A._userStatusMuteAction="userStatusMuteAction")),e.timeFormatAction!=null&&e.hasOwnProperty("timeFormatAction")&&(A.timeFormatAction=d.proto.SyncActionValue.TimeFormatAction.toObject(e.timeFormatAction,i),i.oneofs&&(A._timeFormatAction="timeFormatAction")),e.nuxAction!=null&&e.hasOwnProperty("nuxAction")&&(A.nuxAction=d.proto.SyncActionValue.NuxAction.toObject(e.nuxAction,i),i.oneofs&&(A._nuxAction="nuxAction")),e.primaryVersionAction!=null&&e.hasOwnProperty("primaryVersionAction")&&(A.primaryVersionAction=d.proto.SyncActionValue.PrimaryVersionAction.toObject(e.primaryVersionAction,i),i.oneofs&&(A._primaryVersionAction="primaryVersionAction")),e.stickerAction!=null&&e.hasOwnProperty("stickerAction")&&(A.stickerAction=d.proto.SyncActionValue.StickerAction.toObject(e.stickerAction,i),i.oneofs&&(A._stickerAction="stickerAction")),e.removeRecentStickerAction!=null&&e.hasOwnProperty("removeRecentStickerAction")&&(A.removeRecentStickerAction=d.proto.SyncActionValue.RemoveRecentStickerAction.toObject(e.removeRecentStickerAction,i),i.oneofs&&(A._removeRecentStickerAction="removeRecentStickerAction")),e.chatAssignment!=null&&e.hasOwnProperty("chatAssignment")&&(A.chatAssignment=d.proto.SyncActionValue.ChatAssignmentAction.toObject(e.chatAssignment,i),i.oneofs&&(A._chatAssignment="chatAssignment")),e.chatAssignmentOpenedStatus!=null&&e.hasOwnProperty("chatAssignmentOpenedStatus")&&(A.chatAssignmentOpenedStatus=d.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.toObject(e.chatAssignmentOpenedStatus,i),i.oneofs&&(A._chatAssignmentOpenedStatus="chatAssignmentOpenedStatus")),e.pnForLidChatAction!=null&&e.hasOwnProperty("pnForLidChatAction")&&(A.pnForLidChatAction=d.proto.SyncActionValue.PnForLidChatAction.toObject(e.pnForLidChatAction,i),i.oneofs&&(A._pnForLidChatAction="pnForLidChatAction")),e.marketingMessageAction!=null&&e.hasOwnProperty("marketingMessageAction")&&(A.marketingMessageAction=d.proto.SyncActionValue.MarketingMessageAction.toObject(e.marketingMessageAction,i),i.oneofs&&(A._marketingMessageAction="marketingMessageAction")),e.marketingMessageBroadcastAction!=null&&e.hasOwnProperty("marketingMessageBroadcastAction")&&(A.marketingMessageBroadcastAction=d.proto.SyncActionValue.MarketingMessageBroadcastAction.toObject(e.marketingMessageBroadcastAction,i),i.oneofs&&(A._marketingMessageBroadcastAction="marketingMessageBroadcastAction")),e.externalWebBetaAction!=null&&e.hasOwnProperty("externalWebBetaAction")&&(A.externalWebBetaAction=d.proto.SyncActionValue.ExternalWebBetaAction.toObject(e.externalWebBetaAction,i),i.oneofs&&(A._externalWebBetaAction="externalWebBetaAction")),e.privacySettingRelayAllCalls!=null&&e.hasOwnProperty("privacySettingRelayAllCalls")&&(A.privacySettingRelayAllCalls=d.proto.SyncActionValue.PrivacySettingRelayAllCalls.toObject(e.privacySettingRelayAllCalls,i),i.oneofs&&(A._privacySettingRelayAllCalls="privacySettingRelayAllCalls")),e.callLogAction!=null&&e.hasOwnProperty("callLogAction")&&(A.callLogAction=d.proto.SyncActionValue.CallLogAction.toObject(e.callLogAction,i),i.oneofs&&(A._callLogAction="callLogAction")),e.ugcBot!=null&&e.hasOwnProperty("ugcBot")&&(A.ugcBot=d.proto.SyncActionValue.UGCBot.toObject(e.ugcBot,i),i.oneofs&&(A._ugcBot="ugcBot")),e.statusPrivacy!=null&&e.hasOwnProperty("statusPrivacy")&&(A.statusPrivacy=d.proto.SyncActionValue.StatusPrivacyAction.toObject(e.statusPrivacy,i),i.oneofs&&(A._statusPrivacy="statusPrivacy")),e.botWelcomeRequestAction!=null&&e.hasOwnProperty("botWelcomeRequestAction")&&(A.botWelcomeRequestAction=d.proto.SyncActionValue.BotWelcomeRequestAction.toObject(e.botWelcomeRequestAction,i),i.oneofs&&(A._botWelcomeRequestAction="botWelcomeRequestAction")),e.deleteIndividualCallLog!=null&&e.hasOwnProperty("deleteIndividualCallLog")&&(A.deleteIndividualCallLog=d.proto.SyncActionValue.DeleteIndividualCallLogAction.toObject(e.deleteIndividualCallLog,i),i.oneofs&&(A._deleteIndividualCallLog="deleteIndividualCallLog")),e.labelReorderingAction!=null&&e.hasOwnProperty("labelReorderingAction")&&(A.labelReorderingAction=d.proto.SyncActionValue.LabelReorderingAction.toObject(e.labelReorderingAction,i),i.oneofs&&(A._labelReorderingAction="labelReorderingAction")),e.paymentInfoAction!=null&&e.hasOwnProperty("paymentInfoAction")&&(A.paymentInfoAction=d.proto.SyncActionValue.PaymentInfoAction.toObject(e.paymentInfoAction,i),i.oneofs&&(A._paymentInfoAction="paymentInfoAction")),e.customPaymentMethodsAction!=null&&e.hasOwnProperty("customPaymentMethodsAction")&&(A.customPaymentMethodsAction=d.proto.SyncActionValue.CustomPaymentMethodsAction.toObject(e.customPaymentMethodsAction,i),i.oneofs&&(A._customPaymentMethodsAction="customPaymentMethodsAction")),e.lockChatAction!=null&&e.hasOwnProperty("lockChatAction")&&(A.lockChatAction=d.proto.SyncActionValue.LockChatAction.toObject(e.lockChatAction,i),i.oneofs&&(A._lockChatAction="lockChatAction")),e.chatLockSettings!=null&&e.hasOwnProperty("chatLockSettings")&&(A.chatLockSettings=d.proto.ChatLockSettings.toObject(e.chatLockSettings,i),i.oneofs&&(A._chatLockSettings="chatLockSettings")),e.wamoUserIdentifierAction!=null&&e.hasOwnProperty("wamoUserIdentifierAction")&&(A.wamoUserIdentifierAction=d.proto.SyncActionValue.WamoUserIdentifierAction.toObject(e.wamoUserIdentifierAction,i),i.oneofs&&(A._wamoUserIdentifierAction="wamoUserIdentifierAction")),e.privacySettingDisableLinkPreviewsAction!=null&&e.hasOwnProperty("privacySettingDisableLinkPreviewsAction")&&(A.privacySettingDisableLinkPreviewsAction=d.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.toObject(e.privacySettingDisableLinkPreviewsAction,i),i.oneofs&&(A._privacySettingDisableLinkPreviewsAction="privacySettingDisableLinkPreviewsAction")),e.deviceCapabilities!=null&&e.hasOwnProperty("deviceCapabilities")&&(A.deviceCapabilities=d.proto.DeviceCapabilities.toObject(e.deviceCapabilities,i),i.oneofs&&(A._deviceCapabilities="deviceCapabilities")),e.noteEditAction!=null&&e.hasOwnProperty("noteEditAction")&&(A.noteEditAction=d.proto.SyncActionValue.NoteEditAction.toObject(e.noteEditAction,i),i.oneofs&&(A._noteEditAction="noteEditAction")),e.favoritesAction!=null&&e.hasOwnProperty("favoritesAction")&&(A.favoritesAction=d.proto.SyncActionValue.FavoritesAction.toObject(e.favoritesAction,i),i.oneofs&&(A._favoritesAction="favoritesAction")),e.merchantPaymentPartnerAction!=null&&e.hasOwnProperty("merchantPaymentPartnerAction")&&(A.merchantPaymentPartnerAction=d.proto.SyncActionValue.MerchantPaymentPartnerAction.toObject(e.merchantPaymentPartnerAction,i),i.oneofs&&(A._merchantPaymentPartnerAction="merchantPaymentPartnerAction")),e.waffleAccountLinkStateAction!=null&&e.hasOwnProperty("waffleAccountLinkStateAction")&&(A.waffleAccountLinkStateAction=d.proto.SyncActionValue.WaffleAccountLinkStateAction.toObject(e.waffleAccountLinkStateAction,i),i.oneofs&&(A._waffleAccountLinkStateAction="waffleAccountLinkStateAction")),e.usernameChatStartMode!=null&&e.hasOwnProperty("usernameChatStartMode")&&(A.usernameChatStartMode=d.proto.SyncActionValue.UsernameChatStartModeAction.toObject(e.usernameChatStartMode,i),i.oneofs&&(A._usernameChatStartMode="usernameChatStartMode")),e.notificationActivitySettingAction!=null&&e.hasOwnProperty("notificationActivitySettingAction")&&(A.notificationActivitySettingAction=d.proto.SyncActionValue.NotificationActivitySettingAction.toObject(e.notificationActivitySettingAction,i),i.oneofs&&(A._notificationActivitySettingAction="notificationActivitySettingAction")),e.lidContactAction!=null&&e.hasOwnProperty("lidContactAction")&&(A.lidContactAction=d.proto.SyncActionValue.LidContactAction.toObject(e.lidContactAction,i),i.oneofs&&(A._lidContactAction="lidContactAction")),e.ctwaPerCustomerDataSharingAction!=null&&e.hasOwnProperty("ctwaPerCustomerDataSharingAction")&&(A.ctwaPerCustomerDataSharingAction=d.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.toObject(e.ctwaPerCustomerDataSharingAction,i),i.oneofs&&(A._ctwaPerCustomerDataSharingAction="ctwaPerCustomerDataSharingAction")),e.paymentTosAction!=null&&e.hasOwnProperty("paymentTosAction")&&(A.paymentTosAction=d.proto.SyncActionValue.PaymentTosAction.toObject(e.paymentTosAction,i),i.oneofs&&(A._paymentTosAction="paymentTosAction")),e.privacySettingChannelsPersonalisedRecommendationAction!=null&&e.hasOwnProperty("privacySettingChannelsPersonalisedRecommendationAction")&&(A.privacySettingChannelsPersonalisedRecommendationAction=d.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.toObject(e.privacySettingChannelsPersonalisedRecommendationAction,i),i.oneofs&&(A._privacySettingChannelsPersonalisedRecommendationAction="privacySettingChannelsPersonalisedRecommendationAction")),e.businessBroadcastAssociationAction!=null&&e.hasOwnProperty("businessBroadcastAssociationAction")&&(A.businessBroadcastAssociationAction=d.proto.SyncActionValue.BusinessBroadcastAssociationAction.toObject(e.businessBroadcastAssociationAction,i),i.oneofs&&(A._businessBroadcastAssociationAction="businessBroadcastAssociationAction")),e.detectedOutcomesStatusAction!=null&&e.hasOwnProperty("detectedOutcomesStatusAction")&&(A.detectedOutcomesStatusAction=d.proto.SyncActionValue.DetectedOutcomesStatusAction.toObject(e.detectedOutcomesStatusAction,i),i.oneofs&&(A._detectedOutcomesStatusAction="detectedOutcomesStatusAction")),e.maibaAiFeaturesControlAction!=null&&e.hasOwnProperty("maibaAiFeaturesControlAction")&&(A.maibaAiFeaturesControlAction=d.proto.SyncActionValue.MaibaAIFeaturesControlAction.toObject(e.maibaAiFeaturesControlAction,i),i.oneofs&&(A._maibaAiFeaturesControlAction="maibaAiFeaturesControlAction")),e.businessBroadcastListAction!=null&&e.hasOwnProperty("businessBroadcastListAction")&&(A.businessBroadcastListAction=d.proto.SyncActionValue.BusinessBroadcastListAction.toObject(e.businessBroadcastListAction,i),i.oneofs&&(A._businessBroadcastListAction="businessBroadcastListAction")),e.musicUserIdAction!=null&&e.hasOwnProperty("musicUserIdAction")&&(A.musicUserIdAction=d.proto.SyncActionValue.MusicUserIdAction.toObject(e.musicUserIdAction,i),i.oneofs&&(A._musicUserIdAction="musicUserIdAction")),e.statusPostOptInNotificationPreferencesAction!=null&&e.hasOwnProperty("statusPostOptInNotificationPreferencesAction")&&(A.statusPostOptInNotificationPreferencesAction=d.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.toObject(e.statusPostOptInNotificationPreferencesAction,i),i.oneofs&&(A._statusPostOptInNotificationPreferencesAction="statusPostOptInNotificationPreferencesAction")),e.avatarUpdatedAction!=null&&e.hasOwnProperty("avatarUpdatedAction")&&(A.avatarUpdatedAction=d.proto.SyncActionValue.AvatarUpdatedAction.toObject(e.avatarUpdatedAction,i),i.oneofs&&(A._avatarUpdatedAction="avatarUpdatedAction")),e.privateProcessingSettingAction!=null&&e.hasOwnProperty("privateProcessingSettingAction")&&(A.privateProcessingSettingAction=d.proto.SyncActionValue.PrivateProcessingSettingAction.toObject(e.privateProcessingSettingAction,i),i.oneofs&&(A._privateProcessingSettingAction="privateProcessingSettingAction")),e.newsletterSavedInterestsAction!=null&&e.hasOwnProperty("newsletterSavedInterestsAction")&&(A.newsletterSavedInterestsAction=d.proto.SyncActionValue.NewsletterSavedInterestsAction.toObject(e.newsletterSavedInterestsAction,i),i.oneofs&&(A._newsletterSavedInterestsAction="newsletterSavedInterestsAction")),e.aiThreadRenameAction!=null&&e.hasOwnProperty("aiThreadRenameAction")&&(A.aiThreadRenameAction=d.proto.SyncActionValue.AiThreadRenameAction.toObject(e.aiThreadRenameAction,i),i.oneofs&&(A._aiThreadRenameAction="aiThreadRenameAction")),e.interactiveMessageAction!=null&&e.hasOwnProperty("interactiveMessageAction")&&(A.interactiveMessageAction=d.proto.SyncActionValue.InteractiveMessageAction.toObject(e.interactiveMessageAction,i),i.oneofs&&(A._interactiveMessageAction="interactiveMessageAction")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncActionValue"},t.AgentAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.deviceID=A.int32();break}case 3:{c.isDeleted=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.AgentAction)return A;var r=new d.proto.SyncActionValue.AgentAction;return A.name!=null&&(r.name=String(A.name)),A.deviceID!=null&&(r.deviceID=A.deviceID|0),A.isDeleted!=null&&(r.isDeleted=!!A.isDeleted),r},a.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.deviceID!=null&&A.hasOwnProperty("deviceID")&&(s.deviceID=A.deviceID,r.oneofs&&(s._deviceID="deviceID")),A.isDeleted!=null&&A.hasOwnProperty("isDeleted")&&(s.isDeleted=A.isDeleted,r.oneofs&&(s._isDeleted="isDeleted")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AgentAction"},a})(),t.AiThreadRenameAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.newTitle=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.AiThreadRenameAction)return A;var r=new d.proto.SyncActionValue.AiThreadRenameAction;return A.newTitle!=null&&(r.newTitle=String(A.newTitle)),r},a.toObject=function(A,r){r||(r={});var s={};return A.newTitle!=null&&A.hasOwnProperty("newTitle")&&(s.newTitle=A.newTitle,r.oneofs&&(s._newTitle="newTitle")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AiThreadRenameAction"},a})(),t.AndroidUnsupportedActions=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.allowed=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.AndroidUnsupportedActions)return A;var r=new d.proto.SyncActionValue.AndroidUnsupportedActions;return A.allowed!=null&&(r.allowed=!!A.allowed),r},a.toObject=function(A,r){r||(r={});var s={};return A.allowed!=null&&A.hasOwnProperty("allowed")&&(s.allowed=A.allowed,r.oneofs&&(s._allowed="allowed")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AndroidUnsupportedActions"},a})(),t.ArchiveChatAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.archived=A.bool();break}case 2:{c.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.ArchiveChatAction)return A;var r=new d.proto.SyncActionValue.ArchiveChatAction;if(A.archived!=null&&(r.archived=!!A.archived),A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.ArchiveChatAction.messageRange: object expected");r.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.archived!=null&&A.hasOwnProperty("archived")&&(s.archived=A.archived,r.oneofs&&(s._archived="archived")),A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ArchiveChatAction"},a})(),t.AvatarUpdatedAction=(function(){function a(i){if(this.recentAvatarStickers=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.eventType=A.int32();break}case 2:{c.recentAvatarStickers&&c.recentAvatarStickers.length||(c.recentAvatarStickers=[]),c.recentAvatarStickers.push(d.proto.SyncActionValue.StickerAction.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.AvatarUpdatedAction)return A;var r=new d.proto.SyncActionValue.AvatarUpdatedAction;switch(A.eventType){default:if(typeof A.eventType=="number"){r.eventType=A.eventType;break}break;case"UPDATED":case 0:r.eventType=0;break;case"CREATED":case 1:r.eventType=1;break;case"DELETED":case 2:r.eventType=2;break}if(A.recentAvatarStickers){if(!Array.isArray(A.recentAvatarStickers))throw TypeError(".proto.SyncActionValue.AvatarUpdatedAction.recentAvatarStickers: array expected");r.recentAvatarStickers=[];for(var s=0;s>>3){case 1:{c.isSent=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.BotWelcomeRequestAction)return A;var r=new d.proto.SyncActionValue.BotWelcomeRequestAction;return A.isSent!=null&&(r.isSent=!!A.isSent),r},a.toObject=function(A,r){r||(r={});var s={};return A.isSent!=null&&A.hasOwnProperty("isSent")&&(s.isSent=A.isSent,r.oneofs&&(s._isSent="isSent")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BotWelcomeRequestAction"},a})(),t.BroadcastListParticipant=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.lidJid=A.string();break}case 2:{c.pnJid=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.BroadcastListParticipant)return A;var r=new d.proto.SyncActionValue.BroadcastListParticipant;return A.lidJid!=null&&(r.lidJid=String(A.lidJid)),A.pnJid!=null&&(r.pnJid=String(A.pnJid)),r},a.toObject=function(A,r){r||(r={});var s={};return r.defaults&&(s.lidJid=""),A.lidJid!=null&&A.hasOwnProperty("lidJid")&&(s.lidJid=A.lidJid),A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,r.oneofs&&(s._pnJid="pnJid")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BroadcastListParticipant"},a})(),t.BusinessBroadcastAssociationAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.deleted=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.BusinessBroadcastAssociationAction)return A;var r=new d.proto.SyncActionValue.BusinessBroadcastAssociationAction;return A.deleted!=null&&(r.deleted=!!A.deleted),r},a.toObject=function(A,r){r||(r={});var s={};return A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,r.oneofs&&(s._deleted="deleted")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BusinessBroadcastAssociationAction"},a})(),t.BusinessBroadcastListAction=(function(){function a(i){if(this.participants=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.deleted=A.bool();break}case 2:{c.participants&&c.participants.length||(c.participants=[]),c.participants.push(d.proto.SyncActionValue.BroadcastListParticipant.decode(A,A.uint32()));break}case 3:{c.listName=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.BusinessBroadcastListAction)return A;var r=new d.proto.SyncActionValue.BusinessBroadcastListAction;if(A.deleted!=null&&(r.deleted=!!A.deleted),A.participants){if(!Array.isArray(A.participants))throw TypeError(".proto.SyncActionValue.BusinessBroadcastListAction.participants: array expected");r.participants=[];for(var s=0;s>>3){case 1:{c.callLogRecord=d.proto.CallLogRecord.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.CallLogAction)return A;var r=new d.proto.SyncActionValue.CallLogAction;if(A.callLogRecord!=null){if(typeof A.callLogRecord!="object")throw TypeError(".proto.SyncActionValue.CallLogAction.callLogRecord: object expected");r.callLogRecord=d.proto.CallLogRecord.fromObject(A.callLogRecord)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.callLogRecord!=null&&A.hasOwnProperty("callLogRecord")&&(s.callLogRecord=d.proto.CallLogRecord.toObject(A.callLogRecord,r),r.oneofs&&(s._callLogRecord="callLogRecord")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.CallLogAction"},a})(),t.ChatAssignmentAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.deviceAgentID=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.ChatAssignmentAction)return A;var r=new d.proto.SyncActionValue.ChatAssignmentAction;return A.deviceAgentID!=null&&(r.deviceAgentID=String(A.deviceAgentID)),r},a.toObject=function(A,r){r||(r={});var s={};return A.deviceAgentID!=null&&A.hasOwnProperty("deviceAgentID")&&(s.deviceAgentID=A.deviceAgentID,r.oneofs&&(s._deviceAgentID="deviceAgentID")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ChatAssignmentAction"},a})(),t.ChatAssignmentOpenedStatusAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.chatOpened=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.ChatAssignmentOpenedStatusAction)return A;var r=new d.proto.SyncActionValue.ChatAssignmentOpenedStatusAction;return A.chatOpened!=null&&(r.chatOpened=!!A.chatOpened),r},a.toObject=function(A,r){r||(r={});var s={};return A.chatOpened!=null&&A.hasOwnProperty("chatOpened")&&(s.chatOpened=A.chatOpened,r.oneofs&&(s._chatOpened="chatOpened")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ChatAssignmentOpenedStatusAction"},a})(),t.ClearChatAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.ClearChatAction)return A;var r=new d.proto.SyncActionValue.ClearChatAction;if(A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.ClearChatAction.messageRange: object expected");r.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ClearChatAction"},a})(),t.ContactAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.fullName=A.string();break}case 2:{c.firstName=A.string();break}case 3:{c.lidJid=A.string();break}case 4:{c.saveOnPrimaryAddressbook=A.bool();break}case 5:{c.pnJid=A.string();break}case 6:{c.username=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.ContactAction)return A;var r=new d.proto.SyncActionValue.ContactAction;return A.fullName!=null&&(r.fullName=String(A.fullName)),A.firstName!=null&&(r.firstName=String(A.firstName)),A.lidJid!=null&&(r.lidJid=String(A.lidJid)),A.saveOnPrimaryAddressbook!=null&&(r.saveOnPrimaryAddressbook=!!A.saveOnPrimaryAddressbook),A.pnJid!=null&&(r.pnJid=String(A.pnJid)),A.username!=null&&(r.username=String(A.username)),r},a.toObject=function(A,r){r||(r={});var s={};return A.fullName!=null&&A.hasOwnProperty("fullName")&&(s.fullName=A.fullName,r.oneofs&&(s._fullName="fullName")),A.firstName!=null&&A.hasOwnProperty("firstName")&&(s.firstName=A.firstName,r.oneofs&&(s._firstName="firstName")),A.lidJid!=null&&A.hasOwnProperty("lidJid")&&(s.lidJid=A.lidJid,r.oneofs&&(s._lidJid="lidJid")),A.saveOnPrimaryAddressbook!=null&&A.hasOwnProperty("saveOnPrimaryAddressbook")&&(s.saveOnPrimaryAddressbook=A.saveOnPrimaryAddressbook,r.oneofs&&(s._saveOnPrimaryAddressbook="saveOnPrimaryAddressbook")),A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,r.oneofs&&(s._pnJid="pnJid")),A.username!=null&&A.hasOwnProperty("username")&&(s.username=A.username,r.oneofs&&(s._username="username")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ContactAction"},a})(),t.CtwaPerCustomerDataSharingAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isCtwaPerCustomerDataSharingEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.CtwaPerCustomerDataSharingAction)return A;var r=new d.proto.SyncActionValue.CtwaPerCustomerDataSharingAction;return A.isCtwaPerCustomerDataSharingEnabled!=null&&(r.isCtwaPerCustomerDataSharingEnabled=!!A.isCtwaPerCustomerDataSharingEnabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.isCtwaPerCustomerDataSharingEnabled!=null&&A.hasOwnProperty("isCtwaPerCustomerDataSharingEnabled")&&(s.isCtwaPerCustomerDataSharingEnabled=A.isCtwaPerCustomerDataSharingEnabled,r.oneofs&&(s._isCtwaPerCustomerDataSharingEnabled="isCtwaPerCustomerDataSharingEnabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.CtwaPerCustomerDataSharingAction"},a})(),t.CustomPaymentMethod=(function(){function a(e){if(this.metadata=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.credentialId=i.string();break}case 2:{g.country=i.string();break}case 3:{g.type=i.string();break}case 4:{g.metadata&&g.metadata.length||(g.metadata=[]),g.metadata.push(d.proto.SyncActionValue.CustomPaymentMethodMetadata.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.CustomPaymentMethod)return i;var A=new d.proto.SyncActionValue.CustomPaymentMethod;if(i.credentialId!=null&&(A.credentialId=String(i.credentialId)),i.country!=null&&(A.country=String(i.country)),i.type!=null&&(A.type=String(i.type)),i.metadata){if(!Array.isArray(i.metadata))throw TypeError(".proto.SyncActionValue.CustomPaymentMethod.metadata: array expected");A.metadata=[];for(var r=0;r>>3){case 1:{g.key=i.string();break}case 2:{g.value=i.string();break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.CustomPaymentMethodMetadata)return i;var A=new d.proto.SyncActionValue.CustomPaymentMethodMetadata;return i.key!=null&&(A.key=String(i.key)),i.value!=null&&(A.value=String(i.value)),A},a.toObject=function(i,A){A||(A={});var r={};return A.defaults&&(r.key="",r.value=""),i.key!=null&&i.hasOwnProperty("key")&&(r.key=i.key),i.value!=null&&i.hasOwnProperty("value")&&(r.value=i.value),r},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.SyncActionValue.CustomPaymentMethodMetadata"},a})(),t.CustomPaymentMethodsAction=(function(){function a(e){if(this.customPaymentMethods=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.customPaymentMethods&&g.customPaymentMethods.length||(g.customPaymentMethods=[]),g.customPaymentMethods.push(d.proto.SyncActionValue.CustomPaymentMethod.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.CustomPaymentMethodsAction)return i;var A=new d.proto.SyncActionValue.CustomPaymentMethodsAction;if(i.customPaymentMethods){if(!Array.isArray(i.customPaymentMethods))throw TypeError(".proto.SyncActionValue.CustomPaymentMethodsAction.customPaymentMethods: array expected");A.customPaymentMethods=[];for(var r=0;r>>3){case 1:{c.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.DeleteChatAction)return A;var r=new d.proto.SyncActionValue.DeleteChatAction;if(A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.DeleteChatAction.messageRange: object expected");r.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteChatAction"},a})(),t.DeleteIndividualCallLogAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.peerJid=A.string();break}case 2:{c.isIncoming=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.DeleteIndividualCallLogAction)return A;var r=new d.proto.SyncActionValue.DeleteIndividualCallLogAction;return A.peerJid!=null&&(r.peerJid=String(A.peerJid)),A.isIncoming!=null&&(r.isIncoming=!!A.isIncoming),r},a.toObject=function(A,r){r||(r={});var s={};return A.peerJid!=null&&A.hasOwnProperty("peerJid")&&(s.peerJid=A.peerJid,r.oneofs&&(s._peerJid="peerJid")),A.isIncoming!=null&&A.hasOwnProperty("isIncoming")&&(s.isIncoming=A.isIncoming,r.oneofs&&(s._isIncoming="isIncoming")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteIndividualCallLogAction"},a})(),t.DeleteMessageForMeAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.deleteMedia=A.bool();break}case 2:{c.messageTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.DeleteMessageForMeAction)return A;var r=new d.proto.SyncActionValue.DeleteMessageForMeAction;return A.deleteMedia!=null&&(r.deleteMedia=!!A.deleteMedia),A.messageTimestamp!=null&&(l.Long?(r.messageTimestamp=l.Long.fromValue(A.messageTimestamp)).unsigned=!1:typeof A.messageTimestamp=="string"?r.messageTimestamp=parseInt(A.messageTimestamp,10):typeof A.messageTimestamp=="number"?r.messageTimestamp=A.messageTimestamp:typeof A.messageTimestamp=="object"&&(r.messageTimestamp=new l.LongBits(A.messageTimestamp.low>>>0,A.messageTimestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.deleteMedia!=null&&A.hasOwnProperty("deleteMedia")&&(s.deleteMedia=A.deleteMedia,r.oneofs&&(s._deleteMedia="deleteMedia")),A.messageTimestamp!=null&&A.hasOwnProperty("messageTimestamp")&&(typeof A.messageTimestamp=="number"?s.messageTimestamp=r.longs===String?String(A.messageTimestamp):A.messageTimestamp:s.messageTimestamp=r.longs===String?ge(A.messageTimestamp):r.longs===Number?ce(A.messageTimestamp):A.messageTimestamp,r.oneofs&&(s._messageTimestamp="messageTimestamp")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteMessageForMeAction"},a})(),t.DetectedOutcomesStatusAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.DetectedOutcomesStatusAction)return A;var r=new d.proto.SyncActionValue.DetectedOutcomesStatusAction;return A.isEnabled!=null&&(r.isEnabled=!!A.isEnabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.isEnabled!=null&&A.hasOwnProperty("isEnabled")&&(s.isEnabled=A.isEnabled,r.oneofs&&(s._isEnabled="isEnabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DetectedOutcomesStatusAction"},a})(),t.ExternalWebBetaAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isOptIn=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.ExternalWebBetaAction)return A;var r=new d.proto.SyncActionValue.ExternalWebBetaAction;return A.isOptIn!=null&&(r.isOptIn=!!A.isOptIn),r},a.toObject=function(A,r){r||(r={});var s={};return A.isOptIn!=null&&A.hasOwnProperty("isOptIn")&&(s.isOptIn=A.isOptIn,r.oneofs&&(s._isOptIn="isOptIn")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ExternalWebBetaAction"},a})(),t.FavoritesAction=(function(){function a(e){if(this.favorites=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.favorites&&g.favorites.length||(g.favorites=[]),g.favorites.push(d.proto.SyncActionValue.FavoritesAction.Favorite.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.FavoritesAction)return i;var A=new d.proto.SyncActionValue.FavoritesAction;if(i.favorites){if(!Array.isArray(i.favorites))throw TypeError(".proto.SyncActionValue.FavoritesAction.favorites: array expected");A.favorites=[];for(var r=0;r>>3){case 1:{I.id=r.string();break}default:r.skipType(p&7);break}}return I},e.fromObject=function(r){if(r instanceof d.proto.SyncActionValue.FavoritesAction.Favorite)return r;var s=new d.proto.SyncActionValue.FavoritesAction.Favorite;return r.id!=null&&(s.id=String(r.id)),s},e.toObject=function(r,s){s||(s={});var g={};return r.id!=null&&r.hasOwnProperty("id")&&(g.id=r.id,s.oneofs&&(g._id="id")),g},e.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},e.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/proto.SyncActionValue.FavoritesAction.Favorite"},e})(),a})(),t.InteractiveMessageAction=(function(){function a(e){if(e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.type=i.int32();break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.InteractiveMessageAction)return i;var A=new d.proto.SyncActionValue.InteractiveMessageAction;switch(i.type){default:if(typeof i.type=="number"){A.type=i.type;break}break;case"DISABLE_CTA":case 1:A.type=1;break}return A},a.toObject=function(i,A){A||(A={});var r={};return A.defaults&&(r.type=A.enums===String?"DISABLE_CTA":1),i.type!=null&&i.hasOwnProperty("type")&&(r.type=A.enums===String?d.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[i.type]===void 0?i.type:d.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[i.type]:i.type),r},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.SyncActionValue.InteractiveMessageAction"},a.InteractiveMessageActionMode=(function(){let e={},i=Object.create(e);return i[e[1]="DISABLE_CTA"]=1,i})(),a})(),t.KeyExpiration=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.expiredKeyEpoch=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.KeyExpiration)return A;var r=new d.proto.SyncActionValue.KeyExpiration;return A.expiredKeyEpoch!=null&&(r.expiredKeyEpoch=A.expiredKeyEpoch|0),r},a.toObject=function(A,r){r||(r={});var s={};return A.expiredKeyEpoch!=null&&A.hasOwnProperty("expiredKeyEpoch")&&(s.expiredKeyEpoch=A.expiredKeyEpoch,r.oneofs&&(s._expiredKeyEpoch="expiredKeyEpoch")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.KeyExpiration"},a})(),t.LabelAssociationAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.labeled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.LabelAssociationAction)return A;var r=new d.proto.SyncActionValue.LabelAssociationAction;return A.labeled!=null&&(r.labeled=!!A.labeled),r},a.toObject=function(A,r){r||(r={});var s={};return A.labeled!=null&&A.hasOwnProperty("labeled")&&(s.labeled=A.labeled,r.oneofs&&(s._labeled="labeled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LabelAssociationAction"},a})(),t.LabelEditAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.color=A.int32();break}case 3:{c.predefinedId=A.int32();break}case 4:{c.deleted=A.bool();break}case 5:{c.orderIndex=A.int32();break}case 6:{c.isActive=A.bool();break}case 7:{c.type=A.int32();break}case 8:{c.isImmutable=A.bool();break}case 9:{c.muteEndTimeMs=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.LabelEditAction)return A;var r=new d.proto.SyncActionValue.LabelEditAction;switch(A.name!=null&&(r.name=String(A.name)),A.color!=null&&(r.color=A.color|0),A.predefinedId!=null&&(r.predefinedId=A.predefinedId|0),A.deleted!=null&&(r.deleted=!!A.deleted),A.orderIndex!=null&&(r.orderIndex=A.orderIndex|0),A.isActive!=null&&(r.isActive=!!A.isActive),A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"NONE":case 0:r.type=0;break;case"UNREAD":case 1:r.type=1;break;case"GROUPS":case 2:r.type=2;break;case"FAVORITES":case 3:r.type=3;break;case"PREDEFINED":case 4:r.type=4;break;case"CUSTOM":case 5:r.type=5;break;case"COMMUNITY":case 6:r.type=6;break;case"SERVER_ASSIGNED":case 7:r.type=7;break;case"DRAFTED":case 8:r.type=8;break;case"AI_HANDOFF":case 9:r.type=9;break}return A.isImmutable!=null&&(r.isImmutable=!!A.isImmutable),A.muteEndTimeMs!=null&&(l.Long?(r.muteEndTimeMs=l.Long.fromValue(A.muteEndTimeMs)).unsigned=!1:typeof A.muteEndTimeMs=="string"?r.muteEndTimeMs=parseInt(A.muteEndTimeMs,10):typeof A.muteEndTimeMs=="number"?r.muteEndTimeMs=A.muteEndTimeMs:typeof A.muteEndTimeMs=="object"&&(r.muteEndTimeMs=new l.LongBits(A.muteEndTimeMs.low>>>0,A.muteEndTimeMs.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.color!=null&&A.hasOwnProperty("color")&&(s.color=A.color,r.oneofs&&(s._color="color")),A.predefinedId!=null&&A.hasOwnProperty("predefinedId")&&(s.predefinedId=A.predefinedId,r.oneofs&&(s._predefinedId="predefinedId")),A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,r.oneofs&&(s._deleted="deleted")),A.orderIndex!=null&&A.hasOwnProperty("orderIndex")&&(s.orderIndex=A.orderIndex,r.oneofs&&(s._orderIndex="orderIndex")),A.isActive!=null&&A.hasOwnProperty("isActive")&&(s.isActive=A.isActive,r.oneofs&&(s._isActive="isActive")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.SyncActionValue.LabelEditAction.ListType[A.type]===void 0?A.type:d.proto.SyncActionValue.LabelEditAction.ListType[A.type]:A.type,r.oneofs&&(s._type="type")),A.isImmutable!=null&&A.hasOwnProperty("isImmutable")&&(s.isImmutable=A.isImmutable,r.oneofs&&(s._isImmutable="isImmutable")),A.muteEndTimeMs!=null&&A.hasOwnProperty("muteEndTimeMs")&&(typeof A.muteEndTimeMs=="number"?s.muteEndTimeMs=r.longs===String?String(A.muteEndTimeMs):A.muteEndTimeMs:s.muteEndTimeMs=r.longs===String?ge(A.muteEndTimeMs):r.longs===Number?ce(A.muteEndTimeMs):A.muteEndTimeMs,r.oneofs&&(s._muteEndTimeMs="muteEndTimeMs")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LabelEditAction"},a.ListType=(function(){let i={},A=Object.create(i);return A[i[0]="NONE"]=0,A[i[1]="UNREAD"]=1,A[i[2]="GROUPS"]=2,A[i[3]="FAVORITES"]=3,A[i[4]="PREDEFINED"]=4,A[i[5]="CUSTOM"]=5,A[i[6]="COMMUNITY"]=6,A[i[7]="SERVER_ASSIGNED"]=7,A[i[8]="DRAFTED"]=8,A[i[9]="AI_HANDOFF"]=9,A})(),a})(),t.LabelReorderingAction=(function(){function a(e){if(this.sortedLabelIds=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{if(g.sortedLabelIds&&g.sortedLabelIds.length||(g.sortedLabelIds=[]),(c&7)===2)for(var I=i.uint32()+i.pos;i.pos>>3){case 1:{c.fullName=A.string();break}case 2:{c.firstName=A.string();break}case 3:{c.username=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.LidContactAction)return A;var r=new d.proto.SyncActionValue.LidContactAction;return A.fullName!=null&&(r.fullName=String(A.fullName)),A.firstName!=null&&(r.firstName=String(A.firstName)),A.username!=null&&(r.username=String(A.username)),r},a.toObject=function(A,r){r||(r={});var s={};return A.fullName!=null&&A.hasOwnProperty("fullName")&&(s.fullName=A.fullName,r.oneofs&&(s._fullName="fullName")),A.firstName!=null&&A.hasOwnProperty("firstName")&&(s.firstName=A.firstName,r.oneofs&&(s._firstName="firstName")),A.username!=null&&A.hasOwnProperty("username")&&(s.username=A.username,r.oneofs&&(s._username="username")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LidContactAction"},a})(),t.LocaleSetting=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.locale=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.LocaleSetting)return A;var r=new d.proto.SyncActionValue.LocaleSetting;return A.locale!=null&&(r.locale=String(A.locale)),r},a.toObject=function(A,r){r||(r={});var s={};return A.locale!=null&&A.hasOwnProperty("locale")&&(s.locale=A.locale,r.oneofs&&(s._locale="locale")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LocaleSetting"},a})(),t.LockChatAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.locked=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.LockChatAction)return A;var r=new d.proto.SyncActionValue.LockChatAction;return A.locked!=null&&(r.locked=!!A.locked),r},a.toObject=function(A,r){r||(r={});var s={};return A.locked!=null&&A.hasOwnProperty("locked")&&(s.locked=A.locked,r.oneofs&&(s._locked="locked")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LockChatAction"},a})(),t.MaibaAIFeaturesControlAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.aiFeatureStatus=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MaibaAIFeaturesControlAction)return A;var r=new d.proto.SyncActionValue.MaibaAIFeaturesControlAction;switch(A.aiFeatureStatus){default:if(typeof A.aiFeatureStatus=="number"){r.aiFeatureStatus=A.aiFeatureStatus;break}break;case"ENABLED":case 0:r.aiFeatureStatus=0;break;case"ENABLED_HAS_LEARNING":case 1:r.aiFeatureStatus=1;break;case"DISABLED":case 2:r.aiFeatureStatus=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.aiFeatureStatus!=null&&A.hasOwnProperty("aiFeatureStatus")&&(s.aiFeatureStatus=r.enums===String?d.proto.SyncActionValue.MaibaAIFeaturesControlAction.MaibaAIFeatureStatus[A.aiFeatureStatus]===void 0?A.aiFeatureStatus:d.proto.SyncActionValue.MaibaAIFeaturesControlAction.MaibaAIFeatureStatus[A.aiFeatureStatus]:A.aiFeatureStatus,r.oneofs&&(s._aiFeatureStatus="aiFeatureStatus")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MaibaAIFeaturesControlAction"},a.MaibaAIFeatureStatus=(function(){let i={},A=Object.create(i);return A[i[0]="ENABLED"]=0,A[i[1]="ENABLED_HAS_LEARNING"]=1,A[i[2]="DISABLED"]=2,A})(),a})(),t.MarkChatAsReadAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.read=A.bool();break}case 2:{c.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MarkChatAsReadAction)return A;var r=new d.proto.SyncActionValue.MarkChatAsReadAction;if(A.read!=null&&(r.read=!!A.read),A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.MarkChatAsReadAction.messageRange: object expected");r.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.read!=null&&A.hasOwnProperty("read")&&(s.read=A.read,r.oneofs&&(s._read="read")),A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarkChatAsReadAction"},a})(),t.MarketingMessageAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.message=A.string();break}case 3:{c.type=A.int32();break}case 4:{c.createdAt=A.int64();break}case 5:{c.lastSentAt=A.int64();break}case 6:{c.isDeleted=A.bool();break}case 7:{c.mediaId=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MarketingMessageAction)return A;var r=new d.proto.SyncActionValue.MarketingMessageAction;switch(A.name!=null&&(r.name=String(A.name)),A.message!=null&&(r.message=String(A.message)),A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"PERSONALIZED":case 0:r.type=0;break}return A.createdAt!=null&&(l.Long?(r.createdAt=l.Long.fromValue(A.createdAt)).unsigned=!1:typeof A.createdAt=="string"?r.createdAt=parseInt(A.createdAt,10):typeof A.createdAt=="number"?r.createdAt=A.createdAt:typeof A.createdAt=="object"&&(r.createdAt=new l.LongBits(A.createdAt.low>>>0,A.createdAt.high>>>0).toNumber())),A.lastSentAt!=null&&(l.Long?(r.lastSentAt=l.Long.fromValue(A.lastSentAt)).unsigned=!1:typeof A.lastSentAt=="string"?r.lastSentAt=parseInt(A.lastSentAt,10):typeof A.lastSentAt=="number"?r.lastSentAt=A.lastSentAt:typeof A.lastSentAt=="object"&&(r.lastSentAt=new l.LongBits(A.lastSentAt.low>>>0,A.lastSentAt.high>>>0).toNumber())),A.isDeleted!=null&&(r.isDeleted=!!A.isDeleted),A.mediaId!=null&&(r.mediaId=String(A.mediaId)),r},a.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=A.message,r.oneofs&&(s._message="message")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[A.type]===void 0?A.type:d.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[A.type]:A.type,r.oneofs&&(s._type="type")),A.createdAt!=null&&A.hasOwnProperty("createdAt")&&(typeof A.createdAt=="number"?s.createdAt=r.longs===String?String(A.createdAt):A.createdAt:s.createdAt=r.longs===String?ge(A.createdAt):r.longs===Number?ce(A.createdAt):A.createdAt,r.oneofs&&(s._createdAt="createdAt")),A.lastSentAt!=null&&A.hasOwnProperty("lastSentAt")&&(typeof A.lastSentAt=="number"?s.lastSentAt=r.longs===String?String(A.lastSentAt):A.lastSentAt:s.lastSentAt=r.longs===String?ge(A.lastSentAt):r.longs===Number?ce(A.lastSentAt):A.lastSentAt,r.oneofs&&(s._lastSentAt="lastSentAt")),A.isDeleted!=null&&A.hasOwnProperty("isDeleted")&&(s.isDeleted=A.isDeleted,r.oneofs&&(s._isDeleted="isDeleted")),A.mediaId!=null&&A.hasOwnProperty("mediaId")&&(s.mediaId=A.mediaId,r.oneofs&&(s._mediaId="mediaId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarketingMessageAction"},a.MarketingMessagePrototypeType=(function(){let i={},A=Object.create(i);return A[i[0]="PERSONALIZED"]=0,A})(),a})(),t.MarketingMessageBroadcastAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.repliedCount=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MarketingMessageBroadcastAction)return A;var r=new d.proto.SyncActionValue.MarketingMessageBroadcastAction;return A.repliedCount!=null&&(r.repliedCount=A.repliedCount|0),r},a.toObject=function(A,r){r||(r={});var s={};return A.repliedCount!=null&&A.hasOwnProperty("repliedCount")&&(s.repliedCount=A.repliedCount,r.oneofs&&(s._repliedCount="repliedCount")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarketingMessageBroadcastAction"},a})(),t.MerchantPaymentPartnerAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.status=A.int32();break}case 2:{c.country=A.string();break}case 3:{c.gatewayName=A.string();break}case 4:{c.credentialId=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MerchantPaymentPartnerAction)return A;var r=new d.proto.SyncActionValue.MerchantPaymentPartnerAction;switch(A.status){default:if(typeof A.status=="number"){r.status=A.status;break}break;case"ACTIVE":case 0:r.status=0;break;case"INACTIVE":case 1:r.status=1;break}return A.country!=null&&(r.country=String(A.country)),A.gatewayName!=null&&(r.gatewayName=String(A.gatewayName)),A.credentialId!=null&&(r.credentialId=String(A.credentialId)),r},a.toObject=function(A,r){r||(r={});var s={};return r.defaults&&(s.status=r.enums===String?"ACTIVE":0,s.country=""),A.status!=null&&A.hasOwnProperty("status")&&(s.status=r.enums===String?d.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[A.status]===void 0?A.status:d.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[A.status]:A.status),A.country!=null&&A.hasOwnProperty("country")&&(s.country=A.country),A.gatewayName!=null&&A.hasOwnProperty("gatewayName")&&(s.gatewayName=A.gatewayName,r.oneofs&&(s._gatewayName="gatewayName")),A.credentialId!=null&&A.hasOwnProperty("credentialId")&&(s.credentialId=A.credentialId,r.oneofs&&(s._credentialId="credentialId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MerchantPaymentPartnerAction"},a.Status=(function(){let i={},A=Object.create(i);return A[i[0]="ACTIVE"]=0,A[i[1]="INACTIVE"]=1,A})(),a})(),t.MusicUserIdAction=(function(){function a(i){if(this.musicUserIdMap={},i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.musicUserId=A.string();break}case 2:{c.musicUserIdMap===l.emptyObject&&(c.musicUserIdMap={});var f=A.uint32()+A.pos;for(I="",p="";A.pos>>3){case 1:I=A.string();break;case 2:p=A.string();break;default:A.skipType(Q&7);break}}c.musicUserIdMap[I]=p;break}default:A.skipType(B&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MusicUserIdAction)return A;var r=new d.proto.SyncActionValue.MusicUserIdAction;if(A.musicUserId!=null&&(r.musicUserId=String(A.musicUserId)),A.musicUserIdMap){if(typeof A.musicUserIdMap!="object")throw TypeError(".proto.SyncActionValue.MusicUserIdAction.musicUserIdMap: object expected");r.musicUserIdMap={};for(var s=Object.keys(A.musicUserIdMap),g=0;g>>3){case 1:{c.muted=A.bool();break}case 2:{c.muteEndTimestamp=A.int64();break}case 3:{c.autoMuted=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MuteAction)return A;var r=new d.proto.SyncActionValue.MuteAction;return A.muted!=null&&(r.muted=!!A.muted),A.muteEndTimestamp!=null&&(l.Long?(r.muteEndTimestamp=l.Long.fromValue(A.muteEndTimestamp)).unsigned=!1:typeof A.muteEndTimestamp=="string"?r.muteEndTimestamp=parseInt(A.muteEndTimestamp,10):typeof A.muteEndTimestamp=="number"?r.muteEndTimestamp=A.muteEndTimestamp:typeof A.muteEndTimestamp=="object"&&(r.muteEndTimestamp=new l.LongBits(A.muteEndTimestamp.low>>>0,A.muteEndTimestamp.high>>>0).toNumber())),A.autoMuted!=null&&(r.autoMuted=!!A.autoMuted),r},a.toObject=function(A,r){r||(r={});var s={};return A.muted!=null&&A.hasOwnProperty("muted")&&(s.muted=A.muted,r.oneofs&&(s._muted="muted")),A.muteEndTimestamp!=null&&A.hasOwnProperty("muteEndTimestamp")&&(typeof A.muteEndTimestamp=="number"?s.muteEndTimestamp=r.longs===String?String(A.muteEndTimestamp):A.muteEndTimestamp:s.muteEndTimestamp=r.longs===String?ge(A.muteEndTimestamp):r.longs===Number?ce(A.muteEndTimestamp):A.muteEndTimestamp,r.oneofs&&(s._muteEndTimestamp="muteEndTimestamp")),A.autoMuted!=null&&A.hasOwnProperty("autoMuted")&&(s.autoMuted=A.autoMuted,r.oneofs&&(s._autoMuted="autoMuted")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MuteAction"},a})(),t.NewsletterSavedInterestsAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.newsletterSavedInterests=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.NewsletterSavedInterestsAction)return A;var r=new d.proto.SyncActionValue.NewsletterSavedInterestsAction;return A.newsletterSavedInterests!=null&&(r.newsletterSavedInterests=String(A.newsletterSavedInterests)),r},a.toObject=function(A,r){r||(r={});var s={};return A.newsletterSavedInterests!=null&&A.hasOwnProperty("newsletterSavedInterests")&&(s.newsletterSavedInterests=A.newsletterSavedInterests,r.oneofs&&(s._newsletterSavedInterests="newsletterSavedInterests")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NewsletterSavedInterestsAction"},a})(),t.NoteEditAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.type=A.int32();break}case 2:{c.chatJid=A.string();break}case 3:{c.createdAt=A.int64();break}case 4:{c.deleted=A.bool();break}case 5:{c.unstructuredContent=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.NoteEditAction)return A;var r=new d.proto.SyncActionValue.NoteEditAction;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNSTRUCTURED":case 1:r.type=1;break;case"STRUCTURED":case 2:r.type=2;break}return A.chatJid!=null&&(r.chatJid=String(A.chatJid)),A.createdAt!=null&&(l.Long?(r.createdAt=l.Long.fromValue(A.createdAt)).unsigned=!1:typeof A.createdAt=="string"?r.createdAt=parseInt(A.createdAt,10):typeof A.createdAt=="number"?r.createdAt=A.createdAt:typeof A.createdAt=="object"&&(r.createdAt=new l.LongBits(A.createdAt.low>>>0,A.createdAt.high>>>0).toNumber())),A.deleted!=null&&(r.deleted=!!A.deleted),A.unstructuredContent!=null&&(r.unstructuredContent=String(A.unstructuredContent)),r},a.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.SyncActionValue.NoteEditAction.NoteType[A.type]===void 0?A.type:d.proto.SyncActionValue.NoteEditAction.NoteType[A.type]:A.type,r.oneofs&&(s._type="type")),A.chatJid!=null&&A.hasOwnProperty("chatJid")&&(s.chatJid=A.chatJid,r.oneofs&&(s._chatJid="chatJid")),A.createdAt!=null&&A.hasOwnProperty("createdAt")&&(typeof A.createdAt=="number"?s.createdAt=r.longs===String?String(A.createdAt):A.createdAt:s.createdAt=r.longs===String?ge(A.createdAt):r.longs===Number?ce(A.createdAt):A.createdAt,r.oneofs&&(s._createdAt="createdAt")),A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,r.oneofs&&(s._deleted="deleted")),A.unstructuredContent!=null&&A.hasOwnProperty("unstructuredContent")&&(s.unstructuredContent=A.unstructuredContent,r.oneofs&&(s._unstructuredContent="unstructuredContent")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NoteEditAction"},a.NoteType=(function(){let i={},A=Object.create(i);return A[i[1]="UNSTRUCTURED"]=1,A[i[2]="STRUCTURED"]=2,A})(),a})(),t.NotificationActivitySettingAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.notificationActivitySetting=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.NotificationActivitySettingAction)return A;var r=new d.proto.SyncActionValue.NotificationActivitySettingAction;switch(A.notificationActivitySetting){default:if(typeof A.notificationActivitySetting=="number"){r.notificationActivitySetting=A.notificationActivitySetting;break}break;case"DEFAULT_ALL_MESSAGES":case 0:r.notificationActivitySetting=0;break;case"ALL_MESSAGES":case 1:r.notificationActivitySetting=1;break;case"HIGHLIGHTS":case 2:r.notificationActivitySetting=2;break;case"DEFAULT_HIGHLIGHTS":case 3:r.notificationActivitySetting=3;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.notificationActivitySetting!=null&&A.hasOwnProperty("notificationActivitySetting")&&(s.notificationActivitySetting=r.enums===String?d.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[A.notificationActivitySetting]===void 0?A.notificationActivitySetting:d.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[A.notificationActivitySetting]:A.notificationActivitySetting,r.oneofs&&(s._notificationActivitySetting="notificationActivitySetting")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NotificationActivitySettingAction"},a.NotificationActivitySetting=(function(){let i={},A=Object.create(i);return A[i[0]="DEFAULT_ALL_MESSAGES"]=0,A[i[1]="ALL_MESSAGES"]=1,A[i[2]="HIGHLIGHTS"]=2,A[i[3]="DEFAULT_HIGHLIGHTS"]=3,A})(),a})(),t.NuxAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.acknowledged=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.NuxAction)return A;var r=new d.proto.SyncActionValue.NuxAction;return A.acknowledged!=null&&(r.acknowledged=!!A.acknowledged),r},a.toObject=function(A,r){r||(r={});var s={};return A.acknowledged!=null&&A.hasOwnProperty("acknowledged")&&(s.acknowledged=A.acknowledged,r.oneofs&&(s._acknowledged="acknowledged")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NuxAction"},a})(),t.PaymentInfoAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.cpi=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PaymentInfoAction)return A;var r=new d.proto.SyncActionValue.PaymentInfoAction;return A.cpi!=null&&(r.cpi=String(A.cpi)),r},a.toObject=function(A,r){r||(r={});var s={};return A.cpi!=null&&A.hasOwnProperty("cpi")&&(s.cpi=A.cpi,r.oneofs&&(s._cpi="cpi")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PaymentInfoAction"},a})(),t.PaymentTosAction=(function(){function a(e){if(e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.paymentNotice=i.int32();break}case 2:{g.accepted=i.bool();break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.PaymentTosAction)return i;var A=new d.proto.SyncActionValue.PaymentTosAction;switch(i.paymentNotice){default:if(typeof i.paymentNotice=="number"){A.paymentNotice=i.paymentNotice;break}break;case"BR_PAY_PRIVACY_POLICY":case 0:A.paymentNotice=0;break}return i.accepted!=null&&(A.accepted=!!i.accepted),A},a.toObject=function(i,A){A||(A={});var r={};return A.defaults&&(r.paymentNotice=A.enums===String?"BR_PAY_PRIVACY_POLICY":0,r.accepted=!1),i.paymentNotice!=null&&i.hasOwnProperty("paymentNotice")&&(r.paymentNotice=A.enums===String?d.proto.SyncActionValue.PaymentTosAction.PaymentNotice[i.paymentNotice]===void 0?i.paymentNotice:d.proto.SyncActionValue.PaymentTosAction.PaymentNotice[i.paymentNotice]:i.paymentNotice),i.accepted!=null&&i.hasOwnProperty("accepted")&&(r.accepted=i.accepted),r},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.SyncActionValue.PaymentTosAction"},a.PaymentNotice=(function(){let e={},i=Object.create(e);return i[e[0]="BR_PAY_PRIVACY_POLICY"]=0,i})(),a})(),t.PinAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.pinned=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PinAction)return A;var r=new d.proto.SyncActionValue.PinAction;return A.pinned!=null&&(r.pinned=!!A.pinned),r},a.toObject=function(A,r){r||(r={});var s={};return A.pinned!=null&&A.hasOwnProperty("pinned")&&(s.pinned=A.pinned,r.oneofs&&(s._pinned="pinned")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PinAction"},a})(),t.PnForLidChatAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.pnJid=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PnForLidChatAction)return A;var r=new d.proto.SyncActionValue.PnForLidChatAction;return A.pnJid!=null&&(r.pnJid=String(A.pnJid)),r},a.toObject=function(A,r){r||(r={});var s={};return A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,r.oneofs&&(s._pnJid="pnJid")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PnForLidChatAction"},a})(),t.PrimaryFeature=(function(){function a(e){if(this.flags=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.flags&&g.flags.length||(g.flags=[]),g.flags.push(i.string());break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.PrimaryFeature)return i;var A=new d.proto.SyncActionValue.PrimaryFeature;if(i.flags){if(!Array.isArray(i.flags))throw TypeError(".proto.SyncActionValue.PrimaryFeature.flags: array expected");A.flags=[];for(var r=0;r>>3){case 1:{c.version=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PrimaryVersionAction)return A;var r=new d.proto.SyncActionValue.PrimaryVersionAction;return A.version!=null&&(r.version=String(A.version)),r},a.toObject=function(A,r){r||(r={});var s={};return A.version!=null&&A.hasOwnProperty("version")&&(s.version=A.version,r.oneofs&&(s._version="version")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrimaryVersionAction"},a})(),t.PrivacySettingChannelsPersonalisedRecommendationAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isUserOptedOut=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction)return A;var r=new d.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction;return A.isUserOptedOut!=null&&(r.isUserOptedOut=!!A.isUserOptedOut),r},a.toObject=function(A,r){r||(r={});var s={};return A.isUserOptedOut!=null&&A.hasOwnProperty("isUserOptedOut")&&(s.isUserOptedOut=A.isUserOptedOut,r.oneofs&&(s._isUserOptedOut="isUserOptedOut")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction"},a})(),t.PrivacySettingDisableLinkPreviewsAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isPreviewsDisabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction)return A;var r=new d.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction;return A.isPreviewsDisabled!=null&&(r.isPreviewsDisabled=!!A.isPreviewsDisabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.isPreviewsDisabled!=null&&A.hasOwnProperty("isPreviewsDisabled")&&(s.isPreviewsDisabled=A.isPreviewsDisabled,r.oneofs&&(s._isPreviewsDisabled="isPreviewsDisabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction"},a})(),t.PrivacySettingRelayAllCalls=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PrivacySettingRelayAllCalls)return A;var r=new d.proto.SyncActionValue.PrivacySettingRelayAllCalls;return A.isEnabled!=null&&(r.isEnabled=!!A.isEnabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.isEnabled!=null&&A.hasOwnProperty("isEnabled")&&(s.isEnabled=A.isEnabled,r.oneofs&&(s._isEnabled="isEnabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingRelayAllCalls"},a})(),t.PrivateProcessingSettingAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.privateProcessingStatus=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PrivateProcessingSettingAction)return A;var r=new d.proto.SyncActionValue.PrivateProcessingSettingAction;switch(A.privateProcessingStatus){default:if(typeof A.privateProcessingStatus=="number"){r.privateProcessingStatus=A.privateProcessingStatus;break}break;case"UNDEFINED":case 0:r.privateProcessingStatus=0;break;case"ENABLED":case 1:r.privateProcessingStatus=1;break;case"DISABLED":case 2:r.privateProcessingStatus=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.privateProcessingStatus!=null&&A.hasOwnProperty("privateProcessingStatus")&&(s.privateProcessingStatus=r.enums===String?d.proto.SyncActionValue.PrivateProcessingSettingAction.PrivateProcessingStatus[A.privateProcessingStatus]===void 0?A.privateProcessingStatus:d.proto.SyncActionValue.PrivateProcessingSettingAction.PrivateProcessingStatus[A.privateProcessingStatus]:A.privateProcessingStatus,r.oneofs&&(s._privateProcessingStatus="privateProcessingStatus")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivateProcessingSettingAction"},a.PrivateProcessingStatus=(function(){let i={},A=Object.create(i);return A[i[0]="UNDEFINED"]=0,A[i[1]="ENABLED"]=1,A[i[2]="DISABLED"]=2,A})(),a})(),t.PushNameSetting=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.name=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PushNameSetting)return A;var r=new d.proto.SyncActionValue.PushNameSetting;return A.name!=null&&(r.name=String(A.name)),r},a.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PushNameSetting"},a})(),t.QuickReplyAction=(function(){function a(i){if(this.keywords=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.shortcut=A.string();break}case 2:{c.message=A.string();break}case 3:{c.keywords&&c.keywords.length||(c.keywords=[]),c.keywords.push(A.string());break}case 4:{c.count=A.int32();break}case 5:{c.deleted=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.QuickReplyAction)return A;var r=new d.proto.SyncActionValue.QuickReplyAction;if(A.shortcut!=null&&(r.shortcut=String(A.shortcut)),A.message!=null&&(r.message=String(A.message)),A.keywords){if(!Array.isArray(A.keywords))throw TypeError(".proto.SyncActionValue.QuickReplyAction.keywords: array expected");r.keywords=[];for(var s=0;s>>3){case 1:{g.weights&&g.weights.length||(g.weights=[]),g.weights.push(d.proto.RecentEmojiWeight.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.RecentEmojiWeightsAction)return i;var A=new d.proto.SyncActionValue.RecentEmojiWeightsAction;if(i.weights){if(!Array.isArray(i.weights))throw TypeError(".proto.SyncActionValue.RecentEmojiWeightsAction.weights: array expected");A.weights=[];for(var r=0;r>>3){case 1:{c.lastStickerSentTs=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.RemoveRecentStickerAction)return A;var r=new d.proto.SyncActionValue.RemoveRecentStickerAction;return A.lastStickerSentTs!=null&&(l.Long?(r.lastStickerSentTs=l.Long.fromValue(A.lastStickerSentTs)).unsigned=!1:typeof A.lastStickerSentTs=="string"?r.lastStickerSentTs=parseInt(A.lastStickerSentTs,10):typeof A.lastStickerSentTs=="number"?r.lastStickerSentTs=A.lastStickerSentTs:typeof A.lastStickerSentTs=="object"&&(r.lastStickerSentTs=new l.LongBits(A.lastStickerSentTs.low>>>0,A.lastStickerSentTs.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.lastStickerSentTs!=null&&A.hasOwnProperty("lastStickerSentTs")&&(typeof A.lastStickerSentTs=="number"?s.lastStickerSentTs=r.longs===String?String(A.lastStickerSentTs):A.lastStickerSentTs:s.lastStickerSentTs=r.longs===String?ge(A.lastStickerSentTs):r.longs===Number?ce(A.lastStickerSentTs):A.lastStickerSentTs,r.oneofs&&(s._lastStickerSentTs="lastStickerSentTs")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.RemoveRecentStickerAction"},a})(),t.StarAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.starred=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.StarAction)return A;var r=new d.proto.SyncActionValue.StarAction;return A.starred!=null&&(r.starred=!!A.starred),r},a.toObject=function(A,r){r||(r={});var s={};return A.starred!=null&&A.hasOwnProperty("starred")&&(s.starred=A.starred,r.oneofs&&(s._starred="starred")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StarAction"},a})(),t.StatusPostOptInNotificationPreferencesAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.enabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction)return A;var r=new d.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction;return A.enabled!=null&&(r.enabled=!!A.enabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.enabled!=null&&A.hasOwnProperty("enabled")&&(s.enabled=A.enabled,r.oneofs&&(s._enabled="enabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction"},a})(),t.StatusPrivacyAction=(function(){function a(i){if(this.userJid=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.mode=A.int32();break}case 2:{c.userJid&&c.userJid.length||(c.userJid=[]),c.userJid.push(A.string());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.StatusPrivacyAction)return A;var r=new d.proto.SyncActionValue.StatusPrivacyAction;switch(A.mode){default:if(typeof A.mode=="number"){r.mode=A.mode;break}break;case"ALLOW_LIST":case 0:r.mode=0;break;case"DENY_LIST":case 1:r.mode=1;break;case"CONTACTS":case 2:r.mode=2;break;case"CLOSE_FRIENDS":case 3:r.mode=3;break}if(A.userJid){if(!Array.isArray(A.userJid))throw TypeError(".proto.SyncActionValue.StatusPrivacyAction.userJid: array expected");r.userJid=[];for(var s=0;s>>3){case 1:{c.url=A.string();break}case 2:{c.fileEncSha256=A.bytes();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.mimetype=A.string();break}case 5:{c.height=A.uint32();break}case 6:{c.width=A.uint32();break}case 7:{c.directPath=A.string();break}case 8:{c.fileLength=A.uint64();break}case 9:{c.isFavorite=A.bool();break}case 10:{c.deviceIdHint=A.uint32();break}case 11:{c.isLottie=A.bool();break}case 12:{c.imageHash=A.string();break}case 13:{c.isAvatarSticker=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.StickerAction)return A;var r=new d.proto.SyncActionValue.StickerAction;return A.url!=null&&(r.url=String(A.url)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.directPath!=null&&(r.directPath=String(A.directPath)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.isFavorite!=null&&(r.isFavorite=!!A.isFavorite),A.deviceIdHint!=null&&(r.deviceIdHint=A.deviceIdHint>>>0),A.isLottie!=null&&(r.isLottie=!!A.isLottie),A.imageHash!=null&&(r.imageHash=String(A.imageHash)),A.isAvatarSticker!=null&&(r.isAvatarSticker=!!A.isAvatarSticker),r},a.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,r.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,r.oneofs&&(s._width="width")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.isFavorite!=null&&A.hasOwnProperty("isFavorite")&&(s.isFavorite=A.isFavorite,r.oneofs&&(s._isFavorite="isFavorite")),A.deviceIdHint!=null&&A.hasOwnProperty("deviceIdHint")&&(s.deviceIdHint=A.deviceIdHint,r.oneofs&&(s._deviceIdHint="deviceIdHint")),A.isLottie!=null&&A.hasOwnProperty("isLottie")&&(s.isLottie=A.isLottie,r.oneofs&&(s._isLottie="isLottie")),A.imageHash!=null&&A.hasOwnProperty("imageHash")&&(s.imageHash=A.imageHash,r.oneofs&&(s._imageHash="imageHash")),A.isAvatarSticker!=null&&A.hasOwnProperty("isAvatarSticker")&&(s.isAvatarSticker=A.isAvatarSticker,r.oneofs&&(s._isAvatarSticker="isAvatarSticker")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StickerAction"},a})(),t.SubscriptionAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isDeactivated=A.bool();break}case 2:{c.isAutoRenewing=A.bool();break}case 3:{c.expirationDate=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.SubscriptionAction)return A;var r=new d.proto.SyncActionValue.SubscriptionAction;return A.isDeactivated!=null&&(r.isDeactivated=!!A.isDeactivated),A.isAutoRenewing!=null&&(r.isAutoRenewing=!!A.isAutoRenewing),A.expirationDate!=null&&(l.Long?(r.expirationDate=l.Long.fromValue(A.expirationDate)).unsigned=!1:typeof A.expirationDate=="string"?r.expirationDate=parseInt(A.expirationDate,10):typeof A.expirationDate=="number"?r.expirationDate=A.expirationDate:typeof A.expirationDate=="object"&&(r.expirationDate=new l.LongBits(A.expirationDate.low>>>0,A.expirationDate.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.isDeactivated!=null&&A.hasOwnProperty("isDeactivated")&&(s.isDeactivated=A.isDeactivated,r.oneofs&&(s._isDeactivated="isDeactivated")),A.isAutoRenewing!=null&&A.hasOwnProperty("isAutoRenewing")&&(s.isAutoRenewing=A.isAutoRenewing,r.oneofs&&(s._isAutoRenewing="isAutoRenewing")),A.expirationDate!=null&&A.hasOwnProperty("expirationDate")&&(typeof A.expirationDate=="number"?s.expirationDate=r.longs===String?String(A.expirationDate):A.expirationDate:s.expirationDate=r.longs===String?ge(A.expirationDate):r.longs===Number?ce(A.expirationDate):A.expirationDate,r.oneofs&&(s._expirationDate="expirationDate")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.SubscriptionAction"},a})(),t.SyncActionMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.SyncActionMessage)return A;var r=new d.proto.SyncActionValue.SyncActionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.SyncActionValue.SyncActionMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}return A.timestamp!=null&&(l.Long?(r.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?r.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?r.timestamp=A.timestamp:typeof A.timestamp=="object"&&(r.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=r.longs===String?String(A.timestamp):A.timestamp:s.timestamp=r.longs===String?ge(A.timestamp):r.longs===Number?ce(A.timestamp):A.timestamp,r.oneofs&&(s._timestamp="timestamp")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.SyncActionMessage"},a})(),t.SyncActionMessageRange=(function(){function a(i){if(this.messages=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.lastMessageTimestamp=A.int64();break}case 2:{c.lastSystemMessageTimestamp=A.int64();break}case 3:{c.messages&&c.messages.length||(c.messages=[]),c.messages.push(d.proto.SyncActionValue.SyncActionMessage.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.SyncActionMessageRange)return A;var r=new d.proto.SyncActionValue.SyncActionMessageRange;if(A.lastMessageTimestamp!=null&&(l.Long?(r.lastMessageTimestamp=l.Long.fromValue(A.lastMessageTimestamp)).unsigned=!1:typeof A.lastMessageTimestamp=="string"?r.lastMessageTimestamp=parseInt(A.lastMessageTimestamp,10):typeof A.lastMessageTimestamp=="number"?r.lastMessageTimestamp=A.lastMessageTimestamp:typeof A.lastMessageTimestamp=="object"&&(r.lastMessageTimestamp=new l.LongBits(A.lastMessageTimestamp.low>>>0,A.lastMessageTimestamp.high>>>0).toNumber())),A.lastSystemMessageTimestamp!=null&&(l.Long?(r.lastSystemMessageTimestamp=l.Long.fromValue(A.lastSystemMessageTimestamp)).unsigned=!1:typeof A.lastSystemMessageTimestamp=="string"?r.lastSystemMessageTimestamp=parseInt(A.lastSystemMessageTimestamp,10):typeof A.lastSystemMessageTimestamp=="number"?r.lastSystemMessageTimestamp=A.lastSystemMessageTimestamp:typeof A.lastSystemMessageTimestamp=="object"&&(r.lastSystemMessageTimestamp=new l.LongBits(A.lastSystemMessageTimestamp.low>>>0,A.lastSystemMessageTimestamp.high>>>0).toNumber())),A.messages){if(!Array.isArray(A.messages))throw TypeError(".proto.SyncActionValue.SyncActionMessageRange.messages: array expected");r.messages=[];for(var s=0;s>>3){case 1:{c.isTwentyFourHourFormatEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.TimeFormatAction)return A;var r=new d.proto.SyncActionValue.TimeFormatAction;return A.isTwentyFourHourFormatEnabled!=null&&(r.isTwentyFourHourFormatEnabled=!!A.isTwentyFourHourFormatEnabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.isTwentyFourHourFormatEnabled!=null&&A.hasOwnProperty("isTwentyFourHourFormatEnabled")&&(s.isTwentyFourHourFormatEnabled=A.isTwentyFourHourFormatEnabled,r.oneofs&&(s._isTwentyFourHourFormatEnabled="isTwentyFourHourFormatEnabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.TimeFormatAction"},a})(),t.UGCBot=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.definition=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.UGCBot)return A;var r=new d.proto.SyncActionValue.UGCBot;return A.definition!=null&&(typeof A.definition=="string"?l.base64.decode(A.definition,r.definition=l.newBuffer(l.base64.length(A.definition)),0):A.definition.length>=0&&(r.definition=A.definition)),r},a.toObject=function(A,r){r||(r={});var s={};return A.definition!=null&&A.hasOwnProperty("definition")&&(s.definition=r.bytes===String?l.base64.encode(A.definition,0,A.definition.length):r.bytes===Array?Array.prototype.slice.call(A.definition):A.definition,r.oneofs&&(s._definition="definition")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UGCBot"},a})(),t.UnarchiveChatsSetting=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.unarchiveChats=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.UnarchiveChatsSetting)return A;var r=new d.proto.SyncActionValue.UnarchiveChatsSetting;return A.unarchiveChats!=null&&(r.unarchiveChats=!!A.unarchiveChats),r},a.toObject=function(A,r){r||(r={});var s={};return A.unarchiveChats!=null&&A.hasOwnProperty("unarchiveChats")&&(s.unarchiveChats=A.unarchiveChats,r.oneofs&&(s._unarchiveChats="unarchiveChats")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UnarchiveChatsSetting"},a})(),t.UserStatusMuteAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.muted=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.UserStatusMuteAction)return A;var r=new d.proto.SyncActionValue.UserStatusMuteAction;return A.muted!=null&&(r.muted=!!A.muted),r},a.toObject=function(A,r){r||(r={});var s={};return A.muted!=null&&A.hasOwnProperty("muted")&&(s.muted=A.muted,r.oneofs&&(s._muted="muted")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UserStatusMuteAction"},a})(),t.UsernameChatStartModeAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.chatStartMode=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.UsernameChatStartModeAction)return A;var r=new d.proto.SyncActionValue.UsernameChatStartModeAction;switch(A.chatStartMode){default:if(typeof A.chatStartMode=="number"){r.chatStartMode=A.chatStartMode;break}break;case"LID":case 1:r.chatStartMode=1;break;case"PN":case 2:r.chatStartMode=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.chatStartMode!=null&&A.hasOwnProperty("chatStartMode")&&(s.chatStartMode=r.enums===String?d.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[A.chatStartMode]===void 0?A.chatStartMode:d.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[A.chatStartMode]:A.chatStartMode,r.oneofs&&(s._chatStartMode="chatStartMode")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UsernameChatStartModeAction"},a.ChatStartMode=(function(){let i={},A=Object.create(i);return A[i[1]="LID"]=1,A[i[2]="PN"]=2,A})(),a})(),t.WaffleAccountLinkStateAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 2:{c.linkState=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.WaffleAccountLinkStateAction)return A;var r=new d.proto.SyncActionValue.WaffleAccountLinkStateAction;switch(A.linkState){default:if(typeof A.linkState=="number"){r.linkState=A.linkState;break}break;case"ACTIVE":case 0:r.linkState=0;break;case"PAUSED":case 1:r.linkState=1;break;case"UNLINKED":case 2:r.linkState=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.linkState!=null&&A.hasOwnProperty("linkState")&&(s.linkState=r.enums===String?d.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[A.linkState]===void 0?A.linkState:d.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[A.linkState]:A.linkState,r.oneofs&&(s._linkState="linkState")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.WaffleAccountLinkStateAction"},a.AccountLinkState=(function(){let i={},A=Object.create(i);return A[i[0]="ACTIVE"]=0,A[i[1]="PAUSED"]=1,A[i[2]="UNLINKED"]=2,A})(),a})(),t.WamoUserIdentifierAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.identifier=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.WamoUserIdentifierAction)return A;var r=new d.proto.SyncActionValue.WamoUserIdentifierAction;return A.identifier!=null&&(r.identifier=String(A.identifier)),r},a.toObject=function(A,r){r||(r={});var s={};return A.identifier!=null&&A.hasOwnProperty("identifier")&&(s.identifier=A.identifier,r.oneofs&&(s._identifier="identifier")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.WamoUserIdentifierAction"},a})(),t})(),n.SyncdIndex=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.blob=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdIndex)return e;var i=new d.proto.SyncdIndex;return e.blob!=null&&(typeof e.blob=="string"?l.base64.decode(e.blob,i.blob=l.newBuffer(l.base64.length(e.blob)),0):e.blob.length>=0&&(i.blob=e.blob)),i},t.toObject=function(e,i){i||(i={});var A={};return e.blob!=null&&e.hasOwnProperty("blob")&&(A.blob=i.bytes===String?l.base64.encode(e.blob,0,e.blob.length):i.bytes===Array?Array.prototype.slice.call(e.blob):e.blob,i.oneofs&&(A._blob="blob")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdIndex"},t})(),n.SyncdMutation=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.operation=e.int32();break}case 2:{s.record=d.proto.SyncdRecord.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdMutation)return e;var i=new d.proto.SyncdMutation;switch(e.operation){default:if(typeof e.operation=="number"){i.operation=e.operation;break}break;case"SET":case 0:i.operation=0;break;case"REMOVE":case 1:i.operation=1;break}if(e.record!=null){if(typeof e.record!="object")throw TypeError(".proto.SyncdMutation.record: object expected");i.record=d.proto.SyncdRecord.fromObject(e.record)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.operation!=null&&e.hasOwnProperty("operation")&&(A.operation=i.enums===String?d.proto.SyncdMutation.SyncdOperation[e.operation]===void 0?e.operation:d.proto.SyncdMutation.SyncdOperation[e.operation]:e.operation,i.oneofs&&(A._operation="operation")),e.record!=null&&e.hasOwnProperty("record")&&(A.record=d.proto.SyncdRecord.toObject(e.record,i),i.oneofs&&(A._record="record")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdMutation"},t.SyncdOperation=(function(){let a={},e=Object.create(a);return e[a[0]="SET"]=0,e[a[1]="REMOVE"]=1,e})(),t})(),n.SyncdMutations=(function(){function t(o){if(this.mutations=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.mutations&&r.mutations.length||(r.mutations=[]),r.mutations.push(d.proto.SyncdMutation.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.SyncdMutations)return a;var e=new d.proto.SyncdMutations;if(a.mutations){if(!Array.isArray(a.mutations))throw TypeError(".proto.SyncdMutations.mutations: array expected");e.mutations=[];for(var i=0;i>>3){case 1:{s.version=d.proto.SyncdVersion.decode(e,e.uint32());break}case 2:{s.mutations&&s.mutations.length||(s.mutations=[]),s.mutations.push(d.proto.SyncdMutation.decode(e,e.uint32()));break}case 3:{s.externalMutations=d.proto.ExternalBlobReference.decode(e,e.uint32());break}case 4:{s.snapshotMac=e.bytes();break}case 5:{s.patchMac=e.bytes();break}case 6:{s.keyId=d.proto.KeyId.decode(e,e.uint32());break}case 7:{s.exitCode=d.proto.ExitCode.decode(e,e.uint32());break}case 8:{s.deviceIndex=e.uint32();break}case 9:{s.clientDebugData=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdPatch)return e;var i=new d.proto.SyncdPatch;if(e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.SyncdPatch.version: object expected");i.version=d.proto.SyncdVersion.fromObject(e.version)}if(e.mutations){if(!Array.isArray(e.mutations))throw TypeError(".proto.SyncdPatch.mutations: array expected");i.mutations=[];for(var A=0;A=0&&(i.snapshotMac=e.snapshotMac)),e.patchMac!=null&&(typeof e.patchMac=="string"?l.base64.decode(e.patchMac,i.patchMac=l.newBuffer(l.base64.length(e.patchMac)),0):e.patchMac.length>=0&&(i.patchMac=e.patchMac)),e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdPatch.keyId: object expected");i.keyId=d.proto.KeyId.fromObject(e.keyId)}if(e.exitCode!=null){if(typeof e.exitCode!="object")throw TypeError(".proto.SyncdPatch.exitCode: object expected");i.exitCode=d.proto.ExitCode.fromObject(e.exitCode)}return e.deviceIndex!=null&&(i.deviceIndex=e.deviceIndex>>>0),e.clientDebugData!=null&&(typeof e.clientDebugData=="string"?l.base64.decode(e.clientDebugData,i.clientDebugData=l.newBuffer(l.base64.length(e.clientDebugData)),0):e.clientDebugData.length>=0&&(i.clientDebugData=e.clientDebugData)),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.mutations=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=d.proto.SyncdVersion.toObject(e.version,i),i.oneofs&&(A._version="version")),e.mutations&&e.mutations.length){A.mutations=[];for(var r=0;r>>3){case 1:{s.index=d.proto.SyncdIndex.decode(e,e.uint32());break}case 2:{s.value=d.proto.SyncdValue.decode(e,e.uint32());break}case 3:{s.keyId=d.proto.KeyId.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdRecord)return e;var i=new d.proto.SyncdRecord;if(e.index!=null){if(typeof e.index!="object")throw TypeError(".proto.SyncdRecord.index: object expected");i.index=d.proto.SyncdIndex.fromObject(e.index)}if(e.value!=null){if(typeof e.value!="object")throw TypeError(".proto.SyncdRecord.value: object expected");i.value=d.proto.SyncdValue.fromObject(e.value)}if(e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdRecord.keyId: object expected");i.keyId=d.proto.KeyId.fromObject(e.keyId)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.index!=null&&e.hasOwnProperty("index")&&(A.index=d.proto.SyncdIndex.toObject(e.index,i),i.oneofs&&(A._index="index")),e.value!=null&&e.hasOwnProperty("value")&&(A.value=d.proto.SyncdValue.toObject(e.value,i),i.oneofs&&(A._value="value")),e.keyId!=null&&e.hasOwnProperty("keyId")&&(A.keyId=d.proto.KeyId.toObject(e.keyId,i),i.oneofs&&(A._keyId="keyId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdRecord"},t})(),n.SyncdSnapshot=(function(){function t(a){if(this.records=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.version=d.proto.SyncdVersion.decode(e,e.uint32());break}case 2:{s.records&&s.records.length||(s.records=[]),s.records.push(d.proto.SyncdRecord.decode(e,e.uint32()));break}case 3:{s.mac=e.bytes();break}case 4:{s.keyId=d.proto.KeyId.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdSnapshot)return e;var i=new d.proto.SyncdSnapshot;if(e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.SyncdSnapshot.version: object expected");i.version=d.proto.SyncdVersion.fromObject(e.version)}if(e.records){if(!Array.isArray(e.records))throw TypeError(".proto.SyncdSnapshot.records: array expected");i.records=[];for(var A=0;A=0&&(i.mac=e.mac)),e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdSnapshot.keyId: object expected");i.keyId=d.proto.KeyId.fromObject(e.keyId)}return i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.records=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=d.proto.SyncdVersion.toObject(e.version,i),i.oneofs&&(A._version="version")),e.records&&e.records.length){A.records=[];for(var r=0;r>>3){case 1:{s.blob=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdValue)return e;var i=new d.proto.SyncdValue;return e.blob!=null&&(typeof e.blob=="string"?l.base64.decode(e.blob,i.blob=l.newBuffer(l.base64.length(e.blob)),0):e.blob.length>=0&&(i.blob=e.blob)),i},t.toObject=function(e,i){i||(i={});var A={};return e.blob!=null&&e.hasOwnProperty("blob")&&(A.blob=i.bytes===String?l.base64.encode(e.blob,0,e.blob.length):i.bytes===Array?Array.prototype.slice.call(e.blob):e.blob,i.oneofs&&(A._blob="blob")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdValue"},t})(),n.SyncdVersion=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.version=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdVersion)return e;var i=new d.proto.SyncdVersion;return e.version!=null&&(l.Long?(i.version=l.Long.fromValue(e.version)).unsigned=!0:typeof e.version=="string"?i.version=parseInt(e.version,10):typeof e.version=="number"?i.version=e.version:typeof e.version=="object"&&(i.version=new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};return e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?A.version=i.longs===String?String(e.version):e.version:A.version=i.longs===String?ge(e.version,!0):i.longs===Number?ce(e.version,!0):e.version,i.oneofs&&(A._version="version")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdVersion"},t})(),n.TapLinkAction=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.title=e.string();break}case 2:{s.tapUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.TapLinkAction)return e;var i=new d.proto.TapLinkAction;return e.title!=null&&(i.title=String(e.title)),e.tapUrl!=null&&(i.tapUrl=String(e.tapUrl)),i},t.toObject=function(e,i){i||(i={});var A={};return e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,i.oneofs&&(A._title="title")),e.tapUrl!=null&&e.hasOwnProperty("tapUrl")&&(A.tapUrl=e.tapUrl,i.oneofs&&(A._tapUrl="tapUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.TapLinkAction"},t})(),n.TemplateButton=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 4:{s.index=e.uint32();break}case 1:{s.quickReplyButton=d.proto.TemplateButton.QuickReplyButton.decode(e,e.uint32());break}case 2:{s.urlButton=d.proto.TemplateButton.URLButton.decode(e,e.uint32());break}case 3:{s.callButton=d.proto.TemplateButton.CallButton.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.TemplateButton)return e;var i=new d.proto.TemplateButton;if(e.index!=null&&(i.index=e.index>>>0),e.quickReplyButton!=null){if(typeof e.quickReplyButton!="object")throw TypeError(".proto.TemplateButton.quickReplyButton: object expected");i.quickReplyButton=d.proto.TemplateButton.QuickReplyButton.fromObject(e.quickReplyButton)}if(e.urlButton!=null){if(typeof e.urlButton!="object")throw TypeError(".proto.TemplateButton.urlButton: object expected");i.urlButton=d.proto.TemplateButton.URLButton.fromObject(e.urlButton)}if(e.callButton!=null){if(typeof e.callButton!="object")throw TypeError(".proto.TemplateButton.callButton: object expected");i.callButton=d.proto.TemplateButton.CallButton.fromObject(e.callButton)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.quickReplyButton!=null&&e.hasOwnProperty("quickReplyButton")&&(A.quickReplyButton=d.proto.TemplateButton.QuickReplyButton.toObject(e.quickReplyButton,i),i.oneofs&&(A.button="quickReplyButton")),e.urlButton!=null&&e.hasOwnProperty("urlButton")&&(A.urlButton=d.proto.TemplateButton.URLButton.toObject(e.urlButton,i),i.oneofs&&(A.button="urlButton")),e.callButton!=null&&e.hasOwnProperty("callButton")&&(A.callButton=d.proto.TemplateButton.CallButton.toObject(e.callButton,i),i.oneofs&&(A.button="callButton")),e.index!=null&&e.hasOwnProperty("index")&&(A.index=e.index,i.oneofs&&(A._index="index")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.TemplateButton"},t.CallButton=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayText=d.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.phoneNumber=d.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.TemplateButton.CallButton)return A;var r=new d.proto.TemplateButton.CallButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.CallButton.displayText: object expected");r.displayText=d.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}if(A.phoneNumber!=null){if(typeof A.phoneNumber!="object")throw TypeError(".proto.TemplateButton.CallButton.phoneNumber: object expected");r.phoneNumber=d.proto.Message.HighlyStructuredMessage.fromObject(A.phoneNumber)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=d.proto.Message.HighlyStructuredMessage.toObject(A.displayText,r),r.oneofs&&(s._displayText="displayText")),A.phoneNumber!=null&&A.hasOwnProperty("phoneNumber")&&(s.phoneNumber=d.proto.Message.HighlyStructuredMessage.toObject(A.phoneNumber,r),r.oneofs&&(s._phoneNumber="phoneNumber")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.CallButton"},a})(),t.QuickReplyButton=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayText=d.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.TemplateButton.QuickReplyButton)return A;var r=new d.proto.TemplateButton.QuickReplyButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.QuickReplyButton.displayText: object expected");r.displayText=d.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}return A.id!=null&&(r.id=String(A.id)),r},a.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=d.proto.Message.HighlyStructuredMessage.toObject(A.displayText,r),r.oneofs&&(s._displayText="displayText")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.QuickReplyButton"},a})(),t.URLButton=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayText=d.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.url=d.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.TemplateButton.URLButton)return A;var r=new d.proto.TemplateButton.URLButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.URLButton.displayText: object expected");r.displayText=d.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}if(A.url!=null){if(typeof A.url!="object")throw TypeError(".proto.TemplateButton.URLButton.url: object expected");r.url=d.proto.Message.HighlyStructuredMessage.fromObject(A.url)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=d.proto.Message.HighlyStructuredMessage.toObject(A.displayText,r),r.oneofs&&(s._displayText="displayText")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=d.proto.Message.HighlyStructuredMessage.toObject(A.url,r),r.oneofs&&(s._url="url")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.URLButton"},a})(),t})(),n.ThreadID=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.threadType=e.int32();break}case 2:{s.threadKey=d.proto.MessageKey.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ThreadID)return e;var i=new d.proto.ThreadID;switch(e.threadType){default:if(typeof e.threadType=="number"){i.threadType=e.threadType;break}break;case"UNKNOWN":case 0:i.threadType=0;break;case"VIEW_REPLIES":case 1:i.threadType=1;break;case"AI_THREAD":case 2:i.threadType=2;break}if(e.threadKey!=null){if(typeof e.threadKey!="object")throw TypeError(".proto.ThreadID.threadKey: object expected");i.threadKey=d.proto.MessageKey.fromObject(e.threadKey)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.threadType!=null&&e.hasOwnProperty("threadType")&&(A.threadType=i.enums===String?d.proto.ThreadID.ThreadType[e.threadType]===void 0?e.threadType:d.proto.ThreadID.ThreadType[e.threadType]:e.threadType,i.oneofs&&(A._threadType="threadType")),e.threadKey!=null&&e.hasOwnProperty("threadKey")&&(A.threadKey=d.proto.MessageKey.toObject(e.threadKey,i),i.oneofs&&(A._threadKey="threadKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ThreadID"},t.ThreadType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="VIEW_REPLIES"]=1,e[a[2]="AI_THREAD"]=2,e})(),t})(),n.UrlTrackingMap=(function(){function t(o){if(this.urlTrackingMapElements=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.urlTrackingMapElements&&r.urlTrackingMapElements.length||(r.urlTrackingMapElements=[]),r.urlTrackingMapElements.push(d.proto.UrlTrackingMap.UrlTrackingMapElement.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.UrlTrackingMap)return a;var e=new d.proto.UrlTrackingMap;if(a.urlTrackingMapElements){if(!Array.isArray(a.urlTrackingMapElements))throw TypeError(".proto.UrlTrackingMap.urlTrackingMapElements: array expected");e.urlTrackingMapElements=[];for(var i=0;i>>3){case 1:{g.originalUrl=i.string();break}case 2:{g.unconsentedUsersUrl=i.string();break}case 3:{g.consentedUsersUrl=i.string();break}case 4:{g.cardIndex=i.uint32();break}default:i.skipType(c&7);break}}return g},o.fromObject=function(i){if(i instanceof d.proto.UrlTrackingMap.UrlTrackingMapElement)return i;var A=new d.proto.UrlTrackingMap.UrlTrackingMapElement;return i.originalUrl!=null&&(A.originalUrl=String(i.originalUrl)),i.unconsentedUsersUrl!=null&&(A.unconsentedUsersUrl=String(i.unconsentedUsersUrl)),i.consentedUsersUrl!=null&&(A.consentedUsersUrl=String(i.consentedUsersUrl)),i.cardIndex!=null&&(A.cardIndex=i.cardIndex>>>0),A},o.toObject=function(i,A){A||(A={});var r={};return i.originalUrl!=null&&i.hasOwnProperty("originalUrl")&&(r.originalUrl=i.originalUrl,A.oneofs&&(r._originalUrl="originalUrl")),i.unconsentedUsersUrl!=null&&i.hasOwnProperty("unconsentedUsersUrl")&&(r.unconsentedUsersUrl=i.unconsentedUsersUrl,A.oneofs&&(r._unconsentedUsersUrl="unconsentedUsersUrl")),i.consentedUsersUrl!=null&&i.hasOwnProperty("consentedUsersUrl")&&(r.consentedUsersUrl=i.consentedUsersUrl,A.oneofs&&(r._consentedUsersUrl="consentedUsersUrl")),i.cardIndex!=null&&i.hasOwnProperty("cardIndex")&&(r.cardIndex=i.cardIndex,A.oneofs&&(r._cardIndex="cardIndex")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},o.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.UrlTrackingMap.UrlTrackingMapElement"},o})(),t})(),n.UserPassword=(function(){function t(a){if(this.transformerArg=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.encoding=e.int32();break}case 2:{s.transformer=e.int32();break}case 3:{s.transformerArg&&s.transformerArg.length||(s.transformerArg=[]),s.transformerArg.push(d.proto.UserPassword.TransformerArg.decode(e,e.uint32()));break}case 4:{s.transformedData=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.UserPassword)return e;var i=new d.proto.UserPassword;switch(e.encoding){default:if(typeof e.encoding=="number"){i.encoding=e.encoding;break}break;case"UTF8":case 0:i.encoding=0;break;case"UTF8_BROKEN":case 1:i.encoding=1;break}switch(e.transformer){default:if(typeof e.transformer=="number"){i.transformer=e.transformer;break}break;case"NONE":case 0:i.transformer=0;break;case"PBKDF2_HMAC_SHA512":case 1:i.transformer=1;break;case"PBKDF2_HMAC_SHA384":case 2:i.transformer=2;break}if(e.transformerArg){if(!Array.isArray(e.transformerArg))throw TypeError(".proto.UserPassword.transformerArg: array expected");i.transformerArg=[];for(var A=0;A=0&&(i.transformedData=e.transformedData)),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.transformerArg=[]),e.encoding!=null&&e.hasOwnProperty("encoding")&&(A.encoding=i.enums===String?d.proto.UserPassword.Encoding[e.encoding]===void 0?e.encoding:d.proto.UserPassword.Encoding[e.encoding]:e.encoding,i.oneofs&&(A._encoding="encoding")),e.transformer!=null&&e.hasOwnProperty("transformer")&&(A.transformer=i.enums===String?d.proto.UserPassword.Transformer[e.transformer]===void 0?e.transformer:d.proto.UserPassword.Transformer[e.transformer]:e.transformer,i.oneofs&&(A._transformer="transformer")),e.transformerArg&&e.transformerArg.length){A.transformerArg=[];for(var r=0;r>>3){case 1:{c.key=A.string();break}case 2:{c.value=d.proto.UserPassword.TransformerArg.Value.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.UserPassword.TransformerArg)return A;var r=new d.proto.UserPassword.TransformerArg;if(A.key!=null&&(r.key=String(A.key)),A.value!=null){if(typeof A.value!="object")throw TypeError(".proto.UserPassword.TransformerArg.value: object expected");r.value=d.proto.UserPassword.TransformerArg.Value.fromObject(A.value)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=A.key,r.oneofs&&(s._key="key")),A.value!=null&&A.hasOwnProperty("value")&&(s.value=d.proto.UserPassword.TransformerArg.Value.toObject(A.value,r),r.oneofs&&(s._value="value")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.UserPassword.TransformerArg"},a.Value=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.asBlob=s.bytes();break}case 2:{p.asUnsignedInteger=s.uint32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.UserPassword.TransformerArg.Value)return s;var g=new d.proto.UserPassword.TransformerArg.Value;return s.asBlob!=null&&(typeof s.asBlob=="string"?l.base64.decode(s.asBlob,g.asBlob=l.newBuffer(l.base64.length(s.asBlob)),0):s.asBlob.length>=0&&(g.asBlob=s.asBlob)),s.asUnsignedInteger!=null&&(g.asUnsignedInteger=s.asUnsignedInteger>>>0),g},i.toObject=function(s,g){g||(g={});var c={};return s.asBlob!=null&&s.hasOwnProperty("asBlob")&&(c.asBlob=g.bytes===String?l.base64.encode(s.asBlob,0,s.asBlob.length):g.bytes===Array?Array.prototype.slice.call(s.asBlob):s.asBlob,g.oneofs&&(c.value="asBlob")),s.asUnsignedInteger!=null&&s.hasOwnProperty("asUnsignedInteger")&&(c.asUnsignedInteger=s.asUnsignedInteger,g.oneofs&&(c.value="asUnsignedInteger")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.UserPassword.TransformerArg.Value"},i})(),a})(),t})(),n.UserReceipt=(function(){function t(a){if(this.pendingDeviceJid=[],this.deliveredDeviceJid=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.userJid=e.string();break}case 2:{s.receiptTimestamp=e.int64();break}case 3:{s.readTimestamp=e.int64();break}case 4:{s.playedTimestamp=e.int64();break}case 5:{s.pendingDeviceJid&&s.pendingDeviceJid.length||(s.pendingDeviceJid=[]),s.pendingDeviceJid.push(e.string());break}case 6:{s.deliveredDeviceJid&&s.deliveredDeviceJid.length||(s.deliveredDeviceJid=[]),s.deliveredDeviceJid.push(e.string());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.UserReceipt)return e;var i=new d.proto.UserReceipt;if(e.userJid!=null&&(i.userJid=String(e.userJid)),e.receiptTimestamp!=null&&(l.Long?(i.receiptTimestamp=l.Long.fromValue(e.receiptTimestamp)).unsigned=!1:typeof e.receiptTimestamp=="string"?i.receiptTimestamp=parseInt(e.receiptTimestamp,10):typeof e.receiptTimestamp=="number"?i.receiptTimestamp=e.receiptTimestamp:typeof e.receiptTimestamp=="object"&&(i.receiptTimestamp=new l.LongBits(e.receiptTimestamp.low>>>0,e.receiptTimestamp.high>>>0).toNumber())),e.readTimestamp!=null&&(l.Long?(i.readTimestamp=l.Long.fromValue(e.readTimestamp)).unsigned=!1:typeof e.readTimestamp=="string"?i.readTimestamp=parseInt(e.readTimestamp,10):typeof e.readTimestamp=="number"?i.readTimestamp=e.readTimestamp:typeof e.readTimestamp=="object"&&(i.readTimestamp=new l.LongBits(e.readTimestamp.low>>>0,e.readTimestamp.high>>>0).toNumber())),e.playedTimestamp!=null&&(l.Long?(i.playedTimestamp=l.Long.fromValue(e.playedTimestamp)).unsigned=!1:typeof e.playedTimestamp=="string"?i.playedTimestamp=parseInt(e.playedTimestamp,10):typeof e.playedTimestamp=="number"?i.playedTimestamp=e.playedTimestamp:typeof e.playedTimestamp=="object"&&(i.playedTimestamp=new l.LongBits(e.playedTimestamp.low>>>0,e.playedTimestamp.high>>>0).toNumber())),e.pendingDeviceJid){if(!Array.isArray(e.pendingDeviceJid))throw TypeError(".proto.UserReceipt.pendingDeviceJid: array expected");i.pendingDeviceJid=[];for(var A=0;A>>3){case 1:{s.details=e.bytes();break}case 2:{s.signature=e.bytes();break}case 3:{s.serverSignature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.VerifiedNameCertificate)return e;var i=new d.proto.VerifiedNameCertificate;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,i.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(i.details=e.details)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,i.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(i.signature=e.signature)),e.serverSignature!=null&&(typeof e.serverSignature=="string"?l.base64.decode(e.serverSignature,i.serverSignature=l.newBuffer(l.base64.length(e.serverSignature)),0):e.serverSignature.length>=0&&(i.serverSignature=e.serverSignature)),i},t.toObject=function(e,i){i||(i={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=i.bytes===String?l.base64.encode(e.details,0,e.details.length):i.bytes===Array?Array.prototype.slice.call(e.details):e.details,i.oneofs&&(A._details="details")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=i.bytes===String?l.base64.encode(e.signature,0,e.signature.length):i.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,i.oneofs&&(A._signature="signature")),e.serverSignature!=null&&e.hasOwnProperty("serverSignature")&&(A.serverSignature=i.bytes===String?l.base64.encode(e.serverSignature,0,e.serverSignature.length):i.bytes===Array?Array.prototype.slice.call(e.serverSignature):e.serverSignature,i.oneofs&&(A._serverSignature="serverSignature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.VerifiedNameCertificate"},t.Details=(function(){function a(i){if(this.localizedNames=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.serial=A.uint64();break}case 2:{c.issuer=A.string();break}case 4:{c.verifiedName=A.string();break}case 8:{c.localizedNames&&c.localizedNames.length||(c.localizedNames=[]),c.localizedNames.push(d.proto.LocalizedName.decode(A,A.uint32()));break}case 10:{c.issueTime=A.uint64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.VerifiedNameCertificate.Details)return A;var r=new d.proto.VerifiedNameCertificate.Details;if(A.serial!=null&&(l.Long?(r.serial=l.Long.fromValue(A.serial)).unsigned=!0:typeof A.serial=="string"?r.serial=parseInt(A.serial,10):typeof A.serial=="number"?r.serial=A.serial:typeof A.serial=="object"&&(r.serial=new l.LongBits(A.serial.low>>>0,A.serial.high>>>0).toNumber(!0))),A.issuer!=null&&(r.issuer=String(A.issuer)),A.verifiedName!=null&&(r.verifiedName=String(A.verifiedName)),A.localizedNames){if(!Array.isArray(A.localizedNames))throw TypeError(".proto.VerifiedNameCertificate.Details.localizedNames: array expected");r.localizedNames=[];for(var s=0;s>>0,A.issueTime.high>>>0).toNumber(!0))),r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.localizedNames=[]),A.serial!=null&&A.hasOwnProperty("serial")&&(typeof A.serial=="number"?s.serial=r.longs===String?String(A.serial):A.serial:s.serial=r.longs===String?ge(A.serial,!0):r.longs===Number?ce(A.serial,!0):A.serial,r.oneofs&&(s._serial="serial")),A.issuer!=null&&A.hasOwnProperty("issuer")&&(s.issuer=A.issuer,r.oneofs&&(s._issuer="issuer")),A.verifiedName!=null&&A.hasOwnProperty("verifiedName")&&(s.verifiedName=A.verifiedName,r.oneofs&&(s._verifiedName="verifiedName")),A.localizedNames&&A.localizedNames.length){s.localizedNames=[];for(var g=0;g>>3){case 1:{s.filename=e.string();break}case 2:{s.opacity=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.WallpaperSettings)return e;var i=new d.proto.WallpaperSettings;return e.filename!=null&&(i.filename=String(e.filename)),e.opacity!=null&&(i.opacity=e.opacity>>>0),i},t.toObject=function(e,i){i||(i={});var A={};return e.filename!=null&&e.hasOwnProperty("filename")&&(A.filename=e.filename,i.oneofs&&(A._filename="filename")),e.opacity!=null&&e.hasOwnProperty("opacity")&&(A.opacity=e.opacity,i.oneofs&&(A._opacity="opacity")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.WallpaperSettings"},t})(),n.WebFeatures=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.labelsDisplay=e.int32();break}case 2:{s.voipIndividualOutgoing=e.int32();break}case 3:{s.groupsV3=e.int32();break}case 4:{s.groupsV3Create=e.int32();break}case 5:{s.changeNumberV2=e.int32();break}case 6:{s.queryStatusV3Thumbnail=e.int32();break}case 7:{s.liveLocations=e.int32();break}case 8:{s.queryVname=e.int32();break}case 9:{s.voipIndividualIncoming=e.int32();break}case 10:{s.quickRepliesQuery=e.int32();break}case 11:{s.payments=e.int32();break}case 12:{s.stickerPackQuery=e.int32();break}case 13:{s.liveLocationsFinal=e.int32();break}case 14:{s.labelsEdit=e.int32();break}case 15:{s.mediaUpload=e.int32();break}case 18:{s.mediaUploadRichQuickReplies=e.int32();break}case 19:{s.vnameV2=e.int32();break}case 20:{s.videoPlaybackUrl=e.int32();break}case 21:{s.statusRanking=e.int32();break}case 22:{s.voipIndividualVideo=e.int32();break}case 23:{s.thirdPartyStickers=e.int32();break}case 24:{s.frequentlyForwardedSetting=e.int32();break}case 25:{s.groupsV4JoinPermission=e.int32();break}case 26:{s.recentStickers=e.int32();break}case 27:{s.catalog=e.int32();break}case 28:{s.starredStickers=e.int32();break}case 29:{s.voipGroupCall=e.int32();break}case 30:{s.templateMessage=e.int32();break}case 31:{s.templateMessageInteractivity=e.int32();break}case 32:{s.ephemeralMessages=e.int32();break}case 33:{s.e2ENotificationSync=e.int32();break}case 34:{s.recentStickersV2=e.int32();break}case 36:{s.recentStickersV3=e.int32();break}case 37:{s.userNotice=e.int32();break}case 39:{s.support=e.int32();break}case 40:{s.groupUiiCleanup=e.int32();break}case 41:{s.groupDogfoodingInternalOnly=e.int32();break}case 42:{s.settingsSync=e.int32();break}case 43:{s.archiveV2=e.int32();break}case 44:{s.ephemeralAllowGroupMembers=e.int32();break}case 45:{s.ephemeral24HDuration=e.int32();break}case 46:{s.mdForceUpgrade=e.int32();break}case 47:{s.disappearingMode=e.int32();break}case 48:{s.externalMdOptInAvailable=e.int32();break}case 49:{s.noDeleteMessageTimeLimit=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.WebFeatures)return e;var i=new d.proto.WebFeatures;switch(e.labelsDisplay){default:if(typeof e.labelsDisplay=="number"){i.labelsDisplay=e.labelsDisplay;break}break;case"NOT_STARTED":case 0:i.labelsDisplay=0;break;case"FORCE_UPGRADE":case 1:i.labelsDisplay=1;break;case"DEVELOPMENT":case 2:i.labelsDisplay=2;break;case"PRODUCTION":case 3:i.labelsDisplay=3;break}switch(e.voipIndividualOutgoing){default:if(typeof e.voipIndividualOutgoing=="number"){i.voipIndividualOutgoing=e.voipIndividualOutgoing;break}break;case"NOT_STARTED":case 0:i.voipIndividualOutgoing=0;break;case"FORCE_UPGRADE":case 1:i.voipIndividualOutgoing=1;break;case"DEVELOPMENT":case 2:i.voipIndividualOutgoing=2;break;case"PRODUCTION":case 3:i.voipIndividualOutgoing=3;break}switch(e.groupsV3){default:if(typeof e.groupsV3=="number"){i.groupsV3=e.groupsV3;break}break;case"NOT_STARTED":case 0:i.groupsV3=0;break;case"FORCE_UPGRADE":case 1:i.groupsV3=1;break;case"DEVELOPMENT":case 2:i.groupsV3=2;break;case"PRODUCTION":case 3:i.groupsV3=3;break}switch(e.groupsV3Create){default:if(typeof e.groupsV3Create=="number"){i.groupsV3Create=e.groupsV3Create;break}break;case"NOT_STARTED":case 0:i.groupsV3Create=0;break;case"FORCE_UPGRADE":case 1:i.groupsV3Create=1;break;case"DEVELOPMENT":case 2:i.groupsV3Create=2;break;case"PRODUCTION":case 3:i.groupsV3Create=3;break}switch(e.changeNumberV2){default:if(typeof e.changeNumberV2=="number"){i.changeNumberV2=e.changeNumberV2;break}break;case"NOT_STARTED":case 0:i.changeNumberV2=0;break;case"FORCE_UPGRADE":case 1:i.changeNumberV2=1;break;case"DEVELOPMENT":case 2:i.changeNumberV2=2;break;case"PRODUCTION":case 3:i.changeNumberV2=3;break}switch(e.queryStatusV3Thumbnail){default:if(typeof e.queryStatusV3Thumbnail=="number"){i.queryStatusV3Thumbnail=e.queryStatusV3Thumbnail;break}break;case"NOT_STARTED":case 0:i.queryStatusV3Thumbnail=0;break;case"FORCE_UPGRADE":case 1:i.queryStatusV3Thumbnail=1;break;case"DEVELOPMENT":case 2:i.queryStatusV3Thumbnail=2;break;case"PRODUCTION":case 3:i.queryStatusV3Thumbnail=3;break}switch(e.liveLocations){default:if(typeof e.liveLocations=="number"){i.liveLocations=e.liveLocations;break}break;case"NOT_STARTED":case 0:i.liveLocations=0;break;case"FORCE_UPGRADE":case 1:i.liveLocations=1;break;case"DEVELOPMENT":case 2:i.liveLocations=2;break;case"PRODUCTION":case 3:i.liveLocations=3;break}switch(e.queryVname){default:if(typeof e.queryVname=="number"){i.queryVname=e.queryVname;break}break;case"NOT_STARTED":case 0:i.queryVname=0;break;case"FORCE_UPGRADE":case 1:i.queryVname=1;break;case"DEVELOPMENT":case 2:i.queryVname=2;break;case"PRODUCTION":case 3:i.queryVname=3;break}switch(e.voipIndividualIncoming){default:if(typeof e.voipIndividualIncoming=="number"){i.voipIndividualIncoming=e.voipIndividualIncoming;break}break;case"NOT_STARTED":case 0:i.voipIndividualIncoming=0;break;case"FORCE_UPGRADE":case 1:i.voipIndividualIncoming=1;break;case"DEVELOPMENT":case 2:i.voipIndividualIncoming=2;break;case"PRODUCTION":case 3:i.voipIndividualIncoming=3;break}switch(e.quickRepliesQuery){default:if(typeof e.quickRepliesQuery=="number"){i.quickRepliesQuery=e.quickRepliesQuery;break}break;case"NOT_STARTED":case 0:i.quickRepliesQuery=0;break;case"FORCE_UPGRADE":case 1:i.quickRepliesQuery=1;break;case"DEVELOPMENT":case 2:i.quickRepliesQuery=2;break;case"PRODUCTION":case 3:i.quickRepliesQuery=3;break}switch(e.payments){default:if(typeof e.payments=="number"){i.payments=e.payments;break}break;case"NOT_STARTED":case 0:i.payments=0;break;case"FORCE_UPGRADE":case 1:i.payments=1;break;case"DEVELOPMENT":case 2:i.payments=2;break;case"PRODUCTION":case 3:i.payments=3;break}switch(e.stickerPackQuery){default:if(typeof e.stickerPackQuery=="number"){i.stickerPackQuery=e.stickerPackQuery;break}break;case"NOT_STARTED":case 0:i.stickerPackQuery=0;break;case"FORCE_UPGRADE":case 1:i.stickerPackQuery=1;break;case"DEVELOPMENT":case 2:i.stickerPackQuery=2;break;case"PRODUCTION":case 3:i.stickerPackQuery=3;break}switch(e.liveLocationsFinal){default:if(typeof e.liveLocationsFinal=="number"){i.liveLocationsFinal=e.liveLocationsFinal;break}break;case"NOT_STARTED":case 0:i.liveLocationsFinal=0;break;case"FORCE_UPGRADE":case 1:i.liveLocationsFinal=1;break;case"DEVELOPMENT":case 2:i.liveLocationsFinal=2;break;case"PRODUCTION":case 3:i.liveLocationsFinal=3;break}switch(e.labelsEdit){default:if(typeof e.labelsEdit=="number"){i.labelsEdit=e.labelsEdit;break}break;case"NOT_STARTED":case 0:i.labelsEdit=0;break;case"FORCE_UPGRADE":case 1:i.labelsEdit=1;break;case"DEVELOPMENT":case 2:i.labelsEdit=2;break;case"PRODUCTION":case 3:i.labelsEdit=3;break}switch(e.mediaUpload){default:if(typeof e.mediaUpload=="number"){i.mediaUpload=e.mediaUpload;break}break;case"NOT_STARTED":case 0:i.mediaUpload=0;break;case"FORCE_UPGRADE":case 1:i.mediaUpload=1;break;case"DEVELOPMENT":case 2:i.mediaUpload=2;break;case"PRODUCTION":case 3:i.mediaUpload=3;break}switch(e.mediaUploadRichQuickReplies){default:if(typeof e.mediaUploadRichQuickReplies=="number"){i.mediaUploadRichQuickReplies=e.mediaUploadRichQuickReplies;break}break;case"NOT_STARTED":case 0:i.mediaUploadRichQuickReplies=0;break;case"FORCE_UPGRADE":case 1:i.mediaUploadRichQuickReplies=1;break;case"DEVELOPMENT":case 2:i.mediaUploadRichQuickReplies=2;break;case"PRODUCTION":case 3:i.mediaUploadRichQuickReplies=3;break}switch(e.vnameV2){default:if(typeof e.vnameV2=="number"){i.vnameV2=e.vnameV2;break}break;case"NOT_STARTED":case 0:i.vnameV2=0;break;case"FORCE_UPGRADE":case 1:i.vnameV2=1;break;case"DEVELOPMENT":case 2:i.vnameV2=2;break;case"PRODUCTION":case 3:i.vnameV2=3;break}switch(e.videoPlaybackUrl){default:if(typeof e.videoPlaybackUrl=="number"){i.videoPlaybackUrl=e.videoPlaybackUrl;break}break;case"NOT_STARTED":case 0:i.videoPlaybackUrl=0;break;case"FORCE_UPGRADE":case 1:i.videoPlaybackUrl=1;break;case"DEVELOPMENT":case 2:i.videoPlaybackUrl=2;break;case"PRODUCTION":case 3:i.videoPlaybackUrl=3;break}switch(e.statusRanking){default:if(typeof e.statusRanking=="number"){i.statusRanking=e.statusRanking;break}break;case"NOT_STARTED":case 0:i.statusRanking=0;break;case"FORCE_UPGRADE":case 1:i.statusRanking=1;break;case"DEVELOPMENT":case 2:i.statusRanking=2;break;case"PRODUCTION":case 3:i.statusRanking=3;break}switch(e.voipIndividualVideo){default:if(typeof e.voipIndividualVideo=="number"){i.voipIndividualVideo=e.voipIndividualVideo;break}break;case"NOT_STARTED":case 0:i.voipIndividualVideo=0;break;case"FORCE_UPGRADE":case 1:i.voipIndividualVideo=1;break;case"DEVELOPMENT":case 2:i.voipIndividualVideo=2;break;case"PRODUCTION":case 3:i.voipIndividualVideo=3;break}switch(e.thirdPartyStickers){default:if(typeof e.thirdPartyStickers=="number"){i.thirdPartyStickers=e.thirdPartyStickers;break}break;case"NOT_STARTED":case 0:i.thirdPartyStickers=0;break;case"FORCE_UPGRADE":case 1:i.thirdPartyStickers=1;break;case"DEVELOPMENT":case 2:i.thirdPartyStickers=2;break;case"PRODUCTION":case 3:i.thirdPartyStickers=3;break}switch(e.frequentlyForwardedSetting){default:if(typeof e.frequentlyForwardedSetting=="number"){i.frequentlyForwardedSetting=e.frequentlyForwardedSetting;break}break;case"NOT_STARTED":case 0:i.frequentlyForwardedSetting=0;break;case"FORCE_UPGRADE":case 1:i.frequentlyForwardedSetting=1;break;case"DEVELOPMENT":case 2:i.frequentlyForwardedSetting=2;break;case"PRODUCTION":case 3:i.frequentlyForwardedSetting=3;break}switch(e.groupsV4JoinPermission){default:if(typeof e.groupsV4JoinPermission=="number"){i.groupsV4JoinPermission=e.groupsV4JoinPermission;break}break;case"NOT_STARTED":case 0:i.groupsV4JoinPermission=0;break;case"FORCE_UPGRADE":case 1:i.groupsV4JoinPermission=1;break;case"DEVELOPMENT":case 2:i.groupsV4JoinPermission=2;break;case"PRODUCTION":case 3:i.groupsV4JoinPermission=3;break}switch(e.recentStickers){default:if(typeof e.recentStickers=="number"){i.recentStickers=e.recentStickers;break}break;case"NOT_STARTED":case 0:i.recentStickers=0;break;case"FORCE_UPGRADE":case 1:i.recentStickers=1;break;case"DEVELOPMENT":case 2:i.recentStickers=2;break;case"PRODUCTION":case 3:i.recentStickers=3;break}switch(e.catalog){default:if(typeof e.catalog=="number"){i.catalog=e.catalog;break}break;case"NOT_STARTED":case 0:i.catalog=0;break;case"FORCE_UPGRADE":case 1:i.catalog=1;break;case"DEVELOPMENT":case 2:i.catalog=2;break;case"PRODUCTION":case 3:i.catalog=3;break}switch(e.starredStickers){default:if(typeof e.starredStickers=="number"){i.starredStickers=e.starredStickers;break}break;case"NOT_STARTED":case 0:i.starredStickers=0;break;case"FORCE_UPGRADE":case 1:i.starredStickers=1;break;case"DEVELOPMENT":case 2:i.starredStickers=2;break;case"PRODUCTION":case 3:i.starredStickers=3;break}switch(e.voipGroupCall){default:if(typeof e.voipGroupCall=="number"){i.voipGroupCall=e.voipGroupCall;break}break;case"NOT_STARTED":case 0:i.voipGroupCall=0;break;case"FORCE_UPGRADE":case 1:i.voipGroupCall=1;break;case"DEVELOPMENT":case 2:i.voipGroupCall=2;break;case"PRODUCTION":case 3:i.voipGroupCall=3;break}switch(e.templateMessage){default:if(typeof e.templateMessage=="number"){i.templateMessage=e.templateMessage;break}break;case"NOT_STARTED":case 0:i.templateMessage=0;break;case"FORCE_UPGRADE":case 1:i.templateMessage=1;break;case"DEVELOPMENT":case 2:i.templateMessage=2;break;case"PRODUCTION":case 3:i.templateMessage=3;break}switch(e.templateMessageInteractivity){default:if(typeof e.templateMessageInteractivity=="number"){i.templateMessageInteractivity=e.templateMessageInteractivity;break}break;case"NOT_STARTED":case 0:i.templateMessageInteractivity=0;break;case"FORCE_UPGRADE":case 1:i.templateMessageInteractivity=1;break;case"DEVELOPMENT":case 2:i.templateMessageInteractivity=2;break;case"PRODUCTION":case 3:i.templateMessageInteractivity=3;break}switch(e.ephemeralMessages){default:if(typeof e.ephemeralMessages=="number"){i.ephemeralMessages=e.ephemeralMessages;break}break;case"NOT_STARTED":case 0:i.ephemeralMessages=0;break;case"FORCE_UPGRADE":case 1:i.ephemeralMessages=1;break;case"DEVELOPMENT":case 2:i.ephemeralMessages=2;break;case"PRODUCTION":case 3:i.ephemeralMessages=3;break}switch(e.e2ENotificationSync){default:if(typeof e.e2ENotificationSync=="number"){i.e2ENotificationSync=e.e2ENotificationSync;break}break;case"NOT_STARTED":case 0:i.e2ENotificationSync=0;break;case"FORCE_UPGRADE":case 1:i.e2ENotificationSync=1;break;case"DEVELOPMENT":case 2:i.e2ENotificationSync=2;break;case"PRODUCTION":case 3:i.e2ENotificationSync=3;break}switch(e.recentStickersV2){default:if(typeof e.recentStickersV2=="number"){i.recentStickersV2=e.recentStickersV2;break}break;case"NOT_STARTED":case 0:i.recentStickersV2=0;break;case"FORCE_UPGRADE":case 1:i.recentStickersV2=1;break;case"DEVELOPMENT":case 2:i.recentStickersV2=2;break;case"PRODUCTION":case 3:i.recentStickersV2=3;break}switch(e.recentStickersV3){default:if(typeof e.recentStickersV3=="number"){i.recentStickersV3=e.recentStickersV3;break}break;case"NOT_STARTED":case 0:i.recentStickersV3=0;break;case"FORCE_UPGRADE":case 1:i.recentStickersV3=1;break;case"DEVELOPMENT":case 2:i.recentStickersV3=2;break;case"PRODUCTION":case 3:i.recentStickersV3=3;break}switch(e.userNotice){default:if(typeof e.userNotice=="number"){i.userNotice=e.userNotice;break}break;case"NOT_STARTED":case 0:i.userNotice=0;break;case"FORCE_UPGRADE":case 1:i.userNotice=1;break;case"DEVELOPMENT":case 2:i.userNotice=2;break;case"PRODUCTION":case 3:i.userNotice=3;break}switch(e.support){default:if(typeof e.support=="number"){i.support=e.support;break}break;case"NOT_STARTED":case 0:i.support=0;break;case"FORCE_UPGRADE":case 1:i.support=1;break;case"DEVELOPMENT":case 2:i.support=2;break;case"PRODUCTION":case 3:i.support=3;break}switch(e.groupUiiCleanup){default:if(typeof e.groupUiiCleanup=="number"){i.groupUiiCleanup=e.groupUiiCleanup;break}break;case"NOT_STARTED":case 0:i.groupUiiCleanup=0;break;case"FORCE_UPGRADE":case 1:i.groupUiiCleanup=1;break;case"DEVELOPMENT":case 2:i.groupUiiCleanup=2;break;case"PRODUCTION":case 3:i.groupUiiCleanup=3;break}switch(e.groupDogfoodingInternalOnly){default:if(typeof e.groupDogfoodingInternalOnly=="number"){i.groupDogfoodingInternalOnly=e.groupDogfoodingInternalOnly;break}break;case"NOT_STARTED":case 0:i.groupDogfoodingInternalOnly=0;break;case"FORCE_UPGRADE":case 1:i.groupDogfoodingInternalOnly=1;break;case"DEVELOPMENT":case 2:i.groupDogfoodingInternalOnly=2;break;case"PRODUCTION":case 3:i.groupDogfoodingInternalOnly=3;break}switch(e.settingsSync){default:if(typeof e.settingsSync=="number"){i.settingsSync=e.settingsSync;break}break;case"NOT_STARTED":case 0:i.settingsSync=0;break;case"FORCE_UPGRADE":case 1:i.settingsSync=1;break;case"DEVELOPMENT":case 2:i.settingsSync=2;break;case"PRODUCTION":case 3:i.settingsSync=3;break}switch(e.archiveV2){default:if(typeof e.archiveV2=="number"){i.archiveV2=e.archiveV2;break}break;case"NOT_STARTED":case 0:i.archiveV2=0;break;case"FORCE_UPGRADE":case 1:i.archiveV2=1;break;case"DEVELOPMENT":case 2:i.archiveV2=2;break;case"PRODUCTION":case 3:i.archiveV2=3;break}switch(e.ephemeralAllowGroupMembers){default:if(typeof e.ephemeralAllowGroupMembers=="number"){i.ephemeralAllowGroupMembers=e.ephemeralAllowGroupMembers;break}break;case"NOT_STARTED":case 0:i.ephemeralAllowGroupMembers=0;break;case"FORCE_UPGRADE":case 1:i.ephemeralAllowGroupMembers=1;break;case"DEVELOPMENT":case 2:i.ephemeralAllowGroupMembers=2;break;case"PRODUCTION":case 3:i.ephemeralAllowGroupMembers=3;break}switch(e.ephemeral24HDuration){default:if(typeof e.ephemeral24HDuration=="number"){i.ephemeral24HDuration=e.ephemeral24HDuration;break}break;case"NOT_STARTED":case 0:i.ephemeral24HDuration=0;break;case"FORCE_UPGRADE":case 1:i.ephemeral24HDuration=1;break;case"DEVELOPMENT":case 2:i.ephemeral24HDuration=2;break;case"PRODUCTION":case 3:i.ephemeral24HDuration=3;break}switch(e.mdForceUpgrade){default:if(typeof e.mdForceUpgrade=="number"){i.mdForceUpgrade=e.mdForceUpgrade;break}break;case"NOT_STARTED":case 0:i.mdForceUpgrade=0;break;case"FORCE_UPGRADE":case 1:i.mdForceUpgrade=1;break;case"DEVELOPMENT":case 2:i.mdForceUpgrade=2;break;case"PRODUCTION":case 3:i.mdForceUpgrade=3;break}switch(e.disappearingMode){default:if(typeof e.disappearingMode=="number"){i.disappearingMode=e.disappearingMode;break}break;case"NOT_STARTED":case 0:i.disappearingMode=0;break;case"FORCE_UPGRADE":case 1:i.disappearingMode=1;break;case"DEVELOPMENT":case 2:i.disappearingMode=2;break;case"PRODUCTION":case 3:i.disappearingMode=3;break}switch(e.externalMdOptInAvailable){default:if(typeof e.externalMdOptInAvailable=="number"){i.externalMdOptInAvailable=e.externalMdOptInAvailable;break}break;case"NOT_STARTED":case 0:i.externalMdOptInAvailable=0;break;case"FORCE_UPGRADE":case 1:i.externalMdOptInAvailable=1;break;case"DEVELOPMENT":case 2:i.externalMdOptInAvailable=2;break;case"PRODUCTION":case 3:i.externalMdOptInAvailable=3;break}switch(e.noDeleteMessageTimeLimit){default:if(typeof e.noDeleteMessageTimeLimit=="number"){i.noDeleteMessageTimeLimit=e.noDeleteMessageTimeLimit;break}break;case"NOT_STARTED":case 0:i.noDeleteMessageTimeLimit=0;break;case"FORCE_UPGRADE":case 1:i.noDeleteMessageTimeLimit=1;break;case"DEVELOPMENT":case 2:i.noDeleteMessageTimeLimit=2;break;case"PRODUCTION":case 3:i.noDeleteMessageTimeLimit=3;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.labelsDisplay!=null&&e.hasOwnProperty("labelsDisplay")&&(A.labelsDisplay=i.enums===String?d.proto.WebFeatures.Flag[e.labelsDisplay]===void 0?e.labelsDisplay:d.proto.WebFeatures.Flag[e.labelsDisplay]:e.labelsDisplay,i.oneofs&&(A._labelsDisplay="labelsDisplay")),e.voipIndividualOutgoing!=null&&e.hasOwnProperty("voipIndividualOutgoing")&&(A.voipIndividualOutgoing=i.enums===String?d.proto.WebFeatures.Flag[e.voipIndividualOutgoing]===void 0?e.voipIndividualOutgoing:d.proto.WebFeatures.Flag[e.voipIndividualOutgoing]:e.voipIndividualOutgoing,i.oneofs&&(A._voipIndividualOutgoing="voipIndividualOutgoing")),e.groupsV3!=null&&e.hasOwnProperty("groupsV3")&&(A.groupsV3=i.enums===String?d.proto.WebFeatures.Flag[e.groupsV3]===void 0?e.groupsV3:d.proto.WebFeatures.Flag[e.groupsV3]:e.groupsV3,i.oneofs&&(A._groupsV3="groupsV3")),e.groupsV3Create!=null&&e.hasOwnProperty("groupsV3Create")&&(A.groupsV3Create=i.enums===String?d.proto.WebFeatures.Flag[e.groupsV3Create]===void 0?e.groupsV3Create:d.proto.WebFeatures.Flag[e.groupsV3Create]:e.groupsV3Create,i.oneofs&&(A._groupsV3Create="groupsV3Create")),e.changeNumberV2!=null&&e.hasOwnProperty("changeNumberV2")&&(A.changeNumberV2=i.enums===String?d.proto.WebFeatures.Flag[e.changeNumberV2]===void 0?e.changeNumberV2:d.proto.WebFeatures.Flag[e.changeNumberV2]:e.changeNumberV2,i.oneofs&&(A._changeNumberV2="changeNumberV2")),e.queryStatusV3Thumbnail!=null&&e.hasOwnProperty("queryStatusV3Thumbnail")&&(A.queryStatusV3Thumbnail=i.enums===String?d.proto.WebFeatures.Flag[e.queryStatusV3Thumbnail]===void 0?e.queryStatusV3Thumbnail:d.proto.WebFeatures.Flag[e.queryStatusV3Thumbnail]:e.queryStatusV3Thumbnail,i.oneofs&&(A._queryStatusV3Thumbnail="queryStatusV3Thumbnail")),e.liveLocations!=null&&e.hasOwnProperty("liveLocations")&&(A.liveLocations=i.enums===String?d.proto.WebFeatures.Flag[e.liveLocations]===void 0?e.liveLocations:d.proto.WebFeatures.Flag[e.liveLocations]:e.liveLocations,i.oneofs&&(A._liveLocations="liveLocations")),e.queryVname!=null&&e.hasOwnProperty("queryVname")&&(A.queryVname=i.enums===String?d.proto.WebFeatures.Flag[e.queryVname]===void 0?e.queryVname:d.proto.WebFeatures.Flag[e.queryVname]:e.queryVname,i.oneofs&&(A._queryVname="queryVname")),e.voipIndividualIncoming!=null&&e.hasOwnProperty("voipIndividualIncoming")&&(A.voipIndividualIncoming=i.enums===String?d.proto.WebFeatures.Flag[e.voipIndividualIncoming]===void 0?e.voipIndividualIncoming:d.proto.WebFeatures.Flag[e.voipIndividualIncoming]:e.voipIndividualIncoming,i.oneofs&&(A._voipIndividualIncoming="voipIndividualIncoming")),e.quickRepliesQuery!=null&&e.hasOwnProperty("quickRepliesQuery")&&(A.quickRepliesQuery=i.enums===String?d.proto.WebFeatures.Flag[e.quickRepliesQuery]===void 0?e.quickRepliesQuery:d.proto.WebFeatures.Flag[e.quickRepliesQuery]:e.quickRepliesQuery,i.oneofs&&(A._quickRepliesQuery="quickRepliesQuery")),e.payments!=null&&e.hasOwnProperty("payments")&&(A.payments=i.enums===String?d.proto.WebFeatures.Flag[e.payments]===void 0?e.payments:d.proto.WebFeatures.Flag[e.payments]:e.payments,i.oneofs&&(A._payments="payments")),e.stickerPackQuery!=null&&e.hasOwnProperty("stickerPackQuery")&&(A.stickerPackQuery=i.enums===String?d.proto.WebFeatures.Flag[e.stickerPackQuery]===void 0?e.stickerPackQuery:d.proto.WebFeatures.Flag[e.stickerPackQuery]:e.stickerPackQuery,i.oneofs&&(A._stickerPackQuery="stickerPackQuery")),e.liveLocationsFinal!=null&&e.hasOwnProperty("liveLocationsFinal")&&(A.liveLocationsFinal=i.enums===String?d.proto.WebFeatures.Flag[e.liveLocationsFinal]===void 0?e.liveLocationsFinal:d.proto.WebFeatures.Flag[e.liveLocationsFinal]:e.liveLocationsFinal,i.oneofs&&(A._liveLocationsFinal="liveLocationsFinal")),e.labelsEdit!=null&&e.hasOwnProperty("labelsEdit")&&(A.labelsEdit=i.enums===String?d.proto.WebFeatures.Flag[e.labelsEdit]===void 0?e.labelsEdit:d.proto.WebFeatures.Flag[e.labelsEdit]:e.labelsEdit,i.oneofs&&(A._labelsEdit="labelsEdit")),e.mediaUpload!=null&&e.hasOwnProperty("mediaUpload")&&(A.mediaUpload=i.enums===String?d.proto.WebFeatures.Flag[e.mediaUpload]===void 0?e.mediaUpload:d.proto.WebFeatures.Flag[e.mediaUpload]:e.mediaUpload,i.oneofs&&(A._mediaUpload="mediaUpload")),e.mediaUploadRichQuickReplies!=null&&e.hasOwnProperty("mediaUploadRichQuickReplies")&&(A.mediaUploadRichQuickReplies=i.enums===String?d.proto.WebFeatures.Flag[e.mediaUploadRichQuickReplies]===void 0?e.mediaUploadRichQuickReplies:d.proto.WebFeatures.Flag[e.mediaUploadRichQuickReplies]:e.mediaUploadRichQuickReplies,i.oneofs&&(A._mediaUploadRichQuickReplies="mediaUploadRichQuickReplies")),e.vnameV2!=null&&e.hasOwnProperty("vnameV2")&&(A.vnameV2=i.enums===String?d.proto.WebFeatures.Flag[e.vnameV2]===void 0?e.vnameV2:d.proto.WebFeatures.Flag[e.vnameV2]:e.vnameV2,i.oneofs&&(A._vnameV2="vnameV2")),e.videoPlaybackUrl!=null&&e.hasOwnProperty("videoPlaybackUrl")&&(A.videoPlaybackUrl=i.enums===String?d.proto.WebFeatures.Flag[e.videoPlaybackUrl]===void 0?e.videoPlaybackUrl:d.proto.WebFeatures.Flag[e.videoPlaybackUrl]:e.videoPlaybackUrl,i.oneofs&&(A._videoPlaybackUrl="videoPlaybackUrl")),e.statusRanking!=null&&e.hasOwnProperty("statusRanking")&&(A.statusRanking=i.enums===String?d.proto.WebFeatures.Flag[e.statusRanking]===void 0?e.statusRanking:d.proto.WebFeatures.Flag[e.statusRanking]:e.statusRanking,i.oneofs&&(A._statusRanking="statusRanking")),e.voipIndividualVideo!=null&&e.hasOwnProperty("voipIndividualVideo")&&(A.voipIndividualVideo=i.enums===String?d.proto.WebFeatures.Flag[e.voipIndividualVideo]===void 0?e.voipIndividualVideo:d.proto.WebFeatures.Flag[e.voipIndividualVideo]:e.voipIndividualVideo,i.oneofs&&(A._voipIndividualVideo="voipIndividualVideo")),e.thirdPartyStickers!=null&&e.hasOwnProperty("thirdPartyStickers")&&(A.thirdPartyStickers=i.enums===String?d.proto.WebFeatures.Flag[e.thirdPartyStickers]===void 0?e.thirdPartyStickers:d.proto.WebFeatures.Flag[e.thirdPartyStickers]:e.thirdPartyStickers,i.oneofs&&(A._thirdPartyStickers="thirdPartyStickers")),e.frequentlyForwardedSetting!=null&&e.hasOwnProperty("frequentlyForwardedSetting")&&(A.frequentlyForwardedSetting=i.enums===String?d.proto.WebFeatures.Flag[e.frequentlyForwardedSetting]===void 0?e.frequentlyForwardedSetting:d.proto.WebFeatures.Flag[e.frequentlyForwardedSetting]:e.frequentlyForwardedSetting,i.oneofs&&(A._frequentlyForwardedSetting="frequentlyForwardedSetting")),e.groupsV4JoinPermission!=null&&e.hasOwnProperty("groupsV4JoinPermission")&&(A.groupsV4JoinPermission=i.enums===String?d.proto.WebFeatures.Flag[e.groupsV4JoinPermission]===void 0?e.groupsV4JoinPermission:d.proto.WebFeatures.Flag[e.groupsV4JoinPermission]:e.groupsV4JoinPermission,i.oneofs&&(A._groupsV4JoinPermission="groupsV4JoinPermission")),e.recentStickers!=null&&e.hasOwnProperty("recentStickers")&&(A.recentStickers=i.enums===String?d.proto.WebFeatures.Flag[e.recentStickers]===void 0?e.recentStickers:d.proto.WebFeatures.Flag[e.recentStickers]:e.recentStickers,i.oneofs&&(A._recentStickers="recentStickers")),e.catalog!=null&&e.hasOwnProperty("catalog")&&(A.catalog=i.enums===String?d.proto.WebFeatures.Flag[e.catalog]===void 0?e.catalog:d.proto.WebFeatures.Flag[e.catalog]:e.catalog,i.oneofs&&(A._catalog="catalog")),e.starredStickers!=null&&e.hasOwnProperty("starredStickers")&&(A.starredStickers=i.enums===String?d.proto.WebFeatures.Flag[e.starredStickers]===void 0?e.starredStickers:d.proto.WebFeatures.Flag[e.starredStickers]:e.starredStickers,i.oneofs&&(A._starredStickers="starredStickers")),e.voipGroupCall!=null&&e.hasOwnProperty("voipGroupCall")&&(A.voipGroupCall=i.enums===String?d.proto.WebFeatures.Flag[e.voipGroupCall]===void 0?e.voipGroupCall:d.proto.WebFeatures.Flag[e.voipGroupCall]:e.voipGroupCall,i.oneofs&&(A._voipGroupCall="voipGroupCall")),e.templateMessage!=null&&e.hasOwnProperty("templateMessage")&&(A.templateMessage=i.enums===String?d.proto.WebFeatures.Flag[e.templateMessage]===void 0?e.templateMessage:d.proto.WebFeatures.Flag[e.templateMessage]:e.templateMessage,i.oneofs&&(A._templateMessage="templateMessage")),e.templateMessageInteractivity!=null&&e.hasOwnProperty("templateMessageInteractivity")&&(A.templateMessageInteractivity=i.enums===String?d.proto.WebFeatures.Flag[e.templateMessageInteractivity]===void 0?e.templateMessageInteractivity:d.proto.WebFeatures.Flag[e.templateMessageInteractivity]:e.templateMessageInteractivity,i.oneofs&&(A._templateMessageInteractivity="templateMessageInteractivity")),e.ephemeralMessages!=null&&e.hasOwnProperty("ephemeralMessages")&&(A.ephemeralMessages=i.enums===String?d.proto.WebFeatures.Flag[e.ephemeralMessages]===void 0?e.ephemeralMessages:d.proto.WebFeatures.Flag[e.ephemeralMessages]:e.ephemeralMessages,i.oneofs&&(A._ephemeralMessages="ephemeralMessages")),e.e2ENotificationSync!=null&&e.hasOwnProperty("e2ENotificationSync")&&(A.e2ENotificationSync=i.enums===String?d.proto.WebFeatures.Flag[e.e2ENotificationSync]===void 0?e.e2ENotificationSync:d.proto.WebFeatures.Flag[e.e2ENotificationSync]:e.e2ENotificationSync,i.oneofs&&(A._e2ENotificationSync="e2ENotificationSync")),e.recentStickersV2!=null&&e.hasOwnProperty("recentStickersV2")&&(A.recentStickersV2=i.enums===String?d.proto.WebFeatures.Flag[e.recentStickersV2]===void 0?e.recentStickersV2:d.proto.WebFeatures.Flag[e.recentStickersV2]:e.recentStickersV2,i.oneofs&&(A._recentStickersV2="recentStickersV2")),e.recentStickersV3!=null&&e.hasOwnProperty("recentStickersV3")&&(A.recentStickersV3=i.enums===String?d.proto.WebFeatures.Flag[e.recentStickersV3]===void 0?e.recentStickersV3:d.proto.WebFeatures.Flag[e.recentStickersV3]:e.recentStickersV3,i.oneofs&&(A._recentStickersV3="recentStickersV3")),e.userNotice!=null&&e.hasOwnProperty("userNotice")&&(A.userNotice=i.enums===String?d.proto.WebFeatures.Flag[e.userNotice]===void 0?e.userNotice:d.proto.WebFeatures.Flag[e.userNotice]:e.userNotice,i.oneofs&&(A._userNotice="userNotice")),e.support!=null&&e.hasOwnProperty("support")&&(A.support=i.enums===String?d.proto.WebFeatures.Flag[e.support]===void 0?e.support:d.proto.WebFeatures.Flag[e.support]:e.support,i.oneofs&&(A._support="support")),e.groupUiiCleanup!=null&&e.hasOwnProperty("groupUiiCleanup")&&(A.groupUiiCleanup=i.enums===String?d.proto.WebFeatures.Flag[e.groupUiiCleanup]===void 0?e.groupUiiCleanup:d.proto.WebFeatures.Flag[e.groupUiiCleanup]:e.groupUiiCleanup,i.oneofs&&(A._groupUiiCleanup="groupUiiCleanup")),e.groupDogfoodingInternalOnly!=null&&e.hasOwnProperty("groupDogfoodingInternalOnly")&&(A.groupDogfoodingInternalOnly=i.enums===String?d.proto.WebFeatures.Flag[e.groupDogfoodingInternalOnly]===void 0?e.groupDogfoodingInternalOnly:d.proto.WebFeatures.Flag[e.groupDogfoodingInternalOnly]:e.groupDogfoodingInternalOnly,i.oneofs&&(A._groupDogfoodingInternalOnly="groupDogfoodingInternalOnly")),e.settingsSync!=null&&e.hasOwnProperty("settingsSync")&&(A.settingsSync=i.enums===String?d.proto.WebFeatures.Flag[e.settingsSync]===void 0?e.settingsSync:d.proto.WebFeatures.Flag[e.settingsSync]:e.settingsSync,i.oneofs&&(A._settingsSync="settingsSync")),e.archiveV2!=null&&e.hasOwnProperty("archiveV2")&&(A.archiveV2=i.enums===String?d.proto.WebFeatures.Flag[e.archiveV2]===void 0?e.archiveV2:d.proto.WebFeatures.Flag[e.archiveV2]:e.archiveV2,i.oneofs&&(A._archiveV2="archiveV2")),e.ephemeralAllowGroupMembers!=null&&e.hasOwnProperty("ephemeralAllowGroupMembers")&&(A.ephemeralAllowGroupMembers=i.enums===String?d.proto.WebFeatures.Flag[e.ephemeralAllowGroupMembers]===void 0?e.ephemeralAllowGroupMembers:d.proto.WebFeatures.Flag[e.ephemeralAllowGroupMembers]:e.ephemeralAllowGroupMembers,i.oneofs&&(A._ephemeralAllowGroupMembers="ephemeralAllowGroupMembers")),e.ephemeral24HDuration!=null&&e.hasOwnProperty("ephemeral24HDuration")&&(A.ephemeral24HDuration=i.enums===String?d.proto.WebFeatures.Flag[e.ephemeral24HDuration]===void 0?e.ephemeral24HDuration:d.proto.WebFeatures.Flag[e.ephemeral24HDuration]:e.ephemeral24HDuration,i.oneofs&&(A._ephemeral24HDuration="ephemeral24HDuration")),e.mdForceUpgrade!=null&&e.hasOwnProperty("mdForceUpgrade")&&(A.mdForceUpgrade=i.enums===String?d.proto.WebFeatures.Flag[e.mdForceUpgrade]===void 0?e.mdForceUpgrade:d.proto.WebFeatures.Flag[e.mdForceUpgrade]:e.mdForceUpgrade,i.oneofs&&(A._mdForceUpgrade="mdForceUpgrade")),e.disappearingMode!=null&&e.hasOwnProperty("disappearingMode")&&(A.disappearingMode=i.enums===String?d.proto.WebFeatures.Flag[e.disappearingMode]===void 0?e.disappearingMode:d.proto.WebFeatures.Flag[e.disappearingMode]:e.disappearingMode,i.oneofs&&(A._disappearingMode="disappearingMode")),e.externalMdOptInAvailable!=null&&e.hasOwnProperty("externalMdOptInAvailable")&&(A.externalMdOptInAvailable=i.enums===String?d.proto.WebFeatures.Flag[e.externalMdOptInAvailable]===void 0?e.externalMdOptInAvailable:d.proto.WebFeatures.Flag[e.externalMdOptInAvailable]:e.externalMdOptInAvailable,i.oneofs&&(A._externalMdOptInAvailable="externalMdOptInAvailable")),e.noDeleteMessageTimeLimit!=null&&e.hasOwnProperty("noDeleteMessageTimeLimit")&&(A.noDeleteMessageTimeLimit=i.enums===String?d.proto.WebFeatures.Flag[e.noDeleteMessageTimeLimit]===void 0?e.noDeleteMessageTimeLimit:d.proto.WebFeatures.Flag[e.noDeleteMessageTimeLimit]:e.noDeleteMessageTimeLimit,i.oneofs&&(A._noDeleteMessageTimeLimit="noDeleteMessageTimeLimit")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.WebFeatures"},t.Flag=(function(){let a={},e=Object.create(a);return e[a[0]="NOT_STARTED"]=0,e[a[1]="FORCE_UPGRADE"]=1,e[a[2]="DEVELOPMENT"]=2,e[a[3]="PRODUCTION"]=3,e})(),t})(),n.WebLinkRenderConfig=(function(){let t={},o=Object.create(t);return o[t[0]="WEBVIEW"]=0,o[t[1]="SYSTEM"]=1,o})(),n.WebMessageInfo=(function(){function t(a){if(this.messageStubParameters=[],this.labels=[],this.userReceipt=[],this.reactions=[],this.pollUpdates=[],this.eventResponses=[],this.statusMentions=[],this.messageAddOns=[],this.statusMentionSources=[],this.supportAiCitations=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.key=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=d.proto.Message.decode(e,e.uint32());break}case 3:{s.messageTimestamp=e.uint64();break}case 4:{s.status=e.int32();break}case 5:{s.participant=e.string();break}case 6:{s.messageC2STimestamp=e.uint64();break}case 16:{s.ignore=e.bool();break}case 17:{s.starred=e.bool();break}case 18:{s.broadcast=e.bool();break}case 19:{s.pushName=e.string();break}case 20:{s.mediaCiphertextSha256=e.bytes();break}case 21:{s.multicast=e.bool();break}case 22:{s.urlText=e.bool();break}case 23:{s.urlNumber=e.bool();break}case 24:{s.messageStubType=e.int32();break}case 25:{s.clearMedia=e.bool();break}case 26:{s.messageStubParameters&&s.messageStubParameters.length||(s.messageStubParameters=[]),s.messageStubParameters.push(e.string());break}case 27:{s.duration=e.uint32();break}case 28:{s.labels&&s.labels.length||(s.labels=[]),s.labels.push(e.string());break}case 29:{s.paymentInfo=d.proto.PaymentInfo.decode(e,e.uint32());break}case 30:{s.finalLiveLocation=d.proto.Message.LiveLocationMessage.decode(e,e.uint32());break}case 31:{s.quotedPaymentInfo=d.proto.PaymentInfo.decode(e,e.uint32());break}case 32:{s.ephemeralStartTimestamp=e.uint64();break}case 33:{s.ephemeralDuration=e.uint32();break}case 34:{s.ephemeralOffToOn=e.bool();break}case 35:{s.ephemeralOutOfSync=e.bool();break}case 36:{s.bizPrivacyStatus=e.int32();break}case 37:{s.verifiedBizName=e.string();break}case 38:{s.mediaData=d.proto.MediaData.decode(e,e.uint32());break}case 39:{s.photoChange=d.proto.PhotoChange.decode(e,e.uint32());break}case 40:{s.userReceipt&&s.userReceipt.length||(s.userReceipt=[]),s.userReceipt.push(d.proto.UserReceipt.decode(e,e.uint32()));break}case 41:{s.reactions&&s.reactions.length||(s.reactions=[]),s.reactions.push(d.proto.Reaction.decode(e,e.uint32()));break}case 42:{s.quotedStickerData=d.proto.MediaData.decode(e,e.uint32());break}case 43:{s.futureproofData=e.bytes();break}case 44:{s.statusPsa=d.proto.StatusPSA.decode(e,e.uint32());break}case 45:{s.pollUpdates&&s.pollUpdates.length||(s.pollUpdates=[]),s.pollUpdates.push(d.proto.PollUpdate.decode(e,e.uint32()));break}case 46:{s.pollAdditionalMetadata=d.proto.PollAdditionalMetadata.decode(e,e.uint32());break}case 47:{s.agentId=e.string();break}case 48:{s.statusAlreadyViewed=e.bool();break}case 49:{s.messageSecret=e.bytes();break}case 50:{s.keepInChat=d.proto.KeepInChat.decode(e,e.uint32());break}case 51:{s.originalSelfAuthorUserJidString=e.string();break}case 52:{s.revokeMessageTimestamp=e.uint64();break}case 54:{s.pinInChat=d.proto.PinInChat.decode(e,e.uint32());break}case 55:{s.premiumMessageInfo=d.proto.PremiumMessageInfo.decode(e,e.uint32());break}case 56:{s.is1PBizBotMessage=e.bool();break}case 57:{s.isGroupHistoryMessage=e.bool();break}case 58:{s.botMessageInvokerJid=e.string();break}case 59:{s.commentMetadata=d.proto.CommentMetadata.decode(e,e.uint32());break}case 61:{s.eventResponses&&s.eventResponses.length||(s.eventResponses=[]),s.eventResponses.push(d.proto.EventResponse.decode(e,e.uint32()));break}case 62:{s.reportingTokenInfo=d.proto.ReportingTokenInfo.decode(e,e.uint32());break}case 63:{s.newsletterServerId=e.uint64();break}case 64:{s.eventAdditionalMetadata=d.proto.EventAdditionalMetadata.decode(e,e.uint32());break}case 65:{s.isMentionedInStatus=e.bool();break}case 66:{s.statusMentions&&s.statusMentions.length||(s.statusMentions=[]),s.statusMentions.push(e.string());break}case 67:{s.targetMessageId=d.proto.MessageKey.decode(e,e.uint32());break}case 68:{s.messageAddOns&&s.messageAddOns.length||(s.messageAddOns=[]),s.messageAddOns.push(d.proto.MessageAddOn.decode(e,e.uint32()));break}case 69:{s.statusMentionMessageInfo=d.proto.StatusMentionMessage.decode(e,e.uint32());break}case 70:{s.isSupportAiMessage=e.bool();break}case 71:{s.statusMentionSources&&s.statusMentionSources.length||(s.statusMentionSources=[]),s.statusMentionSources.push(e.string());break}case 72:{s.supportAiCitations&&s.supportAiCitations.length||(s.supportAiCitations=[]),s.supportAiCitations.push(d.proto.Citation.decode(e,e.uint32()));break}case 73:{s.botTargetId=e.string();break}case 74:{s.groupHistoryIndividualMessageInfo=d.proto.GroupHistoryIndividualMessageInfo.decode(e,e.uint32());break}case 75:{s.groupHistoryBundleInfo=d.proto.GroupHistoryBundleInfo.decode(e,e.uint32());break}case 76:{s.interactiveMessageAdditionalMetadata=d.proto.InteractiveMessageAdditionalMetadata.decode(e,e.uint32());break}case 77:{s.quarantinedMessage=d.proto.QuarantinedMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.WebMessageInfo)return e;var i=new d.proto.WebMessageInfo;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.WebMessageInfo.key: object expected");i.key=d.proto.MessageKey.fromObject(e.key)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.WebMessageInfo.message: object expected");i.message=d.proto.Message.fromObject(e.message)}switch(e.messageTimestamp!=null&&(l.Long?(i.messageTimestamp=l.Long.fromValue(e.messageTimestamp)).unsigned=!0:typeof e.messageTimestamp=="string"?i.messageTimestamp=parseInt(e.messageTimestamp,10):typeof e.messageTimestamp=="number"?i.messageTimestamp=e.messageTimestamp:typeof e.messageTimestamp=="object"&&(i.messageTimestamp=new l.LongBits(e.messageTimestamp.low>>>0,e.messageTimestamp.high>>>0).toNumber(!0))),e.status){default:if(typeof e.status=="number"){i.status=e.status;break}break;case"ERROR":case 0:i.status=0;break;case"PENDING":case 1:i.status=1;break;case"SERVER_ACK":case 2:i.status=2;break;case"DELIVERY_ACK":case 3:i.status=3;break;case"READ":case 4:i.status=4;break;case"PLAYED":case 5:i.status=5;break}switch(e.participant!=null&&(i.participant=String(e.participant)),e.messageC2STimestamp!=null&&(l.Long?(i.messageC2STimestamp=l.Long.fromValue(e.messageC2STimestamp)).unsigned=!0:typeof e.messageC2STimestamp=="string"?i.messageC2STimestamp=parseInt(e.messageC2STimestamp,10):typeof e.messageC2STimestamp=="number"?i.messageC2STimestamp=e.messageC2STimestamp:typeof e.messageC2STimestamp=="object"&&(i.messageC2STimestamp=new l.LongBits(e.messageC2STimestamp.low>>>0,e.messageC2STimestamp.high>>>0).toNumber(!0))),e.ignore!=null&&(i.ignore=!!e.ignore),e.starred!=null&&(i.starred=!!e.starred),e.broadcast!=null&&(i.broadcast=!!e.broadcast),e.pushName!=null&&(i.pushName=String(e.pushName)),e.mediaCiphertextSha256!=null&&(typeof e.mediaCiphertextSha256=="string"?l.base64.decode(e.mediaCiphertextSha256,i.mediaCiphertextSha256=l.newBuffer(l.base64.length(e.mediaCiphertextSha256)),0):e.mediaCiphertextSha256.length>=0&&(i.mediaCiphertextSha256=e.mediaCiphertextSha256)),e.multicast!=null&&(i.multicast=!!e.multicast),e.urlText!=null&&(i.urlText=!!e.urlText),e.urlNumber!=null&&(i.urlNumber=!!e.urlNumber),e.messageStubType){default:if(typeof e.messageStubType=="number"){i.messageStubType=e.messageStubType;break}break;case"UNKNOWN":case 0:i.messageStubType=0;break;case"REVOKE":case 1:i.messageStubType=1;break;case"CIPHERTEXT":case 2:i.messageStubType=2;break;case"FUTUREPROOF":case 3:i.messageStubType=3;break;case"NON_VERIFIED_TRANSITION":case 4:i.messageStubType=4;break;case"UNVERIFIED_TRANSITION":case 5:i.messageStubType=5;break;case"VERIFIED_TRANSITION":case 6:i.messageStubType=6;break;case"VERIFIED_LOW_UNKNOWN":case 7:i.messageStubType=7;break;case"VERIFIED_HIGH":case 8:i.messageStubType=8;break;case"VERIFIED_INITIAL_UNKNOWN":case 9:i.messageStubType=9;break;case"VERIFIED_INITIAL_LOW":case 10:i.messageStubType=10;break;case"VERIFIED_INITIAL_HIGH":case 11:i.messageStubType=11;break;case"VERIFIED_TRANSITION_ANY_TO_NONE":case 12:i.messageStubType=12;break;case"VERIFIED_TRANSITION_ANY_TO_HIGH":case 13:i.messageStubType=13;break;case"VERIFIED_TRANSITION_HIGH_TO_LOW":case 14:i.messageStubType=14;break;case"VERIFIED_TRANSITION_HIGH_TO_UNKNOWN":case 15:i.messageStubType=15;break;case"VERIFIED_TRANSITION_UNKNOWN_TO_LOW":case 16:i.messageStubType=16;break;case"VERIFIED_TRANSITION_LOW_TO_UNKNOWN":case 17:i.messageStubType=17;break;case"VERIFIED_TRANSITION_NONE_TO_LOW":case 18:i.messageStubType=18;break;case"VERIFIED_TRANSITION_NONE_TO_UNKNOWN":case 19:i.messageStubType=19;break;case"GROUP_CREATE":case 20:i.messageStubType=20;break;case"GROUP_CHANGE_SUBJECT":case 21:i.messageStubType=21;break;case"GROUP_CHANGE_ICON":case 22:i.messageStubType=22;break;case"GROUP_CHANGE_INVITE_LINK":case 23:i.messageStubType=23;break;case"GROUP_CHANGE_DESCRIPTION":case 24:i.messageStubType=24;break;case"GROUP_CHANGE_RESTRICT":case 25:i.messageStubType=25;break;case"GROUP_CHANGE_ANNOUNCE":case 26:i.messageStubType=26;break;case"GROUP_PARTICIPANT_ADD":case 27:i.messageStubType=27;break;case"GROUP_PARTICIPANT_REMOVE":case 28:i.messageStubType=28;break;case"GROUP_PARTICIPANT_PROMOTE":case 29:i.messageStubType=29;break;case"GROUP_PARTICIPANT_DEMOTE":case 30:i.messageStubType=30;break;case"GROUP_PARTICIPANT_INVITE":case 31:i.messageStubType=31;break;case"GROUP_PARTICIPANT_LEAVE":case 32:i.messageStubType=32;break;case"GROUP_PARTICIPANT_CHANGE_NUMBER":case 33:i.messageStubType=33;break;case"BROADCAST_CREATE":case 34:i.messageStubType=34;break;case"BROADCAST_ADD":case 35:i.messageStubType=35;break;case"BROADCAST_REMOVE":case 36:i.messageStubType=36;break;case"GENERIC_NOTIFICATION":case 37:i.messageStubType=37;break;case"E2E_IDENTITY_CHANGED":case 38:i.messageStubType=38;break;case"E2E_ENCRYPTED":case 39:i.messageStubType=39;break;case"CALL_MISSED_VOICE":case 40:i.messageStubType=40;break;case"CALL_MISSED_VIDEO":case 41:i.messageStubType=41;break;case"INDIVIDUAL_CHANGE_NUMBER":case 42:i.messageStubType=42;break;case"GROUP_DELETE":case 43:i.messageStubType=43;break;case"GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE":case 44:i.messageStubType=44;break;case"CALL_MISSED_GROUP_VOICE":case 45:i.messageStubType=45;break;case"CALL_MISSED_GROUP_VIDEO":case 46:i.messageStubType=46;break;case"PAYMENT_CIPHERTEXT":case 47:i.messageStubType=47;break;case"PAYMENT_FUTUREPROOF":case 48:i.messageStubType=48;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED":case 49:i.messageStubType=49;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED":case 50:i.messageStubType=50;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED":case 51:i.messageStubType=51;break;case"PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP":case 52:i.messageStubType=52;break;case"PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP":case 53:i.messageStubType=53;break;case"PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER":case 54:i.messageStubType=54;break;case"PAYMENT_ACTION_SEND_PAYMENT_REMINDER":case 55:i.messageStubType=55;break;case"PAYMENT_ACTION_SEND_PAYMENT_INVITATION":case 56:i.messageStubType=56;break;case"PAYMENT_ACTION_REQUEST_DECLINED":case 57:i.messageStubType=57;break;case"PAYMENT_ACTION_REQUEST_EXPIRED":case 58:i.messageStubType=58;break;case"PAYMENT_ACTION_REQUEST_CANCELLED":case 59:i.messageStubType=59;break;case"BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM":case 60:i.messageStubType=60;break;case"BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP":case 61:i.messageStubType=61;break;case"BIZ_INTRO_TOP":case 62:i.messageStubType=62;break;case"BIZ_INTRO_BOTTOM":case 63:i.messageStubType=63;break;case"BIZ_NAME_CHANGE":case 64:i.messageStubType=64;break;case"BIZ_MOVE_TO_CONSUMER_APP":case 65:i.messageStubType=65;break;case"BIZ_TWO_TIER_MIGRATION_TOP":case 66:i.messageStubType=66;break;case"BIZ_TWO_TIER_MIGRATION_BOTTOM":case 67:i.messageStubType=67;break;case"OVERSIZED":case 68:i.messageStubType=68;break;case"GROUP_CHANGE_NO_FREQUENTLY_FORWARDED":case 69:i.messageStubType=69;break;case"GROUP_V4_ADD_INVITE_SENT":case 70:i.messageStubType=70;break;case"GROUP_PARTICIPANT_ADD_REQUEST_JOIN":case 71:i.messageStubType=71;break;case"CHANGE_EPHEMERAL_SETTING":case 72:i.messageStubType=72;break;case"E2E_DEVICE_CHANGED":case 73:i.messageStubType=73;break;case"VIEWED_ONCE":case 74:i.messageStubType=74;break;case"E2E_ENCRYPTED_NOW":case 75:i.messageStubType=75;break;case"BLUE_MSG_BSP_FB_TO_BSP_PREMISE":case 76:i.messageStubType=76;break;case"BLUE_MSG_BSP_FB_TO_SELF_FB":case 77:i.messageStubType=77;break;case"BLUE_MSG_BSP_FB_TO_SELF_PREMISE":case 78:i.messageStubType=78;break;case"BLUE_MSG_BSP_FB_UNVERIFIED":case 79:i.messageStubType=79;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 80:i.messageStubType=80;break;case"BLUE_MSG_BSP_FB_VERIFIED":case 81:i.messageStubType=81;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 82:i.messageStubType=82;break;case"BLUE_MSG_BSP_PREMISE_TO_SELF_PREMISE":case 83:i.messageStubType=83;break;case"BLUE_MSG_BSP_PREMISE_UNVERIFIED":case 84:i.messageStubType=84;break;case"BLUE_MSG_BSP_PREMISE_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 85:i.messageStubType=85;break;case"BLUE_MSG_BSP_PREMISE_VERIFIED":case 86:i.messageStubType=86;break;case"BLUE_MSG_BSP_PREMISE_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 87:i.messageStubType=87;break;case"BLUE_MSG_CONSUMER_TO_BSP_FB_UNVERIFIED":case 88:i.messageStubType=88;break;case"BLUE_MSG_CONSUMER_TO_BSP_PREMISE_UNVERIFIED":case 89:i.messageStubType=89;break;case"BLUE_MSG_CONSUMER_TO_SELF_FB_UNVERIFIED":case 90:i.messageStubType=90;break;case"BLUE_MSG_CONSUMER_TO_SELF_PREMISE_UNVERIFIED":case 91:i.messageStubType=91;break;case"BLUE_MSG_SELF_FB_TO_BSP_PREMISE":case 92:i.messageStubType=92;break;case"BLUE_MSG_SELF_FB_TO_SELF_PREMISE":case 93:i.messageStubType=93;break;case"BLUE_MSG_SELF_FB_UNVERIFIED":case 94:i.messageStubType=94;break;case"BLUE_MSG_SELF_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 95:i.messageStubType=95;break;case"BLUE_MSG_SELF_FB_VERIFIED":case 96:i.messageStubType=96;break;case"BLUE_MSG_SELF_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 97:i.messageStubType=97;break;case"BLUE_MSG_SELF_PREMISE_TO_BSP_PREMISE":case 98:i.messageStubType=98;break;case"BLUE_MSG_SELF_PREMISE_UNVERIFIED":case 99:i.messageStubType=99;break;case"BLUE_MSG_SELF_PREMISE_VERIFIED":case 100:i.messageStubType=100;break;case"BLUE_MSG_TO_BSP_FB":case 101:i.messageStubType=101;break;case"BLUE_MSG_TO_CONSUMER":case 102:i.messageStubType=102;break;case"BLUE_MSG_TO_SELF_FB":case 103:i.messageStubType=103;break;case"BLUE_MSG_UNVERIFIED_TO_BSP_FB_VERIFIED":case 104:i.messageStubType=104;break;case"BLUE_MSG_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 105:i.messageStubType=105;break;case"BLUE_MSG_UNVERIFIED_TO_SELF_FB_VERIFIED":case 106:i.messageStubType=106;break;case"BLUE_MSG_UNVERIFIED_TO_VERIFIED":case 107:i.messageStubType=107;break;case"BLUE_MSG_VERIFIED_TO_BSP_FB_UNVERIFIED":case 108:i.messageStubType=108;break;case"BLUE_MSG_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 109:i.messageStubType=109;break;case"BLUE_MSG_VERIFIED_TO_SELF_FB_UNVERIFIED":case 110:i.messageStubType=110;break;case"BLUE_MSG_VERIFIED_TO_UNVERIFIED":case 111:i.messageStubType=111;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 112:i.messageStubType=112;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_FB_VERIFIED":case 113:i.messageStubType=113;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 114:i.messageStubType=114;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_FB_UNVERIFIED":case 115:i.messageStubType=115;break;case"BLUE_MSG_SELF_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 116:i.messageStubType=116;break;case"BLUE_MSG_SELF_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 117:i.messageStubType=117;break;case"E2E_IDENTITY_UNAVAILABLE":case 118:i.messageStubType=118;break;case"GROUP_CREATING":case 119:i.messageStubType=119;break;case"GROUP_CREATE_FAILED":case 120:i.messageStubType=120;break;case"GROUP_BOUNCED":case 121:i.messageStubType=121;break;case"BLOCK_CONTACT":case 122:i.messageStubType=122;break;case"EPHEMERAL_SETTING_NOT_APPLIED":case 123:i.messageStubType=123;break;case"SYNC_FAILED":case 124:i.messageStubType=124;break;case"SYNCING":case 125:i.messageStubType=125;break;case"BIZ_PRIVACY_MODE_INIT_FB":case 126:i.messageStubType=126;break;case"BIZ_PRIVACY_MODE_INIT_BSP":case 127:i.messageStubType=127;break;case"BIZ_PRIVACY_MODE_TO_FB":case 128:i.messageStubType=128;break;case"BIZ_PRIVACY_MODE_TO_BSP":case 129:i.messageStubType=129;break;case"DISAPPEARING_MODE":case 130:i.messageStubType=130;break;case"E2E_DEVICE_FETCH_FAILED":case 131:i.messageStubType=131;break;case"ADMIN_REVOKE":case 132:i.messageStubType=132;break;case"GROUP_INVITE_LINK_GROWTH_LOCKED":case 133:i.messageStubType=133;break;case"COMMUNITY_LINK_PARENT_GROUP":case 134:i.messageStubType=134;break;case"COMMUNITY_LINK_SIBLING_GROUP":case 135:i.messageStubType=135;break;case"COMMUNITY_LINK_SUB_GROUP":case 136:i.messageStubType=136;break;case"COMMUNITY_UNLINK_PARENT_GROUP":case 137:i.messageStubType=137;break;case"COMMUNITY_UNLINK_SIBLING_GROUP":case 138:i.messageStubType=138;break;case"COMMUNITY_UNLINK_SUB_GROUP":case 139:i.messageStubType=139;break;case"GROUP_PARTICIPANT_ACCEPT":case 140:i.messageStubType=140;break;case"GROUP_PARTICIPANT_LINKED_GROUP_JOIN":case 141:i.messageStubType=141;break;case"COMMUNITY_CREATE":case 142:i.messageStubType=142;break;case"EPHEMERAL_KEEP_IN_CHAT":case 143:i.messageStubType=143;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST":case 144:i.messageStubType=144;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE":case 145:i.messageStubType=145;break;case"INTEGRITY_UNLINK_PARENT_GROUP":case 146:i.messageStubType=146;break;case"COMMUNITY_PARTICIPANT_PROMOTE":case 147:i.messageStubType=147;break;case"COMMUNITY_PARTICIPANT_DEMOTE":case 148:i.messageStubType=148;break;case"COMMUNITY_PARENT_GROUP_DELETED":case 149:i.messageStubType=149;break;case"COMMUNITY_LINK_PARENT_GROUP_MEMBERSHIP_APPROVAL":case 150:i.messageStubType=150;break;case"GROUP_PARTICIPANT_JOINED_GROUP_AND_PARENT_GROUP":case 151:i.messageStubType=151;break;case"MASKED_THREAD_CREATED":case 152:i.messageStubType=152;break;case"MASKED_THREAD_UNMASKED":case 153:i.messageStubType=153;break;case"BIZ_CHAT_ASSIGNMENT":case 154:i.messageStubType=154;break;case"CHAT_PSA":case 155:i.messageStubType=155;break;case"CHAT_POLL_CREATION_MESSAGE":case 156:i.messageStubType=156;break;case"CAG_MASKED_THREAD_CREATED":case 157:i.messageStubType=157;break;case"COMMUNITY_PARENT_GROUP_SUBJECT_CHANGED":case 158:i.messageStubType=158;break;case"CAG_INVITE_AUTO_ADD":case 159:i.messageStubType=159;break;case"BIZ_CHAT_ASSIGNMENT_UNASSIGN":case 160:i.messageStubType=160;break;case"CAG_INVITE_AUTO_JOINED":case 161:i.messageStubType=161;break;case"SCHEDULED_CALL_START_MESSAGE":case 162:i.messageStubType=162;break;case"COMMUNITY_INVITE_RICH":case 163:i.messageStubType=163;break;case"COMMUNITY_INVITE_AUTO_ADD_RICH":case 164:i.messageStubType=164;break;case"SUB_GROUP_INVITE_RICH":case 165:i.messageStubType=165;break;case"SUB_GROUP_PARTICIPANT_ADD_RICH":case 166:i.messageStubType=166;break;case"COMMUNITY_LINK_PARENT_GROUP_RICH":case 167:i.messageStubType=167;break;case"COMMUNITY_PARTICIPANT_ADD_RICH":case 168:i.messageStubType=168;break;case"SILENCED_UNKNOWN_CALLER_AUDIO":case 169:i.messageStubType=169;break;case"SILENCED_UNKNOWN_CALLER_VIDEO":case 170:i.messageStubType=170;break;case"GROUP_MEMBER_ADD_MODE":case 171:i.messageStubType=171;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD":case 172:i.messageStubType=172;break;case"COMMUNITY_CHANGE_DESCRIPTION":case 173:i.messageStubType=173;break;case"SENDER_INVITE":case 174:i.messageStubType=174;break;case"RECEIVER_INVITE":case 175:i.messageStubType=175;break;case"COMMUNITY_ALLOW_MEMBER_ADDED_GROUPS":case 176:i.messageStubType=176;break;case"PINNED_MESSAGE_IN_CHAT":case 177:i.messageStubType=177;break;case"PAYMENT_INVITE_SETUP_INVITER":case 178:i.messageStubType=178;break;case"PAYMENT_INVITE_SETUP_INVITEE_RECEIVE_ONLY":case 179:i.messageStubType=179;break;case"PAYMENT_INVITE_SETUP_INVITEE_SEND_AND_RECEIVE":case 180:i.messageStubType=180;break;case"LINKED_GROUP_CALL_START":case 181:i.messageStubType=181;break;case"REPORT_TO_ADMIN_ENABLED_STATUS":case 182:i.messageStubType=182;break;case"EMPTY_SUBGROUP_CREATE":case 183:i.messageStubType=183;break;case"SCHEDULED_CALL_CANCEL":case 184:i.messageStubType=184;break;case"SUBGROUP_ADMIN_TRIGGERED_AUTO_ADD_RICH":case 185:i.messageStubType=185;break;case"GROUP_CHANGE_RECENT_HISTORY_SHARING":case 186:i.messageStubType=186;break;case"PAID_MESSAGE_SERVER_CAMPAIGN_ID":case 187:i.messageStubType=187;break;case"GENERAL_CHAT_CREATE":case 188:i.messageStubType=188;break;case"GENERAL_CHAT_ADD":case 189:i.messageStubType=189;break;case"GENERAL_CHAT_AUTO_ADD_DISABLED":case 190:i.messageStubType=190;break;case"SUGGESTED_SUBGROUP_ANNOUNCE":case 191:i.messageStubType=191;break;case"BIZ_BOT_1P_MESSAGING_ENABLED":case 192:i.messageStubType=192;break;case"CHANGE_USERNAME":case 193:i.messageStubType=193;break;case"BIZ_COEX_PRIVACY_INIT_SELF":case 194:i.messageStubType=194;break;case"BIZ_COEX_PRIVACY_TRANSITION_SELF":case 195:i.messageStubType=195;break;case"SUPPORT_AI_EDUCATION":case 196:i.messageStubType=196;break;case"BIZ_BOT_3P_MESSAGING_ENABLED":case 197:i.messageStubType=197;break;case"REMINDER_SETUP_MESSAGE":case 198:i.messageStubType=198;break;case"REMINDER_SENT_MESSAGE":case 199:i.messageStubType=199;break;case"REMINDER_CANCEL_MESSAGE":case 200:i.messageStubType=200;break;case"BIZ_COEX_PRIVACY_INIT":case 201:i.messageStubType=201;break;case"BIZ_COEX_PRIVACY_TRANSITION":case 202:i.messageStubType=202;break;case"GROUP_DEACTIVATED":case 203:i.messageStubType=203;break;case"COMMUNITY_DEACTIVATE_SIBLING_GROUP":case 204:i.messageStubType=204;break;case"EVENT_UPDATED":case 205:i.messageStubType=205;break;case"EVENT_CANCELED":case 206:i.messageStubType=206;break;case"COMMUNITY_OWNER_UPDATED":case 207:i.messageStubType=207;break;case"COMMUNITY_SUB_GROUP_VISIBILITY_HIDDEN":case 208:i.messageStubType=208;break;case"CAPI_GROUP_NE2EE_SYSTEM_MESSAGE":case 209:i.messageStubType=209;break;case"STATUS_MENTION":case 210:i.messageStubType=210;break;case"USER_CONTROLS_SYSTEM_MESSAGE":case 211:i.messageStubType=211;break;case"SUPPORT_SYSTEM_MESSAGE":case 212:i.messageStubType=212;break;case"CHANGE_LID":case 213:i.messageStubType=213;break;case"BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_IN_MESSAGE":case 214:i.messageStubType=214;break;case"BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_OUT_MESSAGE":case 215:i.messageStubType=215;break;case"CHANGE_LIMIT_SHARING":case 216:i.messageStubType=216;break;case"GROUP_MEMBER_LINK_MODE":case 217:i.messageStubType=217;break;case"BIZ_AUTOMATICALLY_LABELED_CHAT_SYSTEM_MESSAGE":case 218:i.messageStubType=218;break;case"PHONE_NUMBER_HIDING_CHAT_DEPRECATED_MESSAGE":case 219:i.messageStubType=219;break;case"QUARANTINED_MESSAGE":case 220:i.messageStubType=220;break;case"GROUP_MEMBER_SHARE_GROUP_HISTORY_MODE":case 221:i.messageStubType=221;break}if(e.clearMedia!=null&&(i.clearMedia=!!e.clearMedia),e.messageStubParameters){if(!Array.isArray(e.messageStubParameters))throw TypeError(".proto.WebMessageInfo.messageStubParameters: array expected");i.messageStubParameters=[];for(var A=0;A>>0),e.labels){if(!Array.isArray(e.labels))throw TypeError(".proto.WebMessageInfo.labels: array expected");i.labels=[];for(var A=0;A>>0,e.ephemeralStartTimestamp.high>>>0).toNumber(!0))),e.ephemeralDuration!=null&&(i.ephemeralDuration=e.ephemeralDuration>>>0),e.ephemeralOffToOn!=null&&(i.ephemeralOffToOn=!!e.ephemeralOffToOn),e.ephemeralOutOfSync!=null&&(i.ephemeralOutOfSync=!!e.ephemeralOutOfSync),e.bizPrivacyStatus){default:if(typeof e.bizPrivacyStatus=="number"){i.bizPrivacyStatus=e.bizPrivacyStatus;break}break;case"E2EE":case 0:i.bizPrivacyStatus=0;break;case"FB":case 2:i.bizPrivacyStatus=2;break;case"BSP":case 1:i.bizPrivacyStatus=1;break;case"BSP_AND_FB":case 3:i.bizPrivacyStatus=3;break}if(e.verifiedBizName!=null&&(i.verifiedBizName=String(e.verifiedBizName)),e.mediaData!=null){if(typeof e.mediaData!="object")throw TypeError(".proto.WebMessageInfo.mediaData: object expected");i.mediaData=d.proto.MediaData.fromObject(e.mediaData)}if(e.photoChange!=null){if(typeof e.photoChange!="object")throw TypeError(".proto.WebMessageInfo.photoChange: object expected");i.photoChange=d.proto.PhotoChange.fromObject(e.photoChange)}if(e.userReceipt){if(!Array.isArray(e.userReceipt))throw TypeError(".proto.WebMessageInfo.userReceipt: array expected");i.userReceipt=[];for(var A=0;A=0&&(i.futureproofData=e.futureproofData)),e.statusPsa!=null){if(typeof e.statusPsa!="object")throw TypeError(".proto.WebMessageInfo.statusPsa: object expected");i.statusPsa=d.proto.StatusPSA.fromObject(e.statusPsa)}if(e.pollUpdates){if(!Array.isArray(e.pollUpdates))throw TypeError(".proto.WebMessageInfo.pollUpdates: array expected");i.pollUpdates=[];for(var A=0;A=0&&(i.messageSecret=e.messageSecret)),e.keepInChat!=null){if(typeof e.keepInChat!="object")throw TypeError(".proto.WebMessageInfo.keepInChat: object expected");i.keepInChat=d.proto.KeepInChat.fromObject(e.keepInChat)}if(e.originalSelfAuthorUserJidString!=null&&(i.originalSelfAuthorUserJidString=String(e.originalSelfAuthorUserJidString)),e.revokeMessageTimestamp!=null&&(l.Long?(i.revokeMessageTimestamp=l.Long.fromValue(e.revokeMessageTimestamp)).unsigned=!0:typeof e.revokeMessageTimestamp=="string"?i.revokeMessageTimestamp=parseInt(e.revokeMessageTimestamp,10):typeof e.revokeMessageTimestamp=="number"?i.revokeMessageTimestamp=e.revokeMessageTimestamp:typeof e.revokeMessageTimestamp=="object"&&(i.revokeMessageTimestamp=new l.LongBits(e.revokeMessageTimestamp.low>>>0,e.revokeMessageTimestamp.high>>>0).toNumber(!0))),e.pinInChat!=null){if(typeof e.pinInChat!="object")throw TypeError(".proto.WebMessageInfo.pinInChat: object expected");i.pinInChat=d.proto.PinInChat.fromObject(e.pinInChat)}if(e.premiumMessageInfo!=null){if(typeof e.premiumMessageInfo!="object")throw TypeError(".proto.WebMessageInfo.premiumMessageInfo: object expected");i.premiumMessageInfo=d.proto.PremiumMessageInfo.fromObject(e.premiumMessageInfo)}if(e.is1PBizBotMessage!=null&&(i.is1PBizBotMessage=!!e.is1PBizBotMessage),e.isGroupHistoryMessage!=null&&(i.isGroupHistoryMessage=!!e.isGroupHistoryMessage),e.botMessageInvokerJid!=null&&(i.botMessageInvokerJid=String(e.botMessageInvokerJid)),e.commentMetadata!=null){if(typeof e.commentMetadata!="object")throw TypeError(".proto.WebMessageInfo.commentMetadata: object expected");i.commentMetadata=d.proto.CommentMetadata.fromObject(e.commentMetadata)}if(e.eventResponses){if(!Array.isArray(e.eventResponses))throw TypeError(".proto.WebMessageInfo.eventResponses: array expected");i.eventResponses=[];for(var A=0;A>>0,e.newsletterServerId.high>>>0).toNumber(!0))),e.eventAdditionalMetadata!=null){if(typeof e.eventAdditionalMetadata!="object")throw TypeError(".proto.WebMessageInfo.eventAdditionalMetadata: object expected");i.eventAdditionalMetadata=d.proto.EventAdditionalMetadata.fromObject(e.eventAdditionalMetadata)}if(e.isMentionedInStatus!=null&&(i.isMentionedInStatus=!!e.isMentionedInStatus),e.statusMentions){if(!Array.isArray(e.statusMentions))throw TypeError(".proto.WebMessageInfo.statusMentions: array expected");i.statusMentions=[];for(var A=0;A>>3){case 2:{s.timestamp=e.uint64();break}case 3:{s.unreadChats=e.uint32();break}case 4:{s.notifyMessageCount=e.uint32();break}case 5:{s.notifyMessages&&s.notifyMessages.length||(s.notifyMessages=[]),s.notifyMessages.push(d.proto.WebMessageInfo.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.WebNotificationsInfo)return e;var i=new d.proto.WebNotificationsInfo;if(e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.unreadChats!=null&&(i.unreadChats=e.unreadChats>>>0),e.notifyMessageCount!=null&&(i.notifyMessageCount=e.notifyMessageCount>>>0),e.notifyMessages){if(!Array.isArray(e.notifyMessages))throw TypeError(".proto.WebNotificationsInfo.notifyMessages: array expected");i.notifyMessages=[];for(var A=0;ANi.hasSubscribers||PB.hasSubscribers,I7=new Set,c7=typeof process=="object"&&process?process:{},axe=(n,t,o,a)=>{typeof c7.emitWarning=="function"?c7.emitWarning(n,t,o,a):console.error(`[${o}] ${t}: ${n}`)},oxe=n=>!I7.has(n),tI=n=>!!n&&n===Math.floor(n)&&n>0&&isFinite(n),l7=n=>tI(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?wD:null:null,wD=class extends Array{constructor(n){super(n),this.fill(0)}},nxe=class GB{heap;length;static#e=!1;static create(t){let o=l7(t);if(!o)return[];GB.#e=!0;let a=new GB(t,o);return GB.#e=!1,a}constructor(t,o){if(!GB.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new o(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},Jg=class p7{#e;#A;#t;#r;#I;#o;#c;#i;get perf(){return this.#i}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#a;#s;#p;#g;#l;#n;#h;#d;#C;#u;#B;#f;#m;#w;#Q;#y;#b;#E;#k;static unsafeExposeInternals(t){return{starts:t.#m,ttls:t.#w,autopurgeTimers:t.#Q,sizes:t.#f,keyMap:t.#p,keyList:t.#g,valList:t.#l,next:t.#n,prev:t.#h,get head(){return t.#d},get tail(){return t.#C},free:t.#u,isBackgroundFetch:o=>t.#v(o),backgroundFetch:(o,a,e,i)=>t.#q(o,a,e,i),moveToTail:o=>t.#$(o),indexes:o=>t.#x(o),rindexes:o=>t.#K(o),isStale:o=>t.#N(o)}}get max(){return this.#e}get maxSize(){return this.#A}get calculatedSize(){return this.#s}get size(){return this.#a}get fetchMethod(){return this.#o}get memoMethod(){return this.#c}get dispose(){return this.#t}get onInsert(){return this.#r}get disposeAfter(){return this.#I}constructor(t){let{max:o=0,ttl:a,ttlResolution:e=1,ttlAutopurge:i,updateAgeOnGet:A,updateAgeOnHas:r,allowStale:s,dispose:g,onInsert:c,disposeAfter:I,noDisposeOnSet:p,noUpdateTTL:B,maxSize:f=0,maxEntrySize:Q=0,sizeCalculation:y,fetchMethod:m,memoMethod:T,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:U,ignoreFetchAbort:F,backgroundFetchSize:q=1,perf:z}=t;if(this.backgroundFetchSize=q,z!==void 0&&typeof z?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#i=z??ixe,o!==0&&!tI(o))throw new TypeError("max option must be a nonnegative integer");let K=o?l7(o):Array;if(!K)throw new Error("invalid max value: "+o);if(this.#e=o,this.#A=f,this.maxEntrySize=Q||this.#A,this.sizeCalculation=y,this.sizeCalculation){if(!this.#A&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(T!==void 0&&typeof T!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#c=T,m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=m,this.#b=!!m,this.#p=new Map,this.#g=Array.from({length:o}).fill(void 0),this.#l=Array.from({length:o}).fill(void 0),this.#n=new K(o),this.#h=new K(o),this.#d=0,this.#C=0,this.#u=nxe.create(o),this.#a=0,this.#s=0,typeof g=="function"&&(this.#t=g),typeof c=="function"&&(this.#r=c),typeof I=="function"?(this.#I=I,this.#B=[]):(this.#I=void 0,this.#B=void 0),this.#y=!!this.#t,this.#k=!!this.#r,this.#E=!!this.#I,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!B,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!L,this.allowStaleOnFetchAbort=!!U,this.ignoreFetchAbort=!!F,this.maxEntrySize!==0){if(this.#A!==0&&!tI(this.#A))throw new TypeError("maxSize must be a positive integer if specified");if(!tI(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!s,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!A,this.updateAgeOnHas=!!r,this.ttlResolution=tI(e)||e===0?e:1,this.ttlAutopurge=!!i,this.ttl=a||0,this.ttl){if(!tI(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(this.#e===0&&this.ttl===0&&this.#A===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#A){let G="LRU_CACHE_UNBOUNDED";oxe(G)&&(I7.add(G),axe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",G,p7))}}getRemainingTTL(t){return this.#p.has(t)?1/0:0}#M(){let t=new wD(this.#e),o=new wD(this.#e);this.#w=t,this.#m=o;let a=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#Q=a,this.#T=(s,g,c=this.#i.now())=>{o[s]=g!==0?c:0,t[s]=g,e(s,g)},this.#D=s=>{o[s]=t[s]!==0?this.#i.now():0,e(s,t[s])};let e=this.ttlAutopurge?(s,g)=>{if(a?.[s]&&(clearTimeout(a[s]),a[s]=void 0),g&&g!==0&&a){let c=setTimeout(()=>{this.#N(s)?(this.#j(this.#g[s],"expire"),a[s]=void 0):e(s,r(s))},g+1);c.unref&&c.unref(),a[s]=c}}:()=>{};this.#S=(s,g)=>{if(t[g]){let c=t[g],I=o[g];if(!c||!I)return;s.ttl=c,s.start=I,s.now=i||A();let p=s.now-I;s.remainingTTL=c-p}};let i=0,A=()=>{let s=this.#i.now();if(this.ttlResolution>0){i=s;let g=setTimeout(()=>i=0,this.ttlResolution);g.unref&&g.unref()}return s};this.getRemainingTTL=s=>{let g=this.#p.get(s);return g===void 0?0:r(g)};let r=s=>{let g=t[s],c=o[s];if(!g||!c)return 1/0;let I=(i||A())-c;return g-I};this.#N=s=>{let g=o[s],c=t[s];return!!c&&!!g&&(i||A())-g>c}}#D=()=>{};#S=()=>{};#T=()=>{};#N=()=>!1;#P(){let t=new wD(this.#e);this.#s=0,this.#f=t,this.#_=o=>{this.#s-=t[o],t[o]=0},this.#R=(o,a,e,i)=>{if(!tI(e)){if(this.#v(a))return this.backgroundFetchSize;if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(e=i(a,o),!tI(e))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return e},this.#G=(o,a,e)=>{if(t[o]=a,this.#A){let i=this.#A-t[o];for(;this.#s>i;)this.#F(!0)}this.#s+=t[o],e&&(e.entrySize=a,e.totalCalculatedSize=this.#s)}}#_=t=>{};#G=(t,o,a)=>{};#R=(t,o,a,e)=>{if(a||e)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:t=this.allowStale}={}){if(this.#a)for(let o=this.#C;this.#J(o)&&((t||!this.#N(o))&&(yield o),o!==this.#d);)o=this.#h[o]}*#K({allowStale:t=this.allowStale}={}){if(this.#a)for(let o=this.#d;this.#J(o)&&((t||!this.#N(o))&&(yield o),o!==this.#C);)o=this.#n[o]}#J(t){return t!==void 0&&this.#p.get(this.#g[t])===t}*entries(){for(let t of this.#x())this.#l[t]!==void 0&&this.#g[t]!==void 0&&!this.#v(this.#l[t])&&(yield[this.#g[t],this.#l[t]])}*rentries(){for(let t of this.#K())this.#l[t]!==void 0&&this.#g[t]!==void 0&&!this.#v(this.#l[t])&&(yield[this.#g[t],this.#l[t]])}*keys(){for(let t of this.#x()){let o=this.#g[t];o!==void 0&&!this.#v(this.#l[t])&&(yield o)}}*rkeys(){for(let t of this.#K()){let o=this.#g[t];o!==void 0&&!this.#v(this.#l[t])&&(yield o)}}*values(){for(let t of this.#x())this.#l[t]!==void 0&&!this.#v(this.#l[t])&&(yield this.#l[t])}*rvalues(){for(let t of this.#K())this.#l[t]!==void 0&&!this.#v(this.#l[t])&&(yield this.#l[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,o={}){for(let a of this.#x()){let e=this.#l[a],i=this.#v(e)?e.__staleWhileFetching:e;if(i!==void 0&&t(i,this.#g[a],this))return this.#X(this.#g[a],o)}}forEach(t,o=this){for(let a of this.#x()){let e=this.#l[a],i=this.#v(e)?e.__staleWhileFetching:e;i!==void 0&&t.call(o,i,this.#g[a],this)}}rforEach(t,o=this){for(let a of this.#K()){let e=this.#l[a],i=this.#v(e)?e.__staleWhileFetching:e;i!==void 0&&t.call(o,i,this.#g[a],this)}}purgeStale(){let t=!1;for(let o of this.#K({allowStale:!0}))this.#N(o)&&(this.#j(this.#g[o],"expire"),t=!0);return t}info(t){let o=this.#p.get(t);if(o===void 0)return;let a=this.#l[o],e=this.#v(a)?a.__staleWhileFetching:a;if(e===void 0)return;let i={value:e};if(this.#w&&this.#m){let A=this.#w[o],r=this.#m[o];if(A&&r){let s=A-(this.#i.now()-r);i.ttl=s,i.start=Date.now()}}return this.#f&&(i.size=this.#f[o]),i}dump(){let t=[];for(let o of this.#x({allowStale:!0})){let a=this.#g[o],e=this.#l[o],i=this.#v(e)?e.__staleWhileFetching:e;if(i===void 0||a===void 0)continue;let A={value:i};if(this.#w&&this.#m){A.ttl=this.#w[o];let r=this.#i.now()-this.#m[o];A.start=Math.floor(Date.now()-r)}this.#f&&(A.size=this.#f[o]),t.unshift([a,A])}return t}load(t){this.clear();for(let[o,a]of t){if(a.start){let e=Date.now()-a.start;a.start=this.#i.now()-e}this.#U(o,a.value,a)}}set(t,o,a={}){let{status:e=Ni.hasSubscribers?{}:void 0}=a;a.status=e,e&&(e.op="set",e.key=t,o!==void 0&&(e.value=o),e.cache=this);let i=this.#U(t,o,a);return e&&Ni.hasSubscribers&&Ni.publish(e),i}#U(t,o,a,e){let{ttl:i=this.ttl,start:A,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:g}=a,c=this.#v(o);if(o===void 0)return g&&(g.set="deleted"),this.delete(t),this;let{noUpdateTTL:I=this.noUpdateTTL}=a;g&&!c&&(g.value=o);let p=this.#R(t,o,a.size||0,s,g);if(this.maxEntrySize&&p>this.maxEntrySize)return this.#j(t,"set"),g&&(g.set="miss",g.maxEntrySizeExceeded=!0),this;let B=this.#a===0?void 0:this.#p.get(t);if(B===void 0)B=this.#a===0?this.#C:this.#u.length!==0?this.#u.pop():this.#a===this.#e?this.#F(!1):this.#a,this.#g[B]=t,this.#l[B]=o,this.#p.set(t,B),this.#n[this.#C]=B,this.#h[B]=this.#C,this.#C=B,this.#a++,this.#G(B,p,g),g&&(g.set="add"),I=!1,this.#k&&!c&&this.#r?.(o,t,"add");else{this.#$(B);let f=this.#l[B];if(o!==f){if(!r)if(this.#v(f)){f!==e&&f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Q}=f;Q!==void 0&&Q!==o&&(this.#y&&this.#t?.(Q,t,"set"),this.#E&&this.#B?.push([Q,t,"set"]))}else this.#y&&this.#t?.(f,t,"set"),this.#E&&this.#B?.push([f,t,"set"]);if(this.#_(B),this.#G(B,p,g),this.#l[B]=o,!c){let Q=f&&this.#v(f)?f.__staleWhileFetching:f,y=Q===void 0?"add":o!==Q?"replace":"update";g&&(g.set=y,Q!==void 0&&(g.oldValue=Q)),this.#k&&this.onInsert?.(o,t,y)}}else c||(g&&(g.set="update"),this.#k&&this.onInsert?.(o,t,"update"))}if(i!==0&&!this.#w&&this.#M(),this.#w&&(I||this.#T(B,i,A),g&&this.#S(g,B)),!r&&this.#E&&this.#B){let f=this.#B,Q;for(;Q=f?.shift();)this.#I?.(...Q)}return this}pop(){try{for(;this.#a;){let t=this.#l[this.#d];if(this.#F(!0),this.#v(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#E&&this.#B){let t=this.#B,o;for(;o=t?.shift();)this.#I?.(...o)}}}#F(t){let o=this.#d,a=this.#g[o],e=this.#l[o],i=this.#v(e);i&&e.__abortController.abort(new Error("evicted"));let A=i?e.__staleWhileFetching:e;return(this.#y||this.#E)&&A!==void 0&&(this.#y&&this.#t?.(A,a,"evict"),this.#E&&this.#B?.push([A,a,"evict"])),this.#_(o),this.#Q?.[o]&&(clearTimeout(this.#Q[o]),this.#Q[o]=void 0),t&&(this.#g[o]=void 0,this.#l[o]=void 0,this.#u.push(o)),this.#a===1?(this.#d=this.#C=0,this.#u.length=0):this.#d=this.#n[o],this.#p.delete(a),this.#a--,o}has(t,o={}){let{status:a=Ni.hasSubscribers?{}:void 0}=o;o.status=a,a&&(a.op="has",a.key=t,a.cache=this);let e=this.#L(t,o);return Ni.hasSubscribers&&Ni.publish(a),e}#L(t,o={}){let{updateAgeOnHas:a=this.updateAgeOnHas,status:e}=o,i=this.#p.get(t);if(i!==void 0){let A=this.#l[i];if(this.#v(A)&&A.__staleWhileFetching===void 0)return!1;if(this.#N(i))e&&(e.has="stale",this.#S(e,i));else return a&&this.#D(i),e&&(e.has="hit",this.#S(e,i)),!0}else e&&(e.has="miss");return!1}peek(t,o={}){let{status:a=dL()?{}:void 0}=o;a&&(a.op="peek",a.key=t,a.cache=this),o.status=a;let e=this.#V(t,o);return Ni.hasSubscribers&&Ni.publish(a),e}#V(t,o){let{status:a,allowStale:e=this.allowStale}=o,i=this.#p.get(t);if(i===void 0||!e&&this.#N(i)){a&&(a.peek=i===void 0?"miss":"stale");return}let A=this.#l[i],r=this.#v(A)?A.__staleWhileFetching:A;return a&&(r!==void 0?(a.peek="hit",a.value=r):a.peek="miss"),r}#q(t,o,a,e){let i=o===void 0?void 0:this.#l[o];if(this.#v(i))return i;let A=new AbortController,{signal:r}=a;r?.addEventListener("abort",()=>A.abort(r.reason),{signal:A.signal});let s={signal:A.signal,options:a,context:e},g=(Q,y=!1)=>{let{aborted:m}=A.signal,T=a.ignoreFetchAbort&&Q!==void 0,_=a.ignoreFetchAbort||!!(a.allowStaleOnFetchAbort&&Q!==void 0);if(a.status&&(m&&!y?(a.status.fetchAborted=!0,a.status.fetchError=A.signal.reason,T&&(a.status.fetchAbortIgnored=!0)):a.status.fetchResolved=!0),m&&!T&&!y)return I(A.signal.reason,_);let R=B,L=this.#l[o];return(L===B||L===void 0&&T&&y)&&(Q===void 0?R.__staleWhileFetching!==void 0?this.#l[o]=R.__staleWhileFetching:this.#j(t,"fetch"):(a.status&&(a.status.fetchUpdated=!0),this.#U(t,Q,s.options,R))),Q},c=Q=>(a.status&&(a.status.fetchRejected=!0,a.status.fetchError=Q),I(Q,!1)),I=(Q,y)=>{let{aborted:m}=A.signal,T=m&&a.allowStaleOnFetchAbort,_=T||a.allowStaleOnFetchRejection,R=_||a.noDeleteOnFetchRejection,L=B;if(this.#l[o]===B&&(!R||!y&&L.__staleWhileFetching===void 0?this.#j(t,"fetch"):T||(this.#l[o]=L.__staleWhileFetching)),_)return a.status&&L.__staleWhileFetching!==void 0&&(a.status.returnedStale=!0),L.__staleWhileFetching;if(L.__returned===L)throw Q},p=(Q,y)=>{let m=this.#o?.(t,i,s);A.signal.addEventListener("abort",()=>{(!a.ignoreFetchAbort||a.allowStaleOnFetchAbort)&&(Q(void 0),a.allowStaleOnFetchAbort&&(Q=T=>g(T,!0)))}),m&&m instanceof Promise?m.then(T=>Q(T===void 0?void 0:T),y):m!==void 0&&Q(m)};a.status&&(a.status.fetchDispatched=!0);let B=new Promise(p).then(g,c),f=Object.assign(B,{__abortController:A,__staleWhileFetching:i,__returned:void 0});return o===void 0?(this.#U(t,f,{...s.options,status:void 0}),o=this.#p.get(t)):this.#l[o]=f,f}#v(t){if(!this.#b)return!1;let o=t;return!!o&&o instanceof Promise&&o.hasOwnProperty("__staleWhileFetching")&&o.__abortController instanceof AbortController}fetch(t,o={}){let a=PB.hasSubscribers,{status:e=dL()?{}:void 0}=o;o.status=e,e&&o.context&&(e.context=o.context);let i=this.#W(t,o);return e&&a&&(e.trace=!0,PB.tracePromise(()=>i,e).catch(()=>{})),i}async#W(t,o={}){let{allowStale:a=this.allowStale,updateAgeOnGet:e=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:A=this.ttl,noDisposeOnSet:r=this.noDisposeOnSet,size:s=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:I=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:B=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:Q,forceRefresh:y=!1,status:m,signal:T}=o;if(m&&(m.op="fetch",m.key=t,y&&(m.forceRefresh=!0),m.cache=this),!this.#b)return m&&(m.fetch="get"),this.#X(t,{allowStale:a,updateAgeOnGet:e,noDeleteOnStaleGet:i,status:m});let _={allowStale:a,updateAgeOnGet:e,noDeleteOnStaleGet:i,ttl:A,noDisposeOnSet:r,size:s,sizeCalculation:g,noUpdateTTL:c,noDeleteOnFetchRejection:I,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:f,ignoreFetchAbort:B,status:m,signal:T},R=this.#p.get(t);if(R===void 0){m&&(m.fetch="miss");let L=this.#q(t,R,_,Q);return L.__returned=L}else{let L=this.#l[R];if(this.#v(L)){let z=a&&L.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",z&&(m.returnedStale=!0)),z?L.__staleWhileFetching:L.__returned=L}let U=this.#N(R);if(!y&&!U)return m&&(m.fetch="hit"),this.#$(R),e&&this.#D(R),m&&this.#S(m,R),L;let F=this.#q(t,R,_,Q),q=F.__staleWhileFetching!==void 0&&a;return m&&(m.fetch=U?"stale":"refresh",q&&U&&(m.returnedStale=!0)),q?F.__staleWhileFetching:F.__returned=F}}forceFetch(t,o={}){let a=PB.hasSubscribers,{status:e=dL()?{}:void 0}=o;o.status=e,e&&o.context&&(e.context=o.context);let i=this.#H(t,o);return e&&a&&(e.trace=!0,PB.tracePromise(()=>i,e).catch(()=>{})),i}async#H(t,o={}){let a=await this.#W(t,o);if(a===void 0)throw new Error("fetch() returned undefined");return a}memo(t,o={}){let{status:a=Ni.hasSubscribers?{}:void 0}=o;o.status=a,a&&(a.op="memo",a.key=t,o.context&&(a.context=o.context),a.cache=this);let e=this.#Z(t,o);return a&&(a.value=e),Ni.hasSubscribers&&Ni.publish(a),e}#Z(t,o={}){let a=this.#c;if(!a)throw new Error("no memoMethod provided to constructor");let{context:e,status:i,forceRefresh:A,...r}=o;i&&A&&(i.forceRefresh=!0);let s=this.#X(t,r),g=A||s===void 0;if(i&&(i.memo=g?"miss":"hit",g||(i.value=s)),!g)return s;let c=a(t,s,{options:r,context:e});return i&&(i.value=c),this.#U(t,c,r),c}get(t,o={}){let{status:a=Ni.hasSubscribers?{}:void 0}=o;o.status=a,a&&(a.op="get",a.key=t,a.cache=this);let e=this.#X(t,o);return a&&(e!==void 0&&(a.value=e),Ni.hasSubscribers&&Ni.publish(a)),e}#X(t,o={}){let{allowStale:a=this.allowStale,updateAgeOnGet:e=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:A}=o,r=this.#p.get(t);if(r===void 0){A&&(A.get="miss");return}let s=this.#l[r],g=this.#v(s);return A&&this.#S(A,r),this.#N(r)?g?(A&&(A.get="stale-fetching"),a&&s.__staleWhileFetching!==void 0?(A&&(A.returnedStale=!0),s.__staleWhileFetching):void 0):(i||this.#j(t,"expire"),A&&(A.get="stale"),a?(A&&(A.returnedStale=!0),s):void 0):(A&&(A.get=g?"fetching":"hit"),this.#$(r),e&&this.#D(r),g?s.__staleWhileFetching:s)}#ie(t,o){this.#h[o]=t,this.#n[t]=o}#$(t){t!==this.#C&&(t===this.#d?this.#d=this.#n[t]:this.#ie(this.#h[t],this.#n[t]),this.#ie(this.#C,t),this.#C=t)}delete(t){return this.#j(t,"delete")}#j(t,o){Ni.hasSubscribers&&Ni.publish({op:"delete",delete:o,key:t,cache:this});let a=!1;if(this.#a!==0){let e=this.#p.get(t);if(e!==void 0)if(this.#Q?.[e]&&(clearTimeout(this.#Q[e]),this.#Q[e]=void 0),a=!0,this.#a===1)this.#Ae(o);else{this.#_(e);let i=this.#l[e];if(this.#v(i)?i.__abortController.abort(new Error("deleted")):(this.#y||this.#E)&&(this.#y&&this.#t?.(i,t,o),this.#E&&this.#B?.push([i,t,o])),this.#p.delete(t),this.#g[e]=void 0,this.#l[e]=void 0,e===this.#C)this.#C=this.#h[e];else if(e===this.#d)this.#d=this.#n[e];else{let A=this.#h[e];this.#n[A]=this.#n[e];let r=this.#n[e];this.#h[r]=this.#h[e]}this.#a--,this.#u.push(e)}}if(this.#E&&this.#B?.length){let e=this.#B,i;for(;i=e?.shift();)this.#I?.(...i)}return a}clear(){return this.#Ae("delete")}#Ae(t){for(let o of this.#K({allowStale:!0})){let a=this.#l[o];if(this.#v(a))a.__abortController.abort(new Error("deleted"));else{let e=this.#g[o];this.#y&&this.#t?.(a,e,t),this.#E&&this.#B?.push([a,e,t])}}if(this.#p.clear(),this.#l.fill(void 0),this.#g.fill(void 0),this.#w&&this.#m){this.#w.fill(0),this.#m.fill(0);for(let o of this.#Q??[])o!==void 0&&clearTimeout(o);this.#Q?.fill(void 0)}if(this.#f&&this.#f.fill(0),this.#d=0,this.#C=0,this.#u.length=0,this.#s=0,this.#a=0,this.#E&&this.#B){let o=this.#B,a;for(;a=o?.shift();)this.#I?.(...a)}}};var xD=ze(Jr(),1);import{createHash as jxe,randomBytes as VB}from"crypto";var g$=["critical_block","critical_unblock_low","regular_high","regular_low","regular"];var SSA=ze(Jr(),1),Ei;(function(n){n[n.Connecting=0]="Connecting",n[n.AwaitingInitialSync=1]="AwaitingInitialSync",n[n.Syncing=2]="Syncing",n[n.Online=3]="Online"})(Ei||(Ei={}));var iI;(function(n){n.BIZ_COMMERCE_VIOLATION_ALCOHOL="BIZ_COMMERCE_VIOLATION_ALCOHOL",n.BIZ_COMMERCE_VIOLATION_ADULT="BIZ_COMMERCE_VIOLATION_ADULT",n.BIZ_COMMERCE_VIOLATION_ANIMALS="BIZ_COMMERCE_VIOLATION_ANIMALS",n.BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS="BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS",n.BIZ_COMMERCE_VIOLATION_DATING="BIZ_COMMERCE_VIOLATION_DATING",n.BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS="BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS",n.BIZ_COMMERCE_VIOLATION_DRUGS="BIZ_COMMERCE_VIOLATION_DRUGS",n.BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC="BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC",n.BIZ_COMMERCE_VIOLATION_GAMBLING="BIZ_COMMERCE_VIOLATION_GAMBLING",n.BIZ_COMMERCE_VIOLATION_HEALTHCARE="BIZ_COMMERCE_VIOLATION_HEALTHCARE",n.BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY="BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY",n.BIZ_COMMERCE_VIOLATION_SUPPLEMENTS="BIZ_COMMERCE_VIOLATION_SUPPLEMENTS",n.BIZ_COMMERCE_VIOLATION_TOBACCO="BIZ_COMMERCE_VIOLATION_TOBACCO",n.BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT="BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT",n.BIZ_COMMERCE_VIOLATION_WEAPONS="BIZ_COMMERCE_VIOLATION_WEAPONS",n.BIZ_QUALITY="BIZ_QUALITY",n.DEFAULT="DEFAULT",n.WEB_COMPANION_ONLY="WEB_COMPANION_ONLY"})(iI||(iI={}));var c$;(function(n){n.NONE="NONE",n.FIRST_WARNING="FIRST_WARNING",n.SECOND_WARNING="SECOND_WARNING",n.CAPPED="CAPPED"})(c$||(c$={}));var I$;(function(n){n.NOT_ELIGIBLE="NOT_ELIGIBLE",n.NOT_ACTIVE="NOT_ACTIVE",n.ACTIVE="ACTIVE",n.ACTIVE_UPGRADE_AVAILABLE="ACTIVE_UPGRADE_AVAILABLE"})(I$||(I$={}));var l$;(function(n){n.NOT_ELIGIBLE="NOT_ELIGIBLE",n.ELIGIBLE="ELIGIBLE",n.ACTIVE_IN_CURRENT_CYCLE="ACTIVE_IN_CURRENT_CYCLE",n.EXHAUSTED="EXHAUSTED"})(l$||(l$={}));var RA=ne.WebMessageInfo.StubType,bh=ne.WebMessageInfo.Status,LB;(function(n){n.PN="pn",n.LID="lid"})(LB||(LB={}));var Ri;(function(n){n.xwa2_newsletter_create="xwa2_newsletter_create",n.xwa2_newsletter_subscribers="xwa2_newsletter_subscribers",n.xwa2_newsletter_view="xwa2_newsletter_view",n.xwa2_newsletter_metadata="xwa2_newsletter",n.xwa2_newsletter_admin_count="xwa2_newsletter_admin",n.xwa2_newsletter_mute_v2="xwa2_newsletter_mute_v2",n.xwa2_newsletter_unmute_v2="xwa2_newsletter_unmute_v2",n.xwa2_newsletter_follow="xwa2_newsletter_follow",n.xwa2_newsletter_unfollow="xwa2_newsletter_unfollow",n.xwa2_newsletter_join_v2="xwa2_newsletter_join_v2",n.xwa2_newsletter_leave_v2="xwa2_newsletter_leave_v2",n.xwa2_newsletter_change_owner="xwa2_newsletter_change_owner",n.xwa2_newsletter_demote="xwa2_newsletter_demote",n.xwa2_newsletter_delete_v2="xwa2_newsletter_delete_v2",n.xwa2_fetch_account_reachout_timelock="xwa2_fetch_account_reachout_timelock",n.xwa2_message_capping_info="xwa2_message_capping_info"})(Ri||(Ri={}));var ui;(function(n){n.CREATE="8823471724422422",n.UPDATE_METADATA="24250201037901610",n.METADATA="6563316087068696",n.SUBSCRIBERS="9783111038412085",n.FOLLOW="24404358912487870",n.UNFOLLOW="9767147403369991",n.MUTE="29766401636284406",n.UNMUTE="9864994326891137",n.ADMIN_COUNT="7130823597031706",n.CHANGE_OWNER="7341777602580933",n.DEMOTE="6551828931592903",n.DELETE="30062808666639665",n.REACHOUT_TIMELOCK="23983697327930364",n.MESSAGE_CAPPING_INFO="24503548349331633"})(ui||(ui={}));var ar;(function(n){n[n.connectionClosed=428]="connectionClosed",n[n.connectionLost=408]="connectionLost",n[n.connectionReplaced=440]="connectionReplaced",n[n.timedOut=408]="timedOut",n[n.loggedOut=401]="loggedOut",n[n.badSession=500]="badSession",n[n.restartRequired=515]="restartRequired",n[n.multideviceMismatch=411]="multideviceMismatch",n[n.forbidden=403]="forbidden",n[n.unavailableService=503]="unavailableService"})(ar||(ar={}));var UB={};Lr(UB,{DOUBLE_BYTE_TOKENS:()=>p$,SINGLE_BYTE_TOKENS:()=>d$,TAGS:()=>fxe,TOKEN_MAP:()=>wL});var fxe={LIST_EMPTY:0,DICTIONARY_0:236,DICTIONARY_1:237,DICTIONARY_2:238,DICTIONARY_3:239,INTEROP_JID:245,FB_JID:246,AD_JID:247,LIST_8:248,LIST_16:249,JID_PAIR:250,HEX_8:251,BINARY_8:252,BINARY_20:253,BINARY_32:254,NIBBLE_8:255,PACKED_MAX:127},p$=[["read-self","active","fbns","protocol","reaction","screen_width","heartbeat","deviceid","2:47DEQpj8","uploadfieldstat","voip_settings","retry","priority","longitude","conflict","false","ig_professional","replaced","preaccept","cover_photo","uncompressed","encopt","ppic","04","passive","status-revoke-drop","keygen","540","offer","rate","opus","latitude","w:gp2","ver","4","business_profile","medium","sender","prev_v_id","email","website","invited","sign_credential","05","transport","skey","reason","peer_abtest_bucket","America/Sao_Paulo","appid","refresh","100","06","404","101","104","107","102","109","103","member_add_mode","105","transaction-id","110","106","outgoing","108","111","tokens","followers","ig_handle","self_pid","tue","dec","thu","joinable","peer_pid","mon","features","wed","peer_device_presence","pn","delete","07","fri","audio_duration","admin","connected","delta","rcat","disable","collection","08","480","sat","phash","all","invite","accept","critical_unblock_low","group_update","signed_credential","blinded_credential","eph_setting","net","09","background_location","refresh_id","Asia/Kolkata","privacy_mode_ts","account_sync","voip_payload_type","service_areas","acs_public_key","v_id","0a","fallback_class","relay","actual_actors","metadata","w:biz","5","connected-limit","notice","0b","host_storage","fb_page","subject","privatestats","invis","groupadd","010","note.m4r","uuid","0c","8000","sun","372","1020","stage","1200","720","canonical","fb","011","video_duration","0d","1140","superadmin","012","Opening.m4r","keystore_attestation","dleq_proof","013","timestamp","ab_key","w:sync:app:state","0e","vertical","600","p_v_id","6","likes","014","500","1260","creator","0f","rte","destination","group","group_info","syncd_anti_tampering_fatal_exception_enabled","015","dl_bw","Asia/Jakarta","vp8/h.264","online","1320","fb:multiway","10","timeout","016","nse_retry","urn:xmpp:whatsapp:dirty","017","a_v_id","web_shops_chat_header_button_enabled","nse_call","inactive-upgrade","none","web","groups","2250","mms_hot_content_timespan_in_seconds","contact_blacklist","nse_read","suspended_group_deletion_notification","binary_version","018","https://www.whatsapp.com/otp/copy/","reg_push","shops_hide_catalog_attachment_entrypoint","server_sync",".","ephemeral_messages_allowed_values","019","mms_vcache_aggregation_enabled","iphone","America/Argentina/Buenos_Aires","01a","mms_vcard_autodownload_size_kb","nse_ver","shops_header_dropdown_menu_item","dhash","catalog_status","communities_mvp_new_iqs_serverprop","blocklist","default","11","ephemeral_messages_enabled","01b","original_dimensions","8","mms4_media_retry_notification_encryption_enabled","mms4_server_error_receipt_encryption_enabled","original_image_url","sync","multiway","420","companion_enc_static","shops_profile_drawer_entrypoint","01c","vcard_as_document_size_kb","status_video_max_duration","request_image_url","01d","regular_high","s_t","abt","share_ext_min_preliminary_image_quality","01e","32","syncd_key_rotation_enabled","data_namespace","md_downgrade_read_receipts2","patch","polltype","ephemeral_messages_setting","userrate","15","partial_pjpeg_bw_threshold","played-self","catalog_exists","01f","mute_v2"],["reject","dirty","announcement","020","13","9","status_video_max_bitrate","fb:thrift_iq","offline_batch","022","full","ctwa_first_business_reply_logging","h.264","smax_id","group_description_length","https://www.whatsapp.com/otp/code","status_image_max_edge","smb_upsell_business_profile_enabled","021","web_upgrade_to_md_modal","14","023","s_o","smaller_video_thumbs_status_enabled","media_max_autodownload","960","blocking_status","peer_msg","joinable_group_call_client_version","group_call_video_maximization_enabled","return_snapshot","high","America/Mexico_City","entry_point_block_logging_enabled","pop","024","1050","16","1380","one_tap_calling_in_group_chat_size","regular_low","inline_joinable_education_enabled","hq_image_max_edge","locked","America/Bogota","smb_biztools_deeplink_enabled","status_image_quality","1088","025","payments_upi_intent_transaction_limit","voip","w:g2","027","md_pin_chat_enabled","026","multi_scan_pjpeg_download_enabled","shops_product_grid","transaction_id","ctwa_context_enabled","20","fna","hq_image_quality","alt_jpeg_doc_detection_quality","group_call_max_participants","pkey","America/Belem","image_max_kbytes","web_cart_v1_1_order_message_changes_enabled","ctwa_context_enterprise_enabled","urn:xmpp:whatsapp:account","840","Asia/Kuala_Lumpur","max_participants","video_remux_after_repair_enabled","stella_addressbook_restriction_type","660","900","780","context_menu_ios13_enabled","mute-state","ref","payments_request_messages","029","frskmsg","vcard_max_size_kb","sample_buffer_gif_player_enabled","match_last_seen","510","4983","video_max_bitrate","028","w:comms:chat","17","frequently_forwarded_max","groups_privacy_blacklist","Asia/Karachi","02a","web_download_document_thumb_mms_enabled","02b","hist_sync","biz_block_reasons_version","1024","18","web_is_direct_connection_for_plm_transparent","view_once_write","file_max_size","paid_convo_id","online_privacy_setting","video_max_edge","view_once_read","enhanced_storage_management","multi_scan_pjpeg_encoding_enabled","ctwa_context_forward_enabled","video_transcode_downgrade_enable","template_doc_mime_types","hq_image_bw_threshold","30","body","u_aud_limit_sil_restarts_ctrl","other","participating","w:biz:directory","1110","vp8","4018","meta","doc_detection_image_max_edge","image_quality","1170","02c","smb_upsell_chat_banner_enabled","key_expiry_time_second","pid","stella_interop_enabled","19","linked_device_max_count","md_device_sync_enabled","02d","02e","360","enhanced_block_enabled","ephemeral_icon_in_forwarding","paid_convo_status","gif_provider","project_name","server-error","canonical_url_validation_enabled","wallpapers_v2","syncd_clear_chat_delete_chat_enabled","medianotify","02f","shops_required_tos_version","vote","reset_skey_on_id_change","030","image_max_edge","multicast_limit_global","ul_bw","21","25","5000","poll","570","22","031","1280","WhatsApp","032","bloks_shops_enabled","50","upload_host_switching_enabled","web_ctwa_context_compose_enabled","ptt_forwarded_features_enabled","unblocked","partial_pjpeg_enabled","fbid:devices","height","ephemeral_group_query_ts","group_join_permissions","order","033","alt_jpeg_status_quality","migrate","popular-bank","win_uwp_deprecation_killswitch_enabled","web_download_status_thumb_mms_enabled","blocking","url_text","035","web_forwarding_limit_to_groups","1600","val","1000","syncd_msg_date_enabled","bank-ref-id","max_subject","payments_web_enabled","web_upload_document_thumb_mms_enabled","size","request","ephemeral","24","receipt_agg","ptt_remember_play_position","sampling_weight","enc_rekey","mute_always","037","034","23","036","action","click_to_chat_qr_enabled","width","disabled","038","md_blocklist_v2","played_self_enabled","web_buttons_message_enabled","flow_id","clear","450","fbid:thread","bloks_session_state","America/Lima","attachment_picker_refresh","download_host_switching_enabled","1792","u_aud_limit_sil_restarts_test2","custom_urls","device_fanout","optimistic_upload","2000","key_cipher_suite","web_smb_upsell_in_biz_profile_enabled","e","039","siri_post_status_shortcut","pair-device","lg","lc","stream_attribution_url","model","mspjpeg_phash_gen","catalog_send_all","new_multi_vcards_ui","share_biz_vcard_enabled","-","clean","200","md_blocklist_v2_server","03b","03a","web_md_migration_experience","ptt_conversation_waveform","u_aud_limit_sil_restarts_test1"],["64","ptt_playback_speed_enabled","web_product_list_message_enabled","paid_convo_ts","27","manufacturer","psp-routing","grp_uii_cleanup","ptt_draft_enabled","03c","business_initiated","web_catalog_products_onoff","web_upload_link_thumb_mms_enabled","03e","mediaretry","35","hfm_string_changes","28","America/Fortaleza","max_keys","md_mhfs_days","streaming_upload_chunk_size","5541","040","03d","2675","03f","...","512","mute","48","041","alt_jpeg_quality","60","042","md_smb_quick_reply","5183","c","1343","40","1230","043","044","mms_cat_v1_forward_hot_override_enabled","user_notice","ptt_waveform_send","047","Asia/Calcutta","250","md_privacy_v2","31","29","128","md_messaging_enabled","046","crypto","690","045","enc_iv","75","failure","ptt_oot_playback","AIzaSyDR5yfaG7OG8sMTUj8kfQEb8T9pN8BM6Lk","w","048","2201","web_large_files_ui","Asia/Makassar","812","status_collapse_muted","1334","257","2HP4dm","049","patches","1290","43cY6T","America/Caracas","web_sticker_maker","campaign","ptt_pausable_enabled","33","42","attestation","biz","04b","query_linked","s","125","04a","810","availability","1411","responsiveness_v2_m1","catalog_not_created","34","America/Santiago","1465","enc_p","04d","status_info","04f","key_version","..","04c","04e","md_group_notification","1598","1215","web_cart_enabled","37","630","1920","2394","-1","vcard","38","elapsed","36","828","peer","pricing_category","1245","invalid","stella_ios_enabled","2687","45","1528","39","u_is_redial_audio_1104_ctrl","1025","1455","58","2524","2603","054","bsp_system_message_enabled","web_pip_redesign","051","verify_apps","1974","1272","1322","1755","052","70","050","1063","1135","1361","80","1096","1828","1851","1251","1921","key_config_id","1254","1566","1252","2525","critical_block","1669","max_available","w:auth:backup:token","product","2530","870","1022","participant_uuid","web_cart_on_off","1255","1432","1867","41","1415","1440","240","1204","1608","1690","1846","1483","1687","1749","69","url_number","053","1325","1040","365","59","Asia/Riyadh","1177","test_recommended","057","1612","43","1061","1518","1635","055","1034","1375","750","1430","event_code","1682","503","55","865","78","1309","1365","44","America/Guayaquil","535","LIMITED","1377","1613","1420","1599","1822","05a","1681","password","1111","1214","1376","1478","47","1082","4282","Europe/Istanbul","1307","46","058","1124","256","rate-overlimit","retail","u_a_socket_err_fix_succ_test","1292","1370","1388","520","861","psa","regular","1181","1766","05b","1183","1213","1304","1537"],["1724","profile_picture","1071","1314","1605","407","990","1710","746","pricing_model","056","059","061","1119","6027","65","877","1607","05d","917","seen","1516","49","470","973","1037","1350","1394","1480","1796","keys","794","1536","1594","2378","1333","1524","1825","116","309","52","808","827","909","495","1660","361","957","google","1357","1565","1967","996","1775","586","736","1052","1670","bank","177","1416","2194","2222","1454","1839","1275","53","997","1629","6028","smba","1378","1410","05c","1849","727","create","1559","536","1106","1310","1944","670","1297","1316","1762","en","1148","1295","1551","1853","1890","1208","1784","7200","05f","178","1283","1332","381","643","1056","1238","2024","2387","179","981","1547","1705","05e","290","903","1069","1285","2436","062","251","560","582","719","56","1700","2321","325","448","613","777","791","51","488","902","Asia/Almaty","is_hidden","1398","1527","1893","1999","2367","2642","237","busy","065","067","233","590","993","1511","54","723","860","363","487","522","605","995","1321","1691","1865","2447","2462","NON_TRANSACTIONAL","433","871","432","1004","1207","2032","2050","2379","2446","279","636","703","904","248","370","691","700","1068","1655","2334","060","063","364","533","534","567","1191","1210","1473","1827","069","701","2531","514","prev_dhash","064","496","790","1046","1139","1505","1521","1108","207","544","637","final","1173","1293","1694","1939","1951","1993","2353","2515","504","601","857","modify","spam_request","p_121_aa_1101_test4","866","1427","1502","1638","1744","2153","068","382","725","1704","1864","1990","2003","Asia/Dubai","508","531","1387","1474","1632","2307","2386","819","2014","066","387","1468","1706","2186","2261","471","728","1147","1372","1961"]],d$=["","xmlstreamstart","xmlstreamend","s.whatsapp.net","type","participant","from","receipt","id","notification","disappearing_mode","status","jid","broadcast","user","devices","device_hash","to","offline","message","result","class","xmlns","duration","notify","iq","t","ack","g.us","enc","urn:xmpp:whatsapp:push","presence","config_value","picture","verified_name","config_code","key-index-list","contact","mediatype","routing_info","edge_routing","get","read","urn:xmpp:ping","fallback_hostname","0","chatstate","business_hours_config","unavailable","download_buckets","skmsg","verified_level","composing","handshake","device-list","media","text","fallback_ip4","media_conn","device","creation","location","config","item","fallback_ip6","count","w:profile:picture","image","business","2","hostname","call-creator","display_name","relaylatency","platform","abprops","success","msg","offline_preview","prop","key-index","v","day_of_week","pkmsg","version","1","ping","w:p","download","video","set","specific_hours","props","primary","unknown","hash","commerce_experience","last","subscribe","max_buckets","call","profile","member_since_text","close_time","call-id","sticker","mode","participants","value","query","profile_options","open_time","code","list","host","ts","contacts","upload","lid","preview","update","usync","w:stats","delivery","auth_ttl","context","fail","cart_enabled","appdata","category","atn","direct_connection","decrypt-fail","relay_id","mmg-fallback.whatsapp.net","target","available","name","last_id","mmg.whatsapp.net","categories","401","is_new","index","tctoken","ip4","token_id","latency","recipient","edit","ip6","add","thumbnail-document","26","paused","true","identity","stream:error","key","sidelist","background","audio","3","thumbnail-image","biz-cover-photo","cat","gcm","thumbnail-video","error","auth","deny","serial","in","registration","thumbnail-link","remove","00","gif","thumbnail-gif","tag","capability","multicast","item-not-found","description","business_hours","config_expo_key","md-app-state","expiration","fallback","ttl","300","md-msg-hist","device_orientation","out","w:m","open_24h","side_list","token","inactive","01","document","te2","played","encrypt","msgr","hide","direct_path","12","state","not-authorized","url","terminate","signature","status-revoke-delay","02","te","linked_accounts","trusted_contact","timezone","ptt","kyc-id","privacy_token","readreceipts","appointment_only","address","expected_ts","privacy","7","android","interactive","device-identity","enabled","attribute_padding","1080","03","screen_height"],wL={};for(let[n,t]of d$.entries())wL[t]={index:n};for(let[n,t]of p$.entries())for(let[o,a]of t.entries())wL[a]={dict:n,index:o};var OA="@s.whatsapp.net";var h$="0@c.us";var Zt;(function(n){n[n.WHATSAPP=0]="WHATSAPP",n[n.LID=1]="LID",n[n.HOSTED=128]="HOSTED",n[n.HOSTED_LID=129]="HOSTED_LID"})(Zt||(Zt={}));var E$=(n,t)=>{switch(t){case Zt.LID:return"lid";case Zt.HOSTED:return"hosted";case Zt.HOSTED_LID:return"hosted.lid";case Zt.WHATSAPP:default:return n}},Dr=(n,t,o,a)=>`${n||""}${a?`_${a}`:""}${o?`:${o}`:""}@${t}`,hA=n=>{let t=typeof n=="string"?n.indexOf("@"):-1;if(t<0)return;let o=n.slice(t+1),a=n.slice(0,t),[e,i]=a.split(":"),[A,r]=e.split("_"),s=Zt.WHATSAPP;return o==="lid"?s=Zt.LID:o==="hosted"?s=Zt.HOSTED:o==="hosted.lid"?s=Zt.HOSTED_LID:r&&(s=parseInt(r)),{server:o,user:A,domainType:s,device:i?+i:void 0}},Dt=(n,t)=>hA(n)?.user===hA(t)?.user,Mh=n=>n?.endsWith("@bot"),Rt=n=>n?.endsWith("@s.whatsapp.net"),qA=n=>n?.endsWith("@lid"),HB=n=>n?.endsWith("@broadcast"),qr=n=>n?.endsWith("@g.us"),zg=n=>n==="status@broadcast",aI=n=>n?.endsWith("@newsletter"),Or=n=>n?.endsWith("@hosted"),Ci=n=>n?.endsWith("@hosted.lid"),Qxe=/^1313555\d{4}$|^131655500\d{2}$/,u$=n=>n&&Qxe.test(n.split("@")[0])&&n.endsWith("@c.us"),BA=n=>{let t=hA(n);if(!t)return"";let{user:o,server:a}=t;return Dr(o,a==="c.us"?"s.whatsapp.net":a)},C$=(n,t)=>{let a=hA(n)?.device||0,{server:e,user:i}=hA(t);return Dr(i,e,a)};var B$=(n,t=UB,o=[0])=>{let a=f$(n,t,o);return Buffer.from(a)},f$=({tag:n,attrs:t,content:o},a,e)=>{let{TAGS:i,TOKEN_MAP:A}=a,r=F=>e.push(F&255),s=(F,q,z=!1)=>{for(let K=0;K>G*8&255)}},g=F=>{for(let q of F)e.push(q)},c=F=>{g([F>>8&255,F&255])},I=F=>g([F>>16&15,F>>8&255,F&255]),p=F=>{if(F>=4294967296)throw new Error("string too large to encode: "+F);F>=1<<20?(r(i.BINARY_32),s(F,4)):F>=256?(r(i.BINARY_20),I(F)):(r(i.BINARY_8),r(F))},B=F=>{let q=Buffer.from(F,"utf-8");p(q.length),g(q)},f=({domainType:F,device:q,user:z,server:K})=>{typeof q<"u"?(r(i.AD_JID),r(F||0),r(q||0),R(z)):(r(i.JID_PAIR),z.length?R(z):r(i.LIST_EMPTY),R(K))},Q=F=>{switch(F){case"-":return 10;case".":return 11;case"\0":return 15;default:if(F>="0"&&F<="9")return F.charCodeAt(0)-48;throw new Error(`invalid byte for nibble "${F}"`)}},y=F=>{if(F>="0"&&F<="9")return F.charCodeAt(0)-48;if(F>="A"&&F<="F")return 10+F.charCodeAt(0)-65;if(F>="a"&&F<="f")return 10+F.charCodeAt(0)-97;if(F==="\0")return 15;throw new Error(`Invalid hex char "${F}"`)},m=(F,q)=>{if(F.length>i.PACKED_MAX)throw new Error("Too many bytes to pack");r(q==="nibble"?i.NIBBLE_8:i.HEX_8);let z=Math.ceil(F.length/2);F.length%2!==0&&(z|=128),r(z);let K=q==="nibble"?Q:y,G=(H,N)=>K(H)<<4|K(N),V=Math.floor(F.length/2);for(let H=0;H{if(!F||F.length>i.PACKED_MAX)return!1;for(let q of F)if(!(q>="0"&&q<="9")&&q!=="-"&&q!==".")return!1;return!0},_=F=>{if(!F||F.length>i.PACKED_MAX)return!1;for(let q of F)if(!(q>="0"&&q<="9")&&!(q>="A"&&q<="F"))return!1;return!0},R=F=>{if(F==null){r(i.LIST_EMPTY);return}if(F===""){B(F);return}let q=A[F];if(q)typeof q.dict=="number"&&r(i.DICTIONARY_0+q.dict),r(q.index);else if(T(F))m(F,"nibble");else if(_(F))m(F,"hex");else{let z=hA(F);z?f(z):B(F)}},L=F=>{F===0?r(i.LIST_EMPTY):F<256?g([i.LIST_8,F]):(r(i.LIST_16),c(F))};if(!n)throw new Error("Invalid node: tag cannot be undefined");let U=Object.keys(t||{}).filter(F=>typeof t[F]<"u"&&t[F]!==null);L(2*U.length+1+(typeof o<"u"?1:0)),R(n);for(let F of U)typeof t[F]=="string"&&(R(F),R(t[F]));if(typeof o=="string")R(o);else if(Buffer.isBuffer(o)||o instanceof Uint8Array)p(o.length),g(o);else if(Array.isArray(o)){let F=o.filter(q=>q&&(q.tag||Buffer.isBuffer(q)||q instanceof Uint8Array||typeof q=="string"));L(F.length);for(let q of F)f$(q,a,e)}else if(!(typeof o>"u"))throw new Error(`invalid children for header "${n}": ${o} (${typeof o})`);return e};import{promisify as yxe}from"util";import{inflate as mxe}from"zlib";var Sxe=yxe(mxe),wxe=async n=>(2&n.readUInt8()?n=await Sxe(n.slice(1)):n=n.slice(1),n),Q$=(n,t,o={index:0})=>{let{DOUBLE_BYTE_TOKENS:a,SINGLE_BYTE_TOKENS:e,TAGS:i}=t,A=k=>{if(o.index+k>n.length)throw new Error("end of stream")},r=()=>{let k=n[o.index];return o.index+=1,k},s=()=>(A(1),r()),g=k=>{A(k);let J=n.slice(o.index,o.index+k);return o.index+=k,J},c=k=>g(k).toString("utf-8"),I=(k,J=!1)=>{A(k);let X=0;for(let ie=0;ie(A(3),((r()&15)<<16)+(r()<<8)+r()),B=k=>{if(k>=0&&k<16)return k<10?48+k:65+k-10;throw new Error("invalid hex: "+k)},f=k=>{if(k>=0&&k<=9)return 48+k;switch(k){case 10:return 45;case 11:return 46;case 15:return 0;default:throw new Error("invalid nibble: "+k)}},Q=(k,J)=>{if(k===i.NIBBLE_8)return f(J);if(k===i.HEX_8)return B(J);throw new Error("unknown tag: "+k)},y=k=>{let J=s(),X="";for(let ie=0;ie<(J&127);ie++){let De=s();X+=String.fromCharCode(Q(k,(De&240)>>4)),X+=String.fromCharCode(Q(k,De&15))}return J>>7!==0&&(X=X.slice(0,-1)),X},m=k=>k===i.LIST_EMPTY||k===i.LIST_8||k===i.LIST_16,T=k=>{switch(k){case i.LIST_EMPTY:return 0;case i.LIST_8:return s();case i.LIST_16:return I(2);default:throw new Error("invalid tag for list size: "+k)}},_=()=>{let k=F(s()),J=F(s());if(J)return(k||"")+"@"+J;throw new Error("invalid jid pair: "+k+", "+J)},R=()=>{let k=s(),J=Number(k),X=s(),ie=F(s()),De="s.whatsapp.net";return J===Zt.LID?De="lid":J===Zt.HOSTED?De="hosted":J===Zt.HOSTED_LID&&(De="hosted.lid"),Dr(ie,De,X)},L=()=>{let k=F(s()),J=I(2),X=F(s());return`${k}:${J}@${X}`},U=()=>{let k=F(s()),J=I(2),X=I(2),ie="interop",De=o.index;try{ie=F(s())}catch{o.index=De}return`${X}-${k}:${J}@${ie}`},F=k=>{if(k>=1&&k{let J=[],X=T(k);for(let ie=0;ie{let X=a[k];if(!X)throw new Error(`Invalid double token dict (${k})`);let ie=X[J];if(typeof ie>"u")throw new Error(`Invalid double token (${J})`);return ie},K=T(s()),G=F(s());if(!K||!G.length)throw new Error("invalid node");let V={},H;if(K===0||!G)throw new Error("invalid node");let N=K-1>>1;for(let k=0;k{let t=await wxe(n);return Q$(t,UB)};var S$=ze(Jr(),1);var m$=new WeakMap,PA=(n,t)=>{if(!n||!Array.isArray(n.content))return[];let o=m$.get(n);if(!o){o=new Map;for(let a of n.content){let e=o.get(a.tag);e||o.set(a.tag,e=[]),e.push(a)}m$.set(n,o)}return o.get(t)||[]},le=(n,t)=>PA(n,t)[0],Gs=({content:n})=>Array.isArray(n)?n:[],ki=(n,t)=>{let o=le(n,t)?.content;if(Buffer.isBuffer(o)||o instanceof Uint8Array)return o},jA=(n,t)=>{let o=le(n,t)?.content;if(Buffer.isBuffer(o)||o instanceof Uint8Array)return Buffer.from(o).toString("utf-8");if(typeof o=="string")return o},oI=(n,t,o)=>{let a=ki(n,t);if(a)return Dxe(a,o)},Za=n=>{let t=le(n,"error");if(t)throw new S$.Boom(t.attrs.text||"Unknown error",{data:+t.attrs.code})},DL=(n,t)=>PA(n,t).reduce((e,{attrs:i})=>(typeof i.name=="string"?e[i.name]=i.value||i.config_value:e[i.config_code]=i.value||i.config_value,e),{});function Dxe(n,t){let o=0;for(let a=0;a" ".repeat(n);function Jn(n,t=0){if(!n)return n;if(typeof n=="string")return ND(t)+n;if(n instanceof Uint8Array)return ND(t)+Buffer.from(n).toString("hex");if(Array.isArray(n))return n.map(i=>ND(t+1)+Jn(i,t+1)).join(` +${B}`:ut(m),s,g),I||await this.#o.markSeen(A)}catch(T){this.#s.error?.("[dsh-weixin] failed to send the safe error reply:",T)}}}async#K(t,o,a,e){this.#n?.throwIfAborted();let i=this.#d.get(a),A=e.claimedReplyMessageId===o;if(!i||i!==e||i.submitting)return A&&(!i||i!==e)?this.#L(t,o):this.#T(t,o,a,{releaseMessageId:!1});if(this.#o.hasSeen(o))return;await this.#o.markSeen(o),this.#a.messagesReceived+=1,this.#a.lastMessageAt=new Date().toISOString();let r=ir(Ul(t)),s=ir(t?.context_token)??void 0,g=ir(t?.run_id)??void 0;if(!r||wB(t)){await this.#H(e.actor,w("\u8BF7\u7528\u6587\u5B57\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u3002"),s,g);return}let c=this.#d.get(a);if(!c||c!==e||c.submitting){if(A&&(!c||c!==e)){await this.#H(e.actor,Xw(),s,g);return}return this.#T(t,o,a,{releaseMessageId:!1,alreadyRecorded:!0})}if(c.contextToken=s,c.runId=g,c.needsPresentation){try{await this.#F(c)}catch{this.#a.lastError=w("\u5FAE\u4FE1\u4EA4\u4E92\u95EE\u9898\u53D1\u9001\u5931\u8D25\u3002"),this.#s.error?.("[dsh-weixin] failed to retry an interaction question"),c.interaction.reconnect?.();return}let p=this.#d.get(a);if(!p||p!==e||p.submitting){if(A&&(!p||p!==e)){await this.#H(e.actor,Xw(),s,g).catch(()=>{});return}return this.#T(t,o,a,{releaseMessageId:!1,alreadyRecorded:!0})}}let I=c.questions[c.index];if(I){if(c.answers.push(Ma(I,r)),c.index+=1,c.index{});return}if(this.#d.get(a)!==c)return;c.submitting=!1,c.answers.pop(),c.index-=1,this.#a.lastError=w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\u3002"),this.#s.error?.("[dsh-weixin] failed to answer a Harness interaction"),await this.#H(c.actor,w("\u56DE\u7B54\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u5F53\u524D\u95EE\u9898\u7684\u7B54\u6848\u3002"),c.contextToken,c.runId).catch(()=>{})}}}async#J(t,{key:o,actor:a,contextToken:e,runId:i}){if(t?.kind==="approval")return this.#m.handleRequested(t,{key:o,actor:a,send:c=>this.#H(a,c,e,i)});if(t?.kind!=="question")return;let A=t?.payload?.questions,r=typeof t?.interactionId=="string"?t.interactionId:t?.rpcId;if(typeof t?.rpcId!="string"||typeof r!="string"||typeof t.sessionId!="string"||!Array.isArray(A)||A.length===0||A.some(c=>!ba(c))){this.#s.warn?.("[dsh-weixin] ignored an invalid Harness question interaction");return}if(t.recovered===!0){await t.respond({ok:!1,error:{code:"cancelled",message:"Weixin safely cancelled an interaction left by an earlier client.",details:{}}}),await this.#H(a,w("\u68C0\u6D4B\u5230\u8FD9\u4E2A Session \u4E2D\u9057\u7559\u7684\u5F85\u56DE\u7B54\u95EE\u9898\uFF0C\u5DF2\u5B89\u5168\u53D6\u6D88\u5E76\u7EE7\u7EED\u5904\u7406\u4F60\u521A\u624D\u7684\u6D88\u606F\u3002"),e,i).catch(()=>{});return}let s=this.#d.get(o);if(s?.interactionId===r){s.interaction=t,s.needsPresentation&&await this.#F(s);return}if(this.#C.has(r))return;if(s){await t.respond({ok:!1,error:{code:"cancelled",message:"Weixin is already handling another user interaction.",details:{}}});return}let g={kind:"question",interactionId:r,sessionId:t.sessionId,interaction:t,actor:a,questions:A,answers:[],index:0,contextToken:e,runId:i,queue:null,claimedReplyMessageId:null,presentationPromise:null,submitting:!1,needsPresentation:!0};this.#d.set(o,g),this.#C.set(r,o),await this.#F(g)}async#U(t){if(t?.kind==="approval"){await this.#m.handleResolved(t);return}let o=t?.interactionId;if(t?.kind!=="question"||typeof o!="string")return;let a=this.#C.get(o);a&&this.#q(a,o)}#F(t){if(!t.needsPresentation)return Promise.resolve();if(t.presentationPromise)return t.presentationPromise;let o=t.questions[t.index];if(!o)return Promise.resolve();let a=this.#H(t.actor,Ia(o,t.index,t.questions.length),t.contextToken,t.runId).then(()=>{t.needsPresentation=!1}).finally(()=>{t.presentationPromise===a&&(t.presentationPromise=null)});return t.presentationPromise=a,a}async#L(t,o){this.#o.hasSeen(o)||(await this.#o.markSeen(o),this.#a.messagesReceived+=1,this.#a.lastMessageAt=new Date().toISOString(),await this.#H(ir(t?.from_user_id),Xw(),ir(t?.context_token)??void 0,ir(t?.run_id)??void 0).catch(()=>{}))}#V(t,o){let a=this.#d.get(t);return!a||o!==void 0&&a.interactionId!==o?null:(this.#d.delete(t),this.#C.delete(a.interactionId),a)}#q(t,o){return this.#V(t,o)!==null}async#v(t){let o=this.#V(t);if(!(!o||o.kind!=="question"))try{await o.interaction.respond({ok:!1,error:{code:"cancelled",message:"The Weixin interaction ended before the user answered.",details:{}}},{signal:AbortSignal.timeout(5e3)})}catch(a){a?.code!=="interaction-not-pending"&&this.#s.warn?.("[dsh-weixin] failed to cancel a pending Harness interaction")}}async#W(t,o,a){if(this.#n?.aborted)return;this.#a.lastError=a?.message??String(a);let e=rt(this.#a,a);this.#s.error?.(`[dsh-weixin] failed to process an interaction reply [${e.referenceId}]:`,a),this.#o.hasSeen(o)||await this.#o.markSeen(o).catch(()=>{}),await this.#H(ir(t?.from_user_id),ut(e),ir(t?.context_token)??void 0,ir(t?.run_id)??void 0).catch(()=>{})}async#H(t,o,a,e){await this.#$();let i=[],A=iX(o,this.#g);for(let r=0;r{}).then(t);return this.#k=o.catch(()=>{}),o}async#ie(t,o){let a=ir(t);if(!a||this.#M||this.#n?.aborted||Date.now(){if(e!==this.#E||this.#M)return!1;let i=this.#Q;if(!i){let A=await this.#e.getConfig({baseUrl:this.#A,token:this.#t,toUserId:a,contextToken:o,signal:this.#n});if(i=ir(A?.typingTicket),!i)return this.#D=Date.now()+FF,!1;if(e!==this.#E||this.#M)return!1;this.#Q=i,this.#D=0}return this.#y=a,await this.#e.sendTyping({baseUrl:this.#A,token:this.#t,toUserId:a,typingTicket:i,status:1,signal:this.#n}),e!==this.#E||this.#M?!1:(this.#S=!1,this.#D=0,this.#j(e),!0)})}catch(i){return e===this.#E&&(this.#Ae(),this.#S=!!(this.#y&&this.#Q),this.#D=Date.now()+FF),!this.#n?.aborted&&!this.#M&&this.#s.warn?.("[dsh-weixin] typing indicator failed:",i),!1}}async#$({signal:t=AbortSignal.timeout(5e3)}={}){++this.#E,this.#Ae();let o=this.#y,a=this.#Q,e=this.#S;if(this.#y=null,typeof this.#e.sendTyping!="function")return!1;try{return await this.#X(async()=>{if(!o||!a)return!1;try{await this.#e.sendTyping({baseUrl:this.#A,token:this.#t,toUserId:o,typingTicket:a,status:2,signal:t})}finally{e&&this.#Q===a&&(this.#Q=null),this.#S=!1}return!0})}catch(i){return t?.aborted||this.#s.warn?.("[dsh-weixin] typing cancellation failed:",i),!1}}#j(t){if(this.#Ae(),t!==this.#E||!this.#y||this.#M)return;let o=setTimeout(()=>{this.#b===o&&(this.#b=null),this.#X(async()=>t!==this.#E||!this.#y||this.#M?!1:(await this.#e.sendTyping({baseUrl:this.#A,token:this.#t,toUserId:this.#y,typingTicket:this.#Q,status:1,signal:this.#n}),!0)).then(a=>{a&&this.#j(t)}).catch(a=>{t===this.#E&&(this.#S=!!(this.#y&&this.#Q),this.#D=Date.now()+FF,!this.#n?.aborted&&!this.#M&&this.#s.warn?.("[dsh-weixin] typing keepalive failed:",a))})},this.#l);o.unref?.(),this.#b=o}#Ae(){this.#b&&clearTimeout(this.#b),this.#b=null}#Y(t,o,a){return this.#d.has(t)||this.#m.hasPending(t)?Promise.resolve(!1):this.#ie(o,a)}async#te(t,o,a,e,i,A){let r=(g,c)=>this.#e[g]({baseUrl:this.#A,token:this.#t,toUserId:t,file:c,contextToken:e,runId:i,signal:this.#n}),s=await Lo({artifacts:a,baseReceipt:A,deliveryId:o,aggregatePresentation:A?"weixin-text-and-files":"weixin-files",channelKey:"weixin",signal:this.#n,sendImage:typeof this.#e.sendImage=="function"?g=>r("sendImage",g):void 0,sendFile:typeof this.#e.sendFile=="function"?g=>r("sendFile",g):void 0,onFailure:(g,c)=>rt(this.#a,c,{userMessage:HHe(g?.fileName,c),reason:c?.code}),sendFailureNotice:(g,c,I)=>this.#H(t,ut(I),e,i),logger:this.#s});return this.#a.artifactsSent=(this.#a.artifactsSent??0)+s.artifactsSent,this.#a.artifactSendErrors=(this.#a.artifactSendErrors??0)+s.artifactSendErrors,{receipt:s.receipt,userVisible:s.userVisible,artifactSendErrors:s.artifactSendErrors}}};var KHe=Object.freeze([250,1e3,3e3]),xHe=new Set(["harness-connect-failed","harness-timeout","harness-auth-required","harness-proxy-auth-required","harness-loopback-forbidden","harness-host-untrusted","harness-request-forbidden","harness-api-not-found","harness-http-failed","harness-response-invalid","harness-rpc-rejected"]);function YHe(n){if(n===void 0)return[...KHe];if(!Array.isArray(n))throw new TypeError("startRetryDelaysMs must be an array");return n.map(t=>{if(!Number.isFinite(t)||t<0)throw new TypeError("startRetryDelaysMs must contain non-negative delays");return t})}function jHe(n){return n instanceof NA?n.code==="network-error"||n.code==="timeout"?!0:n.code==="http-error"&&(n.status===408||n.status===425||n.status===429||n.status>=500):!1}function JHe(n,t){let o=new Error(`Weixin runtime failed during ${n}`,{cause:t});return o.name="WeixinRuntimeStartError",o.code=n,o}function qHe(n){let t=xHe.has(n?.code)?n.code:"harness-check-unknown-failed";return JHe(t,n)}function uX(n,t){return new Promise((o,a)=>{if(t?.aborted){a(t.reason??new DOMException("Aborted","AbortError"));return}let i=setTimeout(()=>{t?.removeEventListener("abort",A),o()},n),A=()=>{clearTimeout(i),t?.removeEventListener("abort",A),a(t.reason??new DOMException("Aborted","AbortError"))};t?.addEventListener("abort",A,{once:!0})})}function zHe(n){if(!Array.isArray(n)||n.length<2)return Array.isArray(n)?n:[];let t=["seq","create_time_ms"].find(o=>n.every(a=>typeof a?.[o]=="number"&&Number.isFinite(a[o])||typeof a?.[o]=="string"&&a[o].trim()&&Number.isFinite(Number(a[o]))));return t?n.map((o,a)=>({message:o,index:a,order:Number(o[t])})).sort((o,a)=>o.order-a.order||o.index-a.index).map(({message:o})=>o):n}function VHe(){return{startedAt:null,ready:!1,weixinConnectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastError:null,...LF()}}var bB=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g=VHe();#l=null;#n=null;#h=null;#d=null;constructor({api:t,config:o,token:a,harness:e,state:i,contextEnhancement:A,accessPolicy:r,logger:s=console,replyTimeoutMs:g=6e5,maxMessageChars:c=Ll,startRetryDelaysMs:I}){if(!t||!o||!a||!e||!i)throw new TypeError("WeixinRuntime requires API, account, token, Harness, and state");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g,this.#s=c,this.#p=YHe(I)}get status(){return structuredClone(this.#g)}async start(){return this.#g.ready&&this.#h?this.status:this.#d?this.#d:(this.#d=this.#C().finally(()=>{this.#d=null}),this.#d)}async#C(){await this.stop(),this.#g.startedAt=new Date().toISOString(),this.#g.weixinConnectionState="connecting",this.#g.lastError=null;try{try{await this.#r.ensureRunning()}catch(o){throw qHe(o)}this.#g.harnessReachable=!0,await this.#u(),this.#n=new AbortController;let t=this.#n.signal;return this.#l=new $w({api:this.#e,baseUrl:this.#A.baseUrl,token:this.#t,ownerUserId:this.#A.ownerUserId,harness:this.#r,state:this.#I,contextEnhancement:this.#o,accessPolicy:this.#c,status:this.#g,logger:this.#i,replyTimeoutMs:this.#a,maxMessageChars:this.#s,signal:t}),this.#g.ready=!0,this.#g.weixinConnectionState="connected",this.#g.lastCheckedAt=Date.now(),this.#h=this.#B(t).catch(o=>{t.aborted||(this.#g.ready=!1,this.#g.weixinConnectionState="failed",this.#g.lastError=o?.message??String(o),this.#i.error?.(`[dsh-weixin] account ${this.#A.botId} monitor stopped:`,o))}),this.status}catch(t){throw this.#n?.abort(),this.#n=null,this.#l=null,this.#g.ready=!1,this.#g.weixinConnectionState="failed",this.#g.lastError=t?.message??String(t),t}}async#u(){for(let t=0;;t+=1)try{return await this.#e.notifyStart({baseUrl:this.#A.baseUrl,token:this.#t})}catch(o){let a=this.#p[t];if(a===void 0||!jHe(o))throw o;this.#i.warn?.(`[dsh-weixin] account ${this.#A.botId} start request failed; retrying in ${a}ms:`,o),await uX(a)}}async#B(t){let o=0;for(;!t.aborted;)try{let a=await this.#e.getUpdates({baseUrl:this.#A.baseUrl,token:this.#t,getUpdatesBuf:this.#I.getUpdatesBuf(),signal:t});if(t.aborted)return;if(a?.ret!==void 0&&a.ret!==0||a?.errcode!==void 0&&a.errcode!==0){let i=a.errcode??a.ret;throw new NA(i===-14?"stale-token":"updates-rejected",i===-14?w("\u5FAE\u4FE1\u767B\u5F55\u51ED\u636E\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u8D26\u53F7\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("\u5FAE\u4FE1\u6D88\u606F\u540C\u6B65\u8BF7\u6C42\u88AB\u62D2\u7EDD\u3002"))}o=0,this.#g.ready=!0,this.#g.weixinConnectionState="connected",this.#g.lastCheckedAt=Date.now(),this.#g.lastError=null;for(let i of zHe(a?.msgs))this.#l.accept(i).catch(A=>{t.aborted||this.#i.error?.(`[dsh-weixin] account ${this.#A.botId} message handling failed:`,A)});typeof a?.get_updates_buf=="string"&&a.get_updates_buf&&await this.#I.setGetUpdatesBuf(a.get_updates_buf)}catch(a){if(t.aborted)return;if(o+=1,this.#g.lastError=a?.message??String(a),this.#i.warn?.(`[dsh-weixin] account ${this.#A.botId} poll failed (${o}/3):`,a),a instanceof NA&&a.code==="stale-token"||o>=3)throw a;await uX(Math.min(2e3*2**(o-1),1e4),t)}}async stop(){let t=this.#h,o=this.#l,a=!!(this.#n||t||this.#g.ready);if(this.#n?.abort(),this.#n=null,this.#h=null,await o?.close?.(),await t?.catch(()=>{}),await o?.waitForIdle(),this.#l=null,a)try{await this.#e.notifyStop({baseUrl:this.#A.baseUrl,token:this.#t,signal:AbortSignal.timeout(1e4)})}catch(e){this.#i.warn?.(`[dsh-weixin] account ${this.#A.botId} stop notification failed:`,e)}return this.#g.ready=!1,this.#g.weixinConnectionState="idle",this.status}async sendConnectionTest(t){let o=ZE(this.#I),a=typeof o?.toUserId=="string"&&o.toUserId.trim()?o.toUserId.trim():typeof this.#A.ownerUserId=="string"&&this.#A.ownerUserId.trim()?this.#A.ownerUserId.trim():null;if(!a)throw Qr(w("\u5FAE\u4FE1\u673A\u5668\u4EBA"));if(!this.#g.ready||!this.#n)throw new Error("Weixin runtime is not connected");return await this.#f({toUserId:a,text:t,signal:this.#n.signal}),{sent:!0}}async#f({toUserId:t,text:o,signal:a}){let e=Date.now(),i=await this.#e.sendText({baseUrl:this.#A.baseUrl,token:this.#t,toUserId:t,text:o,signal:a});try{await this.#I.rememberOutboundMessage?.({toUserId:t,text:o,sentAt:e,completedAt:Date.now(),providerMessageIds:Ur(i)})}catch(A){this.#i.warn?.("[dsh-weixin] failed to remember an outbound message:",A)}return i}async sendProactiveText(t,o,{signal:a}={}){let e=typeof t?.route?.toUserId=="string"?t.route.toUserId.trim():"";if(t?.kind!=="user"||!e){let i=new TypeError("Invalid Weixin proactive delivery target");throw i.code="invalid-target",i}if(!this.#g.ready||!this.#n){let i=new Error("Weixin runtime is not connected");throw i.code="bot-not-connected",i}return a?.throwIfAborted(),await this.#f({toUserId:e,text:o,signal:a??this.#n.signal}),{sent:!0}}};var CX=Object.freeze([250,1e3,3e3,5e3,1e4,3e4]);function WHe(n){if(!Array.isArray(n)||n.length===0)return[...CX];let t=n.filter(o=>Number.isFinite(o)&&o>=0);return t.length>0?t:[...CX]}var eD=class{#e;#A;#t;#r;#I;#o;#c;#i=null;#a=null;#s=0;#p=!1;#g=!1;#l;#n;constructor({controller:t,harness:o,logger:a=console,retryDelaysMs:e,healthyIntervalMs:i=15e3,setTimeoutImpl:A=setTimeout,clearTimeoutImpl:r=clearTimeout}){if(!t||typeof t.initialize!="function"||typeof t.status!="function")throw new TypeError("ConnectionSupervisor requires a controller");if(!o||typeof o.ensureRunning!="function")throw new TypeError("ConnectionSupervisor requires a Harness client");this.#e=t,this.#A=o,this.#t=a,this.#r=WHe(e),this.#I=Number.isFinite(i)&&i>=0?i:15e3,this.#o=A,this.#c=r,this.#l=new Promise(s=>{this.#n=s})}get ready(){return this.#l}start(){return this.#g||this.#p?this:(this.#g=!0,this.#h(0),this)}async close(){this.#p||(this.#p=!0,this.#i!==null&&this.#c(this.#i),this.#i=null,await this.#a?.catch(()=>{}),this.#n?.(null),this.#n=null)}#h(t){this.#p||(this.#i=this.#o(()=>{this.#i=null,this.#d()},t),this.#i?.unref?.())}async#d(){if(this.#p||this.#a)return;let t=this.#C();this.#a=t;try{await t}finally{this.#a===t&&(this.#a=null)}}async#C(){try{if(await this.#A.ensureRunning(),this.#p)return;let t=await this.#e.initialize();if(this.#p)return;this.#n?.(t),this.#n=null;let{configured:o,connected:a}=t.totals;if(axi(n),B=$He(t),f=await new e(B.config).load(),Q=Hl(t.workspace??process.cwd()),y=o.WorkspaceStore??ni,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(k=>k.botId)),await Promise.all(T.map(k=>m.ensure(k.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("weixin",k)})));let _=typeof f.remove=="function"?Yi(f,{workspaces:m}):f,R=new Map,L=k=>Hl(B.accounts,k,"state.json"),U=async k=>{let J=R.get(k);return J||(J=await new i(L(k)).load(),R.set(k,J)),J},F=zi(n,o.commandExecutor),{controlExecutor:q,sessionMaintenanceExecutor:z,fileIngressExecutor:K}=Vi(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),G=new A({...a,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...F?{commandExecutor:F}:{},...q?{controlExecutor:q}:{},...z?{sessionMaintenanceExecutor:z}:{},...K?{fileIngressExecutor:K}:{}}),V=new r({api:g,credentials:n.credentials,configStore:_,logger:I,createRuntime:async({botId:k,config:J,token:X})=>{let ie=await U(k);await m.ensure(k,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("weixin",J)});let De=ji(G,{botId:k,workspaces:m,state:ie,agentPresetCatalog:p});return new s({api:g,config:J,token:X,harness:De.harness,state:De.state,contextEnhancement:{botId:k,getSettings:()=>m.contextEnhancementFor(k)},accessPolicy:Wi(m,k,{channel:"weixin",config:J}),groupSessionScope:{getScope:()=>m.groupSessionScopeFor(k)},replyTimeoutMs:t.replyTimeoutMs??6e5,maxMessageChars:t.maxMessageChars??Ll,logger:{error:(...oe)=>I.error?.(`[${k}]`,...oe),warn:(...oe)=>I.warn?.(`[${k}]`,...oe),info:(...oe)=>I.info?.(`[${k}]`,...oe),debug:(...oe)=>I.debug?.(`[${k}]`,...oe)}})},deleteState:async({botId:k})=>{let J=R.get(k);if(R.delete(k),J&&typeof J.remove=="function")await J.remove();else try{await ZHe(L(k))}catch(X){if(X?.code!=="ENOENT")throw X}}}),H=Ji(V,{workspaces:m,stateFor:U,agentPresetCatalog:p}),N=c({controller:H,harness:G,logger:I,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:H,deliveryAdapter:qi({channel:"weixin",workspaces:m,coreController:V,stateFor:U}),ready:N.ready,async close(){await N.close(),await H.close(),G.stopManagedProcess()}}}import eKe from"qrcode";var BX="/weixin",Wt=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",submitVerification:"provision.verify",cancelProvisioning:"provision.cancel",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setWorkspace:La,setAgentPreset:Ua,setContextEnhancement:Fa,setAccessPolicy:Xi,setGroupSessionScope:ea}),fX=Object.freeze(Object.values(Wt));function QX(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function Bh(n,t){return QX(n)&&Object.keys(n).every(o=>t.includes(o))}function AD(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function AKe(n,t){return QX(t)?n===Wt.status?Bh(t,[])?null:"connection.status does not accept fields.":n===Wt.beginProvisioning?Bh(t,["locale"])&&(t.locale===void 0||t.locale==="zh-CN")?null:"provision.begin received unsupported fields.":[Wt.pollProvisioning,Wt.cancelProvisioning].includes(n)?Bh(t,["attemptId"])&&AD(t.attemptId)?null:`${n} requires an attemptId.`:n===Wt.submitVerification?Bh(t,["attemptId","verifyCode"])&&AD(t.attemptId)&&typeof t.verifyCode=="string"&&/^\d{4,8}$/.test(t.verifyCode)?null:"provision.verify requires an attemptId and a 4-to-8-digit code.":n===Wt.reconnectBot?Bh(t,["botId","sendTest"])&&AD(t.botId)&&(t.sendTest===void 0||t.sendTest===!0)?null:"bot.reconnect requires a botId and optional sendTest=true.":n===Wt.deleteBot?Bh(t,["botId","confirm"])&&AD(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Wt.setWorkspace?ta(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Wt.setAgentPreset?ia(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Wt.setContextEnhancement?Zi(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":n===Wt.setAccessPolicy?$i(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===Wt.setGroupSessionScope?Aa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u7FA4\u4F1A\u8BDD\u7B56\u7565\u3002":"Unknown Weixin endpoint.":"Payload must be an object."}function tD(n){return{ok:!1,error:{code:"bad-request",message:n}}}function _B(){return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}}function tKe(){return{ok:!1,error:{code:"weixin-operation-failed",message:"\u5FAE\u4FE1\u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}async function rKe(n){return eKe.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function rD(n,t){return!n||!n.verificationUrl?n:{...n,qrCodeDataUrl:await t(n.verificationUrl)}}async function zc(n,t){let o=structuredClone(n);return o.provisioning&&(o.provisioning=await rD(o.provisioning,t)),o}function iKe(n){if(!n||typeof n.status!="function"||typeof n.startProvisioning!="function"||typeof n.registrationStatus!="function"||typeof n.submitVerification!="function"||typeof n.cancelProvisioning!="function"||typeof n.reconnectBot!="function"||typeof n.deleteBot!="function")throw new TypeError("A complete Weixin controller is required")}function yX(n,{encodeQr:t=rKe}={}){iKe(n);let o=new Map,a=e=>{let i=o.get(e);return i||(o.size>=16&&o.delete(o.keys().next().value),i=Promise.resolve().then(()=>t(e)),o.set(e,i)),i};return async(e,i,A)=>{if(A?.aborted)return _B();if(!fX.includes(e))return tD("Unknown Weixin endpoint.");let r=AKe(e,i);if(r)return tD(r);try{let s;if(e===Wt.status)s=await zc(await n.status(),a);else if(e===Wt.beginProvisioning){let g=await n.startProvisioning();if(A?.aborted)return await n.cancelProvisioning(g.attemptId),_B();s=await rD(g,a)}else if(e===Wt.pollProvisioning){let g=await n.registrationStatus(i.attemptId);if(!g)return tD("The provisioning attempt no longer exists.");s=await rD(g,a)}else if(e===Wt.submitVerification)s=await rD(await n.submitVerification(i.attemptId,i.verifyCode),a);else if(e===Wt.cancelProvisioning){if(s=await n.cancelProvisioning(i.attemptId),!s)return tD("The provisioning attempt no longer exists.")}else if(e===Wt.reconnectBot){let g=await n.reconnectBot(i.botId);if(A?.aborted)return _B();let c;if(i.sendTest===!0)if(!g?.bots?.some(p=>p?.botId===i.botId&&p?.connected===!0)||typeof n.sendConnectionTest!="function")c=lr(Qr("\u5FAE\u4FE1\u673A\u5668\u4EBA"));else try{await n.sendConnectionTest(i.botId),c=lr()}catch(p){c=lr(p)}s=await zc({...g,...c?{testMessage:c}:{}},a)}else if(e===Wt.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await zc(await n.updateWorkspace(i.botId,i.workspace),a)}else if(e===Wt.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(i.botId,i.config,g=>zc(g,a))}else if(e===Wt.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(i.botId,i.policy,g=>zc(g,a))}else if(e===Wt.setGroupSessionScope){if(typeof n.updateGroupSessionScope!="function")throw new Error("Group session scope update is unavailable");s=await n.updateGroupSessionScope(i.botId,i.groupSessionScope,g=>zc(g,a))}else if(e===Wt.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await zc(await n.updateAgentPreset(i.botId,i.agentPreset),a)}else s=await zc(await n.deleteBot(i.botId),a);return A?.aborted?_B():{ok:!0,value:s}}catch(s){let g=ra(s);return A?.aborted?_B():g?{ok:!1,error:g}:tKe()}}}function iD(n,t,o,a){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(BX,yX(t,o),{authority:mr(a)})}async function mX(n,t={}){if(t?.controller)return iD(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await HF(n,t,t.internals),a=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=iD(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await a?.(),await o.close()},"dsh-weixin: close account connections"),e}import{rm as u7e,unlink as C7e}from"node:fs/promises";import{homedir as B7e}from"node:os";import{join as jE,resolve as dc}from"node:path";import{createHash as aKe}from"node:crypto";import{mkdir as oKe,readFile as nKe,rename as sKe,unlink as gKe,writeFile as cKe}from"node:fs/promises";import{dirname as IKe}from"node:path";var KF=Object.freeze({version:2,bots:Object.freeze([])}),SX=/^whatsapp_[a-f0-9]{24}$/,lKe=/^[a-f0-9-]{36}$/,pKe=/^[1-9]\d{4,14}$/,xF=Object.freeze({selfOnly:"self-only",privateAllowlist:"private-allowlist",open:"open"});function fh(n){return typeof n=="string"&&n.trim()?n.trim():null}function aD(n){let t=fh(n)?.toLowerCase();return/^\d{5,32}@(s\.whatsapp\.net|lid)$/.test(t??"")?t:null}function YF(n){let t=aD(n);if(!t)throw new TypeError("A valid WhatsApp account JID is required");return`whatsapp_${aKe("sha256").update(t).digest("hex").slice(0,24)}`}function jF(n){let t=aD(n)?.split("@")[0]??"";return t?t.length<=7?`${t.slice(0,2)}\u2022\u2022\u2022${t.slice(-2)}`:`${t.slice(0,4)}\u2022\u2022\u2022\u2022${t.slice(-4)}`:w("WhatsApp\u8D26\u53F7")}function dKe(n){if(n===void 0)return Object.freeze([]);if(!Array.isArray(n))throw new TypeError("allowedNumbers must be an array of WhatsApp phone numbers");let t=n.map(o=>{let a=typeof o=="string"?o.trim().replace(/^\+/,""):"";if(!pKe.test(a))throw new TypeError("allowedNumbers contains an invalid WhatsApp phone number");return a});return Object.freeze([...new Set(t)])}function nD(n={}){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError("WhatsApp access policy must be an object");let t=n.accessMode??xF.selfOnly;if(!Object.values(xF).includes(t))throw new TypeError("WhatsApp accessMode is invalid");return Object.freeze({accessMode:t,allowedNumbers:dKe(n.allowedNumbers)})}var oD=class{#e;#A=KF;#t=Promise.resolve();constructor(t){this.#e=t}async load(){try{let t=this.#I(JSON.parse(await nKe(this.#e,"utf8")));if(!t)throw new Error("dsh-im WhatsApp config contains invalid account data");this.#A=t}catch(t){if(t?.code!=="ENOENT")throw t;this.#A=KF}return this}list(){return structuredClone(this.#A.bots)}get(t){let o=this.#A.bots.find(a=>a.botId===t);return o?structuredClone(o):null}getByAccountJid(t){let o=aD(t),a=this.#A.bots.find(e=>e.accountJid===o);return a?structuredClone(a):null}async save(t){let o=this.#r(t);if(!o)throw new Error("Refusing to persist incomplete WhatsApp account data");return this.#o(a=>{let e=a.find(r=>r.accountJid===o.accountJid&&r.botId!==o.botId),i=a.find(r=>r.authDirectory===o.authDirectory&&r.botId!==o.botId);if(e||i)throw new Error("Duplicate WhatsApp account identity");let A=a.findIndex(r=>r.botId===o.botId);return A===-1?a.push(o):a[A]=o,structuredClone(o)})}async remove(t){if(!SX.test(t))throw new TypeError("Invalid WhatsApp bot id");return this.#o(o=>{let a=o.findIndex(i=>i.botId===t);if(a===-1)return null;let[e]=o.splice(a,1);return structuredClone(e)})}async clear(){let t=this.#t.then(async()=>{try{await gKe(this.#e)}catch(o){if(o?.code!=="ENOENT")throw o}this.#A=KF});this.#t=t.then(()=>{},()=>{}),await t}#r(t){if(!t||typeof t!="object")return null;let o=aD(t.accountJid),a=fh(t.botId),e=fh(t.authDirectory),i=fh(t.name);if(!o||!a||!e||!i||!SX.test(a)||!lKe.test(e)||YF(o)!==a)return null;let A;try{A=nD(t)}catch{return null}return Object.freeze({botId:a,accountJid:o,authDirectory:e,name:i,createdAt:fh(t.createdAt)??new Date().toISOString(),connectedAt:fh(t.connectedAt),...A})}#I(t){if(!t||t.version!==2||!Array.isArray(t.bots))return null;let o=t.bots.map(A=>this.#r(A));if(o.some(A=>A===null))return null;let a=new Set,e=new Set,i=new Set;for(let A of o){if(a.has(A.botId)||e.has(A.accountJid)||i.has(A.authDirectory))return null;a.add(A.botId),e.add(A.accountJid),i.add(A.authDirectory)}return Object.freeze({version:2,bots:Object.freeze(o)})}async#o(t){let o,a=this.#t.then(async()=>{let e=[...this.#A.bots];o=t(e);let i=Object.freeze({version:2,bots:Object.freeze(e)});await this.#c(i),this.#A=i});return this.#t=a.then(()=>{},()=>{}),await a,o}async#c(t){await oKe(IKe(this.#e),{recursive:!0,mode:448});let o=`${this.#e}.tmp`;await cKe(o,`${JSON.stringify(t,null,2)} +`,{encoding:"utf8",mode:384}),await sKe(o,this.#e)}};var sD=class extends yr{constructor(t){super({...t,rpcIdPrefix:"whatsapp",logPrefix:"dsh-whatsapp"})}};var gD=class extends Cs{};import{randomUUID as hKe}from"node:crypto";var wX=new Set(["starting","pending","connecting"]),cD=new Set(["connected","failed","cancelled"]),EKe=6e4;function Vc(n,t){return Object.freeze({code:n,message:t})}function ID(n){return n?{attemptId:n.id,status:n.state,qrRevision:n.qrRevision,pollIntervalMs:1e3,...n.qrValue?{qrValue:n.qrValue}:{},...n.expiresAt?{expiresAt:n.expiresAt}:{},...n.botId?{botId:n.botId}:{},...n.error?{error:structuredClone(n.error)}:{}}:null}var TB=class{#e;#A;#t;#r;#I;#o;#c;#i=new Map;#a=new Map;#s=new Map;#p=new Map;#g=null;#l=0;#n=!1;constructor({configStore:t,authPath:o,createSession:a,createRuntime:e,deleteAuth:i=async()=>{},deleteState:A=async()=>{},logger:r=console}){if(!t||typeof t.list!="function"||typeof t.save!="function"||typeof t.remove!="function")throw new TypeError("WhatsappController requires a config store");if(typeof o!="function"||typeof a!="function"||typeof e!="function")throw new TypeError("WhatsappController dependencies are incomplete");this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r}async initialize(){if(this.#n)return this.status();for(let t of this.#e.list())await this.#B(t.botId,async()=>{if(!(this.#n||this.#i.get(t.botId)?.status?.ready))try{await this.#C(t),this.#a.delete(t.botId)}catch(o){this.#a.set(t.botId,Vc(o?.code==="relink-required"?"relink-required":"connection-failed",o?.code==="relink-required"?w("WhatsApp \u5173\u8054\u8BBE\u5907\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA\uFF0C\u63D2\u4EF6\u4F1A\u81EA\u52A8\u91CD\u8BD5\u3002"))),this.#c.warn?.(`[dsh-im:whatsapp] bot ${t.botId} failed to initialize`)}finally{this.#f()}});return this.status()}async startProvisioning(){if(this.#n)throw new Error("WhatsApp controller is closed");this.#g&&await this.cancelProvisioning(this.#g);let t,o,a=!1,e=new Promise((r,s)=>{t=()=>{a||(a=!0,r())},o=g=>{a||(a=!0,s(g))}}),i=hKe(),A={id:i,state:"starting",authDirectory:i,createdAt:Date.now(),expiresAt:null,qrRevision:0,qrValue:null,controller:new AbortController,session:null,task:null,error:null,botId:null};this.#s.set(i,A),this.#g=i,this.#f();try{let r=await this.#t({authDir:this.#A(A.authDirectory),signal:A.controller.signal,logger:this.#c,onQr:s=>{A.controller.signal.aborted||cD.has(A.state)||typeof s!="string"||!s||(A.qrValue=s,A.qrRevision+=1,A.expiresAt=Date.now()+EKe,A.state="pending",this.#f(),t())}});return A.session=r,A.task=r.ready.then(s=>this.#h(A,s)).catch(s=>this.#d(A,s,o)),await e,ID(A)}catch(r){throw await this.#d(A,r,o),r}}registrationStatus(t){return ID(this.#s.get(t))}async cancelProvisioning(t){let o=this.#s.get(t);return o?(cD.has(o.state)||(o.controller.abort(),await o.session?.close().catch(()=>{}),await o.task?.catch(()=>{}),cD.has(o.state)||(o.state="cancelled",o.error=Vc("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))),await this.#I(o.authDirectory).catch(()=>{})),this.#g===o.id&&(this.#g=null),this.#f(),ID(o)):null}async reconnectBot(t){let o=this.#e.get(t);if(!o)throw new Error("Unknown WhatsApp bot");return await this.#B(t,async()=>{try{await this.#C(o),this.#a.delete(t)}catch(a){throw this.#a.set(t,Vc(a?.code==="relink-required"?"relink-required":"connection-failed",a?.code==="relink-required"?w("WhatsApp \u5173\u8054\u8BBE\u5907\u5DF2\u5931\u6548\uFF0C\u8BF7\u79FB\u9664\u540E\u91CD\u65B0\u626B\u7801\u3002"):w("WhatsApp \u8FDE\u63A5\u4ECD\u672A\u5C31\u7EEA\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"))),a}finally{this.#f()}}),this.status()}async sendConnectionTest(t){let o=this.#e.get(t);if(!o)throw new Error("Unknown WhatsApp bot");return this.#B(t,async()=>{let a=this.#i.get(t);if(!a?.status?.ready||typeof a.sendConnectionTest!="function"){let e=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw e.code="test-target-unavailable",e}return a.sendConnectionTest(Ui(`${o.name}\uFF08${jF(o.accountJid)}\uFF09`,w("WhatsApp\u673A\u5668\u4EBA")))})}async sendProactiveText(t,o,a,e={}){if(!this.#e.get(t))throw new Error("Unknown WhatsApp bot");return this.#B(t,async()=>{let A=this.#i.get(t);if(!A?.status?.ready||typeof A.sendProactiveText!="function"){let r=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return A.sendProactiveText(o,a,e)})}async setAccessPolicy(t,o){if(this.#n)throw new Error("WhatsApp controller is closed");let a=nD(o);return await this.#B(t,async()=>{if(this.#n)throw new Error("WhatsApp controller is closed");let e=this.#e.get(t);if(!e)throw new Error("Unknown WhatsApp bot");let i=await this.#e.save({...e,...a});this.#i.get(t)?.setAccessPolicy?.(i),this.#f()}),this.status()}async deleteBot(t){let o=this.#e.get(t);if(!o)throw new Error("Unknown WhatsApp bot");return await this.#B(t,async()=>{await this.#u(t);try{await this.#e.remove(t)}catch(a){throw await this.#C(o).catch(()=>{}),a}await Promise.allSettled([this.#I(o.authDirectory),this.#o({botId:t,config:o})]),this.#a.delete(t),this.#f()}),this.status()}status(){let t=this.#e.list().map(e=>{let i=this.#i.get(e.botId)?.status??null,A=i?.ready===!0&&i.connectionState==="connected"&&i.harnessReachable===!0,r=A?"connected":i?.connectionState==="connecting"?"connecting":this.#a.has(e.botId)||i?.connectionState==="failed"?"error":"offline";return{botId:e.botId,state:r,connected:A,configured:!0,bot:{name:e.name,idMasked:jF(e.accountJid)},health:{status:A?"healthy":r==="error"?"error":"offline",summary:A?w("WhatsApp Web \u5173\u8054\u8BBE\u5907\u8FD0\u884C\u6B63\u5E38"):r==="error"?w("WhatsApp \u8FDE\u63A5\u672A\u5C31\u7EEA"):w("WhatsApp \u8FDE\u63A5\u5F53\u524D\u79BB\u7EBF"),lastCheckedAt:i?.lastCheckedAt??null,lastConnectedAt:i?.lastConnectedAt??null},stats:{messagesReceived:i?.messagesReceived??0,messagesReplied:i?.messagesReplied??0},lastMessageError:ti(i?.lastMessageError),accessPolicy:nD(e),error:structuredClone(this.#a.get(e.botId)??null)}}),o=t.filter(e=>e.connected).length,a=this.#g?this.#s.get(this.#g):null;return{schemaVersion:1,revision:this.#l,state:a&&wX.has(a.state)?"provisioning":t.length===0?"disconnected":o===t.length?"connected":o>0?"degraded":"offline",bots:t,totals:{configured:t.length,connected:o},...a&&wX.has(a.state)?{provisioning:ID(a)}:{}}}async close(){this.#n||(this.#n=!0,this.#g&&await this.cancelProvisioning(this.#g),await Promise.allSettled([...this.#p.values()]),await Promise.allSettled([...this.#i.keys()].map(t=>this.#u(t))))}async#h(t,o){if(t.controller.signal.aborted||this.#n)return;t.state="connecting",t.qrValue=null,t.expiresAt=null,this.#f();let a=YF(o.accountJid);t.botId=a,await t.session?.close();let e=this.#e.get(a),i={botId:a,accountJid:o.accountJid,authDirectory:t.authDirectory,name:o.name,createdAt:e?.createdAt??new Date().toISOString(),connectedAt:new Date().toISOString(),accessMode:e?.accessMode,allowedNumbers:e?.allowedNumbers};try{if(t.controller.signal.aborted||this.#n)throw Object.assign(new Error,{name:"AbortError"});if(await this.#e.save(i),t.controller.signal.aborted||this.#n)throw Object.assign(new Error,{name:"AbortError"});try{await this.#C(i),this.#a.delete(a)}catch{this.#a.set(a,Vc("connection-failed",w("WhatsApp \u5DF2\u7ED1\u5B9A\uFF0C\u6D88\u606F\u8FDE\u63A5\u6682\u672A\u5C31\u7EEA\u3002"))),this.#c.warn?.(`[dsh-im:whatsapp] bot ${a} did not reconnect after QR binding`)}e?.authDirectory&&e.authDirectory!==i.authDirectory&&await this.#I(e.authDirectory).catch(()=>{}),t.state="connected",t.error=null}catch(A){t.controller.signal.aborted||this.#n||A?.name==="AbortError"?(await this.#u(a),e?await this.#e.save(e).catch(()=>{}):await this.#e.remove(a).catch(()=>null)&&await this.#o({botId:a,config:i}).catch(s=>{this.#c.warn?.("[dsh-im:whatsapp] cancelled bot state cleanup failed:",s)}),await this.#I(t.authDirectory).catch(()=>{}),e&&await this.#C(e).catch(()=>{}),t.state="cancelled",t.error=Vc("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(await this.#I(t.authDirectory).catch(()=>{}),t.state="failed",t.error=Vc("activation-failed",w("WhatsApp \u5DF2\u626B\u7801\uFF0C\u4F46\u65E0\u6CD5\u4FDD\u5B58\u5173\u8054\u8BBE\u5907\u3002")),this.#c.error?.("[dsh-im:whatsapp] unable to persist linked-device session"))}finally{this.#g===t.id&&(this.#g=null),this.#f()}}async#d(t,o,a=()=>{}){cD.has(t.state)||(t.controller.signal.aborted||o?.name==="AbortError"?(t.state="cancelled",t.error=Vc("cancelled",w("\u626B\u7801\u63A5\u5165\u5DF2\u53D6\u6D88\u3002"))):(t.state="failed",t.error=Vc("qr-connect-failed",w("\u65E0\u6CD5\u8FDE\u63A5 WhatsApp\uFF0C\u8BF7\u91CD\u65B0\u751F\u6210\u4E8C\u7EF4\u7801\u3002"))),this.#g===t.id&&(this.#g=null),await t.session?.close().catch(()=>{}),await this.#I(t.authDirectory).catch(()=>{}),this.#f(),a(o))}async#C(t){if(this.#n)throw new Error("WhatsApp controller is closed");if(await this.#u(t.botId),this.#n)throw new Error("WhatsApp controller is closed");let o=await this.#r({botId:t.botId,config:t,authDir:this.#A(t.authDirectory)});if(!o||typeof o.start!="function"||typeof o.stop!="function")throw new TypeError("createRuntime returned an invalid WhatsApp runtime");this.#i.set(t.botId,o);try{await o.start()}catch(a){throw await o.stop().catch(()=>{}),this.#i.delete(t.botId),a}}async#u(t){let o=this.#i.get(t);this.#i.delete(t),await o?.stop().catch(()=>{})}#B(t,o){let i=(this.#p.get(t)??Promise.resolve()).catch(()=>{}).then(o).finally(()=>{this.#p.get(t)===i&&this.#p.delete(t)});return this.#p.set(t,i),i}#f(){this.#l+=1}};import{createHash as e7e,randomBytes as sle}from"node:crypto";var v=ze(tS(),1),D=v.default.Reader,P=v.default.Writer,l=v.default.util,d=v.default.roots.default||(v.default.roots.default={});function ge(n,t){if(typeof n=="string")return n;if(typeof n=="number")return String(n);if(n&&typeof n.low=="number"&&typeof n.high=="number"){let o=BigInt(n.low>>>0),e=BigInt(n.high>>>0)<<32n|o;return!t&&n.high<0?(e-(1n<<64n)).toString():e.toString()}return String(n)}function ce(n,t){if(typeof n=="number")return n;if(typeof n=="string")return Number(n);if(n&&typeof n.low=="number"&&typeof n.high=="number"){let o=BigInt(n.low>>>0),e=BigInt(n.high>>>0)<<32n|o;return!t&&n.high<0?Number(e-(1n<<64n)):Number(e)}return Number(n)}var ne=d.proto=(()=>{let n={};return n.ADVDeviceIdentity=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.rawId=e.uint32();break}case 2:{s.timestamp=e.uint64();break}case 3:{s.keyIndex=e.uint32();break}case 4:{s.accountType=e.int32();break}case 5:{s.deviceType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ADVDeviceIdentity)return e;var i=new d.proto.ADVDeviceIdentity;switch(e.rawId!=null&&(i.rawId=e.rawId>>>0),e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.keyIndex!=null&&(i.keyIndex=e.keyIndex>>>0),e.accountType){default:if(typeof e.accountType=="number"){i.accountType=e.accountType;break}break;case"E2EE":case 0:i.accountType=0;break;case"HOSTED":case 1:i.accountType=1;break}switch(e.deviceType){default:if(typeof e.deviceType=="number"){i.deviceType=e.deviceType;break}break;case"E2EE":case 0:i.deviceType=0;break;case"HOSTED":case 1:i.deviceType=1;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.rawId!=null&&e.hasOwnProperty("rawId")&&(A.rawId=e.rawId,i.oneofs&&(A._rawId="rawId")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=i.longs===String?String(e.timestamp):e.timestamp:A.timestamp=i.longs===String?ge(e.timestamp,!0):i.longs===Number?ce(e.timestamp,!0):e.timestamp,i.oneofs&&(A._timestamp="timestamp")),e.keyIndex!=null&&e.hasOwnProperty("keyIndex")&&(A.keyIndex=e.keyIndex,i.oneofs&&(A._keyIndex="keyIndex")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=i.enums===String?d.proto.ADVEncryptionType[e.accountType]===void 0?e.accountType:d.proto.ADVEncryptionType[e.accountType]:e.accountType,i.oneofs&&(A._accountType="accountType")),e.deviceType!=null&&e.hasOwnProperty("deviceType")&&(A.deviceType=i.enums===String?d.proto.ADVEncryptionType[e.deviceType]===void 0?e.deviceType:d.proto.ADVEncryptionType[e.deviceType]:e.deviceType,i.oneofs&&(A._deviceType="deviceType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVDeviceIdentity"},t})(),n.ADVEncryptionType=(function(){let t={},o=Object.create(t);return o[t[0]="E2EE"]=0,o[t[1]="HOSTED"]=1,o})(),n.ADVKeyIndexList=(function(){function t(a){if(this.validIndexes=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.rawId=e.uint32();break}case 2:{s.timestamp=e.uint64();break}case 3:{s.currentIndex=e.uint32();break}case 4:{if(s.validIndexes&&s.validIndexes.length||(s.validIndexes=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos>>0),e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.currentIndex!=null&&(i.currentIndex=e.currentIndex>>>0),e.validIndexes){if(!Array.isArray(e.validIndexes))throw TypeError(".proto.ADVKeyIndexList.validIndexes: array expected");i.validIndexes=[];for(var A=0;A>>0}switch(e.accountType){default:if(typeof e.accountType=="number"){i.accountType=e.accountType;break}break;case"E2EE":case 0:i.accountType=0;break;case"HOSTED":case 1:i.accountType=1;break}return i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.validIndexes=[]),e.rawId!=null&&e.hasOwnProperty("rawId")&&(A.rawId=e.rawId,i.oneofs&&(A._rawId="rawId")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=i.longs===String?String(e.timestamp):e.timestamp:A.timestamp=i.longs===String?ge(e.timestamp,!0):i.longs===Number?ce(e.timestamp,!0):e.timestamp,i.oneofs&&(A._timestamp="timestamp")),e.currentIndex!=null&&e.hasOwnProperty("currentIndex")&&(A.currentIndex=e.currentIndex,i.oneofs&&(A._currentIndex="currentIndex")),e.validIndexes&&e.validIndexes.length){A.validIndexes=[];for(var r=0;r>>3){case 1:{s.details=e.bytes();break}case 2:{s.accountSignatureKey=e.bytes();break}case 3:{s.accountSignature=e.bytes();break}case 4:{s.deviceSignature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ADVSignedDeviceIdentity)return e;var i=new d.proto.ADVSignedDeviceIdentity;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,i.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(i.details=e.details)),e.accountSignatureKey!=null&&(typeof e.accountSignatureKey=="string"?l.base64.decode(e.accountSignatureKey,i.accountSignatureKey=l.newBuffer(l.base64.length(e.accountSignatureKey)),0):e.accountSignatureKey.length>=0&&(i.accountSignatureKey=e.accountSignatureKey)),e.accountSignature!=null&&(typeof e.accountSignature=="string"?l.base64.decode(e.accountSignature,i.accountSignature=l.newBuffer(l.base64.length(e.accountSignature)),0):e.accountSignature.length>=0&&(i.accountSignature=e.accountSignature)),e.deviceSignature!=null&&(typeof e.deviceSignature=="string"?l.base64.decode(e.deviceSignature,i.deviceSignature=l.newBuffer(l.base64.length(e.deviceSignature)),0):e.deviceSignature.length>=0&&(i.deviceSignature=e.deviceSignature)),i},t.toObject=function(e,i){i||(i={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=i.bytes===String?l.base64.encode(e.details,0,e.details.length):i.bytes===Array?Array.prototype.slice.call(e.details):e.details,i.oneofs&&(A._details="details")),e.accountSignatureKey!=null&&e.hasOwnProperty("accountSignatureKey")&&(A.accountSignatureKey=i.bytes===String?l.base64.encode(e.accountSignatureKey,0,e.accountSignatureKey.length):i.bytes===Array?Array.prototype.slice.call(e.accountSignatureKey):e.accountSignatureKey,i.oneofs&&(A._accountSignatureKey="accountSignatureKey")),e.accountSignature!=null&&e.hasOwnProperty("accountSignature")&&(A.accountSignature=i.bytes===String?l.base64.encode(e.accountSignature,0,e.accountSignature.length):i.bytes===Array?Array.prototype.slice.call(e.accountSignature):e.accountSignature,i.oneofs&&(A._accountSignature="accountSignature")),e.deviceSignature!=null&&e.hasOwnProperty("deviceSignature")&&(A.deviceSignature=i.bytes===String?l.base64.encode(e.deviceSignature,0,e.deviceSignature.length):i.bytes===Array?Array.prototype.slice.call(e.deviceSignature):e.deviceSignature,i.oneofs&&(A._deviceSignature="deviceSignature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedDeviceIdentity"},t})(),n.ADVSignedDeviceIdentityHMAC=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.details=e.bytes();break}case 2:{s.hmac=e.bytes();break}case 3:{s.accountType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ADVSignedDeviceIdentityHMAC)return e;var i=new d.proto.ADVSignedDeviceIdentityHMAC;switch(e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,i.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(i.details=e.details)),e.hmac!=null&&(typeof e.hmac=="string"?l.base64.decode(e.hmac,i.hmac=l.newBuffer(l.base64.length(e.hmac)),0):e.hmac.length>=0&&(i.hmac=e.hmac)),e.accountType){default:if(typeof e.accountType=="number"){i.accountType=e.accountType;break}break;case"E2EE":case 0:i.accountType=0;break;case"HOSTED":case 1:i.accountType=1;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=i.bytes===String?l.base64.encode(e.details,0,e.details.length):i.bytes===Array?Array.prototype.slice.call(e.details):e.details,i.oneofs&&(A._details="details")),e.hmac!=null&&e.hasOwnProperty("hmac")&&(A.hmac=i.bytes===String?l.base64.encode(e.hmac,0,e.hmac.length):i.bytes===Array?Array.prototype.slice.call(e.hmac):e.hmac,i.oneofs&&(A._hmac="hmac")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=i.enums===String?d.proto.ADVEncryptionType[e.accountType]===void 0?e.accountType:d.proto.ADVEncryptionType[e.accountType]:e.accountType,i.oneofs&&(A._accountType="accountType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedDeviceIdentityHMAC"},t})(),n.ADVSignedKeyIndexList=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.details=e.bytes();break}case 2:{s.accountSignature=e.bytes();break}case 3:{s.accountSignatureKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ADVSignedKeyIndexList)return e;var i=new d.proto.ADVSignedKeyIndexList;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,i.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(i.details=e.details)),e.accountSignature!=null&&(typeof e.accountSignature=="string"?l.base64.decode(e.accountSignature,i.accountSignature=l.newBuffer(l.base64.length(e.accountSignature)),0):e.accountSignature.length>=0&&(i.accountSignature=e.accountSignature)),e.accountSignatureKey!=null&&(typeof e.accountSignatureKey=="string"?l.base64.decode(e.accountSignatureKey,i.accountSignatureKey=l.newBuffer(l.base64.length(e.accountSignatureKey)),0):e.accountSignatureKey.length>=0&&(i.accountSignatureKey=e.accountSignatureKey)),i},t.toObject=function(e,i){i||(i={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=i.bytes===String?l.base64.encode(e.details,0,e.details.length):i.bytes===Array?Array.prototype.slice.call(e.details):e.details,i.oneofs&&(A._details="details")),e.accountSignature!=null&&e.hasOwnProperty("accountSignature")&&(A.accountSignature=i.bytes===String?l.base64.encode(e.accountSignature,0,e.accountSignature.length):i.bytes===Array?Array.prototype.slice.call(e.accountSignature):e.accountSignature,i.oneofs&&(A._accountSignature="accountSignature")),e.accountSignatureKey!=null&&e.hasOwnProperty("accountSignatureKey")&&(A.accountSignatureKey=i.bytes===String?l.base64.encode(e.accountSignatureKey,0,e.accountSignatureKey.length):i.bytes===Array?Array.prototype.slice.call(e.accountSignatureKey):e.accountSignatureKey,i.oneofs&&(A._accountSignatureKey="accountSignatureKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ADVSignedKeyIndexList"},t})(),n.AIHomeState=(function(){function t(a){if(this.capabilityOptions=[],this.conversationOptions=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.lastFetchTime=e.int64();break}case 2:{s.capabilityOptions&&s.capabilityOptions.length||(s.capabilityOptions=[]),s.capabilityOptions.push(d.proto.AIHomeState.AIHomeOption.decode(e,e.uint32()));break}case 3:{s.conversationOptions&&s.conversationOptions.length||(s.conversationOptions=[]),s.conversationOptions.push(d.proto.AIHomeState.AIHomeOption.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIHomeState)return e;var i=new d.proto.AIHomeState;if(e.lastFetchTime!=null&&(l.Long?(i.lastFetchTime=l.Long.fromValue(e.lastFetchTime)).unsigned=!1:typeof e.lastFetchTime=="string"?i.lastFetchTime=parseInt(e.lastFetchTime,10):typeof e.lastFetchTime=="number"?i.lastFetchTime=e.lastFetchTime:typeof e.lastFetchTime=="object"&&(i.lastFetchTime=new l.LongBits(e.lastFetchTime.low>>>0,e.lastFetchTime.high>>>0).toNumber())),e.capabilityOptions){if(!Array.isArray(e.capabilityOptions))throw TypeError(".proto.AIHomeState.capabilityOptions: array expected");i.capabilityOptions=[];for(var A=0;A>>3){case 1:{c.type=A.int32();break}case 2:{c.title=A.string();break}case 3:{c.promptText=A.string();break}case 4:{c.sessionId=A.string();break}case 5:{c.imageWdsIdentifier=A.string();break}case 6:{c.imageTintColor=A.string();break}case 7:{c.imageBackgroundColor=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIHomeState.AIHomeOption)return A;var r=new d.proto.AIHomeState.AIHomeOption;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"PROMPT":case 0:r.type=0;break;case"CREATE_IMAGE":case 1:r.type=1;break;case"ANIMATE_PHOTO":case 2:r.type=2;break;case"ANALYZE_FILE":case 3:r.type=3;break}return A.title!=null&&(r.title=String(A.title)),A.promptText!=null&&(r.promptText=String(A.promptText)),A.sessionId!=null&&(r.sessionId=String(A.sessionId)),A.imageWdsIdentifier!=null&&(r.imageWdsIdentifier=String(A.imageWdsIdentifier)),A.imageTintColor!=null&&(r.imageTintColor=String(A.imageTintColor)),A.imageBackgroundColor!=null&&(r.imageBackgroundColor=String(A.imageBackgroundColor)),r},a.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.AIHomeState.AIHomeOption.AIHomeActionType[A.type]===void 0?A.type:d.proto.AIHomeState.AIHomeOption.AIHomeActionType[A.type]:A.type,r.oneofs&&(s._type="type")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.promptText!=null&&A.hasOwnProperty("promptText")&&(s.promptText=A.promptText,r.oneofs&&(s._promptText="promptText")),A.sessionId!=null&&A.hasOwnProperty("sessionId")&&(s.sessionId=A.sessionId,r.oneofs&&(s._sessionId="sessionId")),A.imageWdsIdentifier!=null&&A.hasOwnProperty("imageWdsIdentifier")&&(s.imageWdsIdentifier=A.imageWdsIdentifier,r.oneofs&&(s._imageWdsIdentifier="imageWdsIdentifier")),A.imageTintColor!=null&&A.hasOwnProperty("imageTintColor")&&(s.imageTintColor=A.imageTintColor,r.oneofs&&(s._imageTintColor="imageTintColor")),A.imageBackgroundColor!=null&&A.hasOwnProperty("imageBackgroundColor")&&(s.imageBackgroundColor=A.imageBackgroundColor,r.oneofs&&(s._imageBackgroundColor="imageBackgroundColor")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIHomeState.AIHomeOption"},a.AIHomeActionType=(function(){let i={},A=Object.create(i);return A[i[0]="PROMPT"]=0,A[i[1]="CREATE_IMAGE"]=1,A[i[2]="ANIMATE_PHOTO"]=2,A[i[3]="ANALYZE_FILE"]=3,A})(),a})(),t})(),n.AIQueryFanout=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.messageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=d.proto.Message.decode(e,e.uint32());break}case 3:{s.timestamp=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIQueryFanout)return e;var i=new d.proto.AIQueryFanout;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.AIQueryFanout.messageKey: object expected");i.messageKey=d.proto.MessageKey.fromObject(e.messageKey)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.AIQueryFanout.message: object expected");i.message=d.proto.Message.fromObject(e.message)}return e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=d.proto.MessageKey.toObject(e.messageKey,i),i.oneofs&&(A._messageKey="messageKey")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=d.proto.Message.toObject(e.message,i),i.oneofs&&(A._message="message")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=i.longs===String?String(e.timestamp):e.timestamp:A.timestamp=i.longs===String?ge(e.timestamp):i.longs===Number?ce(e.timestamp):e.timestamp,i.oneofs&&(A._timestamp="timestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIQueryFanout"},t})(),n.AIRegenerateMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.messageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.responseTimestampMs=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRegenerateMetadata)return e;var i=new d.proto.AIRegenerateMetadata;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.AIRegenerateMetadata.messageKey: object expected");i.messageKey=d.proto.MessageKey.fromObject(e.messageKey)}return e.responseTimestampMs!=null&&(l.Long?(i.responseTimestampMs=l.Long.fromValue(e.responseTimestampMs)).unsigned=!1:typeof e.responseTimestampMs=="string"?i.responseTimestampMs=parseInt(e.responseTimestampMs,10):typeof e.responseTimestampMs=="number"?i.responseTimestampMs=e.responseTimestampMs:typeof e.responseTimestampMs=="object"&&(i.responseTimestampMs=new l.LongBits(e.responseTimestampMs.low>>>0,e.responseTimestampMs.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=d.proto.MessageKey.toObject(e.messageKey,i),i.oneofs&&(A._messageKey="messageKey")),e.responseTimestampMs!=null&&e.hasOwnProperty("responseTimestampMs")&&(typeof e.responseTimestampMs=="number"?A.responseTimestampMs=i.longs===String?String(e.responseTimestampMs):e.responseTimestampMs:A.responseTimestampMs=i.longs===String?ge(e.responseTimestampMs):i.longs===Number?ce(e.responseTimestampMs):e.responseTimestampMs,i.oneofs&&(A._responseTimestampMs="responseTimestampMs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRegenerateMetadata"},t})(),n.AIRichResponseCodeMetadata=(function(){function t(a){if(this.codeBlocks=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.codeLanguage=e.string();break}case 2:{s.codeBlocks&&s.codeBlocks.length||(s.codeBlocks=[]),s.codeBlocks.push(d.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseCodeMetadata)return e;var i=new d.proto.AIRichResponseCodeMetadata;if(e.codeLanguage!=null&&(i.codeLanguage=String(e.codeLanguage)),e.codeBlocks){if(!Array.isArray(e.codeBlocks))throw TypeError(".proto.AIRichResponseCodeMetadata.codeBlocks: array expected");i.codeBlocks=[];for(var A=0;A>>3){case 1:{c.highlightType=A.int32();break}case 2:{c.codeContent=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock)return A;var r=new d.proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock;switch(A.highlightType){default:if(typeof A.highlightType=="number"){r.highlightType=A.highlightType;break}break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT":case 0:r.highlightType=0;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD":case 1:r.highlightType=1;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD":case 2:r.highlightType=2;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING":case 3:r.highlightType=3;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER":case 4:r.highlightType=4;break;case"AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT":case 5:r.highlightType=5;break}return A.codeContent!=null&&(r.codeContent=String(A.codeContent)),r},a.toObject=function(A,r){r||(r={});var s={};return A.highlightType!=null&&A.hasOwnProperty("highlightType")&&(s.highlightType=r.enums===String?d.proto.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[A.highlightType]===void 0?A.highlightType:d.proto.AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType[A.highlightType]:A.highlightType,r.oneofs&&(s._highlightType="highlightType")),A.codeContent!=null&&A.hasOwnProperty("codeContent")&&(s.codeContent=A.codeContent,r.oneofs&&(s._codeContent="codeContent")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseCodeMetadata.AIRichResponseCodeBlock"},a})(),t.AIRichResponseCodeHighlightType=(function(){let a={},e=Object.create(a);return e[a[0]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT"]=0,e[a[1]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD"]=1,e[a[2]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD"]=2,e[a[3]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING"]=3,e[a[4]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER"]=4,e[a[5]="AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT"]=5,e})(),t})(),n.AIRichResponseContentItemsMetadata=(function(){function t(a){if(this.itemsMetadata=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.itemsMetadata&&s.itemsMetadata.length||(s.itemsMetadata=[]),s.itemsMetadata.push(d.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.decode(e,e.uint32()));break}case 2:{s.contentType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseContentItemsMetadata)return e;var i=new d.proto.AIRichResponseContentItemsMetadata;if(e.itemsMetadata){if(!Array.isArray(e.itemsMetadata))throw TypeError(".proto.AIRichResponseContentItemsMetadata.itemsMetadata: array expected");i.itemsMetadata=[];for(var A=0;A>>3){case 1:{c.reelItem=d.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata)return A;var r=new d.proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata;if(A.reelItem!=null){if(typeof A.reelItem!="object")throw TypeError(".proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata.reelItem: object expected");r.reelItem=d.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.fromObject(A.reelItem)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.reelItem!=null&&A.hasOwnProperty("reelItem")&&(s.reelItem=d.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem.toObject(A.reelItem,r),r.oneofs&&(s.aIRichResponseContentItem="reelItem")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseContentItemsMetadata.AIRichResponseContentItemMetadata"},a})(),t.AIRichResponseReelItem=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.title=A.string();break}case 2:{c.profileIconUrl=A.string();break}case 3:{c.thumbnailUrl=A.string();break}case 4:{c.videoUrl=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem)return A;var r=new d.proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem;return A.title!=null&&(r.title=String(A.title)),A.profileIconUrl!=null&&(r.profileIconUrl=String(A.profileIconUrl)),A.thumbnailUrl!=null&&(r.thumbnailUrl=String(A.thumbnailUrl)),A.videoUrl!=null&&(r.videoUrl=String(A.videoUrl)),r},a.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.profileIconUrl!=null&&A.hasOwnProperty("profileIconUrl")&&(s.profileIconUrl=A.profileIconUrl,r.oneofs&&(s._profileIconUrl="profileIconUrl")),A.thumbnailUrl!=null&&A.hasOwnProperty("thumbnailUrl")&&(s.thumbnailUrl=A.thumbnailUrl,r.oneofs&&(s._thumbnailUrl="thumbnailUrl")),A.videoUrl!=null&&A.hasOwnProperty("videoUrl")&&(s.videoUrl=A.videoUrl,r.oneofs&&(s._videoUrl="videoUrl")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseContentItemsMetadata.AIRichResponseReelItem"},a})(),t.ContentType=(function(){let a={},e=Object.create(a);return e[a[0]="DEFAULT"]=0,e[a[1]="CAROUSEL"]=1,e})(),t})(),n.AIRichResponseDynamicMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.type=e.int32();break}case 2:{s.version=e.uint64();break}case 3:{s.url=e.string();break}case 4:{s.loopCount=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseDynamicMetadata)return e;var i=new d.proto.AIRichResponseDynamicMetadata;switch(e.type){default:if(typeof e.type=="number"){i.type=e.type;break}break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN":case 0:i.type=0;break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE":case 1:i.type=1;break;case"AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF":case 2:i.type=2;break}return e.version!=null&&(l.Long?(i.version=l.Long.fromValue(e.version)).unsigned=!0:typeof e.version=="string"?i.version=parseInt(e.version,10):typeof e.version=="number"?i.version=e.version:typeof e.version=="object"&&(i.version=new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber(!0))),e.url!=null&&(i.url=String(e.url)),e.loopCount!=null&&(i.loopCount=e.loopCount>>>0),i},t.toObject=function(e,i){i||(i={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=i.enums===String?d.proto.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[e.type]===void 0?e.type:d.proto.AIRichResponseDynamicMetadata.AIRichResponseDynamicMetadataType[e.type]:e.type,i.oneofs&&(A._type="type")),e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?A.version=i.longs===String?String(e.version):e.version:A.version=i.longs===String?ge(e.version,!0):i.longs===Number?ce(e.version,!0):e.version,i.oneofs&&(A._version="version")),e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,i.oneofs&&(A._url="url")),e.loopCount!=null&&e.hasOwnProperty("loopCount")&&(A.loopCount=e.loopCount,i.oneofs&&(A._loopCount="loopCount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseDynamicMetadata"},t.AIRichResponseDynamicMetadataType=(function(){let a={},e=Object.create(a);return e[a[0]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN"]=0,e[a[1]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE"]=1,e[a[2]="AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF"]=2,e})(),t})(),n.AIRichResponseGridImageMetadata=(function(){function t(a){if(this.imageUrls=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.gridImageUrl=d.proto.AIRichResponseImageURL.decode(e,e.uint32());break}case 2:{s.imageUrls&&s.imageUrls.length||(s.imageUrls=[]),s.imageUrls.push(d.proto.AIRichResponseImageURL.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseGridImageMetadata)return e;var i=new d.proto.AIRichResponseGridImageMetadata;if(e.gridImageUrl!=null){if(typeof e.gridImageUrl!="object")throw TypeError(".proto.AIRichResponseGridImageMetadata.gridImageUrl: object expected");i.gridImageUrl=d.proto.AIRichResponseImageURL.fromObject(e.gridImageUrl)}if(e.imageUrls){if(!Array.isArray(e.imageUrls))throw TypeError(".proto.AIRichResponseGridImageMetadata.imageUrls: array expected");i.imageUrls=[];for(var A=0;A>>3){case 1:{s.imagePreviewUrl=e.string();break}case 2:{s.imageHighResUrl=e.string();break}case 3:{s.sourceUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseImageURL)return e;var i=new d.proto.AIRichResponseImageURL;return e.imagePreviewUrl!=null&&(i.imagePreviewUrl=String(e.imagePreviewUrl)),e.imageHighResUrl!=null&&(i.imageHighResUrl=String(e.imageHighResUrl)),e.sourceUrl!=null&&(i.sourceUrl=String(e.sourceUrl)),i},t.toObject=function(e,i){i||(i={});var A={};return e.imagePreviewUrl!=null&&e.hasOwnProperty("imagePreviewUrl")&&(A.imagePreviewUrl=e.imagePreviewUrl,i.oneofs&&(A._imagePreviewUrl="imagePreviewUrl")),e.imageHighResUrl!=null&&e.hasOwnProperty("imageHighResUrl")&&(A.imageHighResUrl=e.imageHighResUrl,i.oneofs&&(A._imageHighResUrl="imageHighResUrl")),e.sourceUrl!=null&&e.hasOwnProperty("sourceUrl")&&(A.sourceUrl=e.sourceUrl,i.oneofs&&(A._sourceUrl="sourceUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseImageURL"},t})(),n.AIRichResponseInlineImageMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.imageUrl=d.proto.AIRichResponseImageURL.decode(e,e.uint32());break}case 2:{s.imageText=e.string();break}case 3:{s.alignment=e.int32();break}case 4:{s.tapLinkUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseInlineImageMetadata)return e;var i=new d.proto.AIRichResponseInlineImageMetadata;if(e.imageUrl!=null){if(typeof e.imageUrl!="object")throw TypeError(".proto.AIRichResponseInlineImageMetadata.imageUrl: object expected");i.imageUrl=d.proto.AIRichResponseImageURL.fromObject(e.imageUrl)}switch(e.imageText!=null&&(i.imageText=String(e.imageText)),e.alignment){default:if(typeof e.alignment=="number"){i.alignment=e.alignment;break}break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED":case 0:i.alignment=0;break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED":case 1:i.alignment=1;break;case"AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED":case 2:i.alignment=2;break}return e.tapLinkUrl!=null&&(i.tapLinkUrl=String(e.tapLinkUrl)),i},t.toObject=function(e,i){i||(i={});var A={};return e.imageUrl!=null&&e.hasOwnProperty("imageUrl")&&(A.imageUrl=d.proto.AIRichResponseImageURL.toObject(e.imageUrl,i),i.oneofs&&(A._imageUrl="imageUrl")),e.imageText!=null&&e.hasOwnProperty("imageText")&&(A.imageText=e.imageText,i.oneofs&&(A._imageText="imageText")),e.alignment!=null&&e.hasOwnProperty("alignment")&&(A.alignment=i.enums===String?d.proto.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[e.alignment]===void 0?e.alignment:d.proto.AIRichResponseInlineImageMetadata.AIRichResponseImageAlignment[e.alignment]:e.alignment,i.oneofs&&(A._alignment="alignment")),e.tapLinkUrl!=null&&e.hasOwnProperty("tapLinkUrl")&&(A.tapLinkUrl=e.tapLinkUrl,i.oneofs&&(A._tapLinkUrl="tapLinkUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseInlineImageMetadata"},t.AIRichResponseImageAlignment=(function(){let a={},e=Object.create(a);return e[a[0]="AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED"]=0,e[a[1]="AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED"]=1,e[a[2]="AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED"]=2,e})(),t})(),n.AIRichResponseLatexMetadata=(function(){function t(a){if(this.expressions=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.text=e.string();break}case 2:{s.expressions&&s.expressions.length||(s.expressions=[]),s.expressions.push(d.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseLatexMetadata)return e;var i=new d.proto.AIRichResponseLatexMetadata;if(e.text!=null&&(i.text=String(e.text)),e.expressions){if(!Array.isArray(e.expressions))throw TypeError(".proto.AIRichResponseLatexMetadata.expressions: array expected");i.expressions=[];for(var A=0;A>>3){case 1:{c.latexExpression=A.string();break}case 2:{c.url=A.string();break}case 3:{c.width=A.double();break}case 4:{c.height=A.double();break}case 5:{c.fontHeight=A.double();break}case 6:{c.imageTopPadding=A.double();break}case 7:{c.imageLeadingPadding=A.double();break}case 8:{c.imageBottomPadding=A.double();break}case 9:{c.imageTrailingPadding=A.double();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression)return A;var r=new d.proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression;return A.latexExpression!=null&&(r.latexExpression=String(A.latexExpression)),A.url!=null&&(r.url=String(A.url)),A.width!=null&&(r.width=Number(A.width)),A.height!=null&&(r.height=Number(A.height)),A.fontHeight!=null&&(r.fontHeight=Number(A.fontHeight)),A.imageTopPadding!=null&&(r.imageTopPadding=Number(A.imageTopPadding)),A.imageLeadingPadding!=null&&(r.imageLeadingPadding=Number(A.imageLeadingPadding)),A.imageBottomPadding!=null&&(r.imageBottomPadding=Number(A.imageBottomPadding)),A.imageTrailingPadding!=null&&(r.imageTrailingPadding=Number(A.imageTrailingPadding)),r},a.toObject=function(A,r){r||(r={});var s={};return A.latexExpression!=null&&A.hasOwnProperty("latexExpression")&&(s.latexExpression=A.latexExpression,r.oneofs&&(s._latexExpression="latexExpression")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=r.json&&!isFinite(A.width)?String(A.width):A.width,r.oneofs&&(s._width="width")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=r.json&&!isFinite(A.height)?String(A.height):A.height,r.oneofs&&(s._height="height")),A.fontHeight!=null&&A.hasOwnProperty("fontHeight")&&(s.fontHeight=r.json&&!isFinite(A.fontHeight)?String(A.fontHeight):A.fontHeight,r.oneofs&&(s._fontHeight="fontHeight")),A.imageTopPadding!=null&&A.hasOwnProperty("imageTopPadding")&&(s.imageTopPadding=r.json&&!isFinite(A.imageTopPadding)?String(A.imageTopPadding):A.imageTopPadding,r.oneofs&&(s._imageTopPadding="imageTopPadding")),A.imageLeadingPadding!=null&&A.hasOwnProperty("imageLeadingPadding")&&(s.imageLeadingPadding=r.json&&!isFinite(A.imageLeadingPadding)?String(A.imageLeadingPadding):A.imageLeadingPadding,r.oneofs&&(s._imageLeadingPadding="imageLeadingPadding")),A.imageBottomPadding!=null&&A.hasOwnProperty("imageBottomPadding")&&(s.imageBottomPadding=r.json&&!isFinite(A.imageBottomPadding)?String(A.imageBottomPadding):A.imageBottomPadding,r.oneofs&&(s._imageBottomPadding="imageBottomPadding")),A.imageTrailingPadding!=null&&A.hasOwnProperty("imageTrailingPadding")&&(s.imageTrailingPadding=r.json&&!isFinite(A.imageTrailingPadding)?String(A.imageTrailingPadding):A.imageTrailingPadding,r.oneofs&&(s._imageTrailingPadding="imageTrailingPadding")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseLatexMetadata.AIRichResponseLatexExpression"},a})(),t})(),n.AIRichResponseMapMetadata=(function(){function t(a){if(this.annotations=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.centerLatitude=e.double();break}case 2:{s.centerLongitude=e.double();break}case 3:{s.latitudeDelta=e.double();break}case 4:{s.longitudeDelta=e.double();break}case 5:{s.annotations&&s.annotations.length||(s.annotations=[]),s.annotations.push(d.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation.decode(e,e.uint32()));break}case 6:{s.showInfoList=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseMapMetadata)return e;var i=new d.proto.AIRichResponseMapMetadata;if(e.centerLatitude!=null&&(i.centerLatitude=Number(e.centerLatitude)),e.centerLongitude!=null&&(i.centerLongitude=Number(e.centerLongitude)),e.latitudeDelta!=null&&(i.latitudeDelta=Number(e.latitudeDelta)),e.longitudeDelta!=null&&(i.longitudeDelta=Number(e.longitudeDelta)),e.annotations){if(!Array.isArray(e.annotations))throw TypeError(".proto.AIRichResponseMapMetadata.annotations: array expected");i.annotations=[];for(var A=0;A>>3){case 1:{c.annotationNumber=A.uint32();break}case 2:{c.latitude=A.double();break}case 3:{c.longitude=A.double();break}case 4:{c.title=A.string();break}case 5:{c.body=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation)return A;var r=new d.proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation;return A.annotationNumber!=null&&(r.annotationNumber=A.annotationNumber>>>0),A.latitude!=null&&(r.latitude=Number(A.latitude)),A.longitude!=null&&(r.longitude=Number(A.longitude)),A.title!=null&&(r.title=String(A.title)),A.body!=null&&(r.body=String(A.body)),r},a.toObject=function(A,r){r||(r={});var s={};return A.annotationNumber!=null&&A.hasOwnProperty("annotationNumber")&&(s.annotationNumber=A.annotationNumber,r.oneofs&&(s._annotationNumber="annotationNumber")),A.latitude!=null&&A.hasOwnProperty("latitude")&&(s.latitude=r.json&&!isFinite(A.latitude)?String(A.latitude):A.latitude,r.oneofs&&(s._latitude="latitude")),A.longitude!=null&&A.hasOwnProperty("longitude")&&(s.longitude=r.json&&!isFinite(A.longitude)?String(A.longitude):A.longitude,r.oneofs&&(s._longitude="longitude")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,r.oneofs&&(s._body="body")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIRichResponseMapMetadata.AIRichResponseMapAnnotation"},a})(),t})(),n.AIRichResponseMessage=(function(){function t(a){if(this.submessages=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.messageType=e.int32();break}case 2:{s.submessages&&s.submessages.length||(s.submessages=[]),s.submessages.push(d.proto.AIRichResponseSubMessage.decode(e,e.uint32()));break}case 3:{s.unifiedResponse=d.proto.AIRichResponseUnifiedResponse.decode(e,e.uint32());break}case 4:{s.contextInfo=d.proto.ContextInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseMessage)return e;var i=new d.proto.AIRichResponseMessage;switch(e.messageType){default:if(typeof e.messageType=="number"){i.messageType=e.messageType;break}break;case"AI_RICH_RESPONSE_TYPE_UNKNOWN":case 0:i.messageType=0;break;case"AI_RICH_RESPONSE_TYPE_STANDARD":case 1:i.messageType=1;break}if(e.submessages){if(!Array.isArray(e.submessages))throw TypeError(".proto.AIRichResponseMessage.submessages: array expected");i.submessages=[];for(var A=0;A>>3){case 1:{s.messageType=e.int32();break}case 2:{s.gridImageMetadata=d.proto.AIRichResponseGridImageMetadata.decode(e,e.uint32());break}case 3:{s.messageText=e.string();break}case 4:{s.imageMetadata=d.proto.AIRichResponseInlineImageMetadata.decode(e,e.uint32());break}case 5:{s.codeMetadata=d.proto.AIRichResponseCodeMetadata.decode(e,e.uint32());break}case 6:{s.tableMetadata=d.proto.AIRichResponseTableMetadata.decode(e,e.uint32());break}case 7:{s.dynamicMetadata=d.proto.AIRichResponseDynamicMetadata.decode(e,e.uint32());break}case 8:{s.latexMetadata=d.proto.AIRichResponseLatexMetadata.decode(e,e.uint32());break}case 9:{s.mapMetadata=d.proto.AIRichResponseMapMetadata.decode(e,e.uint32());break}case 10:{s.contentItemsMetadata=d.proto.AIRichResponseContentItemsMetadata.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseSubMessage)return e;var i=new d.proto.AIRichResponseSubMessage;switch(e.messageType){default:if(typeof e.messageType=="number"){i.messageType=e.messageType;break}break;case"AI_RICH_RESPONSE_UNKNOWN":case 0:i.messageType=0;break;case"AI_RICH_RESPONSE_GRID_IMAGE":case 1:i.messageType=1;break;case"AI_RICH_RESPONSE_TEXT":case 2:i.messageType=2;break;case"AI_RICH_RESPONSE_INLINE_IMAGE":case 3:i.messageType=3;break;case"AI_RICH_RESPONSE_TABLE":case 4:i.messageType=4;break;case"AI_RICH_RESPONSE_CODE":case 5:i.messageType=5;break;case"AI_RICH_RESPONSE_DYNAMIC":case 6:i.messageType=6;break;case"AI_RICH_RESPONSE_MAP":case 7:i.messageType=7;break;case"AI_RICH_RESPONSE_LATEX":case 8:i.messageType=8;break;case"AI_RICH_RESPONSE_CONTENT_ITEMS":case 9:i.messageType=9;break}if(e.gridImageMetadata!=null){if(typeof e.gridImageMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.gridImageMetadata: object expected");i.gridImageMetadata=d.proto.AIRichResponseGridImageMetadata.fromObject(e.gridImageMetadata)}if(e.messageText!=null&&(i.messageText=String(e.messageText)),e.imageMetadata!=null){if(typeof e.imageMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.imageMetadata: object expected");i.imageMetadata=d.proto.AIRichResponseInlineImageMetadata.fromObject(e.imageMetadata)}if(e.codeMetadata!=null){if(typeof e.codeMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.codeMetadata: object expected");i.codeMetadata=d.proto.AIRichResponseCodeMetadata.fromObject(e.codeMetadata)}if(e.tableMetadata!=null){if(typeof e.tableMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.tableMetadata: object expected");i.tableMetadata=d.proto.AIRichResponseTableMetadata.fromObject(e.tableMetadata)}if(e.dynamicMetadata!=null){if(typeof e.dynamicMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.dynamicMetadata: object expected");i.dynamicMetadata=d.proto.AIRichResponseDynamicMetadata.fromObject(e.dynamicMetadata)}if(e.latexMetadata!=null){if(typeof e.latexMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.latexMetadata: object expected");i.latexMetadata=d.proto.AIRichResponseLatexMetadata.fromObject(e.latexMetadata)}if(e.mapMetadata!=null){if(typeof e.mapMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.mapMetadata: object expected");i.mapMetadata=d.proto.AIRichResponseMapMetadata.fromObject(e.mapMetadata)}if(e.contentItemsMetadata!=null){if(typeof e.contentItemsMetadata!="object")throw TypeError(".proto.AIRichResponseSubMessage.contentItemsMetadata: object expected");i.contentItemsMetadata=d.proto.AIRichResponseContentItemsMetadata.fromObject(e.contentItemsMetadata)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.messageType!=null&&e.hasOwnProperty("messageType")&&(A.messageType=i.enums===String?d.proto.AIRichResponseSubMessageType[e.messageType]===void 0?e.messageType:d.proto.AIRichResponseSubMessageType[e.messageType]:e.messageType,i.oneofs&&(A._messageType="messageType")),e.gridImageMetadata!=null&&e.hasOwnProperty("gridImageMetadata")&&(A.gridImageMetadata=d.proto.AIRichResponseGridImageMetadata.toObject(e.gridImageMetadata,i),i.oneofs&&(A._gridImageMetadata="gridImageMetadata")),e.messageText!=null&&e.hasOwnProperty("messageText")&&(A.messageText=e.messageText,i.oneofs&&(A._messageText="messageText")),e.imageMetadata!=null&&e.hasOwnProperty("imageMetadata")&&(A.imageMetadata=d.proto.AIRichResponseInlineImageMetadata.toObject(e.imageMetadata,i),i.oneofs&&(A._imageMetadata="imageMetadata")),e.codeMetadata!=null&&e.hasOwnProperty("codeMetadata")&&(A.codeMetadata=d.proto.AIRichResponseCodeMetadata.toObject(e.codeMetadata,i),i.oneofs&&(A._codeMetadata="codeMetadata")),e.tableMetadata!=null&&e.hasOwnProperty("tableMetadata")&&(A.tableMetadata=d.proto.AIRichResponseTableMetadata.toObject(e.tableMetadata,i),i.oneofs&&(A._tableMetadata="tableMetadata")),e.dynamicMetadata!=null&&e.hasOwnProperty("dynamicMetadata")&&(A.dynamicMetadata=d.proto.AIRichResponseDynamicMetadata.toObject(e.dynamicMetadata,i),i.oneofs&&(A._dynamicMetadata="dynamicMetadata")),e.latexMetadata!=null&&e.hasOwnProperty("latexMetadata")&&(A.latexMetadata=d.proto.AIRichResponseLatexMetadata.toObject(e.latexMetadata,i),i.oneofs&&(A._latexMetadata="latexMetadata")),e.mapMetadata!=null&&e.hasOwnProperty("mapMetadata")&&(A.mapMetadata=d.proto.AIRichResponseMapMetadata.toObject(e.mapMetadata,i),i.oneofs&&(A._mapMetadata="mapMetadata")),e.contentItemsMetadata!=null&&e.hasOwnProperty("contentItemsMetadata")&&(A.contentItemsMetadata=d.proto.AIRichResponseContentItemsMetadata.toObject(e.contentItemsMetadata,i),i.oneofs&&(A._contentItemsMetadata="contentItemsMetadata")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseSubMessage"},t})(),n.AIRichResponseSubMessageType=(function(){let t={},o=Object.create(t);return o[t[0]="AI_RICH_RESPONSE_UNKNOWN"]=0,o[t[1]="AI_RICH_RESPONSE_GRID_IMAGE"]=1,o[t[2]="AI_RICH_RESPONSE_TEXT"]=2,o[t[3]="AI_RICH_RESPONSE_INLINE_IMAGE"]=3,o[t[4]="AI_RICH_RESPONSE_TABLE"]=4,o[t[5]="AI_RICH_RESPONSE_CODE"]=5,o[t[6]="AI_RICH_RESPONSE_DYNAMIC"]=6,o[t[7]="AI_RICH_RESPONSE_MAP"]=7,o[t[8]="AI_RICH_RESPONSE_LATEX"]=8,o[t[9]="AI_RICH_RESPONSE_CONTENT_ITEMS"]=9,o})(),n.AIRichResponseTableMetadata=(function(){function t(a){if(this.rows=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.rows&&s.rows.length||(s.rows=[]),s.rows.push(d.proto.AIRichResponseTableMetadata.AIRichResponseTableRow.decode(e,e.uint32()));break}case 2:{s.title=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseTableMetadata)return e;var i=new d.proto.AIRichResponseTableMetadata;if(e.rows){if(!Array.isArray(e.rows))throw TypeError(".proto.AIRichResponseTableMetadata.rows: array expected");i.rows=[];for(var A=0;A>>3){case 1:{c.items&&c.items.length||(c.items=[]),c.items.push(A.string());break}case 2:{c.isHeading=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIRichResponseTableMetadata.AIRichResponseTableRow)return A;var r=new d.proto.AIRichResponseTableMetadata.AIRichResponseTableRow;if(A.items){if(!Array.isArray(A.items))throw TypeError(".proto.AIRichResponseTableMetadata.AIRichResponseTableRow.items: array expected");r.items=[];for(var s=0;s>>3){case 1:{s.data=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIRichResponseUnifiedResponse)return e;var i=new d.proto.AIRichResponseUnifiedResponse;return e.data!=null&&(typeof e.data=="string"?l.base64.decode(e.data,i.data=l.newBuffer(l.base64.length(e.data)),0):e.data.length>=0&&(i.data=e.data)),i},t.toObject=function(e,i){i||(i={});var A={};return e.data!=null&&e.hasOwnProperty("data")&&(A.data=i.bytes===String?l.base64.encode(e.data,0,e.data.length):i.bytes===Array?Array.prototype.slice.call(e.data):e.data,i.oneofs&&(A._data="data")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIRichResponseUnifiedResponse"},t})(),n.AIThreadInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.serverInfo=d.proto.AIThreadInfo.AIThreadServerInfo.decode(e,e.uint32());break}case 2:{s.clientInfo=d.proto.AIThreadInfo.AIThreadClientInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AIThreadInfo)return e;var i=new d.proto.AIThreadInfo;if(e.serverInfo!=null){if(typeof e.serverInfo!="object")throw TypeError(".proto.AIThreadInfo.serverInfo: object expected");i.serverInfo=d.proto.AIThreadInfo.AIThreadServerInfo.fromObject(e.serverInfo)}if(e.clientInfo!=null){if(typeof e.clientInfo!="object")throw TypeError(".proto.AIThreadInfo.clientInfo: object expected");i.clientInfo=d.proto.AIThreadInfo.AIThreadClientInfo.fromObject(e.clientInfo)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.serverInfo!=null&&e.hasOwnProperty("serverInfo")&&(A.serverInfo=d.proto.AIThreadInfo.AIThreadServerInfo.toObject(e.serverInfo,i),i.oneofs&&(A._serverInfo="serverInfo")),e.clientInfo!=null&&e.hasOwnProperty("clientInfo")&&(A.clientInfo=d.proto.AIThreadInfo.AIThreadClientInfo.toObject(e.clientInfo,i),i.oneofs&&(A._clientInfo="clientInfo")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AIThreadInfo"},t.AIThreadClientInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIThreadInfo.AIThreadClientInfo)return A;var r=new d.proto.AIThreadInfo.AIThreadClientInfo;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"DEFAULT":case 1:r.type=1;break;case"INCOGNITO":case 2:r.type=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.AIThreadInfo.AIThreadClientInfo.AIThreadType[A.type]===void 0?A.type:d.proto.AIThreadInfo.AIThreadClientInfo.AIThreadType[A.type]:A.type,r.oneofs&&(s._type="type")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIThreadInfo.AIThreadClientInfo"},a.AIThreadType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="DEFAULT"]=1,A[i[2]="INCOGNITO"]=2,A})(),a})(),t.AIThreadServerInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.title=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.AIThreadInfo.AIThreadServerInfo)return A;var r=new d.proto.AIThreadInfo.AIThreadServerInfo;return A.title!=null&&(r.title=String(A.title)),r},a.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.AIThreadInfo.AIThreadServerInfo"},a})(),t})(),n.Account=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.lid=e.string();break}case 2:{s.username=e.string();break}case 3:{s.countryCode=e.string();break}case 4:{s.isUsernameDeleted=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Account)return e;var i=new d.proto.Account;return e.lid!=null&&(i.lid=String(e.lid)),e.username!=null&&(i.username=String(e.username)),e.countryCode!=null&&(i.countryCode=String(e.countryCode)),e.isUsernameDeleted!=null&&(i.isUsernameDeleted=!!e.isUsernameDeleted),i},t.toObject=function(e,i){i||(i={});var A={};return e.lid!=null&&e.hasOwnProperty("lid")&&(A.lid=e.lid,i.oneofs&&(A._lid="lid")),e.username!=null&&e.hasOwnProperty("username")&&(A.username=e.username,i.oneofs&&(A._username="username")),e.countryCode!=null&&e.hasOwnProperty("countryCode")&&(A.countryCode=e.countryCode,i.oneofs&&(A._countryCode="countryCode")),e.isUsernameDeleted!=null&&e.hasOwnProperty("isUsernameDeleted")&&(A.isUsernameDeleted=e.isUsernameDeleted,i.oneofs&&(A._isUsernameDeleted="isUsernameDeleted")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Account"},t})(),n.ActionLink=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.url=e.string();break}case 2:{s.buttonTitle=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ActionLink)return e;var i=new d.proto.ActionLink;return e.url!=null&&(i.url=String(e.url)),e.buttonTitle!=null&&(i.buttonTitle=String(e.buttonTitle)),i},t.toObject=function(e,i){i||(i={});var A={};return e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,i.oneofs&&(A._url="url")),e.buttonTitle!=null&&e.hasOwnProperty("buttonTitle")&&(A.buttonTitle=e.buttonTitle,i.oneofs&&(A._buttonTitle="buttonTitle")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ActionLink"},t})(),n.AutoDownloadSettings=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.downloadImages=e.bool();break}case 2:{s.downloadAudio=e.bool();break}case 3:{s.downloadVideo=e.bool();break}case 4:{s.downloadDocuments=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AutoDownloadSettings)return e;var i=new d.proto.AutoDownloadSettings;return e.downloadImages!=null&&(i.downloadImages=!!e.downloadImages),e.downloadAudio!=null&&(i.downloadAudio=!!e.downloadAudio),e.downloadVideo!=null&&(i.downloadVideo=!!e.downloadVideo),e.downloadDocuments!=null&&(i.downloadDocuments=!!e.downloadDocuments),i},t.toObject=function(e,i){i||(i={});var A={};return e.downloadImages!=null&&e.hasOwnProperty("downloadImages")&&(A.downloadImages=e.downloadImages,i.oneofs&&(A._downloadImages="downloadImages")),e.downloadAudio!=null&&e.hasOwnProperty("downloadAudio")&&(A.downloadAudio=e.downloadAudio,i.oneofs&&(A._downloadAudio="downloadAudio")),e.downloadVideo!=null&&e.hasOwnProperty("downloadVideo")&&(A.downloadVideo=e.downloadVideo,i.oneofs&&(A._downloadVideo="downloadVideo")),e.downloadDocuments!=null&&e.hasOwnProperty("downloadDocuments")&&(A.downloadDocuments=e.downloadDocuments,i.oneofs&&(A._downloadDocuments="downloadDocuments")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AutoDownloadSettings"},t})(),n.AvatarUserSettings=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.fbid=e.string();break}case 2:{s.password=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.AvatarUserSettings)return e;var i=new d.proto.AvatarUserSettings;return e.fbid!=null&&(i.fbid=String(e.fbid)),e.password!=null&&(i.password=String(e.password)),i},t.toObject=function(e,i){i||(i={});var A={};return e.fbid!=null&&e.hasOwnProperty("fbid")&&(A.fbid=e.fbid,i.oneofs&&(A._fbid="fbid")),e.password!=null&&e.hasOwnProperty("password")&&(A.password=e.password,i.oneofs&&(A._password="password")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.AvatarUserSettings"},t})(),n.BizAccountLinkInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.whatsappBizAcctFbid=e.uint64();break}case 2:{s.whatsappAcctNumber=e.string();break}case 3:{s.issueTime=e.uint64();break}case 4:{s.hostStorage=e.int32();break}case 5:{s.accountType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BizAccountLinkInfo)return e;var i=new d.proto.BizAccountLinkInfo;switch(e.whatsappBizAcctFbid!=null&&(l.Long?(i.whatsappBizAcctFbid=l.Long.fromValue(e.whatsappBizAcctFbid)).unsigned=!0:typeof e.whatsappBizAcctFbid=="string"?i.whatsappBizAcctFbid=parseInt(e.whatsappBizAcctFbid,10):typeof e.whatsappBizAcctFbid=="number"?i.whatsappBizAcctFbid=e.whatsappBizAcctFbid:typeof e.whatsappBizAcctFbid=="object"&&(i.whatsappBizAcctFbid=new l.LongBits(e.whatsappBizAcctFbid.low>>>0,e.whatsappBizAcctFbid.high>>>0).toNumber(!0))),e.whatsappAcctNumber!=null&&(i.whatsappAcctNumber=String(e.whatsappAcctNumber)),e.issueTime!=null&&(l.Long?(i.issueTime=l.Long.fromValue(e.issueTime)).unsigned=!0:typeof e.issueTime=="string"?i.issueTime=parseInt(e.issueTime,10):typeof e.issueTime=="number"?i.issueTime=e.issueTime:typeof e.issueTime=="object"&&(i.issueTime=new l.LongBits(e.issueTime.low>>>0,e.issueTime.high>>>0).toNumber(!0))),e.hostStorage){default:if(typeof e.hostStorage=="number"){i.hostStorage=e.hostStorage;break}break;case"ON_PREMISE":case 0:i.hostStorage=0;break;case"FACEBOOK":case 1:i.hostStorage=1;break}switch(e.accountType){default:if(typeof e.accountType=="number"){i.accountType=e.accountType;break}break;case"ENTERPRISE":case 0:i.accountType=0;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.whatsappBizAcctFbid!=null&&e.hasOwnProperty("whatsappBizAcctFbid")&&(typeof e.whatsappBizAcctFbid=="number"?A.whatsappBizAcctFbid=i.longs===String?String(e.whatsappBizAcctFbid):e.whatsappBizAcctFbid:A.whatsappBizAcctFbid=i.longs===String?ge(e.whatsappBizAcctFbid,!0):i.longs===Number?ce(e.whatsappBizAcctFbid,!0):e.whatsappBizAcctFbid,i.oneofs&&(A._whatsappBizAcctFbid="whatsappBizAcctFbid")),e.whatsappAcctNumber!=null&&e.hasOwnProperty("whatsappAcctNumber")&&(A.whatsappAcctNumber=e.whatsappAcctNumber,i.oneofs&&(A._whatsappAcctNumber="whatsappAcctNumber")),e.issueTime!=null&&e.hasOwnProperty("issueTime")&&(typeof e.issueTime=="number"?A.issueTime=i.longs===String?String(e.issueTime):e.issueTime:A.issueTime=i.longs===String?ge(e.issueTime,!0):i.longs===Number?ce(e.issueTime,!0):e.issueTime,i.oneofs&&(A._issueTime="issueTime")),e.hostStorage!=null&&e.hasOwnProperty("hostStorage")&&(A.hostStorage=i.enums===String?d.proto.BizAccountLinkInfo.HostStorageType[e.hostStorage]===void 0?e.hostStorage:d.proto.BizAccountLinkInfo.HostStorageType[e.hostStorage]:e.hostStorage,i.oneofs&&(A._hostStorage="hostStorage")),e.accountType!=null&&e.hasOwnProperty("accountType")&&(A.accountType=i.enums===String?d.proto.BizAccountLinkInfo.AccountType[e.accountType]===void 0?e.accountType:d.proto.BizAccountLinkInfo.AccountType[e.accountType]:e.accountType,i.oneofs&&(A._accountType="accountType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizAccountLinkInfo"},t.AccountType=(function(){let a={},e=Object.create(a);return e[a[0]="ENTERPRISE"]=0,e})(),t.HostStorageType=(function(){let a={},e=Object.create(a);return e[a[0]="ON_PREMISE"]=0,e[a[1]="FACEBOOK"]=1,e})(),t})(),n.BizAccountPayload=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.vnameCert=d.proto.VerifiedNameCertificate.decode(e,e.uint32());break}case 2:{s.bizAcctLinkInfo=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BizAccountPayload)return e;var i=new d.proto.BizAccountPayload;if(e.vnameCert!=null){if(typeof e.vnameCert!="object")throw TypeError(".proto.BizAccountPayload.vnameCert: object expected");i.vnameCert=d.proto.VerifiedNameCertificate.fromObject(e.vnameCert)}return e.bizAcctLinkInfo!=null&&(typeof e.bizAcctLinkInfo=="string"?l.base64.decode(e.bizAcctLinkInfo,i.bizAcctLinkInfo=l.newBuffer(l.base64.length(e.bizAcctLinkInfo)),0):e.bizAcctLinkInfo.length>=0&&(i.bizAcctLinkInfo=e.bizAcctLinkInfo)),i},t.toObject=function(e,i){i||(i={});var A={};return e.vnameCert!=null&&e.hasOwnProperty("vnameCert")&&(A.vnameCert=d.proto.VerifiedNameCertificate.toObject(e.vnameCert,i),i.oneofs&&(A._vnameCert="vnameCert")),e.bizAcctLinkInfo!=null&&e.hasOwnProperty("bizAcctLinkInfo")&&(A.bizAcctLinkInfo=i.bytes===String?l.base64.encode(e.bizAcctLinkInfo,0,e.bizAcctLinkInfo.length):i.bytes===Array?Array.prototype.slice.call(e.bizAcctLinkInfo):e.bizAcctLinkInfo,i.oneofs&&(A._bizAcctLinkInfo="bizAcctLinkInfo")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizAccountPayload"},t})(),n.BizIdentityInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.vlevel=e.int32();break}case 2:{s.vnameCert=d.proto.VerifiedNameCertificate.decode(e,e.uint32());break}case 3:{s.signed=e.bool();break}case 4:{s.revoked=e.bool();break}case 5:{s.hostStorage=e.int32();break}case 6:{s.actualActors=e.int32();break}case 7:{s.privacyModeTs=e.uint64();break}case 8:{s.featureControls=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BizIdentityInfo)return e;var i=new d.proto.BizIdentityInfo;switch(e.vlevel){default:if(typeof e.vlevel=="number"){i.vlevel=e.vlevel;break}break;case"UNKNOWN":case 0:i.vlevel=0;break;case"LOW":case 1:i.vlevel=1;break;case"HIGH":case 2:i.vlevel=2;break}if(e.vnameCert!=null){if(typeof e.vnameCert!="object")throw TypeError(".proto.BizIdentityInfo.vnameCert: object expected");i.vnameCert=d.proto.VerifiedNameCertificate.fromObject(e.vnameCert)}switch(e.signed!=null&&(i.signed=!!e.signed),e.revoked!=null&&(i.revoked=!!e.revoked),e.hostStorage){default:if(typeof e.hostStorage=="number"){i.hostStorage=e.hostStorage;break}break;case"ON_PREMISE":case 0:i.hostStorage=0;break;case"FACEBOOK":case 1:i.hostStorage=1;break}switch(e.actualActors){default:if(typeof e.actualActors=="number"){i.actualActors=e.actualActors;break}break;case"SELF":case 0:i.actualActors=0;break;case"BSP":case 1:i.actualActors=1;break}return e.privacyModeTs!=null&&(l.Long?(i.privacyModeTs=l.Long.fromValue(e.privacyModeTs)).unsigned=!0:typeof e.privacyModeTs=="string"?i.privacyModeTs=parseInt(e.privacyModeTs,10):typeof e.privacyModeTs=="number"?i.privacyModeTs=e.privacyModeTs:typeof e.privacyModeTs=="object"&&(i.privacyModeTs=new l.LongBits(e.privacyModeTs.low>>>0,e.privacyModeTs.high>>>0).toNumber(!0))),e.featureControls!=null&&(l.Long?(i.featureControls=l.Long.fromValue(e.featureControls)).unsigned=!0:typeof e.featureControls=="string"?i.featureControls=parseInt(e.featureControls,10):typeof e.featureControls=="number"?i.featureControls=e.featureControls:typeof e.featureControls=="object"&&(i.featureControls=new l.LongBits(e.featureControls.low>>>0,e.featureControls.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};return e.vlevel!=null&&e.hasOwnProperty("vlevel")&&(A.vlevel=i.enums===String?d.proto.BizIdentityInfo.VerifiedLevelValue[e.vlevel]===void 0?e.vlevel:d.proto.BizIdentityInfo.VerifiedLevelValue[e.vlevel]:e.vlevel,i.oneofs&&(A._vlevel="vlevel")),e.vnameCert!=null&&e.hasOwnProperty("vnameCert")&&(A.vnameCert=d.proto.VerifiedNameCertificate.toObject(e.vnameCert,i),i.oneofs&&(A._vnameCert="vnameCert")),e.signed!=null&&e.hasOwnProperty("signed")&&(A.signed=e.signed,i.oneofs&&(A._signed="signed")),e.revoked!=null&&e.hasOwnProperty("revoked")&&(A.revoked=e.revoked,i.oneofs&&(A._revoked="revoked")),e.hostStorage!=null&&e.hasOwnProperty("hostStorage")&&(A.hostStorage=i.enums===String?d.proto.BizIdentityInfo.HostStorageType[e.hostStorage]===void 0?e.hostStorage:d.proto.BizIdentityInfo.HostStorageType[e.hostStorage]:e.hostStorage,i.oneofs&&(A._hostStorage="hostStorage")),e.actualActors!=null&&e.hasOwnProperty("actualActors")&&(A.actualActors=i.enums===String?d.proto.BizIdentityInfo.ActualActorsType[e.actualActors]===void 0?e.actualActors:d.proto.BizIdentityInfo.ActualActorsType[e.actualActors]:e.actualActors,i.oneofs&&(A._actualActors="actualActors")),e.privacyModeTs!=null&&e.hasOwnProperty("privacyModeTs")&&(typeof e.privacyModeTs=="number"?A.privacyModeTs=i.longs===String?String(e.privacyModeTs):e.privacyModeTs:A.privacyModeTs=i.longs===String?ge(e.privacyModeTs,!0):i.longs===Number?ce(e.privacyModeTs,!0):e.privacyModeTs,i.oneofs&&(A._privacyModeTs="privacyModeTs")),e.featureControls!=null&&e.hasOwnProperty("featureControls")&&(typeof e.featureControls=="number"?A.featureControls=i.longs===String?String(e.featureControls):e.featureControls:A.featureControls=i.longs===String?ge(e.featureControls,!0):i.longs===Number?ce(e.featureControls,!0):e.featureControls,i.oneofs&&(A._featureControls="featureControls")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BizIdentityInfo"},t.ActualActorsType=(function(){let a={},e=Object.create(a);return e[a[0]="SELF"]=0,e[a[1]="BSP"]=1,e})(),t.HostStorageType=(function(){let a={},e=Object.create(a);return e[a[0]="ON_PREMISE"]=0,e[a[1]="FACEBOOK"]=1,e})(),t.VerifiedLevelValue=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="LOW"]=1,e[a[2]="HIGH"]=2,e})(),t})(),n.BotAgeCollectionMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.ageCollectionEligible=e.bool();break}case 2:{s.shouldTriggerAgeCollectionOnClient=e.bool();break}case 3:{s.ageCollectionType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotAgeCollectionMetadata)return e;var i=new d.proto.BotAgeCollectionMetadata;switch(e.ageCollectionEligible!=null&&(i.ageCollectionEligible=!!e.ageCollectionEligible),e.shouldTriggerAgeCollectionOnClient!=null&&(i.shouldTriggerAgeCollectionOnClient=!!e.shouldTriggerAgeCollectionOnClient),e.ageCollectionType){default:if(typeof e.ageCollectionType=="number"){i.ageCollectionType=e.ageCollectionType;break}break;case"O18_BINARY":case 0:i.ageCollectionType=0;break;case"WAFFLE":case 1:i.ageCollectionType=1;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.ageCollectionEligible!=null&&e.hasOwnProperty("ageCollectionEligible")&&(A.ageCollectionEligible=e.ageCollectionEligible,i.oneofs&&(A._ageCollectionEligible="ageCollectionEligible")),e.shouldTriggerAgeCollectionOnClient!=null&&e.hasOwnProperty("shouldTriggerAgeCollectionOnClient")&&(A.shouldTriggerAgeCollectionOnClient=e.shouldTriggerAgeCollectionOnClient,i.oneofs&&(A._shouldTriggerAgeCollectionOnClient="shouldTriggerAgeCollectionOnClient")),e.ageCollectionType!=null&&e.hasOwnProperty("ageCollectionType")&&(A.ageCollectionType=i.enums===String?d.proto.BotAgeCollectionMetadata.AgeCollectionType[e.ageCollectionType]===void 0?e.ageCollectionType:d.proto.BotAgeCollectionMetadata.AgeCollectionType[e.ageCollectionType]:e.ageCollectionType,i.oneofs&&(A._ageCollectionType="ageCollectionType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotAgeCollectionMetadata"},t.AgeCollectionType=(function(){let a={},e=Object.create(a);return e[a[0]="O18_BINARY"]=0,e[a[1]="WAFFLE"]=1,e})(),t})(),n.BotAvatarMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.sentiment=e.uint32();break}case 2:{s.behaviorGraph=e.string();break}case 3:{s.action=e.uint32();break}case 4:{s.intensity=e.uint32();break}case 5:{s.wordCount=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotAvatarMetadata)return e;var i=new d.proto.BotAvatarMetadata;return e.sentiment!=null&&(i.sentiment=e.sentiment>>>0),e.behaviorGraph!=null&&(i.behaviorGraph=String(e.behaviorGraph)),e.action!=null&&(i.action=e.action>>>0),e.intensity!=null&&(i.intensity=e.intensity>>>0),e.wordCount!=null&&(i.wordCount=e.wordCount>>>0),i},t.toObject=function(e,i){i||(i={});var A={};return e.sentiment!=null&&e.hasOwnProperty("sentiment")&&(A.sentiment=e.sentiment,i.oneofs&&(A._sentiment="sentiment")),e.behaviorGraph!=null&&e.hasOwnProperty("behaviorGraph")&&(A.behaviorGraph=e.behaviorGraph,i.oneofs&&(A._behaviorGraph="behaviorGraph")),e.action!=null&&e.hasOwnProperty("action")&&(A.action=e.action,i.oneofs&&(A._action="action")),e.intensity!=null&&e.hasOwnProperty("intensity")&&(A.intensity=e.intensity,i.oneofs&&(A._intensity="intensity")),e.wordCount!=null&&e.hasOwnProperty("wordCount")&&(A.wordCount=e.wordCount,i.oneofs&&(A._wordCount="wordCount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotAvatarMetadata"},t})(),n.BotCapabilityMetadata=(function(){function t(o){if(this.capabilities=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{if(r.capabilities&&r.capabilities.length||(r.capabilities=[]),(s&7)===2)for(var g=a.uint32()+a.pos;a.pos>>3){case 1:{s.messageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.kind=e.int32();break}case 3:{s.text=e.string();break}case 4:{s.kindNegative=e.uint64();break}case 5:{s.kindPositive=e.uint64();break}case 6:{s.kindReport=e.int32();break}case 7:{s.sideBySideSurveyMetadata=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotFeedbackMessage)return e;var i=new d.proto.BotFeedbackMessage;if(e.messageKey!=null){if(typeof e.messageKey!="object")throw TypeError(".proto.BotFeedbackMessage.messageKey: object expected");i.messageKey=d.proto.MessageKey.fromObject(e.messageKey)}switch(e.kind){default:if(typeof e.kind=="number"){i.kind=e.kind;break}break;case"BOT_FEEDBACK_POSITIVE":case 0:i.kind=0;break;case"BOT_FEEDBACK_NEGATIVE_GENERIC":case 1:i.kind=1;break;case"BOT_FEEDBACK_NEGATIVE_HELPFUL":case 2:i.kind=2;break;case"BOT_FEEDBACK_NEGATIVE_INTERESTING":case 3:i.kind=3;break;case"BOT_FEEDBACK_NEGATIVE_ACCURATE":case 4:i.kind=4;break;case"BOT_FEEDBACK_NEGATIVE_SAFE":case 5:i.kind=5;break;case"BOT_FEEDBACK_NEGATIVE_OTHER":case 6:i.kind=6;break;case"BOT_FEEDBACK_NEGATIVE_REFUSED":case 7:i.kind=7;break;case"BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING":case 8:i.kind=8;break;case"BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT":case 9:i.kind=9;break;case"BOT_FEEDBACK_NEGATIVE_PERSONALIZED":case 10:i.kind=10;break;case"BOT_FEEDBACK_NEGATIVE_CLARITY":case 11:i.kind=11;break;case"BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON":case 12:i.kind=12;break;case"BOT_FEEDBACK_NEGATIVE_HALLUCINATION_INTERNAL_ONLY":case 13:i.kind=13;break;case"BOT_FEEDBACK_NEGATIVE":case 14:i.kind=14;break}switch(e.text!=null&&(i.text=String(e.text)),e.kindNegative!=null&&(l.Long?(i.kindNegative=l.Long.fromValue(e.kindNegative)).unsigned=!0:typeof e.kindNegative=="string"?i.kindNegative=parseInt(e.kindNegative,10):typeof e.kindNegative=="number"?i.kindNegative=e.kindNegative:typeof e.kindNegative=="object"&&(i.kindNegative=new l.LongBits(e.kindNegative.low>>>0,e.kindNegative.high>>>0).toNumber(!0))),e.kindPositive!=null&&(l.Long?(i.kindPositive=l.Long.fromValue(e.kindPositive)).unsigned=!0:typeof e.kindPositive=="string"?i.kindPositive=parseInt(e.kindPositive,10):typeof e.kindPositive=="number"?i.kindPositive=e.kindPositive:typeof e.kindPositive=="object"&&(i.kindPositive=new l.LongBits(e.kindPositive.low>>>0,e.kindPositive.high>>>0).toNumber(!0))),e.kindReport){default:if(typeof e.kindReport=="number"){i.kindReport=e.kindReport;break}break;case"NONE":case 0:i.kindReport=0;break;case"GENERIC":case 1:i.kindReport=1;break}if(e.sideBySideSurveyMetadata!=null){if(typeof e.sideBySideSurveyMetadata!="object")throw TypeError(".proto.BotFeedbackMessage.sideBySideSurveyMetadata: object expected");i.sideBySideSurveyMetadata=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.fromObject(e.sideBySideSurveyMetadata)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.messageKey!=null&&e.hasOwnProperty("messageKey")&&(A.messageKey=d.proto.MessageKey.toObject(e.messageKey,i),i.oneofs&&(A._messageKey="messageKey")),e.kind!=null&&e.hasOwnProperty("kind")&&(A.kind=i.enums===String?d.proto.BotFeedbackMessage.BotFeedbackKind[e.kind]===void 0?e.kind:d.proto.BotFeedbackMessage.BotFeedbackKind[e.kind]:e.kind,i.oneofs&&(A._kind="kind")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,i.oneofs&&(A._text="text")),e.kindNegative!=null&&e.hasOwnProperty("kindNegative")&&(typeof e.kindNegative=="number"?A.kindNegative=i.longs===String?String(e.kindNegative):e.kindNegative:A.kindNegative=i.longs===String?ge(e.kindNegative,!0):i.longs===Number?ce(e.kindNegative,!0):e.kindNegative,i.oneofs&&(A._kindNegative="kindNegative")),e.kindPositive!=null&&e.hasOwnProperty("kindPositive")&&(typeof e.kindPositive=="number"?A.kindPositive=i.longs===String?String(e.kindPositive):e.kindPositive:A.kindPositive=i.longs===String?ge(e.kindPositive,!0):i.longs===Number?ce(e.kindPositive,!0):e.kindPositive,i.oneofs&&(A._kindPositive="kindPositive")),e.kindReport!=null&&e.hasOwnProperty("kindReport")&&(A.kindReport=i.enums===String?d.proto.BotFeedbackMessage.ReportKind[e.kindReport]===void 0?e.kindReport:d.proto.BotFeedbackMessage.ReportKind[e.kindReport]:e.kindReport,i.oneofs&&(A._kindReport="kindReport")),e.sideBySideSurveyMetadata!=null&&e.hasOwnProperty("sideBySideSurveyMetadata")&&(A.sideBySideSurveyMetadata=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.toObject(e.sideBySideSurveyMetadata,i),i.oneofs&&(A._sideBySideSurveyMetadata="sideBySideSurveyMetadata")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotFeedbackMessage"},t.BotFeedbackKind=(function(){let a={},e=Object.create(a);return e[a[0]="BOT_FEEDBACK_POSITIVE"]=0,e[a[1]="BOT_FEEDBACK_NEGATIVE_GENERIC"]=1,e[a[2]="BOT_FEEDBACK_NEGATIVE_HELPFUL"]=2,e[a[3]="BOT_FEEDBACK_NEGATIVE_INTERESTING"]=3,e[a[4]="BOT_FEEDBACK_NEGATIVE_ACCURATE"]=4,e[a[5]="BOT_FEEDBACK_NEGATIVE_SAFE"]=5,e[a[6]="BOT_FEEDBACK_NEGATIVE_OTHER"]=6,e[a[7]="BOT_FEEDBACK_NEGATIVE_REFUSED"]=7,e[a[8]="BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING"]=8,e[a[9]="BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT"]=9,e[a[10]="BOT_FEEDBACK_NEGATIVE_PERSONALIZED"]=10,e[a[11]="BOT_FEEDBACK_NEGATIVE_CLARITY"]=11,e[a[12]="BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON"]=12,e[a[13]="BOT_FEEDBACK_NEGATIVE_HALLUCINATION_INTERNAL_ONLY"]=13,e[a[14]="BOT_FEEDBACK_NEGATIVE"]=14,e})(),t.BotFeedbackKindMultipleNegative=(function(){let a={},e=Object.create(a);return e[a[1]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_GENERIC"]=1,e[a[2]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_HELPFUL"]=2,e[a[4]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_INTERESTING"]=4,e[a[8]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_ACCURATE"]=8,e[a[16]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_SAFE"]=16,e[a[32]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_OTHER"]=32,e[a[64]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_REFUSED"]=64,e[a[128]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_VISUALLY_APPEALING"]=128,e[a[256]="BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_RELEVANT_TO_TEXT"]=256,e})(),t.BotFeedbackKindMultiplePositive=(function(){let a={},e=Object.create(a);return e[a[1]="BOT_FEEDBACK_MULTIPLE_POSITIVE_GENERIC"]=1,e})(),t.ReportKind=(function(){let a={},e=Object.create(a);return e[a[0]="NONE"]=0,e[a[1]="GENERIC"]=1,e})(),t.SideBySideSurveyMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.selectedRequestId=A.string();break}case 2:{c.surveyId=A.uint32();break}case 3:{c.simonSessionFbid=A.string();break}case 4:{c.responseOtid=A.string();break}case 5:{c.responseTimestampMsString=A.string();break}case 6:{c.isSelectedResponsePrimary=A.bool();break}case 7:{c.messageIdToEdit=A.string();break}case 8:{c.analyticsData=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.decode(A,A.uint32());break}case 9:{c.metaAiAnalyticsData=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata)return A;var r=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata;if(A.selectedRequestId!=null&&(r.selectedRequestId=String(A.selectedRequestId)),A.surveyId!=null&&(r.surveyId=A.surveyId>>>0),A.simonSessionFbid!=null&&(r.simonSessionFbid=String(A.simonSessionFbid)),A.responseOtid!=null&&(r.responseOtid=String(A.responseOtid)),A.responseTimestampMsString!=null&&(r.responseTimestampMsString=String(A.responseTimestampMsString)),A.isSelectedResponsePrimary!=null&&(r.isSelectedResponsePrimary=!!A.isSelectedResponsePrimary),A.messageIdToEdit!=null&&(r.messageIdToEdit=String(A.messageIdToEdit)),A.analyticsData!=null){if(typeof A.analyticsData!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.analyticsData: object expected");r.analyticsData=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.fromObject(A.analyticsData)}if(A.metaAiAnalyticsData!=null){if(typeof A.metaAiAnalyticsData!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.metaAiAnalyticsData: object expected");r.metaAiAnalyticsData=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.fromObject(A.metaAiAnalyticsData)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.selectedRequestId!=null&&A.hasOwnProperty("selectedRequestId")&&(s.selectedRequestId=A.selectedRequestId,r.oneofs&&(s._selectedRequestId="selectedRequestId")),A.surveyId!=null&&A.hasOwnProperty("surveyId")&&(s.surveyId=A.surveyId,r.oneofs&&(s._surveyId="surveyId")),A.simonSessionFbid!=null&&A.hasOwnProperty("simonSessionFbid")&&(s.simonSessionFbid=A.simonSessionFbid,r.oneofs&&(s._simonSessionFbid="simonSessionFbid")),A.responseOtid!=null&&A.hasOwnProperty("responseOtid")&&(s.responseOtid=A.responseOtid,r.oneofs&&(s._responseOtid="responseOtid")),A.responseTimestampMsString!=null&&A.hasOwnProperty("responseTimestampMsString")&&(s.responseTimestampMsString=A.responseTimestampMsString,r.oneofs&&(s._responseTimestampMsString="responseTimestampMsString")),A.isSelectedResponsePrimary!=null&&A.hasOwnProperty("isSelectedResponsePrimary")&&(s.isSelectedResponsePrimary=A.isSelectedResponsePrimary,r.oneofs&&(s._isSelectedResponsePrimary="isSelectedResponsePrimary")),A.messageIdToEdit!=null&&A.hasOwnProperty("messageIdToEdit")&&(s.messageIdToEdit=A.messageIdToEdit,r.oneofs&&(s._messageIdToEdit="messageIdToEdit")),A.analyticsData!=null&&A.hasOwnProperty("analyticsData")&&(s.analyticsData=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData.toObject(A.analyticsData,r),r.oneofs&&(s._analyticsData="analyticsData")),A.metaAiAnalyticsData!=null&&A.hasOwnProperty("metaAiAnalyticsData")&&(s.metaAiAnalyticsData=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.toObject(A.metaAiAnalyticsData,r),r.oneofs&&(s._metaAiAnalyticsData="metaAiAnalyticsData")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata"},a.SideBySideSurveyAnalyticsData=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.tessaEvent=s.string();break}case 2:{p.tessaSessionFbid=s.string();break}case 3:{p.simonSessionFbid=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData)return s;var g=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData;return s.tessaEvent!=null&&(g.tessaEvent=String(s.tessaEvent)),s.tessaSessionFbid!=null&&(g.tessaSessionFbid=String(s.tessaSessionFbid)),s.simonSessionFbid!=null&&(g.simonSessionFbid=String(s.simonSessionFbid)),g},i.toObject=function(s,g){g||(g={});var c={};return s.tessaEvent!=null&&s.hasOwnProperty("tessaEvent")&&(c.tessaEvent=s.tessaEvent,g.oneofs&&(c._tessaEvent="tessaEvent")),s.tessaSessionFbid!=null&&s.hasOwnProperty("tessaSessionFbid")&&(c.tessaSessionFbid=s.tessaSessionFbid,g.oneofs&&(c._tessaSessionFbid="tessaSessionFbid")),s.simonSessionFbid!=null&&s.hasOwnProperty("simonSessionFbid")&&(c.simonSessionFbid=s.simonSessionFbid,g.oneofs&&(c._simonSessionFbid="simonSessionFbid")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SideBySideSurveyAnalyticsData"},i})(),a.SidebySideSurveyMetaAiAnalyticsData=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.surveyId=s.uint32();break}case 2:{p.primaryResponseId=s.string();break}case 3:{p.testArmName=s.string();break}case 4:{p.timestampMsString=s.string();break}case 5:{p.ctaImpressionEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.decode(s,s.uint32());break}case 6:{p.ctaClickEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.decode(s,s.uint32());break}case 7:{p.cardImpressionEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.decode(s,s.uint32());break}case 8:{p.responseEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.decode(s,s.uint32());break}case 9:{p.abandonEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData)return s;var g=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData;if(s.surveyId!=null&&(g.surveyId=s.surveyId>>>0),s.primaryResponseId!=null&&(g.primaryResponseId=String(s.primaryResponseId)),s.testArmName!=null&&(g.testArmName=String(s.testArmName)),s.timestampMsString!=null&&(g.timestampMsString=String(s.timestampMsString)),s.ctaImpressionEvent!=null){if(typeof s.ctaImpressionEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.ctaImpressionEvent: object expected");g.ctaImpressionEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.fromObject(s.ctaImpressionEvent)}if(s.ctaClickEvent!=null){if(typeof s.ctaClickEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.ctaClickEvent: object expected");g.ctaClickEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.fromObject(s.ctaClickEvent)}if(s.cardImpressionEvent!=null){if(typeof s.cardImpressionEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.cardImpressionEvent: object expected");g.cardImpressionEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.fromObject(s.cardImpressionEvent)}if(s.responseEvent!=null){if(typeof s.responseEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.responseEvent: object expected");g.responseEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.fromObject(s.responseEvent)}if(s.abandonEvent!=null){if(typeof s.abandonEvent!="object")throw TypeError(".proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.abandonEvent: object expected");g.abandonEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.fromObject(s.abandonEvent)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.surveyId!=null&&s.hasOwnProperty("surveyId")&&(c.surveyId=s.surveyId,g.oneofs&&(c._surveyId="surveyId")),s.primaryResponseId!=null&&s.hasOwnProperty("primaryResponseId")&&(c.primaryResponseId=s.primaryResponseId,g.oneofs&&(c._primaryResponseId="primaryResponseId")),s.testArmName!=null&&s.hasOwnProperty("testArmName")&&(c.testArmName=s.testArmName,g.oneofs&&(c._testArmName="testArmName")),s.timestampMsString!=null&&s.hasOwnProperty("timestampMsString")&&(c.timestampMsString=s.timestampMsString,g.oneofs&&(c._timestampMsString="timestampMsString")),s.ctaImpressionEvent!=null&&s.hasOwnProperty("ctaImpressionEvent")&&(c.ctaImpressionEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData.toObject(s.ctaImpressionEvent,g),g.oneofs&&(c._ctaImpressionEvent="ctaImpressionEvent")),s.ctaClickEvent!=null&&s.hasOwnProperty("ctaClickEvent")&&(c.ctaClickEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData.toObject(s.ctaClickEvent,g),g.oneofs&&(c._ctaClickEvent="ctaClickEvent")),s.cardImpressionEvent!=null&&s.hasOwnProperty("cardImpressionEvent")&&(c.cardImpressionEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData.toObject(s.cardImpressionEvent,g),g.oneofs&&(c._cardImpressionEvent="cardImpressionEvent")),s.responseEvent!=null&&s.hasOwnProperty("responseEvent")&&(c.responseEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData.toObject(s.responseEvent,g),g.oneofs&&(c._responseEvent="responseEvent")),s.abandonEvent!=null&&s.hasOwnProperty("abandonEvent")&&(c.abandonEvent=d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData.toObject(s.abandonEvent,g),g.oneofs&&(c._abandonEvent="abandonEvent")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData"},i.SideBySideSurveyAbandonEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.abandonDwellTimeMsString=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData)return c;var I=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData;return c.abandonDwellTimeMsString!=null&&(I.abandonDwellTimeMsString=String(c.abandonDwellTimeMsString)),I},r.toObject=function(c,I){I||(I={});var p={};return c.abandonDwellTimeMsString!=null&&c.hasOwnProperty("abandonDwellTimeMsString")&&(p.abandonDwellTimeMsString=c.abandonDwellTimeMsString,I.oneofs&&(p._abandonDwellTimeMsString="abandonDwellTimeMsString")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyAbandonEventData"},r})(),i.SideBySideSurveyCTAClickEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.isSurveyExpired=c.bool();break}case 2:{f.clickDwellTimeMsString=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData)return c;var I=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData;return c.isSurveyExpired!=null&&(I.isSurveyExpired=!!c.isSurveyExpired),c.clickDwellTimeMsString!=null&&(I.clickDwellTimeMsString=String(c.clickDwellTimeMsString)),I},r.toObject=function(c,I){I||(I={});var p={};return c.isSurveyExpired!=null&&c.hasOwnProperty("isSurveyExpired")&&(p.isSurveyExpired=c.isSurveyExpired,I.oneofs&&(p._isSurveyExpired="isSurveyExpired")),c.clickDwellTimeMsString!=null&&c.hasOwnProperty("clickDwellTimeMsString")&&(p.clickDwellTimeMsString=c.clickDwellTimeMsString,I.oneofs&&(p._clickDwellTimeMsString="clickDwellTimeMsString")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAClickEventData"},r})(),i.SideBySideSurveyCTAImpressionEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.isSurveyExpired=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData)return c;var I=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData;return c.isSurveyExpired!=null&&(I.isSurveyExpired=!!c.isSurveyExpired),I},r.toObject=function(c,I){I||(I={});var p={};return c.isSurveyExpired!=null&&c.hasOwnProperty("isSurveyExpired")&&(p.isSurveyExpired=c.isSurveyExpired,I.oneofs&&(p._isSurveyExpired="isSurveyExpired")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCTAImpressionEventData"},r})(),i.SideBySideSurveyCardImpressionEventData=(function(){function r(s){if(s)for(var g=Object.keys(s),c=0;c>>3){default:g.skipType(f&7);break}}return B},r.fromObject=function(g){return g instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData?g:new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData},r.toObject=function(){return{}},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(g){return g===void 0&&(g="type.googleapis.com"),g+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyCardImpressionEventData"},r})(),i.SideBySideSurveyResponseEventData=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.responseDwellTimeMsString=c.string();break}case 2:{f.selectedResponseId=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData)return c;var I=new d.proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData;return c.responseDwellTimeMsString!=null&&(I.responseDwellTimeMsString=String(c.responseDwellTimeMsString)),c.selectedResponseId!=null&&(I.selectedResponseId=String(c.selectedResponseId)),I},r.toObject=function(c,I){I||(I={});var p={};return c.responseDwellTimeMsString!=null&&c.hasOwnProperty("responseDwellTimeMsString")&&(p.responseDwellTimeMsString=c.responseDwellTimeMsString,I.oneofs&&(p._responseDwellTimeMsString="responseDwellTimeMsString")),c.selectedResponseId!=null&&c.hasOwnProperty("selectedResponseId")&&(p.selectedResponseId=c.selectedResponseId,I.oneofs&&(p._selectedResponseId="selectedResponseId")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.BotFeedbackMessage.SideBySideSurveyMetadata.SidebySideSurveyMetaAiAnalyticsData.SideBySideSurveyResponseEventData"},r})(),i})(),a})(),t})(),n.BotImagineMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.imagineType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotImagineMetadata)return e;var i=new d.proto.BotImagineMetadata;switch(e.imagineType){default:if(typeof e.imagineType=="number"){i.imagineType=e.imagineType;break}break;case"UNKNOWN":case 0:i.imagineType=0;break;case"IMAGINE":case 1:i.imagineType=1;break;case"MEMU":case 2:i.imagineType=2;break;case"FLASH":case 3:i.imagineType=3;break;case"EDIT":case 4:i.imagineType=4;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.imagineType!=null&&e.hasOwnProperty("imagineType")&&(A.imagineType=i.enums===String?d.proto.BotImagineMetadata.ImagineType[e.imagineType]===void 0?e.imagineType:d.proto.BotImagineMetadata.ImagineType[e.imagineType]:e.imagineType,i.oneofs&&(A._imagineType="imagineType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotImagineMetadata"},t.ImagineType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="IMAGINE"]=1,e[a[2]="MEMU"]=2,e[a[3]="FLASH"]=3,e[a[4]="EDIT"]=4,e})(),t})(),n.BotLinkedAccount=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotLinkedAccount)return e;var i=new d.proto.BotLinkedAccount;switch(e.type){default:if(typeof e.type=="number"){i.type=e.type;break}break;case"BOT_LINKED_ACCOUNT_TYPE_1P":case 0:i.type=0;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=i.enums===String?d.proto.BotLinkedAccount.BotLinkedAccountType[e.type]===void 0?e.type:d.proto.BotLinkedAccount.BotLinkedAccountType[e.type]:e.type,i.oneofs&&(A._type="type")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotLinkedAccount"},t.BotLinkedAccountType=(function(){let a={},e=Object.create(a);return e[a[0]="BOT_LINKED_ACCOUNT_TYPE_1P"]=0,e})(),t})(),n.BotLinkedAccountsMetadata=(function(){function t(a){if(this.accounts=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.accounts&&s.accounts.length||(s.accounts=[]),s.accounts.push(d.proto.BotLinkedAccount.decode(e,e.uint32()));break}case 2:{s.acAuthTokens=e.bytes();break}case 3:{s.acErrorCode=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotLinkedAccountsMetadata)return e;var i=new d.proto.BotLinkedAccountsMetadata;if(e.accounts){if(!Array.isArray(e.accounts))throw TypeError(".proto.BotLinkedAccountsMetadata.accounts: array expected");i.accounts=[];for(var A=0;A=0&&(i.acAuthTokens=e.acAuthTokens)),e.acErrorCode!=null&&(i.acErrorCode=e.acErrorCode|0),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.accounts=[]),e.accounts&&e.accounts.length){A.accounts=[];for(var r=0;r>>3){case 1:{s.fileSha256=e.string();break}case 2:{s.mediaKey=e.string();break}case 3:{s.fileEncSha256=e.string();break}case 4:{s.directPath=e.string();break}case 5:{s.mediaKeyTimestamp=e.int64();break}case 6:{s.mimetype=e.string();break}case 7:{s.orientationType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMediaMetadata)return e;var i=new d.proto.BotMediaMetadata;switch(e.fileSha256!=null&&(i.fileSha256=String(e.fileSha256)),e.mediaKey!=null&&(i.mediaKey=String(e.mediaKey)),e.fileEncSha256!=null&&(i.fileEncSha256=String(e.fileEncSha256)),e.directPath!=null&&(i.directPath=String(e.directPath)),e.mediaKeyTimestamp!=null&&(l.Long?(i.mediaKeyTimestamp=l.Long.fromValue(e.mediaKeyTimestamp)).unsigned=!1:typeof e.mediaKeyTimestamp=="string"?i.mediaKeyTimestamp=parseInt(e.mediaKeyTimestamp,10):typeof e.mediaKeyTimestamp=="number"?i.mediaKeyTimestamp=e.mediaKeyTimestamp:typeof e.mediaKeyTimestamp=="object"&&(i.mediaKeyTimestamp=new l.LongBits(e.mediaKeyTimestamp.low>>>0,e.mediaKeyTimestamp.high>>>0).toNumber())),e.mimetype!=null&&(i.mimetype=String(e.mimetype)),e.orientationType){default:if(typeof e.orientationType=="number"){i.orientationType=e.orientationType;break}break;case"CENTER":case 1:i.orientationType=1;break;case"LEFT":case 2:i.orientationType=2;break;case"RIGHT":case 3:i.orientationType=3;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=e.fileSha256,i.oneofs&&(A._fileSha256="fileSha256")),e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=e.mediaKey,i.oneofs&&(A._mediaKey="mediaKey")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=e.fileEncSha256,i.oneofs&&(A._fileEncSha256="fileEncSha256")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,i.oneofs&&(A._directPath="directPath")),e.mediaKeyTimestamp!=null&&e.hasOwnProperty("mediaKeyTimestamp")&&(typeof e.mediaKeyTimestamp=="number"?A.mediaKeyTimestamp=i.longs===String?String(e.mediaKeyTimestamp):e.mediaKeyTimestamp:A.mediaKeyTimestamp=i.longs===String?ge(e.mediaKeyTimestamp):i.longs===Number?ce(e.mediaKeyTimestamp):e.mediaKeyTimestamp,i.oneofs&&(A._mediaKeyTimestamp="mediaKeyTimestamp")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,i.oneofs&&(A._mimetype="mimetype")),e.orientationType!=null&&e.hasOwnProperty("orientationType")&&(A.orientationType=i.enums===String?d.proto.BotMediaMetadata.OrientationType[e.orientationType]===void 0?e.orientationType:d.proto.BotMediaMetadata.OrientationType[e.orientationType]:e.orientationType,i.oneofs&&(A._orientationType="orientationType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMediaMetadata"},t.OrientationType=(function(){let a={},e=Object.create(a);return e[a[1]="CENTER"]=1,e[a[2]="LEFT"]=2,e[a[3]="RIGHT"]=3,e})(),t})(),n.BotMemoryFact=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.fact=e.string();break}case 2:{s.factId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMemoryFact)return e;var i=new d.proto.BotMemoryFact;return e.fact!=null&&(i.fact=String(e.fact)),e.factId!=null&&(i.factId=String(e.factId)),i},t.toObject=function(e,i){i||(i={});var A={};return e.fact!=null&&e.hasOwnProperty("fact")&&(A.fact=e.fact,i.oneofs&&(A._fact="fact")),e.factId!=null&&e.hasOwnProperty("factId")&&(A.factId=e.factId,i.oneofs&&(A._factId="factId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMemoryFact"},t})(),n.BotMemoryMetadata=(function(){function t(a){if(this.addedFacts=[],this.removedFacts=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.addedFacts&&s.addedFacts.length||(s.addedFacts=[]),s.addedFacts.push(d.proto.BotMemoryFact.decode(e,e.uint32()));break}case 2:{s.removedFacts&&s.removedFacts.length||(s.removedFacts=[]),s.removedFacts.push(d.proto.BotMemoryFact.decode(e,e.uint32()));break}case 3:{s.disclaimer=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMemoryMetadata)return e;var i=new d.proto.BotMemoryMetadata;if(e.addedFacts){if(!Array.isArray(e.addedFacts))throw TypeError(".proto.BotMemoryMetadata.addedFacts: array expected");i.addedFacts=[];for(var A=0;A>>3){case 1:{r.faceImages&&r.faceImages.length||(r.faceImages=[]),r.faceImages.push(d.proto.BotMediaMetadata.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotMemuMetadata)return a;var e=new d.proto.BotMemuMetadata;if(a.faceImages){if(!Array.isArray(a.faceImages))throw TypeError(".proto.BotMemuMetadata.faceImages: array expected");e.faceImages=[];for(var i=0;i>>3){case 1:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMessageOrigin)return e;var i=new d.proto.BotMessageOrigin;switch(e.type){default:if(typeof e.type=="number"){i.type=e.type;break}break;case"BOT_MESSAGE_ORIGIN_TYPE_AI_INITIATED":case 0:i.type=0;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=i.enums===String?d.proto.BotMessageOrigin.BotMessageOriginType[e.type]===void 0?e.type:d.proto.BotMessageOrigin.BotMessageOriginType[e.type]:e.type,i.oneofs&&(A._type="type")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMessageOrigin"},t.BotMessageOriginType=(function(){let a={},e=Object.create(a);return e[a[0]="BOT_MESSAGE_ORIGIN_TYPE_AI_INITIATED"]=0,e})(),t})(),n.BotMessageOriginMetadata=(function(){function t(o){if(this.origins=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.origins&&r.origins.length||(r.origins=[]),r.origins.push(d.proto.BotMessageOrigin.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotMessageOriginMetadata)return a;var e=new d.proto.BotMessageOriginMetadata;if(a.origins){if(!Array.isArray(a.origins))throw TypeError(".proto.BotMessageOriginMetadata.origins: array expected");e.origins=[];for(var i=0;i>>3){case 1:{s.botEntryPointOrigin=e.int32();break}case 2:{s.forwardScore=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMessageSharingInfo)return e;var i=new d.proto.BotMessageSharingInfo;switch(e.botEntryPointOrigin){default:if(typeof e.botEntryPointOrigin=="number"){i.botEntryPointOrigin=e.botEntryPointOrigin;break}break;case"UNDEFINED_ENTRY_POINT":case 0:i.botEntryPointOrigin=0;break;case"FAVICON":case 1:i.botEntryPointOrigin=1;break;case"CHATLIST":case 2:i.botEntryPointOrigin=2;break;case"AISEARCH_NULL_STATE_PAPER_PLANE":case 3:i.botEntryPointOrigin=3;break;case"AISEARCH_NULL_STATE_SUGGESTION":case 4:i.botEntryPointOrigin=4;break;case"AISEARCH_TYPE_AHEAD_SUGGESTION":case 5:i.botEntryPointOrigin=5;break;case"AISEARCH_TYPE_AHEAD_PAPER_PLANE":case 6:i.botEntryPointOrigin=6;break;case"AISEARCH_TYPE_AHEAD_RESULT_CHATLIST":case 7:i.botEntryPointOrigin=7;break;case"AISEARCH_TYPE_AHEAD_RESULT_MESSAGES":case 8:i.botEntryPointOrigin=8;break;case"AIVOICE_SEARCH_BAR":case 9:i.botEntryPointOrigin=9;break;case"AIVOICE_FAVICON":case 10:i.botEntryPointOrigin=10;break;case"AISTUDIO":case 11:i.botEntryPointOrigin=11;break;case"DEEPLINK":case 12:i.botEntryPointOrigin=12;break;case"NOTIFICATION":case 13:i.botEntryPointOrigin=13;break;case"PROFILE_MESSAGE_BUTTON":case 14:i.botEntryPointOrigin=14;break;case"FORWARD":case 15:i.botEntryPointOrigin=15;break;case"APP_SHORTCUT":case 16:i.botEntryPointOrigin=16;break;case"FF_FAMILY":case 17:i.botEntryPointOrigin=17;break;case"AI_TAB":case 18:i.botEntryPointOrigin=18;break;case"AI_HOME":case 19:i.botEntryPointOrigin=19;break;case"AI_DEEPLINK_IMMERSIVE":case 20:i.botEntryPointOrigin=20;break;case"AI_DEEPLINK":case 21:i.botEntryPointOrigin=21;break;case"META_AI_CHAT_SHORTCUT_AI_STUDIO":case 22:i.botEntryPointOrigin=22;break;case"UGC_CHAT_SHORTCUT_AI_STUDIO":case 23:i.botEntryPointOrigin=23;break;case"NEW_CHAT_AI_STUDIO":case 24:i.botEntryPointOrigin=24;break;case"AIVOICE_FAVICON_CALL_HISTORY":case 25:i.botEntryPointOrigin=25;break;case"ASK_META_AI_CONTEXT_MENU":case 26:i.botEntryPointOrigin=26;break;case"ASK_META_AI_CONTEXT_MENU_1ON1":case 27:i.botEntryPointOrigin=27;break;case"ASK_META_AI_CONTEXT_MENU_GROUP":case 28:i.botEntryPointOrigin=28;break;case"INVOKE_META_AI_1ON1":case 29:i.botEntryPointOrigin=29;break;case"INVOKE_META_AI_GROUP":case 30:i.botEntryPointOrigin=30;break;case"META_AI_FORWARD":case 31:i.botEntryPointOrigin=31;break;case"NEW_CHAT_AI_CONTACT":case 32:i.botEntryPointOrigin=32;break;case"MESSAGE_QUICK_ACTION_1_ON_1_CHAT":case 33:i.botEntryPointOrigin=33;break;case"MESSAGE_QUICK_ACTION_GROUP_CHAT":case 34:i.botEntryPointOrigin=34;break;case"ATTACHMENT_TRAY_1_ON_1_CHAT":case 35:i.botEntryPointOrigin=35;break;case"ATTACHMENT_TRAY_GROUP_CHAT":case 36:i.botEntryPointOrigin=36;break;case"ASK_META_AI_MEDIA_VIEWER_1ON1":case 37:i.botEntryPointOrigin=37;break;case"ASK_META_AI_MEDIA_VIEWER_GROUP":case 38:i.botEntryPointOrigin=38;break}return e.forwardScore!=null&&(i.forwardScore=e.forwardScore>>>0),i},t.toObject=function(e,i){i||(i={});var A={};return e.botEntryPointOrigin!=null&&e.hasOwnProperty("botEntryPointOrigin")&&(A.botEntryPointOrigin=i.enums===String?d.proto.BotMetricsEntryPoint[e.botEntryPointOrigin]===void 0?e.botEntryPointOrigin:d.proto.BotMetricsEntryPoint[e.botEntryPointOrigin]:e.botEntryPointOrigin,i.oneofs&&(A._botEntryPointOrigin="botEntryPointOrigin")),e.forwardScore!=null&&e.hasOwnProperty("forwardScore")&&(A.forwardScore=e.forwardScore,i.oneofs&&(A._forwardScore="forwardScore")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMessageSharingInfo"},t})(),n.BotMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.avatarMetadata=d.proto.BotAvatarMetadata.decode(e,e.uint32());break}case 2:{s.personaId=e.string();break}case 3:{s.pluginMetadata=d.proto.BotPluginMetadata.decode(e,e.uint32());break}case 4:{s.suggestedPromptMetadata=d.proto.BotSuggestedPromptMetadata.decode(e,e.uint32());break}case 5:{s.invokerJid=e.string();break}case 6:{s.sessionMetadata=d.proto.BotSessionMetadata.decode(e,e.uint32());break}case 7:{s.memuMetadata=d.proto.BotMemuMetadata.decode(e,e.uint32());break}case 8:{s.timezone=e.string();break}case 9:{s.reminderMetadata=d.proto.BotReminderMetadata.decode(e,e.uint32());break}case 10:{s.modelMetadata=d.proto.BotModelMetadata.decode(e,e.uint32());break}case 11:{s.messageDisclaimerText=e.string();break}case 12:{s.progressIndicatorMetadata=d.proto.BotProgressIndicatorMetadata.decode(e,e.uint32());break}case 13:{s.capabilityMetadata=d.proto.BotCapabilityMetadata.decode(e,e.uint32());break}case 14:{s.imagineMetadata=d.proto.BotImagineMetadata.decode(e,e.uint32());break}case 15:{s.memoryMetadata=d.proto.BotMemoryMetadata.decode(e,e.uint32());break}case 16:{s.renderingMetadata=d.proto.BotRenderingMetadata.decode(e,e.uint32());break}case 17:{s.botMetricsMetadata=d.proto.BotMetricsMetadata.decode(e,e.uint32());break}case 18:{s.botLinkedAccountsMetadata=d.proto.BotLinkedAccountsMetadata.decode(e,e.uint32());break}case 19:{s.richResponseSourcesMetadata=d.proto.BotSourcesMetadata.decode(e,e.uint32());break}case 20:{s.aiConversationContext=e.bytes();break}case 21:{s.botPromotionMessageMetadata=d.proto.BotPromotionMessageMetadata.decode(e,e.uint32());break}case 22:{s.botModeSelectionMetadata=d.proto.BotModeSelectionMetadata.decode(e,e.uint32());break}case 23:{s.botQuotaMetadata=d.proto.BotQuotaMetadata.decode(e,e.uint32());break}case 24:{s.botAgeCollectionMetadata=d.proto.BotAgeCollectionMetadata.decode(e,e.uint32());break}case 25:{s.conversationStarterPromptId=e.string();break}case 26:{s.botResponseId=e.string();break}case 27:{s.verificationMetadata=d.proto.BotSignatureVerificationMetadata.decode(e,e.uint32());break}case 28:{s.unifiedResponseMutation=d.proto.BotUnifiedResponseMutation.decode(e,e.uint32());break}case 29:{s.botMessageOriginMetadata=d.proto.BotMessageOriginMetadata.decode(e,e.uint32());break}case 30:{s.inThreadSurveyMetadata=d.proto.InThreadSurveyMetadata.decode(e,e.uint32());break}case 31:{s.botThreadInfo=d.proto.AIThreadInfo.decode(e,e.uint32());break}case 32:{s.regenerateMetadata=d.proto.AIRegenerateMetadata.decode(e,e.uint32());break}case 33:{s.sessionTransparencyMetadata=d.proto.SessionTransparencyMetadata.decode(e,e.uint32());break}case 999:{s.internalMetadata=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMetadata)return e;var i=new d.proto.BotMetadata;if(e.avatarMetadata!=null){if(typeof e.avatarMetadata!="object")throw TypeError(".proto.BotMetadata.avatarMetadata: object expected");i.avatarMetadata=d.proto.BotAvatarMetadata.fromObject(e.avatarMetadata)}if(e.personaId!=null&&(i.personaId=String(e.personaId)),e.pluginMetadata!=null){if(typeof e.pluginMetadata!="object")throw TypeError(".proto.BotMetadata.pluginMetadata: object expected");i.pluginMetadata=d.proto.BotPluginMetadata.fromObject(e.pluginMetadata)}if(e.suggestedPromptMetadata!=null){if(typeof e.suggestedPromptMetadata!="object")throw TypeError(".proto.BotMetadata.suggestedPromptMetadata: object expected");i.suggestedPromptMetadata=d.proto.BotSuggestedPromptMetadata.fromObject(e.suggestedPromptMetadata)}if(e.invokerJid!=null&&(i.invokerJid=String(e.invokerJid)),e.sessionMetadata!=null){if(typeof e.sessionMetadata!="object")throw TypeError(".proto.BotMetadata.sessionMetadata: object expected");i.sessionMetadata=d.proto.BotSessionMetadata.fromObject(e.sessionMetadata)}if(e.memuMetadata!=null){if(typeof e.memuMetadata!="object")throw TypeError(".proto.BotMetadata.memuMetadata: object expected");i.memuMetadata=d.proto.BotMemuMetadata.fromObject(e.memuMetadata)}if(e.timezone!=null&&(i.timezone=String(e.timezone)),e.reminderMetadata!=null){if(typeof e.reminderMetadata!="object")throw TypeError(".proto.BotMetadata.reminderMetadata: object expected");i.reminderMetadata=d.proto.BotReminderMetadata.fromObject(e.reminderMetadata)}if(e.modelMetadata!=null){if(typeof e.modelMetadata!="object")throw TypeError(".proto.BotMetadata.modelMetadata: object expected");i.modelMetadata=d.proto.BotModelMetadata.fromObject(e.modelMetadata)}if(e.messageDisclaimerText!=null&&(i.messageDisclaimerText=String(e.messageDisclaimerText)),e.progressIndicatorMetadata!=null){if(typeof e.progressIndicatorMetadata!="object")throw TypeError(".proto.BotMetadata.progressIndicatorMetadata: object expected");i.progressIndicatorMetadata=d.proto.BotProgressIndicatorMetadata.fromObject(e.progressIndicatorMetadata)}if(e.capabilityMetadata!=null){if(typeof e.capabilityMetadata!="object")throw TypeError(".proto.BotMetadata.capabilityMetadata: object expected");i.capabilityMetadata=d.proto.BotCapabilityMetadata.fromObject(e.capabilityMetadata)}if(e.imagineMetadata!=null){if(typeof e.imagineMetadata!="object")throw TypeError(".proto.BotMetadata.imagineMetadata: object expected");i.imagineMetadata=d.proto.BotImagineMetadata.fromObject(e.imagineMetadata)}if(e.memoryMetadata!=null){if(typeof e.memoryMetadata!="object")throw TypeError(".proto.BotMetadata.memoryMetadata: object expected");i.memoryMetadata=d.proto.BotMemoryMetadata.fromObject(e.memoryMetadata)}if(e.renderingMetadata!=null){if(typeof e.renderingMetadata!="object")throw TypeError(".proto.BotMetadata.renderingMetadata: object expected");i.renderingMetadata=d.proto.BotRenderingMetadata.fromObject(e.renderingMetadata)}if(e.botMetricsMetadata!=null){if(typeof e.botMetricsMetadata!="object")throw TypeError(".proto.BotMetadata.botMetricsMetadata: object expected");i.botMetricsMetadata=d.proto.BotMetricsMetadata.fromObject(e.botMetricsMetadata)}if(e.botLinkedAccountsMetadata!=null){if(typeof e.botLinkedAccountsMetadata!="object")throw TypeError(".proto.BotMetadata.botLinkedAccountsMetadata: object expected");i.botLinkedAccountsMetadata=d.proto.BotLinkedAccountsMetadata.fromObject(e.botLinkedAccountsMetadata)}if(e.richResponseSourcesMetadata!=null){if(typeof e.richResponseSourcesMetadata!="object")throw TypeError(".proto.BotMetadata.richResponseSourcesMetadata: object expected");i.richResponseSourcesMetadata=d.proto.BotSourcesMetadata.fromObject(e.richResponseSourcesMetadata)}if(e.aiConversationContext!=null&&(typeof e.aiConversationContext=="string"?l.base64.decode(e.aiConversationContext,i.aiConversationContext=l.newBuffer(l.base64.length(e.aiConversationContext)),0):e.aiConversationContext.length>=0&&(i.aiConversationContext=e.aiConversationContext)),e.botPromotionMessageMetadata!=null){if(typeof e.botPromotionMessageMetadata!="object")throw TypeError(".proto.BotMetadata.botPromotionMessageMetadata: object expected");i.botPromotionMessageMetadata=d.proto.BotPromotionMessageMetadata.fromObject(e.botPromotionMessageMetadata)}if(e.botModeSelectionMetadata!=null){if(typeof e.botModeSelectionMetadata!="object")throw TypeError(".proto.BotMetadata.botModeSelectionMetadata: object expected");i.botModeSelectionMetadata=d.proto.BotModeSelectionMetadata.fromObject(e.botModeSelectionMetadata)}if(e.botQuotaMetadata!=null){if(typeof e.botQuotaMetadata!="object")throw TypeError(".proto.BotMetadata.botQuotaMetadata: object expected");i.botQuotaMetadata=d.proto.BotQuotaMetadata.fromObject(e.botQuotaMetadata)}if(e.botAgeCollectionMetadata!=null){if(typeof e.botAgeCollectionMetadata!="object")throw TypeError(".proto.BotMetadata.botAgeCollectionMetadata: object expected");i.botAgeCollectionMetadata=d.proto.BotAgeCollectionMetadata.fromObject(e.botAgeCollectionMetadata)}if(e.conversationStarterPromptId!=null&&(i.conversationStarterPromptId=String(e.conversationStarterPromptId)),e.botResponseId!=null&&(i.botResponseId=String(e.botResponseId)),e.verificationMetadata!=null){if(typeof e.verificationMetadata!="object")throw TypeError(".proto.BotMetadata.verificationMetadata: object expected");i.verificationMetadata=d.proto.BotSignatureVerificationMetadata.fromObject(e.verificationMetadata)}if(e.unifiedResponseMutation!=null){if(typeof e.unifiedResponseMutation!="object")throw TypeError(".proto.BotMetadata.unifiedResponseMutation: object expected");i.unifiedResponseMutation=d.proto.BotUnifiedResponseMutation.fromObject(e.unifiedResponseMutation)}if(e.botMessageOriginMetadata!=null){if(typeof e.botMessageOriginMetadata!="object")throw TypeError(".proto.BotMetadata.botMessageOriginMetadata: object expected");i.botMessageOriginMetadata=d.proto.BotMessageOriginMetadata.fromObject(e.botMessageOriginMetadata)}if(e.inThreadSurveyMetadata!=null){if(typeof e.inThreadSurveyMetadata!="object")throw TypeError(".proto.BotMetadata.inThreadSurveyMetadata: object expected");i.inThreadSurveyMetadata=d.proto.InThreadSurveyMetadata.fromObject(e.inThreadSurveyMetadata)}if(e.botThreadInfo!=null){if(typeof e.botThreadInfo!="object")throw TypeError(".proto.BotMetadata.botThreadInfo: object expected");i.botThreadInfo=d.proto.AIThreadInfo.fromObject(e.botThreadInfo)}if(e.regenerateMetadata!=null){if(typeof e.regenerateMetadata!="object")throw TypeError(".proto.BotMetadata.regenerateMetadata: object expected");i.regenerateMetadata=d.proto.AIRegenerateMetadata.fromObject(e.regenerateMetadata)}if(e.sessionTransparencyMetadata!=null){if(typeof e.sessionTransparencyMetadata!="object")throw TypeError(".proto.BotMetadata.sessionTransparencyMetadata: object expected");i.sessionTransparencyMetadata=d.proto.SessionTransparencyMetadata.fromObject(e.sessionTransparencyMetadata)}return e.internalMetadata!=null&&(typeof e.internalMetadata=="string"?l.base64.decode(e.internalMetadata,i.internalMetadata=l.newBuffer(l.base64.length(e.internalMetadata)),0):e.internalMetadata.length>=0&&(i.internalMetadata=e.internalMetadata)),i},t.toObject=function(e,i){i||(i={});var A={};return e.avatarMetadata!=null&&e.hasOwnProperty("avatarMetadata")&&(A.avatarMetadata=d.proto.BotAvatarMetadata.toObject(e.avatarMetadata,i),i.oneofs&&(A._avatarMetadata="avatarMetadata")),e.personaId!=null&&e.hasOwnProperty("personaId")&&(A.personaId=e.personaId,i.oneofs&&(A._personaId="personaId")),e.pluginMetadata!=null&&e.hasOwnProperty("pluginMetadata")&&(A.pluginMetadata=d.proto.BotPluginMetadata.toObject(e.pluginMetadata,i),i.oneofs&&(A._pluginMetadata="pluginMetadata")),e.suggestedPromptMetadata!=null&&e.hasOwnProperty("suggestedPromptMetadata")&&(A.suggestedPromptMetadata=d.proto.BotSuggestedPromptMetadata.toObject(e.suggestedPromptMetadata,i),i.oneofs&&(A._suggestedPromptMetadata="suggestedPromptMetadata")),e.invokerJid!=null&&e.hasOwnProperty("invokerJid")&&(A.invokerJid=e.invokerJid,i.oneofs&&(A._invokerJid="invokerJid")),e.sessionMetadata!=null&&e.hasOwnProperty("sessionMetadata")&&(A.sessionMetadata=d.proto.BotSessionMetadata.toObject(e.sessionMetadata,i),i.oneofs&&(A._sessionMetadata="sessionMetadata")),e.memuMetadata!=null&&e.hasOwnProperty("memuMetadata")&&(A.memuMetadata=d.proto.BotMemuMetadata.toObject(e.memuMetadata,i),i.oneofs&&(A._memuMetadata="memuMetadata")),e.timezone!=null&&e.hasOwnProperty("timezone")&&(A.timezone=e.timezone,i.oneofs&&(A._timezone="timezone")),e.reminderMetadata!=null&&e.hasOwnProperty("reminderMetadata")&&(A.reminderMetadata=d.proto.BotReminderMetadata.toObject(e.reminderMetadata,i),i.oneofs&&(A._reminderMetadata="reminderMetadata")),e.modelMetadata!=null&&e.hasOwnProperty("modelMetadata")&&(A.modelMetadata=d.proto.BotModelMetadata.toObject(e.modelMetadata,i),i.oneofs&&(A._modelMetadata="modelMetadata")),e.messageDisclaimerText!=null&&e.hasOwnProperty("messageDisclaimerText")&&(A.messageDisclaimerText=e.messageDisclaimerText,i.oneofs&&(A._messageDisclaimerText="messageDisclaimerText")),e.progressIndicatorMetadata!=null&&e.hasOwnProperty("progressIndicatorMetadata")&&(A.progressIndicatorMetadata=d.proto.BotProgressIndicatorMetadata.toObject(e.progressIndicatorMetadata,i),i.oneofs&&(A._progressIndicatorMetadata="progressIndicatorMetadata")),e.capabilityMetadata!=null&&e.hasOwnProperty("capabilityMetadata")&&(A.capabilityMetadata=d.proto.BotCapabilityMetadata.toObject(e.capabilityMetadata,i),i.oneofs&&(A._capabilityMetadata="capabilityMetadata")),e.imagineMetadata!=null&&e.hasOwnProperty("imagineMetadata")&&(A.imagineMetadata=d.proto.BotImagineMetadata.toObject(e.imagineMetadata,i),i.oneofs&&(A._imagineMetadata="imagineMetadata")),e.memoryMetadata!=null&&e.hasOwnProperty("memoryMetadata")&&(A.memoryMetadata=d.proto.BotMemoryMetadata.toObject(e.memoryMetadata,i),i.oneofs&&(A._memoryMetadata="memoryMetadata")),e.renderingMetadata!=null&&e.hasOwnProperty("renderingMetadata")&&(A.renderingMetadata=d.proto.BotRenderingMetadata.toObject(e.renderingMetadata,i),i.oneofs&&(A._renderingMetadata="renderingMetadata")),e.botMetricsMetadata!=null&&e.hasOwnProperty("botMetricsMetadata")&&(A.botMetricsMetadata=d.proto.BotMetricsMetadata.toObject(e.botMetricsMetadata,i),i.oneofs&&(A._botMetricsMetadata="botMetricsMetadata")),e.botLinkedAccountsMetadata!=null&&e.hasOwnProperty("botLinkedAccountsMetadata")&&(A.botLinkedAccountsMetadata=d.proto.BotLinkedAccountsMetadata.toObject(e.botLinkedAccountsMetadata,i),i.oneofs&&(A._botLinkedAccountsMetadata="botLinkedAccountsMetadata")),e.richResponseSourcesMetadata!=null&&e.hasOwnProperty("richResponseSourcesMetadata")&&(A.richResponseSourcesMetadata=d.proto.BotSourcesMetadata.toObject(e.richResponseSourcesMetadata,i),i.oneofs&&(A._richResponseSourcesMetadata="richResponseSourcesMetadata")),e.aiConversationContext!=null&&e.hasOwnProperty("aiConversationContext")&&(A.aiConversationContext=i.bytes===String?l.base64.encode(e.aiConversationContext,0,e.aiConversationContext.length):i.bytes===Array?Array.prototype.slice.call(e.aiConversationContext):e.aiConversationContext,i.oneofs&&(A._aiConversationContext="aiConversationContext")),e.botPromotionMessageMetadata!=null&&e.hasOwnProperty("botPromotionMessageMetadata")&&(A.botPromotionMessageMetadata=d.proto.BotPromotionMessageMetadata.toObject(e.botPromotionMessageMetadata,i),i.oneofs&&(A._botPromotionMessageMetadata="botPromotionMessageMetadata")),e.botModeSelectionMetadata!=null&&e.hasOwnProperty("botModeSelectionMetadata")&&(A.botModeSelectionMetadata=d.proto.BotModeSelectionMetadata.toObject(e.botModeSelectionMetadata,i),i.oneofs&&(A._botModeSelectionMetadata="botModeSelectionMetadata")),e.botQuotaMetadata!=null&&e.hasOwnProperty("botQuotaMetadata")&&(A.botQuotaMetadata=d.proto.BotQuotaMetadata.toObject(e.botQuotaMetadata,i),i.oneofs&&(A._botQuotaMetadata="botQuotaMetadata")),e.botAgeCollectionMetadata!=null&&e.hasOwnProperty("botAgeCollectionMetadata")&&(A.botAgeCollectionMetadata=d.proto.BotAgeCollectionMetadata.toObject(e.botAgeCollectionMetadata,i),i.oneofs&&(A._botAgeCollectionMetadata="botAgeCollectionMetadata")),e.conversationStarterPromptId!=null&&e.hasOwnProperty("conversationStarterPromptId")&&(A.conversationStarterPromptId=e.conversationStarterPromptId,i.oneofs&&(A._conversationStarterPromptId="conversationStarterPromptId")),e.botResponseId!=null&&e.hasOwnProperty("botResponseId")&&(A.botResponseId=e.botResponseId,i.oneofs&&(A._botResponseId="botResponseId")),e.verificationMetadata!=null&&e.hasOwnProperty("verificationMetadata")&&(A.verificationMetadata=d.proto.BotSignatureVerificationMetadata.toObject(e.verificationMetadata,i),i.oneofs&&(A._verificationMetadata="verificationMetadata")),e.unifiedResponseMutation!=null&&e.hasOwnProperty("unifiedResponseMutation")&&(A.unifiedResponseMutation=d.proto.BotUnifiedResponseMutation.toObject(e.unifiedResponseMutation,i),i.oneofs&&(A._unifiedResponseMutation="unifiedResponseMutation")),e.botMessageOriginMetadata!=null&&e.hasOwnProperty("botMessageOriginMetadata")&&(A.botMessageOriginMetadata=d.proto.BotMessageOriginMetadata.toObject(e.botMessageOriginMetadata,i),i.oneofs&&(A._botMessageOriginMetadata="botMessageOriginMetadata")),e.inThreadSurveyMetadata!=null&&e.hasOwnProperty("inThreadSurveyMetadata")&&(A.inThreadSurveyMetadata=d.proto.InThreadSurveyMetadata.toObject(e.inThreadSurveyMetadata,i),i.oneofs&&(A._inThreadSurveyMetadata="inThreadSurveyMetadata")),e.botThreadInfo!=null&&e.hasOwnProperty("botThreadInfo")&&(A.botThreadInfo=d.proto.AIThreadInfo.toObject(e.botThreadInfo,i),i.oneofs&&(A._botThreadInfo="botThreadInfo")),e.regenerateMetadata!=null&&e.hasOwnProperty("regenerateMetadata")&&(A.regenerateMetadata=d.proto.AIRegenerateMetadata.toObject(e.regenerateMetadata,i),i.oneofs&&(A._regenerateMetadata="regenerateMetadata")),e.sessionTransparencyMetadata!=null&&e.hasOwnProperty("sessionTransparencyMetadata")&&(A.sessionTransparencyMetadata=d.proto.SessionTransparencyMetadata.toObject(e.sessionTransparencyMetadata,i),i.oneofs&&(A._sessionTransparencyMetadata="sessionTransparencyMetadata")),e.internalMetadata!=null&&e.hasOwnProperty("internalMetadata")&&(A.internalMetadata=i.bytes===String?l.base64.encode(e.internalMetadata,0,e.internalMetadata.length):i.bytes===Array?Array.prototype.slice.call(e.internalMetadata):e.internalMetadata,i.oneofs&&(A._internalMetadata="internalMetadata")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMetadata"},t})(),n.BotMetricsEntryPoint=(function(){let t={},o=Object.create(t);return o[t[0]="UNDEFINED_ENTRY_POINT"]=0,o[t[1]="FAVICON"]=1,o[t[2]="CHATLIST"]=2,o[t[3]="AISEARCH_NULL_STATE_PAPER_PLANE"]=3,o[t[4]="AISEARCH_NULL_STATE_SUGGESTION"]=4,o[t[5]="AISEARCH_TYPE_AHEAD_SUGGESTION"]=5,o[t[6]="AISEARCH_TYPE_AHEAD_PAPER_PLANE"]=6,o[t[7]="AISEARCH_TYPE_AHEAD_RESULT_CHATLIST"]=7,o[t[8]="AISEARCH_TYPE_AHEAD_RESULT_MESSAGES"]=8,o[t[9]="AIVOICE_SEARCH_BAR"]=9,o[t[10]="AIVOICE_FAVICON"]=10,o[t[11]="AISTUDIO"]=11,o[t[12]="DEEPLINK"]=12,o[t[13]="NOTIFICATION"]=13,o[t[14]="PROFILE_MESSAGE_BUTTON"]=14,o[t[15]="FORWARD"]=15,o[t[16]="APP_SHORTCUT"]=16,o[t[17]="FF_FAMILY"]=17,o[t[18]="AI_TAB"]=18,o[t[19]="AI_HOME"]=19,o[t[20]="AI_DEEPLINK_IMMERSIVE"]=20,o[t[21]="AI_DEEPLINK"]=21,o[t[22]="META_AI_CHAT_SHORTCUT_AI_STUDIO"]=22,o[t[23]="UGC_CHAT_SHORTCUT_AI_STUDIO"]=23,o[t[24]="NEW_CHAT_AI_STUDIO"]=24,o[t[25]="AIVOICE_FAVICON_CALL_HISTORY"]=25,o[t[26]="ASK_META_AI_CONTEXT_MENU"]=26,o[t[27]="ASK_META_AI_CONTEXT_MENU_1ON1"]=27,o[t[28]="ASK_META_AI_CONTEXT_MENU_GROUP"]=28,o[t[29]="INVOKE_META_AI_1ON1"]=29,o[t[30]="INVOKE_META_AI_GROUP"]=30,o[t[31]="META_AI_FORWARD"]=31,o[t[32]="NEW_CHAT_AI_CONTACT"]=32,o[t[33]="MESSAGE_QUICK_ACTION_1_ON_1_CHAT"]=33,o[t[34]="MESSAGE_QUICK_ACTION_GROUP_CHAT"]=34,o[t[35]="ATTACHMENT_TRAY_1_ON_1_CHAT"]=35,o[t[36]="ATTACHMENT_TRAY_GROUP_CHAT"]=36,o[t[37]="ASK_META_AI_MEDIA_VIEWER_1ON1"]=37,o[t[38]="ASK_META_AI_MEDIA_VIEWER_GROUP"]=38,o})(),n.BotMetricsMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.destinationId=e.string();break}case 2:{s.destinationEntryPoint=e.int32();break}case 3:{s.threadOrigin=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotMetricsMetadata)return e;var i=new d.proto.BotMetricsMetadata;switch(e.destinationId!=null&&(i.destinationId=String(e.destinationId)),e.destinationEntryPoint){default:if(typeof e.destinationEntryPoint=="number"){i.destinationEntryPoint=e.destinationEntryPoint;break}break;case"UNDEFINED_ENTRY_POINT":case 0:i.destinationEntryPoint=0;break;case"FAVICON":case 1:i.destinationEntryPoint=1;break;case"CHATLIST":case 2:i.destinationEntryPoint=2;break;case"AISEARCH_NULL_STATE_PAPER_PLANE":case 3:i.destinationEntryPoint=3;break;case"AISEARCH_NULL_STATE_SUGGESTION":case 4:i.destinationEntryPoint=4;break;case"AISEARCH_TYPE_AHEAD_SUGGESTION":case 5:i.destinationEntryPoint=5;break;case"AISEARCH_TYPE_AHEAD_PAPER_PLANE":case 6:i.destinationEntryPoint=6;break;case"AISEARCH_TYPE_AHEAD_RESULT_CHATLIST":case 7:i.destinationEntryPoint=7;break;case"AISEARCH_TYPE_AHEAD_RESULT_MESSAGES":case 8:i.destinationEntryPoint=8;break;case"AIVOICE_SEARCH_BAR":case 9:i.destinationEntryPoint=9;break;case"AIVOICE_FAVICON":case 10:i.destinationEntryPoint=10;break;case"AISTUDIO":case 11:i.destinationEntryPoint=11;break;case"DEEPLINK":case 12:i.destinationEntryPoint=12;break;case"NOTIFICATION":case 13:i.destinationEntryPoint=13;break;case"PROFILE_MESSAGE_BUTTON":case 14:i.destinationEntryPoint=14;break;case"FORWARD":case 15:i.destinationEntryPoint=15;break;case"APP_SHORTCUT":case 16:i.destinationEntryPoint=16;break;case"FF_FAMILY":case 17:i.destinationEntryPoint=17;break;case"AI_TAB":case 18:i.destinationEntryPoint=18;break;case"AI_HOME":case 19:i.destinationEntryPoint=19;break;case"AI_DEEPLINK_IMMERSIVE":case 20:i.destinationEntryPoint=20;break;case"AI_DEEPLINK":case 21:i.destinationEntryPoint=21;break;case"META_AI_CHAT_SHORTCUT_AI_STUDIO":case 22:i.destinationEntryPoint=22;break;case"UGC_CHAT_SHORTCUT_AI_STUDIO":case 23:i.destinationEntryPoint=23;break;case"NEW_CHAT_AI_STUDIO":case 24:i.destinationEntryPoint=24;break;case"AIVOICE_FAVICON_CALL_HISTORY":case 25:i.destinationEntryPoint=25;break;case"ASK_META_AI_CONTEXT_MENU":case 26:i.destinationEntryPoint=26;break;case"ASK_META_AI_CONTEXT_MENU_1ON1":case 27:i.destinationEntryPoint=27;break;case"ASK_META_AI_CONTEXT_MENU_GROUP":case 28:i.destinationEntryPoint=28;break;case"INVOKE_META_AI_1ON1":case 29:i.destinationEntryPoint=29;break;case"INVOKE_META_AI_GROUP":case 30:i.destinationEntryPoint=30;break;case"META_AI_FORWARD":case 31:i.destinationEntryPoint=31;break;case"NEW_CHAT_AI_CONTACT":case 32:i.destinationEntryPoint=32;break;case"MESSAGE_QUICK_ACTION_1_ON_1_CHAT":case 33:i.destinationEntryPoint=33;break;case"MESSAGE_QUICK_ACTION_GROUP_CHAT":case 34:i.destinationEntryPoint=34;break;case"ATTACHMENT_TRAY_1_ON_1_CHAT":case 35:i.destinationEntryPoint=35;break;case"ATTACHMENT_TRAY_GROUP_CHAT":case 36:i.destinationEntryPoint=36;break;case"ASK_META_AI_MEDIA_VIEWER_1ON1":case 37:i.destinationEntryPoint=37;break;case"ASK_META_AI_MEDIA_VIEWER_GROUP":case 38:i.destinationEntryPoint=38;break}switch(e.threadOrigin){default:if(typeof e.threadOrigin=="number"){i.threadOrigin=e.threadOrigin;break}break;case"AI_TAB_THREAD":case 1:i.threadOrigin=1;break;case"AI_HOME_THREAD":case 2:i.threadOrigin=2;break;case"AI_DEEPLINK_IMMERSIVE_THREAD":case 3:i.threadOrigin=3;break;case"AI_DEEPLINK_THREAD":case 4:i.threadOrigin=4;break;case"ASK_META_AI_CONTEXT_MENU_THREAD":case 5:i.threadOrigin=5;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.destinationId!=null&&e.hasOwnProperty("destinationId")&&(A.destinationId=e.destinationId,i.oneofs&&(A._destinationId="destinationId")),e.destinationEntryPoint!=null&&e.hasOwnProperty("destinationEntryPoint")&&(A.destinationEntryPoint=i.enums===String?d.proto.BotMetricsEntryPoint[e.destinationEntryPoint]===void 0?e.destinationEntryPoint:d.proto.BotMetricsEntryPoint[e.destinationEntryPoint]:e.destinationEntryPoint,i.oneofs&&(A._destinationEntryPoint="destinationEntryPoint")),e.threadOrigin!=null&&e.hasOwnProperty("threadOrigin")&&(A.threadOrigin=i.enums===String?d.proto.BotMetricsThreadEntryPoint[e.threadOrigin]===void 0?e.threadOrigin:d.proto.BotMetricsThreadEntryPoint[e.threadOrigin]:e.threadOrigin,i.oneofs&&(A._threadOrigin="threadOrigin")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotMetricsMetadata"},t})(),n.BotMetricsThreadEntryPoint=(function(){let t={},o=Object.create(t);return o[t[1]="AI_TAB_THREAD"]=1,o[t[2]="AI_HOME_THREAD"]=2,o[t[3]="AI_DEEPLINK_IMMERSIVE_THREAD"]=3,o[t[4]="AI_DEEPLINK_THREAD"]=4,o[t[5]="ASK_META_AI_CONTEXT_MENU_THREAD"]=5,o})(),n.BotModeSelectionMetadata=(function(){function t(o){if(this.mode=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{if(r.mode&&r.mode.length||(r.mode=[]),(s&7)===2)for(var g=a.uint32()+a.pos;a.pos>>3){case 1:{s.modelType=e.int32();break}case 2:{s.premiumModelStatus=e.int32();break}case 3:{s.modelNameOverride=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotModelMetadata)return e;var i=new d.proto.BotModelMetadata;switch(e.modelType){default:if(typeof e.modelType=="number"){i.modelType=e.modelType;break}break;case"UNKNOWN_TYPE":case 0:i.modelType=0;break;case"LLAMA_PROD":case 1:i.modelType=1;break;case"LLAMA_PROD_PREMIUM":case 2:i.modelType=2;break}switch(e.premiumModelStatus){default:if(typeof e.premiumModelStatus=="number"){i.premiumModelStatus=e.premiumModelStatus;break}break;case"UNKNOWN_STATUS":case 0:i.premiumModelStatus=0;break;case"AVAILABLE":case 1:i.premiumModelStatus=1;break;case"QUOTA_EXCEED_LIMIT":case 2:i.premiumModelStatus=2;break}return e.modelNameOverride!=null&&(i.modelNameOverride=String(e.modelNameOverride)),i},t.toObject=function(e,i){i||(i={});var A={};return e.modelType!=null&&e.hasOwnProperty("modelType")&&(A.modelType=i.enums===String?d.proto.BotModelMetadata.ModelType[e.modelType]===void 0?e.modelType:d.proto.BotModelMetadata.ModelType[e.modelType]:e.modelType,i.oneofs&&(A._modelType="modelType")),e.premiumModelStatus!=null&&e.hasOwnProperty("premiumModelStatus")&&(A.premiumModelStatus=i.enums===String?d.proto.BotModelMetadata.PremiumModelStatus[e.premiumModelStatus]===void 0?e.premiumModelStatus:d.proto.BotModelMetadata.PremiumModelStatus[e.premiumModelStatus]:e.premiumModelStatus,i.oneofs&&(A._premiumModelStatus="premiumModelStatus")),e.modelNameOverride!=null&&e.hasOwnProperty("modelNameOverride")&&(A.modelNameOverride=e.modelNameOverride,i.oneofs&&(A._modelNameOverride="modelNameOverride")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotModelMetadata"},t.ModelType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_TYPE"]=0,e[a[1]="LLAMA_PROD"]=1,e[a[2]="LLAMA_PROD_PREMIUM"]=2,e})(),t.PremiumModelStatus=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_STATUS"]=0,e[a[1]="AVAILABLE"]=1,e[a[2]="QUOTA_EXCEED_LIMIT"]=2,e})(),t})(),n.BotPluginMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.provider=e.int32();break}case 2:{s.pluginType=e.int32();break}case 3:{s.thumbnailCdnUrl=e.string();break}case 4:{s.profilePhotoCdnUrl=e.string();break}case 5:{s.searchProviderUrl=e.string();break}case 6:{s.referenceIndex=e.uint32();break}case 7:{s.expectedLinksCount=e.uint32();break}case 9:{s.searchQuery=e.string();break}case 10:{s.parentPluginMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 11:{s.deprecatedField=e.int32();break}case 12:{s.parentPluginType=e.int32();break}case 13:{s.faviconCdnUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotPluginMetadata)return e;var i=new d.proto.BotPluginMetadata;switch(e.provider){default:if(typeof e.provider=="number"){i.provider=e.provider;break}break;case"UNKNOWN":case 0:i.provider=0;break;case"BING":case 1:i.provider=1;break;case"GOOGLE":case 2:i.provider=2;break;case"SUPPORT":case 3:i.provider=3;break}switch(e.pluginType){default:if(typeof e.pluginType=="number"){i.pluginType=e.pluginType;break}break;case"UNKNOWN_PLUGIN":case 0:i.pluginType=0;break;case"REELS":case 1:i.pluginType=1;break;case"SEARCH":case 2:i.pluginType=2;break}if(e.thumbnailCdnUrl!=null&&(i.thumbnailCdnUrl=String(e.thumbnailCdnUrl)),e.profilePhotoCdnUrl!=null&&(i.profilePhotoCdnUrl=String(e.profilePhotoCdnUrl)),e.searchProviderUrl!=null&&(i.searchProviderUrl=String(e.searchProviderUrl)),e.referenceIndex!=null&&(i.referenceIndex=e.referenceIndex>>>0),e.expectedLinksCount!=null&&(i.expectedLinksCount=e.expectedLinksCount>>>0),e.searchQuery!=null&&(i.searchQuery=String(e.searchQuery)),e.parentPluginMessageKey!=null){if(typeof e.parentPluginMessageKey!="object")throw TypeError(".proto.BotPluginMetadata.parentPluginMessageKey: object expected");i.parentPluginMessageKey=d.proto.MessageKey.fromObject(e.parentPluginMessageKey)}switch(e.deprecatedField){default:if(typeof e.deprecatedField=="number"){i.deprecatedField=e.deprecatedField;break}break;case"UNKNOWN_PLUGIN":case 0:i.deprecatedField=0;break;case"REELS":case 1:i.deprecatedField=1;break;case"SEARCH":case 2:i.deprecatedField=2;break}switch(e.parentPluginType){default:if(typeof e.parentPluginType=="number"){i.parentPluginType=e.parentPluginType;break}break;case"UNKNOWN_PLUGIN":case 0:i.parentPluginType=0;break;case"REELS":case 1:i.parentPluginType=1;break;case"SEARCH":case 2:i.parentPluginType=2;break}return e.faviconCdnUrl!=null&&(i.faviconCdnUrl=String(e.faviconCdnUrl)),i},t.toObject=function(e,i){i||(i={});var A={};return e.provider!=null&&e.hasOwnProperty("provider")&&(A.provider=i.enums===String?d.proto.BotPluginMetadata.SearchProvider[e.provider]===void 0?e.provider:d.proto.BotPluginMetadata.SearchProvider[e.provider]:e.provider,i.oneofs&&(A._provider="provider")),e.pluginType!=null&&e.hasOwnProperty("pluginType")&&(A.pluginType=i.enums===String?d.proto.BotPluginMetadata.PluginType[e.pluginType]===void 0?e.pluginType:d.proto.BotPluginMetadata.PluginType[e.pluginType]:e.pluginType,i.oneofs&&(A._pluginType="pluginType")),e.thumbnailCdnUrl!=null&&e.hasOwnProperty("thumbnailCdnUrl")&&(A.thumbnailCdnUrl=e.thumbnailCdnUrl,i.oneofs&&(A._thumbnailCdnUrl="thumbnailCdnUrl")),e.profilePhotoCdnUrl!=null&&e.hasOwnProperty("profilePhotoCdnUrl")&&(A.profilePhotoCdnUrl=e.profilePhotoCdnUrl,i.oneofs&&(A._profilePhotoCdnUrl="profilePhotoCdnUrl")),e.searchProviderUrl!=null&&e.hasOwnProperty("searchProviderUrl")&&(A.searchProviderUrl=e.searchProviderUrl,i.oneofs&&(A._searchProviderUrl="searchProviderUrl")),e.referenceIndex!=null&&e.hasOwnProperty("referenceIndex")&&(A.referenceIndex=e.referenceIndex,i.oneofs&&(A._referenceIndex="referenceIndex")),e.expectedLinksCount!=null&&e.hasOwnProperty("expectedLinksCount")&&(A.expectedLinksCount=e.expectedLinksCount,i.oneofs&&(A._expectedLinksCount="expectedLinksCount")),e.searchQuery!=null&&e.hasOwnProperty("searchQuery")&&(A.searchQuery=e.searchQuery,i.oneofs&&(A._searchQuery="searchQuery")),e.parentPluginMessageKey!=null&&e.hasOwnProperty("parentPluginMessageKey")&&(A.parentPluginMessageKey=d.proto.MessageKey.toObject(e.parentPluginMessageKey,i),i.oneofs&&(A._parentPluginMessageKey="parentPluginMessageKey")),e.deprecatedField!=null&&e.hasOwnProperty("deprecatedField")&&(A.deprecatedField=i.enums===String?d.proto.BotPluginMetadata.PluginType[e.deprecatedField]===void 0?e.deprecatedField:d.proto.BotPluginMetadata.PluginType[e.deprecatedField]:e.deprecatedField,i.oneofs&&(A._deprecatedField="deprecatedField")),e.parentPluginType!=null&&e.hasOwnProperty("parentPluginType")&&(A.parentPluginType=i.enums===String?d.proto.BotPluginMetadata.PluginType[e.parentPluginType]===void 0?e.parentPluginType:d.proto.BotPluginMetadata.PluginType[e.parentPluginType]:e.parentPluginType,i.oneofs&&(A._parentPluginType="parentPluginType")),e.faviconCdnUrl!=null&&e.hasOwnProperty("faviconCdnUrl")&&(A.faviconCdnUrl=e.faviconCdnUrl,i.oneofs&&(A._faviconCdnUrl="faviconCdnUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPluginMetadata"},t.PluginType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_PLUGIN"]=0,e[a[1]="REELS"]=1,e[a[2]="SEARCH"]=2,e})(),t.SearchProvider=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="BING"]=1,e[a[2]="GOOGLE"]=2,e[a[3]="SUPPORT"]=3,e})(),t})(),n.BotProgressIndicatorMetadata=(function(){function t(a){if(this.stepsMetadata=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.progressDescription=e.string();break}case 2:{s.stepsMetadata&&s.stepsMetadata.length||(s.stepsMetadata=[]),s.stepsMetadata.push(d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotProgressIndicatorMetadata)return e;var i=new d.proto.BotProgressIndicatorMetadata;if(e.progressDescription!=null&&(i.progressDescription=String(e.progressDescription)),e.stepsMetadata){if(!Array.isArray(e.stepsMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.stepsMetadata: array expected");i.stepsMetadata=[];for(var A=0;A>>3){case 1:{c.statusTitle=A.string();break}case 2:{c.statusBody=A.string();break}case 3:{c.sourcesMetadata&&c.sourcesMetadata.length||(c.sourcesMetadata=[]),c.sourcesMetadata.push(d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.decode(A,A.uint32()));break}case 4:{c.status=A.int32();break}case 5:{c.isReasoning=A.bool();break}case 6:{c.isEnhancedSearch=A.bool();break}case 7:{c.sections&&c.sections.length||(c.sections=[]),c.sections.push(d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata)return A;var r=new d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata;if(A.statusTitle!=null&&(r.statusTitle=String(A.statusTitle)),A.statusBody!=null&&(r.statusBody=String(A.statusBody)),A.sourcesMetadata){if(!Array.isArray(A.sourcesMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.sourcesMetadata: array expected");r.sourcesMetadata=[];for(var s=0;s>>3){case 1:{p.title=s.string();break}case 2:{p.provider=s.int32();break}case 3:{p.sourceUrl=s.string();break}case 4:{p.favIconUrl=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata)return s;var g=new d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata;switch(s.title!=null&&(g.title=String(s.title)),s.provider){default:if(typeof s.provider=="number"){g.provider=s.provider;break}break;case"UNKNOWN_PROVIDER":case 0:g.provider=0;break;case"OTHER":case 1:g.provider=1;break;case"GOOGLE":case 2:g.provider=2;break;case"BING":case 3:g.provider=3;break}return s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.favIconUrl!=null&&(g.favIconUrl=String(s.favIconUrl)),g},i.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.provider!=null&&s.hasOwnProperty("provider")&&(c.provider=g.enums===String?d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[s.provider]===void 0?s.provider:d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider[s.provider]:s.provider,g.oneofs&&(c._provider="provider")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.favIconUrl!=null&&s.hasOwnProperty("favIconUrl")&&(c.favIconUrl=s.favIconUrl,g.oneofs&&(c._favIconUrl="favIconUrl")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata"},i})(),a.BotPlanningSearchSourcesMetadata=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.sourceTitle=s.string();break}case 2:{p.provider=s.int32();break}case 3:{p.sourceUrl=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata)return s;var g=new d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata;switch(s.sourceTitle!=null&&(g.sourceTitle=String(s.sourceTitle)),s.provider){default:if(typeof s.provider=="number"){g.provider=s.provider;break}break;case"UNKNOWN":case 0:g.provider=0;break;case"OTHER":case 1:g.provider=1;break;case"GOOGLE":case 2:g.provider=2;break;case"BING":case 3:g.provider=3;break}return s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),g},i.toObject=function(s,g){g||(g={});var c={};return s.sourceTitle!=null&&s.hasOwnProperty("sourceTitle")&&(c.sourceTitle=s.sourceTitle,g.oneofs&&(c._sourceTitle="sourceTitle")),s.provider!=null&&s.hasOwnProperty("provider")&&(c.provider=g.enums===String?d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[s.provider]===void 0?s.provider:d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata.BotPlanningSearchSourceProvider[s.provider]:s.provider,g.oneofs&&(c._provider="provider")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourcesMetadata"},i.BotPlanningSearchSourceProvider=(function(){let r={},s=Object.create(r);return s[r[0]="UNKNOWN"]=0,s[r[1]="OTHER"]=1,s[r[2]="GOOGLE"]=2,s[r[3]="BING"]=3,s})(),i})(),a.BotPlanningStepSectionMetadata=(function(){function i(r){if(this.sourcesMetadata=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.sectionTitle=s.string();break}case 2:{p.sectionBody=s.string();break}case 3:{p.sourcesMetadata&&p.sourcesMetadata.length||(p.sourcesMetadata=[]),p.sourcesMetadata.push(d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata)return s;var g=new d.proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata;if(s.sectionTitle!=null&&(g.sectionTitle=String(s.sectionTitle)),s.sectionBody!=null&&(g.sectionBody=String(s.sectionBody)),s.sourcesMetadata){if(!Array.isArray(s.sourcesMetadata))throw TypeError(".proto.BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningStepSectionMetadata.sourcesMetadata: array expected");g.sourcesMetadata=[];for(var c=0;c>>3){case 1:{s.promotionType=e.int32();break}case 2:{s.buttonTitle=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotPromotionMessageMetadata)return e;var i=new d.proto.BotPromotionMessageMetadata;switch(e.promotionType){default:if(typeof e.promotionType=="number"){i.promotionType=e.promotionType;break}break;case"UNKNOWN_TYPE":case 0:i.promotionType=0;break;case"C50":case 1:i.promotionType=1;break;case"SURVEY_PLATFORM":case 2:i.promotionType=2;break}return e.buttonTitle!=null&&(i.buttonTitle=String(e.buttonTitle)),i},t.toObject=function(e,i){i||(i={});var A={};return e.promotionType!=null&&e.hasOwnProperty("promotionType")&&(A.promotionType=i.enums===String?d.proto.BotPromotionMessageMetadata.BotPromotionType[e.promotionType]===void 0?e.promotionType:d.proto.BotPromotionMessageMetadata.BotPromotionType[e.promotionType]:e.promotionType,i.oneofs&&(A._promotionType="promotionType")),e.buttonTitle!=null&&e.hasOwnProperty("buttonTitle")&&(A.buttonTitle=e.buttonTitle,i.oneofs&&(A._buttonTitle="buttonTitle")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPromotionMessageMetadata"},t.BotPromotionType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_TYPE"]=0,e[a[1]="C50"]=1,e[a[2]="SURVEY_PLATFORM"]=2,e})(),t})(),n.BotPromptSuggestion=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.prompt=e.string();break}case 2:{s.promptId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotPromptSuggestion)return e;var i=new d.proto.BotPromptSuggestion;return e.prompt!=null&&(i.prompt=String(e.prompt)),e.promptId!=null&&(i.promptId=String(e.promptId)),i},t.toObject=function(e,i){i||(i={});var A={};return e.prompt!=null&&e.hasOwnProperty("prompt")&&(A.prompt=e.prompt,i.oneofs&&(A._prompt="prompt")),e.promptId!=null&&e.hasOwnProperty("promptId")&&(A.promptId=e.promptId,i.oneofs&&(A._promptId="promptId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotPromptSuggestion"},t})(),n.BotPromptSuggestions=(function(){function t(o){if(this.suggestions=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.suggestions&&r.suggestions.length||(r.suggestions=[]),r.suggestions.push(d.proto.BotPromptSuggestion.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotPromptSuggestions)return a;var e=new d.proto.BotPromptSuggestions;if(a.suggestions){if(!Array.isArray(a.suggestions))throw TypeError(".proto.BotPromptSuggestions.suggestions: array expected");e.suggestions=[];for(var i=0;i>>3){case 1:{r.botFeatureQuotaMetadata&&r.botFeatureQuotaMetadata.length||(r.botFeatureQuotaMetadata=[]),r.botFeatureQuotaMetadata.push(d.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotQuotaMetadata)return a;var e=new d.proto.BotQuotaMetadata;if(a.botFeatureQuotaMetadata){if(!Array.isArray(a.botFeatureQuotaMetadata))throw TypeError(".proto.BotQuotaMetadata.botFeatureQuotaMetadata: array expected");e.botFeatureQuotaMetadata=[];for(var i=0;i>>3){case 1:{g.featureType=i.int32();break}case 2:{g.remainingQuota=i.uint32();break}case 3:{g.expirationTimestamp=i.uint64();break}default:i.skipType(c&7);break}}return g},o.fromObject=function(i){if(i instanceof d.proto.BotQuotaMetadata.BotFeatureQuotaMetadata)return i;var A=new d.proto.BotQuotaMetadata.BotFeatureQuotaMetadata;switch(i.featureType){default:if(typeof i.featureType=="number"){A.featureType=i.featureType;break}break;case"UNKNOWN_FEATURE":case 0:A.featureType=0;break;case"REASONING_FEATURE":case 1:A.featureType=1;break}return i.remainingQuota!=null&&(A.remainingQuota=i.remainingQuota>>>0),i.expirationTimestamp!=null&&(l.Long?(A.expirationTimestamp=l.Long.fromValue(i.expirationTimestamp)).unsigned=!0:typeof i.expirationTimestamp=="string"?A.expirationTimestamp=parseInt(i.expirationTimestamp,10):typeof i.expirationTimestamp=="number"?A.expirationTimestamp=i.expirationTimestamp:typeof i.expirationTimestamp=="object"&&(A.expirationTimestamp=new l.LongBits(i.expirationTimestamp.low>>>0,i.expirationTimestamp.high>>>0).toNumber(!0))),A},o.toObject=function(i,A){A||(A={});var r={};return i.featureType!=null&&i.hasOwnProperty("featureType")&&(r.featureType=A.enums===String?d.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[i.featureType]===void 0?i.featureType:d.proto.BotQuotaMetadata.BotFeatureQuotaMetadata.BotFeatureType[i.featureType]:i.featureType,A.oneofs&&(r._featureType="featureType")),i.remainingQuota!=null&&i.hasOwnProperty("remainingQuota")&&(r.remainingQuota=i.remainingQuota,A.oneofs&&(r._remainingQuota="remainingQuota")),i.expirationTimestamp!=null&&i.hasOwnProperty("expirationTimestamp")&&(typeof i.expirationTimestamp=="number"?r.expirationTimestamp=A.longs===String?String(i.expirationTimestamp):i.expirationTimestamp:r.expirationTimestamp=A.longs===String?ge(i.expirationTimestamp,!0):A.longs===Number?ce(i.expirationTimestamp,!0):i.expirationTimestamp,A.oneofs&&(r._expirationTimestamp="expirationTimestamp")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},o.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.BotQuotaMetadata.BotFeatureQuotaMetadata"},o.BotFeatureType=(function(){let e={},i=Object.create(e);return i[e[0]="UNKNOWN_FEATURE"]=0,i[e[1]="REASONING_FEATURE"]=1,i})(),o})(),t})(),n.BotReminderMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.requestMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.action=e.int32();break}case 3:{s.name=e.string();break}case 4:{s.nextTriggerTimestamp=e.uint64();break}case 5:{s.frequency=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotReminderMetadata)return e;var i=new d.proto.BotReminderMetadata;if(e.requestMessageKey!=null){if(typeof e.requestMessageKey!="object")throw TypeError(".proto.BotReminderMetadata.requestMessageKey: object expected");i.requestMessageKey=d.proto.MessageKey.fromObject(e.requestMessageKey)}switch(e.action){default:if(typeof e.action=="number"){i.action=e.action;break}break;case"NOTIFY":case 1:i.action=1;break;case"CREATE":case 2:i.action=2;break;case"DELETE":case 3:i.action=3;break;case"UPDATE":case 4:i.action=4;break}switch(e.name!=null&&(i.name=String(e.name)),e.nextTriggerTimestamp!=null&&(l.Long?(i.nextTriggerTimestamp=l.Long.fromValue(e.nextTriggerTimestamp)).unsigned=!0:typeof e.nextTriggerTimestamp=="string"?i.nextTriggerTimestamp=parseInt(e.nextTriggerTimestamp,10):typeof e.nextTriggerTimestamp=="number"?i.nextTriggerTimestamp=e.nextTriggerTimestamp:typeof e.nextTriggerTimestamp=="object"&&(i.nextTriggerTimestamp=new l.LongBits(e.nextTriggerTimestamp.low>>>0,e.nextTriggerTimestamp.high>>>0).toNumber(!0))),e.frequency){default:if(typeof e.frequency=="number"){i.frequency=e.frequency;break}break;case"ONCE":case 1:i.frequency=1;break;case"DAILY":case 2:i.frequency=2;break;case"WEEKLY":case 3:i.frequency=3;break;case"BIWEEKLY":case 4:i.frequency=4;break;case"MONTHLY":case 5:i.frequency=5;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.requestMessageKey!=null&&e.hasOwnProperty("requestMessageKey")&&(A.requestMessageKey=d.proto.MessageKey.toObject(e.requestMessageKey,i),i.oneofs&&(A._requestMessageKey="requestMessageKey")),e.action!=null&&e.hasOwnProperty("action")&&(A.action=i.enums===String?d.proto.BotReminderMetadata.ReminderAction[e.action]===void 0?e.action:d.proto.BotReminderMetadata.ReminderAction[e.action]:e.action,i.oneofs&&(A._action="action")),e.name!=null&&e.hasOwnProperty("name")&&(A.name=e.name,i.oneofs&&(A._name="name")),e.nextTriggerTimestamp!=null&&e.hasOwnProperty("nextTriggerTimestamp")&&(typeof e.nextTriggerTimestamp=="number"?A.nextTriggerTimestamp=i.longs===String?String(e.nextTriggerTimestamp):e.nextTriggerTimestamp:A.nextTriggerTimestamp=i.longs===String?ge(e.nextTriggerTimestamp,!0):i.longs===Number?ce(e.nextTriggerTimestamp,!0):e.nextTriggerTimestamp,i.oneofs&&(A._nextTriggerTimestamp="nextTriggerTimestamp")),e.frequency!=null&&e.hasOwnProperty("frequency")&&(A.frequency=i.enums===String?d.proto.BotReminderMetadata.ReminderFrequency[e.frequency]===void 0?e.frequency:d.proto.BotReminderMetadata.ReminderFrequency[e.frequency]:e.frequency,i.oneofs&&(A._frequency="frequency")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotReminderMetadata"},t.ReminderAction=(function(){let a={},e=Object.create(a);return e[a[1]="NOTIFY"]=1,e[a[2]="CREATE"]=2,e[a[3]="DELETE"]=3,e[a[4]="UPDATE"]=4,e})(),t.ReminderFrequency=(function(){let a={},e=Object.create(a);return e[a[1]="ONCE"]=1,e[a[2]="DAILY"]=2,e[a[3]="WEEKLY"]=3,e[a[4]="BIWEEKLY"]=4,e[a[5]="MONTHLY"]=5,e})(),t})(),n.BotRenderingMetadata=(function(){function t(o){if(this.keywords=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.keywords&&r.keywords.length||(r.keywords=[]),r.keywords.push(d.proto.BotRenderingMetadata.Keyword.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotRenderingMetadata)return a;var e=new d.proto.BotRenderingMetadata;if(a.keywords){if(!Array.isArray(a.keywords))throw TypeError(".proto.BotRenderingMetadata.keywords: array expected");e.keywords=[];for(var i=0;i>>3){case 1:{g.value=i.string();break}case 2:{g.associatedPrompts&&g.associatedPrompts.length||(g.associatedPrompts=[]),g.associatedPrompts.push(i.string());break}default:i.skipType(c&7);break}}return g},o.fromObject=function(i){if(i instanceof d.proto.BotRenderingMetadata.Keyword)return i;var A=new d.proto.BotRenderingMetadata.Keyword;if(i.value!=null&&(A.value=String(i.value)),i.associatedPrompts){if(!Array.isArray(i.associatedPrompts))throw TypeError(".proto.BotRenderingMetadata.Keyword.associatedPrompts: array expected");A.associatedPrompts=[];for(var r=0;r>>3){case 1:{s.sessionId=e.string();break}case 2:{s.sessionSource=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotSessionMetadata)return e;var i=new d.proto.BotSessionMetadata;switch(e.sessionId!=null&&(i.sessionId=String(e.sessionId)),e.sessionSource){default:if(typeof e.sessionSource=="number"){i.sessionSource=e.sessionSource;break}break;case"NONE":case 0:i.sessionSource=0;break;case"NULL_STATE":case 1:i.sessionSource=1;break;case"TYPEAHEAD":case 2:i.sessionSource=2;break;case"USER_INPUT":case 3:i.sessionSource=3;break;case"EMU_FLASH":case 4:i.sessionSource=4;break;case"EMU_FLASH_FOLLOWUP":case 5:i.sessionSource=5;break;case"VOICE":case 6:i.sessionSource=6;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.sessionId!=null&&e.hasOwnProperty("sessionId")&&(A.sessionId=e.sessionId,i.oneofs&&(A._sessionId="sessionId")),e.sessionSource!=null&&e.hasOwnProperty("sessionSource")&&(A.sessionSource=i.enums===String?d.proto.BotSessionSource[e.sessionSource]===void 0?e.sessionSource:d.proto.BotSessionSource[e.sessionSource]:e.sessionSource,i.oneofs&&(A._sessionSource="sessionSource")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.BotSessionMetadata"},t})(),n.BotSessionSource=(function(){let t={},o=Object.create(t);return o[t[0]="NONE"]=0,o[t[1]="NULL_STATE"]=1,o[t[2]="TYPEAHEAD"]=2,o[t[3]="USER_INPUT"]=3,o[t[4]="EMU_FLASH"]=4,o[t[5]="EMU_FLASH_FOLLOWUP"]=5,o[t[6]="VOICE"]=6,o})(),n.BotSignatureVerificationMetadata=(function(){function t(o){if(this.proofs=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.proofs&&r.proofs.length||(r.proofs=[]),r.proofs.push(d.proto.BotSignatureVerificationUseCaseProof.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotSignatureVerificationMetadata)return a;var e=new d.proto.BotSignatureVerificationMetadata;if(a.proofs){if(!Array.isArray(a.proofs))throw TypeError(".proto.BotSignatureVerificationMetadata.proofs: array expected");e.proofs=[];for(var i=0;i>>3){case 1:{s.version=e.int32();break}case 2:{s.useCase=e.int32();break}case 3:{s.signature=e.bytes();break}case 4:{s.certificateChain&&s.certificateChain.length||(s.certificateChain=[]),s.certificateChain.push(e.bytes());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotSignatureVerificationUseCaseProof)return e;var i=new d.proto.BotSignatureVerificationUseCaseProof;switch(e.version!=null&&(i.version=e.version|0),e.useCase){default:if(typeof e.useCase=="number"){i.useCase=e.useCase;break}break;case"UNSPECIFIED":case 0:i.useCase=0;break;case"WA_BOT_MSG":case 1:i.useCase=1;break}if(e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,i.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(i.signature=e.signature)),e.certificateChain){if(!Array.isArray(e.certificateChain))throw TypeError(".proto.BotSignatureVerificationUseCaseProof.certificateChain: array expected");i.certificateChain=[];for(var A=0;A=0&&(i.certificateChain[A]=e.certificateChain[A])}return i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.certificateChain=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,i.oneofs&&(A._version="version")),e.useCase!=null&&e.hasOwnProperty("useCase")&&(A.useCase=i.enums===String?d.proto.BotSignatureVerificationUseCaseProof.BotSignatureUseCase[e.useCase]===void 0?e.useCase:d.proto.BotSignatureVerificationUseCaseProof.BotSignatureUseCase[e.useCase]:e.useCase,i.oneofs&&(A._useCase="useCase")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=i.bytes===String?l.base64.encode(e.signature,0,e.signature.length):i.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,i.oneofs&&(A._signature="signature")),e.certificateChain&&e.certificateChain.length){A.certificateChain=[];for(var r=0;r>>3){case 1:{r.sources&&r.sources.length||(r.sources=[]),r.sources.push(d.proto.BotSourcesMetadata.BotSourceItem.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.BotSourcesMetadata)return a;var e=new d.proto.BotSourcesMetadata;if(a.sources){if(!Array.isArray(a.sources))throw TypeError(".proto.BotSourcesMetadata.sources: array expected");e.sources=[];for(var i=0;i>>3){case 1:{g.provider=i.int32();break}case 2:{g.thumbnailCdnUrl=i.string();break}case 3:{g.sourceProviderUrl=i.string();break}case 4:{g.sourceQuery=i.string();break}case 5:{g.faviconCdnUrl=i.string();break}case 6:{g.citationNumber=i.uint32();break}case 7:{g.sourceTitle=i.string();break}default:i.skipType(c&7);break}}return g},o.fromObject=function(i){if(i instanceof d.proto.BotSourcesMetadata.BotSourceItem)return i;var A=new d.proto.BotSourcesMetadata.BotSourceItem;switch(i.provider){default:if(typeof i.provider=="number"){A.provider=i.provider;break}break;case"UNKNOWN":case 0:A.provider=0;break;case"BING":case 1:A.provider=1;break;case"GOOGLE":case 2:A.provider=2;break;case"SUPPORT":case 3:A.provider=3;break;case"OTHER":case 4:A.provider=4;break}return i.thumbnailCdnUrl!=null&&(A.thumbnailCdnUrl=String(i.thumbnailCdnUrl)),i.sourceProviderUrl!=null&&(A.sourceProviderUrl=String(i.sourceProviderUrl)),i.sourceQuery!=null&&(A.sourceQuery=String(i.sourceQuery)),i.faviconCdnUrl!=null&&(A.faviconCdnUrl=String(i.faviconCdnUrl)),i.citationNumber!=null&&(A.citationNumber=i.citationNumber>>>0),i.sourceTitle!=null&&(A.sourceTitle=String(i.sourceTitle)),A},o.toObject=function(i,A){A||(A={});var r={};return i.provider!=null&&i.hasOwnProperty("provider")&&(r.provider=A.enums===String?d.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[i.provider]===void 0?i.provider:d.proto.BotSourcesMetadata.BotSourceItem.SourceProvider[i.provider]:i.provider,A.oneofs&&(r._provider="provider")),i.thumbnailCdnUrl!=null&&i.hasOwnProperty("thumbnailCdnUrl")&&(r.thumbnailCdnUrl=i.thumbnailCdnUrl,A.oneofs&&(r._thumbnailCdnUrl="thumbnailCdnUrl")),i.sourceProviderUrl!=null&&i.hasOwnProperty("sourceProviderUrl")&&(r.sourceProviderUrl=i.sourceProviderUrl,A.oneofs&&(r._sourceProviderUrl="sourceProviderUrl")),i.sourceQuery!=null&&i.hasOwnProperty("sourceQuery")&&(r.sourceQuery=i.sourceQuery,A.oneofs&&(r._sourceQuery="sourceQuery")),i.faviconCdnUrl!=null&&i.hasOwnProperty("faviconCdnUrl")&&(r.faviconCdnUrl=i.faviconCdnUrl,A.oneofs&&(r._faviconCdnUrl="faviconCdnUrl")),i.citationNumber!=null&&i.hasOwnProperty("citationNumber")&&(r.citationNumber=i.citationNumber,A.oneofs&&(r._citationNumber="citationNumber")),i.sourceTitle!=null&&i.hasOwnProperty("sourceTitle")&&(r.sourceTitle=i.sourceTitle,A.oneofs&&(r._sourceTitle="sourceTitle")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},o.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.BotSourcesMetadata.BotSourceItem"},o.SourceProvider=(function(){let e={},i=Object.create(e);return i[e[0]="UNKNOWN"]=0,i[e[1]="BING"]=1,i[e[2]="GOOGLE"]=2,i[e[3]="SUPPORT"]=3,i[e[4]="OTHER"]=4,i})(),o})(),t})(),n.BotSuggestedPromptMetadata=(function(){function t(a){if(this.suggestedPrompts=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.suggestedPrompts&&s.suggestedPrompts.length||(s.suggestedPrompts=[]),s.suggestedPrompts.push(e.string());break}case 2:{s.selectedPromptIndex=e.uint32();break}case 3:{s.promptSuggestions=d.proto.BotPromptSuggestions.decode(e,e.uint32());break}case 4:{s.selectedPromptId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotSuggestedPromptMetadata)return e;var i=new d.proto.BotSuggestedPromptMetadata;if(e.suggestedPrompts){if(!Array.isArray(e.suggestedPrompts))throw TypeError(".proto.BotSuggestedPromptMetadata.suggestedPrompts: array expected");i.suggestedPrompts=[];for(var A=0;A>>0),e.promptSuggestions!=null){if(typeof e.promptSuggestions!="object")throw TypeError(".proto.BotSuggestedPromptMetadata.promptSuggestions: object expected");i.promptSuggestions=d.proto.BotPromptSuggestions.fromObject(e.promptSuggestions)}return e.selectedPromptId!=null&&(i.selectedPromptId=String(e.selectedPromptId)),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.suggestedPrompts=[]),e.suggestedPrompts&&e.suggestedPrompts.length){A.suggestedPrompts=[];for(var r=0;r>>3){case 1:{s.sbsMetadata=d.proto.BotUnifiedResponseMutation.SideBySideMetadata.decode(e,e.uint32());break}case 2:{s.mediaDetailsMetadataList&&s.mediaDetailsMetadataList.length||(s.mediaDetailsMetadataList=[]),s.mediaDetailsMetadataList.push(d.proto.BotUnifiedResponseMutation.MediaDetailsMetadata.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.BotUnifiedResponseMutation)return e;var i=new d.proto.BotUnifiedResponseMutation;if(e.sbsMetadata!=null){if(typeof e.sbsMetadata!="object")throw TypeError(".proto.BotUnifiedResponseMutation.sbsMetadata: object expected");i.sbsMetadata=d.proto.BotUnifiedResponseMutation.SideBySideMetadata.fromObject(e.sbsMetadata)}if(e.mediaDetailsMetadataList){if(!Array.isArray(e.mediaDetailsMetadataList))throw TypeError(".proto.BotUnifiedResponseMutation.mediaDetailsMetadataList: array expected");i.mediaDetailsMetadataList=[];for(var A=0;A>>3){case 1:{c.id=A.string();break}case 2:{c.highResMedia=d.proto.BotMediaMetadata.decode(A,A.uint32());break}case 3:{c.previewMedia=d.proto.BotMediaMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.BotUnifiedResponseMutation.MediaDetailsMetadata)return A;var r=new d.proto.BotUnifiedResponseMutation.MediaDetailsMetadata;if(A.id!=null&&(r.id=String(A.id)),A.highResMedia!=null){if(typeof A.highResMedia!="object")throw TypeError(".proto.BotUnifiedResponseMutation.MediaDetailsMetadata.highResMedia: object expected");r.highResMedia=d.proto.BotMediaMetadata.fromObject(A.highResMedia)}if(A.previewMedia!=null){if(typeof A.previewMedia!="object")throw TypeError(".proto.BotUnifiedResponseMutation.MediaDetailsMetadata.previewMedia: object expected");r.previewMedia=d.proto.BotMediaMetadata.fromObject(A.previewMedia)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),A.highResMedia!=null&&A.hasOwnProperty("highResMedia")&&(s.highResMedia=d.proto.BotMediaMetadata.toObject(A.highResMedia,r),r.oneofs&&(s._highResMedia="highResMedia")),A.previewMedia!=null&&A.hasOwnProperty("previewMedia")&&(s.previewMedia=d.proto.BotMediaMetadata.toObject(A.previewMedia,r),r.oneofs&&(s._previewMedia="previewMedia")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotUnifiedResponseMutation.MediaDetailsMetadata"},a})(),t.SideBySideMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.primaryResponseId=A.string();break}case 2:{c.surveyCtaHasRendered=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.BotUnifiedResponseMutation.SideBySideMetadata)return A;var r=new d.proto.BotUnifiedResponseMutation.SideBySideMetadata;return A.primaryResponseId!=null&&(r.primaryResponseId=String(A.primaryResponseId)),A.surveyCtaHasRendered!=null&&(r.surveyCtaHasRendered=!!A.surveyCtaHasRendered),r},a.toObject=function(A,r){r||(r={});var s={};return A.primaryResponseId!=null&&A.hasOwnProperty("primaryResponseId")&&(s.primaryResponseId=A.primaryResponseId,r.oneofs&&(s._primaryResponseId="primaryResponseId")),A.surveyCtaHasRendered!=null&&A.hasOwnProperty("surveyCtaHasRendered")&&(s.surveyCtaHasRendered=A.surveyCtaHasRendered,r.oneofs&&(s._surveyCtaHasRendered="surveyCtaHasRendered")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.BotUnifiedResponseMutation.SideBySideMetadata"},a})(),t})(),n.CallLogRecord=(function(){function t(a){if(this.participants=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.callResult=e.int32();break}case 2:{s.isDndMode=e.bool();break}case 3:{s.silenceReason=e.int32();break}case 4:{s.duration=e.int64();break}case 5:{s.startTime=e.int64();break}case 6:{s.isIncoming=e.bool();break}case 7:{s.isVideo=e.bool();break}case 8:{s.isCallLink=e.bool();break}case 9:{s.callLinkToken=e.string();break}case 10:{s.scheduledCallId=e.string();break}case 11:{s.callId=e.string();break}case 12:{s.callCreatorJid=e.string();break}case 13:{s.groupJid=e.string();break}case 14:{s.participants&&s.participants.length||(s.participants=[]),s.participants.push(d.proto.CallLogRecord.ParticipantInfo.decode(e,e.uint32()));break}case 15:{s.callType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.CallLogRecord)return e;var i=new d.proto.CallLogRecord;switch(e.callResult){default:if(typeof e.callResult=="number"){i.callResult=e.callResult;break}break;case"CONNECTED":case 0:i.callResult=0;break;case"REJECTED":case 1:i.callResult=1;break;case"CANCELLED":case 2:i.callResult=2;break;case"ACCEPTEDELSEWHERE":case 3:i.callResult=3;break;case"MISSED":case 4:i.callResult=4;break;case"INVALID":case 5:i.callResult=5;break;case"UNAVAILABLE":case 6:i.callResult=6;break;case"UPCOMING":case 7:i.callResult=7;break;case"FAILED":case 8:i.callResult=8;break;case"ABANDONED":case 9:i.callResult=9;break;case"ONGOING":case 10:i.callResult=10;break}switch(e.isDndMode!=null&&(i.isDndMode=!!e.isDndMode),e.silenceReason){default:if(typeof e.silenceReason=="number"){i.silenceReason=e.silenceReason;break}break;case"NONE":case 0:i.silenceReason=0;break;case"SCHEDULED":case 1:i.silenceReason=1;break;case"PRIVACY":case 2:i.silenceReason=2;break;case"LIGHTWEIGHT":case 3:i.silenceReason=3;break}if(e.duration!=null&&(l.Long?(i.duration=l.Long.fromValue(e.duration)).unsigned=!1:typeof e.duration=="string"?i.duration=parseInt(e.duration,10):typeof e.duration=="number"?i.duration=e.duration:typeof e.duration=="object"&&(i.duration=new l.LongBits(e.duration.low>>>0,e.duration.high>>>0).toNumber())),e.startTime!=null&&(l.Long?(i.startTime=l.Long.fromValue(e.startTime)).unsigned=!1:typeof e.startTime=="string"?i.startTime=parseInt(e.startTime,10):typeof e.startTime=="number"?i.startTime=e.startTime:typeof e.startTime=="object"&&(i.startTime=new l.LongBits(e.startTime.low>>>0,e.startTime.high>>>0).toNumber())),e.isIncoming!=null&&(i.isIncoming=!!e.isIncoming),e.isVideo!=null&&(i.isVideo=!!e.isVideo),e.isCallLink!=null&&(i.isCallLink=!!e.isCallLink),e.callLinkToken!=null&&(i.callLinkToken=String(e.callLinkToken)),e.scheduledCallId!=null&&(i.scheduledCallId=String(e.scheduledCallId)),e.callId!=null&&(i.callId=String(e.callId)),e.callCreatorJid!=null&&(i.callCreatorJid=String(e.callCreatorJid)),e.groupJid!=null&&(i.groupJid=String(e.groupJid)),e.participants){if(!Array.isArray(e.participants))throw TypeError(".proto.CallLogRecord.participants: array expected");i.participants=[];for(var A=0;A>>3){case 1:{c.userJid=A.string();break}case 2:{c.callResult=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.CallLogRecord.ParticipantInfo)return A;var r=new d.proto.CallLogRecord.ParticipantInfo;switch(A.userJid!=null&&(r.userJid=String(A.userJid)),A.callResult){default:if(typeof A.callResult=="number"){r.callResult=A.callResult;break}break;case"CONNECTED":case 0:r.callResult=0;break;case"REJECTED":case 1:r.callResult=1;break;case"CANCELLED":case 2:r.callResult=2;break;case"ACCEPTEDELSEWHERE":case 3:r.callResult=3;break;case"MISSED":case 4:r.callResult=4;break;case"INVALID":case 5:r.callResult=5;break;case"UNAVAILABLE":case 6:r.callResult=6;break;case"UPCOMING":case 7:r.callResult=7;break;case"FAILED":case 8:r.callResult=8;break;case"ABANDONED":case 9:r.callResult=9;break;case"ONGOING":case 10:r.callResult=10;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.userJid!=null&&A.hasOwnProperty("userJid")&&(s.userJid=A.userJid,r.oneofs&&(s._userJid="userJid")),A.callResult!=null&&A.hasOwnProperty("callResult")&&(s.callResult=r.enums===String?d.proto.CallLogRecord.CallResult[A.callResult]===void 0?A.callResult:d.proto.CallLogRecord.CallResult[A.callResult]:A.callResult,r.oneofs&&(s._callResult="callResult")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.CallLogRecord.ParticipantInfo"},a})(),t.SilenceReason=(function(){let a={},e=Object.create(a);return e[a[0]="NONE"]=0,e[a[1]="SCHEDULED"]=1,e[a[2]="PRIVACY"]=2,e[a[3]="LIGHTWEIGHT"]=3,e})(),t})(),n.CertChain=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.leaf=d.proto.CertChain.NoiseCertificate.decode(e,e.uint32());break}case 2:{s.intermediate=d.proto.CertChain.NoiseCertificate.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.CertChain)return e;var i=new d.proto.CertChain;if(e.leaf!=null){if(typeof e.leaf!="object")throw TypeError(".proto.CertChain.leaf: object expected");i.leaf=d.proto.CertChain.NoiseCertificate.fromObject(e.leaf)}if(e.intermediate!=null){if(typeof e.intermediate!="object")throw TypeError(".proto.CertChain.intermediate: object expected");i.intermediate=d.proto.CertChain.NoiseCertificate.fromObject(e.intermediate)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.leaf!=null&&e.hasOwnProperty("leaf")&&(A.leaf=d.proto.CertChain.NoiseCertificate.toObject(e.leaf,i),i.oneofs&&(A._leaf="leaf")),e.intermediate!=null&&e.hasOwnProperty("intermediate")&&(A.intermediate=d.proto.CertChain.NoiseCertificate.toObject(e.intermediate,i),i.oneofs&&(A._intermediate="intermediate")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CertChain"},t.NoiseCertificate=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.details=A.bytes();break}case 2:{c.signature=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.CertChain.NoiseCertificate)return A;var r=new d.proto.CertChain.NoiseCertificate;return A.details!=null&&(typeof A.details=="string"?l.base64.decode(A.details,r.details=l.newBuffer(l.base64.length(A.details)),0):A.details.length>=0&&(r.details=A.details)),A.signature!=null&&(typeof A.signature=="string"?l.base64.decode(A.signature,r.signature=l.newBuffer(l.base64.length(A.signature)),0):A.signature.length>=0&&(r.signature=A.signature)),r},a.toObject=function(A,r){r||(r={});var s={};return A.details!=null&&A.hasOwnProperty("details")&&(s.details=r.bytes===String?l.base64.encode(A.details,0,A.details.length):r.bytes===Array?Array.prototype.slice.call(A.details):A.details,r.oneofs&&(s._details="details")),A.signature!=null&&A.hasOwnProperty("signature")&&(s.signature=r.bytes===String?l.base64.encode(A.signature,0,A.signature.length):r.bytes===Array?Array.prototype.slice.call(A.signature):A.signature,r.oneofs&&(s._signature="signature")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.CertChain.NoiseCertificate"},a.Details=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.serial=s.uint32();break}case 2:{p.issuerSerial=s.uint32();break}case 3:{p.key=s.bytes();break}case 4:{p.notBefore=s.uint64();break}case 5:{p.notAfter=s.uint64();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.CertChain.NoiseCertificate.Details)return s;var g=new d.proto.CertChain.NoiseCertificate.Details;return s.serial!=null&&(g.serial=s.serial>>>0),s.issuerSerial!=null&&(g.issuerSerial=s.issuerSerial>>>0),s.key!=null&&(typeof s.key=="string"?l.base64.decode(s.key,g.key=l.newBuffer(l.base64.length(s.key)),0):s.key.length>=0&&(g.key=s.key)),s.notBefore!=null&&(l.Long?(g.notBefore=l.Long.fromValue(s.notBefore)).unsigned=!0:typeof s.notBefore=="string"?g.notBefore=parseInt(s.notBefore,10):typeof s.notBefore=="number"?g.notBefore=s.notBefore:typeof s.notBefore=="object"&&(g.notBefore=new l.LongBits(s.notBefore.low>>>0,s.notBefore.high>>>0).toNumber(!0))),s.notAfter!=null&&(l.Long?(g.notAfter=l.Long.fromValue(s.notAfter)).unsigned=!0:typeof s.notAfter=="string"?g.notAfter=parseInt(s.notAfter,10):typeof s.notAfter=="number"?g.notAfter=s.notAfter:typeof s.notAfter=="object"&&(g.notAfter=new l.LongBits(s.notAfter.low>>>0,s.notAfter.high>>>0).toNumber(!0))),g},i.toObject=function(s,g){g||(g={});var c={};return s.serial!=null&&s.hasOwnProperty("serial")&&(c.serial=s.serial,g.oneofs&&(c._serial="serial")),s.issuerSerial!=null&&s.hasOwnProperty("issuerSerial")&&(c.issuerSerial=s.issuerSerial,g.oneofs&&(c._issuerSerial="issuerSerial")),s.key!=null&&s.hasOwnProperty("key")&&(c.key=g.bytes===String?l.base64.encode(s.key,0,s.key.length):g.bytes===Array?Array.prototype.slice.call(s.key):s.key,g.oneofs&&(c._key="key")),s.notBefore!=null&&s.hasOwnProperty("notBefore")&&(typeof s.notBefore=="number"?c.notBefore=g.longs===String?String(s.notBefore):s.notBefore:c.notBefore=g.longs===String?ge(s.notBefore,!0):g.longs===Number?ce(s.notBefore,!0):s.notBefore,g.oneofs&&(c._notBefore="notBefore")),s.notAfter!=null&&s.hasOwnProperty("notAfter")&&(typeof s.notAfter=="number"?c.notAfter=g.longs===String?String(s.notAfter):s.notAfter:c.notAfter=g.longs===String?ge(s.notAfter,!0):g.longs===Number?ce(s.notAfter,!0):s.notAfter,g.oneofs&&(c._notAfter="notAfter")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.CertChain.NoiseCertificate.Details"},i})(),a})(),t})(),n.ChatLockSettings=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.hideLockedChats=e.bool();break}case 2:{s.secretCode=d.proto.UserPassword.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ChatLockSettings)return e;var i=new d.proto.ChatLockSettings;if(e.hideLockedChats!=null&&(i.hideLockedChats=!!e.hideLockedChats),e.secretCode!=null){if(typeof e.secretCode!="object")throw TypeError(".proto.ChatLockSettings.secretCode: object expected");i.secretCode=d.proto.UserPassword.fromObject(e.secretCode)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.hideLockedChats!=null&&e.hasOwnProperty("hideLockedChats")&&(A.hideLockedChats=e.hideLockedChats,i.oneofs&&(A._hideLockedChats="hideLockedChats")),e.secretCode!=null&&e.hasOwnProperty("secretCode")&&(A.secretCode=d.proto.UserPassword.toObject(e.secretCode,i),i.oneofs&&(A._secretCode="secretCode")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ChatLockSettings"},t})(),n.ChatRowOpaqueData=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.draftMessage=d.proto.ChatRowOpaqueData.DraftMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ChatRowOpaqueData)return e;var i=new d.proto.ChatRowOpaqueData;if(e.draftMessage!=null){if(typeof e.draftMessage!="object")throw TypeError(".proto.ChatRowOpaqueData.draftMessage: object expected");i.draftMessage=d.proto.ChatRowOpaqueData.DraftMessage.fromObject(e.draftMessage)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.draftMessage!=null&&e.hasOwnProperty("draftMessage")&&(A.draftMessage=d.proto.ChatRowOpaqueData.DraftMessage.toObject(e.draftMessage,i),i.oneofs&&(A._draftMessage="draftMessage")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ChatRowOpaqueData"},t.DraftMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.text=A.string();break}case 2:{c.omittedUrl=A.string();break}case 3:{c.ctwaContextLinkData=d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.decode(A,A.uint32());break}case 4:{c.ctwaContext=d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.decode(A,A.uint32());break}case 5:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ChatRowOpaqueData.DraftMessage)return A;var r=new d.proto.ChatRowOpaqueData.DraftMessage;if(A.text!=null&&(r.text=String(A.text)),A.omittedUrl!=null&&(r.omittedUrl=String(A.omittedUrl)),A.ctwaContextLinkData!=null){if(typeof A.ctwaContextLinkData!="object")throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContextLinkData: object expected");r.ctwaContextLinkData=d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.fromObject(A.ctwaContextLinkData)}if(A.ctwaContext!=null){if(typeof A.ctwaContext!="object")throw TypeError(".proto.ChatRowOpaqueData.DraftMessage.ctwaContext: object expected");r.ctwaContext=d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.fromObject(A.ctwaContext)}return A.timestamp!=null&&(l.Long?(r.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?r.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?r.timestamp=A.timestamp:typeof A.timestamp=="object"&&(r.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.omittedUrl!=null&&A.hasOwnProperty("omittedUrl")&&(s.omittedUrl=A.omittedUrl,r.oneofs&&(s._omittedUrl="omittedUrl")),A.ctwaContextLinkData!=null&&A.hasOwnProperty("ctwaContextLinkData")&&(s.ctwaContextLinkData=d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData.toObject(A.ctwaContextLinkData,r),r.oneofs&&(s._ctwaContextLinkData="ctwaContextLinkData")),A.ctwaContext!=null&&A.hasOwnProperty("ctwaContext")&&(s.ctwaContext=d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.toObject(A.ctwaContext,r),r.oneofs&&(s._ctwaContext="ctwaContext")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=r.longs===String?String(A.timestamp):A.timestamp:s.timestamp=r.longs===String?ge(A.timestamp):r.longs===Number?ce(A.timestamp):A.timestamp,r.oneofs&&(s._timestamp="timestamp")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ChatRowOpaqueData.DraftMessage"},a.CtwaContextData=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.conversionSource=s.string();break}case 2:{p.conversionData=s.bytes();break}case 3:{p.sourceUrl=s.string();break}case 4:{p.sourceId=s.string();break}case 5:{p.sourceType=s.string();break}case 6:{p.title=s.string();break}case 7:{p.description=s.string();break}case 8:{p.thumbnail=s.string();break}case 9:{p.thumbnailUrl=s.string();break}case 10:{p.mediaType=s.int32();break}case 11:{p.mediaUrl=s.string();break}case 12:{p.isSuspiciousLink=s.bool();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData)return s;var g=new d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData;switch(s.conversionSource!=null&&(g.conversionSource=String(s.conversionSource)),s.conversionData!=null&&(typeof s.conversionData=="string"?l.base64.decode(s.conversionData,g.conversionData=l.newBuffer(l.base64.length(s.conversionData)),0):s.conversionData.length>=0&&(g.conversionData=s.conversionData)),s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.sourceId!=null&&(g.sourceId=String(s.sourceId)),s.sourceType!=null&&(g.sourceType=String(s.sourceType)),s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.thumbnail!=null&&(g.thumbnail=String(s.thumbnail)),s.thumbnailUrl!=null&&(g.thumbnailUrl=String(s.thumbnailUrl)),s.mediaType){default:if(typeof s.mediaType=="number"){g.mediaType=s.mediaType;break}break;case"NONE":case 0:g.mediaType=0;break;case"IMAGE":case 1:g.mediaType=1;break;case"VIDEO":case 2:g.mediaType=2;break}return s.mediaUrl!=null&&(g.mediaUrl=String(s.mediaUrl)),s.isSuspiciousLink!=null&&(g.isSuspiciousLink=!!s.isSuspiciousLink),g},i.toObject=function(s,g){g||(g={});var c={};return s.conversionSource!=null&&s.hasOwnProperty("conversionSource")&&(c.conversionSource=s.conversionSource,g.oneofs&&(c._conversionSource="conversionSource")),s.conversionData!=null&&s.hasOwnProperty("conversionData")&&(c.conversionData=g.bytes===String?l.base64.encode(s.conversionData,0,s.conversionData.length):g.bytes===Array?Array.prototype.slice.call(s.conversionData):s.conversionData,g.oneofs&&(c._conversionData="conversionData")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.sourceId!=null&&s.hasOwnProperty("sourceId")&&(c.sourceId=s.sourceId,g.oneofs&&(c._sourceId="sourceId")),s.sourceType!=null&&s.hasOwnProperty("sourceType")&&(c.sourceType=s.sourceType,g.oneofs&&(c._sourceType="sourceType")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.thumbnail!=null&&s.hasOwnProperty("thumbnail")&&(c.thumbnail=s.thumbnail,g.oneofs&&(c._thumbnail="thumbnail")),s.thumbnailUrl!=null&&s.hasOwnProperty("thumbnailUrl")&&(c.thumbnailUrl=s.thumbnailUrl,g.oneofs&&(c._thumbnailUrl="thumbnailUrl")),s.mediaType!=null&&s.hasOwnProperty("mediaType")&&(c.mediaType=g.enums===String?d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[s.mediaType]===void 0?s.mediaType:d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextData.ContextInfoExternalAdReplyInfoMediaType[s.mediaType]:s.mediaType,g.oneofs&&(c._mediaType="mediaType")),s.mediaUrl!=null&&s.hasOwnProperty("mediaUrl")&&(c.mediaUrl=s.mediaUrl,g.oneofs&&(c._mediaUrl="mediaUrl")),s.isSuspiciousLink!=null&&s.hasOwnProperty("isSuspiciousLink")&&(c.isSuspiciousLink=s.isSuspiciousLink,g.oneofs&&(c._isSuspiciousLink="isSuspiciousLink")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ChatRowOpaqueData.DraftMessage.CtwaContextData"},i.ContextInfoExternalAdReplyInfoMediaType=(function(){let r={},s=Object.create(r);return s[r[0]="NONE"]=0,s[r[1]="IMAGE"]=1,s[r[2]="VIDEO"]=2,s})(),i})(),a.CtwaContextLinkData=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.context=s.string();break}case 2:{p.sourceUrl=s.string();break}case 3:{p.icebreaker=s.string();break}case 4:{p.phone=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData)return s;var g=new d.proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData;return s.context!=null&&(g.context=String(s.context)),s.sourceUrl!=null&&(g.sourceUrl=String(s.sourceUrl)),s.icebreaker!=null&&(g.icebreaker=String(s.icebreaker)),s.phone!=null&&(g.phone=String(s.phone)),g},i.toObject=function(s,g){g||(g={});var c={};return s.context!=null&&s.hasOwnProperty("context")&&(c.context=s.context,g.oneofs&&(c._context="context")),s.sourceUrl!=null&&s.hasOwnProperty("sourceUrl")&&(c.sourceUrl=s.sourceUrl,g.oneofs&&(c._sourceUrl="sourceUrl")),s.icebreaker!=null&&s.hasOwnProperty("icebreaker")&&(c.icebreaker=s.icebreaker,g.oneofs&&(c._icebreaker="icebreaker")),s.phone!=null&&s.hasOwnProperty("phone")&&(c.phone=s.phone,g.oneofs&&(c._phone="phone")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ChatRowOpaqueData.DraftMessage.CtwaContextLinkData"},i})(),a})(),t})(),n.Citation=(function(){function t(o){if(o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.title=a.string();break}case 2:{r.subtitle=a.string();break}case 3:{r.cmsId=a.string();break}case 4:{r.imageUrl=a.string();break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.Citation)return a;var e=new d.proto.Citation;return a.title!=null&&(e.title=String(a.title)),a.subtitle!=null&&(e.subtitle=String(a.subtitle)),a.cmsId!=null&&(e.cmsId=String(a.cmsId)),a.imageUrl!=null&&(e.imageUrl=String(a.imageUrl)),e},t.toObject=function(a,e){e||(e={});var i={};return e.defaults&&(i.title="",i.subtitle="",i.cmsId="",i.imageUrl=""),a.title!=null&&a.hasOwnProperty("title")&&(i.title=a.title),a.subtitle!=null&&a.hasOwnProperty("subtitle")&&(i.subtitle=a.subtitle),a.cmsId!=null&&a.hasOwnProperty("cmsId")&&(i.cmsId=a.cmsId),a.imageUrl!=null&&a.hasOwnProperty("imageUrl")&&(i.imageUrl=a.imageUrl),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/proto.Citation"},t})(),n.ClientPairingProps=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.isChatDbLidMigrated=e.bool();break}case 2:{s.isSyncdPureLidSession=e.bool();break}case 3:{s.isSyncdSnapshotRecoveryEnabled=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ClientPairingProps)return e;var i=new d.proto.ClientPairingProps;return e.isChatDbLidMigrated!=null&&(i.isChatDbLidMigrated=!!e.isChatDbLidMigrated),e.isSyncdPureLidSession!=null&&(i.isSyncdPureLidSession=!!e.isSyncdPureLidSession),e.isSyncdSnapshotRecoveryEnabled!=null&&(i.isSyncdSnapshotRecoveryEnabled=!!e.isSyncdSnapshotRecoveryEnabled),i},t.toObject=function(e,i){i||(i={});var A={};return e.isChatDbLidMigrated!=null&&e.hasOwnProperty("isChatDbLidMigrated")&&(A.isChatDbLidMigrated=e.isChatDbLidMigrated,i.oneofs&&(A._isChatDbLidMigrated="isChatDbLidMigrated")),e.isSyncdPureLidSession!=null&&e.hasOwnProperty("isSyncdPureLidSession")&&(A.isSyncdPureLidSession=e.isSyncdPureLidSession,i.oneofs&&(A._isSyncdPureLidSession="isSyncdPureLidSession")),e.isSyncdSnapshotRecoveryEnabled!=null&&e.hasOwnProperty("isSyncdSnapshotRecoveryEnabled")&&(A.isSyncdSnapshotRecoveryEnabled=e.isSyncdSnapshotRecoveryEnabled,i.oneofs&&(A._isSyncdSnapshotRecoveryEnabled="isSyncdSnapshotRecoveryEnabled")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ClientPairingProps"},t})(),n.ClientPayload=(function(){function t(a){if(this.shards=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.username=e.uint64();break}case 3:{s.passive=e.bool();break}case 5:{s.userAgent=d.proto.ClientPayload.UserAgent.decode(e,e.uint32());break}case 6:{s.webInfo=d.proto.ClientPayload.WebInfo.decode(e,e.uint32());break}case 7:{s.pushName=e.string();break}case 9:{s.sessionId=e.sfixed32();break}case 10:{s.shortConnect=e.bool();break}case 12:{s.connectType=e.int32();break}case 13:{s.connectReason=e.int32();break}case 14:{if(s.shards&&s.shards.length||(s.shards=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos>>0,e.username.high>>>0).toNumber(!0))),e.passive!=null&&(i.passive=!!e.passive),e.userAgent!=null){if(typeof e.userAgent!="object")throw TypeError(".proto.ClientPayload.userAgent: object expected");i.userAgent=d.proto.ClientPayload.UserAgent.fromObject(e.userAgent)}if(e.webInfo!=null){if(typeof e.webInfo!="object")throw TypeError(".proto.ClientPayload.webInfo: object expected");i.webInfo=d.proto.ClientPayload.WebInfo.fromObject(e.webInfo)}switch(e.pushName!=null&&(i.pushName=String(e.pushName)),e.sessionId!=null&&(i.sessionId=e.sessionId|0),e.shortConnect!=null&&(i.shortConnect=!!e.shortConnect),e.connectType){default:if(typeof e.connectType=="number"){i.connectType=e.connectType;break}break;case"CELLULAR_UNKNOWN":case 0:i.connectType=0;break;case"WIFI_UNKNOWN":case 1:i.connectType=1;break;case"CELLULAR_EDGE":case 100:i.connectType=100;break;case"CELLULAR_IDEN":case 101:i.connectType=101;break;case"CELLULAR_UMTS":case 102:i.connectType=102;break;case"CELLULAR_EVDO":case 103:i.connectType=103;break;case"CELLULAR_GPRS":case 104:i.connectType=104;break;case"CELLULAR_HSDPA":case 105:i.connectType=105;break;case"CELLULAR_HSUPA":case 106:i.connectType=106;break;case"CELLULAR_HSPA":case 107:i.connectType=107;break;case"CELLULAR_CDMA":case 108:i.connectType=108;break;case"CELLULAR_1XRTT":case 109:i.connectType=109;break;case"CELLULAR_EHRPD":case 110:i.connectType=110;break;case"CELLULAR_LTE":case 111:i.connectType=111;break;case"CELLULAR_HSPAP":case 112:i.connectType=112;break}switch(e.connectReason){default:if(typeof e.connectReason=="number"){i.connectReason=e.connectReason;break}break;case"PUSH":case 0:i.connectReason=0;break;case"USER_ACTIVATED":case 1:i.connectReason=1;break;case"SCHEDULED":case 2:i.connectReason=2;break;case"ERROR_RECONNECT":case 3:i.connectReason=3;break;case"NETWORK_SWITCH":case 4:i.connectReason=4;break;case"PING_RECONNECT":case 5:i.connectReason=5;break;case"UNKNOWN":case 6:i.connectReason=6;break}if(e.shards){if(!Array.isArray(e.shards))throw TypeError(".proto.ClientPayload.shards: array expected");i.shards=[];for(var A=0;A>>0),e.device!=null&&(i.device=e.device>>>0),e.devicePairingData!=null){if(typeof e.devicePairingData!="object")throw TypeError(".proto.ClientPayload.devicePairingData: object expected");i.devicePairingData=d.proto.ClientPayload.DevicePairingRegistrationData.fromObject(e.devicePairingData)}switch(e.product){default:if(typeof e.product=="number"){i.product=e.product;break}break;case"WHATSAPP":case 0:i.product=0;break;case"MESSENGER":case 1:i.product=1;break;case"INTEROP":case 2:i.product=2;break;case"INTEROP_MSGR":case 3:i.product=3;break;case"WHATSAPP_LID":case 4:i.product=4;break}switch(e.fbCat!=null&&(typeof e.fbCat=="string"?l.base64.decode(e.fbCat,i.fbCat=l.newBuffer(l.base64.length(e.fbCat)),0):e.fbCat.length>=0&&(i.fbCat=e.fbCat)),e.fbUserAgent!=null&&(typeof e.fbUserAgent=="string"?l.base64.decode(e.fbUserAgent,i.fbUserAgent=l.newBuffer(l.base64.length(e.fbUserAgent)),0):e.fbUserAgent.length>=0&&(i.fbUserAgent=e.fbUserAgent)),e.oc!=null&&(i.oc=!!e.oc),e.lc!=null&&(i.lc=e.lc|0),e.iosAppExtension){default:if(typeof e.iosAppExtension=="number"){i.iosAppExtension=e.iosAppExtension;break}break;case"SHARE_EXTENSION":case 0:i.iosAppExtension=0;break;case"SERVICE_EXTENSION":case 1:i.iosAppExtension=1;break;case"INTENTS_EXTENSION":case 2:i.iosAppExtension=2;break}if(e.fbAppId!=null&&(l.Long?(i.fbAppId=l.Long.fromValue(e.fbAppId)).unsigned=!0:typeof e.fbAppId=="string"?i.fbAppId=parseInt(e.fbAppId,10):typeof e.fbAppId=="number"?i.fbAppId=e.fbAppId:typeof e.fbAppId=="object"&&(i.fbAppId=new l.LongBits(e.fbAppId.low>>>0,e.fbAppId.high>>>0).toNumber(!0))),e.fbDeviceId!=null&&(typeof e.fbDeviceId=="string"?l.base64.decode(e.fbDeviceId,i.fbDeviceId=l.newBuffer(l.base64.length(e.fbDeviceId)),0):e.fbDeviceId.length>=0&&(i.fbDeviceId=e.fbDeviceId)),e.pull!=null&&(i.pull=!!e.pull),e.paddingBytes!=null&&(typeof e.paddingBytes=="string"?l.base64.decode(e.paddingBytes,i.paddingBytes=l.newBuffer(l.base64.length(e.paddingBytes)),0):e.paddingBytes.length>=0&&(i.paddingBytes=e.paddingBytes)),e.yearClass!=null&&(i.yearClass=e.yearClass|0),e.memClass!=null&&(i.memClass=e.memClass|0),e.interopData!=null){if(typeof e.interopData!="object")throw TypeError(".proto.ClientPayload.interopData: object expected");i.interopData=d.proto.ClientPayload.InteropData.fromObject(e.interopData)}switch(e.trafficAnonymization){default:if(typeof e.trafficAnonymization=="number"){i.trafficAnonymization=e.trafficAnonymization;break}break;case"OFF":case 0:i.trafficAnonymization=0;break;case"STANDARD":case 1:i.trafficAnonymization=1;break}switch(e.lidDbMigrated!=null&&(i.lidDbMigrated=!!e.lidDbMigrated),e.accountType){default:if(typeof e.accountType=="number"){i.accountType=e.accountType;break}break;case"DEFAULT":case 0:i.accountType=0;break;case"GUEST":case 1:i.accountType=1;break}return e.connectionSequenceInfo!=null&&(i.connectionSequenceInfo=e.connectionSequenceInfo|0),e.paaLink!=null&&(i.paaLink=!!e.paaLink),e.preacksCount!=null&&(i.preacksCount=e.preacksCount|0),e.processingQueueSize!=null&&(i.processingQueueSize=e.processingQueueSize|0),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.shards=[]),e.username!=null&&e.hasOwnProperty("username")&&(typeof e.username=="number"?A.username=i.longs===String?String(e.username):e.username:A.username=i.longs===String?ge(e.username,!0):i.longs===Number?ce(e.username,!0):e.username,i.oneofs&&(A._username="username")),e.passive!=null&&e.hasOwnProperty("passive")&&(A.passive=e.passive,i.oneofs&&(A._passive="passive")),e.userAgent!=null&&e.hasOwnProperty("userAgent")&&(A.userAgent=d.proto.ClientPayload.UserAgent.toObject(e.userAgent,i),i.oneofs&&(A._userAgent="userAgent")),e.webInfo!=null&&e.hasOwnProperty("webInfo")&&(A.webInfo=d.proto.ClientPayload.WebInfo.toObject(e.webInfo,i),i.oneofs&&(A._webInfo="webInfo")),e.pushName!=null&&e.hasOwnProperty("pushName")&&(A.pushName=e.pushName,i.oneofs&&(A._pushName="pushName")),e.sessionId!=null&&e.hasOwnProperty("sessionId")&&(A.sessionId=e.sessionId,i.oneofs&&(A._sessionId="sessionId")),e.shortConnect!=null&&e.hasOwnProperty("shortConnect")&&(A.shortConnect=e.shortConnect,i.oneofs&&(A._shortConnect="shortConnect")),e.connectType!=null&&e.hasOwnProperty("connectType")&&(A.connectType=i.enums===String?d.proto.ClientPayload.ConnectType[e.connectType]===void 0?e.connectType:d.proto.ClientPayload.ConnectType[e.connectType]:e.connectType,i.oneofs&&(A._connectType="connectType")),e.connectReason!=null&&e.hasOwnProperty("connectReason")&&(A.connectReason=i.enums===String?d.proto.ClientPayload.ConnectReason[e.connectReason]===void 0?e.connectReason:d.proto.ClientPayload.ConnectReason[e.connectReason]:e.connectReason,i.oneofs&&(A._connectReason="connectReason")),e.shards&&e.shards.length){A.shards=[];for(var r=0;r>>3){case 15:{c.dnsMethod=A.int32();break}case 16:{c.appCached=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ClientPayload.DNSSource)return A;var r=new d.proto.ClientPayload.DNSSource;switch(A.dnsMethod){default:if(typeof A.dnsMethod=="number"){r.dnsMethod=A.dnsMethod;break}break;case"SYSTEM":case 0:r.dnsMethod=0;break;case"GOOGLE":case 1:r.dnsMethod=1;break;case"HARDCODED":case 2:r.dnsMethod=2;break;case"OVERRIDE":case 3:r.dnsMethod=3;break;case"FALLBACK":case 4:r.dnsMethod=4;break;case"MNS":case 5:r.dnsMethod=5;break}return A.appCached!=null&&(r.appCached=!!A.appCached),r},a.toObject=function(A,r){r||(r={});var s={};return A.dnsMethod!=null&&A.hasOwnProperty("dnsMethod")&&(s.dnsMethod=r.enums===String?d.proto.ClientPayload.DNSSource.DNSResolutionMethod[A.dnsMethod]===void 0?A.dnsMethod:d.proto.ClientPayload.DNSSource.DNSResolutionMethod[A.dnsMethod]:A.dnsMethod,r.oneofs&&(s._dnsMethod="dnsMethod")),A.appCached!=null&&A.hasOwnProperty("appCached")&&(s.appCached=A.appCached,r.oneofs&&(s._appCached="appCached")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.DNSSource"},a.DNSResolutionMethod=(function(){let i={},A=Object.create(i);return A[i[0]="SYSTEM"]=0,A[i[1]="GOOGLE"]=1,A[i[2]="HARDCODED"]=2,A[i[3]="OVERRIDE"]=3,A[i[4]="FALLBACK"]=4,A[i[5]="MNS"]=5,A})(),a})(),t.DevicePairingRegistrationData=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.eRegid=A.bytes();break}case 2:{c.eKeytype=A.bytes();break}case 3:{c.eIdent=A.bytes();break}case 4:{c.eSkeyId=A.bytes();break}case 5:{c.eSkeyVal=A.bytes();break}case 6:{c.eSkeySig=A.bytes();break}case 7:{c.buildHash=A.bytes();break}case 8:{c.deviceProps=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ClientPayload.DevicePairingRegistrationData)return A;var r=new d.proto.ClientPayload.DevicePairingRegistrationData;return A.eRegid!=null&&(typeof A.eRegid=="string"?l.base64.decode(A.eRegid,r.eRegid=l.newBuffer(l.base64.length(A.eRegid)),0):A.eRegid.length>=0&&(r.eRegid=A.eRegid)),A.eKeytype!=null&&(typeof A.eKeytype=="string"?l.base64.decode(A.eKeytype,r.eKeytype=l.newBuffer(l.base64.length(A.eKeytype)),0):A.eKeytype.length>=0&&(r.eKeytype=A.eKeytype)),A.eIdent!=null&&(typeof A.eIdent=="string"?l.base64.decode(A.eIdent,r.eIdent=l.newBuffer(l.base64.length(A.eIdent)),0):A.eIdent.length>=0&&(r.eIdent=A.eIdent)),A.eSkeyId!=null&&(typeof A.eSkeyId=="string"?l.base64.decode(A.eSkeyId,r.eSkeyId=l.newBuffer(l.base64.length(A.eSkeyId)),0):A.eSkeyId.length>=0&&(r.eSkeyId=A.eSkeyId)),A.eSkeyVal!=null&&(typeof A.eSkeyVal=="string"?l.base64.decode(A.eSkeyVal,r.eSkeyVal=l.newBuffer(l.base64.length(A.eSkeyVal)),0):A.eSkeyVal.length>=0&&(r.eSkeyVal=A.eSkeyVal)),A.eSkeySig!=null&&(typeof A.eSkeySig=="string"?l.base64.decode(A.eSkeySig,r.eSkeySig=l.newBuffer(l.base64.length(A.eSkeySig)),0):A.eSkeySig.length>=0&&(r.eSkeySig=A.eSkeySig)),A.buildHash!=null&&(typeof A.buildHash=="string"?l.base64.decode(A.buildHash,r.buildHash=l.newBuffer(l.base64.length(A.buildHash)),0):A.buildHash.length>=0&&(r.buildHash=A.buildHash)),A.deviceProps!=null&&(typeof A.deviceProps=="string"?l.base64.decode(A.deviceProps,r.deviceProps=l.newBuffer(l.base64.length(A.deviceProps)),0):A.deviceProps.length>=0&&(r.deviceProps=A.deviceProps)),r},a.toObject=function(A,r){r||(r={});var s={};return A.eRegid!=null&&A.hasOwnProperty("eRegid")&&(s.eRegid=r.bytes===String?l.base64.encode(A.eRegid,0,A.eRegid.length):r.bytes===Array?Array.prototype.slice.call(A.eRegid):A.eRegid,r.oneofs&&(s._eRegid="eRegid")),A.eKeytype!=null&&A.hasOwnProperty("eKeytype")&&(s.eKeytype=r.bytes===String?l.base64.encode(A.eKeytype,0,A.eKeytype.length):r.bytes===Array?Array.prototype.slice.call(A.eKeytype):A.eKeytype,r.oneofs&&(s._eKeytype="eKeytype")),A.eIdent!=null&&A.hasOwnProperty("eIdent")&&(s.eIdent=r.bytes===String?l.base64.encode(A.eIdent,0,A.eIdent.length):r.bytes===Array?Array.prototype.slice.call(A.eIdent):A.eIdent,r.oneofs&&(s._eIdent="eIdent")),A.eSkeyId!=null&&A.hasOwnProperty("eSkeyId")&&(s.eSkeyId=r.bytes===String?l.base64.encode(A.eSkeyId,0,A.eSkeyId.length):r.bytes===Array?Array.prototype.slice.call(A.eSkeyId):A.eSkeyId,r.oneofs&&(s._eSkeyId="eSkeyId")),A.eSkeyVal!=null&&A.hasOwnProperty("eSkeyVal")&&(s.eSkeyVal=r.bytes===String?l.base64.encode(A.eSkeyVal,0,A.eSkeyVal.length):r.bytes===Array?Array.prototype.slice.call(A.eSkeyVal):A.eSkeyVal,r.oneofs&&(s._eSkeyVal="eSkeyVal")),A.eSkeySig!=null&&A.hasOwnProperty("eSkeySig")&&(s.eSkeySig=r.bytes===String?l.base64.encode(A.eSkeySig,0,A.eSkeySig.length):r.bytes===Array?Array.prototype.slice.call(A.eSkeySig):A.eSkeySig,r.oneofs&&(s._eSkeySig="eSkeySig")),A.buildHash!=null&&A.hasOwnProperty("buildHash")&&(s.buildHash=r.bytes===String?l.base64.encode(A.buildHash,0,A.buildHash.length):r.bytes===Array?Array.prototype.slice.call(A.buildHash):A.buildHash,r.oneofs&&(s._buildHash="buildHash")),A.deviceProps!=null&&A.hasOwnProperty("deviceProps")&&(s.deviceProps=r.bytes===String?l.base64.encode(A.deviceProps,0,A.deviceProps.length):r.bytes===Array?Array.prototype.slice.call(A.deviceProps):A.deviceProps,r.oneofs&&(s._deviceProps="deviceProps")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.DevicePairingRegistrationData"},a})(),t.IOSAppExtension=(function(){let a={},e=Object.create(a);return e[a[0]="SHARE_EXTENSION"]=0,e[a[1]="SERVICE_EXTENSION"]=1,e[a[2]="INTENTS_EXTENSION"]=2,e})(),t.InteropData=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.accountId=A.uint64();break}case 2:{c.token=A.bytes();break}case 3:{c.enableReadReceipts=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ClientPayload.InteropData)return A;var r=new d.proto.ClientPayload.InteropData;return A.accountId!=null&&(l.Long?(r.accountId=l.Long.fromValue(A.accountId)).unsigned=!0:typeof A.accountId=="string"?r.accountId=parseInt(A.accountId,10):typeof A.accountId=="number"?r.accountId=A.accountId:typeof A.accountId=="object"&&(r.accountId=new l.LongBits(A.accountId.low>>>0,A.accountId.high>>>0).toNumber(!0))),A.token!=null&&(typeof A.token=="string"?l.base64.decode(A.token,r.token=l.newBuffer(l.base64.length(A.token)),0):A.token.length>=0&&(r.token=A.token)),A.enableReadReceipts!=null&&(r.enableReadReceipts=!!A.enableReadReceipts),r},a.toObject=function(A,r){r||(r={});var s={};return A.accountId!=null&&A.hasOwnProperty("accountId")&&(typeof A.accountId=="number"?s.accountId=r.longs===String?String(A.accountId):A.accountId:s.accountId=r.longs===String?ge(A.accountId,!0):r.longs===Number?ce(A.accountId,!0):A.accountId,r.oneofs&&(s._accountId="accountId")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=r.bytes===String?l.base64.encode(A.token,0,A.token.length):r.bytes===Array?Array.prototype.slice.call(A.token):A.token,r.oneofs&&(s._token="token")),A.enableReadReceipts!=null&&A.hasOwnProperty("enableReadReceipts")&&(s.enableReadReceipts=A.enableReadReceipts,r.oneofs&&(s._enableReadReceipts="enableReadReceipts")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.InteropData"},a})(),t.Product=(function(){let a={},e=Object.create(a);return e[a[0]="WHATSAPP"]=0,e[a[1]="MESSENGER"]=1,e[a[2]="INTEROP"]=2,e[a[3]="INTEROP_MSGR"]=3,e[a[4]="WHATSAPP_LID"]=4,e})(),t.TrafficAnonymization=(function(){let a={},e=Object.create(a);return e[a[0]="OFF"]=0,e[a[1]="STANDARD"]=1,e})(),t.UserAgent=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.platform=A.int32();break}case 2:{c.appVersion=d.proto.ClientPayload.UserAgent.AppVersion.decode(A,A.uint32());break}case 3:{c.mcc=A.string();break}case 4:{c.mnc=A.string();break}case 5:{c.osVersion=A.string();break}case 6:{c.manufacturer=A.string();break}case 7:{c.device=A.string();break}case 8:{c.osBuildNumber=A.string();break}case 9:{c.phoneId=A.string();break}case 10:{c.releaseChannel=A.int32();break}case 11:{c.localeLanguageIso6391=A.string();break}case 12:{c.localeCountryIso31661Alpha2=A.string();break}case 13:{c.deviceBoard=A.string();break}case 14:{c.deviceExpId=A.string();break}case 15:{c.deviceType=A.int32();break}case 16:{c.deviceModelType=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ClientPayload.UserAgent)return A;var r=new d.proto.ClientPayload.UserAgent;switch(A.platform){default:if(typeof A.platform=="number"){r.platform=A.platform;break}break;case"ANDROID":case 0:r.platform=0;break;case"IOS":case 1:r.platform=1;break;case"WINDOWS_PHONE":case 2:r.platform=2;break;case"BLACKBERRY":case 3:r.platform=3;break;case"BLACKBERRYX":case 4:r.platform=4;break;case"S40":case 5:r.platform=5;break;case"S60":case 6:r.platform=6;break;case"PYTHON_CLIENT":case 7:r.platform=7;break;case"TIZEN":case 8:r.platform=8;break;case"ENTERPRISE":case 9:r.platform=9;break;case"SMB_ANDROID":case 10:r.platform=10;break;case"KAIOS":case 11:r.platform=11;break;case"SMB_IOS":case 12:r.platform=12;break;case"WINDOWS":case 13:r.platform=13;break;case"WEB":case 14:r.platform=14;break;case"PORTAL":case 15:r.platform=15;break;case"GREEN_ANDROID":case 16:r.platform=16;break;case"GREEN_IPHONE":case 17:r.platform=17;break;case"BLUE_ANDROID":case 18:r.platform=18;break;case"BLUE_IPHONE":case 19:r.platform=19;break;case"FBLITE_ANDROID":case 20:r.platform=20;break;case"MLITE_ANDROID":case 21:r.platform=21;break;case"IGLITE_ANDROID":case 22:r.platform=22;break;case"PAGE":case 23:r.platform=23;break;case"MACOS":case 24:r.platform=24;break;case"OCULUS_MSG":case 25:r.platform=25;break;case"OCULUS_CALL":case 26:r.platform=26;break;case"MILAN":case 27:r.platform=27;break;case"CAPI":case 28:r.platform=28;break;case"WEAROS":case 29:r.platform=29;break;case"ARDEVICE":case 30:r.platform=30;break;case"VRDEVICE":case 31:r.platform=31;break;case"BLUE_WEB":case 32:r.platform=32;break;case"IPAD":case 33:r.platform=33;break;case"TEST":case 34:r.platform=34;break;case"SMART_GLASSES":case 35:r.platform=35;break;case"BLUE_VR":case 36:r.platform=36;break;case"AR_WRIST":case 37:r.platform=37;break}if(A.appVersion!=null){if(typeof A.appVersion!="object")throw TypeError(".proto.ClientPayload.UserAgent.appVersion: object expected");r.appVersion=d.proto.ClientPayload.UserAgent.AppVersion.fromObject(A.appVersion)}switch(A.mcc!=null&&(r.mcc=String(A.mcc)),A.mnc!=null&&(r.mnc=String(A.mnc)),A.osVersion!=null&&(r.osVersion=String(A.osVersion)),A.manufacturer!=null&&(r.manufacturer=String(A.manufacturer)),A.device!=null&&(r.device=String(A.device)),A.osBuildNumber!=null&&(r.osBuildNumber=String(A.osBuildNumber)),A.phoneId!=null&&(r.phoneId=String(A.phoneId)),A.releaseChannel){default:if(typeof A.releaseChannel=="number"){r.releaseChannel=A.releaseChannel;break}break;case"RELEASE":case 0:r.releaseChannel=0;break;case"BETA":case 1:r.releaseChannel=1;break;case"ALPHA":case 2:r.releaseChannel=2;break;case"DEBUG":case 3:r.releaseChannel=3;break}switch(A.localeLanguageIso6391!=null&&(r.localeLanguageIso6391=String(A.localeLanguageIso6391)),A.localeCountryIso31661Alpha2!=null&&(r.localeCountryIso31661Alpha2=String(A.localeCountryIso31661Alpha2)),A.deviceBoard!=null&&(r.deviceBoard=String(A.deviceBoard)),A.deviceExpId!=null&&(r.deviceExpId=String(A.deviceExpId)),A.deviceType){default:if(typeof A.deviceType=="number"){r.deviceType=A.deviceType;break}break;case"PHONE":case 0:r.deviceType=0;break;case"TABLET":case 1:r.deviceType=1;break;case"DESKTOP":case 2:r.deviceType=2;break;case"WEARABLE":case 3:r.deviceType=3;break;case"VR":case 4:r.deviceType=4;break}return A.deviceModelType!=null&&(r.deviceModelType=String(A.deviceModelType)),r},a.toObject=function(A,r){r||(r={});var s={};return A.platform!=null&&A.hasOwnProperty("platform")&&(s.platform=r.enums===String?d.proto.ClientPayload.UserAgent.Platform[A.platform]===void 0?A.platform:d.proto.ClientPayload.UserAgent.Platform[A.platform]:A.platform,r.oneofs&&(s._platform="platform")),A.appVersion!=null&&A.hasOwnProperty("appVersion")&&(s.appVersion=d.proto.ClientPayload.UserAgent.AppVersion.toObject(A.appVersion,r),r.oneofs&&(s._appVersion="appVersion")),A.mcc!=null&&A.hasOwnProperty("mcc")&&(s.mcc=A.mcc,r.oneofs&&(s._mcc="mcc")),A.mnc!=null&&A.hasOwnProperty("mnc")&&(s.mnc=A.mnc,r.oneofs&&(s._mnc="mnc")),A.osVersion!=null&&A.hasOwnProperty("osVersion")&&(s.osVersion=A.osVersion,r.oneofs&&(s._osVersion="osVersion")),A.manufacturer!=null&&A.hasOwnProperty("manufacturer")&&(s.manufacturer=A.manufacturer,r.oneofs&&(s._manufacturer="manufacturer")),A.device!=null&&A.hasOwnProperty("device")&&(s.device=A.device,r.oneofs&&(s._device="device")),A.osBuildNumber!=null&&A.hasOwnProperty("osBuildNumber")&&(s.osBuildNumber=A.osBuildNumber,r.oneofs&&(s._osBuildNumber="osBuildNumber")),A.phoneId!=null&&A.hasOwnProperty("phoneId")&&(s.phoneId=A.phoneId,r.oneofs&&(s._phoneId="phoneId")),A.releaseChannel!=null&&A.hasOwnProperty("releaseChannel")&&(s.releaseChannel=r.enums===String?d.proto.ClientPayload.UserAgent.ReleaseChannel[A.releaseChannel]===void 0?A.releaseChannel:d.proto.ClientPayload.UserAgent.ReleaseChannel[A.releaseChannel]:A.releaseChannel,r.oneofs&&(s._releaseChannel="releaseChannel")),A.localeLanguageIso6391!=null&&A.hasOwnProperty("localeLanguageIso6391")&&(s.localeLanguageIso6391=A.localeLanguageIso6391,r.oneofs&&(s._localeLanguageIso6391="localeLanguageIso6391")),A.localeCountryIso31661Alpha2!=null&&A.hasOwnProperty("localeCountryIso31661Alpha2")&&(s.localeCountryIso31661Alpha2=A.localeCountryIso31661Alpha2,r.oneofs&&(s._localeCountryIso31661Alpha2="localeCountryIso31661Alpha2")),A.deviceBoard!=null&&A.hasOwnProperty("deviceBoard")&&(s.deviceBoard=A.deviceBoard,r.oneofs&&(s._deviceBoard="deviceBoard")),A.deviceExpId!=null&&A.hasOwnProperty("deviceExpId")&&(s.deviceExpId=A.deviceExpId,r.oneofs&&(s._deviceExpId="deviceExpId")),A.deviceType!=null&&A.hasOwnProperty("deviceType")&&(s.deviceType=r.enums===String?d.proto.ClientPayload.UserAgent.DeviceType[A.deviceType]===void 0?A.deviceType:d.proto.ClientPayload.UserAgent.DeviceType[A.deviceType]:A.deviceType,r.oneofs&&(s._deviceType="deviceType")),A.deviceModelType!=null&&A.hasOwnProperty("deviceModelType")&&(s.deviceModelType=A.deviceModelType,r.oneofs&&(s._deviceModelType="deviceModelType")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.UserAgent"},a.AppVersion=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.primary=s.uint32();break}case 2:{p.secondary=s.uint32();break}case 3:{p.tertiary=s.uint32();break}case 4:{p.quaternary=s.uint32();break}case 5:{p.quinary=s.uint32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.ClientPayload.UserAgent.AppVersion)return s;var g=new d.proto.ClientPayload.UserAgent.AppVersion;return s.primary!=null&&(g.primary=s.primary>>>0),s.secondary!=null&&(g.secondary=s.secondary>>>0),s.tertiary!=null&&(g.tertiary=s.tertiary>>>0),s.quaternary!=null&&(g.quaternary=s.quaternary>>>0),s.quinary!=null&&(g.quinary=s.quinary>>>0),g},i.toObject=function(s,g){g||(g={});var c={};return s.primary!=null&&s.hasOwnProperty("primary")&&(c.primary=s.primary,g.oneofs&&(c._primary="primary")),s.secondary!=null&&s.hasOwnProperty("secondary")&&(c.secondary=s.secondary,g.oneofs&&(c._secondary="secondary")),s.tertiary!=null&&s.hasOwnProperty("tertiary")&&(c.tertiary=s.tertiary,g.oneofs&&(c._tertiary="tertiary")),s.quaternary!=null&&s.hasOwnProperty("quaternary")&&(c.quaternary=s.quaternary,g.oneofs&&(c._quaternary="quaternary")),s.quinary!=null&&s.hasOwnProperty("quinary")&&(c.quinary=s.quinary,g.oneofs&&(c._quinary="quinary")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ClientPayload.UserAgent.AppVersion"},i})(),a.DeviceType=(function(){let i={},A=Object.create(i);return A[i[0]="PHONE"]=0,A[i[1]="TABLET"]=1,A[i[2]="DESKTOP"]=2,A[i[3]="WEARABLE"]=3,A[i[4]="VR"]=4,A})(),a.Platform=(function(){let i={},A=Object.create(i);return A[i[0]="ANDROID"]=0,A[i[1]="IOS"]=1,A[i[2]="WINDOWS_PHONE"]=2,A[i[3]="BLACKBERRY"]=3,A[i[4]="BLACKBERRYX"]=4,A[i[5]="S40"]=5,A[i[6]="S60"]=6,A[i[7]="PYTHON_CLIENT"]=7,A[i[8]="TIZEN"]=8,A[i[9]="ENTERPRISE"]=9,A[i[10]="SMB_ANDROID"]=10,A[i[11]="KAIOS"]=11,A[i[12]="SMB_IOS"]=12,A[i[13]="WINDOWS"]=13,A[i[14]="WEB"]=14,A[i[15]="PORTAL"]=15,A[i[16]="GREEN_ANDROID"]=16,A[i[17]="GREEN_IPHONE"]=17,A[i[18]="BLUE_ANDROID"]=18,A[i[19]="BLUE_IPHONE"]=19,A[i[20]="FBLITE_ANDROID"]=20,A[i[21]="MLITE_ANDROID"]=21,A[i[22]="IGLITE_ANDROID"]=22,A[i[23]="PAGE"]=23,A[i[24]="MACOS"]=24,A[i[25]="OCULUS_MSG"]=25,A[i[26]="OCULUS_CALL"]=26,A[i[27]="MILAN"]=27,A[i[28]="CAPI"]=28,A[i[29]="WEAROS"]=29,A[i[30]="ARDEVICE"]=30,A[i[31]="VRDEVICE"]=31,A[i[32]="BLUE_WEB"]=32,A[i[33]="IPAD"]=33,A[i[34]="TEST"]=34,A[i[35]="SMART_GLASSES"]=35,A[i[36]="BLUE_VR"]=36,A[i[37]="AR_WRIST"]=37,A})(),a.ReleaseChannel=(function(){let i={},A=Object.create(i);return A[i[0]="RELEASE"]=0,A[i[1]="BETA"]=1,A[i[2]="ALPHA"]=2,A[i[3]="DEBUG"]=3,A})(),a})(),t.WebInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.refToken=A.string();break}case 2:{c.version=A.string();break}case 3:{c.webdPayload=d.proto.ClientPayload.WebInfo.WebdPayload.decode(A,A.uint32());break}case 4:{c.webSubPlatform=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ClientPayload.WebInfo)return A;var r=new d.proto.ClientPayload.WebInfo;if(A.refToken!=null&&(r.refToken=String(A.refToken)),A.version!=null&&(r.version=String(A.version)),A.webdPayload!=null){if(typeof A.webdPayload!="object")throw TypeError(".proto.ClientPayload.WebInfo.webdPayload: object expected");r.webdPayload=d.proto.ClientPayload.WebInfo.WebdPayload.fromObject(A.webdPayload)}switch(A.webSubPlatform){default:if(typeof A.webSubPlatform=="number"){r.webSubPlatform=A.webSubPlatform;break}break;case"WEB_BROWSER":case 0:r.webSubPlatform=0;break;case"APP_STORE":case 1:r.webSubPlatform=1;break;case"WIN_STORE":case 2:r.webSubPlatform=2;break;case"DARWIN":case 3:r.webSubPlatform=3;break;case"WIN32":case 4:r.webSubPlatform=4;break;case"WIN_HYBRID":case 5:r.webSubPlatform=5;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.refToken!=null&&A.hasOwnProperty("refToken")&&(s.refToken=A.refToken,r.oneofs&&(s._refToken="refToken")),A.version!=null&&A.hasOwnProperty("version")&&(s.version=A.version,r.oneofs&&(s._version="version")),A.webdPayload!=null&&A.hasOwnProperty("webdPayload")&&(s.webdPayload=d.proto.ClientPayload.WebInfo.WebdPayload.toObject(A.webdPayload,r),r.oneofs&&(s._webdPayload="webdPayload")),A.webSubPlatform!=null&&A.hasOwnProperty("webSubPlatform")&&(s.webSubPlatform=r.enums===String?d.proto.ClientPayload.WebInfo.WebSubPlatform[A.webSubPlatform]===void 0?A.webSubPlatform:d.proto.ClientPayload.WebInfo.WebSubPlatform[A.webSubPlatform]:A.webSubPlatform,r.oneofs&&(s._webSubPlatform="webSubPlatform")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ClientPayload.WebInfo"},a.WebSubPlatform=(function(){let i={},A=Object.create(i);return A[i[0]="WEB_BROWSER"]=0,A[i[1]="APP_STORE"]=1,A[i[2]="WIN_STORE"]=2,A[i[3]="DARWIN"]=3,A[i[4]="WIN32"]=4,A[i[5]="WIN_HYBRID"]=5,A})(),a.WebdPayload=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.usesParticipantInKey=s.bool();break}case 2:{p.supportsStarredMessages=s.bool();break}case 3:{p.supportsDocumentMessages=s.bool();break}case 4:{p.supportsUrlMessages=s.bool();break}case 5:{p.supportsMediaRetry=s.bool();break}case 6:{p.supportsE2EImage=s.bool();break}case 7:{p.supportsE2EVideo=s.bool();break}case 8:{p.supportsE2EAudio=s.bool();break}case 9:{p.supportsE2EDocument=s.bool();break}case 10:{p.documentTypes=s.string();break}case 11:{p.features=s.bytes();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.ClientPayload.WebInfo.WebdPayload)return s;var g=new d.proto.ClientPayload.WebInfo.WebdPayload;return s.usesParticipantInKey!=null&&(g.usesParticipantInKey=!!s.usesParticipantInKey),s.supportsStarredMessages!=null&&(g.supportsStarredMessages=!!s.supportsStarredMessages),s.supportsDocumentMessages!=null&&(g.supportsDocumentMessages=!!s.supportsDocumentMessages),s.supportsUrlMessages!=null&&(g.supportsUrlMessages=!!s.supportsUrlMessages),s.supportsMediaRetry!=null&&(g.supportsMediaRetry=!!s.supportsMediaRetry),s.supportsE2EImage!=null&&(g.supportsE2EImage=!!s.supportsE2EImage),s.supportsE2EVideo!=null&&(g.supportsE2EVideo=!!s.supportsE2EVideo),s.supportsE2EAudio!=null&&(g.supportsE2EAudio=!!s.supportsE2EAudio),s.supportsE2EDocument!=null&&(g.supportsE2EDocument=!!s.supportsE2EDocument),s.documentTypes!=null&&(g.documentTypes=String(s.documentTypes)),s.features!=null&&(typeof s.features=="string"?l.base64.decode(s.features,g.features=l.newBuffer(l.base64.length(s.features)),0):s.features.length>=0&&(g.features=s.features)),g},i.toObject=function(s,g){g||(g={});var c={};return s.usesParticipantInKey!=null&&s.hasOwnProperty("usesParticipantInKey")&&(c.usesParticipantInKey=s.usesParticipantInKey,g.oneofs&&(c._usesParticipantInKey="usesParticipantInKey")),s.supportsStarredMessages!=null&&s.hasOwnProperty("supportsStarredMessages")&&(c.supportsStarredMessages=s.supportsStarredMessages,g.oneofs&&(c._supportsStarredMessages="supportsStarredMessages")),s.supportsDocumentMessages!=null&&s.hasOwnProperty("supportsDocumentMessages")&&(c.supportsDocumentMessages=s.supportsDocumentMessages,g.oneofs&&(c._supportsDocumentMessages="supportsDocumentMessages")),s.supportsUrlMessages!=null&&s.hasOwnProperty("supportsUrlMessages")&&(c.supportsUrlMessages=s.supportsUrlMessages,g.oneofs&&(c._supportsUrlMessages="supportsUrlMessages")),s.supportsMediaRetry!=null&&s.hasOwnProperty("supportsMediaRetry")&&(c.supportsMediaRetry=s.supportsMediaRetry,g.oneofs&&(c._supportsMediaRetry="supportsMediaRetry")),s.supportsE2EImage!=null&&s.hasOwnProperty("supportsE2EImage")&&(c.supportsE2EImage=s.supportsE2EImage,g.oneofs&&(c._supportsE2EImage="supportsE2EImage")),s.supportsE2EVideo!=null&&s.hasOwnProperty("supportsE2EVideo")&&(c.supportsE2EVideo=s.supportsE2EVideo,g.oneofs&&(c._supportsE2EVideo="supportsE2EVideo")),s.supportsE2EAudio!=null&&s.hasOwnProperty("supportsE2EAudio")&&(c.supportsE2EAudio=s.supportsE2EAudio,g.oneofs&&(c._supportsE2EAudio="supportsE2EAudio")),s.supportsE2EDocument!=null&&s.hasOwnProperty("supportsE2EDocument")&&(c.supportsE2EDocument=s.supportsE2EDocument,g.oneofs&&(c._supportsE2EDocument="supportsE2EDocument")),s.documentTypes!=null&&s.hasOwnProperty("documentTypes")&&(c.documentTypes=s.documentTypes,g.oneofs&&(c._documentTypes="documentTypes")),s.features!=null&&s.hasOwnProperty("features")&&(c.features=g.bytes===String?l.base64.encode(s.features,0,s.features.length):g.bytes===Array?Array.prototype.slice.call(s.features):s.features,g.oneofs&&(c._features="features")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ClientPayload.WebInfo.WebdPayload"},i})(),a})(),t})(),n.CollectionName=(function(){let t={},o=Object.create(t);return o[t[0]="COLLECTION_NAME_UNKNOWN"]=0,o[t[1]="REGULAR"]=1,o[t[2]="REGULAR_LOW"]=2,o[t[3]="REGULAR_HIGH"]=3,o[t[4]="CRITICAL_BLOCK"]=4,o[t[5]="CRITICAL_UNBLOCK_LOW"]=5,o})(),n.CommentMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.commentParentKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.replyCount=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.CommentMetadata)return e;var i=new d.proto.CommentMetadata;if(e.commentParentKey!=null){if(typeof e.commentParentKey!="object")throw TypeError(".proto.CommentMetadata.commentParentKey: object expected");i.commentParentKey=d.proto.MessageKey.fromObject(e.commentParentKey)}return e.replyCount!=null&&(i.replyCount=e.replyCount>>>0),i},t.toObject=function(e,i){i||(i={});var A={};return e.commentParentKey!=null&&e.hasOwnProperty("commentParentKey")&&(A.commentParentKey=d.proto.MessageKey.toObject(e.commentParentKey,i),i.oneofs&&(A._commentParentKey="commentParentKey")),e.replyCount!=null&&e.hasOwnProperty("replyCount")&&(A.replyCount=e.replyCount,i.oneofs&&(A._replyCount="replyCount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CommentMetadata"},t})(),n.CompanionCommitment=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.hash=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.CompanionCommitment)return e;var i=new d.proto.CompanionCommitment;return e.hash!=null&&(typeof e.hash=="string"?l.base64.decode(e.hash,i.hash=l.newBuffer(l.base64.length(e.hash)),0):e.hash.length>=0&&(i.hash=e.hash)),i},t.toObject=function(e,i){i||(i={});var A={};return e.hash!=null&&e.hasOwnProperty("hash")&&(A.hash=i.bytes===String?l.base64.encode(e.hash,0,e.hash.length):i.bytes===Array?Array.prototype.slice.call(e.hash):e.hash,i.oneofs&&(A._hash="hash")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CompanionCommitment"},t})(),n.CompanionEphemeralIdentity=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.deviceType=e.int32();break}case 3:{s.ref=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.CompanionEphemeralIdentity)return e;var i=new d.proto.CompanionEphemeralIdentity;switch(e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,i.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(i.publicKey=e.publicKey)),e.deviceType){default:if(typeof e.deviceType=="number"){i.deviceType=e.deviceType;break}break;case"UNKNOWN":case 0:i.deviceType=0;break;case"CHROME":case 1:i.deviceType=1;break;case"FIREFOX":case 2:i.deviceType=2;break;case"IE":case 3:i.deviceType=3;break;case"OPERA":case 4:i.deviceType=4;break;case"SAFARI":case 5:i.deviceType=5;break;case"EDGE":case 6:i.deviceType=6;break;case"DESKTOP":case 7:i.deviceType=7;break;case"IPAD":case 8:i.deviceType=8;break;case"ANDROID_TABLET":case 9:i.deviceType=9;break;case"OHANA":case 10:i.deviceType=10;break;case"ALOHA":case 11:i.deviceType=11;break;case"CATALINA":case 12:i.deviceType=12;break;case"TCL_TV":case 13:i.deviceType=13;break;case"IOS_PHONE":case 14:i.deviceType=14;break;case"IOS_CATALYST":case 15:i.deviceType=15;break;case"ANDROID_PHONE":case 16:i.deviceType=16;break;case"ANDROID_AMBIGUOUS":case 17:i.deviceType=17;break;case"WEAR_OS":case 18:i.deviceType=18;break;case"AR_WRIST":case 19:i.deviceType=19;break;case"AR_DEVICE":case 20:i.deviceType=20;break;case"UWP":case 21:i.deviceType=21;break;case"VR":case 22:i.deviceType=22;break;case"CLOUD_API":case 23:i.deviceType=23;break;case"SMARTGLASSES":case 24:i.deviceType=24;break}return e.ref!=null&&(i.ref=String(e.ref)),i},t.toObject=function(e,i){i||(i={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=i.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):i.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,i.oneofs&&(A._publicKey="publicKey")),e.deviceType!=null&&e.hasOwnProperty("deviceType")&&(A.deviceType=i.enums===String?d.proto.DeviceProps.PlatformType[e.deviceType]===void 0?e.deviceType:d.proto.DeviceProps.PlatformType[e.deviceType]:e.deviceType,i.oneofs&&(A._deviceType="deviceType")),e.ref!=null&&e.hasOwnProperty("ref")&&(A.ref=e.ref,i.oneofs&&(A._ref="ref")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.CompanionEphemeralIdentity"},t})(),n.Config=(function(){function t(a){if(this.field={},a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.field===l.emptyObject&&(s.field={});var p=e.uint32()+e.pos;for(g=0,c=null;e.pos>>3){case 1:g=e.uint32();break;case 2:c=d.proto.Field.decode(e,e.uint32());break;default:e.skipType(B&7);break}}s.field[g]=c;break}case 2:{s.version=e.uint32();break}default:e.skipType(I&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Config)return e;var i=new d.proto.Config;if(e.field){if(typeof e.field!="object")throw TypeError(".proto.Config.field: object expected");i.field={};for(var A=Object.keys(e.field),r=0;r>>0),i},t.toObject=function(e,i){i||(i={});var A={};(i.objects||i.defaults)&&(A.field={});var r;if(e.field&&(r=Object.keys(e.field)).length){A.field={};for(var s=0;s>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.participant=e.string();break}case 3:{s.quotedMessage=d.proto.Message.decode(e,e.uint32());break}case 4:{s.remoteJid=e.string();break}case 15:{s.mentionedJid&&s.mentionedJid.length||(s.mentionedJid=[]),s.mentionedJid.push(e.string());break}case 18:{s.conversionSource=e.string();break}case 19:{s.conversionData=e.bytes();break}case 20:{s.conversionDelaySeconds=e.uint32();break}case 21:{s.forwardingScore=e.uint32();break}case 22:{s.isForwarded=e.bool();break}case 23:{s.quotedAd=d.proto.ContextInfo.AdReplyInfo.decode(e,e.uint32());break}case 24:{s.placeholderKey=d.proto.MessageKey.decode(e,e.uint32());break}case 25:{s.expiration=e.uint32();break}case 26:{s.ephemeralSettingTimestamp=e.int64();break}case 27:{s.ephemeralSharedSecret=e.bytes();break}case 28:{s.externalAdReply=d.proto.ContextInfo.ExternalAdReplyInfo.decode(e,e.uint32());break}case 29:{s.entryPointConversionSource=e.string();break}case 30:{s.entryPointConversionApp=e.string();break}case 31:{s.entryPointConversionDelaySeconds=e.uint32();break}case 32:{s.disappearingMode=d.proto.DisappearingMode.decode(e,e.uint32());break}case 33:{s.actionLink=d.proto.ActionLink.decode(e,e.uint32());break}case 34:{s.groupSubject=e.string();break}case 35:{s.parentGroupJid=e.string();break}case 37:{s.trustBannerType=e.string();break}case 38:{s.trustBannerAction=e.uint32();break}case 39:{s.isSampled=e.bool();break}case 40:{s.groupMentions&&s.groupMentions.length||(s.groupMentions=[]),s.groupMentions.push(d.proto.GroupMention.decode(e,e.uint32()));break}case 41:{s.utm=d.proto.ContextInfo.UTMInfo.decode(e,e.uint32());break}case 43:{s.forwardedNewsletterMessageInfo=d.proto.ContextInfo.ForwardedNewsletterMessageInfo.decode(e,e.uint32());break}case 44:{s.businessMessageForwardInfo=d.proto.ContextInfo.BusinessMessageForwardInfo.decode(e,e.uint32());break}case 45:{s.smbClientCampaignId=e.string();break}case 46:{s.smbServerCampaignId=e.string();break}case 47:{s.dataSharingContext=d.proto.ContextInfo.DataSharingContext.decode(e,e.uint32());break}case 48:{s.alwaysShowAdAttribution=e.bool();break}case 49:{s.featureEligibilities=d.proto.ContextInfo.FeatureEligibilities.decode(e,e.uint32());break}case 50:{s.entryPointConversionExternalSource=e.string();break}case 51:{s.entryPointConversionExternalMedium=e.string();break}case 54:{s.ctwaSignals=e.string();break}case 55:{s.ctwaPayload=e.bytes();break}case 56:{s.forwardedAiBotMessageInfo=d.proto.ForwardedAIBotMessageInfo.decode(e,e.uint32());break}case 57:{s.statusAttributionType=e.int32();break}case 58:{s.urlTrackingMap=d.proto.UrlTrackingMap.decode(e,e.uint32());break}case 59:{s.pairedMediaType=e.int32();break}case 60:{s.rankingVersion=e.uint32();break}case 62:{s.memberLabel=d.proto.MemberLabel.decode(e,e.uint32());break}case 63:{s.isQuestion=e.bool();break}case 64:{s.statusSourceType=e.int32();break}case 65:{s.statusAttributions&&s.statusAttributions.length||(s.statusAttributions=[]),s.statusAttributions.push(d.proto.StatusAttribution.decode(e,e.uint32()));break}case 66:{s.isGroupStatus=e.bool();break}case 67:{s.forwardOrigin=e.int32();break}case 68:{s.questionReplyQuotedMessage=d.proto.ContextInfo.QuestionReplyQuotedMessage.decode(e,e.uint32());break}case 69:{s.statusAudienceMetadata=d.proto.ContextInfo.StatusAudienceMetadata.decode(e,e.uint32());break}case 70:{s.nonJidMentions=e.uint32();break}case 71:{s.quotedType=e.int32();break}case 72:{s.botMessageSharingInfo=d.proto.BotMessageSharingInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ContextInfo)return e;var i=new d.proto.ContextInfo;if(e.stanzaId!=null&&(i.stanzaId=String(e.stanzaId)),e.participant!=null&&(i.participant=String(e.participant)),e.quotedMessage!=null){if(typeof e.quotedMessage!="object")throw TypeError(".proto.ContextInfo.quotedMessage: object expected");i.quotedMessage=d.proto.Message.fromObject(e.quotedMessage)}if(e.remoteJid!=null&&(i.remoteJid=String(e.remoteJid)),e.mentionedJid){if(!Array.isArray(e.mentionedJid))throw TypeError(".proto.ContextInfo.mentionedJid: array expected");i.mentionedJid=[];for(var A=0;A=0&&(i.conversionData=e.conversionData)),e.conversionDelaySeconds!=null&&(i.conversionDelaySeconds=e.conversionDelaySeconds>>>0),e.forwardingScore!=null&&(i.forwardingScore=e.forwardingScore>>>0),e.isForwarded!=null&&(i.isForwarded=!!e.isForwarded),e.quotedAd!=null){if(typeof e.quotedAd!="object")throw TypeError(".proto.ContextInfo.quotedAd: object expected");i.quotedAd=d.proto.ContextInfo.AdReplyInfo.fromObject(e.quotedAd)}if(e.placeholderKey!=null){if(typeof e.placeholderKey!="object")throw TypeError(".proto.ContextInfo.placeholderKey: object expected");i.placeholderKey=d.proto.MessageKey.fromObject(e.placeholderKey)}if(e.expiration!=null&&(i.expiration=e.expiration>>>0),e.ephemeralSettingTimestamp!=null&&(l.Long?(i.ephemeralSettingTimestamp=l.Long.fromValue(e.ephemeralSettingTimestamp)).unsigned=!1:typeof e.ephemeralSettingTimestamp=="string"?i.ephemeralSettingTimestamp=parseInt(e.ephemeralSettingTimestamp,10):typeof e.ephemeralSettingTimestamp=="number"?i.ephemeralSettingTimestamp=e.ephemeralSettingTimestamp:typeof e.ephemeralSettingTimestamp=="object"&&(i.ephemeralSettingTimestamp=new l.LongBits(e.ephemeralSettingTimestamp.low>>>0,e.ephemeralSettingTimestamp.high>>>0).toNumber())),e.ephemeralSharedSecret!=null&&(typeof e.ephemeralSharedSecret=="string"?l.base64.decode(e.ephemeralSharedSecret,i.ephemeralSharedSecret=l.newBuffer(l.base64.length(e.ephemeralSharedSecret)),0):e.ephemeralSharedSecret.length>=0&&(i.ephemeralSharedSecret=e.ephemeralSharedSecret)),e.externalAdReply!=null){if(typeof e.externalAdReply!="object")throw TypeError(".proto.ContextInfo.externalAdReply: object expected");i.externalAdReply=d.proto.ContextInfo.ExternalAdReplyInfo.fromObject(e.externalAdReply)}if(e.entryPointConversionSource!=null&&(i.entryPointConversionSource=String(e.entryPointConversionSource)),e.entryPointConversionApp!=null&&(i.entryPointConversionApp=String(e.entryPointConversionApp)),e.entryPointConversionDelaySeconds!=null&&(i.entryPointConversionDelaySeconds=e.entryPointConversionDelaySeconds>>>0),e.disappearingMode!=null){if(typeof e.disappearingMode!="object")throw TypeError(".proto.ContextInfo.disappearingMode: object expected");i.disappearingMode=d.proto.DisappearingMode.fromObject(e.disappearingMode)}if(e.actionLink!=null){if(typeof e.actionLink!="object")throw TypeError(".proto.ContextInfo.actionLink: object expected");i.actionLink=d.proto.ActionLink.fromObject(e.actionLink)}if(e.groupSubject!=null&&(i.groupSubject=String(e.groupSubject)),e.parentGroupJid!=null&&(i.parentGroupJid=String(e.parentGroupJid)),e.trustBannerType!=null&&(i.trustBannerType=String(e.trustBannerType)),e.trustBannerAction!=null&&(i.trustBannerAction=e.trustBannerAction>>>0),e.isSampled!=null&&(i.isSampled=!!e.isSampled),e.groupMentions){if(!Array.isArray(e.groupMentions))throw TypeError(".proto.ContextInfo.groupMentions: array expected");i.groupMentions=[];for(var A=0;A=0&&(i.ctwaPayload=e.ctwaPayload)),e.forwardedAiBotMessageInfo!=null){if(typeof e.forwardedAiBotMessageInfo!="object")throw TypeError(".proto.ContextInfo.forwardedAiBotMessageInfo: object expected");i.forwardedAiBotMessageInfo=d.proto.ForwardedAIBotMessageInfo.fromObject(e.forwardedAiBotMessageInfo)}switch(e.statusAttributionType){default:if(typeof e.statusAttributionType=="number"){i.statusAttributionType=e.statusAttributionType;break}break;case"NONE":case 0:i.statusAttributionType=0;break;case"RESHARED_FROM_MENTION":case 1:i.statusAttributionType=1;break;case"RESHARED_FROM_POST":case 2:i.statusAttributionType=2;break;case"RESHARED_FROM_POST_MANY_TIMES":case 3:i.statusAttributionType=3;break;case"FORWARDED_FROM_STATUS":case 4:i.statusAttributionType=4;break}if(e.urlTrackingMap!=null){if(typeof e.urlTrackingMap!="object")throw TypeError(".proto.ContextInfo.urlTrackingMap: object expected");i.urlTrackingMap=d.proto.UrlTrackingMap.fromObject(e.urlTrackingMap)}switch(e.pairedMediaType){default:if(typeof e.pairedMediaType=="number"){i.pairedMediaType=e.pairedMediaType;break}break;case"NOT_PAIRED_MEDIA":case 0:i.pairedMediaType=0;break;case"SD_VIDEO_PARENT":case 1:i.pairedMediaType=1;break;case"HD_VIDEO_CHILD":case 2:i.pairedMediaType=2;break;case"SD_IMAGE_PARENT":case 3:i.pairedMediaType=3;break;case"HD_IMAGE_CHILD":case 4:i.pairedMediaType=4;break;case"MOTION_PHOTO_PARENT":case 5:i.pairedMediaType=5;break;case"MOTION_PHOTO_CHILD":case 6:i.pairedMediaType=6;break;case"HEVC_VIDEO_PARENT":case 7:i.pairedMediaType=7;break;case"HEVC_VIDEO_CHILD":case 8:i.pairedMediaType=8;break}if(e.rankingVersion!=null&&(i.rankingVersion=e.rankingVersion>>>0),e.memberLabel!=null){if(typeof e.memberLabel!="object")throw TypeError(".proto.ContextInfo.memberLabel: object expected");i.memberLabel=d.proto.MemberLabel.fromObject(e.memberLabel)}switch(e.isQuestion!=null&&(i.isQuestion=!!e.isQuestion),e.statusSourceType){default:if(typeof e.statusSourceType=="number"){i.statusSourceType=e.statusSourceType;break}break;case"IMAGE":case 0:i.statusSourceType=0;break;case"VIDEO":case 1:i.statusSourceType=1;break;case"GIF":case 2:i.statusSourceType=2;break;case"AUDIO":case 3:i.statusSourceType=3;break;case"TEXT":case 4:i.statusSourceType=4;break;case"MUSIC_STANDALONE":case 5:i.statusSourceType=5;break}if(e.statusAttributions){if(!Array.isArray(e.statusAttributions))throw TypeError(".proto.ContextInfo.statusAttributions: array expected");i.statusAttributions=[];for(var A=0;A>>0),e.quotedType){default:if(typeof e.quotedType=="number"){i.quotedType=e.quotedType;break}break;case"EXPLICIT":case 0:i.quotedType=0;break;case"AUTO":case 1:i.quotedType=1;break}if(e.botMessageSharingInfo!=null){if(typeof e.botMessageSharingInfo!="object")throw TypeError(".proto.ContextInfo.botMessageSharingInfo: object expected");i.botMessageSharingInfo=d.proto.BotMessageSharingInfo.fromObject(e.botMessageSharingInfo)}return i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.mentionedJid=[],A.groupMentions=[],A.statusAttributions=[]),e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,i.oneofs&&(A._stanzaId="stanzaId")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,i.oneofs&&(A._participant="participant")),e.quotedMessage!=null&&e.hasOwnProperty("quotedMessage")&&(A.quotedMessage=d.proto.Message.toObject(e.quotedMessage,i),i.oneofs&&(A._quotedMessage="quotedMessage")),e.remoteJid!=null&&e.hasOwnProperty("remoteJid")&&(A.remoteJid=e.remoteJid,i.oneofs&&(A._remoteJid="remoteJid")),e.mentionedJid&&e.mentionedJid.length){A.mentionedJid=[];for(var r=0;r>>3){case 1:{c.advertiserName=A.string();break}case 2:{c.mediaType=A.int32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.caption=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.AdReplyInfo)return A;var r=new d.proto.ContextInfo.AdReplyInfo;switch(A.advertiserName!=null&&(r.advertiserName=String(A.advertiserName)),A.mediaType){default:if(typeof A.mediaType=="number"){r.mediaType=A.mediaType;break}break;case"NONE":case 0:r.mediaType=0;break;case"IMAGE":case 1:r.mediaType=1;break;case"VIDEO":case 2:r.mediaType=2;break}return A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),r},a.toObject=function(A,r){r||(r={});var s={};return A.advertiserName!=null&&A.hasOwnProperty("advertiserName")&&(s.advertiserName=A.advertiserName,r.oneofs&&(s._advertiserName="advertiserName")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=r.enums===String?d.proto.ContextInfo.AdReplyInfo.MediaType[A.mediaType]===void 0?A.mediaType:d.proto.ContextInfo.AdReplyInfo.MediaType[A.mediaType]:A.mediaType,r.oneofs&&(s._mediaType="mediaType")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.AdReplyInfo"},a.MediaType=(function(){let i={},A=Object.create(i);return A[i[0]="NONE"]=0,A[i[1]="IMAGE"]=1,A[i[2]="VIDEO"]=2,A})(),a})(),t.BusinessMessageForwardInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.businessOwnerJid=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.BusinessMessageForwardInfo)return A;var r=new d.proto.ContextInfo.BusinessMessageForwardInfo;return A.businessOwnerJid!=null&&(r.businessOwnerJid=String(A.businessOwnerJid)),r},a.toObject=function(A,r){r||(r={});var s={};return A.businessOwnerJid!=null&&A.hasOwnProperty("businessOwnerJid")&&(s.businessOwnerJid=A.businessOwnerJid,r.oneofs&&(s._businessOwnerJid="businessOwnerJid")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.BusinessMessageForwardInfo"},a})(),t.DataSharingContext=(function(){function a(i){if(this.parameters=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.showMmDisclosure=A.bool();break}case 2:{c.encryptedSignalTokenConsented=A.string();break}case 3:{c.parameters&&c.parameters.length||(c.parameters=[]),c.parameters.push(d.proto.ContextInfo.DataSharingContext.Parameters.decode(A,A.uint32()));break}case 4:{c.dataSharingFlags=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.DataSharingContext)return A;var r=new d.proto.ContextInfo.DataSharingContext;if(A.showMmDisclosure!=null&&(r.showMmDisclosure=!!A.showMmDisclosure),A.encryptedSignalTokenConsented!=null&&(r.encryptedSignalTokenConsented=String(A.encryptedSignalTokenConsented)),A.parameters){if(!Array.isArray(A.parameters))throw TypeError(".proto.ContextInfo.DataSharingContext.parameters: array expected");r.parameters=[];for(var s=0;s>>3){case 1:{p.key=s.string();break}case 2:{p.stringData=s.string();break}case 3:{p.intData=s.int64();break}case 4:{p.floatData=s.float();break}case 5:{p.contents=d.proto.ContextInfo.DataSharingContext.Parameters.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.ContextInfo.DataSharingContext.Parameters)return s;var g=new d.proto.ContextInfo.DataSharingContext.Parameters;if(s.key!=null&&(g.key=String(s.key)),s.stringData!=null&&(g.stringData=String(s.stringData)),s.intData!=null&&(l.Long?(g.intData=l.Long.fromValue(s.intData)).unsigned=!1:typeof s.intData=="string"?g.intData=parseInt(s.intData,10):typeof s.intData=="number"?g.intData=s.intData:typeof s.intData=="object"&&(g.intData=new l.LongBits(s.intData.low>>>0,s.intData.high>>>0).toNumber())),s.floatData!=null&&(g.floatData=Number(s.floatData)),s.contents!=null){if(typeof s.contents!="object")throw TypeError(".proto.ContextInfo.DataSharingContext.Parameters.contents: object expected");g.contents=d.proto.ContextInfo.DataSharingContext.Parameters.fromObject(s.contents)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.key!=null&&s.hasOwnProperty("key")&&(c.key=s.key,g.oneofs&&(c._key="key")),s.stringData!=null&&s.hasOwnProperty("stringData")&&(c.stringData=s.stringData,g.oneofs&&(c._stringData="stringData")),s.intData!=null&&s.hasOwnProperty("intData")&&(typeof s.intData=="number"?c.intData=g.longs===String?String(s.intData):s.intData:c.intData=g.longs===String?ge(s.intData):g.longs===Number?ce(s.intData):s.intData,g.oneofs&&(c._intData="intData")),s.floatData!=null&&s.hasOwnProperty("floatData")&&(c.floatData=g.json&&!isFinite(s.floatData)?String(s.floatData):s.floatData,g.oneofs&&(c._floatData="floatData")),s.contents!=null&&s.hasOwnProperty("contents")&&(c.contents=d.proto.ContextInfo.DataSharingContext.Parameters.toObject(s.contents,g),g.oneofs&&(c._contents="contents")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.ContextInfo.DataSharingContext.Parameters"},i})(),a})(),t.ExternalAdReplyInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.title=A.string();break}case 2:{c.body=A.string();break}case 3:{c.mediaType=A.int32();break}case 4:{c.thumbnailUrl=A.string();break}case 5:{c.mediaUrl=A.string();break}case 6:{c.thumbnail=A.bytes();break}case 7:{c.sourceType=A.string();break}case 8:{c.sourceId=A.string();break}case 9:{c.sourceUrl=A.string();break}case 10:{c.containsAutoReply=A.bool();break}case 11:{c.renderLargerThumbnail=A.bool();break}case 12:{c.showAdAttribution=A.bool();break}case 13:{c.ctwaClid=A.string();break}case 14:{c.ref=A.string();break}case 15:{c.clickToWhatsappCall=A.bool();break}case 16:{c.adContextPreviewDismissed=A.bool();break}case 17:{c.sourceApp=A.string();break}case 18:{c.automatedGreetingMessageShown=A.bool();break}case 19:{c.greetingMessageBody=A.string();break}case 20:{c.ctaPayload=A.string();break}case 21:{c.disableNudge=A.bool();break}case 22:{c.originalImageUrl=A.string();break}case 23:{c.automatedGreetingMessageCtaType=A.string();break}case 24:{c.wtwaAdFormat=A.bool();break}case 25:{c.adType=A.int32();break}case 26:{c.wtwaWebsiteUrl=A.string();break}case 27:{c.adPreviewUrl=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.ExternalAdReplyInfo)return A;var r=new d.proto.ContextInfo.ExternalAdReplyInfo;switch(A.title!=null&&(r.title=String(A.title)),A.body!=null&&(r.body=String(A.body)),A.mediaType){default:if(typeof A.mediaType=="number"){r.mediaType=A.mediaType;break}break;case"NONE":case 0:r.mediaType=0;break;case"IMAGE":case 1:r.mediaType=1;break;case"VIDEO":case 2:r.mediaType=2;break}switch(A.thumbnailUrl!=null&&(r.thumbnailUrl=String(A.thumbnailUrl)),A.mediaUrl!=null&&(r.mediaUrl=String(A.mediaUrl)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,r.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(r.thumbnail=A.thumbnail)),A.sourceType!=null&&(r.sourceType=String(A.sourceType)),A.sourceId!=null&&(r.sourceId=String(A.sourceId)),A.sourceUrl!=null&&(r.sourceUrl=String(A.sourceUrl)),A.containsAutoReply!=null&&(r.containsAutoReply=!!A.containsAutoReply),A.renderLargerThumbnail!=null&&(r.renderLargerThumbnail=!!A.renderLargerThumbnail),A.showAdAttribution!=null&&(r.showAdAttribution=!!A.showAdAttribution),A.ctwaClid!=null&&(r.ctwaClid=String(A.ctwaClid)),A.ref!=null&&(r.ref=String(A.ref)),A.clickToWhatsappCall!=null&&(r.clickToWhatsappCall=!!A.clickToWhatsappCall),A.adContextPreviewDismissed!=null&&(r.adContextPreviewDismissed=!!A.adContextPreviewDismissed),A.sourceApp!=null&&(r.sourceApp=String(A.sourceApp)),A.automatedGreetingMessageShown!=null&&(r.automatedGreetingMessageShown=!!A.automatedGreetingMessageShown),A.greetingMessageBody!=null&&(r.greetingMessageBody=String(A.greetingMessageBody)),A.ctaPayload!=null&&(r.ctaPayload=String(A.ctaPayload)),A.disableNudge!=null&&(r.disableNudge=!!A.disableNudge),A.originalImageUrl!=null&&(r.originalImageUrl=String(A.originalImageUrl)),A.automatedGreetingMessageCtaType!=null&&(r.automatedGreetingMessageCtaType=String(A.automatedGreetingMessageCtaType)),A.wtwaAdFormat!=null&&(r.wtwaAdFormat=!!A.wtwaAdFormat),A.adType){default:if(typeof A.adType=="number"){r.adType=A.adType;break}break;case"CTWA":case 0:r.adType=0;break;case"CAWC":case 1:r.adType=1;break}return A.wtwaWebsiteUrl!=null&&(r.wtwaWebsiteUrl=String(A.wtwaWebsiteUrl)),A.adPreviewUrl!=null&&(r.adPreviewUrl=String(A.adPreviewUrl)),r},a.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,r.oneofs&&(s._body="body")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=r.enums===String?d.proto.ContextInfo.ExternalAdReplyInfo.MediaType[A.mediaType]===void 0?A.mediaType:d.proto.ContextInfo.ExternalAdReplyInfo.MediaType[A.mediaType]:A.mediaType,r.oneofs&&(s._mediaType="mediaType")),A.thumbnailUrl!=null&&A.hasOwnProperty("thumbnailUrl")&&(s.thumbnailUrl=A.thumbnailUrl,r.oneofs&&(s._thumbnailUrl="thumbnailUrl")),A.mediaUrl!=null&&A.hasOwnProperty("mediaUrl")&&(s.mediaUrl=A.mediaUrl,r.oneofs&&(s._mediaUrl="mediaUrl")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=r.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,r.oneofs&&(s._thumbnail="thumbnail")),A.sourceType!=null&&A.hasOwnProperty("sourceType")&&(s.sourceType=A.sourceType,r.oneofs&&(s._sourceType="sourceType")),A.sourceId!=null&&A.hasOwnProperty("sourceId")&&(s.sourceId=A.sourceId,r.oneofs&&(s._sourceId="sourceId")),A.sourceUrl!=null&&A.hasOwnProperty("sourceUrl")&&(s.sourceUrl=A.sourceUrl,r.oneofs&&(s._sourceUrl="sourceUrl")),A.containsAutoReply!=null&&A.hasOwnProperty("containsAutoReply")&&(s.containsAutoReply=A.containsAutoReply,r.oneofs&&(s._containsAutoReply="containsAutoReply")),A.renderLargerThumbnail!=null&&A.hasOwnProperty("renderLargerThumbnail")&&(s.renderLargerThumbnail=A.renderLargerThumbnail,r.oneofs&&(s._renderLargerThumbnail="renderLargerThumbnail")),A.showAdAttribution!=null&&A.hasOwnProperty("showAdAttribution")&&(s.showAdAttribution=A.showAdAttribution,r.oneofs&&(s._showAdAttribution="showAdAttribution")),A.ctwaClid!=null&&A.hasOwnProperty("ctwaClid")&&(s.ctwaClid=A.ctwaClid,r.oneofs&&(s._ctwaClid="ctwaClid")),A.ref!=null&&A.hasOwnProperty("ref")&&(s.ref=A.ref,r.oneofs&&(s._ref="ref")),A.clickToWhatsappCall!=null&&A.hasOwnProperty("clickToWhatsappCall")&&(s.clickToWhatsappCall=A.clickToWhatsappCall,r.oneofs&&(s._clickToWhatsappCall="clickToWhatsappCall")),A.adContextPreviewDismissed!=null&&A.hasOwnProperty("adContextPreviewDismissed")&&(s.adContextPreviewDismissed=A.adContextPreviewDismissed,r.oneofs&&(s._adContextPreviewDismissed="adContextPreviewDismissed")),A.sourceApp!=null&&A.hasOwnProperty("sourceApp")&&(s.sourceApp=A.sourceApp,r.oneofs&&(s._sourceApp="sourceApp")),A.automatedGreetingMessageShown!=null&&A.hasOwnProperty("automatedGreetingMessageShown")&&(s.automatedGreetingMessageShown=A.automatedGreetingMessageShown,r.oneofs&&(s._automatedGreetingMessageShown="automatedGreetingMessageShown")),A.greetingMessageBody!=null&&A.hasOwnProperty("greetingMessageBody")&&(s.greetingMessageBody=A.greetingMessageBody,r.oneofs&&(s._greetingMessageBody="greetingMessageBody")),A.ctaPayload!=null&&A.hasOwnProperty("ctaPayload")&&(s.ctaPayload=A.ctaPayload,r.oneofs&&(s._ctaPayload="ctaPayload")),A.disableNudge!=null&&A.hasOwnProperty("disableNudge")&&(s.disableNudge=A.disableNudge,r.oneofs&&(s._disableNudge="disableNudge")),A.originalImageUrl!=null&&A.hasOwnProperty("originalImageUrl")&&(s.originalImageUrl=A.originalImageUrl,r.oneofs&&(s._originalImageUrl="originalImageUrl")),A.automatedGreetingMessageCtaType!=null&&A.hasOwnProperty("automatedGreetingMessageCtaType")&&(s.automatedGreetingMessageCtaType=A.automatedGreetingMessageCtaType,r.oneofs&&(s._automatedGreetingMessageCtaType="automatedGreetingMessageCtaType")),A.wtwaAdFormat!=null&&A.hasOwnProperty("wtwaAdFormat")&&(s.wtwaAdFormat=A.wtwaAdFormat,r.oneofs&&(s._wtwaAdFormat="wtwaAdFormat")),A.adType!=null&&A.hasOwnProperty("adType")&&(s.adType=r.enums===String?d.proto.ContextInfo.ExternalAdReplyInfo.AdType[A.adType]===void 0?A.adType:d.proto.ContextInfo.ExternalAdReplyInfo.AdType[A.adType]:A.adType,r.oneofs&&(s._adType="adType")),A.wtwaWebsiteUrl!=null&&A.hasOwnProperty("wtwaWebsiteUrl")&&(s.wtwaWebsiteUrl=A.wtwaWebsiteUrl,r.oneofs&&(s._wtwaWebsiteUrl="wtwaWebsiteUrl")),A.adPreviewUrl!=null&&A.hasOwnProperty("adPreviewUrl")&&(s.adPreviewUrl=A.adPreviewUrl,r.oneofs&&(s._adPreviewUrl="adPreviewUrl")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.ExternalAdReplyInfo"},a.AdType=(function(){let i={},A=Object.create(i);return A[i[0]="CTWA"]=0,A[i[1]="CAWC"]=1,A})(),a.MediaType=(function(){let i={},A=Object.create(i);return A[i[0]="NONE"]=0,A[i[1]="IMAGE"]=1,A[i[2]="VIDEO"]=2,A})(),a})(),t.FeatureEligibilities=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.cannotBeReactedTo=A.bool();break}case 2:{c.cannotBeRanked=A.bool();break}case 3:{c.canRequestFeedback=A.bool();break}case 4:{c.canBeReshared=A.bool();break}case 5:{c.canReceiveMultiReact=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.FeatureEligibilities)return A;var r=new d.proto.ContextInfo.FeatureEligibilities;return A.cannotBeReactedTo!=null&&(r.cannotBeReactedTo=!!A.cannotBeReactedTo),A.cannotBeRanked!=null&&(r.cannotBeRanked=!!A.cannotBeRanked),A.canRequestFeedback!=null&&(r.canRequestFeedback=!!A.canRequestFeedback),A.canBeReshared!=null&&(r.canBeReshared=!!A.canBeReshared),A.canReceiveMultiReact!=null&&(r.canReceiveMultiReact=!!A.canReceiveMultiReact),r},a.toObject=function(A,r){r||(r={});var s={};return A.cannotBeReactedTo!=null&&A.hasOwnProperty("cannotBeReactedTo")&&(s.cannotBeReactedTo=A.cannotBeReactedTo,r.oneofs&&(s._cannotBeReactedTo="cannotBeReactedTo")),A.cannotBeRanked!=null&&A.hasOwnProperty("cannotBeRanked")&&(s.cannotBeRanked=A.cannotBeRanked,r.oneofs&&(s._cannotBeRanked="cannotBeRanked")),A.canRequestFeedback!=null&&A.hasOwnProperty("canRequestFeedback")&&(s.canRequestFeedback=A.canRequestFeedback,r.oneofs&&(s._canRequestFeedback="canRequestFeedback")),A.canBeReshared!=null&&A.hasOwnProperty("canBeReshared")&&(s.canBeReshared=A.canBeReshared,r.oneofs&&(s._canBeReshared="canBeReshared")),A.canReceiveMultiReact!=null&&A.hasOwnProperty("canReceiveMultiReact")&&(s.canReceiveMultiReact=A.canReceiveMultiReact,r.oneofs&&(s._canReceiveMultiReact="canReceiveMultiReact")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.FeatureEligibilities"},a})(),t.ForwardOrigin=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="CHAT"]=1,e[a[2]="STATUS"]=2,e[a[3]="CHANNELS"]=3,e[a[4]="META_AI"]=4,e[a[5]="UGC"]=5,e})(),t.ForwardedNewsletterMessageInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.serverMessageId=A.int32();break}case 3:{c.newsletterName=A.string();break}case 4:{c.contentType=A.int32();break}case 5:{c.accessibilityText=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.ForwardedNewsletterMessageInfo)return A;var r=new d.proto.ContextInfo.ForwardedNewsletterMessageInfo;switch(A.newsletterJid!=null&&(r.newsletterJid=String(A.newsletterJid)),A.serverMessageId!=null&&(r.serverMessageId=A.serverMessageId|0),A.newsletterName!=null&&(r.newsletterName=String(A.newsletterName)),A.contentType){default:if(typeof A.contentType=="number"){r.contentType=A.contentType;break}break;case"UPDATE":case 1:r.contentType=1;break;case"UPDATE_CARD":case 2:r.contentType=2;break;case"LINK_CARD":case 3:r.contentType=3;break}return A.accessibilityText!=null&&(r.accessibilityText=String(A.accessibilityText)),r},a.toObject=function(A,r){r||(r={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,r.oneofs&&(s._newsletterJid="newsletterJid")),A.serverMessageId!=null&&A.hasOwnProperty("serverMessageId")&&(s.serverMessageId=A.serverMessageId,r.oneofs&&(s._serverMessageId="serverMessageId")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,r.oneofs&&(s._newsletterName="newsletterName")),A.contentType!=null&&A.hasOwnProperty("contentType")&&(s.contentType=r.enums===String?d.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[A.contentType]===void 0?A.contentType:d.proto.ContextInfo.ForwardedNewsletterMessageInfo.ContentType[A.contentType]:A.contentType,r.oneofs&&(s._contentType="contentType")),A.accessibilityText!=null&&A.hasOwnProperty("accessibilityText")&&(s.accessibilityText=A.accessibilityText,r.oneofs&&(s._accessibilityText="accessibilityText")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.ForwardedNewsletterMessageInfo"},a.ContentType=(function(){let i={},A=Object.create(i);return A[i[1]="UPDATE"]=1,A[i[2]="UPDATE_CARD"]=2,A[i[3]="LINK_CARD"]=3,A})(),a})(),t.PairedMediaType=(function(){let a={},e=Object.create(a);return e[a[0]="NOT_PAIRED_MEDIA"]=0,e[a[1]="SD_VIDEO_PARENT"]=1,e[a[2]="HD_VIDEO_CHILD"]=2,e[a[3]="SD_IMAGE_PARENT"]=3,e[a[4]="HD_IMAGE_CHILD"]=4,e[a[5]="MOTION_PHOTO_PARENT"]=5,e[a[6]="MOTION_PHOTO_CHILD"]=6,e[a[7]="HEVC_VIDEO_PARENT"]=7,e[a[8]="HEVC_VIDEO_CHILD"]=8,e})(),t.QuestionReplyQuotedMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.serverQuestionId=A.int32();break}case 2:{c.quotedQuestion=d.proto.Message.decode(A,A.uint32());break}case 3:{c.quotedResponse=d.proto.Message.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.QuestionReplyQuotedMessage)return A;var r=new d.proto.ContextInfo.QuestionReplyQuotedMessage;if(A.serverQuestionId!=null&&(r.serverQuestionId=A.serverQuestionId|0),A.quotedQuestion!=null){if(typeof A.quotedQuestion!="object")throw TypeError(".proto.ContextInfo.QuestionReplyQuotedMessage.quotedQuestion: object expected");r.quotedQuestion=d.proto.Message.fromObject(A.quotedQuestion)}if(A.quotedResponse!=null){if(typeof A.quotedResponse!="object")throw TypeError(".proto.ContextInfo.QuestionReplyQuotedMessage.quotedResponse: object expected");r.quotedResponse=d.proto.Message.fromObject(A.quotedResponse)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.serverQuestionId!=null&&A.hasOwnProperty("serverQuestionId")&&(s.serverQuestionId=A.serverQuestionId,r.oneofs&&(s._serverQuestionId="serverQuestionId")),A.quotedQuestion!=null&&A.hasOwnProperty("quotedQuestion")&&(s.quotedQuestion=d.proto.Message.toObject(A.quotedQuestion,r),r.oneofs&&(s._quotedQuestion="quotedQuestion")),A.quotedResponse!=null&&A.hasOwnProperty("quotedResponse")&&(s.quotedResponse=d.proto.Message.toObject(A.quotedResponse,r),r.oneofs&&(s._quotedResponse="quotedResponse")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.QuestionReplyQuotedMessage"},a})(),t.QuotedType=(function(){let a={},e=Object.create(a);return e[a[0]="EXPLICIT"]=0,e[a[1]="AUTO"]=1,e})(),t.StatusAttributionType=(function(){let a={},e=Object.create(a);return e[a[0]="NONE"]=0,e[a[1]="RESHARED_FROM_MENTION"]=1,e[a[2]="RESHARED_FROM_POST"]=2,e[a[3]="RESHARED_FROM_POST_MANY_TIMES"]=3,e[a[4]="FORWARDED_FROM_STATUS"]=4,e})(),t.StatusAudienceMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.audienceType=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.StatusAudienceMetadata)return A;var r=new d.proto.ContextInfo.StatusAudienceMetadata;switch(A.audienceType){default:if(typeof A.audienceType=="number"){r.audienceType=A.audienceType;break}break;case"UNKNOWN":case 0:r.audienceType=0;break;case"CLOSE_FRIENDS":case 1:r.audienceType=1;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.audienceType!=null&&A.hasOwnProperty("audienceType")&&(s.audienceType=r.enums===String?d.proto.ContextInfo.StatusAudienceMetadata.AudienceType[A.audienceType]===void 0?A.audienceType:d.proto.ContextInfo.StatusAudienceMetadata.AudienceType[A.audienceType]:A.audienceType,r.oneofs&&(s._audienceType="audienceType")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.StatusAudienceMetadata"},a.AudienceType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="CLOSE_FRIENDS"]=1,A})(),a})(),t.StatusSourceType=(function(){let a={},e=Object.create(a);return e[a[0]="IMAGE"]=0,e[a[1]="VIDEO"]=1,e[a[2]="GIF"]=2,e[a[3]="AUDIO"]=3,e[a[4]="TEXT"]=4,e[a[5]="MUSIC_STANDALONE"]=5,e})(),t.UTMInfo=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.utmSource=A.string();break}case 2:{c.utmCampaign=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.ContextInfo.UTMInfo)return A;var r=new d.proto.ContextInfo.UTMInfo;return A.utmSource!=null&&(r.utmSource=String(A.utmSource)),A.utmCampaign!=null&&(r.utmCampaign=String(A.utmCampaign)),r},a.toObject=function(A,r){r||(r={});var s={};return A.utmSource!=null&&A.hasOwnProperty("utmSource")&&(s.utmSource=A.utmSource,r.oneofs&&(s._utmSource="utmSource")),A.utmCampaign!=null&&A.hasOwnProperty("utmCampaign")&&(s.utmCampaign=A.utmCampaign,r.oneofs&&(s._utmCampaign="utmCampaign")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.ContextInfo.UTMInfo"},a})(),t})(),n.Conversation=(function(){function t(a){if(this.messages=[],this.participant=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.string();break}case 2:{s.messages&&s.messages.length||(s.messages=[]),s.messages.push(d.proto.HistorySyncMsg.decode(e,e.uint32()));break}case 3:{s.newJid=e.string();break}case 4:{s.oldJid=e.string();break}case 5:{s.lastMsgTimestamp=e.uint64();break}case 6:{s.unreadCount=e.uint32();break}case 7:{s.readOnly=e.bool();break}case 8:{s.endOfHistoryTransfer=e.bool();break}case 9:{s.ephemeralExpiration=e.uint32();break}case 10:{s.ephemeralSettingTimestamp=e.int64();break}case 11:{s.endOfHistoryTransferType=e.int32();break}case 12:{s.conversationTimestamp=e.uint64();break}case 13:{s.name=e.string();break}case 14:{s.pHash=e.string();break}case 15:{s.notSpam=e.bool();break}case 16:{s.archived=e.bool();break}case 17:{s.disappearingMode=d.proto.DisappearingMode.decode(e,e.uint32());break}case 18:{s.unreadMentionCount=e.uint32();break}case 19:{s.markedAsUnread=e.bool();break}case 20:{s.participant&&s.participant.length||(s.participant=[]),s.participant.push(d.proto.GroupParticipant.decode(e,e.uint32()));break}case 21:{s.tcToken=e.bytes();break}case 22:{s.tcTokenTimestamp=e.uint64();break}case 23:{s.contactPrimaryIdentityKey=e.bytes();break}case 24:{s.pinned=e.uint32();break}case 25:{s.muteEndTime=e.uint64();break}case 26:{s.wallpaper=d.proto.WallpaperSettings.decode(e,e.uint32());break}case 27:{s.mediaVisibility=e.int32();break}case 28:{s.tcTokenSenderTimestamp=e.uint64();break}case 29:{s.suspended=e.bool();break}case 30:{s.terminated=e.bool();break}case 31:{s.createdAt=e.uint64();break}case 32:{s.createdBy=e.string();break}case 33:{s.description=e.string();break}case 34:{s.support=e.bool();break}case 35:{s.isParentGroup=e.bool();break}case 37:{s.parentGroupId=e.string();break}case 36:{s.isDefaultSubgroup=e.bool();break}case 38:{s.displayName=e.string();break}case 39:{s.pnJid=e.string();break}case 40:{s.shareOwnPn=e.bool();break}case 41:{s.pnhDuplicateLidThread=e.bool();break}case 42:{s.lidJid=e.string();break}case 43:{s.username=e.string();break}case 44:{s.lidOriginType=e.string();break}case 45:{s.commentsCount=e.uint32();break}case 46:{s.locked=e.bool();break}case 47:{s.systemMessageToInsert=e.int32();break}case 48:{s.capiCreatedGroup=e.bool();break}case 49:{s.accountLid=e.string();break}case 50:{s.limitSharing=e.bool();break}case 51:{s.limitSharingSettingTimestamp=e.int64();break}case 52:{s.limitSharingTrigger=e.int32();break}case 53:{s.limitSharingInitiatedByMe=e.bool();break}case 54:{s.maibaAiThreadEnabled=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Conversation)return e;var i=new d.proto.Conversation;if(e.id!=null&&(i.id=String(e.id)),e.messages){if(!Array.isArray(e.messages))throw TypeError(".proto.Conversation.messages: array expected");i.messages=[];for(var A=0;A>>0,e.lastMsgTimestamp.high>>>0).toNumber(!0))),e.unreadCount!=null&&(i.unreadCount=e.unreadCount>>>0),e.readOnly!=null&&(i.readOnly=!!e.readOnly),e.endOfHistoryTransfer!=null&&(i.endOfHistoryTransfer=!!e.endOfHistoryTransfer),e.ephemeralExpiration!=null&&(i.ephemeralExpiration=e.ephemeralExpiration>>>0),e.ephemeralSettingTimestamp!=null&&(l.Long?(i.ephemeralSettingTimestamp=l.Long.fromValue(e.ephemeralSettingTimestamp)).unsigned=!1:typeof e.ephemeralSettingTimestamp=="string"?i.ephemeralSettingTimestamp=parseInt(e.ephemeralSettingTimestamp,10):typeof e.ephemeralSettingTimestamp=="number"?i.ephemeralSettingTimestamp=e.ephemeralSettingTimestamp:typeof e.ephemeralSettingTimestamp=="object"&&(i.ephemeralSettingTimestamp=new l.LongBits(e.ephemeralSettingTimestamp.low>>>0,e.ephemeralSettingTimestamp.high>>>0).toNumber())),e.endOfHistoryTransferType){default:if(typeof e.endOfHistoryTransferType=="number"){i.endOfHistoryTransferType=e.endOfHistoryTransferType;break}break;case"COMPLETE_BUT_MORE_MESSAGES_REMAIN_ON_PRIMARY":case 0:i.endOfHistoryTransferType=0;break;case"COMPLETE_AND_NO_MORE_MESSAGE_REMAIN_ON_PRIMARY":case 1:i.endOfHistoryTransferType=1;break;case"COMPLETE_ON_DEMAND_SYNC_BUT_MORE_MSG_REMAIN_ON_PRIMARY":case 2:i.endOfHistoryTransferType=2;break}if(e.conversationTimestamp!=null&&(l.Long?(i.conversationTimestamp=l.Long.fromValue(e.conversationTimestamp)).unsigned=!0:typeof e.conversationTimestamp=="string"?i.conversationTimestamp=parseInt(e.conversationTimestamp,10):typeof e.conversationTimestamp=="number"?i.conversationTimestamp=e.conversationTimestamp:typeof e.conversationTimestamp=="object"&&(i.conversationTimestamp=new l.LongBits(e.conversationTimestamp.low>>>0,e.conversationTimestamp.high>>>0).toNumber(!0))),e.name!=null&&(i.name=String(e.name)),e.pHash!=null&&(i.pHash=String(e.pHash)),e.notSpam!=null&&(i.notSpam=!!e.notSpam),e.archived!=null&&(i.archived=!!e.archived),e.disappearingMode!=null){if(typeof e.disappearingMode!="object")throw TypeError(".proto.Conversation.disappearingMode: object expected");i.disappearingMode=d.proto.DisappearingMode.fromObject(e.disappearingMode)}if(e.unreadMentionCount!=null&&(i.unreadMentionCount=e.unreadMentionCount>>>0),e.markedAsUnread!=null&&(i.markedAsUnread=!!e.markedAsUnread),e.participant){if(!Array.isArray(e.participant))throw TypeError(".proto.Conversation.participant: array expected");i.participant=[];for(var A=0;A=0&&(i.tcToken=e.tcToken)),e.tcTokenTimestamp!=null&&(l.Long?(i.tcTokenTimestamp=l.Long.fromValue(e.tcTokenTimestamp)).unsigned=!0:typeof e.tcTokenTimestamp=="string"?i.tcTokenTimestamp=parseInt(e.tcTokenTimestamp,10):typeof e.tcTokenTimestamp=="number"?i.tcTokenTimestamp=e.tcTokenTimestamp:typeof e.tcTokenTimestamp=="object"&&(i.tcTokenTimestamp=new l.LongBits(e.tcTokenTimestamp.low>>>0,e.tcTokenTimestamp.high>>>0).toNumber(!0))),e.contactPrimaryIdentityKey!=null&&(typeof e.contactPrimaryIdentityKey=="string"?l.base64.decode(e.contactPrimaryIdentityKey,i.contactPrimaryIdentityKey=l.newBuffer(l.base64.length(e.contactPrimaryIdentityKey)),0):e.contactPrimaryIdentityKey.length>=0&&(i.contactPrimaryIdentityKey=e.contactPrimaryIdentityKey)),e.pinned!=null&&(i.pinned=e.pinned>>>0),e.muteEndTime!=null&&(l.Long?(i.muteEndTime=l.Long.fromValue(e.muteEndTime)).unsigned=!0:typeof e.muteEndTime=="string"?i.muteEndTime=parseInt(e.muteEndTime,10):typeof e.muteEndTime=="number"?i.muteEndTime=e.muteEndTime:typeof e.muteEndTime=="object"&&(i.muteEndTime=new l.LongBits(e.muteEndTime.low>>>0,e.muteEndTime.high>>>0).toNumber(!0))),e.wallpaper!=null){if(typeof e.wallpaper!="object")throw TypeError(".proto.Conversation.wallpaper: object expected");i.wallpaper=d.proto.WallpaperSettings.fromObject(e.wallpaper)}switch(e.mediaVisibility){default:if(typeof e.mediaVisibility=="number"){i.mediaVisibility=e.mediaVisibility;break}break;case"DEFAULT":case 0:i.mediaVisibility=0;break;case"OFF":case 1:i.mediaVisibility=1;break;case"ON":case 2:i.mediaVisibility=2;break}switch(e.tcTokenSenderTimestamp!=null&&(l.Long?(i.tcTokenSenderTimestamp=l.Long.fromValue(e.tcTokenSenderTimestamp)).unsigned=!0:typeof e.tcTokenSenderTimestamp=="string"?i.tcTokenSenderTimestamp=parseInt(e.tcTokenSenderTimestamp,10):typeof e.tcTokenSenderTimestamp=="number"?i.tcTokenSenderTimestamp=e.tcTokenSenderTimestamp:typeof e.tcTokenSenderTimestamp=="object"&&(i.tcTokenSenderTimestamp=new l.LongBits(e.tcTokenSenderTimestamp.low>>>0,e.tcTokenSenderTimestamp.high>>>0).toNumber(!0))),e.suspended!=null&&(i.suspended=!!e.suspended),e.terminated!=null&&(i.terminated=!!e.terminated),e.createdAt!=null&&(l.Long?(i.createdAt=l.Long.fromValue(e.createdAt)).unsigned=!0:typeof e.createdAt=="string"?i.createdAt=parseInt(e.createdAt,10):typeof e.createdAt=="number"?i.createdAt=e.createdAt:typeof e.createdAt=="object"&&(i.createdAt=new l.LongBits(e.createdAt.low>>>0,e.createdAt.high>>>0).toNumber(!0))),e.createdBy!=null&&(i.createdBy=String(e.createdBy)),e.description!=null&&(i.description=String(e.description)),e.support!=null&&(i.support=!!e.support),e.isParentGroup!=null&&(i.isParentGroup=!!e.isParentGroup),e.parentGroupId!=null&&(i.parentGroupId=String(e.parentGroupId)),e.isDefaultSubgroup!=null&&(i.isDefaultSubgroup=!!e.isDefaultSubgroup),e.displayName!=null&&(i.displayName=String(e.displayName)),e.pnJid!=null&&(i.pnJid=String(e.pnJid)),e.shareOwnPn!=null&&(i.shareOwnPn=!!e.shareOwnPn),e.pnhDuplicateLidThread!=null&&(i.pnhDuplicateLidThread=!!e.pnhDuplicateLidThread),e.lidJid!=null&&(i.lidJid=String(e.lidJid)),e.username!=null&&(i.username=String(e.username)),e.lidOriginType!=null&&(i.lidOriginType=String(e.lidOriginType)),e.commentsCount!=null&&(i.commentsCount=e.commentsCount>>>0),e.locked!=null&&(i.locked=!!e.locked),e.systemMessageToInsert){default:if(typeof e.systemMessageToInsert=="number"){i.systemMessageToInsert=e.systemMessageToInsert;break}break;case"E2EE_MSG":case 1:i.systemMessageToInsert=1;break;case"NE2EE_SELF":case 2:i.systemMessageToInsert=2;break;case"NE2EE_OTHER":case 3:i.systemMessageToInsert=3;break}switch(e.capiCreatedGroup!=null&&(i.capiCreatedGroup=!!e.capiCreatedGroup),e.accountLid!=null&&(i.accountLid=String(e.accountLid)),e.limitSharing!=null&&(i.limitSharing=!!e.limitSharing),e.limitSharingSettingTimestamp!=null&&(l.Long?(i.limitSharingSettingTimestamp=l.Long.fromValue(e.limitSharingSettingTimestamp)).unsigned=!1:typeof e.limitSharingSettingTimestamp=="string"?i.limitSharingSettingTimestamp=parseInt(e.limitSharingSettingTimestamp,10):typeof e.limitSharingSettingTimestamp=="number"?i.limitSharingSettingTimestamp=e.limitSharingSettingTimestamp:typeof e.limitSharingSettingTimestamp=="object"&&(i.limitSharingSettingTimestamp=new l.LongBits(e.limitSharingSettingTimestamp.low>>>0,e.limitSharingSettingTimestamp.high>>>0).toNumber())),e.limitSharingTrigger){default:if(typeof e.limitSharingTrigger=="number"){i.limitSharingTrigger=e.limitSharingTrigger;break}break;case"UNKNOWN":case 0:i.limitSharingTrigger=0;break;case"CHAT_SETTING":case 1:i.limitSharingTrigger=1;break;case"BIZ_SUPPORTS_FB_HOSTING":case 2:i.limitSharingTrigger=2;break;case"UNKNOWN_GROUP":case 3:i.limitSharingTrigger=3;break}return e.limitSharingInitiatedByMe!=null&&(i.limitSharingInitiatedByMe=!!e.limitSharingInitiatedByMe),e.maibaAiThreadEnabled!=null&&(i.maibaAiThreadEnabled=!!e.maibaAiThreadEnabled),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.messages=[],A.participant=[]),i.defaults&&(A.id=""),e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id),e.messages&&e.messages.length){A.messages=[];for(var r=0;r>>3){case 1:{s.chatLockSupportLevel=e.int32();break}case 2:{s.lidMigration=d.proto.DeviceCapabilities.LIDMigration.decode(e,e.uint32());break}case 3:{s.businessBroadcast=d.proto.DeviceCapabilities.BusinessBroadcast.decode(e,e.uint32());break}case 4:{s.userHasAvatar=d.proto.DeviceCapabilities.UserHasAvatar.decode(e,e.uint32());break}case 5:{s.memberNameTagPrimarySupport=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.DeviceCapabilities)return e;var i=new d.proto.DeviceCapabilities;switch(e.chatLockSupportLevel){default:if(typeof e.chatLockSupportLevel=="number"){i.chatLockSupportLevel=e.chatLockSupportLevel;break}break;case"NONE":case 0:i.chatLockSupportLevel=0;break;case"MINIMAL":case 1:i.chatLockSupportLevel=1;break;case"FULL":case 2:i.chatLockSupportLevel=2;break}if(e.lidMigration!=null){if(typeof e.lidMigration!="object")throw TypeError(".proto.DeviceCapabilities.lidMigration: object expected");i.lidMigration=d.proto.DeviceCapabilities.LIDMigration.fromObject(e.lidMigration)}if(e.businessBroadcast!=null){if(typeof e.businessBroadcast!="object")throw TypeError(".proto.DeviceCapabilities.businessBroadcast: object expected");i.businessBroadcast=d.proto.DeviceCapabilities.BusinessBroadcast.fromObject(e.businessBroadcast)}if(e.userHasAvatar!=null){if(typeof e.userHasAvatar!="object")throw TypeError(".proto.DeviceCapabilities.userHasAvatar: object expected");i.userHasAvatar=d.proto.DeviceCapabilities.UserHasAvatar.fromObject(e.userHasAvatar)}switch(e.memberNameTagPrimarySupport){default:if(typeof e.memberNameTagPrimarySupport=="number"){i.memberNameTagPrimarySupport=e.memberNameTagPrimarySupport;break}break;case"DISABLED":case 0:i.memberNameTagPrimarySupport=0;break;case"RECEIVER_ENABLED":case 1:i.memberNameTagPrimarySupport=1;break;case"SENDER_ENABLED":case 2:i.memberNameTagPrimarySupport=2;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.chatLockSupportLevel!=null&&e.hasOwnProperty("chatLockSupportLevel")&&(A.chatLockSupportLevel=i.enums===String?d.proto.DeviceCapabilities.ChatLockSupportLevel[e.chatLockSupportLevel]===void 0?e.chatLockSupportLevel:d.proto.DeviceCapabilities.ChatLockSupportLevel[e.chatLockSupportLevel]:e.chatLockSupportLevel,i.oneofs&&(A._chatLockSupportLevel="chatLockSupportLevel")),e.lidMigration!=null&&e.hasOwnProperty("lidMigration")&&(A.lidMigration=d.proto.DeviceCapabilities.LIDMigration.toObject(e.lidMigration,i),i.oneofs&&(A._lidMigration="lidMigration")),e.businessBroadcast!=null&&e.hasOwnProperty("businessBroadcast")&&(A.businessBroadcast=d.proto.DeviceCapabilities.BusinessBroadcast.toObject(e.businessBroadcast,i),i.oneofs&&(A._businessBroadcast="businessBroadcast")),e.userHasAvatar!=null&&e.hasOwnProperty("userHasAvatar")&&(A.userHasAvatar=d.proto.DeviceCapabilities.UserHasAvatar.toObject(e.userHasAvatar,i),i.oneofs&&(A._userHasAvatar="userHasAvatar")),e.memberNameTagPrimarySupport!=null&&e.hasOwnProperty("memberNameTagPrimarySupport")&&(A.memberNameTagPrimarySupport=i.enums===String?d.proto.DeviceCapabilities.MemberNameTagPrimarySupport[e.memberNameTagPrimarySupport]===void 0?e.memberNameTagPrimarySupport:d.proto.DeviceCapabilities.MemberNameTagPrimarySupport[e.memberNameTagPrimarySupport]:e.memberNameTagPrimarySupport,i.oneofs&&(A._memberNameTagPrimarySupport="memberNameTagPrimarySupport")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceCapabilities"},t.BusinessBroadcast=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.importListEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.DeviceCapabilities.BusinessBroadcast)return A;var r=new d.proto.DeviceCapabilities.BusinessBroadcast;return A.importListEnabled!=null&&(r.importListEnabled=!!A.importListEnabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.importListEnabled!=null&&A.hasOwnProperty("importListEnabled")&&(s.importListEnabled=A.importListEnabled,r.oneofs&&(s._importListEnabled="importListEnabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.BusinessBroadcast"},a})(),t.ChatLockSupportLevel=(function(){let a={},e=Object.create(a);return e[a[0]="NONE"]=0,e[a[1]="MINIMAL"]=1,e[a[2]="FULL"]=2,e})(),t.LIDMigration=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.chatDbMigrationTimestamp=A.uint64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.DeviceCapabilities.LIDMigration)return A;var r=new d.proto.DeviceCapabilities.LIDMigration;return A.chatDbMigrationTimestamp!=null&&(l.Long?(r.chatDbMigrationTimestamp=l.Long.fromValue(A.chatDbMigrationTimestamp)).unsigned=!0:typeof A.chatDbMigrationTimestamp=="string"?r.chatDbMigrationTimestamp=parseInt(A.chatDbMigrationTimestamp,10):typeof A.chatDbMigrationTimestamp=="number"?r.chatDbMigrationTimestamp=A.chatDbMigrationTimestamp:typeof A.chatDbMigrationTimestamp=="object"&&(r.chatDbMigrationTimestamp=new l.LongBits(A.chatDbMigrationTimestamp.low>>>0,A.chatDbMigrationTimestamp.high>>>0).toNumber(!0))),r},a.toObject=function(A,r){r||(r={});var s={};return A.chatDbMigrationTimestamp!=null&&A.hasOwnProperty("chatDbMigrationTimestamp")&&(typeof A.chatDbMigrationTimestamp=="number"?s.chatDbMigrationTimestamp=r.longs===String?String(A.chatDbMigrationTimestamp):A.chatDbMigrationTimestamp:s.chatDbMigrationTimestamp=r.longs===String?ge(A.chatDbMigrationTimestamp,!0):r.longs===Number?ce(A.chatDbMigrationTimestamp,!0):A.chatDbMigrationTimestamp,r.oneofs&&(s._chatDbMigrationTimestamp="chatDbMigrationTimestamp")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.LIDMigration"},a})(),t.MemberNameTagPrimarySupport=(function(){let a={},e=Object.create(a);return e[a[0]="DISABLED"]=0,e[a[1]="RECEIVER_ENABLED"]=1,e[a[2]="SENDER_ENABLED"]=2,e})(),t.UserHasAvatar=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.userHasAvatar=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.DeviceCapabilities.UserHasAvatar)return A;var r=new d.proto.DeviceCapabilities.UserHasAvatar;return A.userHasAvatar!=null&&(r.userHasAvatar=!!A.userHasAvatar),r},a.toObject=function(A,r){r||(r={});var s={};return A.userHasAvatar!=null&&A.hasOwnProperty("userHasAvatar")&&(s.userHasAvatar=A.userHasAvatar,r.oneofs&&(s._userHasAvatar="userHasAvatar")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceCapabilities.UserHasAvatar"},a})(),t})(),n.DeviceConsistencyCodeMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.generation=e.uint32();break}case 2:{s.signature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.DeviceConsistencyCodeMessage)return e;var i=new d.proto.DeviceConsistencyCodeMessage;return e.generation!=null&&(i.generation=e.generation>>>0),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,i.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(i.signature=e.signature)),i},t.toObject=function(e,i){i||(i={});var A={};return e.generation!=null&&e.hasOwnProperty("generation")&&(A.generation=e.generation,i.oneofs&&(A._generation="generation")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=i.bytes===String?l.base64.encode(e.signature,0,e.signature.length):i.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,i.oneofs&&(A._signature="signature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceConsistencyCodeMessage"},t})(),n.DeviceListMetadata=(function(){function t(a){if(this.senderKeyIndexes=[],this.recipientKeyIndexes=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.senderKeyHash=e.bytes();break}case 2:{s.senderTimestamp=e.uint64();break}case 3:{if(s.senderKeyIndexes&&s.senderKeyIndexes.length||(s.senderKeyIndexes=[]),(g&7)===2)for(var c=e.uint32()+e.pos;e.pos=0&&(i.senderKeyHash=e.senderKeyHash)),e.senderTimestamp!=null&&(l.Long?(i.senderTimestamp=l.Long.fromValue(e.senderTimestamp)).unsigned=!0:typeof e.senderTimestamp=="string"?i.senderTimestamp=parseInt(e.senderTimestamp,10):typeof e.senderTimestamp=="number"?i.senderTimestamp=e.senderTimestamp:typeof e.senderTimestamp=="object"&&(i.senderTimestamp=new l.LongBits(e.senderTimestamp.low>>>0,e.senderTimestamp.high>>>0).toNumber(!0))),e.senderKeyIndexes){if(!Array.isArray(e.senderKeyIndexes))throw TypeError(".proto.DeviceListMetadata.senderKeyIndexes: array expected");i.senderKeyIndexes=[];for(var A=0;A>>0}switch(e.senderAccountType){default:if(typeof e.senderAccountType=="number"){i.senderAccountType=e.senderAccountType;break}break;case"E2EE":case 0:i.senderAccountType=0;break;case"HOSTED":case 1:i.senderAccountType=1;break}switch(e.receiverAccountType){default:if(typeof e.receiverAccountType=="number"){i.receiverAccountType=e.receiverAccountType;break}break;case"E2EE":case 0:i.receiverAccountType=0;break;case"HOSTED":case 1:i.receiverAccountType=1;break}if(e.recipientKeyHash!=null&&(typeof e.recipientKeyHash=="string"?l.base64.decode(e.recipientKeyHash,i.recipientKeyHash=l.newBuffer(l.base64.length(e.recipientKeyHash)),0):e.recipientKeyHash.length>=0&&(i.recipientKeyHash=e.recipientKeyHash)),e.recipientTimestamp!=null&&(l.Long?(i.recipientTimestamp=l.Long.fromValue(e.recipientTimestamp)).unsigned=!0:typeof e.recipientTimestamp=="string"?i.recipientTimestamp=parseInt(e.recipientTimestamp,10):typeof e.recipientTimestamp=="number"?i.recipientTimestamp=e.recipientTimestamp:typeof e.recipientTimestamp=="object"&&(i.recipientTimestamp=new l.LongBits(e.recipientTimestamp.low>>>0,e.recipientTimestamp.high>>>0).toNumber(!0))),e.recipientKeyIndexes){if(!Array.isArray(e.recipientKeyIndexes))throw TypeError(".proto.DeviceListMetadata.recipientKeyIndexes: array expected");i.recipientKeyIndexes=[];for(var A=0;A>>0}return i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.senderKeyIndexes=[],A.recipientKeyIndexes=[]),e.senderKeyHash!=null&&e.hasOwnProperty("senderKeyHash")&&(A.senderKeyHash=i.bytes===String?l.base64.encode(e.senderKeyHash,0,e.senderKeyHash.length):i.bytes===Array?Array.prototype.slice.call(e.senderKeyHash):e.senderKeyHash,i.oneofs&&(A._senderKeyHash="senderKeyHash")),e.senderTimestamp!=null&&e.hasOwnProperty("senderTimestamp")&&(typeof e.senderTimestamp=="number"?A.senderTimestamp=i.longs===String?String(e.senderTimestamp):e.senderTimestamp:A.senderTimestamp=i.longs===String?ge(e.senderTimestamp,!0):i.longs===Number?ce(e.senderTimestamp,!0):e.senderTimestamp,i.oneofs&&(A._senderTimestamp="senderTimestamp")),e.senderKeyIndexes&&e.senderKeyIndexes.length){A.senderKeyIndexes=[];for(var r=0;r>>3){case 1:{s.os=e.string();break}case 2:{s.version=d.proto.DeviceProps.AppVersion.decode(e,e.uint32());break}case 3:{s.platformType=e.int32();break}case 4:{s.requireFullSync=e.bool();break}case 5:{s.historySyncConfig=d.proto.DeviceProps.HistorySyncConfig.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.DeviceProps)return e;var i=new d.proto.DeviceProps;if(e.os!=null&&(i.os=String(e.os)),e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.DeviceProps.version: object expected");i.version=d.proto.DeviceProps.AppVersion.fromObject(e.version)}switch(e.platformType){default:if(typeof e.platformType=="number"){i.platformType=e.platformType;break}break;case"UNKNOWN":case 0:i.platformType=0;break;case"CHROME":case 1:i.platformType=1;break;case"FIREFOX":case 2:i.platformType=2;break;case"IE":case 3:i.platformType=3;break;case"OPERA":case 4:i.platformType=4;break;case"SAFARI":case 5:i.platformType=5;break;case"EDGE":case 6:i.platformType=6;break;case"DESKTOP":case 7:i.platformType=7;break;case"IPAD":case 8:i.platformType=8;break;case"ANDROID_TABLET":case 9:i.platformType=9;break;case"OHANA":case 10:i.platformType=10;break;case"ALOHA":case 11:i.platformType=11;break;case"CATALINA":case 12:i.platformType=12;break;case"TCL_TV":case 13:i.platformType=13;break;case"IOS_PHONE":case 14:i.platformType=14;break;case"IOS_CATALYST":case 15:i.platformType=15;break;case"ANDROID_PHONE":case 16:i.platformType=16;break;case"ANDROID_AMBIGUOUS":case 17:i.platformType=17;break;case"WEAR_OS":case 18:i.platformType=18;break;case"AR_WRIST":case 19:i.platformType=19;break;case"AR_DEVICE":case 20:i.platformType=20;break;case"UWP":case 21:i.platformType=21;break;case"VR":case 22:i.platformType=22;break;case"CLOUD_API":case 23:i.platformType=23;break;case"SMARTGLASSES":case 24:i.platformType=24;break}if(e.requireFullSync!=null&&(i.requireFullSync=!!e.requireFullSync),e.historySyncConfig!=null){if(typeof e.historySyncConfig!="object")throw TypeError(".proto.DeviceProps.historySyncConfig: object expected");i.historySyncConfig=d.proto.DeviceProps.HistorySyncConfig.fromObject(e.historySyncConfig)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.os!=null&&e.hasOwnProperty("os")&&(A.os=e.os,i.oneofs&&(A._os="os")),e.version!=null&&e.hasOwnProperty("version")&&(A.version=d.proto.DeviceProps.AppVersion.toObject(e.version,i),i.oneofs&&(A._version="version")),e.platformType!=null&&e.hasOwnProperty("platformType")&&(A.platformType=i.enums===String?d.proto.DeviceProps.PlatformType[e.platformType]===void 0?e.platformType:d.proto.DeviceProps.PlatformType[e.platformType]:e.platformType,i.oneofs&&(A._platformType="platformType")),e.requireFullSync!=null&&e.hasOwnProperty("requireFullSync")&&(A.requireFullSync=e.requireFullSync,i.oneofs&&(A._requireFullSync="requireFullSync")),e.historySyncConfig!=null&&e.hasOwnProperty("historySyncConfig")&&(A.historySyncConfig=d.proto.DeviceProps.HistorySyncConfig.toObject(e.historySyncConfig,i),i.oneofs&&(A._historySyncConfig="historySyncConfig")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DeviceProps"},t.AppVersion=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.primary=A.uint32();break}case 2:{c.secondary=A.uint32();break}case 3:{c.tertiary=A.uint32();break}case 4:{c.quaternary=A.uint32();break}case 5:{c.quinary=A.uint32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.DeviceProps.AppVersion)return A;var r=new d.proto.DeviceProps.AppVersion;return A.primary!=null&&(r.primary=A.primary>>>0),A.secondary!=null&&(r.secondary=A.secondary>>>0),A.tertiary!=null&&(r.tertiary=A.tertiary>>>0),A.quaternary!=null&&(r.quaternary=A.quaternary>>>0),A.quinary!=null&&(r.quinary=A.quinary>>>0),r},a.toObject=function(A,r){r||(r={});var s={};return A.primary!=null&&A.hasOwnProperty("primary")&&(s.primary=A.primary,r.oneofs&&(s._primary="primary")),A.secondary!=null&&A.hasOwnProperty("secondary")&&(s.secondary=A.secondary,r.oneofs&&(s._secondary="secondary")),A.tertiary!=null&&A.hasOwnProperty("tertiary")&&(s.tertiary=A.tertiary,r.oneofs&&(s._tertiary="tertiary")),A.quaternary!=null&&A.hasOwnProperty("quaternary")&&(s.quaternary=A.quaternary,r.oneofs&&(s._quaternary="quaternary")),A.quinary!=null&&A.hasOwnProperty("quinary")&&(s.quinary=A.quinary,r.oneofs&&(s._quinary="quinary")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceProps.AppVersion"},a})(),t.HistorySyncConfig=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.fullSyncDaysLimit=A.uint32();break}case 2:{c.fullSyncSizeMbLimit=A.uint32();break}case 3:{c.storageQuotaMb=A.uint32();break}case 4:{c.inlineInitialPayloadInE2EeMsg=A.bool();break}case 5:{c.recentSyncDaysLimit=A.uint32();break}case 6:{c.supportCallLogHistory=A.bool();break}case 7:{c.supportBotUserAgentChatHistory=A.bool();break}case 8:{c.supportCagReactionsAndPolls=A.bool();break}case 9:{c.supportBizHostedMsg=A.bool();break}case 10:{c.supportRecentSyncChunkMessageCountTuning=A.bool();break}case 11:{c.supportHostedGroupMsg=A.bool();break}case 12:{c.supportFbidBotChatHistory=A.bool();break}case 13:{c.supportAddOnHistorySyncMigration=A.bool();break}case 14:{c.supportMessageAssociation=A.bool();break}case 15:{c.supportGroupHistory=A.bool();break}case 16:{c.onDemandReady=A.bool();break}case 17:{c.supportGuestChat=A.bool();break}case 18:{c.completeOnDemandReady=A.bool();break}case 19:{c.thumbnailSyncDaysLimit=A.uint32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.DeviceProps.HistorySyncConfig)return A;var r=new d.proto.DeviceProps.HistorySyncConfig;return A.fullSyncDaysLimit!=null&&(r.fullSyncDaysLimit=A.fullSyncDaysLimit>>>0),A.fullSyncSizeMbLimit!=null&&(r.fullSyncSizeMbLimit=A.fullSyncSizeMbLimit>>>0),A.storageQuotaMb!=null&&(r.storageQuotaMb=A.storageQuotaMb>>>0),A.inlineInitialPayloadInE2EeMsg!=null&&(r.inlineInitialPayloadInE2EeMsg=!!A.inlineInitialPayloadInE2EeMsg),A.recentSyncDaysLimit!=null&&(r.recentSyncDaysLimit=A.recentSyncDaysLimit>>>0),A.supportCallLogHistory!=null&&(r.supportCallLogHistory=!!A.supportCallLogHistory),A.supportBotUserAgentChatHistory!=null&&(r.supportBotUserAgentChatHistory=!!A.supportBotUserAgentChatHistory),A.supportCagReactionsAndPolls!=null&&(r.supportCagReactionsAndPolls=!!A.supportCagReactionsAndPolls),A.supportBizHostedMsg!=null&&(r.supportBizHostedMsg=!!A.supportBizHostedMsg),A.supportRecentSyncChunkMessageCountTuning!=null&&(r.supportRecentSyncChunkMessageCountTuning=!!A.supportRecentSyncChunkMessageCountTuning),A.supportHostedGroupMsg!=null&&(r.supportHostedGroupMsg=!!A.supportHostedGroupMsg),A.supportFbidBotChatHistory!=null&&(r.supportFbidBotChatHistory=!!A.supportFbidBotChatHistory),A.supportAddOnHistorySyncMigration!=null&&(r.supportAddOnHistorySyncMigration=!!A.supportAddOnHistorySyncMigration),A.supportMessageAssociation!=null&&(r.supportMessageAssociation=!!A.supportMessageAssociation),A.supportGroupHistory!=null&&(r.supportGroupHistory=!!A.supportGroupHistory),A.onDemandReady!=null&&(r.onDemandReady=!!A.onDemandReady),A.supportGuestChat!=null&&(r.supportGuestChat=!!A.supportGuestChat),A.completeOnDemandReady!=null&&(r.completeOnDemandReady=!!A.completeOnDemandReady),A.thumbnailSyncDaysLimit!=null&&(r.thumbnailSyncDaysLimit=A.thumbnailSyncDaysLimit>>>0),r},a.toObject=function(A,r){r||(r={});var s={};return A.fullSyncDaysLimit!=null&&A.hasOwnProperty("fullSyncDaysLimit")&&(s.fullSyncDaysLimit=A.fullSyncDaysLimit,r.oneofs&&(s._fullSyncDaysLimit="fullSyncDaysLimit")),A.fullSyncSizeMbLimit!=null&&A.hasOwnProperty("fullSyncSizeMbLimit")&&(s.fullSyncSizeMbLimit=A.fullSyncSizeMbLimit,r.oneofs&&(s._fullSyncSizeMbLimit="fullSyncSizeMbLimit")),A.storageQuotaMb!=null&&A.hasOwnProperty("storageQuotaMb")&&(s.storageQuotaMb=A.storageQuotaMb,r.oneofs&&(s._storageQuotaMb="storageQuotaMb")),A.inlineInitialPayloadInE2EeMsg!=null&&A.hasOwnProperty("inlineInitialPayloadInE2EeMsg")&&(s.inlineInitialPayloadInE2EeMsg=A.inlineInitialPayloadInE2EeMsg,r.oneofs&&(s._inlineInitialPayloadInE2EeMsg="inlineInitialPayloadInE2EeMsg")),A.recentSyncDaysLimit!=null&&A.hasOwnProperty("recentSyncDaysLimit")&&(s.recentSyncDaysLimit=A.recentSyncDaysLimit,r.oneofs&&(s._recentSyncDaysLimit="recentSyncDaysLimit")),A.supportCallLogHistory!=null&&A.hasOwnProperty("supportCallLogHistory")&&(s.supportCallLogHistory=A.supportCallLogHistory,r.oneofs&&(s._supportCallLogHistory="supportCallLogHistory")),A.supportBotUserAgentChatHistory!=null&&A.hasOwnProperty("supportBotUserAgentChatHistory")&&(s.supportBotUserAgentChatHistory=A.supportBotUserAgentChatHistory,r.oneofs&&(s._supportBotUserAgentChatHistory="supportBotUserAgentChatHistory")),A.supportCagReactionsAndPolls!=null&&A.hasOwnProperty("supportCagReactionsAndPolls")&&(s.supportCagReactionsAndPolls=A.supportCagReactionsAndPolls,r.oneofs&&(s._supportCagReactionsAndPolls="supportCagReactionsAndPolls")),A.supportBizHostedMsg!=null&&A.hasOwnProperty("supportBizHostedMsg")&&(s.supportBizHostedMsg=A.supportBizHostedMsg,r.oneofs&&(s._supportBizHostedMsg="supportBizHostedMsg")),A.supportRecentSyncChunkMessageCountTuning!=null&&A.hasOwnProperty("supportRecentSyncChunkMessageCountTuning")&&(s.supportRecentSyncChunkMessageCountTuning=A.supportRecentSyncChunkMessageCountTuning,r.oneofs&&(s._supportRecentSyncChunkMessageCountTuning="supportRecentSyncChunkMessageCountTuning")),A.supportHostedGroupMsg!=null&&A.hasOwnProperty("supportHostedGroupMsg")&&(s.supportHostedGroupMsg=A.supportHostedGroupMsg,r.oneofs&&(s._supportHostedGroupMsg="supportHostedGroupMsg")),A.supportFbidBotChatHistory!=null&&A.hasOwnProperty("supportFbidBotChatHistory")&&(s.supportFbidBotChatHistory=A.supportFbidBotChatHistory,r.oneofs&&(s._supportFbidBotChatHistory="supportFbidBotChatHistory")),A.supportAddOnHistorySyncMigration!=null&&A.hasOwnProperty("supportAddOnHistorySyncMigration")&&(s.supportAddOnHistorySyncMigration=A.supportAddOnHistorySyncMigration,r.oneofs&&(s._supportAddOnHistorySyncMigration="supportAddOnHistorySyncMigration")),A.supportMessageAssociation!=null&&A.hasOwnProperty("supportMessageAssociation")&&(s.supportMessageAssociation=A.supportMessageAssociation,r.oneofs&&(s._supportMessageAssociation="supportMessageAssociation")),A.supportGroupHistory!=null&&A.hasOwnProperty("supportGroupHistory")&&(s.supportGroupHistory=A.supportGroupHistory,r.oneofs&&(s._supportGroupHistory="supportGroupHistory")),A.onDemandReady!=null&&A.hasOwnProperty("onDemandReady")&&(s.onDemandReady=A.onDemandReady,r.oneofs&&(s._onDemandReady="onDemandReady")),A.supportGuestChat!=null&&A.hasOwnProperty("supportGuestChat")&&(s.supportGuestChat=A.supportGuestChat,r.oneofs&&(s._supportGuestChat="supportGuestChat")),A.completeOnDemandReady!=null&&A.hasOwnProperty("completeOnDemandReady")&&(s.completeOnDemandReady=A.completeOnDemandReady,r.oneofs&&(s._completeOnDemandReady="completeOnDemandReady")),A.thumbnailSyncDaysLimit!=null&&A.hasOwnProperty("thumbnailSyncDaysLimit")&&(s.thumbnailSyncDaysLimit=A.thumbnailSyncDaysLimit,r.oneofs&&(s._thumbnailSyncDaysLimit="thumbnailSyncDaysLimit")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.DeviceProps.HistorySyncConfig"},a})(),t.PlatformType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="CHROME"]=1,e[a[2]="FIREFOX"]=2,e[a[3]="IE"]=3,e[a[4]="OPERA"]=4,e[a[5]="SAFARI"]=5,e[a[6]="EDGE"]=6,e[a[7]="DESKTOP"]=7,e[a[8]="IPAD"]=8,e[a[9]="ANDROID_TABLET"]=9,e[a[10]="OHANA"]=10,e[a[11]="ALOHA"]=11,e[a[12]="CATALINA"]=12,e[a[13]="TCL_TV"]=13,e[a[14]="IOS_PHONE"]=14,e[a[15]="IOS_CATALYST"]=15,e[a[16]="ANDROID_PHONE"]=16,e[a[17]="ANDROID_AMBIGUOUS"]=17,e[a[18]="WEAR_OS"]=18,e[a[19]="AR_WRIST"]=19,e[a[20]="AR_DEVICE"]=20,e[a[21]="UWP"]=21,e[a[22]="VR"]=22,e[a[23]="CLOUD_API"]=23,e[a[24]="SMARTGLASSES"]=24,e})(),t})(),n.DisappearingMode=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.initiator=e.int32();break}case 2:{s.trigger=e.int32();break}case 3:{s.initiatorDeviceJid=e.string();break}case 4:{s.initiatedByMe=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.DisappearingMode)return e;var i=new d.proto.DisappearingMode;switch(e.initiator){default:if(typeof e.initiator=="number"){i.initiator=e.initiator;break}break;case"CHANGED_IN_CHAT":case 0:i.initiator=0;break;case"INITIATED_BY_ME":case 1:i.initiator=1;break;case"INITIATED_BY_OTHER":case 2:i.initiator=2;break;case"BIZ_UPGRADE_FB_HOSTING":case 3:i.initiator=3;break}switch(e.trigger){default:if(typeof e.trigger=="number"){i.trigger=e.trigger;break}break;case"UNKNOWN":case 0:i.trigger=0;break;case"CHAT_SETTING":case 1:i.trigger=1;break;case"ACCOUNT_SETTING":case 2:i.trigger=2;break;case"BULK_CHANGE":case 3:i.trigger=3;break;case"BIZ_SUPPORTS_FB_HOSTING":case 4:i.trigger=4;break;case"UNKNOWN_GROUPS":case 5:i.trigger=5;break}return e.initiatorDeviceJid!=null&&(i.initiatorDeviceJid=String(e.initiatorDeviceJid)),e.initiatedByMe!=null&&(i.initiatedByMe=!!e.initiatedByMe),i},t.toObject=function(e,i){i||(i={});var A={};return e.initiator!=null&&e.hasOwnProperty("initiator")&&(A.initiator=i.enums===String?d.proto.DisappearingMode.Initiator[e.initiator]===void 0?e.initiator:d.proto.DisappearingMode.Initiator[e.initiator]:e.initiator,i.oneofs&&(A._initiator="initiator")),e.trigger!=null&&e.hasOwnProperty("trigger")&&(A.trigger=i.enums===String?d.proto.DisappearingMode.Trigger[e.trigger]===void 0?e.trigger:d.proto.DisappearingMode.Trigger[e.trigger]:e.trigger,i.oneofs&&(A._trigger="trigger")),e.initiatorDeviceJid!=null&&e.hasOwnProperty("initiatorDeviceJid")&&(A.initiatorDeviceJid=e.initiatorDeviceJid,i.oneofs&&(A._initiatorDeviceJid="initiatorDeviceJid")),e.initiatedByMe!=null&&e.hasOwnProperty("initiatedByMe")&&(A.initiatedByMe=e.initiatedByMe,i.oneofs&&(A._initiatedByMe="initiatedByMe")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.DisappearingMode"},t.Initiator=(function(){let a={},e=Object.create(a);return e[a[0]="CHANGED_IN_CHAT"]=0,e[a[1]="INITIATED_BY_ME"]=1,e[a[2]="INITIATED_BY_OTHER"]=2,e[a[3]="BIZ_UPGRADE_FB_HOSTING"]=3,e})(),t.Trigger=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="CHAT_SETTING"]=1,e[a[2]="ACCOUNT_SETTING"]=2,e[a[3]="BULK_CHANGE"]=3,e[a[4]="BIZ_SUPPORTS_FB_HOSTING"]=4,e[a[5]="UNKNOWN_GROUPS"]=5,e})(),t})(),n.EmbeddedContent=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.embeddedMessage=d.proto.EmbeddedMessage.decode(e,e.uint32());break}case 2:{s.embeddedMusic=d.proto.EmbeddedMusic.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EmbeddedContent)return e;var i=new d.proto.EmbeddedContent;if(e.embeddedMessage!=null){if(typeof e.embeddedMessage!="object")throw TypeError(".proto.EmbeddedContent.embeddedMessage: object expected");i.embeddedMessage=d.proto.EmbeddedMessage.fromObject(e.embeddedMessage)}if(e.embeddedMusic!=null){if(typeof e.embeddedMusic!="object")throw TypeError(".proto.EmbeddedContent.embeddedMusic: object expected");i.embeddedMusic=d.proto.EmbeddedMusic.fromObject(e.embeddedMusic)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.embeddedMessage!=null&&e.hasOwnProperty("embeddedMessage")&&(A.embeddedMessage=d.proto.EmbeddedMessage.toObject(e.embeddedMessage,i),i.oneofs&&(A.content="embeddedMessage")),e.embeddedMusic!=null&&e.hasOwnProperty("embeddedMusic")&&(A.embeddedMusic=d.proto.EmbeddedMusic.toObject(e.embeddedMusic,i),i.oneofs&&(A.content="embeddedMusic")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedContent"},t})(),n.EmbeddedMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.message=d.proto.Message.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EmbeddedMessage)return e;var i=new d.proto.EmbeddedMessage;if(e.stanzaId!=null&&(i.stanzaId=String(e.stanzaId)),e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.EmbeddedMessage.message: object expected");i.message=d.proto.Message.fromObject(e.message)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,i.oneofs&&(A._stanzaId="stanzaId")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=d.proto.Message.toObject(e.message,i),i.oneofs&&(A._message="message")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedMessage"},t})(),n.EmbeddedMusic=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.musicContentMediaId=e.string();break}case 2:{s.songId=e.string();break}case 3:{s.author=e.string();break}case 4:{s.title=e.string();break}case 5:{s.artworkDirectPath=e.string();break}case 6:{s.artworkSha256=e.bytes();break}case 7:{s.artworkEncSha256=e.bytes();break}case 8:{s.artistAttribution=e.string();break}case 9:{s.countryBlocklist=e.bytes();break}case 10:{s.isExplicit=e.bool();break}case 11:{s.artworkMediaKey=e.bytes();break}case 12:{s.musicSongStartTimeInMs=e.int64();break}case 13:{s.derivedContentStartTimeInMs=e.int64();break}case 14:{s.overlapDurationInMs=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EmbeddedMusic)return e;var i=new d.proto.EmbeddedMusic;return e.musicContentMediaId!=null&&(i.musicContentMediaId=String(e.musicContentMediaId)),e.songId!=null&&(i.songId=String(e.songId)),e.author!=null&&(i.author=String(e.author)),e.title!=null&&(i.title=String(e.title)),e.artworkDirectPath!=null&&(i.artworkDirectPath=String(e.artworkDirectPath)),e.artworkSha256!=null&&(typeof e.artworkSha256=="string"?l.base64.decode(e.artworkSha256,i.artworkSha256=l.newBuffer(l.base64.length(e.artworkSha256)),0):e.artworkSha256.length>=0&&(i.artworkSha256=e.artworkSha256)),e.artworkEncSha256!=null&&(typeof e.artworkEncSha256=="string"?l.base64.decode(e.artworkEncSha256,i.artworkEncSha256=l.newBuffer(l.base64.length(e.artworkEncSha256)),0):e.artworkEncSha256.length>=0&&(i.artworkEncSha256=e.artworkEncSha256)),e.artistAttribution!=null&&(i.artistAttribution=String(e.artistAttribution)),e.countryBlocklist!=null&&(typeof e.countryBlocklist=="string"?l.base64.decode(e.countryBlocklist,i.countryBlocklist=l.newBuffer(l.base64.length(e.countryBlocklist)),0):e.countryBlocklist.length>=0&&(i.countryBlocklist=e.countryBlocklist)),e.isExplicit!=null&&(i.isExplicit=!!e.isExplicit),e.artworkMediaKey!=null&&(typeof e.artworkMediaKey=="string"?l.base64.decode(e.artworkMediaKey,i.artworkMediaKey=l.newBuffer(l.base64.length(e.artworkMediaKey)),0):e.artworkMediaKey.length>=0&&(i.artworkMediaKey=e.artworkMediaKey)),e.musicSongStartTimeInMs!=null&&(l.Long?(i.musicSongStartTimeInMs=l.Long.fromValue(e.musicSongStartTimeInMs)).unsigned=!1:typeof e.musicSongStartTimeInMs=="string"?i.musicSongStartTimeInMs=parseInt(e.musicSongStartTimeInMs,10):typeof e.musicSongStartTimeInMs=="number"?i.musicSongStartTimeInMs=e.musicSongStartTimeInMs:typeof e.musicSongStartTimeInMs=="object"&&(i.musicSongStartTimeInMs=new l.LongBits(e.musicSongStartTimeInMs.low>>>0,e.musicSongStartTimeInMs.high>>>0).toNumber())),e.derivedContentStartTimeInMs!=null&&(l.Long?(i.derivedContentStartTimeInMs=l.Long.fromValue(e.derivedContentStartTimeInMs)).unsigned=!1:typeof e.derivedContentStartTimeInMs=="string"?i.derivedContentStartTimeInMs=parseInt(e.derivedContentStartTimeInMs,10):typeof e.derivedContentStartTimeInMs=="number"?i.derivedContentStartTimeInMs=e.derivedContentStartTimeInMs:typeof e.derivedContentStartTimeInMs=="object"&&(i.derivedContentStartTimeInMs=new l.LongBits(e.derivedContentStartTimeInMs.low>>>0,e.derivedContentStartTimeInMs.high>>>0).toNumber())),e.overlapDurationInMs!=null&&(l.Long?(i.overlapDurationInMs=l.Long.fromValue(e.overlapDurationInMs)).unsigned=!1:typeof e.overlapDurationInMs=="string"?i.overlapDurationInMs=parseInt(e.overlapDurationInMs,10):typeof e.overlapDurationInMs=="number"?i.overlapDurationInMs=e.overlapDurationInMs:typeof e.overlapDurationInMs=="object"&&(i.overlapDurationInMs=new l.LongBits(e.overlapDurationInMs.low>>>0,e.overlapDurationInMs.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.musicContentMediaId!=null&&e.hasOwnProperty("musicContentMediaId")&&(A.musicContentMediaId=e.musicContentMediaId,i.oneofs&&(A._musicContentMediaId="musicContentMediaId")),e.songId!=null&&e.hasOwnProperty("songId")&&(A.songId=e.songId,i.oneofs&&(A._songId="songId")),e.author!=null&&e.hasOwnProperty("author")&&(A.author=e.author,i.oneofs&&(A._author="author")),e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,i.oneofs&&(A._title="title")),e.artworkDirectPath!=null&&e.hasOwnProperty("artworkDirectPath")&&(A.artworkDirectPath=e.artworkDirectPath,i.oneofs&&(A._artworkDirectPath="artworkDirectPath")),e.artworkSha256!=null&&e.hasOwnProperty("artworkSha256")&&(A.artworkSha256=i.bytes===String?l.base64.encode(e.artworkSha256,0,e.artworkSha256.length):i.bytes===Array?Array.prototype.slice.call(e.artworkSha256):e.artworkSha256,i.oneofs&&(A._artworkSha256="artworkSha256")),e.artworkEncSha256!=null&&e.hasOwnProperty("artworkEncSha256")&&(A.artworkEncSha256=i.bytes===String?l.base64.encode(e.artworkEncSha256,0,e.artworkEncSha256.length):i.bytes===Array?Array.prototype.slice.call(e.artworkEncSha256):e.artworkEncSha256,i.oneofs&&(A._artworkEncSha256="artworkEncSha256")),e.artistAttribution!=null&&e.hasOwnProperty("artistAttribution")&&(A.artistAttribution=e.artistAttribution,i.oneofs&&(A._artistAttribution="artistAttribution")),e.countryBlocklist!=null&&e.hasOwnProperty("countryBlocklist")&&(A.countryBlocklist=i.bytes===String?l.base64.encode(e.countryBlocklist,0,e.countryBlocklist.length):i.bytes===Array?Array.prototype.slice.call(e.countryBlocklist):e.countryBlocklist,i.oneofs&&(A._countryBlocklist="countryBlocklist")),e.isExplicit!=null&&e.hasOwnProperty("isExplicit")&&(A.isExplicit=e.isExplicit,i.oneofs&&(A._isExplicit="isExplicit")),e.artworkMediaKey!=null&&e.hasOwnProperty("artworkMediaKey")&&(A.artworkMediaKey=i.bytes===String?l.base64.encode(e.artworkMediaKey,0,e.artworkMediaKey.length):i.bytes===Array?Array.prototype.slice.call(e.artworkMediaKey):e.artworkMediaKey,i.oneofs&&(A._artworkMediaKey="artworkMediaKey")),e.musicSongStartTimeInMs!=null&&e.hasOwnProperty("musicSongStartTimeInMs")&&(typeof e.musicSongStartTimeInMs=="number"?A.musicSongStartTimeInMs=i.longs===String?String(e.musicSongStartTimeInMs):e.musicSongStartTimeInMs:A.musicSongStartTimeInMs=i.longs===String?ge(e.musicSongStartTimeInMs):i.longs===Number?ce(e.musicSongStartTimeInMs):e.musicSongStartTimeInMs,i.oneofs&&(A._musicSongStartTimeInMs="musicSongStartTimeInMs")),e.derivedContentStartTimeInMs!=null&&e.hasOwnProperty("derivedContentStartTimeInMs")&&(typeof e.derivedContentStartTimeInMs=="number"?A.derivedContentStartTimeInMs=i.longs===String?String(e.derivedContentStartTimeInMs):e.derivedContentStartTimeInMs:A.derivedContentStartTimeInMs=i.longs===String?ge(e.derivedContentStartTimeInMs):i.longs===Number?ce(e.derivedContentStartTimeInMs):e.derivedContentStartTimeInMs,i.oneofs&&(A._derivedContentStartTimeInMs="derivedContentStartTimeInMs")),e.overlapDurationInMs!=null&&e.hasOwnProperty("overlapDurationInMs")&&(typeof e.overlapDurationInMs=="number"?A.overlapDurationInMs=i.longs===String?String(e.overlapDurationInMs):e.overlapDurationInMs:A.overlapDurationInMs=i.longs===String?ge(e.overlapDurationInMs):i.longs===Number?ce(e.overlapDurationInMs):e.overlapDurationInMs,i.oneofs&&(A._overlapDurationInMs="overlapDurationInMs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EmbeddedMusic"},t})(),n.EncryptedPairingRequest=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.encryptedPayload=e.bytes();break}case 2:{s.iv=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EncryptedPairingRequest)return e;var i=new d.proto.EncryptedPairingRequest;return e.encryptedPayload!=null&&(typeof e.encryptedPayload=="string"?l.base64.decode(e.encryptedPayload,i.encryptedPayload=l.newBuffer(l.base64.length(e.encryptedPayload)),0):e.encryptedPayload.length>=0&&(i.encryptedPayload=e.encryptedPayload)),e.iv!=null&&(typeof e.iv=="string"?l.base64.decode(e.iv,i.iv=l.newBuffer(l.base64.length(e.iv)),0):e.iv.length>=0&&(i.iv=e.iv)),i},t.toObject=function(e,i){i||(i={});var A={};return e.encryptedPayload!=null&&e.hasOwnProperty("encryptedPayload")&&(A.encryptedPayload=i.bytes===String?l.base64.encode(e.encryptedPayload,0,e.encryptedPayload.length):i.bytes===Array?Array.prototype.slice.call(e.encryptedPayload):e.encryptedPayload,i.oneofs&&(A._encryptedPayload="encryptedPayload")),e.iv!=null&&e.hasOwnProperty("iv")&&(A.iv=i.bytes===String?l.base64.encode(e.iv,0,e.iv.length):i.bytes===Array?Array.prototype.slice.call(e.iv):e.iv,i.oneofs&&(A._iv="iv")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EncryptedPairingRequest"},t})(),n.EphemeralSetting=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.duration=e.sfixed32();break}case 2:{s.timestamp=e.sfixed64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EphemeralSetting)return e;var i=new d.proto.EphemeralSetting;return e.duration!=null&&(i.duration=e.duration|0),e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.duration!=null&&e.hasOwnProperty("duration")&&(A.duration=e.duration,i.oneofs&&(A._duration="duration")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=i.longs===String?String(e.timestamp):e.timestamp:A.timestamp=i.longs===String?ge(e.timestamp):i.longs===Number?ce(e.timestamp):e.timestamp,i.oneofs&&(A._timestamp="timestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EphemeralSetting"},t})(),n.EventAdditionalMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.isStale=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EventAdditionalMetadata)return e;var i=new d.proto.EventAdditionalMetadata;return e.isStale!=null&&(i.isStale=!!e.isStale),i},t.toObject=function(e,i){i||(i={});var A={};return e.isStale!=null&&e.hasOwnProperty("isStale")&&(A.isStale=e.isStale,i.oneofs&&(A._isStale="isStale")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EventAdditionalMetadata"},t})(),n.EventResponse=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.eventResponseMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.timestampMs=e.int64();break}case 3:{s.eventResponseMessage=d.proto.Message.EventResponseMessage.decode(e,e.uint32());break}case 4:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.EventResponse)return e;var i=new d.proto.EventResponse;if(e.eventResponseMessageKey!=null){if(typeof e.eventResponseMessageKey!="object")throw TypeError(".proto.EventResponse.eventResponseMessageKey: object expected");i.eventResponseMessageKey=d.proto.MessageKey.fromObject(e.eventResponseMessageKey)}if(e.timestampMs!=null&&(l.Long?(i.timestampMs=l.Long.fromValue(e.timestampMs)).unsigned=!1:typeof e.timestampMs=="string"?i.timestampMs=parseInt(e.timestampMs,10):typeof e.timestampMs=="number"?i.timestampMs=e.timestampMs:typeof e.timestampMs=="object"&&(i.timestampMs=new l.LongBits(e.timestampMs.low>>>0,e.timestampMs.high>>>0).toNumber())),e.eventResponseMessage!=null){if(typeof e.eventResponseMessage!="object")throw TypeError(".proto.EventResponse.eventResponseMessage: object expected");i.eventResponseMessage=d.proto.Message.EventResponseMessage.fromObject(e.eventResponseMessage)}return e.unread!=null&&(i.unread=!!e.unread),i},t.toObject=function(e,i){i||(i={});var A={};return e.eventResponseMessageKey!=null&&e.hasOwnProperty("eventResponseMessageKey")&&(A.eventResponseMessageKey=d.proto.MessageKey.toObject(e.eventResponseMessageKey,i),i.oneofs&&(A._eventResponseMessageKey="eventResponseMessageKey")),e.timestampMs!=null&&e.hasOwnProperty("timestampMs")&&(typeof e.timestampMs=="number"?A.timestampMs=i.longs===String?String(e.timestampMs):e.timestampMs:A.timestampMs=i.longs===String?ge(e.timestampMs):i.longs===Number?ce(e.timestampMs):e.timestampMs,i.oneofs&&(A._timestampMs="timestampMs")),e.eventResponseMessage!=null&&e.hasOwnProperty("eventResponseMessage")&&(A.eventResponseMessage=d.proto.Message.EventResponseMessage.toObject(e.eventResponseMessage,i),i.oneofs&&(A._eventResponseMessage="eventResponseMessage")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,i.oneofs&&(A._unread="unread")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.EventResponse"},t})(),n.ExitCode=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.code=e.uint64();break}case 2:{s.text=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ExitCode)return e;var i=new d.proto.ExitCode;return e.code!=null&&(l.Long?(i.code=l.Long.fromValue(e.code)).unsigned=!0:typeof e.code=="string"?i.code=parseInt(e.code,10):typeof e.code=="number"?i.code=e.code:typeof e.code=="object"&&(i.code=new l.LongBits(e.code.low>>>0,e.code.high>>>0).toNumber(!0))),e.text!=null&&(i.text=String(e.text)),i},t.toObject=function(e,i){i||(i={});var A={};return e.code!=null&&e.hasOwnProperty("code")&&(typeof e.code=="number"?A.code=i.longs===String?String(e.code):e.code:A.code=i.longs===String?ge(e.code,!0):i.longs===Number?ce(e.code,!0):e.code,i.oneofs&&(A._code="code")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,i.oneofs&&(A._text="text")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ExitCode"},t})(),n.ExternalBlobReference=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.mediaKey=e.bytes();break}case 2:{s.directPath=e.string();break}case 3:{s.handle=e.string();break}case 4:{s.fileSizeBytes=e.uint64();break}case 5:{s.fileSha256=e.bytes();break}case 6:{s.fileEncSha256=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ExternalBlobReference)return e;var i=new d.proto.ExternalBlobReference;return e.mediaKey!=null&&(typeof e.mediaKey=="string"?l.base64.decode(e.mediaKey,i.mediaKey=l.newBuffer(l.base64.length(e.mediaKey)),0):e.mediaKey.length>=0&&(i.mediaKey=e.mediaKey)),e.directPath!=null&&(i.directPath=String(e.directPath)),e.handle!=null&&(i.handle=String(e.handle)),e.fileSizeBytes!=null&&(l.Long?(i.fileSizeBytes=l.Long.fromValue(e.fileSizeBytes)).unsigned=!0:typeof e.fileSizeBytes=="string"?i.fileSizeBytes=parseInt(e.fileSizeBytes,10):typeof e.fileSizeBytes=="number"?i.fileSizeBytes=e.fileSizeBytes:typeof e.fileSizeBytes=="object"&&(i.fileSizeBytes=new l.LongBits(e.fileSizeBytes.low>>>0,e.fileSizeBytes.high>>>0).toNumber(!0))),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,i.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(i.fileSha256=e.fileSha256)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,i.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(i.fileEncSha256=e.fileEncSha256)),i},t.toObject=function(e,i){i||(i={});var A={};return e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=i.bytes===String?l.base64.encode(e.mediaKey,0,e.mediaKey.length):i.bytes===Array?Array.prototype.slice.call(e.mediaKey):e.mediaKey,i.oneofs&&(A._mediaKey="mediaKey")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,i.oneofs&&(A._directPath="directPath")),e.handle!=null&&e.hasOwnProperty("handle")&&(A.handle=e.handle,i.oneofs&&(A._handle="handle")),e.fileSizeBytes!=null&&e.hasOwnProperty("fileSizeBytes")&&(typeof e.fileSizeBytes=="number"?A.fileSizeBytes=i.longs===String?String(e.fileSizeBytes):e.fileSizeBytes:A.fileSizeBytes=i.longs===String?ge(e.fileSizeBytes,!0):i.longs===Number?ce(e.fileSizeBytes,!0):e.fileSizeBytes,i.oneofs&&(A._fileSizeBytes="fileSizeBytes")),e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=i.bytes===String?l.base64.encode(e.fileSha256,0,e.fileSha256.length):i.bytes===Array?Array.prototype.slice.call(e.fileSha256):e.fileSha256,i.oneofs&&(A._fileSha256="fileSha256")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=i.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):i.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,i.oneofs&&(A._fileEncSha256="fileEncSha256")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ExternalBlobReference"},t})(),n.Field=(function(){function t(a){if(this.subfield={},a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.minVersion=e.uint32();break}case 2:{s.maxVersion=e.uint32();break}case 3:{s.notReportableMinVersion=e.uint32();break}case 4:{s.isMessage=e.bool();break}case 5:{s.subfield===l.emptyObject&&(s.subfield={});var p=e.uint32()+e.pos;for(g=0,c=null;e.pos>>3){case 1:g=e.uint32();break;case 2:c=d.proto.Field.decode(e,e.uint32());break;default:e.skipType(B&7);break}}s.subfield[g]=c;break}default:e.skipType(I&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Field)return e;var i=new d.proto.Field;if(e.minVersion!=null&&(i.minVersion=e.minVersion>>>0),e.maxVersion!=null&&(i.maxVersion=e.maxVersion>>>0),e.notReportableMinVersion!=null&&(i.notReportableMinVersion=e.notReportableMinVersion>>>0),e.isMessage!=null&&(i.isMessage=!!e.isMessage),e.subfield){if(typeof e.subfield!="object")throw TypeError(".proto.Field.subfield: object expected");i.subfield={};for(var A=Object.keys(e.subfield),r=0;r>>3){case 1:{s.botName=e.string();break}case 2:{s.botJid=e.string();break}case 3:{s.creatorName=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ForwardedAIBotMessageInfo)return e;var i=new d.proto.ForwardedAIBotMessageInfo;return e.botName!=null&&(i.botName=String(e.botName)),e.botJid!=null&&(i.botJid=String(e.botJid)),e.creatorName!=null&&(i.creatorName=String(e.creatorName)),i},t.toObject=function(e,i){i||(i={});var A={};return e.botName!=null&&e.hasOwnProperty("botName")&&(A.botName=e.botName,i.oneofs&&(A._botName="botName")),e.botJid!=null&&e.hasOwnProperty("botJid")&&(A.botJid=e.botJid,i.oneofs&&(A._botJid="botJid")),e.creatorName!=null&&e.hasOwnProperty("creatorName")&&(A.creatorName=e.creatorName,i.oneofs&&(A._creatorName="creatorName")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ForwardedAIBotMessageInfo"},t})(),n.GlobalSettings=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.lightThemeWallpaper=d.proto.WallpaperSettings.decode(e,e.uint32());break}case 2:{s.mediaVisibility=e.int32();break}case 3:{s.darkThemeWallpaper=d.proto.WallpaperSettings.decode(e,e.uint32());break}case 4:{s.autoDownloadWiFi=d.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 5:{s.autoDownloadCellular=d.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 6:{s.autoDownloadRoaming=d.proto.AutoDownloadSettings.decode(e,e.uint32());break}case 7:{s.showIndividualNotificationsPreview=e.bool();break}case 8:{s.showGroupNotificationsPreview=e.bool();break}case 9:{s.disappearingModeDuration=e.int32();break}case 10:{s.disappearingModeTimestamp=e.int64();break}case 11:{s.avatarUserSettings=d.proto.AvatarUserSettings.decode(e,e.uint32());break}case 12:{s.fontSize=e.int32();break}case 13:{s.securityNotifications=e.bool();break}case 14:{s.autoUnarchiveChats=e.bool();break}case 15:{s.videoQualityMode=e.int32();break}case 16:{s.photoQualityMode=e.int32();break}case 17:{s.individualNotificationSettings=d.proto.NotificationSettings.decode(e,e.uint32());break}case 18:{s.groupNotificationSettings=d.proto.NotificationSettings.decode(e,e.uint32());break}case 19:{s.chatLockSettings=d.proto.ChatLockSettings.decode(e,e.uint32());break}case 20:{s.chatDbLidMigrationTimestamp=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.GlobalSettings)return e;var i=new d.proto.GlobalSettings;if(e.lightThemeWallpaper!=null){if(typeof e.lightThemeWallpaper!="object")throw TypeError(".proto.GlobalSettings.lightThemeWallpaper: object expected");i.lightThemeWallpaper=d.proto.WallpaperSettings.fromObject(e.lightThemeWallpaper)}switch(e.mediaVisibility){default:if(typeof e.mediaVisibility=="number"){i.mediaVisibility=e.mediaVisibility;break}break;case"DEFAULT":case 0:i.mediaVisibility=0;break;case"OFF":case 1:i.mediaVisibility=1;break;case"ON":case 2:i.mediaVisibility=2;break}if(e.darkThemeWallpaper!=null){if(typeof e.darkThemeWallpaper!="object")throw TypeError(".proto.GlobalSettings.darkThemeWallpaper: object expected");i.darkThemeWallpaper=d.proto.WallpaperSettings.fromObject(e.darkThemeWallpaper)}if(e.autoDownloadWiFi!=null){if(typeof e.autoDownloadWiFi!="object")throw TypeError(".proto.GlobalSettings.autoDownloadWiFi: object expected");i.autoDownloadWiFi=d.proto.AutoDownloadSettings.fromObject(e.autoDownloadWiFi)}if(e.autoDownloadCellular!=null){if(typeof e.autoDownloadCellular!="object")throw TypeError(".proto.GlobalSettings.autoDownloadCellular: object expected");i.autoDownloadCellular=d.proto.AutoDownloadSettings.fromObject(e.autoDownloadCellular)}if(e.autoDownloadRoaming!=null){if(typeof e.autoDownloadRoaming!="object")throw TypeError(".proto.GlobalSettings.autoDownloadRoaming: object expected");i.autoDownloadRoaming=d.proto.AutoDownloadSettings.fromObject(e.autoDownloadRoaming)}if(e.showIndividualNotificationsPreview!=null&&(i.showIndividualNotificationsPreview=!!e.showIndividualNotificationsPreview),e.showGroupNotificationsPreview!=null&&(i.showGroupNotificationsPreview=!!e.showGroupNotificationsPreview),e.disappearingModeDuration!=null&&(i.disappearingModeDuration=e.disappearingModeDuration|0),e.disappearingModeTimestamp!=null&&(l.Long?(i.disappearingModeTimestamp=l.Long.fromValue(e.disappearingModeTimestamp)).unsigned=!1:typeof e.disappearingModeTimestamp=="string"?i.disappearingModeTimestamp=parseInt(e.disappearingModeTimestamp,10):typeof e.disappearingModeTimestamp=="number"?i.disappearingModeTimestamp=e.disappearingModeTimestamp:typeof e.disappearingModeTimestamp=="object"&&(i.disappearingModeTimestamp=new l.LongBits(e.disappearingModeTimestamp.low>>>0,e.disappearingModeTimestamp.high>>>0).toNumber())),e.avatarUserSettings!=null){if(typeof e.avatarUserSettings!="object")throw TypeError(".proto.GlobalSettings.avatarUserSettings: object expected");i.avatarUserSettings=d.proto.AvatarUserSettings.fromObject(e.avatarUserSettings)}if(e.fontSize!=null&&(i.fontSize=e.fontSize|0),e.securityNotifications!=null&&(i.securityNotifications=!!e.securityNotifications),e.autoUnarchiveChats!=null&&(i.autoUnarchiveChats=!!e.autoUnarchiveChats),e.videoQualityMode!=null&&(i.videoQualityMode=e.videoQualityMode|0),e.photoQualityMode!=null&&(i.photoQualityMode=e.photoQualityMode|0),e.individualNotificationSettings!=null){if(typeof e.individualNotificationSettings!="object")throw TypeError(".proto.GlobalSettings.individualNotificationSettings: object expected");i.individualNotificationSettings=d.proto.NotificationSettings.fromObject(e.individualNotificationSettings)}if(e.groupNotificationSettings!=null){if(typeof e.groupNotificationSettings!="object")throw TypeError(".proto.GlobalSettings.groupNotificationSettings: object expected");i.groupNotificationSettings=d.proto.NotificationSettings.fromObject(e.groupNotificationSettings)}if(e.chatLockSettings!=null){if(typeof e.chatLockSettings!="object")throw TypeError(".proto.GlobalSettings.chatLockSettings: object expected");i.chatLockSettings=d.proto.ChatLockSettings.fromObject(e.chatLockSettings)}return e.chatDbLidMigrationTimestamp!=null&&(l.Long?(i.chatDbLidMigrationTimestamp=l.Long.fromValue(e.chatDbLidMigrationTimestamp)).unsigned=!1:typeof e.chatDbLidMigrationTimestamp=="string"?i.chatDbLidMigrationTimestamp=parseInt(e.chatDbLidMigrationTimestamp,10):typeof e.chatDbLidMigrationTimestamp=="number"?i.chatDbLidMigrationTimestamp=e.chatDbLidMigrationTimestamp:typeof e.chatDbLidMigrationTimestamp=="object"&&(i.chatDbLidMigrationTimestamp=new l.LongBits(e.chatDbLidMigrationTimestamp.low>>>0,e.chatDbLidMigrationTimestamp.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.lightThemeWallpaper!=null&&e.hasOwnProperty("lightThemeWallpaper")&&(A.lightThemeWallpaper=d.proto.WallpaperSettings.toObject(e.lightThemeWallpaper,i),i.oneofs&&(A._lightThemeWallpaper="lightThemeWallpaper")),e.mediaVisibility!=null&&e.hasOwnProperty("mediaVisibility")&&(A.mediaVisibility=i.enums===String?d.proto.MediaVisibility[e.mediaVisibility]===void 0?e.mediaVisibility:d.proto.MediaVisibility[e.mediaVisibility]:e.mediaVisibility,i.oneofs&&(A._mediaVisibility="mediaVisibility")),e.darkThemeWallpaper!=null&&e.hasOwnProperty("darkThemeWallpaper")&&(A.darkThemeWallpaper=d.proto.WallpaperSettings.toObject(e.darkThemeWallpaper,i),i.oneofs&&(A._darkThemeWallpaper="darkThemeWallpaper")),e.autoDownloadWiFi!=null&&e.hasOwnProperty("autoDownloadWiFi")&&(A.autoDownloadWiFi=d.proto.AutoDownloadSettings.toObject(e.autoDownloadWiFi,i),i.oneofs&&(A._autoDownloadWiFi="autoDownloadWiFi")),e.autoDownloadCellular!=null&&e.hasOwnProperty("autoDownloadCellular")&&(A.autoDownloadCellular=d.proto.AutoDownloadSettings.toObject(e.autoDownloadCellular,i),i.oneofs&&(A._autoDownloadCellular="autoDownloadCellular")),e.autoDownloadRoaming!=null&&e.hasOwnProperty("autoDownloadRoaming")&&(A.autoDownloadRoaming=d.proto.AutoDownloadSettings.toObject(e.autoDownloadRoaming,i),i.oneofs&&(A._autoDownloadRoaming="autoDownloadRoaming")),e.showIndividualNotificationsPreview!=null&&e.hasOwnProperty("showIndividualNotificationsPreview")&&(A.showIndividualNotificationsPreview=e.showIndividualNotificationsPreview,i.oneofs&&(A._showIndividualNotificationsPreview="showIndividualNotificationsPreview")),e.showGroupNotificationsPreview!=null&&e.hasOwnProperty("showGroupNotificationsPreview")&&(A.showGroupNotificationsPreview=e.showGroupNotificationsPreview,i.oneofs&&(A._showGroupNotificationsPreview="showGroupNotificationsPreview")),e.disappearingModeDuration!=null&&e.hasOwnProperty("disappearingModeDuration")&&(A.disappearingModeDuration=e.disappearingModeDuration,i.oneofs&&(A._disappearingModeDuration="disappearingModeDuration")),e.disappearingModeTimestamp!=null&&e.hasOwnProperty("disappearingModeTimestamp")&&(typeof e.disappearingModeTimestamp=="number"?A.disappearingModeTimestamp=i.longs===String?String(e.disappearingModeTimestamp):e.disappearingModeTimestamp:A.disappearingModeTimestamp=i.longs===String?ge(e.disappearingModeTimestamp):i.longs===Number?ce(e.disappearingModeTimestamp):e.disappearingModeTimestamp,i.oneofs&&(A._disappearingModeTimestamp="disappearingModeTimestamp")),e.avatarUserSettings!=null&&e.hasOwnProperty("avatarUserSettings")&&(A.avatarUserSettings=d.proto.AvatarUserSettings.toObject(e.avatarUserSettings,i),i.oneofs&&(A._avatarUserSettings="avatarUserSettings")),e.fontSize!=null&&e.hasOwnProperty("fontSize")&&(A.fontSize=e.fontSize,i.oneofs&&(A._fontSize="fontSize")),e.securityNotifications!=null&&e.hasOwnProperty("securityNotifications")&&(A.securityNotifications=e.securityNotifications,i.oneofs&&(A._securityNotifications="securityNotifications")),e.autoUnarchiveChats!=null&&e.hasOwnProperty("autoUnarchiveChats")&&(A.autoUnarchiveChats=e.autoUnarchiveChats,i.oneofs&&(A._autoUnarchiveChats="autoUnarchiveChats")),e.videoQualityMode!=null&&e.hasOwnProperty("videoQualityMode")&&(A.videoQualityMode=e.videoQualityMode,i.oneofs&&(A._videoQualityMode="videoQualityMode")),e.photoQualityMode!=null&&e.hasOwnProperty("photoQualityMode")&&(A.photoQualityMode=e.photoQualityMode,i.oneofs&&(A._photoQualityMode="photoQualityMode")),e.individualNotificationSettings!=null&&e.hasOwnProperty("individualNotificationSettings")&&(A.individualNotificationSettings=d.proto.NotificationSettings.toObject(e.individualNotificationSettings,i),i.oneofs&&(A._individualNotificationSettings="individualNotificationSettings")),e.groupNotificationSettings!=null&&e.hasOwnProperty("groupNotificationSettings")&&(A.groupNotificationSettings=d.proto.NotificationSettings.toObject(e.groupNotificationSettings,i),i.oneofs&&(A._groupNotificationSettings="groupNotificationSettings")),e.chatLockSettings!=null&&e.hasOwnProperty("chatLockSettings")&&(A.chatLockSettings=d.proto.ChatLockSettings.toObject(e.chatLockSettings,i),i.oneofs&&(A._chatLockSettings="chatLockSettings")),e.chatDbLidMigrationTimestamp!=null&&e.hasOwnProperty("chatDbLidMigrationTimestamp")&&(typeof e.chatDbLidMigrationTimestamp=="number"?A.chatDbLidMigrationTimestamp=i.longs===String?String(e.chatDbLidMigrationTimestamp):e.chatDbLidMigrationTimestamp:A.chatDbLidMigrationTimestamp=i.longs===String?ge(e.chatDbLidMigrationTimestamp):i.longs===Number?ce(e.chatDbLidMigrationTimestamp):e.chatDbLidMigrationTimestamp,i.oneofs&&(A._chatDbLidMigrationTimestamp="chatDbLidMigrationTimestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GlobalSettings"},t})(),n.GroupHistoryBundleInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.deprecatedMessageHistoryBundle=d.proto.Message.MessageHistoryBundle.decode(e,e.uint32());break}case 2:{s.processState=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.GroupHistoryBundleInfo)return e;var i=new d.proto.GroupHistoryBundleInfo;if(e.deprecatedMessageHistoryBundle!=null){if(typeof e.deprecatedMessageHistoryBundle!="object")throw TypeError(".proto.GroupHistoryBundleInfo.deprecatedMessageHistoryBundle: object expected");i.deprecatedMessageHistoryBundle=d.proto.Message.MessageHistoryBundle.fromObject(e.deprecatedMessageHistoryBundle)}switch(e.processState){default:if(typeof e.processState=="number"){i.processState=e.processState;break}break;case"NOT_INJECTED":case 0:i.processState=0;break;case"INJECTED":case 1:i.processState=1;break;case"INJECTED_PARTIAL":case 2:i.processState=2;break;case"INJECTION_FAILED":case 3:i.processState=3;break;case"INJECTION_FAILED_NO_RETRY":case 4:i.processState=4;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.deprecatedMessageHistoryBundle!=null&&e.hasOwnProperty("deprecatedMessageHistoryBundle")&&(A.deprecatedMessageHistoryBundle=d.proto.Message.MessageHistoryBundle.toObject(e.deprecatedMessageHistoryBundle,i),i.oneofs&&(A._deprecatedMessageHistoryBundle="deprecatedMessageHistoryBundle")),e.processState!=null&&e.hasOwnProperty("processState")&&(A.processState=i.enums===String?d.proto.GroupHistoryBundleInfo.ProcessState[e.processState]===void 0?e.processState:d.proto.GroupHistoryBundleInfo.ProcessState[e.processState]:e.processState,i.oneofs&&(A._processState="processState")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupHistoryBundleInfo"},t.ProcessState=(function(){let a={},e=Object.create(a);return e[a[0]="NOT_INJECTED"]=0,e[a[1]="INJECTED"]=1,e[a[2]="INJECTED_PARTIAL"]=2,e[a[3]="INJECTION_FAILED"]=3,e[a[4]="INJECTION_FAILED_NO_RETRY"]=4,e})(),t})(),n.GroupHistoryIndividualMessageInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.bundleMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.editedAfterReceivedAsHistory=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.GroupHistoryIndividualMessageInfo)return e;var i=new d.proto.GroupHistoryIndividualMessageInfo;if(e.bundleMessageKey!=null){if(typeof e.bundleMessageKey!="object")throw TypeError(".proto.GroupHistoryIndividualMessageInfo.bundleMessageKey: object expected");i.bundleMessageKey=d.proto.MessageKey.fromObject(e.bundleMessageKey)}return e.editedAfterReceivedAsHistory!=null&&(i.editedAfterReceivedAsHistory=!!e.editedAfterReceivedAsHistory),i},t.toObject=function(e,i){i||(i={});var A={};return e.bundleMessageKey!=null&&e.hasOwnProperty("bundleMessageKey")&&(A.bundleMessageKey=d.proto.MessageKey.toObject(e.bundleMessageKey,i),i.oneofs&&(A._bundleMessageKey="bundleMessageKey")),e.editedAfterReceivedAsHistory!=null&&e.hasOwnProperty("editedAfterReceivedAsHistory")&&(A.editedAfterReceivedAsHistory=e.editedAfterReceivedAsHistory,i.oneofs&&(A._editedAfterReceivedAsHistory="editedAfterReceivedAsHistory")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupHistoryIndividualMessageInfo"},t})(),n.GroupMention=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.groupJid=e.string();break}case 2:{s.groupSubject=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.GroupMention)return e;var i=new d.proto.GroupMention;return e.groupJid!=null&&(i.groupJid=String(e.groupJid)),e.groupSubject!=null&&(i.groupSubject=String(e.groupSubject)),i},t.toObject=function(e,i){i||(i={});var A={};return e.groupJid!=null&&e.hasOwnProperty("groupJid")&&(A.groupJid=e.groupJid,i.oneofs&&(A._groupJid="groupJid")),e.groupSubject!=null&&e.hasOwnProperty("groupSubject")&&(A.groupSubject=e.groupSubject,i.oneofs&&(A._groupSubject="groupSubject")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupMention"},t})(),n.GroupParticipant=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.userJid=e.string();break}case 2:{s.rank=e.int32();break}case 3:{s.memberLabel=d.proto.MemberLabel.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.GroupParticipant)return e;var i=new d.proto.GroupParticipant;switch(e.userJid!=null&&(i.userJid=String(e.userJid)),e.rank){default:if(typeof e.rank=="number"){i.rank=e.rank;break}break;case"REGULAR":case 0:i.rank=0;break;case"ADMIN":case 1:i.rank=1;break;case"SUPERADMIN":case 2:i.rank=2;break}if(e.memberLabel!=null){if(typeof e.memberLabel!="object")throw TypeError(".proto.GroupParticipant.memberLabel: object expected");i.memberLabel=d.proto.MemberLabel.fromObject(e.memberLabel)}return i},t.toObject=function(e,i){i||(i={});var A={};return i.defaults&&(A.userJid=""),e.userJid!=null&&e.hasOwnProperty("userJid")&&(A.userJid=e.userJid),e.rank!=null&&e.hasOwnProperty("rank")&&(A.rank=i.enums===String?d.proto.GroupParticipant.Rank[e.rank]===void 0?e.rank:d.proto.GroupParticipant.Rank[e.rank]:e.rank,i.oneofs&&(A._rank="rank")),e.memberLabel!=null&&e.hasOwnProperty("memberLabel")&&(A.memberLabel=d.proto.MemberLabel.toObject(e.memberLabel,i),i.oneofs&&(A._memberLabel="memberLabel")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.GroupParticipant"},t.Rank=(function(){let a={},e=Object.create(a);return e[a[0]="REGULAR"]=0,e[a[1]="ADMIN"]=1,e[a[2]="SUPERADMIN"]=2,e})(),t})(),n.HandshakeMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 2:{s.clientHello=d.proto.HandshakeMessage.ClientHello.decode(e,e.uint32());break}case 3:{s.serverHello=d.proto.HandshakeMessage.ServerHello.decode(e,e.uint32());break}case 4:{s.clientFinish=d.proto.HandshakeMessage.ClientFinish.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.HandshakeMessage)return e;var i=new d.proto.HandshakeMessage;if(e.clientHello!=null){if(typeof e.clientHello!="object")throw TypeError(".proto.HandshakeMessage.clientHello: object expected");i.clientHello=d.proto.HandshakeMessage.ClientHello.fromObject(e.clientHello)}if(e.serverHello!=null){if(typeof e.serverHello!="object")throw TypeError(".proto.HandshakeMessage.serverHello: object expected");i.serverHello=d.proto.HandshakeMessage.ServerHello.fromObject(e.serverHello)}if(e.clientFinish!=null){if(typeof e.clientFinish!="object")throw TypeError(".proto.HandshakeMessage.clientFinish: object expected");i.clientFinish=d.proto.HandshakeMessage.ClientFinish.fromObject(e.clientFinish)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.clientHello!=null&&e.hasOwnProperty("clientHello")&&(A.clientHello=d.proto.HandshakeMessage.ClientHello.toObject(e.clientHello,i),i.oneofs&&(A._clientHello="clientHello")),e.serverHello!=null&&e.hasOwnProperty("serverHello")&&(A.serverHello=d.proto.HandshakeMessage.ServerHello.toObject(e.serverHello,i),i.oneofs&&(A._serverHello="serverHello")),e.clientFinish!=null&&e.hasOwnProperty("clientFinish")&&(A.clientFinish=d.proto.HandshakeMessage.ClientFinish.toObject(e.clientFinish,i),i.oneofs&&(A._clientFinish="clientFinish")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HandshakeMessage"},t.ClientFinish=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.static=A.bytes();break}case 2:{c.payload=A.bytes();break}case 3:{c.extendedCiphertext=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.HandshakeMessage.ClientFinish)return A;var r=new d.proto.HandshakeMessage.ClientFinish;return A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,r.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(r.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,r.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(r.payload=A.payload)),A.extendedCiphertext!=null&&(typeof A.extendedCiphertext=="string"?l.base64.decode(A.extendedCiphertext,r.extendedCiphertext=l.newBuffer(l.base64.length(A.extendedCiphertext)),0):A.extendedCiphertext.length>=0&&(r.extendedCiphertext=A.extendedCiphertext)),r},a.toObject=function(A,r){r||(r={});var s={};return A.static!=null&&A.hasOwnProperty("static")&&(s.static=r.bytes===String?l.base64.encode(A.static,0,A.static.length):r.bytes===Array?Array.prototype.slice.call(A.static):A.static,r.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=r.bytes===String?l.base64.encode(A.payload,0,A.payload.length):r.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,r.oneofs&&(s._payload="payload")),A.extendedCiphertext!=null&&A.hasOwnProperty("extendedCiphertext")&&(s.extendedCiphertext=r.bytes===String?l.base64.encode(A.extendedCiphertext,0,A.extendedCiphertext.length):r.bytes===Array?Array.prototype.slice.call(A.extendedCiphertext):A.extendedCiphertext,r.oneofs&&(s._extendedCiphertext="extendedCiphertext")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ClientFinish"},a})(),t.ClientHello=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.ephemeral=A.bytes();break}case 2:{c.static=A.bytes();break}case 3:{c.payload=A.bytes();break}case 4:{c.useExtended=A.bool();break}case 5:{c.extendedCiphertext=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.HandshakeMessage.ClientHello)return A;var r=new d.proto.HandshakeMessage.ClientHello;return A.ephemeral!=null&&(typeof A.ephemeral=="string"?l.base64.decode(A.ephemeral,r.ephemeral=l.newBuffer(l.base64.length(A.ephemeral)),0):A.ephemeral.length>=0&&(r.ephemeral=A.ephemeral)),A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,r.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(r.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,r.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(r.payload=A.payload)),A.useExtended!=null&&(r.useExtended=!!A.useExtended),A.extendedCiphertext!=null&&(typeof A.extendedCiphertext=="string"?l.base64.decode(A.extendedCiphertext,r.extendedCiphertext=l.newBuffer(l.base64.length(A.extendedCiphertext)),0):A.extendedCiphertext.length>=0&&(r.extendedCiphertext=A.extendedCiphertext)),r},a.toObject=function(A,r){r||(r={});var s={};return A.ephemeral!=null&&A.hasOwnProperty("ephemeral")&&(s.ephemeral=r.bytes===String?l.base64.encode(A.ephemeral,0,A.ephemeral.length):r.bytes===Array?Array.prototype.slice.call(A.ephemeral):A.ephemeral,r.oneofs&&(s._ephemeral="ephemeral")),A.static!=null&&A.hasOwnProperty("static")&&(s.static=r.bytes===String?l.base64.encode(A.static,0,A.static.length):r.bytes===Array?Array.prototype.slice.call(A.static):A.static,r.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=r.bytes===String?l.base64.encode(A.payload,0,A.payload.length):r.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,r.oneofs&&(s._payload="payload")),A.useExtended!=null&&A.hasOwnProperty("useExtended")&&(s.useExtended=A.useExtended,r.oneofs&&(s._useExtended="useExtended")),A.extendedCiphertext!=null&&A.hasOwnProperty("extendedCiphertext")&&(s.extendedCiphertext=r.bytes===String?l.base64.encode(A.extendedCiphertext,0,A.extendedCiphertext.length):r.bytes===Array?Array.prototype.slice.call(A.extendedCiphertext):A.extendedCiphertext,r.oneofs&&(s._extendedCiphertext="extendedCiphertext")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ClientHello"},a})(),t.ServerHello=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.ephemeral=A.bytes();break}case 2:{c.static=A.bytes();break}case 3:{c.payload=A.bytes();break}case 4:{c.extendedStatic=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.HandshakeMessage.ServerHello)return A;var r=new d.proto.HandshakeMessage.ServerHello;return A.ephemeral!=null&&(typeof A.ephemeral=="string"?l.base64.decode(A.ephemeral,r.ephemeral=l.newBuffer(l.base64.length(A.ephemeral)),0):A.ephemeral.length>=0&&(r.ephemeral=A.ephemeral)),A.static!=null&&(typeof A.static=="string"?l.base64.decode(A.static,r.static=l.newBuffer(l.base64.length(A.static)),0):A.static.length>=0&&(r.static=A.static)),A.payload!=null&&(typeof A.payload=="string"?l.base64.decode(A.payload,r.payload=l.newBuffer(l.base64.length(A.payload)),0):A.payload.length>=0&&(r.payload=A.payload)),A.extendedStatic!=null&&(typeof A.extendedStatic=="string"?l.base64.decode(A.extendedStatic,r.extendedStatic=l.newBuffer(l.base64.length(A.extendedStatic)),0):A.extendedStatic.length>=0&&(r.extendedStatic=A.extendedStatic)),r},a.toObject=function(A,r){r||(r={});var s={};return A.ephemeral!=null&&A.hasOwnProperty("ephemeral")&&(s.ephemeral=r.bytes===String?l.base64.encode(A.ephemeral,0,A.ephemeral.length):r.bytes===Array?Array.prototype.slice.call(A.ephemeral):A.ephemeral,r.oneofs&&(s._ephemeral="ephemeral")),A.static!=null&&A.hasOwnProperty("static")&&(s.static=r.bytes===String?l.base64.encode(A.static,0,A.static.length):r.bytes===Array?Array.prototype.slice.call(A.static):A.static,r.oneofs&&(s._static="static")),A.payload!=null&&A.hasOwnProperty("payload")&&(s.payload=r.bytes===String?l.base64.encode(A.payload,0,A.payload.length):r.bytes===Array?Array.prototype.slice.call(A.payload):A.payload,r.oneofs&&(s._payload="payload")),A.extendedStatic!=null&&A.hasOwnProperty("extendedStatic")&&(s.extendedStatic=r.bytes===String?l.base64.encode(A.extendedStatic,0,A.extendedStatic.length):r.bytes===Array?Array.prototype.slice.call(A.extendedStatic):A.extendedStatic,r.oneofs&&(s._extendedStatic="extendedStatic")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HandshakeMessage.ServerHello"},a})(),t})(),n.HistorySync=(function(){function t(a){if(this.conversations=[],this.statusV3Messages=[],this.pushnames=[],this.recentStickers=[],this.pastParticipants=[],this.callLogRecords=[],this.phoneNumberToLidMappings=[],this.accounts=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.syncType=e.int32();break}case 2:{s.conversations&&s.conversations.length||(s.conversations=[]),s.conversations.push(d.proto.Conversation.decode(e,e.uint32()));break}case 3:{s.statusV3Messages&&s.statusV3Messages.length||(s.statusV3Messages=[]),s.statusV3Messages.push(d.proto.WebMessageInfo.decode(e,e.uint32()));break}case 5:{s.chunkOrder=e.uint32();break}case 6:{s.progress=e.uint32();break}case 7:{s.pushnames&&s.pushnames.length||(s.pushnames=[]),s.pushnames.push(d.proto.Pushname.decode(e,e.uint32()));break}case 8:{s.globalSettings=d.proto.GlobalSettings.decode(e,e.uint32());break}case 9:{s.threadIdUserSecret=e.bytes();break}case 10:{s.threadDsTimeframeOffset=e.uint32();break}case 11:{s.recentStickers&&s.recentStickers.length||(s.recentStickers=[]),s.recentStickers.push(d.proto.StickerMetadata.decode(e,e.uint32()));break}case 12:{s.pastParticipants&&s.pastParticipants.length||(s.pastParticipants=[]),s.pastParticipants.push(d.proto.PastParticipants.decode(e,e.uint32()));break}case 13:{s.callLogRecords&&s.callLogRecords.length||(s.callLogRecords=[]),s.callLogRecords.push(d.proto.CallLogRecord.decode(e,e.uint32()));break}case 14:{s.aiWaitListState=e.int32();break}case 15:{s.phoneNumberToLidMappings&&s.phoneNumberToLidMappings.length||(s.phoneNumberToLidMappings=[]),s.phoneNumberToLidMappings.push(d.proto.PhoneNumberToLIDMapping.decode(e,e.uint32()));break}case 16:{s.companionMetaNonce=e.string();break}case 17:{s.shareableChatIdentifierEncryptionKey=e.bytes();break}case 18:{s.accounts&&s.accounts.length||(s.accounts=[]),s.accounts.push(d.proto.Account.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.HistorySync)return e;var i=new d.proto.HistorySync;switch(e.syncType){default:if(typeof e.syncType=="number"){i.syncType=e.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:i.syncType=0;break;case"INITIAL_STATUS_V3":case 1:i.syncType=1;break;case"FULL":case 2:i.syncType=2;break;case"RECENT":case 3:i.syncType=3;break;case"PUSH_NAME":case 4:i.syncType=4;break;case"NON_BLOCKING_DATA":case 5:i.syncType=5;break;case"ON_DEMAND":case 6:i.syncType=6;break}if(e.conversations){if(!Array.isArray(e.conversations))throw TypeError(".proto.HistorySync.conversations: array expected");i.conversations=[];for(var A=0;A>>0),e.progress!=null&&(i.progress=e.progress>>>0),e.pushnames){if(!Array.isArray(e.pushnames))throw TypeError(".proto.HistorySync.pushnames: array expected");i.pushnames=[];for(var A=0;A=0&&(i.threadIdUserSecret=e.threadIdUserSecret)),e.threadDsTimeframeOffset!=null&&(i.threadDsTimeframeOffset=e.threadDsTimeframeOffset>>>0),e.recentStickers){if(!Array.isArray(e.recentStickers))throw TypeError(".proto.HistorySync.recentStickers: array expected");i.recentStickers=[];for(var A=0;A=0&&(i.shareableChatIdentifierEncryptionKey=e.shareableChatIdentifierEncryptionKey)),e.accounts){if(!Array.isArray(e.accounts))throw TypeError(".proto.HistorySync.accounts: array expected");i.accounts=[];for(var A=0;A>>3){case 1:{s.message=d.proto.WebMessageInfo.decode(e,e.uint32());break}case 2:{s.msgOrderId=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.HistorySyncMsg)return e;var i=new d.proto.HistorySyncMsg;if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.HistorySyncMsg.message: object expected");i.message=d.proto.WebMessageInfo.fromObject(e.message)}return e.msgOrderId!=null&&(l.Long?(i.msgOrderId=l.Long.fromValue(e.msgOrderId)).unsigned=!0:typeof e.msgOrderId=="string"?i.msgOrderId=parseInt(e.msgOrderId,10):typeof e.msgOrderId=="number"?i.msgOrderId=e.msgOrderId:typeof e.msgOrderId=="object"&&(i.msgOrderId=new l.LongBits(e.msgOrderId.low>>>0,e.msgOrderId.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};return e.message!=null&&e.hasOwnProperty("message")&&(A.message=d.proto.WebMessageInfo.toObject(e.message,i),i.oneofs&&(A._message="message")),e.msgOrderId!=null&&e.hasOwnProperty("msgOrderId")&&(typeof e.msgOrderId=="number"?A.msgOrderId=i.longs===String?String(e.msgOrderId):e.msgOrderId:A.msgOrderId=i.longs===String?ge(e.msgOrderId,!0):i.longs===Number?ce(e.msgOrderId,!0):e.msgOrderId,i.oneofs&&(A._msgOrderId="msgOrderId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HistorySyncMsg"},t})(),n.HydratedTemplateButton=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 4:{s.index=e.uint32();break}case 1:{s.quickReplyButton=d.proto.HydratedTemplateButton.HydratedQuickReplyButton.decode(e,e.uint32());break}case 2:{s.urlButton=d.proto.HydratedTemplateButton.HydratedURLButton.decode(e,e.uint32());break}case 3:{s.callButton=d.proto.HydratedTemplateButton.HydratedCallButton.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.HydratedTemplateButton)return e;var i=new d.proto.HydratedTemplateButton;if(e.index!=null&&(i.index=e.index>>>0),e.quickReplyButton!=null){if(typeof e.quickReplyButton!="object")throw TypeError(".proto.HydratedTemplateButton.quickReplyButton: object expected");i.quickReplyButton=d.proto.HydratedTemplateButton.HydratedQuickReplyButton.fromObject(e.quickReplyButton)}if(e.urlButton!=null){if(typeof e.urlButton!="object")throw TypeError(".proto.HydratedTemplateButton.urlButton: object expected");i.urlButton=d.proto.HydratedTemplateButton.HydratedURLButton.fromObject(e.urlButton)}if(e.callButton!=null){if(typeof e.callButton!="object")throw TypeError(".proto.HydratedTemplateButton.callButton: object expected");i.callButton=d.proto.HydratedTemplateButton.HydratedCallButton.fromObject(e.callButton)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.quickReplyButton!=null&&e.hasOwnProperty("quickReplyButton")&&(A.quickReplyButton=d.proto.HydratedTemplateButton.HydratedQuickReplyButton.toObject(e.quickReplyButton,i),i.oneofs&&(A.hydratedButton="quickReplyButton")),e.urlButton!=null&&e.hasOwnProperty("urlButton")&&(A.urlButton=d.proto.HydratedTemplateButton.HydratedURLButton.toObject(e.urlButton,i),i.oneofs&&(A.hydratedButton="urlButton")),e.callButton!=null&&e.hasOwnProperty("callButton")&&(A.callButton=d.proto.HydratedTemplateButton.HydratedCallButton.toObject(e.callButton,i),i.oneofs&&(A.hydratedButton="callButton")),e.index!=null&&e.hasOwnProperty("index")&&(A.index=e.index,i.oneofs&&(A._index="index")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.HydratedTemplateButton"},t.HydratedCallButton=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayText=A.string();break}case 2:{c.phoneNumber=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.HydratedTemplateButton.HydratedCallButton)return A;var r=new d.proto.HydratedTemplateButton.HydratedCallButton;return A.displayText!=null&&(r.displayText=String(A.displayText)),A.phoneNumber!=null&&(r.phoneNumber=String(A.phoneNumber)),r},a.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,r.oneofs&&(s._displayText="displayText")),A.phoneNumber!=null&&A.hasOwnProperty("phoneNumber")&&(s.phoneNumber=A.phoneNumber,r.oneofs&&(s._phoneNumber="phoneNumber")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedCallButton"},a})(),t.HydratedQuickReplyButton=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayText=A.string();break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.HydratedTemplateButton.HydratedQuickReplyButton)return A;var r=new d.proto.HydratedTemplateButton.HydratedQuickReplyButton;return A.displayText!=null&&(r.displayText=String(A.displayText)),A.id!=null&&(r.id=String(A.id)),r},a.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,r.oneofs&&(s._displayText="displayText")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedQuickReplyButton"},a})(),t.HydratedURLButton=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayText=A.string();break}case 2:{c.url=A.string();break}case 3:{c.consentedUsersUrl=A.string();break}case 4:{c.webviewPresentation=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.HydratedTemplateButton.HydratedURLButton)return A;var r=new d.proto.HydratedTemplateButton.HydratedURLButton;switch(A.displayText!=null&&(r.displayText=String(A.displayText)),A.url!=null&&(r.url=String(A.url)),A.consentedUsersUrl!=null&&(r.consentedUsersUrl=String(A.consentedUsersUrl)),A.webviewPresentation){default:if(typeof A.webviewPresentation=="number"){r.webviewPresentation=A.webviewPresentation;break}break;case"FULL":case 1:r.webviewPresentation=1;break;case"TALL":case 2:r.webviewPresentation=2;break;case"COMPACT":case 3:r.webviewPresentation=3;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=A.displayText,r.oneofs&&(s._displayText="displayText")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.consentedUsersUrl!=null&&A.hasOwnProperty("consentedUsersUrl")&&(s.consentedUsersUrl=A.consentedUsersUrl,r.oneofs&&(s._consentedUsersUrl="consentedUsersUrl")),A.webviewPresentation!=null&&A.hasOwnProperty("webviewPresentation")&&(s.webviewPresentation=r.enums===String?d.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[A.webviewPresentation]===void 0?A.webviewPresentation:d.proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType[A.webviewPresentation]:A.webviewPresentation,r.oneofs&&(s._webviewPresentation="webviewPresentation")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.HydratedTemplateButton.HydratedURLButton"},a.WebviewPresentationType=(function(){let i={},A=Object.create(i);return A[i[1]="FULL"]=1,A[i[2]="TALL"]=2,A[i[3]="COMPACT"]=3,A})(),a})(),t})(),n.IdentityKeyPairStructure=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.privateKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.IdentityKeyPairStructure)return e;var i=new d.proto.IdentityKeyPairStructure;return e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,i.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(i.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,i.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(i.privateKey=e.privateKey)),i},t.toObject=function(e,i){i||(i={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=i.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):i.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,i.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=i.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):i.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,i.oneofs&&(A._privateKey="privateKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.IdentityKeyPairStructure"},t})(),n.InThreadSurveyMetadata=(function(){function t(a){if(this.questions=[],this.privacyStatementParts=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.tessaSessionId=e.string();break}case 2:{s.simonSessionId=e.string();break}case 3:{s.simonSurveyId=e.string();break}case 4:{s.tessaRootId=e.string();break}case 5:{s.requestId=e.string();break}case 6:{s.tessaEvent=e.string();break}case 7:{s.invitationHeaderText=e.string();break}case 8:{s.invitationBodyText=e.string();break}case 9:{s.invitationCtaText=e.string();break}case 10:{s.invitationCtaUrl=e.string();break}case 11:{s.surveyTitle=e.string();break}case 12:{s.questions&&s.questions.length||(s.questions=[]),s.questions.push(d.proto.InThreadSurveyMetadata.InThreadSurveyQuestion.decode(e,e.uint32()));break}case 13:{s.surveyContinueButtonText=e.string();break}case 14:{s.surveySubmitButtonText=e.string();break}case 15:{s.privacyStatementFull=e.string();break}case 16:{s.privacyStatementParts&&s.privacyStatementParts.length||(s.privacyStatementParts=[]),s.privacyStatementParts.push(d.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart.decode(e,e.uint32()));break}case 17:{s.feedbackToastText=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.InThreadSurveyMetadata)return e;var i=new d.proto.InThreadSurveyMetadata;if(e.tessaSessionId!=null&&(i.tessaSessionId=String(e.tessaSessionId)),e.simonSessionId!=null&&(i.simonSessionId=String(e.simonSessionId)),e.simonSurveyId!=null&&(i.simonSurveyId=String(e.simonSurveyId)),e.tessaRootId!=null&&(i.tessaRootId=String(e.tessaRootId)),e.requestId!=null&&(i.requestId=String(e.requestId)),e.tessaEvent!=null&&(i.tessaEvent=String(e.tessaEvent)),e.invitationHeaderText!=null&&(i.invitationHeaderText=String(e.invitationHeaderText)),e.invitationBodyText!=null&&(i.invitationBodyText=String(e.invitationBodyText)),e.invitationCtaText!=null&&(i.invitationCtaText=String(e.invitationCtaText)),e.invitationCtaUrl!=null&&(i.invitationCtaUrl=String(e.invitationCtaUrl)),e.surveyTitle!=null&&(i.surveyTitle=String(e.surveyTitle)),e.questions){if(!Array.isArray(e.questions))throw TypeError(".proto.InThreadSurveyMetadata.questions: array expected");i.questions=[];for(var A=0;A>>3){case 1:{c.stringValue=A.string();break}case 2:{c.numericValue=A.uint32();break}case 3:{c.textTranslated=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.InThreadSurveyMetadata.InThreadSurveyOption)return A;var r=new d.proto.InThreadSurveyMetadata.InThreadSurveyOption;return A.stringValue!=null&&(r.stringValue=String(A.stringValue)),A.numericValue!=null&&(r.numericValue=A.numericValue>>>0),A.textTranslated!=null&&(r.textTranslated=String(A.textTranslated)),r},a.toObject=function(A,r){r||(r={});var s={};return A.stringValue!=null&&A.hasOwnProperty("stringValue")&&(s.stringValue=A.stringValue,r.oneofs&&(s._stringValue="stringValue")),A.numericValue!=null&&A.hasOwnProperty("numericValue")&&(s.numericValue=A.numericValue,r.oneofs&&(s._numericValue="numericValue")),A.textTranslated!=null&&A.hasOwnProperty("textTranslated")&&(s.textTranslated=A.textTranslated,r.oneofs&&(s._textTranslated="textTranslated")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.InThreadSurveyMetadata.InThreadSurveyOption"},a})(),t.InThreadSurveyPrivacyStatementPart=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.text=A.string();break}case 2:{c.url=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart)return A;var r=new d.proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart;return A.text!=null&&(r.text=String(A.text)),A.url!=null&&(r.url=String(A.url)),r},a.toObject=function(A,r){r||(r={});var s={};return A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.InThreadSurveyMetadata.InThreadSurveyPrivacyStatementPart"},a})(),t.InThreadSurveyQuestion=(function(){function a(i){if(this.questionOptions=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.questionText=A.string();break}case 2:{c.questionId=A.string();break}case 3:{c.questionOptions&&c.questionOptions.length||(c.questionOptions=[]),c.questionOptions.push(d.proto.InThreadSurveyMetadata.InThreadSurveyOption.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.InThreadSurveyMetadata.InThreadSurveyQuestion)return A;var r=new d.proto.InThreadSurveyMetadata.InThreadSurveyQuestion;if(A.questionText!=null&&(r.questionText=String(A.questionText)),A.questionId!=null&&(r.questionId=String(A.questionId)),A.questionOptions){if(!Array.isArray(A.questionOptions))throw TypeError(".proto.InThreadSurveyMetadata.InThreadSurveyQuestion.questionOptions: array expected");r.questionOptions=[];for(var s=0;s>>3){case 1:{s.polygonVertices&&s.polygonVertices.length||(s.polygonVertices=[]),s.polygonVertices.push(d.proto.Point.decode(e,e.uint32()));break}case 4:{s.shouldSkipConfirmation=e.bool();break}case 5:{s.embeddedContent=d.proto.EmbeddedContent.decode(e,e.uint32());break}case 8:{s.statusLinkType=e.int32();break}case 2:{s.location=d.proto.Location.decode(e,e.uint32());break}case 3:{s.newsletter=d.proto.ContextInfo.ForwardedNewsletterMessageInfo.decode(e,e.uint32());break}case 6:{s.embeddedAction=e.bool();break}case 7:{s.tapAction=d.proto.TapLinkAction.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.InteractiveAnnotation)return e;var i=new d.proto.InteractiveAnnotation;if(e.polygonVertices){if(!Array.isArray(e.polygonVertices))throw TypeError(".proto.InteractiveAnnotation.polygonVertices: array expected");i.polygonVertices=[];for(var A=0;A>>3){case 1:{s.isGalaxyFlowCompleted=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.InteractiveMessageAdditionalMetadata)return e;var i=new d.proto.InteractiveMessageAdditionalMetadata;return e.isGalaxyFlowCompleted!=null&&(i.isGalaxyFlowCompleted=!!e.isGalaxyFlowCompleted),i},t.toObject=function(e,i){i||(i={});var A={};return e.isGalaxyFlowCompleted!=null&&e.hasOwnProperty("isGalaxyFlowCompleted")&&(A.isGalaxyFlowCompleted=e.isGalaxyFlowCompleted,i.oneofs&&(A._isGalaxyFlowCompleted="isGalaxyFlowCompleted")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.InteractiveMessageAdditionalMetadata"},t})(),n.KeepInChat=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.keepType=e.int32();break}case 2:{s.serverTimestamp=e.int64();break}case 3:{s.key=d.proto.MessageKey.decode(e,e.uint32());break}case 4:{s.deviceJid=e.string();break}case 5:{s.clientTimestampMs=e.int64();break}case 6:{s.serverTimestampMs=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.KeepInChat)return e;var i=new d.proto.KeepInChat;switch(e.keepType){default:if(typeof e.keepType=="number"){i.keepType=e.keepType;break}break;case"UNKNOWN":case 0:i.keepType=0;break;case"KEEP_FOR_ALL":case 1:i.keepType=1;break;case"UNDO_KEEP_FOR_ALL":case 2:i.keepType=2;break}if(e.serverTimestamp!=null&&(l.Long?(i.serverTimestamp=l.Long.fromValue(e.serverTimestamp)).unsigned=!1:typeof e.serverTimestamp=="string"?i.serverTimestamp=parseInt(e.serverTimestamp,10):typeof e.serverTimestamp=="number"?i.serverTimestamp=e.serverTimestamp:typeof e.serverTimestamp=="object"&&(i.serverTimestamp=new l.LongBits(e.serverTimestamp.low>>>0,e.serverTimestamp.high>>>0).toNumber())),e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.KeepInChat.key: object expected");i.key=d.proto.MessageKey.fromObject(e.key)}return e.deviceJid!=null&&(i.deviceJid=String(e.deviceJid)),e.clientTimestampMs!=null&&(l.Long?(i.clientTimestampMs=l.Long.fromValue(e.clientTimestampMs)).unsigned=!1:typeof e.clientTimestampMs=="string"?i.clientTimestampMs=parseInt(e.clientTimestampMs,10):typeof e.clientTimestampMs=="number"?i.clientTimestampMs=e.clientTimestampMs:typeof e.clientTimestampMs=="object"&&(i.clientTimestampMs=new l.LongBits(e.clientTimestampMs.low>>>0,e.clientTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(i.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?i.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?i.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(i.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.keepType!=null&&e.hasOwnProperty("keepType")&&(A.keepType=i.enums===String?d.proto.KeepType[e.keepType]===void 0?e.keepType:d.proto.KeepType[e.keepType]:e.keepType,i.oneofs&&(A._keepType="keepType")),e.serverTimestamp!=null&&e.hasOwnProperty("serverTimestamp")&&(typeof e.serverTimestamp=="number"?A.serverTimestamp=i.longs===String?String(e.serverTimestamp):e.serverTimestamp:A.serverTimestamp=i.longs===String?ge(e.serverTimestamp):i.longs===Number?ce(e.serverTimestamp):e.serverTimestamp,i.oneofs&&(A._serverTimestamp="serverTimestamp")),e.key!=null&&e.hasOwnProperty("key")&&(A.key=d.proto.MessageKey.toObject(e.key,i),i.oneofs&&(A._key="key")),e.deviceJid!=null&&e.hasOwnProperty("deviceJid")&&(A.deviceJid=e.deviceJid,i.oneofs&&(A._deviceJid="deviceJid")),e.clientTimestampMs!=null&&e.hasOwnProperty("clientTimestampMs")&&(typeof e.clientTimestampMs=="number"?A.clientTimestampMs=i.longs===String?String(e.clientTimestampMs):e.clientTimestampMs:A.clientTimestampMs=i.longs===String?ge(e.clientTimestampMs):i.longs===Number?ce(e.clientTimestampMs):e.clientTimestampMs,i.oneofs&&(A._clientTimestampMs="clientTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=i.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=i.longs===String?ge(e.serverTimestampMs):i.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,i.oneofs&&(A._serverTimestampMs="serverTimestampMs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeepInChat"},t})(),n.KeepType=(function(){let t={},o=Object.create(t);return o[t[0]="UNKNOWN"]=0,o[t[1]="KEEP_FOR_ALL"]=1,o[t[2]="UNDO_KEEP_FOR_ALL"]=2,o})(),n.KeyExchangeMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.uint32();break}case 2:{s.baseKey=e.bytes();break}case 3:{s.ratchetKey=e.bytes();break}case 4:{s.identityKey=e.bytes();break}case 5:{s.baseKeySignature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.KeyExchangeMessage)return e;var i=new d.proto.KeyExchangeMessage;return e.id!=null&&(i.id=e.id>>>0),e.baseKey!=null&&(typeof e.baseKey=="string"?l.base64.decode(e.baseKey,i.baseKey=l.newBuffer(l.base64.length(e.baseKey)),0):e.baseKey.length>=0&&(i.baseKey=e.baseKey)),e.ratchetKey!=null&&(typeof e.ratchetKey=="string"?l.base64.decode(e.ratchetKey,i.ratchetKey=l.newBuffer(l.base64.length(e.ratchetKey)),0):e.ratchetKey.length>=0&&(i.ratchetKey=e.ratchetKey)),e.identityKey!=null&&(typeof e.identityKey=="string"?l.base64.decode(e.identityKey,i.identityKey=l.newBuffer(l.base64.length(e.identityKey)),0):e.identityKey.length>=0&&(i.identityKey=e.identityKey)),e.baseKeySignature!=null&&(typeof e.baseKeySignature=="string"?l.base64.decode(e.baseKeySignature,i.baseKeySignature=l.newBuffer(l.base64.length(e.baseKeySignature)),0):e.baseKeySignature.length>=0&&(i.baseKeySignature=e.baseKeySignature)),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.baseKey!=null&&e.hasOwnProperty("baseKey")&&(A.baseKey=i.bytes===String?l.base64.encode(e.baseKey,0,e.baseKey.length):i.bytes===Array?Array.prototype.slice.call(e.baseKey):e.baseKey,i.oneofs&&(A._baseKey="baseKey")),e.ratchetKey!=null&&e.hasOwnProperty("ratchetKey")&&(A.ratchetKey=i.bytes===String?l.base64.encode(e.ratchetKey,0,e.ratchetKey.length):i.bytes===Array?Array.prototype.slice.call(e.ratchetKey):e.ratchetKey,i.oneofs&&(A._ratchetKey="ratchetKey")),e.identityKey!=null&&e.hasOwnProperty("identityKey")&&(A.identityKey=i.bytes===String?l.base64.encode(e.identityKey,0,e.identityKey.length):i.bytes===Array?Array.prototype.slice.call(e.identityKey):e.identityKey,i.oneofs&&(A._identityKey="identityKey")),e.baseKeySignature!=null&&e.hasOwnProperty("baseKeySignature")&&(A.baseKeySignature=i.bytes===String?l.base64.encode(e.baseKeySignature,0,e.baseKeySignature.length):i.bytes===Array?Array.prototype.slice.call(e.baseKeySignature):e.baseKeySignature,i.oneofs&&(A._baseKeySignature="baseKeySignature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeyExchangeMessage"},t})(),n.KeyId=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.KeyId)return e;var i=new d.proto.KeyId;return e.id!=null&&(typeof e.id=="string"?l.base64.decode(e.id,i.id=l.newBuffer(l.base64.length(e.id)),0):e.id.length>=0&&(i.id=e.id)),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=i.bytes===String?l.base64.encode(e.id,0,e.id.length):i.bytes===Array?Array.prototype.slice.call(e.id):e.id,i.oneofs&&(A._id="id")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.KeyId"},t})(),n.LIDMigrationMapping=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.pn=e.uint64();break}case 2:{s.assignedLid=e.uint64();break}case 3:{s.latestLid=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.LIDMigrationMapping)return e;var i=new d.proto.LIDMigrationMapping;return e.pn!=null&&(l.Long?(i.pn=l.Long.fromValue(e.pn)).unsigned=!0:typeof e.pn=="string"?i.pn=parseInt(e.pn,10):typeof e.pn=="number"?i.pn=e.pn:typeof e.pn=="object"&&(i.pn=new l.LongBits(e.pn.low>>>0,e.pn.high>>>0).toNumber(!0))),e.assignedLid!=null&&(l.Long?(i.assignedLid=l.Long.fromValue(e.assignedLid)).unsigned=!0:typeof e.assignedLid=="string"?i.assignedLid=parseInt(e.assignedLid,10):typeof e.assignedLid=="number"?i.assignedLid=e.assignedLid:typeof e.assignedLid=="object"&&(i.assignedLid=new l.LongBits(e.assignedLid.low>>>0,e.assignedLid.high>>>0).toNumber(!0))),e.latestLid!=null&&(l.Long?(i.latestLid=l.Long.fromValue(e.latestLid)).unsigned=!0:typeof e.latestLid=="string"?i.latestLid=parseInt(e.latestLid,10):typeof e.latestLid=="number"?i.latestLid=e.latestLid:typeof e.latestLid=="object"&&(i.latestLid=new l.LongBits(e.latestLid.low>>>0,e.latestLid.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};if(i.defaults){if(l.Long){var r=new l.Long(0,0,!0);A.pn=i.longs===String?r.toString():i.longs===Number?r.toNumber():r}else A.pn=i.longs===String?"0":0;if(l.Long){var r=new l.Long(0,0,!0);A.assignedLid=i.longs===String?r.toString():i.longs===Number?r.toNumber():r}else A.assignedLid=i.longs===String?"0":0}return e.pn!=null&&e.hasOwnProperty("pn")&&(typeof e.pn=="number"?A.pn=i.longs===String?String(e.pn):e.pn:A.pn=i.longs===String?ge(e.pn,!0):i.longs===Number?ce(e.pn,!0):e.pn),e.assignedLid!=null&&e.hasOwnProperty("assignedLid")&&(typeof e.assignedLid=="number"?A.assignedLid=i.longs===String?String(e.assignedLid):e.assignedLid:A.assignedLid=i.longs===String?ge(e.assignedLid,!0):i.longs===Number?ce(e.assignedLid,!0):e.assignedLid),e.latestLid!=null&&e.hasOwnProperty("latestLid")&&(typeof e.latestLid=="number"?A.latestLid=i.longs===String?String(e.latestLid):e.latestLid:A.latestLid=i.longs===String?ge(e.latestLid,!0):i.longs===Number?ce(e.latestLid,!0):e.latestLid,i.oneofs&&(A._latestLid="latestLid")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LIDMigrationMapping"},t})(),n.LIDMigrationMappingSyncMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.encodedMappingPayload=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.LIDMigrationMappingSyncMessage)return e;var i=new d.proto.LIDMigrationMappingSyncMessage;return e.encodedMappingPayload!=null&&(typeof e.encodedMappingPayload=="string"?l.base64.decode(e.encodedMappingPayload,i.encodedMappingPayload=l.newBuffer(l.base64.length(e.encodedMappingPayload)),0):e.encodedMappingPayload.length>=0&&(i.encodedMappingPayload=e.encodedMappingPayload)),i},t.toObject=function(e,i){i||(i={});var A={};return e.encodedMappingPayload!=null&&e.hasOwnProperty("encodedMappingPayload")&&(A.encodedMappingPayload=i.bytes===String?l.base64.encode(e.encodedMappingPayload,0,e.encodedMappingPayload.length):i.bytes===Array?Array.prototype.slice.call(e.encodedMappingPayload):e.encodedMappingPayload,i.oneofs&&(A._encodedMappingPayload="encodedMappingPayload")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LIDMigrationMappingSyncMessage"},t})(),n.LIDMigrationMappingSyncPayload=(function(){function t(a){if(this.pnToLidMappings=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.pnToLidMappings&&s.pnToLidMappings.length||(s.pnToLidMappings=[]),s.pnToLidMappings.push(d.proto.LIDMigrationMapping.decode(e,e.uint32()));break}case 2:{s.chatDbMigrationTimestamp=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.LIDMigrationMappingSyncPayload)return e;var i=new d.proto.LIDMigrationMappingSyncPayload;if(e.pnToLidMappings){if(!Array.isArray(e.pnToLidMappings))throw TypeError(".proto.LIDMigrationMappingSyncPayload.pnToLidMappings: array expected");i.pnToLidMappings=[];for(var A=0;A>>0,e.chatDbMigrationTimestamp.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.pnToLidMappings=[]),e.pnToLidMappings&&e.pnToLidMappings.length){A.pnToLidMappings=[];for(var r=0;r>>3){case 1:{s.eventResponseMessage=d.proto.Message.EventResponseMessage.decode(e,e.uint32());break}case 2:{s.pollVote=d.proto.Message.PollVoteMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.LegacyMessage)return e;var i=new d.proto.LegacyMessage;if(e.eventResponseMessage!=null){if(typeof e.eventResponseMessage!="object")throw TypeError(".proto.LegacyMessage.eventResponseMessage: object expected");i.eventResponseMessage=d.proto.Message.EventResponseMessage.fromObject(e.eventResponseMessage)}if(e.pollVote!=null){if(typeof e.pollVote!="object")throw TypeError(".proto.LegacyMessage.pollVote: object expected");i.pollVote=d.proto.Message.PollVoteMessage.fromObject(e.pollVote)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.eventResponseMessage!=null&&e.hasOwnProperty("eventResponseMessage")&&(A.eventResponseMessage=d.proto.Message.EventResponseMessage.toObject(e.eventResponseMessage,i),i.oneofs&&(A._eventResponseMessage="eventResponseMessage")),e.pollVote!=null&&e.hasOwnProperty("pollVote")&&(A.pollVote=d.proto.Message.PollVoteMessage.toObject(e.pollVote,i),i.oneofs&&(A._pollVote="pollVote")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LegacyMessage"},t})(),n.LimitSharing=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.sharingLimited=e.bool();break}case 2:{s.trigger=e.int32();break}case 3:{s.limitSharingSettingTimestamp=e.int64();break}case 4:{s.initiatedByMe=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.LimitSharing)return e;var i=new d.proto.LimitSharing;switch(e.sharingLimited!=null&&(i.sharingLimited=!!e.sharingLimited),e.trigger){default:if(typeof e.trigger=="number"){i.trigger=e.trigger;break}break;case"UNKNOWN":case 0:i.trigger=0;break;case"CHAT_SETTING":case 1:i.trigger=1;break;case"BIZ_SUPPORTS_FB_HOSTING":case 2:i.trigger=2;break;case"UNKNOWN_GROUP":case 3:i.trigger=3;break}return e.limitSharingSettingTimestamp!=null&&(l.Long?(i.limitSharingSettingTimestamp=l.Long.fromValue(e.limitSharingSettingTimestamp)).unsigned=!1:typeof e.limitSharingSettingTimestamp=="string"?i.limitSharingSettingTimestamp=parseInt(e.limitSharingSettingTimestamp,10):typeof e.limitSharingSettingTimestamp=="number"?i.limitSharingSettingTimestamp=e.limitSharingSettingTimestamp:typeof e.limitSharingSettingTimestamp=="object"&&(i.limitSharingSettingTimestamp=new l.LongBits(e.limitSharingSettingTimestamp.low>>>0,e.limitSharingSettingTimestamp.high>>>0).toNumber())),e.initiatedByMe!=null&&(i.initiatedByMe=!!e.initiatedByMe),i},t.toObject=function(e,i){i||(i={});var A={};return e.sharingLimited!=null&&e.hasOwnProperty("sharingLimited")&&(A.sharingLimited=e.sharingLimited,i.oneofs&&(A._sharingLimited="sharingLimited")),e.trigger!=null&&e.hasOwnProperty("trigger")&&(A.trigger=i.enums===String?d.proto.LimitSharing.TriggerType[e.trigger]===void 0?e.trigger:d.proto.LimitSharing.TriggerType[e.trigger]:e.trigger,i.oneofs&&(A._trigger="trigger")),e.limitSharingSettingTimestamp!=null&&e.hasOwnProperty("limitSharingSettingTimestamp")&&(typeof e.limitSharingSettingTimestamp=="number"?A.limitSharingSettingTimestamp=i.longs===String?String(e.limitSharingSettingTimestamp):e.limitSharingSettingTimestamp:A.limitSharingSettingTimestamp=i.longs===String?ge(e.limitSharingSettingTimestamp):i.longs===Number?ce(e.limitSharingSettingTimestamp):e.limitSharingSettingTimestamp,i.oneofs&&(A._limitSharingSettingTimestamp="limitSharingSettingTimestamp")),e.initiatedByMe!=null&&e.hasOwnProperty("initiatedByMe")&&(A.initiatedByMe=e.initiatedByMe,i.oneofs&&(A._initiatedByMe="initiatedByMe")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LimitSharing"},t.TriggerType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="CHAT_SETTING"]=1,e[a[2]="BIZ_SUPPORTS_FB_HOSTING"]=2,e[a[3]="UNKNOWN_GROUP"]=3,e})(),t})(),n.LocalizedName=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.lg=e.string();break}case 2:{s.lc=e.string();break}case 3:{s.verifiedName=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.LocalizedName)return e;var i=new d.proto.LocalizedName;return e.lg!=null&&(i.lg=String(e.lg)),e.lc!=null&&(i.lc=String(e.lc)),e.verifiedName!=null&&(i.verifiedName=String(e.verifiedName)),i},t.toObject=function(e,i){i||(i={});var A={};return e.lg!=null&&e.hasOwnProperty("lg")&&(A.lg=e.lg,i.oneofs&&(A._lg="lg")),e.lc!=null&&e.hasOwnProperty("lc")&&(A.lc=e.lc,i.oneofs&&(A._lc="lc")),e.verifiedName!=null&&e.hasOwnProperty("verifiedName")&&(A.verifiedName=e.verifiedName,i.oneofs&&(A._verifiedName="verifiedName")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.LocalizedName"},t})(),n.Location=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.degreesLatitude=e.double();break}case 2:{s.degreesLongitude=e.double();break}case 3:{s.name=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Location)return e;var i=new d.proto.Location;return e.degreesLatitude!=null&&(i.degreesLatitude=Number(e.degreesLatitude)),e.degreesLongitude!=null&&(i.degreesLongitude=Number(e.degreesLongitude)),e.name!=null&&(i.name=String(e.name)),i},t.toObject=function(e,i){i||(i={});var A={};return e.degreesLatitude!=null&&e.hasOwnProperty("degreesLatitude")&&(A.degreesLatitude=i.json&&!isFinite(e.degreesLatitude)?String(e.degreesLatitude):e.degreesLatitude,i.oneofs&&(A._degreesLatitude="degreesLatitude")),e.degreesLongitude!=null&&e.hasOwnProperty("degreesLongitude")&&(A.degreesLongitude=i.json&&!isFinite(e.degreesLongitude)?String(e.degreesLongitude):e.degreesLongitude,i.oneofs&&(A._degreesLongitude="degreesLongitude")),e.name!=null&&e.hasOwnProperty("name")&&(A.name=e.name,i.oneofs&&(A._name="name")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Location"},t})(),n.MediaData=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.localPath=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MediaData)return e;var i=new d.proto.MediaData;return e.localPath!=null&&(i.localPath=String(e.localPath)),i},t.toObject=function(e,i){i||(i={});var A={};return e.localPath!=null&&e.hasOwnProperty("localPath")&&(A.localPath=e.localPath,i.oneofs&&(A._localPath="localPath")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaData"},t})(),n.MediaNotifyMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.expressPathUrl=e.string();break}case 2:{s.fileEncSha256=e.bytes();break}case 3:{s.fileLength=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MediaNotifyMessage)return e;var i=new d.proto.MediaNotifyMessage;return e.expressPathUrl!=null&&(i.expressPathUrl=String(e.expressPathUrl)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,i.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(i.fileEncSha256=e.fileEncSha256)),e.fileLength!=null&&(l.Long?(i.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?i.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?i.fileLength=e.fileLength:typeof e.fileLength=="object"&&(i.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};return e.expressPathUrl!=null&&e.hasOwnProperty("expressPathUrl")&&(A.expressPathUrl=e.expressPathUrl,i.oneofs&&(A._expressPathUrl="expressPathUrl")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=i.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):i.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,i.oneofs&&(A._fileEncSha256="fileEncSha256")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=i.longs===String?String(e.fileLength):e.fileLength:A.fileLength=i.longs===String?ge(e.fileLength,!0):i.longs===Number?ce(e.fileLength,!0):e.fileLength,i.oneofs&&(A._fileLength="fileLength")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaNotifyMessage"},t})(),n.MediaRetryNotification=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.stanzaId=e.string();break}case 2:{s.directPath=e.string();break}case 3:{s.result=e.int32();break}case 4:{s.messageSecret=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MediaRetryNotification)return e;var i=new d.proto.MediaRetryNotification;switch(e.stanzaId!=null&&(i.stanzaId=String(e.stanzaId)),e.directPath!=null&&(i.directPath=String(e.directPath)),e.result){default:if(typeof e.result=="number"){i.result=e.result;break}break;case"GENERAL_ERROR":case 0:i.result=0;break;case"SUCCESS":case 1:i.result=1;break;case"NOT_FOUND":case 2:i.result=2;break;case"DECRYPTION_ERROR":case 3:i.result=3;break}return e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,i.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(i.messageSecret=e.messageSecret)),i},t.toObject=function(e,i){i||(i={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,i.oneofs&&(A._stanzaId="stanzaId")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,i.oneofs&&(A._directPath="directPath")),e.result!=null&&e.hasOwnProperty("result")&&(A.result=i.enums===String?d.proto.MediaRetryNotification.ResultType[e.result]===void 0?e.result:d.proto.MediaRetryNotification.ResultType[e.result]:e.result,i.oneofs&&(A._result="result")),e.messageSecret!=null&&e.hasOwnProperty("messageSecret")&&(A.messageSecret=i.bytes===String?l.base64.encode(e.messageSecret,0,e.messageSecret.length):i.bytes===Array?Array.prototype.slice.call(e.messageSecret):e.messageSecret,i.oneofs&&(A._messageSecret="messageSecret")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MediaRetryNotification"},t.ResultType=(function(){let a={},e=Object.create(a);return e[a[0]="GENERAL_ERROR"]=0,e[a[1]="SUCCESS"]=1,e[a[2]="NOT_FOUND"]=2,e[a[3]="DECRYPTION_ERROR"]=3,e})(),t})(),n.MediaVisibility=(function(){let t={},o=Object.create(t);return o[t[0]="DEFAULT"]=0,o[t[1]="OFF"]=1,o[t[2]="ON"]=2,o})(),n.MemberLabel=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.label=e.string();break}case 2:{s.labelTimestamp=e.int64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MemberLabel)return e;var i=new d.proto.MemberLabel;return e.label!=null&&(i.label=String(e.label)),e.labelTimestamp!=null&&(l.Long?(i.labelTimestamp=l.Long.fromValue(e.labelTimestamp)).unsigned=!1:typeof e.labelTimestamp=="string"?i.labelTimestamp=parseInt(e.labelTimestamp,10):typeof e.labelTimestamp=="number"?i.labelTimestamp=e.labelTimestamp:typeof e.labelTimestamp=="object"&&(i.labelTimestamp=new l.LongBits(e.labelTimestamp.low>>>0,e.labelTimestamp.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.label!=null&&e.hasOwnProperty("label")&&(A.label=e.label,i.oneofs&&(A._label="label")),e.labelTimestamp!=null&&e.hasOwnProperty("labelTimestamp")&&(typeof e.labelTimestamp=="number"?A.labelTimestamp=i.longs===String?String(e.labelTimestamp):e.labelTimestamp:A.labelTimestamp=i.longs===String?ge(e.labelTimestamp):i.longs===Number?ce(e.labelTimestamp):e.labelTimestamp,i.oneofs&&(A._labelTimestamp="labelTimestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MemberLabel"},t})(),n.Message=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.conversation=e.string();break}case 2:{s.senderKeyDistributionMessage=d.proto.Message.SenderKeyDistributionMessage.decode(e,e.uint32());break}case 3:{s.imageMessage=d.proto.Message.ImageMessage.decode(e,e.uint32());break}case 4:{s.contactMessage=d.proto.Message.ContactMessage.decode(e,e.uint32());break}case 5:{s.locationMessage=d.proto.Message.LocationMessage.decode(e,e.uint32());break}case 6:{s.extendedTextMessage=d.proto.Message.ExtendedTextMessage.decode(e,e.uint32());break}case 7:{s.documentMessage=d.proto.Message.DocumentMessage.decode(e,e.uint32());break}case 8:{s.audioMessage=d.proto.Message.AudioMessage.decode(e,e.uint32());break}case 9:{s.videoMessage=d.proto.Message.VideoMessage.decode(e,e.uint32());break}case 10:{s.call=d.proto.Message.Call.decode(e,e.uint32());break}case 11:{s.chat=d.proto.Message.Chat.decode(e,e.uint32());break}case 12:{s.protocolMessage=d.proto.Message.ProtocolMessage.decode(e,e.uint32());break}case 13:{s.contactsArrayMessage=d.proto.Message.ContactsArrayMessage.decode(e,e.uint32());break}case 14:{s.highlyStructuredMessage=d.proto.Message.HighlyStructuredMessage.decode(e,e.uint32());break}case 15:{s.fastRatchetKeySenderKeyDistributionMessage=d.proto.Message.SenderKeyDistributionMessage.decode(e,e.uint32());break}case 16:{s.sendPaymentMessage=d.proto.Message.SendPaymentMessage.decode(e,e.uint32());break}case 18:{s.liveLocationMessage=d.proto.Message.LiveLocationMessage.decode(e,e.uint32());break}case 22:{s.requestPaymentMessage=d.proto.Message.RequestPaymentMessage.decode(e,e.uint32());break}case 23:{s.declinePaymentRequestMessage=d.proto.Message.DeclinePaymentRequestMessage.decode(e,e.uint32());break}case 24:{s.cancelPaymentRequestMessage=d.proto.Message.CancelPaymentRequestMessage.decode(e,e.uint32());break}case 25:{s.templateMessage=d.proto.Message.TemplateMessage.decode(e,e.uint32());break}case 26:{s.stickerMessage=d.proto.Message.StickerMessage.decode(e,e.uint32());break}case 28:{s.groupInviteMessage=d.proto.Message.GroupInviteMessage.decode(e,e.uint32());break}case 29:{s.templateButtonReplyMessage=d.proto.Message.TemplateButtonReplyMessage.decode(e,e.uint32());break}case 30:{s.productMessage=d.proto.Message.ProductMessage.decode(e,e.uint32());break}case 31:{s.deviceSentMessage=d.proto.Message.DeviceSentMessage.decode(e,e.uint32());break}case 35:{s.messageContextInfo=d.proto.MessageContextInfo.decode(e,e.uint32());break}case 36:{s.listMessage=d.proto.Message.ListMessage.decode(e,e.uint32());break}case 37:{s.viewOnceMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 38:{s.orderMessage=d.proto.Message.OrderMessage.decode(e,e.uint32());break}case 39:{s.listResponseMessage=d.proto.Message.ListResponseMessage.decode(e,e.uint32());break}case 40:{s.ephemeralMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 41:{s.invoiceMessage=d.proto.Message.InvoiceMessage.decode(e,e.uint32());break}case 42:{s.buttonsMessage=d.proto.Message.ButtonsMessage.decode(e,e.uint32());break}case 43:{s.buttonsResponseMessage=d.proto.Message.ButtonsResponseMessage.decode(e,e.uint32());break}case 44:{s.paymentInviteMessage=d.proto.Message.PaymentInviteMessage.decode(e,e.uint32());break}case 45:{s.interactiveMessage=d.proto.Message.InteractiveMessage.decode(e,e.uint32());break}case 46:{s.reactionMessage=d.proto.Message.ReactionMessage.decode(e,e.uint32());break}case 47:{s.stickerSyncRmrMessage=d.proto.Message.StickerSyncRMRMessage.decode(e,e.uint32());break}case 48:{s.interactiveResponseMessage=d.proto.Message.InteractiveResponseMessage.decode(e,e.uint32());break}case 49:{s.pollCreationMessage=d.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 50:{s.pollUpdateMessage=d.proto.Message.PollUpdateMessage.decode(e,e.uint32());break}case 51:{s.keepInChatMessage=d.proto.Message.KeepInChatMessage.decode(e,e.uint32());break}case 53:{s.documentWithCaptionMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 54:{s.requestPhoneNumberMessage=d.proto.Message.RequestPhoneNumberMessage.decode(e,e.uint32());break}case 55:{s.viewOnceMessageV2=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 56:{s.encReactionMessage=d.proto.Message.EncReactionMessage.decode(e,e.uint32());break}case 58:{s.editedMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 59:{s.viewOnceMessageV2Extension=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 60:{s.pollCreationMessageV2=d.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 61:{s.scheduledCallCreationMessage=d.proto.Message.ScheduledCallCreationMessage.decode(e,e.uint32());break}case 62:{s.groupMentionedMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 63:{s.pinInChatMessage=d.proto.Message.PinInChatMessage.decode(e,e.uint32());break}case 64:{s.pollCreationMessageV3=d.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 65:{s.scheduledCallEditMessage=d.proto.Message.ScheduledCallEditMessage.decode(e,e.uint32());break}case 66:{s.ptvMessage=d.proto.Message.VideoMessage.decode(e,e.uint32());break}case 67:{s.botInvokeMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 69:{s.callLogMesssage=d.proto.Message.CallLogMessage.decode(e,e.uint32());break}case 70:{s.messageHistoryBundle=d.proto.Message.MessageHistoryBundle.decode(e,e.uint32());break}case 71:{s.encCommentMessage=d.proto.Message.EncCommentMessage.decode(e,e.uint32());break}case 72:{s.bcallMessage=d.proto.Message.BCallMessage.decode(e,e.uint32());break}case 74:{s.lottieStickerMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 75:{s.eventMessage=d.proto.Message.EventMessage.decode(e,e.uint32());break}case 76:{s.encEventResponseMessage=d.proto.Message.EncEventResponseMessage.decode(e,e.uint32());break}case 77:{s.commentMessage=d.proto.Message.CommentMessage.decode(e,e.uint32());break}case 78:{s.newsletterAdminInviteMessage=d.proto.Message.NewsletterAdminInviteMessage.decode(e,e.uint32());break}case 80:{s.placeholderMessage=d.proto.Message.PlaceholderMessage.decode(e,e.uint32());break}case 82:{s.secretEncryptedMessage=d.proto.Message.SecretEncryptedMessage.decode(e,e.uint32());break}case 83:{s.albumMessage=d.proto.Message.AlbumMessage.decode(e,e.uint32());break}case 85:{s.eventCoverImage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 86:{s.stickerPackMessage=d.proto.Message.StickerPackMessage.decode(e,e.uint32());break}case 87:{s.statusMentionMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 88:{s.pollResultSnapshotMessage=d.proto.Message.PollResultSnapshotMessage.decode(e,e.uint32());break}case 90:{s.pollCreationOptionImageMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 91:{s.associatedChildMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 92:{s.groupStatusMentionMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 93:{s.pollCreationMessageV4=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 95:{s.statusAddYours=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 96:{s.groupStatusMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 97:{s.richResponseMessage=d.proto.AIRichResponseMessage.decode(e,e.uint32());break}case 98:{s.statusNotificationMessage=d.proto.Message.StatusNotificationMessage.decode(e,e.uint32());break}case 99:{s.limitSharingMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 100:{s.botTaskMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 101:{s.questionMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 102:{s.messageHistoryNotice=d.proto.Message.MessageHistoryNotice.decode(e,e.uint32());break}case 103:{s.groupStatusMessageV2=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 104:{s.botForwardedMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 105:{s.statusQuestionAnswerMessage=d.proto.Message.StatusQuestionAnswerMessage.decode(e,e.uint32());break}case 106:{s.questionReplyMessage=d.proto.Message.FutureProofMessage.decode(e,e.uint32());break}case 107:{s.questionResponseMessage=d.proto.Message.QuestionResponseMessage.decode(e,e.uint32());break}case 109:{s.statusQuotedMessage=d.proto.Message.StatusQuotedMessage.decode(e,e.uint32());break}case 110:{s.statusStickerInteractionMessage=d.proto.Message.StatusStickerInteractionMessage.decode(e,e.uint32());break}case 111:{s.pollCreationMessageV5=d.proto.Message.PollCreationMessage.decode(e,e.uint32());break}case 113:{s.newsletterFollowerInviteMessageV2=d.proto.Message.NewsletterFollowerInviteMessage.decode(e,e.uint32());break}case 114:{s.pollResultSnapshotMessageV3=d.proto.Message.PollResultSnapshotMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Message)return e;var i=new d.proto.Message;if(e.conversation!=null&&(i.conversation=String(e.conversation)),e.senderKeyDistributionMessage!=null){if(typeof e.senderKeyDistributionMessage!="object")throw TypeError(".proto.Message.senderKeyDistributionMessage: object expected");i.senderKeyDistributionMessage=d.proto.Message.SenderKeyDistributionMessage.fromObject(e.senderKeyDistributionMessage)}if(e.imageMessage!=null){if(typeof e.imageMessage!="object")throw TypeError(".proto.Message.imageMessage: object expected");i.imageMessage=d.proto.Message.ImageMessage.fromObject(e.imageMessage)}if(e.contactMessage!=null){if(typeof e.contactMessage!="object")throw TypeError(".proto.Message.contactMessage: object expected");i.contactMessage=d.proto.Message.ContactMessage.fromObject(e.contactMessage)}if(e.locationMessage!=null){if(typeof e.locationMessage!="object")throw TypeError(".proto.Message.locationMessage: object expected");i.locationMessage=d.proto.Message.LocationMessage.fromObject(e.locationMessage)}if(e.extendedTextMessage!=null){if(typeof e.extendedTextMessage!="object")throw TypeError(".proto.Message.extendedTextMessage: object expected");i.extendedTextMessage=d.proto.Message.ExtendedTextMessage.fromObject(e.extendedTextMessage)}if(e.documentMessage!=null){if(typeof e.documentMessage!="object")throw TypeError(".proto.Message.documentMessage: object expected");i.documentMessage=d.proto.Message.DocumentMessage.fromObject(e.documentMessage)}if(e.audioMessage!=null){if(typeof e.audioMessage!="object")throw TypeError(".proto.Message.audioMessage: object expected");i.audioMessage=d.proto.Message.AudioMessage.fromObject(e.audioMessage)}if(e.videoMessage!=null){if(typeof e.videoMessage!="object")throw TypeError(".proto.Message.videoMessage: object expected");i.videoMessage=d.proto.Message.VideoMessage.fromObject(e.videoMessage)}if(e.call!=null){if(typeof e.call!="object")throw TypeError(".proto.Message.call: object expected");i.call=d.proto.Message.Call.fromObject(e.call)}if(e.chat!=null){if(typeof e.chat!="object")throw TypeError(".proto.Message.chat: object expected");i.chat=d.proto.Message.Chat.fromObject(e.chat)}if(e.protocolMessage!=null){if(typeof e.protocolMessage!="object")throw TypeError(".proto.Message.protocolMessage: object expected");i.protocolMessage=d.proto.Message.ProtocolMessage.fromObject(e.protocolMessage)}if(e.contactsArrayMessage!=null){if(typeof e.contactsArrayMessage!="object")throw TypeError(".proto.Message.contactsArrayMessage: object expected");i.contactsArrayMessage=d.proto.Message.ContactsArrayMessage.fromObject(e.contactsArrayMessage)}if(e.highlyStructuredMessage!=null){if(typeof e.highlyStructuredMessage!="object")throw TypeError(".proto.Message.highlyStructuredMessage: object expected");i.highlyStructuredMessage=d.proto.Message.HighlyStructuredMessage.fromObject(e.highlyStructuredMessage)}if(e.fastRatchetKeySenderKeyDistributionMessage!=null){if(typeof e.fastRatchetKeySenderKeyDistributionMessage!="object")throw TypeError(".proto.Message.fastRatchetKeySenderKeyDistributionMessage: object expected");i.fastRatchetKeySenderKeyDistributionMessage=d.proto.Message.SenderKeyDistributionMessage.fromObject(e.fastRatchetKeySenderKeyDistributionMessage)}if(e.sendPaymentMessage!=null){if(typeof e.sendPaymentMessage!="object")throw TypeError(".proto.Message.sendPaymentMessage: object expected");i.sendPaymentMessage=d.proto.Message.SendPaymentMessage.fromObject(e.sendPaymentMessage)}if(e.liveLocationMessage!=null){if(typeof e.liveLocationMessage!="object")throw TypeError(".proto.Message.liveLocationMessage: object expected");i.liveLocationMessage=d.proto.Message.LiveLocationMessage.fromObject(e.liveLocationMessage)}if(e.requestPaymentMessage!=null){if(typeof e.requestPaymentMessage!="object")throw TypeError(".proto.Message.requestPaymentMessage: object expected");i.requestPaymentMessage=d.proto.Message.RequestPaymentMessage.fromObject(e.requestPaymentMessage)}if(e.declinePaymentRequestMessage!=null){if(typeof e.declinePaymentRequestMessage!="object")throw TypeError(".proto.Message.declinePaymentRequestMessage: object expected");i.declinePaymentRequestMessage=d.proto.Message.DeclinePaymentRequestMessage.fromObject(e.declinePaymentRequestMessage)}if(e.cancelPaymentRequestMessage!=null){if(typeof e.cancelPaymentRequestMessage!="object")throw TypeError(".proto.Message.cancelPaymentRequestMessage: object expected");i.cancelPaymentRequestMessage=d.proto.Message.CancelPaymentRequestMessage.fromObject(e.cancelPaymentRequestMessage)}if(e.templateMessage!=null){if(typeof e.templateMessage!="object")throw TypeError(".proto.Message.templateMessage: object expected");i.templateMessage=d.proto.Message.TemplateMessage.fromObject(e.templateMessage)}if(e.stickerMessage!=null){if(typeof e.stickerMessage!="object")throw TypeError(".proto.Message.stickerMessage: object expected");i.stickerMessage=d.proto.Message.StickerMessage.fromObject(e.stickerMessage)}if(e.groupInviteMessage!=null){if(typeof e.groupInviteMessage!="object")throw TypeError(".proto.Message.groupInviteMessage: object expected");i.groupInviteMessage=d.proto.Message.GroupInviteMessage.fromObject(e.groupInviteMessage)}if(e.templateButtonReplyMessage!=null){if(typeof e.templateButtonReplyMessage!="object")throw TypeError(".proto.Message.templateButtonReplyMessage: object expected");i.templateButtonReplyMessage=d.proto.Message.TemplateButtonReplyMessage.fromObject(e.templateButtonReplyMessage)}if(e.productMessage!=null){if(typeof e.productMessage!="object")throw TypeError(".proto.Message.productMessage: object expected");i.productMessage=d.proto.Message.ProductMessage.fromObject(e.productMessage)}if(e.deviceSentMessage!=null){if(typeof e.deviceSentMessage!="object")throw TypeError(".proto.Message.deviceSentMessage: object expected");i.deviceSentMessage=d.proto.Message.DeviceSentMessage.fromObject(e.deviceSentMessage)}if(e.messageContextInfo!=null){if(typeof e.messageContextInfo!="object")throw TypeError(".proto.Message.messageContextInfo: object expected");i.messageContextInfo=d.proto.MessageContextInfo.fromObject(e.messageContextInfo)}if(e.listMessage!=null){if(typeof e.listMessage!="object")throw TypeError(".proto.Message.listMessage: object expected");i.listMessage=d.proto.Message.ListMessage.fromObject(e.listMessage)}if(e.viewOnceMessage!=null){if(typeof e.viewOnceMessage!="object")throw TypeError(".proto.Message.viewOnceMessage: object expected");i.viewOnceMessage=d.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessage)}if(e.orderMessage!=null){if(typeof e.orderMessage!="object")throw TypeError(".proto.Message.orderMessage: object expected");i.orderMessage=d.proto.Message.OrderMessage.fromObject(e.orderMessage)}if(e.listResponseMessage!=null){if(typeof e.listResponseMessage!="object")throw TypeError(".proto.Message.listResponseMessage: object expected");i.listResponseMessage=d.proto.Message.ListResponseMessage.fromObject(e.listResponseMessage)}if(e.ephemeralMessage!=null){if(typeof e.ephemeralMessage!="object")throw TypeError(".proto.Message.ephemeralMessage: object expected");i.ephemeralMessage=d.proto.Message.FutureProofMessage.fromObject(e.ephemeralMessage)}if(e.invoiceMessage!=null){if(typeof e.invoiceMessage!="object")throw TypeError(".proto.Message.invoiceMessage: object expected");i.invoiceMessage=d.proto.Message.InvoiceMessage.fromObject(e.invoiceMessage)}if(e.buttonsMessage!=null){if(typeof e.buttonsMessage!="object")throw TypeError(".proto.Message.buttonsMessage: object expected");i.buttonsMessage=d.proto.Message.ButtonsMessage.fromObject(e.buttonsMessage)}if(e.buttonsResponseMessage!=null){if(typeof e.buttonsResponseMessage!="object")throw TypeError(".proto.Message.buttonsResponseMessage: object expected");i.buttonsResponseMessage=d.proto.Message.ButtonsResponseMessage.fromObject(e.buttonsResponseMessage)}if(e.paymentInviteMessage!=null){if(typeof e.paymentInviteMessage!="object")throw TypeError(".proto.Message.paymentInviteMessage: object expected");i.paymentInviteMessage=d.proto.Message.PaymentInviteMessage.fromObject(e.paymentInviteMessage)}if(e.interactiveMessage!=null){if(typeof e.interactiveMessage!="object")throw TypeError(".proto.Message.interactiveMessage: object expected");i.interactiveMessage=d.proto.Message.InteractiveMessage.fromObject(e.interactiveMessage)}if(e.reactionMessage!=null){if(typeof e.reactionMessage!="object")throw TypeError(".proto.Message.reactionMessage: object expected");i.reactionMessage=d.proto.Message.ReactionMessage.fromObject(e.reactionMessage)}if(e.stickerSyncRmrMessage!=null){if(typeof e.stickerSyncRmrMessage!="object")throw TypeError(".proto.Message.stickerSyncRmrMessage: object expected");i.stickerSyncRmrMessage=d.proto.Message.StickerSyncRMRMessage.fromObject(e.stickerSyncRmrMessage)}if(e.interactiveResponseMessage!=null){if(typeof e.interactiveResponseMessage!="object")throw TypeError(".proto.Message.interactiveResponseMessage: object expected");i.interactiveResponseMessage=d.proto.Message.InteractiveResponseMessage.fromObject(e.interactiveResponseMessage)}if(e.pollCreationMessage!=null){if(typeof e.pollCreationMessage!="object")throw TypeError(".proto.Message.pollCreationMessage: object expected");i.pollCreationMessage=d.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessage)}if(e.pollUpdateMessage!=null){if(typeof e.pollUpdateMessage!="object")throw TypeError(".proto.Message.pollUpdateMessage: object expected");i.pollUpdateMessage=d.proto.Message.PollUpdateMessage.fromObject(e.pollUpdateMessage)}if(e.keepInChatMessage!=null){if(typeof e.keepInChatMessage!="object")throw TypeError(".proto.Message.keepInChatMessage: object expected");i.keepInChatMessage=d.proto.Message.KeepInChatMessage.fromObject(e.keepInChatMessage)}if(e.documentWithCaptionMessage!=null){if(typeof e.documentWithCaptionMessage!="object")throw TypeError(".proto.Message.documentWithCaptionMessage: object expected");i.documentWithCaptionMessage=d.proto.Message.FutureProofMessage.fromObject(e.documentWithCaptionMessage)}if(e.requestPhoneNumberMessage!=null){if(typeof e.requestPhoneNumberMessage!="object")throw TypeError(".proto.Message.requestPhoneNumberMessage: object expected");i.requestPhoneNumberMessage=d.proto.Message.RequestPhoneNumberMessage.fromObject(e.requestPhoneNumberMessage)}if(e.viewOnceMessageV2!=null){if(typeof e.viewOnceMessageV2!="object")throw TypeError(".proto.Message.viewOnceMessageV2: object expected");i.viewOnceMessageV2=d.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessageV2)}if(e.encReactionMessage!=null){if(typeof e.encReactionMessage!="object")throw TypeError(".proto.Message.encReactionMessage: object expected");i.encReactionMessage=d.proto.Message.EncReactionMessage.fromObject(e.encReactionMessage)}if(e.editedMessage!=null){if(typeof e.editedMessage!="object")throw TypeError(".proto.Message.editedMessage: object expected");i.editedMessage=d.proto.Message.FutureProofMessage.fromObject(e.editedMessage)}if(e.viewOnceMessageV2Extension!=null){if(typeof e.viewOnceMessageV2Extension!="object")throw TypeError(".proto.Message.viewOnceMessageV2Extension: object expected");i.viewOnceMessageV2Extension=d.proto.Message.FutureProofMessage.fromObject(e.viewOnceMessageV2Extension)}if(e.pollCreationMessageV2!=null){if(typeof e.pollCreationMessageV2!="object")throw TypeError(".proto.Message.pollCreationMessageV2: object expected");i.pollCreationMessageV2=d.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV2)}if(e.scheduledCallCreationMessage!=null){if(typeof e.scheduledCallCreationMessage!="object")throw TypeError(".proto.Message.scheduledCallCreationMessage: object expected");i.scheduledCallCreationMessage=d.proto.Message.ScheduledCallCreationMessage.fromObject(e.scheduledCallCreationMessage)}if(e.groupMentionedMessage!=null){if(typeof e.groupMentionedMessage!="object")throw TypeError(".proto.Message.groupMentionedMessage: object expected");i.groupMentionedMessage=d.proto.Message.FutureProofMessage.fromObject(e.groupMentionedMessage)}if(e.pinInChatMessage!=null){if(typeof e.pinInChatMessage!="object")throw TypeError(".proto.Message.pinInChatMessage: object expected");i.pinInChatMessage=d.proto.Message.PinInChatMessage.fromObject(e.pinInChatMessage)}if(e.pollCreationMessageV3!=null){if(typeof e.pollCreationMessageV3!="object")throw TypeError(".proto.Message.pollCreationMessageV3: object expected");i.pollCreationMessageV3=d.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV3)}if(e.scheduledCallEditMessage!=null){if(typeof e.scheduledCallEditMessage!="object")throw TypeError(".proto.Message.scheduledCallEditMessage: object expected");i.scheduledCallEditMessage=d.proto.Message.ScheduledCallEditMessage.fromObject(e.scheduledCallEditMessage)}if(e.ptvMessage!=null){if(typeof e.ptvMessage!="object")throw TypeError(".proto.Message.ptvMessage: object expected");i.ptvMessage=d.proto.Message.VideoMessage.fromObject(e.ptvMessage)}if(e.botInvokeMessage!=null){if(typeof e.botInvokeMessage!="object")throw TypeError(".proto.Message.botInvokeMessage: object expected");i.botInvokeMessage=d.proto.Message.FutureProofMessage.fromObject(e.botInvokeMessage)}if(e.callLogMesssage!=null){if(typeof e.callLogMesssage!="object")throw TypeError(".proto.Message.callLogMesssage: object expected");i.callLogMesssage=d.proto.Message.CallLogMessage.fromObject(e.callLogMesssage)}if(e.messageHistoryBundle!=null){if(typeof e.messageHistoryBundle!="object")throw TypeError(".proto.Message.messageHistoryBundle: object expected");i.messageHistoryBundle=d.proto.Message.MessageHistoryBundle.fromObject(e.messageHistoryBundle)}if(e.encCommentMessage!=null){if(typeof e.encCommentMessage!="object")throw TypeError(".proto.Message.encCommentMessage: object expected");i.encCommentMessage=d.proto.Message.EncCommentMessage.fromObject(e.encCommentMessage)}if(e.bcallMessage!=null){if(typeof e.bcallMessage!="object")throw TypeError(".proto.Message.bcallMessage: object expected");i.bcallMessage=d.proto.Message.BCallMessage.fromObject(e.bcallMessage)}if(e.lottieStickerMessage!=null){if(typeof e.lottieStickerMessage!="object")throw TypeError(".proto.Message.lottieStickerMessage: object expected");i.lottieStickerMessage=d.proto.Message.FutureProofMessage.fromObject(e.lottieStickerMessage)}if(e.eventMessage!=null){if(typeof e.eventMessage!="object")throw TypeError(".proto.Message.eventMessage: object expected");i.eventMessage=d.proto.Message.EventMessage.fromObject(e.eventMessage)}if(e.encEventResponseMessage!=null){if(typeof e.encEventResponseMessage!="object")throw TypeError(".proto.Message.encEventResponseMessage: object expected");i.encEventResponseMessage=d.proto.Message.EncEventResponseMessage.fromObject(e.encEventResponseMessage)}if(e.commentMessage!=null){if(typeof e.commentMessage!="object")throw TypeError(".proto.Message.commentMessage: object expected");i.commentMessage=d.proto.Message.CommentMessage.fromObject(e.commentMessage)}if(e.newsletterAdminInviteMessage!=null){if(typeof e.newsletterAdminInviteMessage!="object")throw TypeError(".proto.Message.newsletterAdminInviteMessage: object expected");i.newsletterAdminInviteMessage=d.proto.Message.NewsletterAdminInviteMessage.fromObject(e.newsletterAdminInviteMessage)}if(e.placeholderMessage!=null){if(typeof e.placeholderMessage!="object")throw TypeError(".proto.Message.placeholderMessage: object expected");i.placeholderMessage=d.proto.Message.PlaceholderMessage.fromObject(e.placeholderMessage)}if(e.secretEncryptedMessage!=null){if(typeof e.secretEncryptedMessage!="object")throw TypeError(".proto.Message.secretEncryptedMessage: object expected");i.secretEncryptedMessage=d.proto.Message.SecretEncryptedMessage.fromObject(e.secretEncryptedMessage)}if(e.albumMessage!=null){if(typeof e.albumMessage!="object")throw TypeError(".proto.Message.albumMessage: object expected");i.albumMessage=d.proto.Message.AlbumMessage.fromObject(e.albumMessage)}if(e.eventCoverImage!=null){if(typeof e.eventCoverImage!="object")throw TypeError(".proto.Message.eventCoverImage: object expected");i.eventCoverImage=d.proto.Message.FutureProofMessage.fromObject(e.eventCoverImage)}if(e.stickerPackMessage!=null){if(typeof e.stickerPackMessage!="object")throw TypeError(".proto.Message.stickerPackMessage: object expected");i.stickerPackMessage=d.proto.Message.StickerPackMessage.fromObject(e.stickerPackMessage)}if(e.statusMentionMessage!=null){if(typeof e.statusMentionMessage!="object")throw TypeError(".proto.Message.statusMentionMessage: object expected");i.statusMentionMessage=d.proto.Message.FutureProofMessage.fromObject(e.statusMentionMessage)}if(e.pollResultSnapshotMessage!=null){if(typeof e.pollResultSnapshotMessage!="object")throw TypeError(".proto.Message.pollResultSnapshotMessage: object expected");i.pollResultSnapshotMessage=d.proto.Message.PollResultSnapshotMessage.fromObject(e.pollResultSnapshotMessage)}if(e.pollCreationOptionImageMessage!=null){if(typeof e.pollCreationOptionImageMessage!="object")throw TypeError(".proto.Message.pollCreationOptionImageMessage: object expected");i.pollCreationOptionImageMessage=d.proto.Message.FutureProofMessage.fromObject(e.pollCreationOptionImageMessage)}if(e.associatedChildMessage!=null){if(typeof e.associatedChildMessage!="object")throw TypeError(".proto.Message.associatedChildMessage: object expected");i.associatedChildMessage=d.proto.Message.FutureProofMessage.fromObject(e.associatedChildMessage)}if(e.groupStatusMentionMessage!=null){if(typeof e.groupStatusMentionMessage!="object")throw TypeError(".proto.Message.groupStatusMentionMessage: object expected");i.groupStatusMentionMessage=d.proto.Message.FutureProofMessage.fromObject(e.groupStatusMentionMessage)}if(e.pollCreationMessageV4!=null){if(typeof e.pollCreationMessageV4!="object")throw TypeError(".proto.Message.pollCreationMessageV4: object expected");i.pollCreationMessageV4=d.proto.Message.FutureProofMessage.fromObject(e.pollCreationMessageV4)}if(e.statusAddYours!=null){if(typeof e.statusAddYours!="object")throw TypeError(".proto.Message.statusAddYours: object expected");i.statusAddYours=d.proto.Message.FutureProofMessage.fromObject(e.statusAddYours)}if(e.groupStatusMessage!=null){if(typeof e.groupStatusMessage!="object")throw TypeError(".proto.Message.groupStatusMessage: object expected");i.groupStatusMessage=d.proto.Message.FutureProofMessage.fromObject(e.groupStatusMessage)}if(e.richResponseMessage!=null){if(typeof e.richResponseMessage!="object")throw TypeError(".proto.Message.richResponseMessage: object expected");i.richResponseMessage=d.proto.AIRichResponseMessage.fromObject(e.richResponseMessage)}if(e.statusNotificationMessage!=null){if(typeof e.statusNotificationMessage!="object")throw TypeError(".proto.Message.statusNotificationMessage: object expected");i.statusNotificationMessage=d.proto.Message.StatusNotificationMessage.fromObject(e.statusNotificationMessage)}if(e.limitSharingMessage!=null){if(typeof e.limitSharingMessage!="object")throw TypeError(".proto.Message.limitSharingMessage: object expected");i.limitSharingMessage=d.proto.Message.FutureProofMessage.fromObject(e.limitSharingMessage)}if(e.botTaskMessage!=null){if(typeof e.botTaskMessage!="object")throw TypeError(".proto.Message.botTaskMessage: object expected");i.botTaskMessage=d.proto.Message.FutureProofMessage.fromObject(e.botTaskMessage)}if(e.questionMessage!=null){if(typeof e.questionMessage!="object")throw TypeError(".proto.Message.questionMessage: object expected");i.questionMessage=d.proto.Message.FutureProofMessage.fromObject(e.questionMessage)}if(e.messageHistoryNotice!=null){if(typeof e.messageHistoryNotice!="object")throw TypeError(".proto.Message.messageHistoryNotice: object expected");i.messageHistoryNotice=d.proto.Message.MessageHistoryNotice.fromObject(e.messageHistoryNotice)}if(e.groupStatusMessageV2!=null){if(typeof e.groupStatusMessageV2!="object")throw TypeError(".proto.Message.groupStatusMessageV2: object expected");i.groupStatusMessageV2=d.proto.Message.FutureProofMessage.fromObject(e.groupStatusMessageV2)}if(e.botForwardedMessage!=null){if(typeof e.botForwardedMessage!="object")throw TypeError(".proto.Message.botForwardedMessage: object expected");i.botForwardedMessage=d.proto.Message.FutureProofMessage.fromObject(e.botForwardedMessage)}if(e.statusQuestionAnswerMessage!=null){if(typeof e.statusQuestionAnswerMessage!="object")throw TypeError(".proto.Message.statusQuestionAnswerMessage: object expected");i.statusQuestionAnswerMessage=d.proto.Message.StatusQuestionAnswerMessage.fromObject(e.statusQuestionAnswerMessage)}if(e.questionReplyMessage!=null){if(typeof e.questionReplyMessage!="object")throw TypeError(".proto.Message.questionReplyMessage: object expected");i.questionReplyMessage=d.proto.Message.FutureProofMessage.fromObject(e.questionReplyMessage)}if(e.questionResponseMessage!=null){if(typeof e.questionResponseMessage!="object")throw TypeError(".proto.Message.questionResponseMessage: object expected");i.questionResponseMessage=d.proto.Message.QuestionResponseMessage.fromObject(e.questionResponseMessage)}if(e.statusQuotedMessage!=null){if(typeof e.statusQuotedMessage!="object")throw TypeError(".proto.Message.statusQuotedMessage: object expected");i.statusQuotedMessage=d.proto.Message.StatusQuotedMessage.fromObject(e.statusQuotedMessage)}if(e.statusStickerInteractionMessage!=null){if(typeof e.statusStickerInteractionMessage!="object")throw TypeError(".proto.Message.statusStickerInteractionMessage: object expected");i.statusStickerInteractionMessage=d.proto.Message.StatusStickerInteractionMessage.fromObject(e.statusStickerInteractionMessage)}if(e.pollCreationMessageV5!=null){if(typeof e.pollCreationMessageV5!="object")throw TypeError(".proto.Message.pollCreationMessageV5: object expected");i.pollCreationMessageV5=d.proto.Message.PollCreationMessage.fromObject(e.pollCreationMessageV5)}if(e.newsletterFollowerInviteMessageV2!=null){if(typeof e.newsletterFollowerInviteMessageV2!="object")throw TypeError(".proto.Message.newsletterFollowerInviteMessageV2: object expected");i.newsletterFollowerInviteMessageV2=d.proto.Message.NewsletterFollowerInviteMessage.fromObject(e.newsletterFollowerInviteMessageV2)}if(e.pollResultSnapshotMessageV3!=null){if(typeof e.pollResultSnapshotMessageV3!="object")throw TypeError(".proto.Message.pollResultSnapshotMessageV3: object expected");i.pollResultSnapshotMessageV3=d.proto.Message.PollResultSnapshotMessage.fromObject(e.pollResultSnapshotMessageV3)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.conversation!=null&&e.hasOwnProperty("conversation")&&(A.conversation=e.conversation,i.oneofs&&(A._conversation="conversation")),e.senderKeyDistributionMessage!=null&&e.hasOwnProperty("senderKeyDistributionMessage")&&(A.senderKeyDistributionMessage=d.proto.Message.SenderKeyDistributionMessage.toObject(e.senderKeyDistributionMessage,i),i.oneofs&&(A._senderKeyDistributionMessage="senderKeyDistributionMessage")),e.imageMessage!=null&&e.hasOwnProperty("imageMessage")&&(A.imageMessage=d.proto.Message.ImageMessage.toObject(e.imageMessage,i),i.oneofs&&(A._imageMessage="imageMessage")),e.contactMessage!=null&&e.hasOwnProperty("contactMessage")&&(A.contactMessage=d.proto.Message.ContactMessage.toObject(e.contactMessage,i),i.oneofs&&(A._contactMessage="contactMessage")),e.locationMessage!=null&&e.hasOwnProperty("locationMessage")&&(A.locationMessage=d.proto.Message.LocationMessage.toObject(e.locationMessage,i),i.oneofs&&(A._locationMessage="locationMessage")),e.extendedTextMessage!=null&&e.hasOwnProperty("extendedTextMessage")&&(A.extendedTextMessage=d.proto.Message.ExtendedTextMessage.toObject(e.extendedTextMessage,i),i.oneofs&&(A._extendedTextMessage="extendedTextMessage")),e.documentMessage!=null&&e.hasOwnProperty("documentMessage")&&(A.documentMessage=d.proto.Message.DocumentMessage.toObject(e.documentMessage,i),i.oneofs&&(A._documentMessage="documentMessage")),e.audioMessage!=null&&e.hasOwnProperty("audioMessage")&&(A.audioMessage=d.proto.Message.AudioMessage.toObject(e.audioMessage,i),i.oneofs&&(A._audioMessage="audioMessage")),e.videoMessage!=null&&e.hasOwnProperty("videoMessage")&&(A.videoMessage=d.proto.Message.VideoMessage.toObject(e.videoMessage,i),i.oneofs&&(A._videoMessage="videoMessage")),e.call!=null&&e.hasOwnProperty("call")&&(A.call=d.proto.Message.Call.toObject(e.call,i),i.oneofs&&(A._call="call")),e.chat!=null&&e.hasOwnProperty("chat")&&(A.chat=d.proto.Message.Chat.toObject(e.chat,i),i.oneofs&&(A._chat="chat")),e.protocolMessage!=null&&e.hasOwnProperty("protocolMessage")&&(A.protocolMessage=d.proto.Message.ProtocolMessage.toObject(e.protocolMessage,i),i.oneofs&&(A._protocolMessage="protocolMessage")),e.contactsArrayMessage!=null&&e.hasOwnProperty("contactsArrayMessage")&&(A.contactsArrayMessage=d.proto.Message.ContactsArrayMessage.toObject(e.contactsArrayMessage,i),i.oneofs&&(A._contactsArrayMessage="contactsArrayMessage")),e.highlyStructuredMessage!=null&&e.hasOwnProperty("highlyStructuredMessage")&&(A.highlyStructuredMessage=d.proto.Message.HighlyStructuredMessage.toObject(e.highlyStructuredMessage,i),i.oneofs&&(A._highlyStructuredMessage="highlyStructuredMessage")),e.fastRatchetKeySenderKeyDistributionMessage!=null&&e.hasOwnProperty("fastRatchetKeySenderKeyDistributionMessage")&&(A.fastRatchetKeySenderKeyDistributionMessage=d.proto.Message.SenderKeyDistributionMessage.toObject(e.fastRatchetKeySenderKeyDistributionMessage,i),i.oneofs&&(A._fastRatchetKeySenderKeyDistributionMessage="fastRatchetKeySenderKeyDistributionMessage")),e.sendPaymentMessage!=null&&e.hasOwnProperty("sendPaymentMessage")&&(A.sendPaymentMessage=d.proto.Message.SendPaymentMessage.toObject(e.sendPaymentMessage,i),i.oneofs&&(A._sendPaymentMessage="sendPaymentMessage")),e.liveLocationMessage!=null&&e.hasOwnProperty("liveLocationMessage")&&(A.liveLocationMessage=d.proto.Message.LiveLocationMessage.toObject(e.liveLocationMessage,i),i.oneofs&&(A._liveLocationMessage="liveLocationMessage")),e.requestPaymentMessage!=null&&e.hasOwnProperty("requestPaymentMessage")&&(A.requestPaymentMessage=d.proto.Message.RequestPaymentMessage.toObject(e.requestPaymentMessage,i),i.oneofs&&(A._requestPaymentMessage="requestPaymentMessage")),e.declinePaymentRequestMessage!=null&&e.hasOwnProperty("declinePaymentRequestMessage")&&(A.declinePaymentRequestMessage=d.proto.Message.DeclinePaymentRequestMessage.toObject(e.declinePaymentRequestMessage,i),i.oneofs&&(A._declinePaymentRequestMessage="declinePaymentRequestMessage")),e.cancelPaymentRequestMessage!=null&&e.hasOwnProperty("cancelPaymentRequestMessage")&&(A.cancelPaymentRequestMessage=d.proto.Message.CancelPaymentRequestMessage.toObject(e.cancelPaymentRequestMessage,i),i.oneofs&&(A._cancelPaymentRequestMessage="cancelPaymentRequestMessage")),e.templateMessage!=null&&e.hasOwnProperty("templateMessage")&&(A.templateMessage=d.proto.Message.TemplateMessage.toObject(e.templateMessage,i),i.oneofs&&(A._templateMessage="templateMessage")),e.stickerMessage!=null&&e.hasOwnProperty("stickerMessage")&&(A.stickerMessage=d.proto.Message.StickerMessage.toObject(e.stickerMessage,i),i.oneofs&&(A._stickerMessage="stickerMessage")),e.groupInviteMessage!=null&&e.hasOwnProperty("groupInviteMessage")&&(A.groupInviteMessage=d.proto.Message.GroupInviteMessage.toObject(e.groupInviteMessage,i),i.oneofs&&(A._groupInviteMessage="groupInviteMessage")),e.templateButtonReplyMessage!=null&&e.hasOwnProperty("templateButtonReplyMessage")&&(A.templateButtonReplyMessage=d.proto.Message.TemplateButtonReplyMessage.toObject(e.templateButtonReplyMessage,i),i.oneofs&&(A._templateButtonReplyMessage="templateButtonReplyMessage")),e.productMessage!=null&&e.hasOwnProperty("productMessage")&&(A.productMessage=d.proto.Message.ProductMessage.toObject(e.productMessage,i),i.oneofs&&(A._productMessage="productMessage")),e.deviceSentMessage!=null&&e.hasOwnProperty("deviceSentMessage")&&(A.deviceSentMessage=d.proto.Message.DeviceSentMessage.toObject(e.deviceSentMessage,i),i.oneofs&&(A._deviceSentMessage="deviceSentMessage")),e.messageContextInfo!=null&&e.hasOwnProperty("messageContextInfo")&&(A.messageContextInfo=d.proto.MessageContextInfo.toObject(e.messageContextInfo,i),i.oneofs&&(A._messageContextInfo="messageContextInfo")),e.listMessage!=null&&e.hasOwnProperty("listMessage")&&(A.listMessage=d.proto.Message.ListMessage.toObject(e.listMessage,i),i.oneofs&&(A._listMessage="listMessage")),e.viewOnceMessage!=null&&e.hasOwnProperty("viewOnceMessage")&&(A.viewOnceMessage=d.proto.Message.FutureProofMessage.toObject(e.viewOnceMessage,i),i.oneofs&&(A._viewOnceMessage="viewOnceMessage")),e.orderMessage!=null&&e.hasOwnProperty("orderMessage")&&(A.orderMessage=d.proto.Message.OrderMessage.toObject(e.orderMessage,i),i.oneofs&&(A._orderMessage="orderMessage")),e.listResponseMessage!=null&&e.hasOwnProperty("listResponseMessage")&&(A.listResponseMessage=d.proto.Message.ListResponseMessage.toObject(e.listResponseMessage,i),i.oneofs&&(A._listResponseMessage="listResponseMessage")),e.ephemeralMessage!=null&&e.hasOwnProperty("ephemeralMessage")&&(A.ephemeralMessage=d.proto.Message.FutureProofMessage.toObject(e.ephemeralMessage,i),i.oneofs&&(A._ephemeralMessage="ephemeralMessage")),e.invoiceMessage!=null&&e.hasOwnProperty("invoiceMessage")&&(A.invoiceMessage=d.proto.Message.InvoiceMessage.toObject(e.invoiceMessage,i),i.oneofs&&(A._invoiceMessage="invoiceMessage")),e.buttonsMessage!=null&&e.hasOwnProperty("buttonsMessage")&&(A.buttonsMessage=d.proto.Message.ButtonsMessage.toObject(e.buttonsMessage,i),i.oneofs&&(A._buttonsMessage="buttonsMessage")),e.buttonsResponseMessage!=null&&e.hasOwnProperty("buttonsResponseMessage")&&(A.buttonsResponseMessage=d.proto.Message.ButtonsResponseMessage.toObject(e.buttonsResponseMessage,i),i.oneofs&&(A._buttonsResponseMessage="buttonsResponseMessage")),e.paymentInviteMessage!=null&&e.hasOwnProperty("paymentInviteMessage")&&(A.paymentInviteMessage=d.proto.Message.PaymentInviteMessage.toObject(e.paymentInviteMessage,i),i.oneofs&&(A._paymentInviteMessage="paymentInviteMessage")),e.interactiveMessage!=null&&e.hasOwnProperty("interactiveMessage")&&(A.interactiveMessage=d.proto.Message.InteractiveMessage.toObject(e.interactiveMessage,i),i.oneofs&&(A._interactiveMessage="interactiveMessage")),e.reactionMessage!=null&&e.hasOwnProperty("reactionMessage")&&(A.reactionMessage=d.proto.Message.ReactionMessage.toObject(e.reactionMessage,i),i.oneofs&&(A._reactionMessage="reactionMessage")),e.stickerSyncRmrMessage!=null&&e.hasOwnProperty("stickerSyncRmrMessage")&&(A.stickerSyncRmrMessage=d.proto.Message.StickerSyncRMRMessage.toObject(e.stickerSyncRmrMessage,i),i.oneofs&&(A._stickerSyncRmrMessage="stickerSyncRmrMessage")),e.interactiveResponseMessage!=null&&e.hasOwnProperty("interactiveResponseMessage")&&(A.interactiveResponseMessage=d.proto.Message.InteractiveResponseMessage.toObject(e.interactiveResponseMessage,i),i.oneofs&&(A._interactiveResponseMessage="interactiveResponseMessage")),e.pollCreationMessage!=null&&e.hasOwnProperty("pollCreationMessage")&&(A.pollCreationMessage=d.proto.Message.PollCreationMessage.toObject(e.pollCreationMessage,i),i.oneofs&&(A._pollCreationMessage="pollCreationMessage")),e.pollUpdateMessage!=null&&e.hasOwnProperty("pollUpdateMessage")&&(A.pollUpdateMessage=d.proto.Message.PollUpdateMessage.toObject(e.pollUpdateMessage,i),i.oneofs&&(A._pollUpdateMessage="pollUpdateMessage")),e.keepInChatMessage!=null&&e.hasOwnProperty("keepInChatMessage")&&(A.keepInChatMessage=d.proto.Message.KeepInChatMessage.toObject(e.keepInChatMessage,i),i.oneofs&&(A._keepInChatMessage="keepInChatMessage")),e.documentWithCaptionMessage!=null&&e.hasOwnProperty("documentWithCaptionMessage")&&(A.documentWithCaptionMessage=d.proto.Message.FutureProofMessage.toObject(e.documentWithCaptionMessage,i),i.oneofs&&(A._documentWithCaptionMessage="documentWithCaptionMessage")),e.requestPhoneNumberMessage!=null&&e.hasOwnProperty("requestPhoneNumberMessage")&&(A.requestPhoneNumberMessage=d.proto.Message.RequestPhoneNumberMessage.toObject(e.requestPhoneNumberMessage,i),i.oneofs&&(A._requestPhoneNumberMessage="requestPhoneNumberMessage")),e.viewOnceMessageV2!=null&&e.hasOwnProperty("viewOnceMessageV2")&&(A.viewOnceMessageV2=d.proto.Message.FutureProofMessage.toObject(e.viewOnceMessageV2,i),i.oneofs&&(A._viewOnceMessageV2="viewOnceMessageV2")),e.encReactionMessage!=null&&e.hasOwnProperty("encReactionMessage")&&(A.encReactionMessage=d.proto.Message.EncReactionMessage.toObject(e.encReactionMessage,i),i.oneofs&&(A._encReactionMessage="encReactionMessage")),e.editedMessage!=null&&e.hasOwnProperty("editedMessage")&&(A.editedMessage=d.proto.Message.FutureProofMessage.toObject(e.editedMessage,i),i.oneofs&&(A._editedMessage="editedMessage")),e.viewOnceMessageV2Extension!=null&&e.hasOwnProperty("viewOnceMessageV2Extension")&&(A.viewOnceMessageV2Extension=d.proto.Message.FutureProofMessage.toObject(e.viewOnceMessageV2Extension,i),i.oneofs&&(A._viewOnceMessageV2Extension="viewOnceMessageV2Extension")),e.pollCreationMessageV2!=null&&e.hasOwnProperty("pollCreationMessageV2")&&(A.pollCreationMessageV2=d.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV2,i),i.oneofs&&(A._pollCreationMessageV2="pollCreationMessageV2")),e.scheduledCallCreationMessage!=null&&e.hasOwnProperty("scheduledCallCreationMessage")&&(A.scheduledCallCreationMessage=d.proto.Message.ScheduledCallCreationMessage.toObject(e.scheduledCallCreationMessage,i),i.oneofs&&(A._scheduledCallCreationMessage="scheduledCallCreationMessage")),e.groupMentionedMessage!=null&&e.hasOwnProperty("groupMentionedMessage")&&(A.groupMentionedMessage=d.proto.Message.FutureProofMessage.toObject(e.groupMentionedMessage,i),i.oneofs&&(A._groupMentionedMessage="groupMentionedMessage")),e.pinInChatMessage!=null&&e.hasOwnProperty("pinInChatMessage")&&(A.pinInChatMessage=d.proto.Message.PinInChatMessage.toObject(e.pinInChatMessage,i),i.oneofs&&(A._pinInChatMessage="pinInChatMessage")),e.pollCreationMessageV3!=null&&e.hasOwnProperty("pollCreationMessageV3")&&(A.pollCreationMessageV3=d.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV3,i),i.oneofs&&(A._pollCreationMessageV3="pollCreationMessageV3")),e.scheduledCallEditMessage!=null&&e.hasOwnProperty("scheduledCallEditMessage")&&(A.scheduledCallEditMessage=d.proto.Message.ScheduledCallEditMessage.toObject(e.scheduledCallEditMessage,i),i.oneofs&&(A._scheduledCallEditMessage="scheduledCallEditMessage")),e.ptvMessage!=null&&e.hasOwnProperty("ptvMessage")&&(A.ptvMessage=d.proto.Message.VideoMessage.toObject(e.ptvMessage,i),i.oneofs&&(A._ptvMessage="ptvMessage")),e.botInvokeMessage!=null&&e.hasOwnProperty("botInvokeMessage")&&(A.botInvokeMessage=d.proto.Message.FutureProofMessage.toObject(e.botInvokeMessage,i),i.oneofs&&(A._botInvokeMessage="botInvokeMessage")),e.callLogMesssage!=null&&e.hasOwnProperty("callLogMesssage")&&(A.callLogMesssage=d.proto.Message.CallLogMessage.toObject(e.callLogMesssage,i),i.oneofs&&(A._callLogMesssage="callLogMesssage")),e.messageHistoryBundle!=null&&e.hasOwnProperty("messageHistoryBundle")&&(A.messageHistoryBundle=d.proto.Message.MessageHistoryBundle.toObject(e.messageHistoryBundle,i),i.oneofs&&(A._messageHistoryBundle="messageHistoryBundle")),e.encCommentMessage!=null&&e.hasOwnProperty("encCommentMessage")&&(A.encCommentMessage=d.proto.Message.EncCommentMessage.toObject(e.encCommentMessage,i),i.oneofs&&(A._encCommentMessage="encCommentMessage")),e.bcallMessage!=null&&e.hasOwnProperty("bcallMessage")&&(A.bcallMessage=d.proto.Message.BCallMessage.toObject(e.bcallMessage,i),i.oneofs&&(A._bcallMessage="bcallMessage")),e.lottieStickerMessage!=null&&e.hasOwnProperty("lottieStickerMessage")&&(A.lottieStickerMessage=d.proto.Message.FutureProofMessage.toObject(e.lottieStickerMessage,i),i.oneofs&&(A._lottieStickerMessage="lottieStickerMessage")),e.eventMessage!=null&&e.hasOwnProperty("eventMessage")&&(A.eventMessage=d.proto.Message.EventMessage.toObject(e.eventMessage,i),i.oneofs&&(A._eventMessage="eventMessage")),e.encEventResponseMessage!=null&&e.hasOwnProperty("encEventResponseMessage")&&(A.encEventResponseMessage=d.proto.Message.EncEventResponseMessage.toObject(e.encEventResponseMessage,i),i.oneofs&&(A._encEventResponseMessage="encEventResponseMessage")),e.commentMessage!=null&&e.hasOwnProperty("commentMessage")&&(A.commentMessage=d.proto.Message.CommentMessage.toObject(e.commentMessage,i),i.oneofs&&(A._commentMessage="commentMessage")),e.newsletterAdminInviteMessage!=null&&e.hasOwnProperty("newsletterAdminInviteMessage")&&(A.newsletterAdminInviteMessage=d.proto.Message.NewsletterAdminInviteMessage.toObject(e.newsletterAdminInviteMessage,i),i.oneofs&&(A._newsletterAdminInviteMessage="newsletterAdminInviteMessage")),e.placeholderMessage!=null&&e.hasOwnProperty("placeholderMessage")&&(A.placeholderMessage=d.proto.Message.PlaceholderMessage.toObject(e.placeholderMessage,i),i.oneofs&&(A._placeholderMessage="placeholderMessage")),e.secretEncryptedMessage!=null&&e.hasOwnProperty("secretEncryptedMessage")&&(A.secretEncryptedMessage=d.proto.Message.SecretEncryptedMessage.toObject(e.secretEncryptedMessage,i),i.oneofs&&(A._secretEncryptedMessage="secretEncryptedMessage")),e.albumMessage!=null&&e.hasOwnProperty("albumMessage")&&(A.albumMessage=d.proto.Message.AlbumMessage.toObject(e.albumMessage,i),i.oneofs&&(A._albumMessage="albumMessage")),e.eventCoverImage!=null&&e.hasOwnProperty("eventCoverImage")&&(A.eventCoverImage=d.proto.Message.FutureProofMessage.toObject(e.eventCoverImage,i),i.oneofs&&(A._eventCoverImage="eventCoverImage")),e.stickerPackMessage!=null&&e.hasOwnProperty("stickerPackMessage")&&(A.stickerPackMessage=d.proto.Message.StickerPackMessage.toObject(e.stickerPackMessage,i),i.oneofs&&(A._stickerPackMessage="stickerPackMessage")),e.statusMentionMessage!=null&&e.hasOwnProperty("statusMentionMessage")&&(A.statusMentionMessage=d.proto.Message.FutureProofMessage.toObject(e.statusMentionMessage,i),i.oneofs&&(A._statusMentionMessage="statusMentionMessage")),e.pollResultSnapshotMessage!=null&&e.hasOwnProperty("pollResultSnapshotMessage")&&(A.pollResultSnapshotMessage=d.proto.Message.PollResultSnapshotMessage.toObject(e.pollResultSnapshotMessage,i),i.oneofs&&(A._pollResultSnapshotMessage="pollResultSnapshotMessage")),e.pollCreationOptionImageMessage!=null&&e.hasOwnProperty("pollCreationOptionImageMessage")&&(A.pollCreationOptionImageMessage=d.proto.Message.FutureProofMessage.toObject(e.pollCreationOptionImageMessage,i),i.oneofs&&(A._pollCreationOptionImageMessage="pollCreationOptionImageMessage")),e.associatedChildMessage!=null&&e.hasOwnProperty("associatedChildMessage")&&(A.associatedChildMessage=d.proto.Message.FutureProofMessage.toObject(e.associatedChildMessage,i),i.oneofs&&(A._associatedChildMessage="associatedChildMessage")),e.groupStatusMentionMessage!=null&&e.hasOwnProperty("groupStatusMentionMessage")&&(A.groupStatusMentionMessage=d.proto.Message.FutureProofMessage.toObject(e.groupStatusMentionMessage,i),i.oneofs&&(A._groupStatusMentionMessage="groupStatusMentionMessage")),e.pollCreationMessageV4!=null&&e.hasOwnProperty("pollCreationMessageV4")&&(A.pollCreationMessageV4=d.proto.Message.FutureProofMessage.toObject(e.pollCreationMessageV4,i),i.oneofs&&(A._pollCreationMessageV4="pollCreationMessageV4")),e.statusAddYours!=null&&e.hasOwnProperty("statusAddYours")&&(A.statusAddYours=d.proto.Message.FutureProofMessage.toObject(e.statusAddYours,i),i.oneofs&&(A._statusAddYours="statusAddYours")),e.groupStatusMessage!=null&&e.hasOwnProperty("groupStatusMessage")&&(A.groupStatusMessage=d.proto.Message.FutureProofMessage.toObject(e.groupStatusMessage,i),i.oneofs&&(A._groupStatusMessage="groupStatusMessage")),e.richResponseMessage!=null&&e.hasOwnProperty("richResponseMessage")&&(A.richResponseMessage=d.proto.AIRichResponseMessage.toObject(e.richResponseMessage,i),i.oneofs&&(A._richResponseMessage="richResponseMessage")),e.statusNotificationMessage!=null&&e.hasOwnProperty("statusNotificationMessage")&&(A.statusNotificationMessage=d.proto.Message.StatusNotificationMessage.toObject(e.statusNotificationMessage,i),i.oneofs&&(A._statusNotificationMessage="statusNotificationMessage")),e.limitSharingMessage!=null&&e.hasOwnProperty("limitSharingMessage")&&(A.limitSharingMessage=d.proto.Message.FutureProofMessage.toObject(e.limitSharingMessage,i),i.oneofs&&(A._limitSharingMessage="limitSharingMessage")),e.botTaskMessage!=null&&e.hasOwnProperty("botTaskMessage")&&(A.botTaskMessage=d.proto.Message.FutureProofMessage.toObject(e.botTaskMessage,i),i.oneofs&&(A._botTaskMessage="botTaskMessage")),e.questionMessage!=null&&e.hasOwnProperty("questionMessage")&&(A.questionMessage=d.proto.Message.FutureProofMessage.toObject(e.questionMessage,i),i.oneofs&&(A._questionMessage="questionMessage")),e.messageHistoryNotice!=null&&e.hasOwnProperty("messageHistoryNotice")&&(A.messageHistoryNotice=d.proto.Message.MessageHistoryNotice.toObject(e.messageHistoryNotice,i),i.oneofs&&(A._messageHistoryNotice="messageHistoryNotice")),e.groupStatusMessageV2!=null&&e.hasOwnProperty("groupStatusMessageV2")&&(A.groupStatusMessageV2=d.proto.Message.FutureProofMessage.toObject(e.groupStatusMessageV2,i),i.oneofs&&(A._groupStatusMessageV2="groupStatusMessageV2")),e.botForwardedMessage!=null&&e.hasOwnProperty("botForwardedMessage")&&(A.botForwardedMessage=d.proto.Message.FutureProofMessage.toObject(e.botForwardedMessage,i),i.oneofs&&(A._botForwardedMessage="botForwardedMessage")),e.statusQuestionAnswerMessage!=null&&e.hasOwnProperty("statusQuestionAnswerMessage")&&(A.statusQuestionAnswerMessage=d.proto.Message.StatusQuestionAnswerMessage.toObject(e.statusQuestionAnswerMessage,i),i.oneofs&&(A._statusQuestionAnswerMessage="statusQuestionAnswerMessage")),e.questionReplyMessage!=null&&e.hasOwnProperty("questionReplyMessage")&&(A.questionReplyMessage=d.proto.Message.FutureProofMessage.toObject(e.questionReplyMessage,i),i.oneofs&&(A._questionReplyMessage="questionReplyMessage")),e.questionResponseMessage!=null&&e.hasOwnProperty("questionResponseMessage")&&(A.questionResponseMessage=d.proto.Message.QuestionResponseMessage.toObject(e.questionResponseMessage,i),i.oneofs&&(A._questionResponseMessage="questionResponseMessage")),e.statusQuotedMessage!=null&&e.hasOwnProperty("statusQuotedMessage")&&(A.statusQuotedMessage=d.proto.Message.StatusQuotedMessage.toObject(e.statusQuotedMessage,i),i.oneofs&&(A._statusQuotedMessage="statusQuotedMessage")),e.statusStickerInteractionMessage!=null&&e.hasOwnProperty("statusStickerInteractionMessage")&&(A.statusStickerInteractionMessage=d.proto.Message.StatusStickerInteractionMessage.toObject(e.statusStickerInteractionMessage,i),i.oneofs&&(A._statusStickerInteractionMessage="statusStickerInteractionMessage")),e.pollCreationMessageV5!=null&&e.hasOwnProperty("pollCreationMessageV5")&&(A.pollCreationMessageV5=d.proto.Message.PollCreationMessage.toObject(e.pollCreationMessageV5,i),i.oneofs&&(A._pollCreationMessageV5="pollCreationMessageV5")),e.newsletterFollowerInviteMessageV2!=null&&e.hasOwnProperty("newsletterFollowerInviteMessageV2")&&(A.newsletterFollowerInviteMessageV2=d.proto.Message.NewsletterFollowerInviteMessage.toObject(e.newsletterFollowerInviteMessageV2,i),i.oneofs&&(A._newsletterFollowerInviteMessageV2="newsletterFollowerInviteMessageV2")),e.pollResultSnapshotMessageV3!=null&&e.hasOwnProperty("pollResultSnapshotMessageV3")&&(A.pollResultSnapshotMessageV3=d.proto.Message.PollResultSnapshotMessage.toObject(e.pollResultSnapshotMessageV3,i),i.oneofs&&(A._pollResultSnapshotMessageV3="pollResultSnapshotMessageV3")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Message"},t.AlbumMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 2:{c.expectedImageCount=A.uint32();break}case 3:{c.expectedVideoCount=A.uint32();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.AlbumMessage)return A;var r=new d.proto.Message.AlbumMessage;if(A.expectedImageCount!=null&&(r.expectedImageCount=A.expectedImageCount>>>0),A.expectedVideoCount!=null&&(r.expectedVideoCount=A.expectedVideoCount>>>0),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.AlbumMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.expectedImageCount!=null&&A.hasOwnProperty("expectedImageCount")&&(s.expectedImageCount=A.expectedImageCount,r.oneofs&&(s._expectedImageCount="expectedImageCount")),A.expectedVideoCount!=null&&A.hasOwnProperty("expectedVideoCount")&&(s.expectedVideoCount=A.expectedVideoCount,r.oneofs&&(s._expectedVideoCount="expectedVideoCount")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AlbumMessage"},a})(),t.AppStateFatalExceptionNotification=(function(){function a(i){if(this.collectionNames=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.collectionNames&&c.collectionNames.length||(c.collectionNames=[]),c.collectionNames.push(A.string());break}case 2:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.AppStateFatalExceptionNotification)return A;var r=new d.proto.Message.AppStateFatalExceptionNotification;if(A.collectionNames){if(!Array.isArray(A.collectionNames))throw TypeError(".proto.Message.AppStateFatalExceptionNotification.collectionNames: array expected");r.collectionNames=[];for(var s=0;s>>0,A.timestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.collectionNames=[]),A.collectionNames&&A.collectionNames.length){s.collectionNames=[];for(var g=0;g>>3){case 1:{c.keyId=d.proto.Message.AppStateSyncKeyId.decode(A,A.uint32());break}case 2:{c.keyData=d.proto.Message.AppStateSyncKeyData.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.AppStateSyncKey)return A;var r=new d.proto.Message.AppStateSyncKey;if(A.keyId!=null){if(typeof A.keyId!="object")throw TypeError(".proto.Message.AppStateSyncKey.keyId: object expected");r.keyId=d.proto.Message.AppStateSyncKeyId.fromObject(A.keyId)}if(A.keyData!=null){if(typeof A.keyData!="object")throw TypeError(".proto.Message.AppStateSyncKey.keyData: object expected");r.keyData=d.proto.Message.AppStateSyncKeyData.fromObject(A.keyData)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.keyId!=null&&A.hasOwnProperty("keyId")&&(s.keyId=d.proto.Message.AppStateSyncKeyId.toObject(A.keyId,r),r.oneofs&&(s._keyId="keyId")),A.keyData!=null&&A.hasOwnProperty("keyData")&&(s.keyData=d.proto.Message.AppStateSyncKeyData.toObject(A.keyData,r),r.oneofs&&(s._keyData="keyData")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKey"},a})(),t.AppStateSyncKeyData=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.keyData=A.bytes();break}case 2:{c.fingerprint=d.proto.Message.AppStateSyncKeyFingerprint.decode(A,A.uint32());break}case 3:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.AppStateSyncKeyData)return A;var r=new d.proto.Message.AppStateSyncKeyData;if(A.keyData!=null&&(typeof A.keyData=="string"?l.base64.decode(A.keyData,r.keyData=l.newBuffer(l.base64.length(A.keyData)),0):A.keyData.length>=0&&(r.keyData=A.keyData)),A.fingerprint!=null){if(typeof A.fingerprint!="object")throw TypeError(".proto.Message.AppStateSyncKeyData.fingerprint: object expected");r.fingerprint=d.proto.Message.AppStateSyncKeyFingerprint.fromObject(A.fingerprint)}return A.timestamp!=null&&(l.Long?(r.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?r.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?r.timestamp=A.timestamp:typeof A.timestamp=="object"&&(r.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.keyData!=null&&A.hasOwnProperty("keyData")&&(s.keyData=r.bytes===String?l.base64.encode(A.keyData,0,A.keyData.length):r.bytes===Array?Array.prototype.slice.call(A.keyData):A.keyData,r.oneofs&&(s._keyData="keyData")),A.fingerprint!=null&&A.hasOwnProperty("fingerprint")&&(s.fingerprint=d.proto.Message.AppStateSyncKeyFingerprint.toObject(A.fingerprint,r),r.oneofs&&(s._fingerprint="fingerprint")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=r.longs===String?String(A.timestamp):A.timestamp:s.timestamp=r.longs===String?ge(A.timestamp):r.longs===Number?ce(A.timestamp):A.timestamp,r.oneofs&&(s._timestamp="timestamp")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKeyData"},a})(),t.AppStateSyncKeyFingerprint=(function(){function a(i){if(this.deviceIndexes=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.rawId=A.uint32();break}case 2:{c.currentIndex=A.uint32();break}case 3:{if(c.deviceIndexes&&c.deviceIndexes.length||(c.deviceIndexes=[]),(I&7)===2)for(var p=A.uint32()+A.pos;A.pos>>0),A.currentIndex!=null&&(r.currentIndex=A.currentIndex>>>0),A.deviceIndexes){if(!Array.isArray(A.deviceIndexes))throw TypeError(".proto.Message.AppStateSyncKeyFingerprint.deviceIndexes: array expected");r.deviceIndexes=[];for(var s=0;s>>0}return r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.deviceIndexes=[]),A.rawId!=null&&A.hasOwnProperty("rawId")&&(s.rawId=A.rawId,r.oneofs&&(s._rawId="rawId")),A.currentIndex!=null&&A.hasOwnProperty("currentIndex")&&(s.currentIndex=A.currentIndex,r.oneofs&&(s._currentIndex="currentIndex")),A.deviceIndexes&&A.deviceIndexes.length){s.deviceIndexes=[];for(var g=0;g>>3){case 1:{c.keyId=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.AppStateSyncKeyId)return A;var r=new d.proto.Message.AppStateSyncKeyId;return A.keyId!=null&&(typeof A.keyId=="string"?l.base64.decode(A.keyId,r.keyId=l.newBuffer(l.base64.length(A.keyId)),0):A.keyId.length>=0&&(r.keyId=A.keyId)),r},a.toObject=function(A,r){r||(r={});var s={};return A.keyId!=null&&A.hasOwnProperty("keyId")&&(s.keyId=r.bytes===String?l.base64.encode(A.keyId,0,A.keyId.length):r.bytes===Array?Array.prototype.slice.call(A.keyId):A.keyId,r.oneofs&&(s._keyId="keyId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AppStateSyncKeyId"},a})(),t.AppStateSyncKeyRequest=(function(){function a(e){if(this.keyIds=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.keyIds&&g.keyIds.length||(g.keyIds=[]),g.keyIds.push(d.proto.Message.AppStateSyncKeyId.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.Message.AppStateSyncKeyRequest)return i;var A=new d.proto.Message.AppStateSyncKeyRequest;if(i.keyIds){if(!Array.isArray(i.keyIds))throw TypeError(".proto.Message.AppStateSyncKeyRequest.keyIds: array expected");A.keyIds=[];for(var r=0;r>>3){case 1:{g.keys&&g.keys.length||(g.keys=[]),g.keys.push(d.proto.Message.AppStateSyncKey.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.Message.AppStateSyncKeyShare)return i;var A=new d.proto.Message.AppStateSyncKeyShare;if(i.keys){if(!Array.isArray(i.keys))throw TypeError(".proto.Message.AppStateSyncKeyShare.keys: array expected");A.keys=[];for(var r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileLength=A.uint64();break}case 5:{c.seconds=A.uint32();break}case 6:{c.ptt=A.bool();break}case 7:{c.mediaKey=A.bytes();break}case 8:{c.fileEncSha256=A.bytes();break}case 9:{c.directPath=A.string();break}case 10:{c.mediaKeyTimestamp=A.int64();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.streamingSidecar=A.bytes();break}case 19:{c.waveform=A.bytes();break}case 20:{c.backgroundArgb=A.fixed32();break}case 21:{c.viewOnce=A.bool();break}case 22:{c.accessibilityLabel=A.string();break}case 23:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.AudioMessage)return A;var r=new d.proto.Message.AudioMessage;if(A.url!=null&&(r.url=String(A.url)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.seconds!=null&&(r.seconds=A.seconds>>>0),A.ptt!=null&&(r.ptt=!!A.ptt),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.AudioMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.streamingSidecar!=null&&(typeof A.streamingSidecar=="string"?l.base64.decode(A.streamingSidecar,r.streamingSidecar=l.newBuffer(l.base64.length(A.streamingSidecar)),0):A.streamingSidecar.length>=0&&(r.streamingSidecar=A.streamingSidecar)),A.waveform!=null&&(typeof A.waveform=="string"?l.base64.decode(A.waveform,r.waveform=l.newBuffer(l.base64.length(A.waveform)),0):A.waveform.length>=0&&(r.waveform=A.waveform)),A.backgroundArgb!=null&&(r.backgroundArgb=A.backgroundArgb>>>0),A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.accessibilityLabel!=null&&(r.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.seconds!=null&&A.hasOwnProperty("seconds")&&(s.seconds=A.seconds,r.oneofs&&(s._seconds="seconds")),A.ptt!=null&&A.hasOwnProperty("ptt")&&(s.ptt=A.ptt,r.oneofs&&(s._ptt="ptt")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.streamingSidecar!=null&&A.hasOwnProperty("streamingSidecar")&&(s.streamingSidecar=r.bytes===String?l.base64.encode(A.streamingSidecar,0,A.streamingSidecar.length):r.bytes===Array?Array.prototype.slice.call(A.streamingSidecar):A.streamingSidecar,r.oneofs&&(s._streamingSidecar="streamingSidecar")),A.waveform!=null&&A.hasOwnProperty("waveform")&&(s.waveform=r.bytes===String?l.base64.encode(A.waveform,0,A.waveform.length):r.bytes===Array?Array.prototype.slice.call(A.waveform):A.waveform,r.oneofs&&(s._waveform="waveform")),A.backgroundArgb!=null&&A.hasOwnProperty("backgroundArgb")&&(s.backgroundArgb=A.backgroundArgb,r.oneofs&&(s._backgroundArgb="backgroundArgb")),A.viewOnce!=null&&A.hasOwnProperty("viewOnce")&&(s.viewOnce=A.viewOnce,r.oneofs&&(s._viewOnce="viewOnce")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,r.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.AudioMessage"},a})(),t.BCallMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.sessionId=A.string();break}case 2:{c.mediaType=A.int32();break}case 3:{c.masterKey=A.bytes();break}case 4:{c.caption=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.BCallMessage)return A;var r=new d.proto.Message.BCallMessage;switch(A.sessionId!=null&&(r.sessionId=String(A.sessionId)),A.mediaType){default:if(typeof A.mediaType=="number"){r.mediaType=A.mediaType;break}break;case"UNKNOWN":case 0:r.mediaType=0;break;case"AUDIO":case 1:r.mediaType=1;break;case"VIDEO":case 2:r.mediaType=2;break}return A.masterKey!=null&&(typeof A.masterKey=="string"?l.base64.decode(A.masterKey,r.masterKey=l.newBuffer(l.base64.length(A.masterKey)),0):A.masterKey.length>=0&&(r.masterKey=A.masterKey)),A.caption!=null&&(r.caption=String(A.caption)),r},a.toObject=function(A,r){r||(r={});var s={};return A.sessionId!=null&&A.hasOwnProperty("sessionId")&&(s.sessionId=A.sessionId,r.oneofs&&(s._sessionId="sessionId")),A.mediaType!=null&&A.hasOwnProperty("mediaType")&&(s.mediaType=r.enums===String?d.proto.Message.BCallMessage.MediaType[A.mediaType]===void 0?A.mediaType:d.proto.Message.BCallMessage.MediaType[A.mediaType]:A.mediaType,r.oneofs&&(s._mediaType="mediaType")),A.masterKey!=null&&A.hasOwnProperty("masterKey")&&(s.masterKey=r.bytes===String?l.base64.encode(A.masterKey,0,A.masterKey.length):r.bytes===Array?Array.prototype.slice.call(A.masterKey):A.masterKey,r.oneofs&&(s._masterKey="masterKey")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.BCallMessage"},a.MediaType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="AUDIO"]=1,A[i[2]="VIDEO"]=2,A})(),a})(),t.ButtonsMessage=(function(){function a(i){if(this.buttons=[],i)for(var A=Object.keys(i),r=0;r>>3){case 6:{c.contentText=A.string();break}case 7:{c.footerText=A.string();break}case 8:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 9:{c.buttons&&c.buttons.length||(c.buttons=[]),c.buttons.push(d.proto.Message.ButtonsMessage.Button.decode(A,A.uint32()));break}case 10:{c.headerType=A.int32();break}case 1:{c.text=A.string();break}case 2:{c.documentMessage=d.proto.Message.DocumentMessage.decode(A,A.uint32());break}case 3:{c.imageMessage=d.proto.Message.ImageMessage.decode(A,A.uint32());break}case 4:{c.videoMessage=d.proto.Message.VideoMessage.decode(A,A.uint32());break}case 5:{c.locationMessage=d.proto.Message.LocationMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ButtonsMessage)return A;var r=new d.proto.Message.ButtonsMessage;if(A.contentText!=null&&(r.contentText=String(A.contentText)),A.footerText!=null&&(r.footerText=String(A.footerText)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ButtonsMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.buttons){if(!Array.isArray(A.buttons))throw TypeError(".proto.Message.ButtonsMessage.buttons: array expected");r.buttons=[];for(var s=0;s>>3){case 1:{p.buttonId=s.string();break}case 2:{p.buttonText=d.proto.Message.ButtonsMessage.Button.ButtonText.decode(s,s.uint32());break}case 3:{p.type=s.int32();break}case 4:{p.nativeFlowInfo=d.proto.Message.ButtonsMessage.Button.NativeFlowInfo.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ButtonsMessage.Button)return s;var g=new d.proto.Message.ButtonsMessage.Button;if(s.buttonId!=null&&(g.buttonId=String(s.buttonId)),s.buttonText!=null){if(typeof s.buttonText!="object")throw TypeError(".proto.Message.ButtonsMessage.Button.buttonText: object expected");g.buttonText=d.proto.Message.ButtonsMessage.Button.ButtonText.fromObject(s.buttonText)}switch(s.type){default:if(typeof s.type=="number"){g.type=s.type;break}break;case"UNKNOWN":case 0:g.type=0;break;case"RESPONSE":case 1:g.type=1;break;case"NATIVE_FLOW":case 2:g.type=2;break}if(s.nativeFlowInfo!=null){if(typeof s.nativeFlowInfo!="object")throw TypeError(".proto.Message.ButtonsMessage.Button.nativeFlowInfo: object expected");g.nativeFlowInfo=d.proto.Message.ButtonsMessage.Button.NativeFlowInfo.fromObject(s.nativeFlowInfo)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.buttonId!=null&&s.hasOwnProperty("buttonId")&&(c.buttonId=s.buttonId,g.oneofs&&(c._buttonId="buttonId")),s.buttonText!=null&&s.hasOwnProperty("buttonText")&&(c.buttonText=d.proto.Message.ButtonsMessage.Button.ButtonText.toObject(s.buttonText,g),g.oneofs&&(c._buttonText="buttonText")),s.type!=null&&s.hasOwnProperty("type")&&(c.type=g.enums===String?d.proto.Message.ButtonsMessage.Button.Type[s.type]===void 0?s.type:d.proto.Message.ButtonsMessage.Button.Type[s.type]:s.type,g.oneofs&&(c._type="type")),s.nativeFlowInfo!=null&&s.hasOwnProperty("nativeFlowInfo")&&(c.nativeFlowInfo=d.proto.Message.ButtonsMessage.Button.NativeFlowInfo.toObject(s.nativeFlowInfo,g),g.oneofs&&(c._nativeFlowInfo="nativeFlowInfo")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ButtonsMessage.Button"},i.ButtonText=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.displayText=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.ButtonsMessage.Button.ButtonText)return c;var I=new d.proto.Message.ButtonsMessage.Button.ButtonText;return c.displayText!=null&&(I.displayText=String(c.displayText)),I},r.toObject=function(c,I){I||(I={});var p={};return c.displayText!=null&&c.hasOwnProperty("displayText")&&(p.displayText=c.displayText,I.oneofs&&(p._displayText="displayText")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.ButtonsMessage.Button.ButtonText"},r})(),i.NativeFlowInfo=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.name=c.string();break}case 2:{f.paramsJson=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.ButtonsMessage.Button.NativeFlowInfo)return c;var I=new d.proto.Message.ButtonsMessage.Button.NativeFlowInfo;return c.name!=null&&(I.name=String(c.name)),c.paramsJson!=null&&(I.paramsJson=String(c.paramsJson)),I},r.toObject=function(c,I){I||(I={});var p={};return c.name!=null&&c.hasOwnProperty("name")&&(p.name=c.name,I.oneofs&&(p._name="name")),c.paramsJson!=null&&c.hasOwnProperty("paramsJson")&&(p.paramsJson=c.paramsJson,I.oneofs&&(p._paramsJson="paramsJson")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.ButtonsMessage.Button.NativeFlowInfo"},r})(),i.Type=(function(){let r={},s=Object.create(r);return s[r[0]="UNKNOWN"]=0,s[r[1]="RESPONSE"]=1,s[r[2]="NATIVE_FLOW"]=2,s})(),i})(),a.HeaderType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="EMPTY"]=1,A[i[2]="TEXT"]=2,A[i[3]="DOCUMENT"]=3,A[i[4]="IMAGE"]=4,A[i[5]="VIDEO"]=5,A[i[6]="LOCATION"]=6,A})(),a})(),t.ButtonsResponseMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.selectedButtonId=A.string();break}case 3:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.type=A.int32();break}case 2:{c.selectedDisplayText=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ButtonsResponseMessage)return A;var r=new d.proto.Message.ButtonsResponseMessage;if(A.selectedButtonId!=null&&(r.selectedButtonId=String(A.selectedButtonId)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ButtonsResponseMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"DISPLAY_TEXT":case 1:r.type=1;break}return A.selectedDisplayText!=null&&(r.selectedDisplayText=String(A.selectedDisplayText)),r},a.toObject=function(A,r){r||(r={});var s={};return A.selectedButtonId!=null&&A.hasOwnProperty("selectedButtonId")&&(s.selectedButtonId=A.selectedButtonId,r.oneofs&&(s._selectedButtonId="selectedButtonId")),A.selectedDisplayText!=null&&A.hasOwnProperty("selectedDisplayText")&&(s.selectedDisplayText=A.selectedDisplayText,r.oneofs&&(s.response="selectedDisplayText")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.ButtonsResponseMessage.Type[A.type]===void 0?A.type:d.proto.Message.ButtonsResponseMessage.Type[A.type]:A.type,r.oneofs&&(s._type="type")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ButtonsResponseMessage"},a.Type=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="DISPLAY_TEXT"]=1,A})(),a})(),t.Call=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.callKey=A.bytes();break}case 2:{c.conversionSource=A.string();break}case 3:{c.conversionData=A.bytes();break}case 4:{c.conversionDelaySeconds=A.uint32();break}case 5:{c.ctwaSignals=A.string();break}case 6:{c.ctwaPayload=A.bytes();break}case 7:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.nativeFlowCallButtonPayload=A.string();break}case 9:{c.deeplinkPayload=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.Call)return A;var r=new d.proto.Message.Call;if(A.callKey!=null&&(typeof A.callKey=="string"?l.base64.decode(A.callKey,r.callKey=l.newBuffer(l.base64.length(A.callKey)),0):A.callKey.length>=0&&(r.callKey=A.callKey)),A.conversionSource!=null&&(r.conversionSource=String(A.conversionSource)),A.conversionData!=null&&(typeof A.conversionData=="string"?l.base64.decode(A.conversionData,r.conversionData=l.newBuffer(l.base64.length(A.conversionData)),0):A.conversionData.length>=0&&(r.conversionData=A.conversionData)),A.conversionDelaySeconds!=null&&(r.conversionDelaySeconds=A.conversionDelaySeconds>>>0),A.ctwaSignals!=null&&(r.ctwaSignals=String(A.ctwaSignals)),A.ctwaPayload!=null&&(typeof A.ctwaPayload=="string"?l.base64.decode(A.ctwaPayload,r.ctwaPayload=l.newBuffer(l.base64.length(A.ctwaPayload)),0):A.ctwaPayload.length>=0&&(r.ctwaPayload=A.ctwaPayload)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.Call.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return A.nativeFlowCallButtonPayload!=null&&(r.nativeFlowCallButtonPayload=String(A.nativeFlowCallButtonPayload)),A.deeplinkPayload!=null&&(r.deeplinkPayload=String(A.deeplinkPayload)),r},a.toObject=function(A,r){r||(r={});var s={};return A.callKey!=null&&A.hasOwnProperty("callKey")&&(s.callKey=r.bytes===String?l.base64.encode(A.callKey,0,A.callKey.length):r.bytes===Array?Array.prototype.slice.call(A.callKey):A.callKey,r.oneofs&&(s._callKey="callKey")),A.conversionSource!=null&&A.hasOwnProperty("conversionSource")&&(s.conversionSource=A.conversionSource,r.oneofs&&(s._conversionSource="conversionSource")),A.conversionData!=null&&A.hasOwnProperty("conversionData")&&(s.conversionData=r.bytes===String?l.base64.encode(A.conversionData,0,A.conversionData.length):r.bytes===Array?Array.prototype.slice.call(A.conversionData):A.conversionData,r.oneofs&&(s._conversionData="conversionData")),A.conversionDelaySeconds!=null&&A.hasOwnProperty("conversionDelaySeconds")&&(s.conversionDelaySeconds=A.conversionDelaySeconds,r.oneofs&&(s._conversionDelaySeconds="conversionDelaySeconds")),A.ctwaSignals!=null&&A.hasOwnProperty("ctwaSignals")&&(s.ctwaSignals=A.ctwaSignals,r.oneofs&&(s._ctwaSignals="ctwaSignals")),A.ctwaPayload!=null&&A.hasOwnProperty("ctwaPayload")&&(s.ctwaPayload=r.bytes===String?l.base64.encode(A.ctwaPayload,0,A.ctwaPayload.length):r.bytes===Array?Array.prototype.slice.call(A.ctwaPayload):A.ctwaPayload,r.oneofs&&(s._ctwaPayload="ctwaPayload")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.nativeFlowCallButtonPayload!=null&&A.hasOwnProperty("nativeFlowCallButtonPayload")&&(s.nativeFlowCallButtonPayload=A.nativeFlowCallButtonPayload,r.oneofs&&(s._nativeFlowCallButtonPayload="nativeFlowCallButtonPayload")),A.deeplinkPayload!=null&&A.hasOwnProperty("deeplinkPayload")&&(s.deeplinkPayload=A.deeplinkPayload,r.oneofs&&(s._deeplinkPayload="deeplinkPayload")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.Call"},a})(),t.CallLogMessage=(function(){function a(i){if(this.participants=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isVideo=A.bool();break}case 2:{c.callOutcome=A.int32();break}case 3:{c.durationSecs=A.int64();break}case 4:{c.callType=A.int32();break}case 5:{c.participants&&c.participants.length||(c.participants=[]),c.participants.push(d.proto.Message.CallLogMessage.CallParticipant.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.CallLogMessage)return A;var r=new d.proto.Message.CallLogMessage;switch(A.isVideo!=null&&(r.isVideo=!!A.isVideo),A.callOutcome){default:if(typeof A.callOutcome=="number"){r.callOutcome=A.callOutcome;break}break;case"CONNECTED":case 0:r.callOutcome=0;break;case"MISSED":case 1:r.callOutcome=1;break;case"FAILED":case 2:r.callOutcome=2;break;case"REJECTED":case 3:r.callOutcome=3;break;case"ACCEPTED_ELSEWHERE":case 4:r.callOutcome=4;break;case"ONGOING":case 5:r.callOutcome=5;break;case"SILENCED_BY_DND":case 6:r.callOutcome=6;break;case"SILENCED_UNKNOWN_CALLER":case 7:r.callOutcome=7;break}switch(A.durationSecs!=null&&(l.Long?(r.durationSecs=l.Long.fromValue(A.durationSecs)).unsigned=!1:typeof A.durationSecs=="string"?r.durationSecs=parseInt(A.durationSecs,10):typeof A.durationSecs=="number"?r.durationSecs=A.durationSecs:typeof A.durationSecs=="object"&&(r.durationSecs=new l.LongBits(A.durationSecs.low>>>0,A.durationSecs.high>>>0).toNumber())),A.callType){default:if(typeof A.callType=="number"){r.callType=A.callType;break}break;case"REGULAR":case 0:r.callType=0;break;case"SCHEDULED_CALL":case 1:r.callType=1;break;case"VOICE_CHAT":case 2:r.callType=2;break}if(A.participants){if(!Array.isArray(A.participants))throw TypeError(".proto.Message.CallLogMessage.participants: array expected");r.participants=[];for(var s=0;s>>3){case 1:{p.jid=s.string();break}case 2:{p.callOutcome=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.CallLogMessage.CallParticipant)return s;var g=new d.proto.Message.CallLogMessage.CallParticipant;switch(s.jid!=null&&(g.jid=String(s.jid)),s.callOutcome){default:if(typeof s.callOutcome=="number"){g.callOutcome=s.callOutcome;break}break;case"CONNECTED":case 0:g.callOutcome=0;break;case"MISSED":case 1:g.callOutcome=1;break;case"FAILED":case 2:g.callOutcome=2;break;case"REJECTED":case 3:g.callOutcome=3;break;case"ACCEPTED_ELSEWHERE":case 4:g.callOutcome=4;break;case"ONGOING":case 5:g.callOutcome=5;break;case"SILENCED_BY_DND":case 6:g.callOutcome=6;break;case"SILENCED_UNKNOWN_CALLER":case 7:g.callOutcome=7;break}return g},i.toObject=function(s,g){g||(g={});var c={};return s.jid!=null&&s.hasOwnProperty("jid")&&(c.jid=s.jid,g.oneofs&&(c._jid="jid")),s.callOutcome!=null&&s.hasOwnProperty("callOutcome")&&(c.callOutcome=g.enums===String?d.proto.Message.CallLogMessage.CallOutcome[s.callOutcome]===void 0?s.callOutcome:d.proto.Message.CallLogMessage.CallOutcome[s.callOutcome]:s.callOutcome,g.oneofs&&(c._callOutcome="callOutcome")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.CallLogMessage.CallParticipant"},i})(),a.CallType=(function(){let i={},A=Object.create(i);return A[i[0]="REGULAR"]=0,A[i[1]="SCHEDULED_CALL"]=1,A[i[2]="VOICE_CHAT"]=2,A})(),a})(),t.CancelPaymentRequestMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.CancelPaymentRequestMessage)return A;var r=new d.proto.Message.CancelPaymentRequestMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.CancelPaymentRequestMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CancelPaymentRequestMessage"},a})(),t.Chat=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayName=A.string();break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.Chat)return A;var r=new d.proto.Message.Chat;return A.displayName!=null&&(r.displayName=String(A.displayName)),A.id!=null&&(r.id=String(A.id)),r},a.toObject=function(A,r){r||(r={});var s={};return A.displayName!=null&&A.hasOwnProperty("displayName")&&(s.displayName=A.displayName,r.oneofs&&(s._displayName="displayName")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.Chat"},a})(),t.CloudAPIThreadControlNotification=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.status=A.int32();break}case 2:{c.senderNotificationTimestampMs=A.int64();break}case 3:{c.consumerLid=A.string();break}case 4:{c.consumerPhoneNumber=A.string();break}case 5:{c.notificationContent=d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.decode(A,A.uint32());break}case 6:{c.shouldSuppressNotification=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.CloudAPIThreadControlNotification)return A;var r=new d.proto.Message.CloudAPIThreadControlNotification;switch(A.status){default:if(typeof A.status=="number"){r.status=A.status;break}break;case"UNKNOWN":case 0:r.status=0;break;case"CONTROL_PASSED":case 1:r.status=1;break;case"CONTROL_TAKEN":case 2:r.status=2;break}if(A.senderNotificationTimestampMs!=null&&(l.Long?(r.senderNotificationTimestampMs=l.Long.fromValue(A.senderNotificationTimestampMs)).unsigned=!1:typeof A.senderNotificationTimestampMs=="string"?r.senderNotificationTimestampMs=parseInt(A.senderNotificationTimestampMs,10):typeof A.senderNotificationTimestampMs=="number"?r.senderNotificationTimestampMs=A.senderNotificationTimestampMs:typeof A.senderNotificationTimestampMs=="object"&&(r.senderNotificationTimestampMs=new l.LongBits(A.senderNotificationTimestampMs.low>>>0,A.senderNotificationTimestampMs.high>>>0).toNumber())),A.consumerLid!=null&&(r.consumerLid=String(A.consumerLid)),A.consumerPhoneNumber!=null&&(r.consumerPhoneNumber=String(A.consumerPhoneNumber)),A.notificationContent!=null){if(typeof A.notificationContent!="object")throw TypeError(".proto.Message.CloudAPIThreadControlNotification.notificationContent: object expected");r.notificationContent=d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.fromObject(A.notificationContent)}return A.shouldSuppressNotification!=null&&(r.shouldSuppressNotification=!!A.shouldSuppressNotification),r},a.toObject=function(A,r){r||(r={});var s={};return A.status!=null&&A.hasOwnProperty("status")&&(s.status=r.enums===String?d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[A.status]===void 0?A.status:d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControl[A.status]:A.status,r.oneofs&&(s._status="status")),A.senderNotificationTimestampMs!=null&&A.hasOwnProperty("senderNotificationTimestampMs")&&(typeof A.senderNotificationTimestampMs=="number"?s.senderNotificationTimestampMs=r.longs===String?String(A.senderNotificationTimestampMs):A.senderNotificationTimestampMs:s.senderNotificationTimestampMs=r.longs===String?ge(A.senderNotificationTimestampMs):r.longs===Number?ce(A.senderNotificationTimestampMs):A.senderNotificationTimestampMs,r.oneofs&&(s._senderNotificationTimestampMs="senderNotificationTimestampMs")),A.consumerLid!=null&&A.hasOwnProperty("consumerLid")&&(s.consumerLid=A.consumerLid,r.oneofs&&(s._consumerLid="consumerLid")),A.consumerPhoneNumber!=null&&A.hasOwnProperty("consumerPhoneNumber")&&(s.consumerPhoneNumber=A.consumerPhoneNumber,r.oneofs&&(s._consumerPhoneNumber="consumerPhoneNumber")),A.notificationContent!=null&&A.hasOwnProperty("notificationContent")&&(s.notificationContent=d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent.toObject(A.notificationContent,r),r.oneofs&&(s._notificationContent="notificationContent")),A.shouldSuppressNotification!=null&&A.hasOwnProperty("shouldSuppressNotification")&&(s.shouldSuppressNotification=A.shouldSuppressNotification,r.oneofs&&(s._shouldSuppressNotification="shouldSuppressNotification")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CloudAPIThreadControlNotification"},a.CloudAPIThreadControl=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="CONTROL_PASSED"]=1,A[i[2]="CONTROL_TAKEN"]=2,A})(),a.CloudAPIThreadControlNotificationContent=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.handoffNotificationText=s.string();break}case 2:{p.extraJson=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent)return s;var g=new d.proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent;return s.handoffNotificationText!=null&&(g.handoffNotificationText=String(s.handoffNotificationText)),s.extraJson!=null&&(g.extraJson=String(s.extraJson)),g},i.toObject=function(s,g){g||(g={});var c={};return s.handoffNotificationText!=null&&s.hasOwnProperty("handoffNotificationText")&&(c.handoffNotificationText=s.handoffNotificationText,g.oneofs&&(c._handoffNotificationText="handoffNotificationText")),s.extraJson!=null&&s.hasOwnProperty("extraJson")&&(c.extraJson=s.extraJson,g.oneofs&&(c._extraJson="extraJson")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.CloudAPIThreadControlNotification.CloudAPIThreadControlNotificationContent"},i})(),a})(),t.CommentMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.message=d.proto.Message.decode(A,A.uint32());break}case 2:{c.targetMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.CommentMessage)return A;var r=new d.proto.Message.CommentMessage;if(A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.CommentMessage.message: object expected");r.message=d.proto.Message.fromObject(A.message)}if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.CommentMessage.targetMessageKey: object expected");r.targetMessageKey=d.proto.MessageKey.fromObject(A.targetMessageKey)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.message!=null&&A.hasOwnProperty("message")&&(s.message=d.proto.Message.toObject(A.message,r),r.oneofs&&(s._message="message")),A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=d.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.CommentMessage"},a})(),t.ContactMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayName=A.string();break}case 16:{c.vcard=A.string();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ContactMessage)return A;var r=new d.proto.Message.ContactMessage;if(A.displayName!=null&&(r.displayName=String(A.displayName)),A.vcard!=null&&(r.vcard=String(A.vcard)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ContactMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.displayName!=null&&A.hasOwnProperty("displayName")&&(s.displayName=A.displayName,r.oneofs&&(s._displayName="displayName")),A.vcard!=null&&A.hasOwnProperty("vcard")&&(s.vcard=A.vcard,r.oneofs&&(s._vcard="vcard")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ContactMessage"},a})(),t.ContactsArrayMessage=(function(){function a(i){if(this.contacts=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayName=A.string();break}case 2:{c.contacts&&c.contacts.length||(c.contacts=[]),c.contacts.push(d.proto.Message.ContactMessage.decode(A,A.uint32()));break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ContactsArrayMessage)return A;var r=new d.proto.Message.ContactsArrayMessage;if(A.displayName!=null&&(r.displayName=String(A.displayName)),A.contacts){if(!Array.isArray(A.contacts))throw TypeError(".proto.Message.ContactsArrayMessage.contacts: array expected");r.contacts=[];for(var s=0;s>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.DeclinePaymentRequestMessage)return A;var r=new d.proto.Message.DeclinePaymentRequestMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.DeclinePaymentRequestMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DeclinePaymentRequestMessage"},a})(),t.DeviceSentMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.destinationJid=A.string();break}case 2:{c.message=d.proto.Message.decode(A,A.uint32());break}case 3:{c.phash=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.DeviceSentMessage)return A;var r=new d.proto.Message.DeviceSentMessage;if(A.destinationJid!=null&&(r.destinationJid=String(A.destinationJid)),A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.DeviceSentMessage.message: object expected");r.message=d.proto.Message.fromObject(A.message)}return A.phash!=null&&(r.phash=String(A.phash)),r},a.toObject=function(A,r){r||(r={});var s={};return A.destinationJid!=null&&A.hasOwnProperty("destinationJid")&&(s.destinationJid=A.destinationJid,r.oneofs&&(s._destinationJid="destinationJid")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=d.proto.Message.toObject(A.message,r),r.oneofs&&(s._message="message")),A.phash!=null&&A.hasOwnProperty("phash")&&(s.phash=A.phash,r.oneofs&&(s._phash="phash")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DeviceSentMessage"},a})(),t.DocumentMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.title=A.string();break}case 4:{c.fileSha256=A.bytes();break}case 5:{c.fileLength=A.uint64();break}case 6:{c.pageCount=A.uint32();break}case 7:{c.mediaKey=A.bytes();break}case 8:{c.fileName=A.string();break}case 9:{c.fileEncSha256=A.bytes();break}case 10:{c.directPath=A.string();break}case 11:{c.mediaKeyTimestamp=A.int64();break}case 12:{c.contactVcard=A.bool();break}case 13:{c.thumbnailDirectPath=A.string();break}case 14:{c.thumbnailSha256=A.bytes();break}case 15:{c.thumbnailEncSha256=A.bytes();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.thumbnailHeight=A.uint32();break}case 19:{c.thumbnailWidth=A.uint32();break}case 20:{c.caption=A.string();break}case 21:{c.accessibilityLabel=A.string();break}case 22:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.DocumentMessage)return A;var r=new d.proto.Message.DocumentMessage;if(A.url!=null&&(r.url=String(A.url)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.title!=null&&(r.title=String(A.title)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.pageCount!=null&&(r.pageCount=A.pageCount>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileName!=null&&(r.fileName=String(A.fileName)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contactVcard!=null&&(r.contactVcard=!!A.contactVcard),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.DocumentMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.caption!=null&&(r.caption=String(A.caption)),A.accessibilityLabel!=null&&(r.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.pageCount!=null&&A.hasOwnProperty("pageCount")&&(s.pageCount=A.pageCount,r.oneofs&&(s._pageCount="pageCount")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileName!=null&&A.hasOwnProperty("fileName")&&(s.fileName=A.fileName,r.oneofs&&(s._fileName="fileName")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contactVcard!=null&&A.hasOwnProperty("contactVcard")&&(s.contactVcard=A.contactVcard,r.oneofs&&(s._contactVcard="contactVcard")),A.thumbnailDirectPath!=null&&A.hasOwnProperty("thumbnailDirectPath")&&(s.thumbnailDirectPath=A.thumbnailDirectPath,r.oneofs&&(s._thumbnailDirectPath="thumbnailDirectPath")),A.thumbnailSha256!=null&&A.hasOwnProperty("thumbnailSha256")&&(s.thumbnailSha256=r.bytes===String?l.base64.encode(A.thumbnailSha256,0,A.thumbnailSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailSha256):A.thumbnailSha256,r.oneofs&&(s._thumbnailSha256="thumbnailSha256")),A.thumbnailEncSha256!=null&&A.hasOwnProperty("thumbnailEncSha256")&&(s.thumbnailEncSha256=r.bytes===String?l.base64.encode(A.thumbnailEncSha256,0,A.thumbnailEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailEncSha256):A.thumbnailEncSha256,r.oneofs&&(s._thumbnailEncSha256="thumbnailEncSha256")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.thumbnailHeight!=null&&A.hasOwnProperty("thumbnailHeight")&&(s.thumbnailHeight=A.thumbnailHeight,r.oneofs&&(s._thumbnailHeight="thumbnailHeight")),A.thumbnailWidth!=null&&A.hasOwnProperty("thumbnailWidth")&&(s.thumbnailWidth=A.thumbnailWidth,r.oneofs&&(s._thumbnailWidth="thumbnailWidth")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,r.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.DocumentMessage"},a})(),t.EncCommentMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.targetMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.EncCommentMessage)return A;var r=new d.proto.Message.EncCommentMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.EncCommentMessage.targetMessageKey: object expected");r.targetMessageKey=d.proto.MessageKey.fromObject(A.targetMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},a.toObject=function(A,r){r||(r={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=d.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncCommentMessage"},a})(),t.EncEventResponseMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.eventCreationMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.EncEventResponseMessage)return A;var r=new d.proto.Message.EncEventResponseMessage;if(A.eventCreationMessageKey!=null){if(typeof A.eventCreationMessageKey!="object")throw TypeError(".proto.Message.EncEventResponseMessage.eventCreationMessageKey: object expected");r.eventCreationMessageKey=d.proto.MessageKey.fromObject(A.eventCreationMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},a.toObject=function(A,r){r||(r={});var s={};return A.eventCreationMessageKey!=null&&A.hasOwnProperty("eventCreationMessageKey")&&(s.eventCreationMessageKey=d.proto.MessageKey.toObject(A.eventCreationMessageKey,r),r.oneofs&&(s._eventCreationMessageKey="eventCreationMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncEventResponseMessage"},a})(),t.EncReactionMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.targetMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.EncReactionMessage)return A;var r=new d.proto.Message.EncReactionMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.EncReactionMessage.targetMessageKey: object expected");r.targetMessageKey=d.proto.MessageKey.fromObject(A.targetMessageKey)}return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},a.toObject=function(A,r){r||(r={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=d.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EncReactionMessage"},a})(),t.EventMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.isCanceled=A.bool();break}case 3:{c.name=A.string();break}case 4:{c.description=A.string();break}case 5:{c.location=d.proto.Message.LocationMessage.decode(A,A.uint32());break}case 6:{c.joinLink=A.string();break}case 7:{c.startTime=A.int64();break}case 8:{c.endTime=A.int64();break}case 9:{c.extraGuestsAllowed=A.bool();break}case 10:{c.isScheduleCall=A.bool();break}case 11:{c.hasReminder=A.bool();break}case 12:{c.reminderOffsetSec=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.EventMessage)return A;var r=new d.proto.Message.EventMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.EventMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.isCanceled!=null&&(r.isCanceled=!!A.isCanceled),A.name!=null&&(r.name=String(A.name)),A.description!=null&&(r.description=String(A.description)),A.location!=null){if(typeof A.location!="object")throw TypeError(".proto.Message.EventMessage.location: object expected");r.location=d.proto.Message.LocationMessage.fromObject(A.location)}return A.joinLink!=null&&(r.joinLink=String(A.joinLink)),A.startTime!=null&&(l.Long?(r.startTime=l.Long.fromValue(A.startTime)).unsigned=!1:typeof A.startTime=="string"?r.startTime=parseInt(A.startTime,10):typeof A.startTime=="number"?r.startTime=A.startTime:typeof A.startTime=="object"&&(r.startTime=new l.LongBits(A.startTime.low>>>0,A.startTime.high>>>0).toNumber())),A.endTime!=null&&(l.Long?(r.endTime=l.Long.fromValue(A.endTime)).unsigned=!1:typeof A.endTime=="string"?r.endTime=parseInt(A.endTime,10):typeof A.endTime=="number"?r.endTime=A.endTime:typeof A.endTime=="object"&&(r.endTime=new l.LongBits(A.endTime.low>>>0,A.endTime.high>>>0).toNumber())),A.extraGuestsAllowed!=null&&(r.extraGuestsAllowed=!!A.extraGuestsAllowed),A.isScheduleCall!=null&&(r.isScheduleCall=!!A.isScheduleCall),A.hasReminder!=null&&(r.hasReminder=!!A.hasReminder),A.reminderOffsetSec!=null&&(l.Long?(r.reminderOffsetSec=l.Long.fromValue(A.reminderOffsetSec)).unsigned=!1:typeof A.reminderOffsetSec=="string"?r.reminderOffsetSec=parseInt(A.reminderOffsetSec,10):typeof A.reminderOffsetSec=="number"?r.reminderOffsetSec=A.reminderOffsetSec:typeof A.reminderOffsetSec=="object"&&(r.reminderOffsetSec=new l.LongBits(A.reminderOffsetSec.low>>>0,A.reminderOffsetSec.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.isCanceled!=null&&A.hasOwnProperty("isCanceled")&&(s.isCanceled=A.isCanceled,r.oneofs&&(s._isCanceled="isCanceled")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.description!=null&&A.hasOwnProperty("description")&&(s.description=A.description,r.oneofs&&(s._description="description")),A.location!=null&&A.hasOwnProperty("location")&&(s.location=d.proto.Message.LocationMessage.toObject(A.location,r),r.oneofs&&(s._location="location")),A.joinLink!=null&&A.hasOwnProperty("joinLink")&&(s.joinLink=A.joinLink,r.oneofs&&(s._joinLink="joinLink")),A.startTime!=null&&A.hasOwnProperty("startTime")&&(typeof A.startTime=="number"?s.startTime=r.longs===String?String(A.startTime):A.startTime:s.startTime=r.longs===String?ge(A.startTime):r.longs===Number?ce(A.startTime):A.startTime,r.oneofs&&(s._startTime="startTime")),A.endTime!=null&&A.hasOwnProperty("endTime")&&(typeof A.endTime=="number"?s.endTime=r.longs===String?String(A.endTime):A.endTime:s.endTime=r.longs===String?ge(A.endTime):r.longs===Number?ce(A.endTime):A.endTime,r.oneofs&&(s._endTime="endTime")),A.extraGuestsAllowed!=null&&A.hasOwnProperty("extraGuestsAllowed")&&(s.extraGuestsAllowed=A.extraGuestsAllowed,r.oneofs&&(s._extraGuestsAllowed="extraGuestsAllowed")),A.isScheduleCall!=null&&A.hasOwnProperty("isScheduleCall")&&(s.isScheduleCall=A.isScheduleCall,r.oneofs&&(s._isScheduleCall="isScheduleCall")),A.hasReminder!=null&&A.hasOwnProperty("hasReminder")&&(s.hasReminder=A.hasReminder,r.oneofs&&(s._hasReminder="hasReminder")),A.reminderOffsetSec!=null&&A.hasOwnProperty("reminderOffsetSec")&&(typeof A.reminderOffsetSec=="number"?s.reminderOffsetSec=r.longs===String?String(A.reminderOffsetSec):A.reminderOffsetSec:s.reminderOffsetSec=r.longs===String?ge(A.reminderOffsetSec):r.longs===Number?ce(A.reminderOffsetSec):A.reminderOffsetSec,r.oneofs&&(s._reminderOffsetSec="reminderOffsetSec")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EventMessage"},a})(),t.EventResponseMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.response=A.int32();break}case 2:{c.timestampMs=A.int64();break}case 3:{c.extraGuestCount=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.EventResponseMessage)return A;var r=new d.proto.Message.EventResponseMessage;switch(A.response){default:if(typeof A.response=="number"){r.response=A.response;break}break;case"UNKNOWN":case 0:r.response=0;break;case"GOING":case 1:r.response=1;break;case"NOT_GOING":case 2:r.response=2;break;case"MAYBE":case 3:r.response=3;break}return A.timestampMs!=null&&(l.Long?(r.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?r.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?r.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(r.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),A.extraGuestCount!=null&&(r.extraGuestCount=A.extraGuestCount|0),r},a.toObject=function(A,r){r||(r={});var s={};return A.response!=null&&A.hasOwnProperty("response")&&(s.response=r.enums===String?d.proto.Message.EventResponseMessage.EventResponseType[A.response]===void 0?A.response:d.proto.Message.EventResponseMessage.EventResponseType[A.response]:A.response,r.oneofs&&(s._response="response")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=r.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=r.longs===String?ge(A.timestampMs):r.longs===Number?ce(A.timestampMs):A.timestampMs,r.oneofs&&(s._timestampMs="timestampMs")),A.extraGuestCount!=null&&A.hasOwnProperty("extraGuestCount")&&(s.extraGuestCount=A.extraGuestCount,r.oneofs&&(s._extraGuestCount="extraGuestCount")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.EventResponseMessage"},a.EventResponseType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="GOING"]=1,A[i[2]="NOT_GOING"]=2,A[i[3]="MAYBE"]=3,A})(),a})(),t.ExtendedTextMessage=(function(){function a(i){if(this.endCardTiles=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.text=A.string();break}case 2:{c.matchedText=A.string();break}case 5:{c.description=A.string();break}case 6:{c.title=A.string();break}case 7:{c.textArgb=A.fixed32();break}case 8:{c.backgroundArgb=A.fixed32();break}case 9:{c.font=A.int32();break}case 10:{c.previewType=A.int32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.doNotPlayInline=A.bool();break}case 19:{c.thumbnailDirectPath=A.string();break}case 20:{c.thumbnailSha256=A.bytes();break}case 21:{c.thumbnailEncSha256=A.bytes();break}case 22:{c.mediaKey=A.bytes();break}case 23:{c.mediaKeyTimestamp=A.int64();break}case 24:{c.thumbnailHeight=A.uint32();break}case 25:{c.thumbnailWidth=A.uint32();break}case 26:{c.inviteLinkGroupType=A.int32();break}case 27:{c.inviteLinkParentGroupSubjectV2=A.string();break}case 28:{c.inviteLinkParentGroupThumbnailV2=A.bytes();break}case 29:{c.inviteLinkGroupTypeV2=A.int32();break}case 30:{c.viewOnce=A.bool();break}case 31:{c.videoHeight=A.uint32();break}case 32:{c.videoWidth=A.uint32();break}case 33:{c.faviconMMSMetadata=d.proto.Message.MMSThumbnailMetadata.decode(A,A.uint32());break}case 34:{c.linkPreviewMetadata=d.proto.Message.LinkPreviewMetadata.decode(A,A.uint32());break}case 35:{c.paymentLinkMetadata=d.proto.Message.PaymentLinkMetadata.decode(A,A.uint32());break}case 36:{c.endCardTiles&&c.endCardTiles.length||(c.endCardTiles=[]),c.endCardTiles.push(d.proto.Message.VideoEndCard.decode(A,A.uint32()));break}case 37:{c.videoContentUrl=A.string();break}case 38:{c.musicMetadata=d.proto.EmbeddedMusic.decode(A,A.uint32());break}case 39:{c.paymentExtendedMetadata=d.proto.Message.PaymentExtendedMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ExtendedTextMessage)return A;var r=new d.proto.Message.ExtendedTextMessage;switch(A.text!=null&&(r.text=String(A.text)),A.matchedText!=null&&(r.matchedText=String(A.matchedText)),A.description!=null&&(r.description=String(A.description)),A.title!=null&&(r.title=String(A.title)),A.textArgb!=null&&(r.textArgb=A.textArgb>>>0),A.backgroundArgb!=null&&(r.backgroundArgb=A.backgroundArgb>>>0),A.font){default:if(typeof A.font=="number"){r.font=A.font;break}break;case"SYSTEM":case 0:r.font=0;break;case"SYSTEM_TEXT":case 1:r.font=1;break;case"FB_SCRIPT":case 2:r.font=2;break;case"SYSTEM_BOLD":case 6:r.font=6;break;case"MORNINGBREEZE_REGULAR":case 7:r.font=7;break;case"CALISTOGA_REGULAR":case 8:r.font=8;break;case"EXO2_EXTRABOLD":case 9:r.font=9;break;case"COURIERPRIME_BOLD":case 10:r.font=10;break}switch(A.previewType){default:if(typeof A.previewType=="number"){r.previewType=A.previewType;break}break;case"NONE":case 0:r.previewType=0;break;case"VIDEO":case 1:r.previewType=1;break;case"PLACEHOLDER":case 4:r.previewType=4;break;case"IMAGE":case 5:r.previewType=5;break;case"PAYMENT_LINKS":case 6:r.previewType=6;break;case"PROFILE":case 7:r.previewType=7;break}if(A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ExtendedTextMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.doNotPlayInline!=null&&(r.doNotPlayInline=!!A.doNotPlayInline),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.inviteLinkGroupType){default:if(typeof A.inviteLinkGroupType=="number"){r.inviteLinkGroupType=A.inviteLinkGroupType;break}break;case"DEFAULT":case 0:r.inviteLinkGroupType=0;break;case"PARENT":case 1:r.inviteLinkGroupType=1;break;case"SUB":case 2:r.inviteLinkGroupType=2;break;case"DEFAULT_SUB":case 3:r.inviteLinkGroupType=3;break}switch(A.inviteLinkParentGroupSubjectV2!=null&&(r.inviteLinkParentGroupSubjectV2=String(A.inviteLinkParentGroupSubjectV2)),A.inviteLinkParentGroupThumbnailV2!=null&&(typeof A.inviteLinkParentGroupThumbnailV2=="string"?l.base64.decode(A.inviteLinkParentGroupThumbnailV2,r.inviteLinkParentGroupThumbnailV2=l.newBuffer(l.base64.length(A.inviteLinkParentGroupThumbnailV2)),0):A.inviteLinkParentGroupThumbnailV2.length>=0&&(r.inviteLinkParentGroupThumbnailV2=A.inviteLinkParentGroupThumbnailV2)),A.inviteLinkGroupTypeV2){default:if(typeof A.inviteLinkGroupTypeV2=="number"){r.inviteLinkGroupTypeV2=A.inviteLinkGroupTypeV2;break}break;case"DEFAULT":case 0:r.inviteLinkGroupTypeV2=0;break;case"PARENT":case 1:r.inviteLinkGroupTypeV2=1;break;case"SUB":case 2:r.inviteLinkGroupTypeV2=2;break;case"DEFAULT_SUB":case 3:r.inviteLinkGroupTypeV2=3;break}if(A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.videoHeight!=null&&(r.videoHeight=A.videoHeight>>>0),A.videoWidth!=null&&(r.videoWidth=A.videoWidth>>>0),A.faviconMMSMetadata!=null){if(typeof A.faviconMMSMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.faviconMMSMetadata: object expected");r.faviconMMSMetadata=d.proto.Message.MMSThumbnailMetadata.fromObject(A.faviconMMSMetadata)}if(A.linkPreviewMetadata!=null){if(typeof A.linkPreviewMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.linkPreviewMetadata: object expected");r.linkPreviewMetadata=d.proto.Message.LinkPreviewMetadata.fromObject(A.linkPreviewMetadata)}if(A.paymentLinkMetadata!=null){if(typeof A.paymentLinkMetadata!="object")throw TypeError(".proto.Message.ExtendedTextMessage.paymentLinkMetadata: object expected");r.paymentLinkMetadata=d.proto.Message.PaymentLinkMetadata.fromObject(A.paymentLinkMetadata)}if(A.endCardTiles){if(!Array.isArray(A.endCardTiles))throw TypeError(".proto.Message.ExtendedTextMessage.endCardTiles: array expected");r.endCardTiles=[];for(var s=0;s>>3){case 1:{c.requestId=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.FullHistorySyncOnDemandRequestMetadata)return A;var r=new d.proto.Message.FullHistorySyncOnDemandRequestMetadata;return A.requestId!=null&&(r.requestId=String(A.requestId)),r},a.toObject=function(A,r){r||(r={});var s={};return A.requestId!=null&&A.hasOwnProperty("requestId")&&(s.requestId=A.requestId,r.oneofs&&(s._requestId="requestId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.FullHistorySyncOnDemandRequestMetadata"},a})(),t.FutureProofMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.message=d.proto.Message.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.FutureProofMessage)return A;var r=new d.proto.Message.FutureProofMessage;if(A.message!=null){if(typeof A.message!="object")throw TypeError(".proto.Message.FutureProofMessage.message: object expected");r.message=d.proto.Message.fromObject(A.message)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.message!=null&&A.hasOwnProperty("message")&&(s.message=d.proto.Message.toObject(A.message,r),r.oneofs&&(s._message="message")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.FutureProofMessage"},a})(),t.GroupInviteMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.groupJid=A.string();break}case 2:{c.inviteCode=A.string();break}case 3:{c.inviteExpiration=A.int64();break}case 4:{c.groupName=A.string();break}case 5:{c.jpegThumbnail=A.bytes();break}case 6:{c.caption=A.string();break}case 7:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.groupType=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.GroupInviteMessage)return A;var r=new d.proto.Message.GroupInviteMessage;if(A.groupJid!=null&&(r.groupJid=String(A.groupJid)),A.inviteCode!=null&&(r.inviteCode=String(A.inviteCode)),A.inviteExpiration!=null&&(l.Long?(r.inviteExpiration=l.Long.fromValue(A.inviteExpiration)).unsigned=!1:typeof A.inviteExpiration=="string"?r.inviteExpiration=parseInt(A.inviteExpiration,10):typeof A.inviteExpiration=="number"?r.inviteExpiration=A.inviteExpiration:typeof A.inviteExpiration=="object"&&(r.inviteExpiration=new l.LongBits(A.inviteExpiration.low>>>0,A.inviteExpiration.high>>>0).toNumber())),A.groupName!=null&&(r.groupName=String(A.groupName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.GroupInviteMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.groupType){default:if(typeof A.groupType=="number"){r.groupType=A.groupType;break}break;case"DEFAULT":case 0:r.groupType=0;break;case"PARENT":case 1:r.groupType=1;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.groupJid!=null&&A.hasOwnProperty("groupJid")&&(s.groupJid=A.groupJid,r.oneofs&&(s._groupJid="groupJid")),A.inviteCode!=null&&A.hasOwnProperty("inviteCode")&&(s.inviteCode=A.inviteCode,r.oneofs&&(s._inviteCode="inviteCode")),A.inviteExpiration!=null&&A.hasOwnProperty("inviteExpiration")&&(typeof A.inviteExpiration=="number"?s.inviteExpiration=r.longs===String?String(A.inviteExpiration):A.inviteExpiration:s.inviteExpiration=r.longs===String?ge(A.inviteExpiration):r.longs===Number?ce(A.inviteExpiration):A.inviteExpiration,r.oneofs&&(s._inviteExpiration="inviteExpiration")),A.groupName!=null&&A.hasOwnProperty("groupName")&&(s.groupName=A.groupName,r.oneofs&&(s._groupName="groupName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.groupType!=null&&A.hasOwnProperty("groupType")&&(s.groupType=r.enums===String?d.proto.Message.GroupInviteMessage.GroupType[A.groupType]===void 0?A.groupType:d.proto.Message.GroupInviteMessage.GroupType[A.groupType]:A.groupType,r.oneofs&&(s._groupType="groupType")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.GroupInviteMessage"},a.GroupType=(function(){let i={},A=Object.create(i);return A[i[0]="DEFAULT"]=0,A[i[1]="PARENT"]=1,A})(),a})(),t.HighlyStructuredMessage=(function(){function a(i){if(this.params=[],this.localizableParams=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.namespace=A.string();break}case 2:{c.elementName=A.string();break}case 3:{c.params&&c.params.length||(c.params=[]),c.params.push(A.string());break}case 4:{c.fallbackLg=A.string();break}case 5:{c.fallbackLc=A.string();break}case 6:{c.localizableParams&&c.localizableParams.length||(c.localizableParams=[]),c.localizableParams.push(d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.decode(A,A.uint32()));break}case 7:{c.deterministicLg=A.string();break}case 8:{c.deterministicLc=A.string();break}case 9:{c.hydratedHsm=d.proto.Message.TemplateMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.HighlyStructuredMessage)return A;var r=new d.proto.Message.HighlyStructuredMessage;if(A.namespace!=null&&(r.namespace=String(A.namespace)),A.elementName!=null&&(r.elementName=String(A.elementName)),A.params){if(!Array.isArray(A.params))throw TypeError(".proto.Message.HighlyStructuredMessage.params: array expected");r.params=[];for(var s=0;s>>3){case 1:{p.default=s.string();break}case 2:{p.currency=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.decode(s,s.uint32());break}case 3:{p.dateTime=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter)return s;var g=new d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter;if(s.default!=null&&(g.default=String(s.default)),s.currency!=null){if(typeof s.currency!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.currency: object expected");g.currency=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.fromObject(s.currency)}if(s.dateTime!=null){if(typeof s.dateTime!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.dateTime: object expected");g.dateTime=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.fromObject(s.dateTime)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.default!=null&&s.hasOwnProperty("default")&&(c.default=s.default,g.oneofs&&(c._default="default")),s.currency!=null&&s.hasOwnProperty("currency")&&(c.currency=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency.toObject(s.currency,g),g.oneofs&&(c.paramOneof="currency")),s.dateTime!=null&&s.hasOwnProperty("dateTime")&&(c.dateTime=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.toObject(s.dateTime,g),g.oneofs&&(c.paramOneof="dateTime")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter"},i.HSMCurrency=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.currencyCode=c.string();break}case 2:{f.amount1000=c.int64();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency)return c;var I=new d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency;return c.currencyCode!=null&&(I.currencyCode=String(c.currencyCode)),c.amount1000!=null&&(l.Long?(I.amount1000=l.Long.fromValue(c.amount1000)).unsigned=!1:typeof c.amount1000=="string"?I.amount1000=parseInt(c.amount1000,10):typeof c.amount1000=="number"?I.amount1000=c.amount1000:typeof c.amount1000=="object"&&(I.amount1000=new l.LongBits(c.amount1000.low>>>0,c.amount1000.high>>>0).toNumber())),I},r.toObject=function(c,I){I||(I={});var p={};return c.currencyCode!=null&&c.hasOwnProperty("currencyCode")&&(p.currencyCode=c.currencyCode,I.oneofs&&(p._currencyCode="currencyCode")),c.amount1000!=null&&c.hasOwnProperty("amount1000")&&(typeof c.amount1000=="number"?p.amount1000=I.longs===String?String(c.amount1000):c.amount1000:p.amount1000=I.longs===String?ge(c.amount1000):I.longs===Number?ce(c.amount1000):c.amount1000,I.oneofs&&(p._amount1000="amount1000")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency"},r})(),i.HSMDateTime=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.component=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.decode(c,c.uint32());break}case 2:{f.unixEpoch=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.decode(c,c.uint32());break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime)return c;var I=new d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime;if(c.component!=null){if(typeof c.component!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.component: object expected");I.component=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.fromObject(c.component)}if(c.unixEpoch!=null){if(typeof c.unixEpoch!="object")throw TypeError(".proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.unixEpoch: object expected");I.unixEpoch=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.fromObject(c.unixEpoch)}return I},r.toObject=function(c,I){I||(I={});var p={};return c.component!=null&&c.hasOwnProperty("component")&&(p.component=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.toObject(c.component,I),I.oneofs&&(p.datetimeOneof="component")),c.unixEpoch!=null&&c.hasOwnProperty("unixEpoch")&&(p.unixEpoch=d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch.toObject(c.unixEpoch,I),I.oneofs&&(p.datetimeOneof="unixEpoch")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime"},r.HSMDateTimeComponent=(function(){function g(I){if(I)for(var p=Object.keys(I),B=0;B>>3){case 1:{y.dayOfWeek=p.int32();break}case 2:{y.year=p.uint32();break}case 3:{y.month=p.uint32();break}case 4:{y.dayOfMonth=p.uint32();break}case 5:{y.hour=p.uint32();break}case 6:{y.minute=p.uint32();break}case 7:{y.calendar=p.int32();break}default:p.skipType(m&7);break}}return y},g.fromObject=function(p){if(p instanceof d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent)return p;var B=new d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent;switch(p.dayOfWeek){default:if(typeof p.dayOfWeek=="number"){B.dayOfWeek=p.dayOfWeek;break}break;case"MONDAY":case 1:B.dayOfWeek=1;break;case"TUESDAY":case 2:B.dayOfWeek=2;break;case"WEDNESDAY":case 3:B.dayOfWeek=3;break;case"THURSDAY":case 4:B.dayOfWeek=4;break;case"FRIDAY":case 5:B.dayOfWeek=5;break;case"SATURDAY":case 6:B.dayOfWeek=6;break;case"SUNDAY":case 7:B.dayOfWeek=7;break}switch(p.year!=null&&(B.year=p.year>>>0),p.month!=null&&(B.month=p.month>>>0),p.dayOfMonth!=null&&(B.dayOfMonth=p.dayOfMonth>>>0),p.hour!=null&&(B.hour=p.hour>>>0),p.minute!=null&&(B.minute=p.minute>>>0),p.calendar){default:if(typeof p.calendar=="number"){B.calendar=p.calendar;break}break;case"GREGORIAN":case 1:B.calendar=1;break;case"SOLAR_HIJRI":case 2:B.calendar=2;break}return B},g.toObject=function(p,B){B||(B={});var f={};return p.dayOfWeek!=null&&p.hasOwnProperty("dayOfWeek")&&(f.dayOfWeek=B.enums===String?d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[p.dayOfWeek]===void 0?p.dayOfWeek:d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType[p.dayOfWeek]:p.dayOfWeek,B.oneofs&&(f._dayOfWeek="dayOfWeek")),p.year!=null&&p.hasOwnProperty("year")&&(f.year=p.year,B.oneofs&&(f._year="year")),p.month!=null&&p.hasOwnProperty("month")&&(f.month=p.month,B.oneofs&&(f._month="month")),p.dayOfMonth!=null&&p.hasOwnProperty("dayOfMonth")&&(f.dayOfMonth=p.dayOfMonth,B.oneofs&&(f._dayOfMonth="dayOfMonth")),p.hour!=null&&p.hasOwnProperty("hour")&&(f.hour=p.hour,B.oneofs&&(f._hour="hour")),p.minute!=null&&p.hasOwnProperty("minute")&&(f.minute=p.minute,B.oneofs&&(f._minute="minute")),p.calendar!=null&&p.hasOwnProperty("calendar")&&(f.calendar=B.enums===String?d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[p.calendar]===void 0?p.calendar:d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType[p.calendar]:p.calendar,B.oneofs&&(f._calendar="calendar")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(p){return p===void 0&&(p="type.googleapis.com"),p+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent"},g.CalendarType=(function(){let I={},p=Object.create(I);return p[I[1]="GREGORIAN"]=1,p[I[2]="SOLAR_HIJRI"]=2,p})(),g.DayOfWeekType=(function(){let I={},p=Object.create(I);return p[I[1]="MONDAY"]=1,p[I[2]="TUESDAY"]=2,p[I[3]="WEDNESDAY"]=3,p[I[4]="THURSDAY"]=4,p[I[5]="FRIDAY"]=5,p[I[6]="SATURDAY"]=6,p[I[7]="SUNDAY"]=7,p})(),g})(),r.HSMDateTimeUnixEpoch=(function(){function g(I){if(I)for(var p=Object.keys(I),B=0;B>>3){case 1:{y.timestamp=p.int64();break}default:p.skipType(m&7);break}}return y},g.fromObject=function(p){if(p instanceof d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch)return p;var B=new d.proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch;return p.timestamp!=null&&(l.Long?(B.timestamp=l.Long.fromValue(p.timestamp)).unsigned=!1:typeof p.timestamp=="string"?B.timestamp=parseInt(p.timestamp,10):typeof p.timestamp=="number"?B.timestamp=p.timestamp:typeof p.timestamp=="object"&&(B.timestamp=new l.LongBits(p.timestamp.low>>>0,p.timestamp.high>>>0).toNumber())),B},g.toObject=function(p,B){B||(B={});var f={};return p.timestamp!=null&&p.hasOwnProperty("timestamp")&&(typeof p.timestamp=="number"?f.timestamp=B.longs===String?String(p.timestamp):p.timestamp:f.timestamp=B.longs===String?ge(p.timestamp):B.longs===Number?ce(p.timestamp):p.timestamp,B.oneofs&&(f._timestamp="timestamp")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(p){return p===void 0&&(p="type.googleapis.com"),p+"/proto.Message.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch"},g})(),r})(),i})(),a})(),t.HistorySyncMessageAccessStatus=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.completeAccessGranted=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.HistorySyncMessageAccessStatus)return A;var r=new d.proto.Message.HistorySyncMessageAccessStatus;return A.completeAccessGranted!=null&&(r.completeAccessGranted=!!A.completeAccessGranted),r},a.toObject=function(A,r){r||(r={});var s={};return A.completeAccessGranted!=null&&A.hasOwnProperty("completeAccessGranted")&&(s.completeAccessGranted=A.completeAccessGranted,r.oneofs&&(s._completeAccessGranted="completeAccessGranted")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.HistorySyncMessageAccessStatus"},a})(),t.HistorySyncNotification=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.fileSha256=A.bytes();break}case 2:{c.fileLength=A.uint64();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}case 6:{c.syncType=A.int32();break}case 7:{c.chunkOrder=A.uint32();break}case 8:{c.originalMessageId=A.string();break}case 9:{c.progress=A.uint32();break}case 10:{c.oldestMsgInChunkTimestampSec=A.int64();break}case 11:{c.initialHistBootstrapInlinePayload=A.bytes();break}case 12:{c.peerDataRequestSessionId=A.string();break}case 13:{c.fullHistorySyncOnDemandRequestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(A,A.uint32());break}case 14:{c.encHandle=A.string();break}case 15:{c.messageAccessStatus=d.proto.Message.HistorySyncMessageAccessStatus.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.HistorySyncNotification)return A;var r=new d.proto.Message.HistorySyncNotification;switch(A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.syncType){default:if(typeof A.syncType=="number"){r.syncType=A.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:r.syncType=0;break;case"INITIAL_STATUS_V3":case 1:r.syncType=1;break;case"FULL":case 2:r.syncType=2;break;case"RECENT":case 3:r.syncType=3;break;case"PUSH_NAME":case 4:r.syncType=4;break;case"NON_BLOCKING_DATA":case 5:r.syncType=5;break;case"ON_DEMAND":case 6:r.syncType=6;break;case"NO_HISTORY":case 7:r.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:r.syncType=8;break}if(A.chunkOrder!=null&&(r.chunkOrder=A.chunkOrder>>>0),A.originalMessageId!=null&&(r.originalMessageId=String(A.originalMessageId)),A.progress!=null&&(r.progress=A.progress>>>0),A.oldestMsgInChunkTimestampSec!=null&&(l.Long?(r.oldestMsgInChunkTimestampSec=l.Long.fromValue(A.oldestMsgInChunkTimestampSec)).unsigned=!1:typeof A.oldestMsgInChunkTimestampSec=="string"?r.oldestMsgInChunkTimestampSec=parseInt(A.oldestMsgInChunkTimestampSec,10):typeof A.oldestMsgInChunkTimestampSec=="number"?r.oldestMsgInChunkTimestampSec=A.oldestMsgInChunkTimestampSec:typeof A.oldestMsgInChunkTimestampSec=="object"&&(r.oldestMsgInChunkTimestampSec=new l.LongBits(A.oldestMsgInChunkTimestampSec.low>>>0,A.oldestMsgInChunkTimestampSec.high>>>0).toNumber())),A.initialHistBootstrapInlinePayload!=null&&(typeof A.initialHistBootstrapInlinePayload=="string"?l.base64.decode(A.initialHistBootstrapInlinePayload,r.initialHistBootstrapInlinePayload=l.newBuffer(l.base64.length(A.initialHistBootstrapInlinePayload)),0):A.initialHistBootstrapInlinePayload.length>=0&&(r.initialHistBootstrapInlinePayload=A.initialHistBootstrapInlinePayload)),A.peerDataRequestSessionId!=null&&(r.peerDataRequestSessionId=String(A.peerDataRequestSessionId)),A.fullHistorySyncOnDemandRequestMetadata!=null){if(typeof A.fullHistorySyncOnDemandRequestMetadata!="object")throw TypeError(".proto.Message.HistorySyncNotification.fullHistorySyncOnDemandRequestMetadata: object expected");r.fullHistorySyncOnDemandRequestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(A.fullHistorySyncOnDemandRequestMetadata)}if(A.encHandle!=null&&(r.encHandle=String(A.encHandle)),A.messageAccessStatus!=null){if(typeof A.messageAccessStatus!="object")throw TypeError(".proto.Message.HistorySyncNotification.messageAccessStatus: object expected");r.messageAccessStatus=d.proto.Message.HistorySyncMessageAccessStatus.fromObject(A.messageAccessStatus)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.syncType!=null&&A.hasOwnProperty("syncType")&&(s.syncType=r.enums===String?d.proto.Message.HistorySyncType[A.syncType]===void 0?A.syncType:d.proto.Message.HistorySyncType[A.syncType]:A.syncType,r.oneofs&&(s._syncType="syncType")),A.chunkOrder!=null&&A.hasOwnProperty("chunkOrder")&&(s.chunkOrder=A.chunkOrder,r.oneofs&&(s._chunkOrder="chunkOrder")),A.originalMessageId!=null&&A.hasOwnProperty("originalMessageId")&&(s.originalMessageId=A.originalMessageId,r.oneofs&&(s._originalMessageId="originalMessageId")),A.progress!=null&&A.hasOwnProperty("progress")&&(s.progress=A.progress,r.oneofs&&(s._progress="progress")),A.oldestMsgInChunkTimestampSec!=null&&A.hasOwnProperty("oldestMsgInChunkTimestampSec")&&(typeof A.oldestMsgInChunkTimestampSec=="number"?s.oldestMsgInChunkTimestampSec=r.longs===String?String(A.oldestMsgInChunkTimestampSec):A.oldestMsgInChunkTimestampSec:s.oldestMsgInChunkTimestampSec=r.longs===String?ge(A.oldestMsgInChunkTimestampSec):r.longs===Number?ce(A.oldestMsgInChunkTimestampSec):A.oldestMsgInChunkTimestampSec,r.oneofs&&(s._oldestMsgInChunkTimestampSec="oldestMsgInChunkTimestampSec")),A.initialHistBootstrapInlinePayload!=null&&A.hasOwnProperty("initialHistBootstrapInlinePayload")&&(s.initialHistBootstrapInlinePayload=r.bytes===String?l.base64.encode(A.initialHistBootstrapInlinePayload,0,A.initialHistBootstrapInlinePayload.length):r.bytes===Array?Array.prototype.slice.call(A.initialHistBootstrapInlinePayload):A.initialHistBootstrapInlinePayload,r.oneofs&&(s._initialHistBootstrapInlinePayload="initialHistBootstrapInlinePayload")),A.peerDataRequestSessionId!=null&&A.hasOwnProperty("peerDataRequestSessionId")&&(s.peerDataRequestSessionId=A.peerDataRequestSessionId,r.oneofs&&(s._peerDataRequestSessionId="peerDataRequestSessionId")),A.fullHistorySyncOnDemandRequestMetadata!=null&&A.hasOwnProperty("fullHistorySyncOnDemandRequestMetadata")&&(s.fullHistorySyncOnDemandRequestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(A.fullHistorySyncOnDemandRequestMetadata,r),r.oneofs&&(s._fullHistorySyncOnDemandRequestMetadata="fullHistorySyncOnDemandRequestMetadata")),A.encHandle!=null&&A.hasOwnProperty("encHandle")&&(s.encHandle=A.encHandle,r.oneofs&&(s._encHandle="encHandle")),A.messageAccessStatus!=null&&A.hasOwnProperty("messageAccessStatus")&&(s.messageAccessStatus=d.proto.Message.HistorySyncMessageAccessStatus.toObject(A.messageAccessStatus,r),r.oneofs&&(s._messageAccessStatus="messageAccessStatus")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.HistorySyncNotification"},a})(),t.HistorySyncType=(function(){let a={},e=Object.create(a);return e[a[0]="INITIAL_BOOTSTRAP"]=0,e[a[1]="INITIAL_STATUS_V3"]=1,e[a[2]="FULL"]=2,e[a[3]="RECENT"]=3,e[a[4]="PUSH_NAME"]=4,e[a[5]="NON_BLOCKING_DATA"]=5,e[a[6]="ON_DEMAND"]=6,e[a[7]="NO_HISTORY"]=7,e[a[8]="MESSAGE_ACCESS_STATUS"]=8,e})(),t.ImageMessage=(function(){function a(i){if(this.interactiveAnnotations=[],this.scanLengths=[],this.annotations=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.caption=A.string();break}case 4:{c.fileSha256=A.bytes();break}case 5:{c.fileLength=A.uint64();break}case 6:{c.height=A.uint32();break}case 7:{c.width=A.uint32();break}case 8:{c.mediaKey=A.bytes();break}case 9:{c.fileEncSha256=A.bytes();break}case 10:{c.interactiveAnnotations&&c.interactiveAnnotations.length||(c.interactiveAnnotations=[]),c.interactiveAnnotations.push(d.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 11:{c.directPath=A.string();break}case 12:{c.mediaKeyTimestamp=A.int64();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.firstScanSidecar=A.bytes();break}case 19:{c.firstScanLength=A.uint32();break}case 20:{c.experimentGroupId=A.uint32();break}case 21:{c.scansSidecar=A.bytes();break}case 22:{if(c.scanLengths&&c.scanLengths.length||(c.scanLengths=[]),(I&7)===2)for(var p=A.uint32()+A.pos;A.pos=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.interactiveAnnotations){if(!Array.isArray(A.interactiveAnnotations))throw TypeError(".proto.Message.ImageMessage.interactiveAnnotations: array expected");r.interactiveAnnotations=[];for(var s=0;s>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ImageMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.firstScanSidecar!=null&&(typeof A.firstScanSidecar=="string"?l.base64.decode(A.firstScanSidecar,r.firstScanSidecar=l.newBuffer(l.base64.length(A.firstScanSidecar)),0):A.firstScanSidecar.length>=0&&(r.firstScanSidecar=A.firstScanSidecar)),A.firstScanLength!=null&&(r.firstScanLength=A.firstScanLength>>>0),A.experimentGroupId!=null&&(r.experimentGroupId=A.experimentGroupId>>>0),A.scansSidecar!=null&&(typeof A.scansSidecar=="string"?l.base64.decode(A.scansSidecar,r.scansSidecar=l.newBuffer(l.base64.length(A.scansSidecar)),0):A.scansSidecar.length>=0&&(r.scansSidecar=A.scansSidecar)),A.scanLengths){if(!Array.isArray(A.scanLengths))throw TypeError(".proto.Message.ImageMessage.scanLengths: array expected");r.scanLengths=[];for(var s=0;s>>0}if(A.midQualityFileSha256!=null&&(typeof A.midQualityFileSha256=="string"?l.base64.decode(A.midQualityFileSha256,r.midQualityFileSha256=l.newBuffer(l.base64.length(A.midQualityFileSha256)),0):A.midQualityFileSha256.length>=0&&(r.midQualityFileSha256=A.midQualityFileSha256)),A.midQualityFileEncSha256!=null&&(typeof A.midQualityFileEncSha256=="string"?l.base64.decode(A.midQualityFileEncSha256,r.midQualityFileEncSha256=l.newBuffer(l.base64.length(A.midQualityFileEncSha256)),0):A.midQualityFileEncSha256.length>=0&&(r.midQualityFileEncSha256=A.midQualityFileEncSha256)),A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.staticUrl!=null&&(r.staticUrl=String(A.staticUrl)),A.annotations){if(!Array.isArray(A.annotations))throw TypeError(".proto.Message.ImageMessage.annotations: array expected");r.annotations=[];for(var s=0;s>>3){case 1:{c.securityNotificationEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.InitialSecurityNotificationSettingSync)return A;var r=new d.proto.Message.InitialSecurityNotificationSettingSync;return A.securityNotificationEnabled!=null&&(r.securityNotificationEnabled=!!A.securityNotificationEnabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.securityNotificationEnabled!=null&&A.hasOwnProperty("securityNotificationEnabled")&&(s.securityNotificationEnabled=A.securityNotificationEnabled,r.oneofs&&(s._securityNotificationEnabled="securityNotificationEnabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InitialSecurityNotificationSettingSync"},a})(),t.InteractiveMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.header=d.proto.Message.InteractiveMessage.Header.decode(A,A.uint32());break}case 2:{c.body=d.proto.Message.InteractiveMessage.Body.decode(A,A.uint32());break}case 3:{c.footer=d.proto.Message.InteractiveMessage.Footer.decode(A,A.uint32());break}case 15:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 16:{c.urlTrackingMap=d.proto.UrlTrackingMap.decode(A,A.uint32());break}case 4:{c.shopStorefrontMessage=d.proto.Message.InteractiveMessage.ShopMessage.decode(A,A.uint32());break}case 5:{c.collectionMessage=d.proto.Message.InteractiveMessage.CollectionMessage.decode(A,A.uint32());break}case 6:{c.nativeFlowMessage=d.proto.Message.InteractiveMessage.NativeFlowMessage.decode(A,A.uint32());break}case 7:{c.carouselMessage=d.proto.Message.InteractiveMessage.CarouselMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.InteractiveMessage)return A;var r=new d.proto.Message.InteractiveMessage;if(A.header!=null){if(typeof A.header!="object")throw TypeError(".proto.Message.InteractiveMessage.header: object expected");r.header=d.proto.Message.InteractiveMessage.Header.fromObject(A.header)}if(A.body!=null){if(typeof A.body!="object")throw TypeError(".proto.Message.InteractiveMessage.body: object expected");r.body=d.proto.Message.InteractiveMessage.Body.fromObject(A.body)}if(A.footer!=null){if(typeof A.footer!="object")throw TypeError(".proto.Message.InteractiveMessage.footer: object expected");r.footer=d.proto.Message.InteractiveMessage.Footer.fromObject(A.footer)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.InteractiveMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.urlTrackingMap!=null){if(typeof A.urlTrackingMap!="object")throw TypeError(".proto.Message.InteractiveMessage.urlTrackingMap: object expected");r.urlTrackingMap=d.proto.UrlTrackingMap.fromObject(A.urlTrackingMap)}if(A.shopStorefrontMessage!=null){if(typeof A.shopStorefrontMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.shopStorefrontMessage: object expected");r.shopStorefrontMessage=d.proto.Message.InteractiveMessage.ShopMessage.fromObject(A.shopStorefrontMessage)}if(A.collectionMessage!=null){if(typeof A.collectionMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.collectionMessage: object expected");r.collectionMessage=d.proto.Message.InteractiveMessage.CollectionMessage.fromObject(A.collectionMessage)}if(A.nativeFlowMessage!=null){if(typeof A.nativeFlowMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.nativeFlowMessage: object expected");r.nativeFlowMessage=d.proto.Message.InteractiveMessage.NativeFlowMessage.fromObject(A.nativeFlowMessage)}if(A.carouselMessage!=null){if(typeof A.carouselMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.carouselMessage: object expected");r.carouselMessage=d.proto.Message.InteractiveMessage.CarouselMessage.fromObject(A.carouselMessage)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.header!=null&&A.hasOwnProperty("header")&&(s.header=d.proto.Message.InteractiveMessage.Header.toObject(A.header,r),r.oneofs&&(s._header="header")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=d.proto.Message.InteractiveMessage.Body.toObject(A.body,r),r.oneofs&&(s._body="body")),A.footer!=null&&A.hasOwnProperty("footer")&&(s.footer=d.proto.Message.InteractiveMessage.Footer.toObject(A.footer,r),r.oneofs&&(s._footer="footer")),A.shopStorefrontMessage!=null&&A.hasOwnProperty("shopStorefrontMessage")&&(s.shopStorefrontMessage=d.proto.Message.InteractiveMessage.ShopMessage.toObject(A.shopStorefrontMessage,r),r.oneofs&&(s.interactiveMessage="shopStorefrontMessage")),A.collectionMessage!=null&&A.hasOwnProperty("collectionMessage")&&(s.collectionMessage=d.proto.Message.InteractiveMessage.CollectionMessage.toObject(A.collectionMessage,r),r.oneofs&&(s.interactiveMessage="collectionMessage")),A.nativeFlowMessage!=null&&A.hasOwnProperty("nativeFlowMessage")&&(s.nativeFlowMessage=d.proto.Message.InteractiveMessage.NativeFlowMessage.toObject(A.nativeFlowMessage,r),r.oneofs&&(s.interactiveMessage="nativeFlowMessage")),A.carouselMessage!=null&&A.hasOwnProperty("carouselMessage")&&(s.carouselMessage=d.proto.Message.InteractiveMessage.CarouselMessage.toObject(A.carouselMessage,r),r.oneofs&&(s.interactiveMessage="carouselMessage")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.urlTrackingMap!=null&&A.hasOwnProperty("urlTrackingMap")&&(s.urlTrackingMap=d.proto.UrlTrackingMap.toObject(A.urlTrackingMap,r),r.oneofs&&(s._urlTrackingMap="urlTrackingMap")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InteractiveMessage"},a.Body=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.text=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.Body)return s;var g=new d.proto.Message.InteractiveMessage.Body;return s.text!=null&&(g.text=String(s.text)),g},i.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Body"},i})(),a.CarouselMessage=(function(){function i(r){if(this.cards=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.cards&&p.cards.length||(p.cards=[]),p.cards.push(d.proto.Message.InteractiveMessage.decode(s,s.uint32()));break}case 2:{p.messageVersion=s.int32();break}case 3:{p.carouselCardType=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.CarouselMessage)return s;var g=new d.proto.Message.InteractiveMessage.CarouselMessage;if(s.cards){if(!Array.isArray(s.cards))throw TypeError(".proto.Message.InteractiveMessage.CarouselMessage.cards: array expected");g.cards=[];for(var c=0;c>>3){case 1:{p.bizJid=s.string();break}case 2:{p.id=s.string();break}case 3:{p.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.CollectionMessage)return s;var g=new d.proto.Message.InteractiveMessage.CollectionMessage;return s.bizJid!=null&&(g.bizJid=String(s.bizJid)),s.id!=null&&(g.id=String(s.id)),s.messageVersion!=null&&(g.messageVersion=s.messageVersion|0),g},i.toObject=function(s,g){g||(g={});var c={};return s.bizJid!=null&&s.hasOwnProperty("bizJid")&&(c.bizJid=s.bizJid,g.oneofs&&(c._bizJid="bizJid")),s.id!=null&&s.hasOwnProperty("id")&&(c.id=s.id,g.oneofs&&(c._id="id")),s.messageVersion!=null&&s.hasOwnProperty("messageVersion")&&(c.messageVersion=s.messageVersion,g.oneofs&&(c._messageVersion="messageVersion")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.CollectionMessage"},i})(),a.Footer=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.text=s.string();break}case 3:{p.hasMediaAttachment=s.bool();break}case 2:{p.audioMessage=d.proto.Message.AudioMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.Footer)return s;var g=new d.proto.Message.InteractiveMessage.Footer;if(s.text!=null&&(g.text=String(s.text)),s.hasMediaAttachment!=null&&(g.hasMediaAttachment=!!s.hasMediaAttachment),s.audioMessage!=null){if(typeof s.audioMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Footer.audioMessage: object expected");g.audioMessage=d.proto.Message.AudioMessage.fromObject(s.audioMessage)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),s.audioMessage!=null&&s.hasOwnProperty("audioMessage")&&(c.audioMessage=d.proto.Message.AudioMessage.toObject(s.audioMessage,g),g.oneofs&&(c.media="audioMessage")),s.hasMediaAttachment!=null&&s.hasOwnProperty("hasMediaAttachment")&&(c.hasMediaAttachment=s.hasMediaAttachment,g.oneofs&&(c._hasMediaAttachment="hasMediaAttachment")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Footer"},i})(),a.Header=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.title=s.string();break}case 2:{p.subtitle=s.string();break}case 5:{p.hasMediaAttachment=s.bool();break}case 3:{p.documentMessage=d.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 4:{p.imageMessage=d.proto.Message.ImageMessage.decode(s,s.uint32());break}case 6:{p.jpegThumbnail=s.bytes();break}case 7:{p.videoMessage=d.proto.Message.VideoMessage.decode(s,s.uint32());break}case 8:{p.locationMessage=d.proto.Message.LocationMessage.decode(s,s.uint32());break}case 9:{p.productMessage=d.proto.Message.ProductMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.Header)return s;var g=new d.proto.Message.InteractiveMessage.Header;if(s.title!=null&&(g.title=String(s.title)),s.subtitle!=null&&(g.subtitle=String(s.subtitle)),s.hasMediaAttachment!=null&&(g.hasMediaAttachment=!!s.hasMediaAttachment),s.documentMessage!=null){if(typeof s.documentMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.documentMessage: object expected");g.documentMessage=d.proto.Message.DocumentMessage.fromObject(s.documentMessage)}if(s.imageMessage!=null){if(typeof s.imageMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.imageMessage: object expected");g.imageMessage=d.proto.Message.ImageMessage.fromObject(s.imageMessage)}if(s.jpegThumbnail!=null&&(typeof s.jpegThumbnail=="string"?l.base64.decode(s.jpegThumbnail,g.jpegThumbnail=l.newBuffer(l.base64.length(s.jpegThumbnail)),0):s.jpegThumbnail.length>=0&&(g.jpegThumbnail=s.jpegThumbnail)),s.videoMessage!=null){if(typeof s.videoMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.videoMessage: object expected");g.videoMessage=d.proto.Message.VideoMessage.fromObject(s.videoMessage)}if(s.locationMessage!=null){if(typeof s.locationMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.locationMessage: object expected");g.locationMessage=d.proto.Message.LocationMessage.fromObject(s.locationMessage)}if(s.productMessage!=null){if(typeof s.productMessage!="object")throw TypeError(".proto.Message.InteractiveMessage.Header.productMessage: object expected");g.productMessage=d.proto.Message.ProductMessage.fromObject(s.productMessage)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.subtitle!=null&&s.hasOwnProperty("subtitle")&&(c.subtitle=s.subtitle,g.oneofs&&(c._subtitle="subtitle")),s.documentMessage!=null&&s.hasOwnProperty("documentMessage")&&(c.documentMessage=d.proto.Message.DocumentMessage.toObject(s.documentMessage,g),g.oneofs&&(c.media="documentMessage")),s.imageMessage!=null&&s.hasOwnProperty("imageMessage")&&(c.imageMessage=d.proto.Message.ImageMessage.toObject(s.imageMessage,g),g.oneofs&&(c.media="imageMessage")),s.hasMediaAttachment!=null&&s.hasOwnProperty("hasMediaAttachment")&&(c.hasMediaAttachment=s.hasMediaAttachment,g.oneofs&&(c._hasMediaAttachment="hasMediaAttachment")),s.jpegThumbnail!=null&&s.hasOwnProperty("jpegThumbnail")&&(c.jpegThumbnail=g.bytes===String?l.base64.encode(s.jpegThumbnail,0,s.jpegThumbnail.length):g.bytes===Array?Array.prototype.slice.call(s.jpegThumbnail):s.jpegThumbnail,g.oneofs&&(c.media="jpegThumbnail")),s.videoMessage!=null&&s.hasOwnProperty("videoMessage")&&(c.videoMessage=d.proto.Message.VideoMessage.toObject(s.videoMessage,g),g.oneofs&&(c.media="videoMessage")),s.locationMessage!=null&&s.hasOwnProperty("locationMessage")&&(c.locationMessage=d.proto.Message.LocationMessage.toObject(s.locationMessage,g),g.oneofs&&(c.media="locationMessage")),s.productMessage!=null&&s.hasOwnProperty("productMessage")&&(c.productMessage=d.proto.Message.ProductMessage.toObject(s.productMessage,g),g.oneofs&&(c.media="productMessage")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.Header"},i})(),a.NativeFlowMessage=(function(){function i(r){if(this.buttons=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.buttons&&p.buttons.length||(p.buttons=[]),p.buttons.push(d.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton.decode(s,s.uint32()));break}case 2:{p.messageParamsJson=s.string();break}case 3:{p.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.NativeFlowMessage)return s;var g=new d.proto.Message.InteractiveMessage.NativeFlowMessage;if(s.buttons){if(!Array.isArray(s.buttons))throw TypeError(".proto.Message.InteractiveMessage.NativeFlowMessage.buttons: array expected");g.buttons=[];for(var c=0;c>>3){case 1:{f.name=c.string();break}case 2:{f.buttonParamsJson=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton)return c;var I=new d.proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton;return c.name!=null&&(I.name=String(c.name)),c.buttonParamsJson!=null&&(I.buttonParamsJson=String(c.buttonParamsJson)),I},r.toObject=function(c,I){I||(I={});var p={};return c.name!=null&&c.hasOwnProperty("name")&&(p.name=c.name,I.oneofs&&(p._name="name")),c.buttonParamsJson!=null&&c.hasOwnProperty("buttonParamsJson")&&(p.buttonParamsJson=c.buttonParamsJson,I.oneofs&&(p._buttonParamsJson="buttonParamsJson")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.InteractiveMessage.NativeFlowMessage.NativeFlowButton"},r})(),i})(),a.ShopMessage=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.id=s.string();break}case 2:{p.surface=s.int32();break}case 3:{p.messageVersion=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveMessage.ShopMessage)return s;var g=new d.proto.Message.InteractiveMessage.ShopMessage;switch(s.id!=null&&(g.id=String(s.id)),s.surface){default:if(typeof s.surface=="number"){g.surface=s.surface;break}break;case"UNKNOWN_SURFACE":case 0:g.surface=0;break;case"FB":case 1:g.surface=1;break;case"IG":case 2:g.surface=2;break;case"WA":case 3:g.surface=3;break}return s.messageVersion!=null&&(g.messageVersion=s.messageVersion|0),g},i.toObject=function(s,g){g||(g={});var c={};return s.id!=null&&s.hasOwnProperty("id")&&(c.id=s.id,g.oneofs&&(c._id="id")),s.surface!=null&&s.hasOwnProperty("surface")&&(c.surface=g.enums===String?d.proto.Message.InteractiveMessage.ShopMessage.Surface[s.surface]===void 0?s.surface:d.proto.Message.InteractiveMessage.ShopMessage.Surface[s.surface]:s.surface,g.oneofs&&(c._surface="surface")),s.messageVersion!=null&&s.hasOwnProperty("messageVersion")&&(c.messageVersion=s.messageVersion,g.oneofs&&(c._messageVersion="messageVersion")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveMessage.ShopMessage"},i.Surface=(function(){let r={},s=Object.create(r);return s[r[0]="UNKNOWN_SURFACE"]=0,s[r[1]="FB"]=1,s[r[2]="IG"]=2,s[r[3]="WA"]=3,s})(),i})(),a})(),t.InteractiveResponseMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.body=d.proto.Message.InteractiveResponseMessage.Body.decode(A,A.uint32());break}case 15:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.nativeFlowResponseMessage=d.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.InteractiveResponseMessage)return A;var r=new d.proto.Message.InteractiveResponseMessage;if(A.body!=null){if(typeof A.body!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.body: object expected");r.body=d.proto.Message.InteractiveResponseMessage.Body.fromObject(A.body)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.nativeFlowResponseMessage!=null){if(typeof A.nativeFlowResponseMessage!="object")throw TypeError(".proto.Message.InteractiveResponseMessage.nativeFlowResponseMessage: object expected");r.nativeFlowResponseMessage=d.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.fromObject(A.nativeFlowResponseMessage)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.body!=null&&A.hasOwnProperty("body")&&(s.body=d.proto.Message.InteractiveResponseMessage.Body.toObject(A.body,r),r.oneofs&&(s._body="body")),A.nativeFlowResponseMessage!=null&&A.hasOwnProperty("nativeFlowResponseMessage")&&(s.nativeFlowResponseMessage=d.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage.toObject(A.nativeFlowResponseMessage,r),r.oneofs&&(s.interactiveResponseMessage="nativeFlowResponseMessage")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InteractiveResponseMessage"},a.Body=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.text=s.string();break}case 2:{p.format=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveResponseMessage.Body)return s;var g=new d.proto.Message.InteractiveResponseMessage.Body;switch(s.text!=null&&(g.text=String(s.text)),s.format){default:if(typeof s.format=="number"){g.format=s.format;break}break;case"DEFAULT":case 0:g.format=0;break;case"EXTENSIONS_1":case 1:g.format=1;break}return g},i.toObject=function(s,g){g||(g={});var c={};return s.text!=null&&s.hasOwnProperty("text")&&(c.text=s.text,g.oneofs&&(c._text="text")),s.format!=null&&s.hasOwnProperty("format")&&(c.format=g.enums===String?d.proto.Message.InteractiveResponseMessage.Body.Format[s.format]===void 0?s.format:d.proto.Message.InteractiveResponseMessage.Body.Format[s.format]:s.format,g.oneofs&&(c._format="format")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveResponseMessage.Body"},i.Format=(function(){let r={},s=Object.create(r);return s[r[0]="DEFAULT"]=0,s[r[1]="EXTENSIONS_1"]=1,s})(),i})(),a.NativeFlowResponseMessage=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.name=s.string();break}case 2:{p.paramsJson=s.string();break}case 3:{p.version=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage)return s;var g=new d.proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage;return s.name!=null&&(g.name=String(s.name)),s.paramsJson!=null&&(g.paramsJson=String(s.paramsJson)),s.version!=null&&(g.version=s.version|0),g},i.toObject=function(s,g){g||(g={});var c={};return s.name!=null&&s.hasOwnProperty("name")&&(c.name=s.name,g.oneofs&&(c._name="name")),s.paramsJson!=null&&s.hasOwnProperty("paramsJson")&&(c.paramsJson=s.paramsJson,g.oneofs&&(c._paramsJson="paramsJson")),s.version!=null&&s.hasOwnProperty("version")&&(c.version=s.version,g.oneofs&&(c._version="version")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.InteractiveResponseMessage.NativeFlowResponseMessage"},i})(),a})(),t.InvoiceMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.note=A.string();break}case 2:{c.token=A.string();break}case 3:{c.attachmentType=A.int32();break}case 4:{c.attachmentMimetype=A.string();break}case 5:{c.attachmentMediaKey=A.bytes();break}case 6:{c.attachmentMediaKeyTimestamp=A.int64();break}case 7:{c.attachmentFileSha256=A.bytes();break}case 8:{c.attachmentFileEncSha256=A.bytes();break}case 9:{c.attachmentDirectPath=A.string();break}case 10:{c.attachmentJpegThumbnail=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.InvoiceMessage)return A;var r=new d.proto.Message.InvoiceMessage;switch(A.note!=null&&(r.note=String(A.note)),A.token!=null&&(r.token=String(A.token)),A.attachmentType){default:if(typeof A.attachmentType=="number"){r.attachmentType=A.attachmentType;break}break;case"IMAGE":case 0:r.attachmentType=0;break;case"PDF":case 1:r.attachmentType=1;break}return A.attachmentMimetype!=null&&(r.attachmentMimetype=String(A.attachmentMimetype)),A.attachmentMediaKey!=null&&(typeof A.attachmentMediaKey=="string"?l.base64.decode(A.attachmentMediaKey,r.attachmentMediaKey=l.newBuffer(l.base64.length(A.attachmentMediaKey)),0):A.attachmentMediaKey.length>=0&&(r.attachmentMediaKey=A.attachmentMediaKey)),A.attachmentMediaKeyTimestamp!=null&&(l.Long?(r.attachmentMediaKeyTimestamp=l.Long.fromValue(A.attachmentMediaKeyTimestamp)).unsigned=!1:typeof A.attachmentMediaKeyTimestamp=="string"?r.attachmentMediaKeyTimestamp=parseInt(A.attachmentMediaKeyTimestamp,10):typeof A.attachmentMediaKeyTimestamp=="number"?r.attachmentMediaKeyTimestamp=A.attachmentMediaKeyTimestamp:typeof A.attachmentMediaKeyTimestamp=="object"&&(r.attachmentMediaKeyTimestamp=new l.LongBits(A.attachmentMediaKeyTimestamp.low>>>0,A.attachmentMediaKeyTimestamp.high>>>0).toNumber())),A.attachmentFileSha256!=null&&(typeof A.attachmentFileSha256=="string"?l.base64.decode(A.attachmentFileSha256,r.attachmentFileSha256=l.newBuffer(l.base64.length(A.attachmentFileSha256)),0):A.attachmentFileSha256.length>=0&&(r.attachmentFileSha256=A.attachmentFileSha256)),A.attachmentFileEncSha256!=null&&(typeof A.attachmentFileEncSha256=="string"?l.base64.decode(A.attachmentFileEncSha256,r.attachmentFileEncSha256=l.newBuffer(l.base64.length(A.attachmentFileEncSha256)),0):A.attachmentFileEncSha256.length>=0&&(r.attachmentFileEncSha256=A.attachmentFileEncSha256)),A.attachmentDirectPath!=null&&(r.attachmentDirectPath=String(A.attachmentDirectPath)),A.attachmentJpegThumbnail!=null&&(typeof A.attachmentJpegThumbnail=="string"?l.base64.decode(A.attachmentJpegThumbnail,r.attachmentJpegThumbnail=l.newBuffer(l.base64.length(A.attachmentJpegThumbnail)),0):A.attachmentJpegThumbnail.length>=0&&(r.attachmentJpegThumbnail=A.attachmentJpegThumbnail)),r},a.toObject=function(A,r){r||(r={});var s={};return A.note!=null&&A.hasOwnProperty("note")&&(s.note=A.note,r.oneofs&&(s._note="note")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=A.token,r.oneofs&&(s._token="token")),A.attachmentType!=null&&A.hasOwnProperty("attachmentType")&&(s.attachmentType=r.enums===String?d.proto.Message.InvoiceMessage.AttachmentType[A.attachmentType]===void 0?A.attachmentType:d.proto.Message.InvoiceMessage.AttachmentType[A.attachmentType]:A.attachmentType,r.oneofs&&(s._attachmentType="attachmentType")),A.attachmentMimetype!=null&&A.hasOwnProperty("attachmentMimetype")&&(s.attachmentMimetype=A.attachmentMimetype,r.oneofs&&(s._attachmentMimetype="attachmentMimetype")),A.attachmentMediaKey!=null&&A.hasOwnProperty("attachmentMediaKey")&&(s.attachmentMediaKey=r.bytes===String?l.base64.encode(A.attachmentMediaKey,0,A.attachmentMediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentMediaKey):A.attachmentMediaKey,r.oneofs&&(s._attachmentMediaKey="attachmentMediaKey")),A.attachmentMediaKeyTimestamp!=null&&A.hasOwnProperty("attachmentMediaKeyTimestamp")&&(typeof A.attachmentMediaKeyTimestamp=="number"?s.attachmentMediaKeyTimestamp=r.longs===String?String(A.attachmentMediaKeyTimestamp):A.attachmentMediaKeyTimestamp:s.attachmentMediaKeyTimestamp=r.longs===String?ge(A.attachmentMediaKeyTimestamp):r.longs===Number?ce(A.attachmentMediaKeyTimestamp):A.attachmentMediaKeyTimestamp,r.oneofs&&(s._attachmentMediaKeyTimestamp="attachmentMediaKeyTimestamp")),A.attachmentFileSha256!=null&&A.hasOwnProperty("attachmentFileSha256")&&(s.attachmentFileSha256=r.bytes===String?l.base64.encode(A.attachmentFileSha256,0,A.attachmentFileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentFileSha256):A.attachmentFileSha256,r.oneofs&&(s._attachmentFileSha256="attachmentFileSha256")),A.attachmentFileEncSha256!=null&&A.hasOwnProperty("attachmentFileEncSha256")&&(s.attachmentFileEncSha256=r.bytes===String?l.base64.encode(A.attachmentFileEncSha256,0,A.attachmentFileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentFileEncSha256):A.attachmentFileEncSha256,r.oneofs&&(s._attachmentFileEncSha256="attachmentFileEncSha256")),A.attachmentDirectPath!=null&&A.hasOwnProperty("attachmentDirectPath")&&(s.attachmentDirectPath=A.attachmentDirectPath,r.oneofs&&(s._attachmentDirectPath="attachmentDirectPath")),A.attachmentJpegThumbnail!=null&&A.hasOwnProperty("attachmentJpegThumbnail")&&(s.attachmentJpegThumbnail=r.bytes===String?l.base64.encode(A.attachmentJpegThumbnail,0,A.attachmentJpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.attachmentJpegThumbnail):A.attachmentJpegThumbnail,r.oneofs&&(s._attachmentJpegThumbnail="attachmentJpegThumbnail")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.InvoiceMessage"},a.AttachmentType=(function(){let i={},A=Object.create(i);return A[i[0]="IMAGE"]=0,A[i[1]="PDF"]=1,A})(),a})(),t.KeepInChatMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.keepType=A.int32();break}case 3:{c.timestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.KeepInChatMessage)return A;var r=new d.proto.Message.KeepInChatMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.KeepInChatMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}switch(A.keepType){default:if(typeof A.keepType=="number"){r.keepType=A.keepType;break}break;case"UNKNOWN":case 0:r.keepType=0;break;case"KEEP_FOR_ALL":case 1:r.keepType=1;break;case"UNDO_KEEP_FOR_ALL":case 2:r.keepType=2;break}return A.timestampMs!=null&&(l.Long?(r.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?r.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?r.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(r.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.keepType!=null&&A.hasOwnProperty("keepType")&&(s.keepType=r.enums===String?d.proto.KeepType[A.keepType]===void 0?A.keepType:d.proto.KeepType[A.keepType]:A.keepType,r.oneofs&&(s._keepType="keepType")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=r.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=r.longs===String?ge(A.timestampMs):r.longs===Number?ce(A.timestampMs):A.timestampMs,r.oneofs&&(s._timestampMs="timestampMs")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.KeepInChatMessage"},a})(),t.LinkPreviewMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.paymentLinkMetadata=d.proto.Message.PaymentLinkMetadata.decode(A,A.uint32());break}case 2:{c.urlMetadata=d.proto.Message.URLMetadata.decode(A,A.uint32());break}case 3:{c.fbExperimentId=A.uint32();break}case 4:{c.linkMediaDuration=A.uint32();break}case 5:{c.socialMediaPostType=A.int32();break}case 6:{c.linkInlineVideoMuted=A.bool();break}case 7:{c.videoContentUrl=A.string();break}case 8:{c.musicMetadata=d.proto.EmbeddedMusic.decode(A,A.uint32());break}case 9:{c.videoContentCaption=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.LinkPreviewMetadata)return A;var r=new d.proto.Message.LinkPreviewMetadata;if(A.paymentLinkMetadata!=null){if(typeof A.paymentLinkMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.paymentLinkMetadata: object expected");r.paymentLinkMetadata=d.proto.Message.PaymentLinkMetadata.fromObject(A.paymentLinkMetadata)}if(A.urlMetadata!=null){if(typeof A.urlMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.urlMetadata: object expected");r.urlMetadata=d.proto.Message.URLMetadata.fromObject(A.urlMetadata)}switch(A.fbExperimentId!=null&&(r.fbExperimentId=A.fbExperimentId>>>0),A.linkMediaDuration!=null&&(r.linkMediaDuration=A.linkMediaDuration>>>0),A.socialMediaPostType){default:if(typeof A.socialMediaPostType=="number"){r.socialMediaPostType=A.socialMediaPostType;break}break;case"NONE":case 0:r.socialMediaPostType=0;break;case"REEL":case 1:r.socialMediaPostType=1;break;case"LIVE_VIDEO":case 2:r.socialMediaPostType=2;break;case"LONG_VIDEO":case 3:r.socialMediaPostType=3;break;case"SINGLE_IMAGE":case 4:r.socialMediaPostType=4;break;case"CAROUSEL":case 5:r.socialMediaPostType=5;break}if(A.linkInlineVideoMuted!=null&&(r.linkInlineVideoMuted=!!A.linkInlineVideoMuted),A.videoContentUrl!=null&&(r.videoContentUrl=String(A.videoContentUrl)),A.musicMetadata!=null){if(typeof A.musicMetadata!="object")throw TypeError(".proto.Message.LinkPreviewMetadata.musicMetadata: object expected");r.musicMetadata=d.proto.EmbeddedMusic.fromObject(A.musicMetadata)}return A.videoContentCaption!=null&&(r.videoContentCaption=String(A.videoContentCaption)),r},a.toObject=function(A,r){r||(r={});var s={};return A.paymentLinkMetadata!=null&&A.hasOwnProperty("paymentLinkMetadata")&&(s.paymentLinkMetadata=d.proto.Message.PaymentLinkMetadata.toObject(A.paymentLinkMetadata,r),r.oneofs&&(s._paymentLinkMetadata="paymentLinkMetadata")),A.urlMetadata!=null&&A.hasOwnProperty("urlMetadata")&&(s.urlMetadata=d.proto.Message.URLMetadata.toObject(A.urlMetadata,r),r.oneofs&&(s._urlMetadata="urlMetadata")),A.fbExperimentId!=null&&A.hasOwnProperty("fbExperimentId")&&(s.fbExperimentId=A.fbExperimentId,r.oneofs&&(s._fbExperimentId="fbExperimentId")),A.linkMediaDuration!=null&&A.hasOwnProperty("linkMediaDuration")&&(s.linkMediaDuration=A.linkMediaDuration,r.oneofs&&(s._linkMediaDuration="linkMediaDuration")),A.socialMediaPostType!=null&&A.hasOwnProperty("socialMediaPostType")&&(s.socialMediaPostType=r.enums===String?d.proto.Message.LinkPreviewMetadata.SocialMediaPostType[A.socialMediaPostType]===void 0?A.socialMediaPostType:d.proto.Message.LinkPreviewMetadata.SocialMediaPostType[A.socialMediaPostType]:A.socialMediaPostType,r.oneofs&&(s._socialMediaPostType="socialMediaPostType")),A.linkInlineVideoMuted!=null&&A.hasOwnProperty("linkInlineVideoMuted")&&(s.linkInlineVideoMuted=A.linkInlineVideoMuted,r.oneofs&&(s._linkInlineVideoMuted="linkInlineVideoMuted")),A.videoContentUrl!=null&&A.hasOwnProperty("videoContentUrl")&&(s.videoContentUrl=A.videoContentUrl,r.oneofs&&(s._videoContentUrl="videoContentUrl")),A.musicMetadata!=null&&A.hasOwnProperty("musicMetadata")&&(s.musicMetadata=d.proto.EmbeddedMusic.toObject(A.musicMetadata,r),r.oneofs&&(s._musicMetadata="musicMetadata")),A.videoContentCaption!=null&&A.hasOwnProperty("videoContentCaption")&&(s.videoContentCaption=A.videoContentCaption,r.oneofs&&(s._videoContentCaption="videoContentCaption")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LinkPreviewMetadata"},a.SocialMediaPostType=(function(){let i={},A=Object.create(i);return A[i[0]="NONE"]=0,A[i[1]="REEL"]=1,A[i[2]="LIVE_VIDEO"]=2,A[i[3]="LONG_VIDEO"]=3,A[i[4]="SINGLE_IMAGE"]=4,A[i[5]="CAROUSEL"]=5,A})(),a})(),t.ListMessage=(function(){function a(i){if(this.sections=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.title=A.string();break}case 2:{c.description=A.string();break}case 3:{c.buttonText=A.string();break}case 4:{c.listType=A.int32();break}case 5:{c.sections&&c.sections.length||(c.sections=[]),c.sections.push(d.proto.Message.ListMessage.Section.decode(A,A.uint32()));break}case 6:{c.productListInfo=d.proto.Message.ListMessage.ProductListInfo.decode(A,A.uint32());break}case 7:{c.footerText=A.string();break}case 8:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ListMessage)return A;var r=new d.proto.Message.ListMessage;switch(A.title!=null&&(r.title=String(A.title)),A.description!=null&&(r.description=String(A.description)),A.buttonText!=null&&(r.buttonText=String(A.buttonText)),A.listType){default:if(typeof A.listType=="number"){r.listType=A.listType;break}break;case"UNKNOWN":case 0:r.listType=0;break;case"SINGLE_SELECT":case 1:r.listType=1;break;case"PRODUCT_LIST":case 2:r.listType=2;break}if(A.sections){if(!Array.isArray(A.sections))throw TypeError(".proto.Message.ListMessage.sections: array expected");r.sections=[];for(var s=0;s>>3){case 1:{p.productId=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListMessage.Product)return s;var g=new d.proto.Message.ListMessage.Product;return s.productId!=null&&(g.productId=String(s.productId)),g},i.toObject=function(s,g){g||(g={});var c={};return s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.Product"},i})(),a.ProductListHeaderImage=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.productId=s.string();break}case 2:{p.jpegThumbnail=s.bytes();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListMessage.ProductListHeaderImage)return s;var g=new d.proto.Message.ListMessage.ProductListHeaderImage;return s.productId!=null&&(g.productId=String(s.productId)),s.jpegThumbnail!=null&&(typeof s.jpegThumbnail=="string"?l.base64.decode(s.jpegThumbnail,g.jpegThumbnail=l.newBuffer(l.base64.length(s.jpegThumbnail)),0):s.jpegThumbnail.length>=0&&(g.jpegThumbnail=s.jpegThumbnail)),g},i.toObject=function(s,g){g||(g={});var c={};return s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),s.jpegThumbnail!=null&&s.hasOwnProperty("jpegThumbnail")&&(c.jpegThumbnail=g.bytes===String?l.base64.encode(s.jpegThumbnail,0,s.jpegThumbnail.length):g.bytes===Array?Array.prototype.slice.call(s.jpegThumbnail):s.jpegThumbnail,g.oneofs&&(c._jpegThumbnail="jpegThumbnail")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.ProductListHeaderImage"},i})(),a.ProductListInfo=(function(){function i(r){if(this.productSections=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.productSections&&p.productSections.length||(p.productSections=[]),p.productSections.push(d.proto.Message.ListMessage.ProductSection.decode(s,s.uint32()));break}case 2:{p.headerImage=d.proto.Message.ListMessage.ProductListHeaderImage.decode(s,s.uint32());break}case 3:{p.businessOwnerJid=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListMessage.ProductListInfo)return s;var g=new d.proto.Message.ListMessage.ProductListInfo;if(s.productSections){if(!Array.isArray(s.productSections))throw TypeError(".proto.Message.ListMessage.ProductListInfo.productSections: array expected");g.productSections=[];for(var c=0;c>>3){case 1:{p.title=s.string();break}case 2:{p.products&&p.products.length||(p.products=[]),p.products.push(d.proto.Message.ListMessage.Product.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListMessage.ProductSection)return s;var g=new d.proto.Message.ListMessage.ProductSection;if(s.title!=null&&(g.title=String(s.title)),s.products){if(!Array.isArray(s.products))throw TypeError(".proto.Message.ListMessage.ProductSection.products: array expected");g.products=[];for(var c=0;c>>3){case 1:{p.title=s.string();break}case 2:{p.description=s.string();break}case 3:{p.rowId=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListMessage.Row)return s;var g=new d.proto.Message.ListMessage.Row;return s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.rowId!=null&&(g.rowId=String(s.rowId)),g},i.toObject=function(s,g){g||(g={});var c={};return s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.rowId!=null&&s.hasOwnProperty("rowId")&&(c.rowId=s.rowId,g.oneofs&&(c._rowId="rowId")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListMessage.Row"},i})(),a.Section=(function(){function i(r){if(this.rows=[],r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.title=s.string();break}case 2:{p.rows&&p.rows.length||(p.rows=[]),p.rows.push(d.proto.Message.ListMessage.Row.decode(s,s.uint32()));break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListMessage.Section)return s;var g=new d.proto.Message.ListMessage.Section;if(s.title!=null&&(g.title=String(s.title)),s.rows){if(!Array.isArray(s.rows))throw TypeError(".proto.Message.ListMessage.Section.rows: array expected");g.rows=[];for(var c=0;c>>3){case 1:{c.title=A.string();break}case 2:{c.listType=A.int32();break}case 3:{c.singleSelectReply=d.proto.Message.ListResponseMessage.SingleSelectReply.decode(A,A.uint32());break}case 4:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 5:{c.description=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ListResponseMessage)return A;var r=new d.proto.Message.ListResponseMessage;switch(A.title!=null&&(r.title=String(A.title)),A.listType){default:if(typeof A.listType=="number"){r.listType=A.listType;break}break;case"UNKNOWN":case 0:r.listType=0;break;case"SINGLE_SELECT":case 1:r.listType=1;break}if(A.singleSelectReply!=null){if(typeof A.singleSelectReply!="object")throw TypeError(".proto.Message.ListResponseMessage.singleSelectReply: object expected");r.singleSelectReply=d.proto.Message.ListResponseMessage.SingleSelectReply.fromObject(A.singleSelectReply)}if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ListResponseMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return A.description!=null&&(r.description=String(A.description)),r},a.toObject=function(A,r){r||(r={});var s={};return A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.listType!=null&&A.hasOwnProperty("listType")&&(s.listType=r.enums===String?d.proto.Message.ListResponseMessage.ListType[A.listType]===void 0?A.listType:d.proto.Message.ListResponseMessage.ListType[A.listType]:A.listType,r.oneofs&&(s._listType="listType")),A.singleSelectReply!=null&&A.hasOwnProperty("singleSelectReply")&&(s.singleSelectReply=d.proto.Message.ListResponseMessage.SingleSelectReply.toObject(A.singleSelectReply,r),r.oneofs&&(s._singleSelectReply="singleSelectReply")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.description!=null&&A.hasOwnProperty("description")&&(s.description=A.description,r.oneofs&&(s._description="description")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ListResponseMessage"},a.ListType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="SINGLE_SELECT"]=1,A})(),a.SingleSelectReply=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.selectedRowId=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ListResponseMessage.SingleSelectReply)return s;var g=new d.proto.Message.ListResponseMessage.SingleSelectReply;return s.selectedRowId!=null&&(g.selectedRowId=String(s.selectedRowId)),g},i.toObject=function(s,g){g||(g={});var c={};return s.selectedRowId!=null&&s.hasOwnProperty("selectedRowId")&&(c.selectedRowId=s.selectedRowId,g.oneofs&&(c._selectedRowId="selectedRowId")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ListResponseMessage.SingleSelectReply"},i})(),a})(),t.LiveLocationMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.accuracyInMeters=A.uint32();break}case 4:{c.speedInMps=A.float();break}case 5:{c.degreesClockwiseFromMagneticNorth=A.uint32();break}case 6:{c.caption=A.string();break}case 7:{c.sequenceNumber=A.int64();break}case 8:{c.timeOffset=A.uint32();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.LiveLocationMessage)return A;var r=new d.proto.Message.LiveLocationMessage;if(A.degreesLatitude!=null&&(r.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(r.degreesLongitude=Number(A.degreesLongitude)),A.accuracyInMeters!=null&&(r.accuracyInMeters=A.accuracyInMeters>>>0),A.speedInMps!=null&&(r.speedInMps=Number(A.speedInMps)),A.degreesClockwiseFromMagneticNorth!=null&&(r.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth>>>0),A.caption!=null&&(r.caption=String(A.caption)),A.sequenceNumber!=null&&(l.Long?(r.sequenceNumber=l.Long.fromValue(A.sequenceNumber)).unsigned=!1:typeof A.sequenceNumber=="string"?r.sequenceNumber=parseInt(A.sequenceNumber,10):typeof A.sequenceNumber=="number"?r.sequenceNumber=A.sequenceNumber:typeof A.sequenceNumber=="object"&&(r.sequenceNumber=new l.LongBits(A.sequenceNumber.low>>>0,A.sequenceNumber.high>>>0).toNumber())),A.timeOffset!=null&&(r.timeOffset=A.timeOffset>>>0),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.LiveLocationMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=r.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,r.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=r.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,r.oneofs&&(s._degreesLongitude="degreesLongitude")),A.accuracyInMeters!=null&&A.hasOwnProperty("accuracyInMeters")&&(s.accuracyInMeters=A.accuracyInMeters,r.oneofs&&(s._accuracyInMeters="accuracyInMeters")),A.speedInMps!=null&&A.hasOwnProperty("speedInMps")&&(s.speedInMps=r.json&&!isFinite(A.speedInMps)?String(A.speedInMps):A.speedInMps,r.oneofs&&(s._speedInMps="speedInMps")),A.degreesClockwiseFromMagneticNorth!=null&&A.hasOwnProperty("degreesClockwiseFromMagneticNorth")&&(s.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth,r.oneofs&&(s._degreesClockwiseFromMagneticNorth="degreesClockwiseFromMagneticNorth")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.sequenceNumber!=null&&A.hasOwnProperty("sequenceNumber")&&(typeof A.sequenceNumber=="number"?s.sequenceNumber=r.longs===String?String(A.sequenceNumber):A.sequenceNumber:s.sequenceNumber=r.longs===String?ge(A.sequenceNumber):r.longs===Number?ce(A.sequenceNumber):A.sequenceNumber,r.oneofs&&(s._sequenceNumber="sequenceNumber")),A.timeOffset!=null&&A.hasOwnProperty("timeOffset")&&(s.timeOffset=A.timeOffset,r.oneofs&&(s._timeOffset="timeOffset")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LiveLocationMessage"},a})(),t.LocationMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.name=A.string();break}case 4:{c.address=A.string();break}case 5:{c.url=A.string();break}case 6:{c.isLive=A.bool();break}case 7:{c.accuracyInMeters=A.uint32();break}case 8:{c.speedInMps=A.float();break}case 9:{c.degreesClockwiseFromMagneticNorth=A.uint32();break}case 11:{c.comment=A.string();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.LocationMessage)return A;var r=new d.proto.Message.LocationMessage;if(A.degreesLatitude!=null&&(r.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(r.degreesLongitude=Number(A.degreesLongitude)),A.name!=null&&(r.name=String(A.name)),A.address!=null&&(r.address=String(A.address)),A.url!=null&&(r.url=String(A.url)),A.isLive!=null&&(r.isLive=!!A.isLive),A.accuracyInMeters!=null&&(r.accuracyInMeters=A.accuracyInMeters>>>0),A.speedInMps!=null&&(r.speedInMps=Number(A.speedInMps)),A.degreesClockwiseFromMagneticNorth!=null&&(r.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth>>>0),A.comment!=null&&(r.comment=String(A.comment)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.LocationMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=r.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,r.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=r.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,r.oneofs&&(s._degreesLongitude="degreesLongitude")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.address!=null&&A.hasOwnProperty("address")&&(s.address=A.address,r.oneofs&&(s._address="address")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.isLive!=null&&A.hasOwnProperty("isLive")&&(s.isLive=A.isLive,r.oneofs&&(s._isLive="isLive")),A.accuracyInMeters!=null&&A.hasOwnProperty("accuracyInMeters")&&(s.accuracyInMeters=A.accuracyInMeters,r.oneofs&&(s._accuracyInMeters="accuracyInMeters")),A.speedInMps!=null&&A.hasOwnProperty("speedInMps")&&(s.speedInMps=r.json&&!isFinite(A.speedInMps)?String(A.speedInMps):A.speedInMps,r.oneofs&&(s._speedInMps="speedInMps")),A.degreesClockwiseFromMagneticNorth!=null&&A.hasOwnProperty("degreesClockwiseFromMagneticNorth")&&(s.degreesClockwiseFromMagneticNorth=A.degreesClockwiseFromMagneticNorth,r.oneofs&&(s._degreesClockwiseFromMagneticNorth="degreesClockwiseFromMagneticNorth")),A.comment!=null&&A.hasOwnProperty("comment")&&(s.comment=A.comment,r.oneofs&&(s._comment="comment")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.LocationMessage"},a})(),t.MMSThumbnailMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.thumbnailDirectPath=A.string();break}case 2:{c.thumbnailSha256=A.bytes();break}case 3:{c.thumbnailEncSha256=A.bytes();break}case 4:{c.mediaKey=A.bytes();break}case 5:{c.mediaKeyTimestamp=A.int64();break}case 6:{c.thumbnailHeight=A.uint32();break}case 7:{c.thumbnailWidth=A.uint32();break}case 8:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.MMSThumbnailMetadata)return A;var r=new d.proto.Message.MMSThumbnailMetadata;switch(A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.thumbnailDirectPath!=null&&A.hasOwnProperty("thumbnailDirectPath")&&(s.thumbnailDirectPath=A.thumbnailDirectPath,r.oneofs&&(s._thumbnailDirectPath="thumbnailDirectPath")),A.thumbnailSha256!=null&&A.hasOwnProperty("thumbnailSha256")&&(s.thumbnailSha256=r.bytes===String?l.base64.encode(A.thumbnailSha256,0,A.thumbnailSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailSha256):A.thumbnailSha256,r.oneofs&&(s._thumbnailSha256="thumbnailSha256")),A.thumbnailEncSha256!=null&&A.hasOwnProperty("thumbnailEncSha256")&&(s.thumbnailEncSha256=r.bytes===String?l.base64.encode(A.thumbnailEncSha256,0,A.thumbnailEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnailEncSha256):A.thumbnailEncSha256,r.oneofs&&(s._thumbnailEncSha256="thumbnailEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.thumbnailHeight!=null&&A.hasOwnProperty("thumbnailHeight")&&(s.thumbnailHeight=A.thumbnailHeight,r.oneofs&&(s._thumbnailHeight="thumbnailHeight")),A.thumbnailWidth!=null&&A.hasOwnProperty("thumbnailWidth")&&(s.thumbnailWidth=A.thumbnailWidth,r.oneofs&&(s._thumbnailWidth="thumbnailWidth")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MMSThumbnailMetadata"},a})(),t.MediaKeyDomain=(function(){let a={},e=Object.create(a);return e[a[0]="UNSET"]=0,e[a[1]="E2EE_CHAT"]=1,e[a[2]="STATUS"]=2,e[a[3]="CAPI"]=3,e[a[4]="BOT"]=4,e})(),t.MessageHistoryBundle=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.mimetype=A.string();break}case 2:{c.fileSha256=A.bytes();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}case 6:{c.mediaKeyTimestamp=A.int64();break}case 7:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 8:{c.messageHistoryMetadata=d.proto.Message.MessageHistoryMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.MessageHistoryBundle)return A;var r=new d.proto.Message.MessageHistoryBundle;if(A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.MessageHistoryBundle.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageHistoryMetadata!=null){if(typeof A.messageHistoryMetadata!="object")throw TypeError(".proto.Message.MessageHistoryBundle.messageHistoryMetadata: object expected");r.messageHistoryMetadata=d.proto.Message.MessageHistoryMetadata.fromObject(A.messageHistoryMetadata)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.messageHistoryMetadata!=null&&A.hasOwnProperty("messageHistoryMetadata")&&(s.messageHistoryMetadata=d.proto.Message.MessageHistoryMetadata.toObject(A.messageHistoryMetadata,r),r.oneofs&&(s._messageHistoryMetadata="messageHistoryMetadata")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MessageHistoryBundle"},a})(),t.MessageHistoryMetadata=(function(){function a(i){if(this.historyReceivers=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.historyReceivers&&c.historyReceivers.length||(c.historyReceivers=[]),c.historyReceivers.push(A.string());break}case 2:{c.oldestMessageTimestamp=A.int64();break}case 3:{c.messageCount=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.MessageHistoryMetadata)return A;var r=new d.proto.Message.MessageHistoryMetadata;if(A.historyReceivers){if(!Array.isArray(A.historyReceivers))throw TypeError(".proto.Message.MessageHistoryMetadata.historyReceivers: array expected");r.historyReceivers=[];for(var s=0;s>>0,A.oldestMessageTimestamp.high>>>0).toNumber())),A.messageCount!=null&&(l.Long?(r.messageCount=l.Long.fromValue(A.messageCount)).unsigned=!1:typeof A.messageCount=="string"?r.messageCount=parseInt(A.messageCount,10):typeof A.messageCount=="number"?r.messageCount=A.messageCount:typeof A.messageCount=="object"&&(r.messageCount=new l.LongBits(A.messageCount.low>>>0,A.messageCount.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.historyReceivers=[]),A.historyReceivers&&A.historyReceivers.length){s.historyReceivers=[];for(var g=0;g>>3){case 1:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 2:{c.messageHistoryMetadata=d.proto.Message.MessageHistoryMetadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.MessageHistoryNotice)return A;var r=new d.proto.Message.MessageHistoryNotice;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.MessageHistoryNotice.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageHistoryMetadata!=null){if(typeof A.messageHistoryMetadata!="object")throw TypeError(".proto.Message.MessageHistoryNotice.messageHistoryMetadata: object expected");r.messageHistoryMetadata=d.proto.Message.MessageHistoryMetadata.fromObject(A.messageHistoryMetadata)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.messageHistoryMetadata!=null&&A.hasOwnProperty("messageHistoryMetadata")&&(s.messageHistoryMetadata=d.proto.Message.MessageHistoryMetadata.toObject(A.messageHistoryMetadata,r),r.oneofs&&(s._messageHistoryMetadata="messageHistoryMetadata")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.MessageHistoryNotice"},a})(),t.NewsletterAdminInviteMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.newsletterName=A.string();break}case 3:{c.jpegThumbnail=A.bytes();break}case 4:{c.caption=A.string();break}case 5:{c.inviteExpiration=A.int64();break}case 6:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.NewsletterAdminInviteMessage)return A;var r=new d.proto.Message.NewsletterAdminInviteMessage;if(A.newsletterJid!=null&&(r.newsletterJid=String(A.newsletterJid)),A.newsletterName!=null&&(r.newsletterName=String(A.newsletterName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),A.inviteExpiration!=null&&(l.Long?(r.inviteExpiration=l.Long.fromValue(A.inviteExpiration)).unsigned=!1:typeof A.inviteExpiration=="string"?r.inviteExpiration=parseInt(A.inviteExpiration,10):typeof A.inviteExpiration=="number"?r.inviteExpiration=A.inviteExpiration:typeof A.inviteExpiration=="object"&&(r.inviteExpiration=new l.LongBits(A.inviteExpiration.low>>>0,A.inviteExpiration.high>>>0).toNumber())),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.NewsletterAdminInviteMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,r.oneofs&&(s._newsletterJid="newsletterJid")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,r.oneofs&&(s._newsletterName="newsletterName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.inviteExpiration!=null&&A.hasOwnProperty("inviteExpiration")&&(typeof A.inviteExpiration=="number"?s.inviteExpiration=r.longs===String?String(A.inviteExpiration):A.inviteExpiration:s.inviteExpiration=r.longs===String?ge(A.inviteExpiration):r.longs===Number?ce(A.inviteExpiration):A.inviteExpiration,r.oneofs&&(s._inviteExpiration="inviteExpiration")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.NewsletterAdminInviteMessage"},a})(),t.NewsletterFollowerInviteMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.newsletterJid=A.string();break}case 2:{c.newsletterName=A.string();break}case 3:{c.jpegThumbnail=A.bytes();break}case 4:{c.caption=A.string();break}case 5:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.NewsletterFollowerInviteMessage)return A;var r=new d.proto.Message.NewsletterFollowerInviteMessage;if(A.newsletterJid!=null&&(r.newsletterJid=String(A.newsletterJid)),A.newsletterName!=null&&(r.newsletterName=String(A.newsletterName)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.caption!=null&&(r.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.NewsletterFollowerInviteMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.newsletterJid!=null&&A.hasOwnProperty("newsletterJid")&&(s.newsletterJid=A.newsletterJid,r.oneofs&&(s._newsletterJid="newsletterJid")),A.newsletterName!=null&&A.hasOwnProperty("newsletterName")&&(s.newsletterName=A.newsletterName,r.oneofs&&(s._newsletterName="newsletterName")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.NewsletterFollowerInviteMessage"},a})(),t.OrderMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.orderId=A.string();break}case 2:{c.thumbnail=A.bytes();break}case 3:{c.itemCount=A.int32();break}case 4:{c.status=A.int32();break}case 5:{c.surface=A.int32();break}case 6:{c.message=A.string();break}case 7:{c.orderTitle=A.string();break}case 8:{c.sellerJid=A.string();break}case 9:{c.token=A.string();break}case 10:{c.totalAmount1000=A.int64();break}case 11:{c.totalCurrencyCode=A.string();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 12:{c.messageVersion=A.int32();break}case 13:{c.orderRequestMessageId=d.proto.MessageKey.decode(A,A.uint32());break}case 15:{c.catalogType=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.OrderMessage)return A;var r=new d.proto.Message.OrderMessage;switch(A.orderId!=null&&(r.orderId=String(A.orderId)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,r.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(r.thumbnail=A.thumbnail)),A.itemCount!=null&&(r.itemCount=A.itemCount|0),A.status){default:if(typeof A.status=="number"){r.status=A.status;break}break;case"INQUIRY":case 1:r.status=1;break;case"ACCEPTED":case 2:r.status=2;break;case"DECLINED":case 3:r.status=3;break}switch(A.surface){default:if(typeof A.surface=="number"){r.surface=A.surface;break}break;case"CATALOG":case 1:r.surface=1;break}if(A.message!=null&&(r.message=String(A.message)),A.orderTitle!=null&&(r.orderTitle=String(A.orderTitle)),A.sellerJid!=null&&(r.sellerJid=String(A.sellerJid)),A.token!=null&&(r.token=String(A.token)),A.totalAmount1000!=null&&(l.Long?(r.totalAmount1000=l.Long.fromValue(A.totalAmount1000)).unsigned=!1:typeof A.totalAmount1000=="string"?r.totalAmount1000=parseInt(A.totalAmount1000,10):typeof A.totalAmount1000=="number"?r.totalAmount1000=A.totalAmount1000:typeof A.totalAmount1000=="object"&&(r.totalAmount1000=new l.LongBits(A.totalAmount1000.low>>>0,A.totalAmount1000.high>>>0).toNumber())),A.totalCurrencyCode!=null&&(r.totalCurrencyCode=String(A.totalCurrencyCode)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.OrderMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.messageVersion!=null&&(r.messageVersion=A.messageVersion|0),A.orderRequestMessageId!=null){if(typeof A.orderRequestMessageId!="object")throw TypeError(".proto.Message.OrderMessage.orderRequestMessageId: object expected");r.orderRequestMessageId=d.proto.MessageKey.fromObject(A.orderRequestMessageId)}return A.catalogType!=null&&(r.catalogType=String(A.catalogType)),r},a.toObject=function(A,r){r||(r={});var s={};return A.orderId!=null&&A.hasOwnProperty("orderId")&&(s.orderId=A.orderId,r.oneofs&&(s._orderId="orderId")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=r.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,r.oneofs&&(s._thumbnail="thumbnail")),A.itemCount!=null&&A.hasOwnProperty("itemCount")&&(s.itemCount=A.itemCount,r.oneofs&&(s._itemCount="itemCount")),A.status!=null&&A.hasOwnProperty("status")&&(s.status=r.enums===String?d.proto.Message.OrderMessage.OrderStatus[A.status]===void 0?A.status:d.proto.Message.OrderMessage.OrderStatus[A.status]:A.status,r.oneofs&&(s._status="status")),A.surface!=null&&A.hasOwnProperty("surface")&&(s.surface=r.enums===String?d.proto.Message.OrderMessage.OrderSurface[A.surface]===void 0?A.surface:d.proto.Message.OrderMessage.OrderSurface[A.surface]:A.surface,r.oneofs&&(s._surface="surface")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=A.message,r.oneofs&&(s._message="message")),A.orderTitle!=null&&A.hasOwnProperty("orderTitle")&&(s.orderTitle=A.orderTitle,r.oneofs&&(s._orderTitle="orderTitle")),A.sellerJid!=null&&A.hasOwnProperty("sellerJid")&&(s.sellerJid=A.sellerJid,r.oneofs&&(s._sellerJid="sellerJid")),A.token!=null&&A.hasOwnProperty("token")&&(s.token=A.token,r.oneofs&&(s._token="token")),A.totalAmount1000!=null&&A.hasOwnProperty("totalAmount1000")&&(typeof A.totalAmount1000=="number"?s.totalAmount1000=r.longs===String?String(A.totalAmount1000):A.totalAmount1000:s.totalAmount1000=r.longs===String?ge(A.totalAmount1000):r.longs===Number?ce(A.totalAmount1000):A.totalAmount1000,r.oneofs&&(s._totalAmount1000="totalAmount1000")),A.totalCurrencyCode!=null&&A.hasOwnProperty("totalCurrencyCode")&&(s.totalCurrencyCode=A.totalCurrencyCode,r.oneofs&&(s._totalCurrencyCode="totalCurrencyCode")),A.messageVersion!=null&&A.hasOwnProperty("messageVersion")&&(s.messageVersion=A.messageVersion,r.oneofs&&(s._messageVersion="messageVersion")),A.orderRequestMessageId!=null&&A.hasOwnProperty("orderRequestMessageId")&&(s.orderRequestMessageId=d.proto.MessageKey.toObject(A.orderRequestMessageId,r),r.oneofs&&(s._orderRequestMessageId="orderRequestMessageId")),A.catalogType!=null&&A.hasOwnProperty("catalogType")&&(s.catalogType=A.catalogType,r.oneofs&&(s._catalogType="catalogType")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.OrderMessage"},a.OrderStatus=(function(){let i={},A=Object.create(i);return A[i[1]="INQUIRY"]=1,A[i[2]="ACCEPTED"]=2,A[i[3]="DECLINED"]=3,A})(),a.OrderSurface=(function(){let i={},A=Object.create(i);return A[i[1]="CATALOG"]=1,A})(),a})(),t.PaymentExtendedMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.type=A.uint32();break}case 2:{c.platform=A.string();break}case 3:{c.messageParamsJson=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PaymentExtendedMetadata)return A;var r=new d.proto.Message.PaymentExtendedMetadata;return A.type!=null&&(r.type=A.type>>>0),A.platform!=null&&(r.platform=String(A.platform)),A.messageParamsJson!=null&&(r.messageParamsJson=String(A.messageParamsJson)),r},a.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=A.type,r.oneofs&&(s._type="type")),A.platform!=null&&A.hasOwnProperty("platform")&&(s.platform=A.platform,r.oneofs&&(s._platform="platform")),A.messageParamsJson!=null&&A.hasOwnProperty("messageParamsJson")&&(s.messageParamsJson=A.messageParamsJson,r.oneofs&&(s._messageParamsJson="messageParamsJson")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentExtendedMetadata"},a})(),t.PaymentInviteMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.serviceType=A.int32();break}case 2:{c.expiryTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PaymentInviteMessage)return A;var r=new d.proto.Message.PaymentInviteMessage;switch(A.serviceType){default:if(typeof A.serviceType=="number"){r.serviceType=A.serviceType;break}break;case"UNKNOWN":case 0:r.serviceType=0;break;case"FBPAY":case 1:r.serviceType=1;break;case"NOVI":case 2:r.serviceType=2;break;case"UPI":case 3:r.serviceType=3;break}return A.expiryTimestamp!=null&&(l.Long?(r.expiryTimestamp=l.Long.fromValue(A.expiryTimestamp)).unsigned=!1:typeof A.expiryTimestamp=="string"?r.expiryTimestamp=parseInt(A.expiryTimestamp,10):typeof A.expiryTimestamp=="number"?r.expiryTimestamp=A.expiryTimestamp:typeof A.expiryTimestamp=="object"&&(r.expiryTimestamp=new l.LongBits(A.expiryTimestamp.low>>>0,A.expiryTimestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.serviceType!=null&&A.hasOwnProperty("serviceType")&&(s.serviceType=r.enums===String?d.proto.Message.PaymentInviteMessage.ServiceType[A.serviceType]===void 0?A.serviceType:d.proto.Message.PaymentInviteMessage.ServiceType[A.serviceType]:A.serviceType,r.oneofs&&(s._serviceType="serviceType")),A.expiryTimestamp!=null&&A.hasOwnProperty("expiryTimestamp")&&(typeof A.expiryTimestamp=="number"?s.expiryTimestamp=r.longs===String?String(A.expiryTimestamp):A.expiryTimestamp:s.expiryTimestamp=r.longs===String?ge(A.expiryTimestamp):r.longs===Number?ce(A.expiryTimestamp):A.expiryTimestamp,r.oneofs&&(s._expiryTimestamp="expiryTimestamp")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentInviteMessage"},a.ServiceType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="FBPAY"]=1,A[i[2]="NOVI"]=2,A[i[3]="UPI"]=3,A})(),a})(),t.PaymentLinkMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.button=d.proto.Message.PaymentLinkMetadata.PaymentLinkButton.decode(A,A.uint32());break}case 2:{c.header=d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.decode(A,A.uint32());break}case 3:{c.provider=d.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PaymentLinkMetadata)return A;var r=new d.proto.Message.PaymentLinkMetadata;if(A.button!=null){if(typeof A.button!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.button: object expected");r.button=d.proto.Message.PaymentLinkMetadata.PaymentLinkButton.fromObject(A.button)}if(A.header!=null){if(typeof A.header!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.header: object expected");r.header=d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.fromObject(A.header)}if(A.provider!=null){if(typeof A.provider!="object")throw TypeError(".proto.Message.PaymentLinkMetadata.provider: object expected");r.provider=d.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.fromObject(A.provider)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.button!=null&&A.hasOwnProperty("button")&&(s.button=d.proto.Message.PaymentLinkMetadata.PaymentLinkButton.toObject(A.button,r),r.oneofs&&(s._button="button")),A.header!=null&&A.hasOwnProperty("header")&&(s.header=d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.toObject(A.header,r),r.oneofs&&(s._header="header")),A.provider!=null&&A.hasOwnProperty("provider")&&(s.provider=d.proto.Message.PaymentLinkMetadata.PaymentLinkProvider.toObject(A.provider,r),r.oneofs&&(s._provider="provider")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PaymentLinkMetadata"},a.PaymentLinkButton=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.displayText=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PaymentLinkMetadata.PaymentLinkButton)return s;var g=new d.proto.Message.PaymentLinkMetadata.PaymentLinkButton;return s.displayText!=null&&(g.displayText=String(s.displayText)),g},i.toObject=function(s,g){g||(g={});var c={};return s.displayText!=null&&s.hasOwnProperty("displayText")&&(c.displayText=s.displayText,g.oneofs&&(c._displayText="displayText")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkButton"},i})(),a.PaymentLinkHeader=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.headerType=s.int32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader)return s;var g=new d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader;switch(s.headerType){default:if(typeof s.headerType=="number"){g.headerType=s.headerType;break}break;case"LINK_PREVIEW":case 0:g.headerType=0;break;case"ORDER":case 1:g.headerType=1;break}return g},i.toObject=function(s,g){g||(g={});var c={};return s.headerType!=null&&s.hasOwnProperty("headerType")&&(c.headerType=g.enums===String?d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[s.headerType]===void 0?s.headerType:d.proto.Message.PaymentLinkMetadata.PaymentLinkHeader.PaymentLinkHeaderType[s.headerType]:s.headerType,g.oneofs&&(c._headerType="headerType")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkHeader"},i.PaymentLinkHeaderType=(function(){let r={},s=Object.create(r);return s[r[0]="LINK_PREVIEW"]=0,s[r[1]="ORDER"]=1,s})(),i})(),a.PaymentLinkProvider=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.paramsJson=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PaymentLinkMetadata.PaymentLinkProvider)return s;var g=new d.proto.Message.PaymentLinkMetadata.PaymentLinkProvider;return s.paramsJson!=null&&(g.paramsJson=String(s.paramsJson)),g},i.toObject=function(s,g){g||(g={});var c={};return s.paramsJson!=null&&s.hasOwnProperty("paramsJson")&&(c.paramsJson=s.paramsJson,g.oneofs&&(c._paramsJson="paramsJson")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PaymentLinkMetadata.PaymentLinkProvider"},i})(),a})(),t.PeerDataOperationRequestMessage=(function(){function a(i){if(this.requestStickerReupload=[],this.requestUrlPreview=[],this.placeholderMessageResendRequest=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.peerDataOperationRequestType=A.int32();break}case 2:{c.requestStickerReupload&&c.requestStickerReupload.length||(c.requestStickerReupload=[]),c.requestStickerReupload.push(d.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload.decode(A,A.uint32()));break}case 3:{c.requestUrlPreview&&c.requestUrlPreview.length||(c.requestUrlPreview=[]),c.requestUrlPreview.push(d.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview.decode(A,A.uint32()));break}case 4:{c.historySyncOnDemandRequest=d.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest.decode(A,A.uint32());break}case 5:{c.placeholderMessageResendRequest&&c.placeholderMessageResendRequest.length||(c.placeholderMessageResendRequest=[]),c.placeholderMessageResendRequest.push(d.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.decode(A,A.uint32()));break}case 6:{c.fullHistorySyncOnDemandRequest=d.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.decode(A,A.uint32());break}case 7:{c.syncdCollectionFatalRecoveryRequest=d.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest.decode(A,A.uint32());break}case 8:{c.historySyncChunkRetryRequest=d.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest.decode(A,A.uint32());break}case 9:{c.galaxyFlowAction=d.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PeerDataOperationRequestMessage)return A;var r=new d.proto.Message.PeerDataOperationRequestMessage;switch(A.peerDataOperationRequestType){default:if(typeof A.peerDataOperationRequestType=="number"){r.peerDataOperationRequestType=A.peerDataOperationRequestType;break}break;case"UPLOAD_STICKER":case 0:r.peerDataOperationRequestType=0;break;case"SEND_RECENT_STICKER_BOOTSTRAP":case 1:r.peerDataOperationRequestType=1;break;case"GENERATE_LINK_PREVIEW":case 2:r.peerDataOperationRequestType=2;break;case"HISTORY_SYNC_ON_DEMAND":case 3:r.peerDataOperationRequestType=3;break;case"PLACEHOLDER_MESSAGE_RESEND":case 4:r.peerDataOperationRequestType=4;break;case"WAFFLE_LINKING_NONCE_FETCH":case 5:r.peerDataOperationRequestType=5;break;case"FULL_HISTORY_SYNC_ON_DEMAND":case 6:r.peerDataOperationRequestType=6;break;case"COMPANION_META_NONCE_FETCH":case 7:r.peerDataOperationRequestType=7;break;case"COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY":case 8:r.peerDataOperationRequestType=8;break;case"COMPANION_CANONICAL_USER_NONCE_FETCH":case 9:r.peerDataOperationRequestType=9;break;case"HISTORY_SYNC_CHUNK_RETRY":case 10:r.peerDataOperationRequestType=10;break;case"GALAXY_FLOW_ACTION":case 11:r.peerDataOperationRequestType=11;break}if(A.requestStickerReupload){if(!Array.isArray(A.requestStickerReupload))throw TypeError(".proto.Message.PeerDataOperationRequestMessage.requestStickerReupload: array expected");r.requestStickerReupload=[];for(var s=0;s>>3){case 1:{p.requestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(s,s.uint32());break}case 2:{p.historySyncConfig=d.proto.DeviceProps.HistorySyncConfig.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest;if(s.requestMetadata!=null){if(typeof s.requestMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.requestMetadata: object expected");g.requestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(s.requestMetadata)}if(s.historySyncConfig!=null){if(typeof s.historySyncConfig!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest.historySyncConfig: object expected");g.historySyncConfig=d.proto.DeviceProps.HistorySyncConfig.fromObject(s.historySyncConfig)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.requestMetadata!=null&&s.hasOwnProperty("requestMetadata")&&(c.requestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(s.requestMetadata,g),g.oneofs&&(c._requestMetadata="requestMetadata")),s.historySyncConfig!=null&&s.hasOwnProperty("historySyncConfig")&&(c.historySyncConfig=d.proto.DeviceProps.HistorySyncConfig.toObject(s.historySyncConfig,g),g.oneofs&&(c._historySyncConfig="historySyncConfig")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.FullHistorySyncOnDemandRequest"},i})(),a.GalaxyFlowAction=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.type=s.int32();break}case 2:{p.flowId=s.string();break}case 3:{p.stanzaId=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction;switch(s.type){default:if(typeof s.type=="number"){g.type=s.type;break}break;case"NOTIFY_LAUNCH":case 1:g.type=1;break}return s.flowId!=null&&(g.flowId=String(s.flowId)),s.stanzaId!=null&&(g.stanzaId=String(s.stanzaId)),g},i.toObject=function(s,g){g||(g={});var c={};return s.type!=null&&s.hasOwnProperty("type")&&(c.type=g.enums===String?d.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.GalaxyFlowActionType[s.type]===void 0?s.type:d.proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction.GalaxyFlowActionType[s.type]:s.type,g.oneofs&&(c._type="type")),s.flowId!=null&&s.hasOwnProperty("flowId")&&(c.flowId=s.flowId,g.oneofs&&(c._flowId="flowId")),s.stanzaId!=null&&s.hasOwnProperty("stanzaId")&&(c.stanzaId=s.stanzaId,g.oneofs&&(c._stanzaId="stanzaId")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.GalaxyFlowAction"},i.GalaxyFlowActionType=(function(){let r={},s=Object.create(r);return s[r[1]="NOTIFY_LAUNCH"]=1,s})(),i})(),a.HistorySyncChunkRetryRequest=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.syncType=s.int32();break}case 2:{p.chunkOrder=s.uint32();break}case 3:{p.chunkNotificationId=s.string();break}case 4:{p.regenerateChunk=s.bool();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest;switch(s.syncType){default:if(typeof s.syncType=="number"){g.syncType=s.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:g.syncType=0;break;case"INITIAL_STATUS_V3":case 1:g.syncType=1;break;case"FULL":case 2:g.syncType=2;break;case"RECENT":case 3:g.syncType=3;break;case"PUSH_NAME":case 4:g.syncType=4;break;case"NON_BLOCKING_DATA":case 5:g.syncType=5;break;case"ON_DEMAND":case 6:g.syncType=6;break;case"NO_HISTORY":case 7:g.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:g.syncType=8;break}return s.chunkOrder!=null&&(g.chunkOrder=s.chunkOrder>>>0),s.chunkNotificationId!=null&&(g.chunkNotificationId=String(s.chunkNotificationId)),s.regenerateChunk!=null&&(g.regenerateChunk=!!s.regenerateChunk),g},i.toObject=function(s,g){g||(g={});var c={};return s.syncType!=null&&s.hasOwnProperty("syncType")&&(c.syncType=g.enums===String?d.proto.Message.HistorySyncType[s.syncType]===void 0?s.syncType:d.proto.Message.HistorySyncType[s.syncType]:s.syncType,g.oneofs&&(c._syncType="syncType")),s.chunkOrder!=null&&s.hasOwnProperty("chunkOrder")&&(c.chunkOrder=s.chunkOrder,g.oneofs&&(c._chunkOrder="chunkOrder")),s.chunkNotificationId!=null&&s.hasOwnProperty("chunkNotificationId")&&(c.chunkNotificationId=s.chunkNotificationId,g.oneofs&&(c._chunkNotificationId="chunkNotificationId")),s.regenerateChunk!=null&&s.hasOwnProperty("regenerateChunk")&&(c.regenerateChunk=s.regenerateChunk,g.oneofs&&(c._regenerateChunk="regenerateChunk")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.HistorySyncChunkRetryRequest"},i})(),a.HistorySyncOnDemandRequest=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.chatJid=s.string();break}case 2:{p.oldestMsgId=s.string();break}case 3:{p.oldestMsgFromMe=s.bool();break}case 4:{p.onDemandMsgCount=s.int32();break}case 5:{p.oldestMsgTimestampMs=s.int64();break}case 6:{p.accountLid=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest;return s.chatJid!=null&&(g.chatJid=String(s.chatJid)),s.oldestMsgId!=null&&(g.oldestMsgId=String(s.oldestMsgId)),s.oldestMsgFromMe!=null&&(g.oldestMsgFromMe=!!s.oldestMsgFromMe),s.onDemandMsgCount!=null&&(g.onDemandMsgCount=s.onDemandMsgCount|0),s.oldestMsgTimestampMs!=null&&(l.Long?(g.oldestMsgTimestampMs=l.Long.fromValue(s.oldestMsgTimestampMs)).unsigned=!1:typeof s.oldestMsgTimestampMs=="string"?g.oldestMsgTimestampMs=parseInt(s.oldestMsgTimestampMs,10):typeof s.oldestMsgTimestampMs=="number"?g.oldestMsgTimestampMs=s.oldestMsgTimestampMs:typeof s.oldestMsgTimestampMs=="object"&&(g.oldestMsgTimestampMs=new l.LongBits(s.oldestMsgTimestampMs.low>>>0,s.oldestMsgTimestampMs.high>>>0).toNumber())),s.accountLid!=null&&(g.accountLid=String(s.accountLid)),g},i.toObject=function(s,g){g||(g={});var c={};return s.chatJid!=null&&s.hasOwnProperty("chatJid")&&(c.chatJid=s.chatJid,g.oneofs&&(c._chatJid="chatJid")),s.oldestMsgId!=null&&s.hasOwnProperty("oldestMsgId")&&(c.oldestMsgId=s.oldestMsgId,g.oneofs&&(c._oldestMsgId="oldestMsgId")),s.oldestMsgFromMe!=null&&s.hasOwnProperty("oldestMsgFromMe")&&(c.oldestMsgFromMe=s.oldestMsgFromMe,g.oneofs&&(c._oldestMsgFromMe="oldestMsgFromMe")),s.onDemandMsgCount!=null&&s.hasOwnProperty("onDemandMsgCount")&&(c.onDemandMsgCount=s.onDemandMsgCount,g.oneofs&&(c._onDemandMsgCount="onDemandMsgCount")),s.oldestMsgTimestampMs!=null&&s.hasOwnProperty("oldestMsgTimestampMs")&&(typeof s.oldestMsgTimestampMs=="number"?c.oldestMsgTimestampMs=g.longs===String?String(s.oldestMsgTimestampMs):s.oldestMsgTimestampMs:c.oldestMsgTimestampMs=g.longs===String?ge(s.oldestMsgTimestampMs):g.longs===Number?ce(s.oldestMsgTimestampMs):s.oldestMsgTimestampMs,g.oneofs&&(c._oldestMsgTimestampMs="oldestMsgTimestampMs")),s.accountLid!=null&&s.hasOwnProperty("accountLid")&&(c.accountLid=s.accountLid,g.oneofs&&(c._accountLid="accountLid")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest"},i})(),a.PlaceholderMessageResendRequest=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.messageKey=d.proto.MessageKey.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest;if(s.messageKey!=null){if(typeof s.messageKey!="object")throw TypeError(".proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.messageKey: object expected");g.messageKey=d.proto.MessageKey.fromObject(s.messageKey)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.messageKey!=null&&s.hasOwnProperty("messageKey")&&(c.messageKey=d.proto.MessageKey.toObject(s.messageKey,g),g.oneofs&&(c._messageKey="messageKey")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest"},i})(),a.RequestStickerReupload=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.fileSha256=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload;return s.fileSha256!=null&&(g.fileSha256=String(s.fileSha256)),g},i.toObject=function(s,g){g||(g={});var c={};return s.fileSha256!=null&&s.hasOwnProperty("fileSha256")&&(c.fileSha256=s.fileSha256,g.oneofs&&(c._fileSha256="fileSha256")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.RequestStickerReupload"},i})(),a.RequestUrlPreview=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.url=s.string();break}case 2:{p.includeHqThumbnail=s.bool();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview;return s.url!=null&&(g.url=String(s.url)),s.includeHqThumbnail!=null&&(g.includeHqThumbnail=!!s.includeHqThumbnail),g},i.toObject=function(s,g){g||(g={});var c={};return s.url!=null&&s.hasOwnProperty("url")&&(c.url=s.url,g.oneofs&&(c._url="url")),s.includeHqThumbnail!=null&&s.hasOwnProperty("includeHqThumbnail")&&(c.includeHqThumbnail=s.includeHqThumbnail,g.oneofs&&(c._includeHqThumbnail="includeHqThumbnail")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.RequestUrlPreview"},i})(),a.SyncDCollectionFatalRecoveryRequest=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.collectionName=s.string();break}case 2:{p.timestamp=s.int64();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest)return s;var g=new d.proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest;return s.collectionName!=null&&(g.collectionName=String(s.collectionName)),s.timestamp!=null&&(l.Long?(g.timestamp=l.Long.fromValue(s.timestamp)).unsigned=!1:typeof s.timestamp=="string"?g.timestamp=parseInt(s.timestamp,10):typeof s.timestamp=="number"?g.timestamp=s.timestamp:typeof s.timestamp=="object"&&(g.timestamp=new l.LongBits(s.timestamp.low>>>0,s.timestamp.high>>>0).toNumber())),g},i.toObject=function(s,g){g||(g={});var c={};return s.collectionName!=null&&s.hasOwnProperty("collectionName")&&(c.collectionName=s.collectionName,g.oneofs&&(c._collectionName="collectionName")),s.timestamp!=null&&s.hasOwnProperty("timestamp")&&(typeof s.timestamp=="number"?c.timestamp=g.longs===String?String(s.timestamp):s.timestamp:c.timestamp=g.longs===String?ge(s.timestamp):g.longs===Number?ce(s.timestamp):s.timestamp,g.oneofs&&(c._timestamp="timestamp")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestMessage.SyncDCollectionFatalRecoveryRequest"},i})(),a})(),t.PeerDataOperationRequestResponseMessage=(function(){function a(i){if(this.peerDataOperationResult=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.peerDataOperationRequestType=A.int32();break}case 2:{c.stanzaId=A.string();break}case 3:{c.peerDataOperationResult&&c.peerDataOperationResult.length||(c.peerDataOperationResult=[]),c.peerDataOperationResult.push(d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PeerDataOperationRequestResponseMessage)return A;var r=new d.proto.Message.PeerDataOperationRequestResponseMessage;switch(A.peerDataOperationRequestType){default:if(typeof A.peerDataOperationRequestType=="number"){r.peerDataOperationRequestType=A.peerDataOperationRequestType;break}break;case"UPLOAD_STICKER":case 0:r.peerDataOperationRequestType=0;break;case"SEND_RECENT_STICKER_BOOTSTRAP":case 1:r.peerDataOperationRequestType=1;break;case"GENERATE_LINK_PREVIEW":case 2:r.peerDataOperationRequestType=2;break;case"HISTORY_SYNC_ON_DEMAND":case 3:r.peerDataOperationRequestType=3;break;case"PLACEHOLDER_MESSAGE_RESEND":case 4:r.peerDataOperationRequestType=4;break;case"WAFFLE_LINKING_NONCE_FETCH":case 5:r.peerDataOperationRequestType=5;break;case"FULL_HISTORY_SYNC_ON_DEMAND":case 6:r.peerDataOperationRequestType=6;break;case"COMPANION_META_NONCE_FETCH":case 7:r.peerDataOperationRequestType=7;break;case"COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY":case 8:r.peerDataOperationRequestType=8;break;case"COMPANION_CANONICAL_USER_NONCE_FETCH":case 9:r.peerDataOperationRequestType=9;break;case"HISTORY_SYNC_CHUNK_RETRY":case 10:r.peerDataOperationRequestType=10;break;case"GALAXY_FLOW_ACTION":case 11:r.peerDataOperationRequestType=11;break}if(A.stanzaId!=null&&(r.stanzaId=String(A.stanzaId)),A.peerDataOperationResult){if(!Array.isArray(A.peerDataOperationResult))throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.peerDataOperationResult: array expected");r.peerDataOperationResult=[];for(var s=0;s>>3){case 1:{p.mediaUploadResult=s.int32();break}case 2:{p.stickerMessage=d.proto.Message.StickerMessage.decode(s,s.uint32());break}case 3:{p.linkPreviewResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.decode(s,s.uint32());break}case 4:{p.placeholderMessageResendResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.decode(s,s.uint32());break}case 5:{p.waffleNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.decode(s,s.uint32());break}case 6:{p.fullHistorySyncOnDemandRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.decode(s,s.uint32());break}case 7:{p.companionMetaNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.decode(s,s.uint32());break}case 8:{p.syncdSnapshotFatalRecoveryResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.decode(s,s.uint32());break}case 9:{p.companionCanonicalUserNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.decode(s,s.uint32());break}case 10:{p.historySyncChunkRetryResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult)return s;var g=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult;switch(s.mediaUploadResult){default:if(typeof s.mediaUploadResult=="number"){g.mediaUploadResult=s.mediaUploadResult;break}break;case"GENERAL_ERROR":case 0:g.mediaUploadResult=0;break;case"SUCCESS":case 1:g.mediaUploadResult=1;break;case"NOT_FOUND":case 2:g.mediaUploadResult=2;break;case"DECRYPTION_ERROR":case 3:g.mediaUploadResult=3;break}if(s.stickerMessage!=null){if(typeof s.stickerMessage!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.stickerMessage: object expected");g.stickerMessage=d.proto.Message.StickerMessage.fromObject(s.stickerMessage)}if(s.linkPreviewResponse!=null){if(typeof s.linkPreviewResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.linkPreviewResponse: object expected");g.linkPreviewResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.fromObject(s.linkPreviewResponse)}if(s.placeholderMessageResendResponse!=null){if(typeof s.placeholderMessageResendResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.placeholderMessageResendResponse: object expected");g.placeholderMessageResendResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.fromObject(s.placeholderMessageResendResponse)}if(s.waffleNonceFetchRequestResponse!=null){if(typeof s.waffleNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.waffleNonceFetchRequestResponse: object expected");g.waffleNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.fromObject(s.waffleNonceFetchRequestResponse)}if(s.fullHistorySyncOnDemandRequestResponse!=null){if(typeof s.fullHistorySyncOnDemandRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.fullHistorySyncOnDemandRequestResponse: object expected");g.fullHistorySyncOnDemandRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.fromObject(s.fullHistorySyncOnDemandRequestResponse)}if(s.companionMetaNonceFetchRequestResponse!=null){if(typeof s.companionMetaNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.companionMetaNonceFetchRequestResponse: object expected");g.companionMetaNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.fromObject(s.companionMetaNonceFetchRequestResponse)}if(s.syncdSnapshotFatalRecoveryResponse!=null){if(typeof s.syncdSnapshotFatalRecoveryResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.syncdSnapshotFatalRecoveryResponse: object expected");g.syncdSnapshotFatalRecoveryResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.fromObject(s.syncdSnapshotFatalRecoveryResponse)}if(s.companionCanonicalUserNonceFetchRequestResponse!=null){if(typeof s.companionCanonicalUserNonceFetchRequestResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.companionCanonicalUserNonceFetchRequestResponse: object expected");g.companionCanonicalUserNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.fromObject(s.companionCanonicalUserNonceFetchRequestResponse)}if(s.historySyncChunkRetryResponse!=null){if(typeof s.historySyncChunkRetryResponse!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.historySyncChunkRetryResponse: object expected");g.historySyncChunkRetryResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.fromObject(s.historySyncChunkRetryResponse)}return g},i.toObject=function(s,g){g||(g={});var c={};return s.mediaUploadResult!=null&&s.hasOwnProperty("mediaUploadResult")&&(c.mediaUploadResult=g.enums===String?d.proto.MediaRetryNotification.ResultType[s.mediaUploadResult]===void 0?s.mediaUploadResult:d.proto.MediaRetryNotification.ResultType[s.mediaUploadResult]:s.mediaUploadResult,g.oneofs&&(c._mediaUploadResult="mediaUploadResult")),s.stickerMessage!=null&&s.hasOwnProperty("stickerMessage")&&(c.stickerMessage=d.proto.Message.StickerMessage.toObject(s.stickerMessage,g),g.oneofs&&(c._stickerMessage="stickerMessage")),s.linkPreviewResponse!=null&&s.hasOwnProperty("linkPreviewResponse")&&(c.linkPreviewResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.toObject(s.linkPreviewResponse,g),g.oneofs&&(c._linkPreviewResponse="linkPreviewResponse")),s.placeholderMessageResendResponse!=null&&s.hasOwnProperty("placeholderMessageResendResponse")&&(c.placeholderMessageResendResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse.toObject(s.placeholderMessageResendResponse,g),g.oneofs&&(c._placeholderMessageResendResponse="placeholderMessageResendResponse")),s.waffleNonceFetchRequestResponse!=null&&s.hasOwnProperty("waffleNonceFetchRequestResponse")&&(c.waffleNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse.toObject(s.waffleNonceFetchRequestResponse,g),g.oneofs&&(c._waffleNonceFetchRequestResponse="waffleNonceFetchRequestResponse")),s.fullHistorySyncOnDemandRequestResponse!=null&&s.hasOwnProperty("fullHistorySyncOnDemandRequestResponse")&&(c.fullHistorySyncOnDemandRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.toObject(s.fullHistorySyncOnDemandRequestResponse,g),g.oneofs&&(c._fullHistorySyncOnDemandRequestResponse="fullHistorySyncOnDemandRequestResponse")),s.companionMetaNonceFetchRequestResponse!=null&&s.hasOwnProperty("companionMetaNonceFetchRequestResponse")&&(c.companionMetaNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse.toObject(s.companionMetaNonceFetchRequestResponse,g),g.oneofs&&(c._companionMetaNonceFetchRequestResponse="companionMetaNonceFetchRequestResponse")),s.syncdSnapshotFatalRecoveryResponse!=null&&s.hasOwnProperty("syncdSnapshotFatalRecoveryResponse")&&(c.syncdSnapshotFatalRecoveryResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse.toObject(s.syncdSnapshotFatalRecoveryResponse,g),g.oneofs&&(c._syncdSnapshotFatalRecoveryResponse="syncdSnapshotFatalRecoveryResponse")),s.companionCanonicalUserNonceFetchRequestResponse!=null&&s.hasOwnProperty("companionCanonicalUserNonceFetchRequestResponse")&&(c.companionCanonicalUserNonceFetchRequestResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse.toObject(s.companionCanonicalUserNonceFetchRequestResponse,g),g.oneofs&&(c._companionCanonicalUserNonceFetchRequestResponse="companionCanonicalUserNonceFetchRequestResponse")),s.historySyncChunkRetryResponse!=null&&s.hasOwnProperty("historySyncChunkRetryResponse")&&(c.historySyncChunkRetryResponse=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse.toObject(s.historySyncChunkRetryResponse,g),g.oneofs&&(c._historySyncChunkRetryResponse="historySyncChunkRetryResponse")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult"},i.CompanionCanonicalUserNonceFetchResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}case 2:{f.waFbid=c.string();break}case 3:{f.forceRefresh=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),c.waFbid!=null&&(I.waFbid=String(c.waFbid)),c.forceRefresh!=null&&(I.forceRefresh=!!c.forceRefresh),I},r.toObject=function(c,I){I||(I={});var p={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(p.nonce=c.nonce,I.oneofs&&(p._nonce="nonce")),c.waFbid!=null&&c.hasOwnProperty("waFbid")&&(p.waFbid=c.waFbid,I.oneofs&&(p._waFbid="waFbid")),c.forceRefresh!=null&&c.hasOwnProperty("forceRefresh")&&(p.forceRefresh=c.forceRefresh,I.oneofs&&(p._forceRefresh="forceRefresh")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionCanonicalUserNonceFetchResponse"},r})(),i.CompanionMetaNonceFetchResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),I},r.toObject=function(c,I){I||(I={});var p={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(p.nonce=c.nonce,I.oneofs&&(p._nonce="nonce")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.CompanionMetaNonceFetchResponse"},r})(),i.FullHistorySyncOnDemandRequestResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.requestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.decode(c,c.uint32());break}case 2:{f.responseCode=c.int32();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse;if(c.requestMetadata!=null){if(typeof c.requestMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse.requestMetadata: object expected");I.requestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.fromObject(c.requestMetadata)}switch(c.responseCode){default:if(typeof c.responseCode=="number"){I.responseCode=c.responseCode;break}break;case"REQUEST_SUCCESS":case 0:I.responseCode=0;break;case"REQUEST_TIME_EXPIRED":case 1:I.responseCode=1;break;case"DECLINED_SHARING_HISTORY":case 2:I.responseCode=2;break;case"GENERIC_ERROR":case 3:I.responseCode=3;break;case"ERROR_REQUEST_ON_NON_SMB_PRIMARY":case 4:I.responseCode=4;break;case"ERROR_HOSTED_DEVICE_NOT_CONNECTED":case 5:I.responseCode=5;break;case"ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET":case 6:I.responseCode=6;break}return I},r.toObject=function(c,I){I||(I={});var p={};return c.requestMetadata!=null&&c.hasOwnProperty("requestMetadata")&&(p.requestMetadata=d.proto.Message.FullHistorySyncOnDemandRequestMetadata.toObject(c.requestMetadata,I),I.oneofs&&(p._requestMetadata="requestMetadata")),c.responseCode!=null&&c.hasOwnProperty("responseCode")&&(p.responseCode=I.enums===String?d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[c.responseCode]===void 0?c.responseCode:d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandResponseCode[c.responseCode]:c.responseCode,I.oneofs&&(p._responseCode="responseCode")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.FullHistorySyncOnDemandRequestResponse"},r})(),i.FullHistorySyncOnDemandResponseCode=(function(){let r={},s=Object.create(r);return s[r[0]="REQUEST_SUCCESS"]=0,s[r[1]="REQUEST_TIME_EXPIRED"]=1,s[r[2]="DECLINED_SHARING_HISTORY"]=2,s[r[3]="GENERIC_ERROR"]=3,s[r[4]="ERROR_REQUEST_ON_NON_SMB_PRIMARY"]=4,s[r[5]="ERROR_HOSTED_DEVICE_NOT_CONNECTED"]=5,s[r[6]="ERROR_HOSTED_DEVICE_LOGIN_TIME_NOT_SET"]=6,s})(),i.HistorySyncChunkRetryResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.syncType=c.int32();break}case 2:{f.chunkOrder=c.uint32();break}case 3:{f.requestId=c.string();break}case 4:{f.responseCode=c.int32();break}case 5:{f.canRecover=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse;switch(c.syncType){default:if(typeof c.syncType=="number"){I.syncType=c.syncType;break}break;case"INITIAL_BOOTSTRAP":case 0:I.syncType=0;break;case"INITIAL_STATUS_V3":case 1:I.syncType=1;break;case"FULL":case 2:I.syncType=2;break;case"RECENT":case 3:I.syncType=3;break;case"PUSH_NAME":case 4:I.syncType=4;break;case"NON_BLOCKING_DATA":case 5:I.syncType=5;break;case"ON_DEMAND":case 6:I.syncType=6;break;case"NO_HISTORY":case 7:I.syncType=7;break;case"MESSAGE_ACCESS_STATUS":case 8:I.syncType=8;break}switch(c.chunkOrder!=null&&(I.chunkOrder=c.chunkOrder>>>0),c.requestId!=null&&(I.requestId=String(c.requestId)),c.responseCode){default:if(typeof c.responseCode=="number"){I.responseCode=c.responseCode;break}break;case"GENERATION_ERROR":case 1:I.responseCode=1;break;case"CHUNK_CONSUMED":case 2:I.responseCode=2;break;case"TIMEOUT":case 3:I.responseCode=3;break;case"SESSION_EXHAUSTED":case 4:I.responseCode=4;break;case"CHUNK_EXHAUSTED":case 5:I.responseCode=5;break;case"DUPLICATED_REQUEST":case 6:I.responseCode=6;break}return c.canRecover!=null&&(I.canRecover=!!c.canRecover),I},r.toObject=function(c,I){I||(I={});var p={};return c.syncType!=null&&c.hasOwnProperty("syncType")&&(p.syncType=I.enums===String?d.proto.Message.HistorySyncType[c.syncType]===void 0?c.syncType:d.proto.Message.HistorySyncType[c.syncType]:c.syncType,I.oneofs&&(p._syncType="syncType")),c.chunkOrder!=null&&c.hasOwnProperty("chunkOrder")&&(p.chunkOrder=c.chunkOrder,I.oneofs&&(p._chunkOrder="chunkOrder")),c.requestId!=null&&c.hasOwnProperty("requestId")&&(p.requestId=c.requestId,I.oneofs&&(p._requestId="requestId")),c.responseCode!=null&&c.hasOwnProperty("responseCode")&&(p.responseCode=I.enums===String?d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponseCode[c.responseCode]===void 0?c.responseCode:d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponseCode[c.responseCode]:c.responseCode,I.oneofs&&(p._responseCode="responseCode")),c.canRecover!=null&&c.hasOwnProperty("canRecover")&&(p.canRecover=c.canRecover,I.oneofs&&(p._canRecover="canRecover")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.HistorySyncChunkRetryResponse"},r})(),i.HistorySyncChunkRetryResponseCode=(function(){let r={},s=Object.create(r);return s[r[1]="GENERATION_ERROR"]=1,s[r[2]="CHUNK_CONSUMED"]=2,s[r[3]="TIMEOUT"]=3,s[r[4]="SESSION_EXHAUSTED"]=4,s[r[5]="CHUNK_EXHAUSTED"]=5,s[r[6]="DUPLICATED_REQUEST"]=6,s})(),i.LinkPreviewResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.url=c.string();break}case 2:{f.title=c.string();break}case 3:{f.description=c.string();break}case 4:{f.thumbData=c.bytes();break}case 6:{f.matchText=c.string();break}case 7:{f.previewType=c.string();break}case 8:{f.hqThumbnail=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.decode(c,c.uint32());break}case 9:{f.previewMetadata=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.decode(c,c.uint32());break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse;if(c.url!=null&&(I.url=String(c.url)),c.title!=null&&(I.title=String(c.title)),c.description!=null&&(I.description=String(c.description)),c.thumbData!=null&&(typeof c.thumbData=="string"?l.base64.decode(c.thumbData,I.thumbData=l.newBuffer(l.base64.length(c.thumbData)),0):c.thumbData.length>=0&&(I.thumbData=c.thumbData)),c.matchText!=null&&(I.matchText=String(c.matchText)),c.previewType!=null&&(I.previewType=String(c.previewType)),c.hqThumbnail!=null){if(typeof c.hqThumbnail!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.hqThumbnail: object expected");I.hqThumbnail=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.fromObject(c.hqThumbnail)}if(c.previewMetadata!=null){if(typeof c.previewMetadata!="object")throw TypeError(".proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.previewMetadata: object expected");I.previewMetadata=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.fromObject(c.previewMetadata)}return I},r.toObject=function(c,I){I||(I={});var p={};return c.url!=null&&c.hasOwnProperty("url")&&(p.url=c.url,I.oneofs&&(p._url="url")),c.title!=null&&c.hasOwnProperty("title")&&(p.title=c.title,I.oneofs&&(p._title="title")),c.description!=null&&c.hasOwnProperty("description")&&(p.description=c.description,I.oneofs&&(p._description="description")),c.thumbData!=null&&c.hasOwnProperty("thumbData")&&(p.thumbData=I.bytes===String?l.base64.encode(c.thumbData,0,c.thumbData.length):I.bytes===Array?Array.prototype.slice.call(c.thumbData):c.thumbData,I.oneofs&&(p._thumbData="thumbData")),c.matchText!=null&&c.hasOwnProperty("matchText")&&(p.matchText=c.matchText,I.oneofs&&(p._matchText="matchText")),c.previewType!=null&&c.hasOwnProperty("previewType")&&(p.previewType=c.previewType,I.oneofs&&(p._previewType="previewType")),c.hqThumbnail!=null&&c.hasOwnProperty("hqThumbnail")&&(p.hqThumbnail=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail.toObject(c.hqThumbnail,I),I.oneofs&&(p._hqThumbnail="hqThumbnail")),c.previewMetadata!=null&&c.hasOwnProperty("previewMetadata")&&(p.previewMetadata=d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata.toObject(c.previewMetadata,I),I.oneofs&&(p._previewMetadata="previewMetadata")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse"},r.LinkPreviewHighQualityThumbnail=(function(){function g(I){if(I)for(var p=Object.keys(I),B=0;B>>3){case 1:{y.directPath=p.string();break}case 2:{y.thumbHash=p.string();break}case 3:{y.encThumbHash=p.string();break}case 4:{y.mediaKey=p.bytes();break}case 5:{y.mediaKeyTimestampMs=p.int64();break}case 6:{y.thumbWidth=p.int32();break}case 7:{y.thumbHeight=p.int32();break}default:p.skipType(m&7);break}}return y},g.fromObject=function(p){if(p instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail)return p;var B=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail;return p.directPath!=null&&(B.directPath=String(p.directPath)),p.thumbHash!=null&&(B.thumbHash=String(p.thumbHash)),p.encThumbHash!=null&&(B.encThumbHash=String(p.encThumbHash)),p.mediaKey!=null&&(typeof p.mediaKey=="string"?l.base64.decode(p.mediaKey,B.mediaKey=l.newBuffer(l.base64.length(p.mediaKey)),0):p.mediaKey.length>=0&&(B.mediaKey=p.mediaKey)),p.mediaKeyTimestampMs!=null&&(l.Long?(B.mediaKeyTimestampMs=l.Long.fromValue(p.mediaKeyTimestampMs)).unsigned=!1:typeof p.mediaKeyTimestampMs=="string"?B.mediaKeyTimestampMs=parseInt(p.mediaKeyTimestampMs,10):typeof p.mediaKeyTimestampMs=="number"?B.mediaKeyTimestampMs=p.mediaKeyTimestampMs:typeof p.mediaKeyTimestampMs=="object"&&(B.mediaKeyTimestampMs=new l.LongBits(p.mediaKeyTimestampMs.low>>>0,p.mediaKeyTimestampMs.high>>>0).toNumber())),p.thumbWidth!=null&&(B.thumbWidth=p.thumbWidth|0),p.thumbHeight!=null&&(B.thumbHeight=p.thumbHeight|0),B},g.toObject=function(p,B){B||(B={});var f={};return p.directPath!=null&&p.hasOwnProperty("directPath")&&(f.directPath=p.directPath,B.oneofs&&(f._directPath="directPath")),p.thumbHash!=null&&p.hasOwnProperty("thumbHash")&&(f.thumbHash=p.thumbHash,B.oneofs&&(f._thumbHash="thumbHash")),p.encThumbHash!=null&&p.hasOwnProperty("encThumbHash")&&(f.encThumbHash=p.encThumbHash,B.oneofs&&(f._encThumbHash="encThumbHash")),p.mediaKey!=null&&p.hasOwnProperty("mediaKey")&&(f.mediaKey=B.bytes===String?l.base64.encode(p.mediaKey,0,p.mediaKey.length):B.bytes===Array?Array.prototype.slice.call(p.mediaKey):p.mediaKey,B.oneofs&&(f._mediaKey="mediaKey")),p.mediaKeyTimestampMs!=null&&p.hasOwnProperty("mediaKeyTimestampMs")&&(typeof p.mediaKeyTimestampMs=="number"?f.mediaKeyTimestampMs=B.longs===String?String(p.mediaKeyTimestampMs):p.mediaKeyTimestampMs:f.mediaKeyTimestampMs=B.longs===String?ge(p.mediaKeyTimestampMs):B.longs===Number?ce(p.mediaKeyTimestampMs):p.mediaKeyTimestampMs,B.oneofs&&(f._mediaKeyTimestampMs="mediaKeyTimestampMs")),p.thumbWidth!=null&&p.hasOwnProperty("thumbWidth")&&(f.thumbWidth=p.thumbWidth,B.oneofs&&(f._thumbWidth="thumbWidth")),p.thumbHeight!=null&&p.hasOwnProperty("thumbHeight")&&(f.thumbHeight=p.thumbHeight,B.oneofs&&(f._thumbHeight="thumbHeight")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(p){return p===void 0&&(p="type.googleapis.com"),p+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail"},g})(),r.PaymentLinkPreviewMetadata=(function(){function g(I){if(I)for(var p=Object.keys(I),B=0;B>>3){case 1:{y.isBusinessVerified=p.bool();break}case 2:{y.providerName=p.string();break}default:p.skipType(m&7);break}}return y},g.fromObject=function(p){if(p instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata)return p;var B=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata;return p.isBusinessVerified!=null&&(B.isBusinessVerified=!!p.isBusinessVerified),p.providerName!=null&&(B.providerName=String(p.providerName)),B},g.toObject=function(p,B){B||(B={});var f={};return p.isBusinessVerified!=null&&p.hasOwnProperty("isBusinessVerified")&&(f.isBusinessVerified=p.isBusinessVerified,B.oneofs&&(f._isBusinessVerified="isBusinessVerified")),p.providerName!=null&&p.hasOwnProperty("providerName")&&(f.providerName=p.providerName,B.oneofs&&(f._providerName="providerName")),f},g.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},g.getTypeUrl=function(p){return p===void 0&&(p="type.googleapis.com"),p+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.PaymentLinkPreviewMetadata"},g})(),r})(),i.PlaceholderMessageResendResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.webMessageInfoBytes=c.bytes();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse;return c.webMessageInfoBytes!=null&&(typeof c.webMessageInfoBytes=="string"?l.base64.decode(c.webMessageInfoBytes,I.webMessageInfoBytes=l.newBuffer(l.base64.length(c.webMessageInfoBytes)),0):c.webMessageInfoBytes.length>=0&&(I.webMessageInfoBytes=c.webMessageInfoBytes)),I},r.toObject=function(c,I){I||(I={});var p={};return c.webMessageInfoBytes!=null&&c.hasOwnProperty("webMessageInfoBytes")&&(p.webMessageInfoBytes=I.bytes===String?l.base64.encode(c.webMessageInfoBytes,0,c.webMessageInfoBytes.length):I.bytes===Array?Array.prototype.slice.call(c.webMessageInfoBytes):c.webMessageInfoBytes,I.oneofs&&(p._webMessageInfoBytes="webMessageInfoBytes")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse"},r})(),i.SyncDSnapshotFatalRecoveryResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.collectionSnapshot=c.bytes();break}case 2:{f.isCompressed=c.bool();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse;return c.collectionSnapshot!=null&&(typeof c.collectionSnapshot=="string"?l.base64.decode(c.collectionSnapshot,I.collectionSnapshot=l.newBuffer(l.base64.length(c.collectionSnapshot)),0):c.collectionSnapshot.length>=0&&(I.collectionSnapshot=c.collectionSnapshot)),c.isCompressed!=null&&(I.isCompressed=!!c.isCompressed),I},r.toObject=function(c,I){I||(I={});var p={};return c.collectionSnapshot!=null&&c.hasOwnProperty("collectionSnapshot")&&(p.collectionSnapshot=I.bytes===String?l.base64.encode(c.collectionSnapshot,0,c.collectionSnapshot.length):I.bytes===Array?Array.prototype.slice.call(c.collectionSnapshot):c.collectionSnapshot,I.oneofs&&(p._collectionSnapshot="collectionSnapshot")),c.isCompressed!=null&&c.hasOwnProperty("isCompressed")&&(p.isCompressed=c.isCompressed,I.oneofs&&(p._isCompressed="isCompressed")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.SyncDSnapshotFatalRecoveryResponse"},r})(),i.WaffleNonceFetchResponse=(function(){function r(g){if(g)for(var c=Object.keys(g),I=0;I>>3){case 1:{f.nonce=c.string();break}case 2:{f.waEntFbid=c.string();break}default:c.skipType(Q&7);break}}return f},r.fromObject=function(c){if(c instanceof d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse)return c;var I=new d.proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse;return c.nonce!=null&&(I.nonce=String(c.nonce)),c.waEntFbid!=null&&(I.waEntFbid=String(c.waEntFbid)),I},r.toObject=function(c,I){I||(I={});var p={};return c.nonce!=null&&c.hasOwnProperty("nonce")&&(p.nonce=c.nonce,I.oneofs&&(p._nonce="nonce")),c.waEntFbid!=null&&c.hasOwnProperty("waEntFbid")&&(p.waEntFbid=c.waEntFbid,I.oneofs&&(p._waEntFbid="waEntFbid")),p},r.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},r.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/proto.Message.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.WaffleNonceFetchResponse"},r})(),i})(),a})(),t.PeerDataOperationRequestType=(function(){let a={},e=Object.create(a);return e[a[0]="UPLOAD_STICKER"]=0,e[a[1]="SEND_RECENT_STICKER_BOOTSTRAP"]=1,e[a[2]="GENERATE_LINK_PREVIEW"]=2,e[a[3]="HISTORY_SYNC_ON_DEMAND"]=3,e[a[4]="PLACEHOLDER_MESSAGE_RESEND"]=4,e[a[5]="WAFFLE_LINKING_NONCE_FETCH"]=5,e[a[6]="FULL_HISTORY_SYNC_ON_DEMAND"]=6,e[a[7]="COMPANION_META_NONCE_FETCH"]=7,e[a[8]="COMPANION_SYNCD_SNAPSHOT_FATAL_RECOVERY"]=8,e[a[9]="COMPANION_CANONICAL_USER_NONCE_FETCH"]=9,e[a[10]="HISTORY_SYNC_CHUNK_RETRY"]=10,e[a[11]="GALAXY_FLOW_ACTION"]=11,e})(),t.PinInChatMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.type=A.int32();break}case 3:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PinInChatMessage)return A;var r=new d.proto.Message.PinInChatMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.PinInChatMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN_TYPE":case 0:r.type=0;break;case"PIN_FOR_ALL":case 1:r.type=1;break;case"UNPIN_FOR_ALL":case 2:r.type=2;break}return A.senderTimestampMs!=null&&(l.Long?(r.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?r.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?r.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(r.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.PinInChatMessage.Type[A.type]===void 0?A.type:d.proto.Message.PinInChatMessage.Type[A.type]:A.type,r.oneofs&&(s._type="type")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=r.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=r.longs===String?ge(A.senderTimestampMs):r.longs===Number?ce(A.senderTimestampMs):A.senderTimestampMs,r.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PinInChatMessage"},a.Type=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN_TYPE"]=0,A[i[1]="PIN_FOR_ALL"]=1,A[i[2]="UNPIN_FOR_ALL"]=2,A})(),a})(),t.PlaceholderMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PlaceholderMessage)return A;var r=new d.proto.Message.PlaceholderMessage;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"MASK_LINKED_DEVICES":case 0:r.type=0;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.PlaceholderMessage.PlaceholderType[A.type]===void 0?A.type:d.proto.Message.PlaceholderMessage.PlaceholderType[A.type]:A.type,r.oneofs&&(s._type="type")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PlaceholderMessage"},a.PlaceholderType=(function(){let i={},A=Object.create(i);return A[i[0]="MASK_LINKED_DEVICES"]=0,A})(),a})(),t.PollContentType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="TEXT"]=1,e[a[2]="IMAGE"]=2,e})(),t.PollCreationMessage=(function(){function a(i){if(this.options=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.encKey=A.bytes();break}case 2:{c.name=A.string();break}case 3:{c.options&&c.options.length||(c.options=[]),c.options.push(d.proto.Message.PollCreationMessage.Option.decode(A,A.uint32()));break}case 4:{c.selectableOptionsCount=A.uint32();break}case 5:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 6:{c.pollContentType=A.int32();break}case 7:{c.pollType=A.int32();break}case 8:{c.correctAnswer=d.proto.Message.PollCreationMessage.Option.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PollCreationMessage)return A;var r=new d.proto.Message.PollCreationMessage;if(A.encKey!=null&&(typeof A.encKey=="string"?l.base64.decode(A.encKey,r.encKey=l.newBuffer(l.base64.length(A.encKey)),0):A.encKey.length>=0&&(r.encKey=A.encKey)),A.name!=null&&(r.name=String(A.name)),A.options){if(!Array.isArray(A.options))throw TypeError(".proto.Message.PollCreationMessage.options: array expected");r.options=[];for(var s=0;s>>0),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.PollCreationMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.pollContentType){default:if(typeof A.pollContentType=="number"){r.pollContentType=A.pollContentType;break}break;case"UNKNOWN":case 0:r.pollContentType=0;break;case"TEXT":case 1:r.pollContentType=1;break;case"IMAGE":case 2:r.pollContentType=2;break}switch(A.pollType){default:if(typeof A.pollType=="number"){r.pollType=A.pollType;break}break;case"POLL":case 0:r.pollType=0;break;case"QUIZ":case 1:r.pollType=1;break}if(A.correctAnswer!=null){if(typeof A.correctAnswer!="object")throw TypeError(".proto.Message.PollCreationMessage.correctAnswer: object expected");r.correctAnswer=d.proto.Message.PollCreationMessage.Option.fromObject(A.correctAnswer)}return r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.options=[]),A.encKey!=null&&A.hasOwnProperty("encKey")&&(s.encKey=r.bytes===String?l.base64.encode(A.encKey,0,A.encKey.length):r.bytes===Array?Array.prototype.slice.call(A.encKey):A.encKey,r.oneofs&&(s._encKey="encKey")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.options&&A.options.length){s.options=[];for(var g=0;g>>3){case 1:{p.optionName=s.string();break}case 2:{p.optionHash=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PollCreationMessage.Option)return s;var g=new d.proto.Message.PollCreationMessage.Option;return s.optionName!=null&&(g.optionName=String(s.optionName)),s.optionHash!=null&&(g.optionHash=String(s.optionHash)),g},i.toObject=function(s,g){g||(g={});var c={};return s.optionName!=null&&s.hasOwnProperty("optionName")&&(c.optionName=s.optionName,g.oneofs&&(c._optionName="optionName")),s.optionHash!=null&&s.hasOwnProperty("optionHash")&&(c.optionHash=s.optionHash,g.oneofs&&(c._optionHash="optionHash")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PollCreationMessage.Option"},i})(),a})(),t.PollEncValue=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.encPayload=A.bytes();break}case 2:{c.encIv=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PollEncValue)return A;var r=new d.proto.Message.PollEncValue;return A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),r},a.toObject=function(A,r){r||(r={});var s={};return A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PollEncValue"},a})(),t.PollResultSnapshotMessage=(function(){function a(i){if(this.pollVotes=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.pollVotes&&c.pollVotes.length||(c.pollVotes=[]),c.pollVotes.push(d.proto.Message.PollResultSnapshotMessage.PollVote.decode(A,A.uint32()));break}case 3:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.pollType=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PollResultSnapshotMessage)return A;var r=new d.proto.Message.PollResultSnapshotMessage;if(A.name!=null&&(r.name=String(A.name)),A.pollVotes){if(!Array.isArray(A.pollVotes))throw TypeError(".proto.Message.PollResultSnapshotMessage.pollVotes: array expected");r.pollVotes=[];for(var s=0;s>>3){case 1:{p.optionName=s.string();break}case 2:{p.optionVoteCount=s.int64();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.PollResultSnapshotMessage.PollVote)return s;var g=new d.proto.Message.PollResultSnapshotMessage.PollVote;return s.optionName!=null&&(g.optionName=String(s.optionName)),s.optionVoteCount!=null&&(l.Long?(g.optionVoteCount=l.Long.fromValue(s.optionVoteCount)).unsigned=!1:typeof s.optionVoteCount=="string"?g.optionVoteCount=parseInt(s.optionVoteCount,10):typeof s.optionVoteCount=="number"?g.optionVoteCount=s.optionVoteCount:typeof s.optionVoteCount=="object"&&(g.optionVoteCount=new l.LongBits(s.optionVoteCount.low>>>0,s.optionVoteCount.high>>>0).toNumber())),g},i.toObject=function(s,g){g||(g={});var c={};return s.optionName!=null&&s.hasOwnProperty("optionName")&&(c.optionName=s.optionName,g.oneofs&&(c._optionName="optionName")),s.optionVoteCount!=null&&s.hasOwnProperty("optionVoteCount")&&(typeof s.optionVoteCount=="number"?c.optionVoteCount=g.longs===String?String(s.optionVoteCount):s.optionVoteCount:c.optionVoteCount=g.longs===String?ge(s.optionVoteCount):g.longs===Number?ce(s.optionVoteCount):s.optionVoteCount,g.oneofs&&(c._optionVoteCount="optionVoteCount")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.PollResultSnapshotMessage.PollVote"},i})(),a})(),t.PollType=(function(){let a={},e=Object.create(a);return e[a[0]="POLL"]=0,e[a[1]="QUIZ"]=1,e})(),t.PollUpdateMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.pollCreationMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.vote=d.proto.Message.PollEncValue.decode(A,A.uint32());break}case 3:{c.metadata=d.proto.Message.PollUpdateMessageMetadata.decode(A,A.uint32());break}case 4:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.PollUpdateMessage)return A;var r=new d.proto.Message.PollUpdateMessage;if(A.pollCreationMessageKey!=null){if(typeof A.pollCreationMessageKey!="object")throw TypeError(".proto.Message.PollUpdateMessage.pollCreationMessageKey: object expected");r.pollCreationMessageKey=d.proto.MessageKey.fromObject(A.pollCreationMessageKey)}if(A.vote!=null){if(typeof A.vote!="object")throw TypeError(".proto.Message.PollUpdateMessage.vote: object expected");r.vote=d.proto.Message.PollEncValue.fromObject(A.vote)}if(A.metadata!=null){if(typeof A.metadata!="object")throw TypeError(".proto.Message.PollUpdateMessage.metadata: object expected");r.metadata=d.proto.Message.PollUpdateMessageMetadata.fromObject(A.metadata)}return A.senderTimestampMs!=null&&(l.Long?(r.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?r.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?r.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(r.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.pollCreationMessageKey!=null&&A.hasOwnProperty("pollCreationMessageKey")&&(s.pollCreationMessageKey=d.proto.MessageKey.toObject(A.pollCreationMessageKey,r),r.oneofs&&(s._pollCreationMessageKey="pollCreationMessageKey")),A.vote!=null&&A.hasOwnProperty("vote")&&(s.vote=d.proto.Message.PollEncValue.toObject(A.vote,r),r.oneofs&&(s._vote="vote")),A.metadata!=null&&A.hasOwnProperty("metadata")&&(s.metadata=d.proto.Message.PollUpdateMessageMetadata.toObject(A.metadata,r),r.oneofs&&(s._metadata="metadata")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=r.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=r.longs===String?ge(A.senderTimestampMs):r.longs===Number?ce(A.senderTimestampMs):A.senderTimestampMs,r.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.PollUpdateMessage"},a})(),t.PollUpdateMessageMetadata=(function(){function a(e){if(e)for(var i=Object.keys(e),A=0;A>>3){default:i.skipType(c&7);break}}return g},a.fromObject=function(i){return i instanceof d.proto.Message.PollUpdateMessageMetadata?i:new d.proto.Message.PollUpdateMessageMetadata},a.toObject=function(){return{}},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.Message.PollUpdateMessageMetadata"},a})(),t.PollVoteMessage=(function(){function a(e){if(this.selectedOptions=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.selectedOptions&&g.selectedOptions.length||(g.selectedOptions=[]),g.selectedOptions.push(i.bytes());break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.Message.PollVoteMessage)return i;var A=new d.proto.Message.PollVoteMessage;if(i.selectedOptions){if(!Array.isArray(i.selectedOptions))throw TypeError(".proto.Message.PollVoteMessage.selectedOptions: array expected");A.selectedOptions=[];for(var r=0;r=0&&(A.selectedOptions[r]=i.selectedOptions[r])}return A},a.toObject=function(i,A){A||(A={});var r={};if((A.arrays||A.defaults)&&(r.selectedOptions=[]),i.selectedOptions&&i.selectedOptions.length){r.selectedOptions=[];for(var s=0;s>>3){case 1:{c.product=d.proto.Message.ProductMessage.ProductSnapshot.decode(A,A.uint32());break}case 2:{c.businessOwnerJid=A.string();break}case 4:{c.catalog=d.proto.Message.ProductMessage.CatalogSnapshot.decode(A,A.uint32());break}case 5:{c.body=A.string();break}case 6:{c.footer=A.string();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ProductMessage)return A;var r=new d.proto.Message.ProductMessage;if(A.product!=null){if(typeof A.product!="object")throw TypeError(".proto.Message.ProductMessage.product: object expected");r.product=d.proto.Message.ProductMessage.ProductSnapshot.fromObject(A.product)}if(A.businessOwnerJid!=null&&(r.businessOwnerJid=String(A.businessOwnerJid)),A.catalog!=null){if(typeof A.catalog!="object")throw TypeError(".proto.Message.ProductMessage.catalog: object expected");r.catalog=d.proto.Message.ProductMessage.CatalogSnapshot.fromObject(A.catalog)}if(A.body!=null&&(r.body=String(A.body)),A.footer!=null&&(r.footer=String(A.footer)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.ProductMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.product!=null&&A.hasOwnProperty("product")&&(s.product=d.proto.Message.ProductMessage.ProductSnapshot.toObject(A.product,r),r.oneofs&&(s._product="product")),A.businessOwnerJid!=null&&A.hasOwnProperty("businessOwnerJid")&&(s.businessOwnerJid=A.businessOwnerJid,r.oneofs&&(s._businessOwnerJid="businessOwnerJid")),A.catalog!=null&&A.hasOwnProperty("catalog")&&(s.catalog=d.proto.Message.ProductMessage.CatalogSnapshot.toObject(A.catalog,r),r.oneofs&&(s._catalog="catalog")),A.body!=null&&A.hasOwnProperty("body")&&(s.body=A.body,r.oneofs&&(s._body="body")),A.footer!=null&&A.hasOwnProperty("footer")&&(s.footer=A.footer,r.oneofs&&(s._footer="footer")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ProductMessage"},a.CatalogSnapshot=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.catalogImage=d.proto.Message.ImageMessage.decode(s,s.uint32());break}case 2:{p.title=s.string();break}case 3:{p.description=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ProductMessage.CatalogSnapshot)return s;var g=new d.proto.Message.ProductMessage.CatalogSnapshot;if(s.catalogImage!=null){if(typeof s.catalogImage!="object")throw TypeError(".proto.Message.ProductMessage.CatalogSnapshot.catalogImage: object expected");g.catalogImage=d.proto.Message.ImageMessage.fromObject(s.catalogImage)}return s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),g},i.toObject=function(s,g){g||(g={});var c={};return s.catalogImage!=null&&s.hasOwnProperty("catalogImage")&&(c.catalogImage=d.proto.Message.ImageMessage.toObject(s.catalogImage,g),g.oneofs&&(c._catalogImage="catalogImage")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ProductMessage.CatalogSnapshot"},i})(),a.ProductSnapshot=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.productImage=d.proto.Message.ImageMessage.decode(s,s.uint32());break}case 2:{p.productId=s.string();break}case 3:{p.title=s.string();break}case 4:{p.description=s.string();break}case 5:{p.currencyCode=s.string();break}case 6:{p.priceAmount1000=s.int64();break}case 7:{p.retailerId=s.string();break}case 8:{p.url=s.string();break}case 9:{p.productImageCount=s.uint32();break}case 11:{p.firstImageId=s.string();break}case 12:{p.salePriceAmount1000=s.int64();break}case 13:{p.signedUrl=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.ProductMessage.ProductSnapshot)return s;var g=new d.proto.Message.ProductMessage.ProductSnapshot;if(s.productImage!=null){if(typeof s.productImage!="object")throw TypeError(".proto.Message.ProductMessage.ProductSnapshot.productImage: object expected");g.productImage=d.proto.Message.ImageMessage.fromObject(s.productImage)}return s.productId!=null&&(g.productId=String(s.productId)),s.title!=null&&(g.title=String(s.title)),s.description!=null&&(g.description=String(s.description)),s.currencyCode!=null&&(g.currencyCode=String(s.currencyCode)),s.priceAmount1000!=null&&(l.Long?(g.priceAmount1000=l.Long.fromValue(s.priceAmount1000)).unsigned=!1:typeof s.priceAmount1000=="string"?g.priceAmount1000=parseInt(s.priceAmount1000,10):typeof s.priceAmount1000=="number"?g.priceAmount1000=s.priceAmount1000:typeof s.priceAmount1000=="object"&&(g.priceAmount1000=new l.LongBits(s.priceAmount1000.low>>>0,s.priceAmount1000.high>>>0).toNumber())),s.retailerId!=null&&(g.retailerId=String(s.retailerId)),s.url!=null&&(g.url=String(s.url)),s.productImageCount!=null&&(g.productImageCount=s.productImageCount>>>0),s.firstImageId!=null&&(g.firstImageId=String(s.firstImageId)),s.salePriceAmount1000!=null&&(l.Long?(g.salePriceAmount1000=l.Long.fromValue(s.salePriceAmount1000)).unsigned=!1:typeof s.salePriceAmount1000=="string"?g.salePriceAmount1000=parseInt(s.salePriceAmount1000,10):typeof s.salePriceAmount1000=="number"?g.salePriceAmount1000=s.salePriceAmount1000:typeof s.salePriceAmount1000=="object"&&(g.salePriceAmount1000=new l.LongBits(s.salePriceAmount1000.low>>>0,s.salePriceAmount1000.high>>>0).toNumber())),s.signedUrl!=null&&(g.signedUrl=String(s.signedUrl)),g},i.toObject=function(s,g){g||(g={});var c={};return s.productImage!=null&&s.hasOwnProperty("productImage")&&(c.productImage=d.proto.Message.ImageMessage.toObject(s.productImage,g),g.oneofs&&(c._productImage="productImage")),s.productId!=null&&s.hasOwnProperty("productId")&&(c.productId=s.productId,g.oneofs&&(c._productId="productId")),s.title!=null&&s.hasOwnProperty("title")&&(c.title=s.title,g.oneofs&&(c._title="title")),s.description!=null&&s.hasOwnProperty("description")&&(c.description=s.description,g.oneofs&&(c._description="description")),s.currencyCode!=null&&s.hasOwnProperty("currencyCode")&&(c.currencyCode=s.currencyCode,g.oneofs&&(c._currencyCode="currencyCode")),s.priceAmount1000!=null&&s.hasOwnProperty("priceAmount1000")&&(typeof s.priceAmount1000=="number"?c.priceAmount1000=g.longs===String?String(s.priceAmount1000):s.priceAmount1000:c.priceAmount1000=g.longs===String?ge(s.priceAmount1000):g.longs===Number?ce(s.priceAmount1000):s.priceAmount1000,g.oneofs&&(c._priceAmount1000="priceAmount1000")),s.retailerId!=null&&s.hasOwnProperty("retailerId")&&(c.retailerId=s.retailerId,g.oneofs&&(c._retailerId="retailerId")),s.url!=null&&s.hasOwnProperty("url")&&(c.url=s.url,g.oneofs&&(c._url="url")),s.productImageCount!=null&&s.hasOwnProperty("productImageCount")&&(c.productImageCount=s.productImageCount,g.oneofs&&(c._productImageCount="productImageCount")),s.firstImageId!=null&&s.hasOwnProperty("firstImageId")&&(c.firstImageId=s.firstImageId,g.oneofs&&(c._firstImageId="firstImageId")),s.salePriceAmount1000!=null&&s.hasOwnProperty("salePriceAmount1000")&&(typeof s.salePriceAmount1000=="number"?c.salePriceAmount1000=g.longs===String?String(s.salePriceAmount1000):s.salePriceAmount1000:c.salePriceAmount1000=g.longs===String?ge(s.salePriceAmount1000):g.longs===Number?ce(s.salePriceAmount1000):s.salePriceAmount1000,g.oneofs&&(c._salePriceAmount1000="salePriceAmount1000")),s.signedUrl!=null&&s.hasOwnProperty("signedUrl")&&(c.signedUrl=s.signedUrl,g.oneofs&&(c._signedUrl="signedUrl")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.Message.ProductMessage.ProductSnapshot"},i})(),a})(),t.ProtocolMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.type=A.int32();break}case 4:{c.ephemeralExpiration=A.uint32();break}case 5:{c.ephemeralSettingTimestamp=A.int64();break}case 6:{c.historySyncNotification=d.proto.Message.HistorySyncNotification.decode(A,A.uint32());break}case 7:{c.appStateSyncKeyShare=d.proto.Message.AppStateSyncKeyShare.decode(A,A.uint32());break}case 8:{c.appStateSyncKeyRequest=d.proto.Message.AppStateSyncKeyRequest.decode(A,A.uint32());break}case 9:{c.initialSecurityNotificationSettingSync=d.proto.Message.InitialSecurityNotificationSettingSync.decode(A,A.uint32());break}case 10:{c.appStateFatalExceptionNotification=d.proto.Message.AppStateFatalExceptionNotification.decode(A,A.uint32());break}case 11:{c.disappearingMode=d.proto.DisappearingMode.decode(A,A.uint32());break}case 14:{c.editedMessage=d.proto.Message.decode(A,A.uint32());break}case 15:{c.timestampMs=A.int64();break}case 16:{c.peerDataOperationRequestMessage=d.proto.Message.PeerDataOperationRequestMessage.decode(A,A.uint32());break}case 17:{c.peerDataOperationRequestResponseMessage=d.proto.Message.PeerDataOperationRequestResponseMessage.decode(A,A.uint32());break}case 18:{c.botFeedbackMessage=d.proto.BotFeedbackMessage.decode(A,A.uint32());break}case 19:{c.invokerJid=A.string();break}case 20:{c.requestWelcomeMessageMetadata=d.proto.Message.RequestWelcomeMessageMetadata.decode(A,A.uint32());break}case 21:{c.mediaNotifyMessage=d.proto.MediaNotifyMessage.decode(A,A.uint32());break}case 22:{c.cloudApiThreadControlNotification=d.proto.Message.CloudAPIThreadControlNotification.decode(A,A.uint32());break}case 23:{c.lidMigrationMappingSyncMessage=d.proto.LIDMigrationMappingSyncMessage.decode(A,A.uint32());break}case 24:{c.limitSharing=d.proto.LimitSharing.decode(A,A.uint32());break}case 25:{c.aiPsiMetadata=A.bytes();break}case 26:{c.aiQueryFanout=d.proto.AIQueryFanout.decode(A,A.uint32());break}case 27:{c.memberLabel=d.proto.MemberLabel.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ProtocolMessage)return A;var r=new d.proto.Message.ProtocolMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ProtocolMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"REVOKE":case 0:r.type=0;break;case"EPHEMERAL_SETTING":case 3:r.type=3;break;case"EPHEMERAL_SYNC_RESPONSE":case 4:r.type=4;break;case"HISTORY_SYNC_NOTIFICATION":case 5:r.type=5;break;case"APP_STATE_SYNC_KEY_SHARE":case 6:r.type=6;break;case"APP_STATE_SYNC_KEY_REQUEST":case 7:r.type=7;break;case"MSG_FANOUT_BACKFILL_REQUEST":case 8:r.type=8;break;case"INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC":case 9:r.type=9;break;case"APP_STATE_FATAL_EXCEPTION_NOTIFICATION":case 10:r.type=10;break;case"SHARE_PHONE_NUMBER":case 11:r.type=11;break;case"MESSAGE_EDIT":case 14:r.type=14;break;case"PEER_DATA_OPERATION_REQUEST_MESSAGE":case 16:r.type=16;break;case"PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE":case 17:r.type=17;break;case"REQUEST_WELCOME_MESSAGE":case 18:r.type=18;break;case"BOT_FEEDBACK_MESSAGE":case 19:r.type=19;break;case"MEDIA_NOTIFY_MESSAGE":case 20:r.type=20;break;case"CLOUD_API_THREAD_CONTROL_NOTIFICATION":case 21:r.type=21;break;case"LID_MIGRATION_MAPPING_SYNC":case 22:r.type=22;break;case"REMINDER_MESSAGE":case 23:r.type=23;break;case"BOT_MEMU_ONBOARDING_MESSAGE":case 24:r.type=24;break;case"STATUS_MENTION_MESSAGE":case 25:r.type=25;break;case"STOP_GENERATION_MESSAGE":case 26:r.type=26;break;case"LIMIT_SHARING":case 27:r.type=27;break;case"AI_PSI_METADATA":case 28:r.type=28;break;case"AI_QUERY_FANOUT":case 29:r.type=29;break;case"GROUP_MEMBER_LABEL_CHANGE":case 30:r.type=30;break}if(A.ephemeralExpiration!=null&&(r.ephemeralExpiration=A.ephemeralExpiration>>>0),A.ephemeralSettingTimestamp!=null&&(l.Long?(r.ephemeralSettingTimestamp=l.Long.fromValue(A.ephemeralSettingTimestamp)).unsigned=!1:typeof A.ephemeralSettingTimestamp=="string"?r.ephemeralSettingTimestamp=parseInt(A.ephemeralSettingTimestamp,10):typeof A.ephemeralSettingTimestamp=="number"?r.ephemeralSettingTimestamp=A.ephemeralSettingTimestamp:typeof A.ephemeralSettingTimestamp=="object"&&(r.ephemeralSettingTimestamp=new l.LongBits(A.ephemeralSettingTimestamp.low>>>0,A.ephemeralSettingTimestamp.high>>>0).toNumber())),A.historySyncNotification!=null){if(typeof A.historySyncNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.historySyncNotification: object expected");r.historySyncNotification=d.proto.Message.HistorySyncNotification.fromObject(A.historySyncNotification)}if(A.appStateSyncKeyShare!=null){if(typeof A.appStateSyncKeyShare!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyShare: object expected");r.appStateSyncKeyShare=d.proto.Message.AppStateSyncKeyShare.fromObject(A.appStateSyncKeyShare)}if(A.appStateSyncKeyRequest!=null){if(typeof A.appStateSyncKeyRequest!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateSyncKeyRequest: object expected");r.appStateSyncKeyRequest=d.proto.Message.AppStateSyncKeyRequest.fromObject(A.appStateSyncKeyRequest)}if(A.initialSecurityNotificationSettingSync!=null){if(typeof A.initialSecurityNotificationSettingSync!="object")throw TypeError(".proto.Message.ProtocolMessage.initialSecurityNotificationSettingSync: object expected");r.initialSecurityNotificationSettingSync=d.proto.Message.InitialSecurityNotificationSettingSync.fromObject(A.initialSecurityNotificationSettingSync)}if(A.appStateFatalExceptionNotification!=null){if(typeof A.appStateFatalExceptionNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.appStateFatalExceptionNotification: object expected");r.appStateFatalExceptionNotification=d.proto.Message.AppStateFatalExceptionNotification.fromObject(A.appStateFatalExceptionNotification)}if(A.disappearingMode!=null){if(typeof A.disappearingMode!="object")throw TypeError(".proto.Message.ProtocolMessage.disappearingMode: object expected");r.disappearingMode=d.proto.DisappearingMode.fromObject(A.disappearingMode)}if(A.editedMessage!=null){if(typeof A.editedMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.editedMessage: object expected");r.editedMessage=d.proto.Message.fromObject(A.editedMessage)}if(A.timestampMs!=null&&(l.Long?(r.timestampMs=l.Long.fromValue(A.timestampMs)).unsigned=!1:typeof A.timestampMs=="string"?r.timestampMs=parseInt(A.timestampMs,10):typeof A.timestampMs=="number"?r.timestampMs=A.timestampMs:typeof A.timestampMs=="object"&&(r.timestampMs=new l.LongBits(A.timestampMs.low>>>0,A.timestampMs.high>>>0).toNumber())),A.peerDataOperationRequestMessage!=null){if(typeof A.peerDataOperationRequestMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestMessage: object expected");r.peerDataOperationRequestMessage=d.proto.Message.PeerDataOperationRequestMessage.fromObject(A.peerDataOperationRequestMessage)}if(A.peerDataOperationRequestResponseMessage!=null){if(typeof A.peerDataOperationRequestResponseMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.peerDataOperationRequestResponseMessage: object expected");r.peerDataOperationRequestResponseMessage=d.proto.Message.PeerDataOperationRequestResponseMessage.fromObject(A.peerDataOperationRequestResponseMessage)}if(A.botFeedbackMessage!=null){if(typeof A.botFeedbackMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.botFeedbackMessage: object expected");r.botFeedbackMessage=d.proto.BotFeedbackMessage.fromObject(A.botFeedbackMessage)}if(A.invokerJid!=null&&(r.invokerJid=String(A.invokerJid)),A.requestWelcomeMessageMetadata!=null){if(typeof A.requestWelcomeMessageMetadata!="object")throw TypeError(".proto.Message.ProtocolMessage.requestWelcomeMessageMetadata: object expected");r.requestWelcomeMessageMetadata=d.proto.Message.RequestWelcomeMessageMetadata.fromObject(A.requestWelcomeMessageMetadata)}if(A.mediaNotifyMessage!=null){if(typeof A.mediaNotifyMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.mediaNotifyMessage: object expected");r.mediaNotifyMessage=d.proto.MediaNotifyMessage.fromObject(A.mediaNotifyMessage)}if(A.cloudApiThreadControlNotification!=null){if(typeof A.cloudApiThreadControlNotification!="object")throw TypeError(".proto.Message.ProtocolMessage.cloudApiThreadControlNotification: object expected");r.cloudApiThreadControlNotification=d.proto.Message.CloudAPIThreadControlNotification.fromObject(A.cloudApiThreadControlNotification)}if(A.lidMigrationMappingSyncMessage!=null){if(typeof A.lidMigrationMappingSyncMessage!="object")throw TypeError(".proto.Message.ProtocolMessage.lidMigrationMappingSyncMessage: object expected");r.lidMigrationMappingSyncMessage=d.proto.LIDMigrationMappingSyncMessage.fromObject(A.lidMigrationMappingSyncMessage)}if(A.limitSharing!=null){if(typeof A.limitSharing!="object")throw TypeError(".proto.Message.ProtocolMessage.limitSharing: object expected");r.limitSharing=d.proto.LimitSharing.fromObject(A.limitSharing)}if(A.aiPsiMetadata!=null&&(typeof A.aiPsiMetadata=="string"?l.base64.decode(A.aiPsiMetadata,r.aiPsiMetadata=l.newBuffer(l.base64.length(A.aiPsiMetadata)),0):A.aiPsiMetadata.length>=0&&(r.aiPsiMetadata=A.aiPsiMetadata)),A.aiQueryFanout!=null){if(typeof A.aiQueryFanout!="object")throw TypeError(".proto.Message.ProtocolMessage.aiQueryFanout: object expected");r.aiQueryFanout=d.proto.AIQueryFanout.fromObject(A.aiQueryFanout)}if(A.memberLabel!=null){if(typeof A.memberLabel!="object")throw TypeError(".proto.Message.ProtocolMessage.memberLabel: object expected");r.memberLabel=d.proto.MemberLabel.fromObject(A.memberLabel)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.ProtocolMessage.Type[A.type]===void 0?A.type:d.proto.Message.ProtocolMessage.Type[A.type]:A.type,r.oneofs&&(s._type="type")),A.ephemeralExpiration!=null&&A.hasOwnProperty("ephemeralExpiration")&&(s.ephemeralExpiration=A.ephemeralExpiration,r.oneofs&&(s._ephemeralExpiration="ephemeralExpiration")),A.ephemeralSettingTimestamp!=null&&A.hasOwnProperty("ephemeralSettingTimestamp")&&(typeof A.ephemeralSettingTimestamp=="number"?s.ephemeralSettingTimestamp=r.longs===String?String(A.ephemeralSettingTimestamp):A.ephemeralSettingTimestamp:s.ephemeralSettingTimestamp=r.longs===String?ge(A.ephemeralSettingTimestamp):r.longs===Number?ce(A.ephemeralSettingTimestamp):A.ephemeralSettingTimestamp,r.oneofs&&(s._ephemeralSettingTimestamp="ephemeralSettingTimestamp")),A.historySyncNotification!=null&&A.hasOwnProperty("historySyncNotification")&&(s.historySyncNotification=d.proto.Message.HistorySyncNotification.toObject(A.historySyncNotification,r),r.oneofs&&(s._historySyncNotification="historySyncNotification")),A.appStateSyncKeyShare!=null&&A.hasOwnProperty("appStateSyncKeyShare")&&(s.appStateSyncKeyShare=d.proto.Message.AppStateSyncKeyShare.toObject(A.appStateSyncKeyShare,r),r.oneofs&&(s._appStateSyncKeyShare="appStateSyncKeyShare")),A.appStateSyncKeyRequest!=null&&A.hasOwnProperty("appStateSyncKeyRequest")&&(s.appStateSyncKeyRequest=d.proto.Message.AppStateSyncKeyRequest.toObject(A.appStateSyncKeyRequest,r),r.oneofs&&(s._appStateSyncKeyRequest="appStateSyncKeyRequest")),A.initialSecurityNotificationSettingSync!=null&&A.hasOwnProperty("initialSecurityNotificationSettingSync")&&(s.initialSecurityNotificationSettingSync=d.proto.Message.InitialSecurityNotificationSettingSync.toObject(A.initialSecurityNotificationSettingSync,r),r.oneofs&&(s._initialSecurityNotificationSettingSync="initialSecurityNotificationSettingSync")),A.appStateFatalExceptionNotification!=null&&A.hasOwnProperty("appStateFatalExceptionNotification")&&(s.appStateFatalExceptionNotification=d.proto.Message.AppStateFatalExceptionNotification.toObject(A.appStateFatalExceptionNotification,r),r.oneofs&&(s._appStateFatalExceptionNotification="appStateFatalExceptionNotification")),A.disappearingMode!=null&&A.hasOwnProperty("disappearingMode")&&(s.disappearingMode=d.proto.DisappearingMode.toObject(A.disappearingMode,r),r.oneofs&&(s._disappearingMode="disappearingMode")),A.editedMessage!=null&&A.hasOwnProperty("editedMessage")&&(s.editedMessage=d.proto.Message.toObject(A.editedMessage,r),r.oneofs&&(s._editedMessage="editedMessage")),A.timestampMs!=null&&A.hasOwnProperty("timestampMs")&&(typeof A.timestampMs=="number"?s.timestampMs=r.longs===String?String(A.timestampMs):A.timestampMs:s.timestampMs=r.longs===String?ge(A.timestampMs):r.longs===Number?ce(A.timestampMs):A.timestampMs,r.oneofs&&(s._timestampMs="timestampMs")),A.peerDataOperationRequestMessage!=null&&A.hasOwnProperty("peerDataOperationRequestMessage")&&(s.peerDataOperationRequestMessage=d.proto.Message.PeerDataOperationRequestMessage.toObject(A.peerDataOperationRequestMessage,r),r.oneofs&&(s._peerDataOperationRequestMessage="peerDataOperationRequestMessage")),A.peerDataOperationRequestResponseMessage!=null&&A.hasOwnProperty("peerDataOperationRequestResponseMessage")&&(s.peerDataOperationRequestResponseMessage=d.proto.Message.PeerDataOperationRequestResponseMessage.toObject(A.peerDataOperationRequestResponseMessage,r),r.oneofs&&(s._peerDataOperationRequestResponseMessage="peerDataOperationRequestResponseMessage")),A.botFeedbackMessage!=null&&A.hasOwnProperty("botFeedbackMessage")&&(s.botFeedbackMessage=d.proto.BotFeedbackMessage.toObject(A.botFeedbackMessage,r),r.oneofs&&(s._botFeedbackMessage="botFeedbackMessage")),A.invokerJid!=null&&A.hasOwnProperty("invokerJid")&&(s.invokerJid=A.invokerJid,r.oneofs&&(s._invokerJid="invokerJid")),A.requestWelcomeMessageMetadata!=null&&A.hasOwnProperty("requestWelcomeMessageMetadata")&&(s.requestWelcomeMessageMetadata=d.proto.Message.RequestWelcomeMessageMetadata.toObject(A.requestWelcomeMessageMetadata,r),r.oneofs&&(s._requestWelcomeMessageMetadata="requestWelcomeMessageMetadata")),A.mediaNotifyMessage!=null&&A.hasOwnProperty("mediaNotifyMessage")&&(s.mediaNotifyMessage=d.proto.MediaNotifyMessage.toObject(A.mediaNotifyMessage,r),r.oneofs&&(s._mediaNotifyMessage="mediaNotifyMessage")),A.cloudApiThreadControlNotification!=null&&A.hasOwnProperty("cloudApiThreadControlNotification")&&(s.cloudApiThreadControlNotification=d.proto.Message.CloudAPIThreadControlNotification.toObject(A.cloudApiThreadControlNotification,r),r.oneofs&&(s._cloudApiThreadControlNotification="cloudApiThreadControlNotification")),A.lidMigrationMappingSyncMessage!=null&&A.hasOwnProperty("lidMigrationMappingSyncMessage")&&(s.lidMigrationMappingSyncMessage=d.proto.LIDMigrationMappingSyncMessage.toObject(A.lidMigrationMappingSyncMessage,r),r.oneofs&&(s._lidMigrationMappingSyncMessage="lidMigrationMappingSyncMessage")),A.limitSharing!=null&&A.hasOwnProperty("limitSharing")&&(s.limitSharing=d.proto.LimitSharing.toObject(A.limitSharing,r),r.oneofs&&(s._limitSharing="limitSharing")),A.aiPsiMetadata!=null&&A.hasOwnProperty("aiPsiMetadata")&&(s.aiPsiMetadata=r.bytes===String?l.base64.encode(A.aiPsiMetadata,0,A.aiPsiMetadata.length):r.bytes===Array?Array.prototype.slice.call(A.aiPsiMetadata):A.aiPsiMetadata,r.oneofs&&(s._aiPsiMetadata="aiPsiMetadata")),A.aiQueryFanout!=null&&A.hasOwnProperty("aiQueryFanout")&&(s.aiQueryFanout=d.proto.AIQueryFanout.toObject(A.aiQueryFanout,r),r.oneofs&&(s._aiQueryFanout="aiQueryFanout")),A.memberLabel!=null&&A.hasOwnProperty("memberLabel")&&(s.memberLabel=d.proto.MemberLabel.toObject(A.memberLabel,r),r.oneofs&&(s._memberLabel="memberLabel")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ProtocolMessage"},a.Type=(function(){let i={},A=Object.create(i);return A[i[0]="REVOKE"]=0,A[i[3]="EPHEMERAL_SETTING"]=3,A[i[4]="EPHEMERAL_SYNC_RESPONSE"]=4,A[i[5]="HISTORY_SYNC_NOTIFICATION"]=5,A[i[6]="APP_STATE_SYNC_KEY_SHARE"]=6,A[i[7]="APP_STATE_SYNC_KEY_REQUEST"]=7,A[i[8]="MSG_FANOUT_BACKFILL_REQUEST"]=8,A[i[9]="INITIAL_SECURITY_NOTIFICATION_SETTING_SYNC"]=9,A[i[10]="APP_STATE_FATAL_EXCEPTION_NOTIFICATION"]=10,A[i[11]="SHARE_PHONE_NUMBER"]=11,A[i[14]="MESSAGE_EDIT"]=14,A[i[16]="PEER_DATA_OPERATION_REQUEST_MESSAGE"]=16,A[i[17]="PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE"]=17,A[i[18]="REQUEST_WELCOME_MESSAGE"]=18,A[i[19]="BOT_FEEDBACK_MESSAGE"]=19,A[i[20]="MEDIA_NOTIFY_MESSAGE"]=20,A[i[21]="CLOUD_API_THREAD_CONTROL_NOTIFICATION"]=21,A[i[22]="LID_MIGRATION_MAPPING_SYNC"]=22,A[i[23]="REMINDER_MESSAGE"]=23,A[i[24]="BOT_MEMU_ONBOARDING_MESSAGE"]=24,A[i[25]="STATUS_MENTION_MESSAGE"]=25,A[i[26]="STOP_GENERATION_MESSAGE"]=26,A[i[27]="LIMIT_SHARING"]=27,A[i[28]="AI_PSI_METADATA"]=28,A[i[29]="AI_QUERY_FANOUT"]=29,A[i[30]="GROUP_MEMBER_LABEL_CHANGE"]=30,A})(),a})(),t.QuestionResponseMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.QuestionResponseMessage)return A;var r=new d.proto.Message.QuestionResponseMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.QuestionResponseMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(r.text=String(A.text)),r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.QuestionResponseMessage"},a})(),t.ReactionMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}case 3:{c.groupingKey=A.string();break}case 4:{c.senderTimestampMs=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ReactionMessage)return A;var r=new d.proto.Message.ReactionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ReactionMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(r.text=String(A.text)),A.groupingKey!=null&&(r.groupingKey=String(A.groupingKey)),A.senderTimestampMs!=null&&(l.Long?(r.senderTimestampMs=l.Long.fromValue(A.senderTimestampMs)).unsigned=!1:typeof A.senderTimestampMs=="string"?r.senderTimestampMs=parseInt(A.senderTimestampMs,10):typeof A.senderTimestampMs=="number"?r.senderTimestampMs=A.senderTimestampMs:typeof A.senderTimestampMs=="object"&&(r.senderTimestampMs=new l.LongBits(A.senderTimestampMs.low>>>0,A.senderTimestampMs.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.groupingKey!=null&&A.hasOwnProperty("groupingKey")&&(s.groupingKey=A.groupingKey,r.oneofs&&(s._groupingKey="groupingKey")),A.senderTimestampMs!=null&&A.hasOwnProperty("senderTimestampMs")&&(typeof A.senderTimestampMs=="number"?s.senderTimestampMs=r.longs===String?String(A.senderTimestampMs):A.senderTimestampMs:s.senderTimestampMs=r.longs===String?ge(A.senderTimestampMs):r.longs===Number?ce(A.senderTimestampMs):A.senderTimestampMs,r.oneofs&&(s._senderTimestampMs="senderTimestampMs")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ReactionMessage"},a})(),t.RequestPaymentMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 4:{c.noteMessage=d.proto.Message.decode(A,A.uint32());break}case 1:{c.currencyCodeIso4217=A.string();break}case 2:{c.amount1000=A.uint64();break}case 3:{c.requestFrom=A.string();break}case 5:{c.expiryTimestamp=A.int64();break}case 6:{c.amount=d.proto.Money.decode(A,A.uint32());break}case 7:{c.background=d.proto.PaymentBackground.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.RequestPaymentMessage)return A;var r=new d.proto.Message.RequestPaymentMessage;if(A.noteMessage!=null){if(typeof A.noteMessage!="object")throw TypeError(".proto.Message.RequestPaymentMessage.noteMessage: object expected");r.noteMessage=d.proto.Message.fromObject(A.noteMessage)}if(A.currencyCodeIso4217!=null&&(r.currencyCodeIso4217=String(A.currencyCodeIso4217)),A.amount1000!=null&&(l.Long?(r.amount1000=l.Long.fromValue(A.amount1000)).unsigned=!0:typeof A.amount1000=="string"?r.amount1000=parseInt(A.amount1000,10):typeof A.amount1000=="number"?r.amount1000=A.amount1000:typeof A.amount1000=="object"&&(r.amount1000=new l.LongBits(A.amount1000.low>>>0,A.amount1000.high>>>0).toNumber(!0))),A.requestFrom!=null&&(r.requestFrom=String(A.requestFrom)),A.expiryTimestamp!=null&&(l.Long?(r.expiryTimestamp=l.Long.fromValue(A.expiryTimestamp)).unsigned=!1:typeof A.expiryTimestamp=="string"?r.expiryTimestamp=parseInt(A.expiryTimestamp,10):typeof A.expiryTimestamp=="number"?r.expiryTimestamp=A.expiryTimestamp:typeof A.expiryTimestamp=="object"&&(r.expiryTimestamp=new l.LongBits(A.expiryTimestamp.low>>>0,A.expiryTimestamp.high>>>0).toNumber())),A.amount!=null){if(typeof A.amount!="object")throw TypeError(".proto.Message.RequestPaymentMessage.amount: object expected");r.amount=d.proto.Money.fromObject(A.amount)}if(A.background!=null){if(typeof A.background!="object")throw TypeError(".proto.Message.RequestPaymentMessage.background: object expected");r.background=d.proto.PaymentBackground.fromObject(A.background)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.currencyCodeIso4217!=null&&A.hasOwnProperty("currencyCodeIso4217")&&(s.currencyCodeIso4217=A.currencyCodeIso4217,r.oneofs&&(s._currencyCodeIso4217="currencyCodeIso4217")),A.amount1000!=null&&A.hasOwnProperty("amount1000")&&(typeof A.amount1000=="number"?s.amount1000=r.longs===String?String(A.amount1000):A.amount1000:s.amount1000=r.longs===String?ge(A.amount1000,!0):r.longs===Number?ce(A.amount1000,!0):A.amount1000,r.oneofs&&(s._amount1000="amount1000")),A.requestFrom!=null&&A.hasOwnProperty("requestFrom")&&(s.requestFrom=A.requestFrom,r.oneofs&&(s._requestFrom="requestFrom")),A.noteMessage!=null&&A.hasOwnProperty("noteMessage")&&(s.noteMessage=d.proto.Message.toObject(A.noteMessage,r),r.oneofs&&(s._noteMessage="noteMessage")),A.expiryTimestamp!=null&&A.hasOwnProperty("expiryTimestamp")&&(typeof A.expiryTimestamp=="number"?s.expiryTimestamp=r.longs===String?String(A.expiryTimestamp):A.expiryTimestamp:s.expiryTimestamp=r.longs===String?ge(A.expiryTimestamp):r.longs===Number?ce(A.expiryTimestamp):A.expiryTimestamp,r.oneofs&&(s._expiryTimestamp="expiryTimestamp")),A.amount!=null&&A.hasOwnProperty("amount")&&(s.amount=d.proto.Money.toObject(A.amount,r),r.oneofs&&(s._amount="amount")),A.background!=null&&A.hasOwnProperty("background")&&(s.background=d.proto.PaymentBackground.toObject(A.background,r),r.oneofs&&(s._background="background")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestPaymentMessage"},a})(),t.RequestPhoneNumberMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.RequestPhoneNumberMessage)return A;var r=new d.proto.Message.RequestPhoneNumberMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.RequestPhoneNumberMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestPhoneNumberMessage"},a})(),t.RequestWelcomeMessageMetadata=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.localChatState=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.RequestWelcomeMessageMetadata)return A;var r=new d.proto.Message.RequestWelcomeMessageMetadata;switch(A.localChatState){default:if(typeof A.localChatState=="number"){r.localChatState=A.localChatState;break}break;case"EMPTY":case 0:r.localChatState=0;break;case"NON_EMPTY":case 1:r.localChatState=1;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.localChatState!=null&&A.hasOwnProperty("localChatState")&&(s.localChatState=r.enums===String?d.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[A.localChatState]===void 0?A.localChatState:d.proto.Message.RequestWelcomeMessageMetadata.LocalChatState[A.localChatState]:A.localChatState,r.oneofs&&(s._localChatState="localChatState")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.RequestWelcomeMessageMetadata"},a.LocalChatState=(function(){let i={},A=Object.create(i);return A[i[0]="EMPTY"]=0,A[i[1]="NON_EMPTY"]=1,A})(),a})(),t.ScheduledCallCreationMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.scheduledTimestampMs=A.int64();break}case 2:{c.callType=A.int32();break}case 3:{c.title=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ScheduledCallCreationMessage)return A;var r=new d.proto.Message.ScheduledCallCreationMessage;switch(A.scheduledTimestampMs!=null&&(l.Long?(r.scheduledTimestampMs=l.Long.fromValue(A.scheduledTimestampMs)).unsigned=!1:typeof A.scheduledTimestampMs=="string"?r.scheduledTimestampMs=parseInt(A.scheduledTimestampMs,10):typeof A.scheduledTimestampMs=="number"?r.scheduledTimestampMs=A.scheduledTimestampMs:typeof A.scheduledTimestampMs=="object"&&(r.scheduledTimestampMs=new l.LongBits(A.scheduledTimestampMs.low>>>0,A.scheduledTimestampMs.high>>>0).toNumber())),A.callType){default:if(typeof A.callType=="number"){r.callType=A.callType;break}break;case"UNKNOWN":case 0:r.callType=0;break;case"VOICE":case 1:r.callType=1;break;case"VIDEO":case 2:r.callType=2;break}return A.title!=null&&(r.title=String(A.title)),r},a.toObject=function(A,r){r||(r={});var s={};return A.scheduledTimestampMs!=null&&A.hasOwnProperty("scheduledTimestampMs")&&(typeof A.scheduledTimestampMs=="number"?s.scheduledTimestampMs=r.longs===String?String(A.scheduledTimestampMs):A.scheduledTimestampMs:s.scheduledTimestampMs=r.longs===String?ge(A.scheduledTimestampMs):r.longs===Number?ce(A.scheduledTimestampMs):A.scheduledTimestampMs,r.oneofs&&(s._scheduledTimestampMs="scheduledTimestampMs")),A.callType!=null&&A.hasOwnProperty("callType")&&(s.callType=r.enums===String?d.proto.Message.ScheduledCallCreationMessage.CallType[A.callType]===void 0?A.callType:d.proto.Message.ScheduledCallCreationMessage.CallType[A.callType]:A.callType,r.oneofs&&(s._callType="callType")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ScheduledCallCreationMessage"},a.CallType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="VOICE"]=1,A[i[2]="VIDEO"]=2,A})(),a})(),t.ScheduledCallEditMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.editType=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.ScheduledCallEditMessage)return A;var r=new d.proto.Message.ScheduledCallEditMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.ScheduledCallEditMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}switch(A.editType){default:if(typeof A.editType=="number"){r.editType=A.editType;break}break;case"UNKNOWN":case 0:r.editType=0;break;case"CANCEL":case 1:r.editType=1;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.editType!=null&&A.hasOwnProperty("editType")&&(s.editType=r.enums===String?d.proto.Message.ScheduledCallEditMessage.EditType[A.editType]===void 0?A.editType:d.proto.Message.ScheduledCallEditMessage.EditType[A.editType]:A.editType,r.oneofs&&(s._editType="editType")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.ScheduledCallEditMessage"},a.EditType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="CANCEL"]=1,A})(),a})(),t.SecretEncryptedMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.targetMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.encPayload=A.bytes();break}case 3:{c.encIv=A.bytes();break}case 4:{c.secretEncType=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.SecretEncryptedMessage)return A;var r=new d.proto.Message.SecretEncryptedMessage;if(A.targetMessageKey!=null){if(typeof A.targetMessageKey!="object")throw TypeError(".proto.Message.SecretEncryptedMessage.targetMessageKey: object expected");r.targetMessageKey=d.proto.MessageKey.fromObject(A.targetMessageKey)}switch(A.encPayload!=null&&(typeof A.encPayload=="string"?l.base64.decode(A.encPayload,r.encPayload=l.newBuffer(l.base64.length(A.encPayload)),0):A.encPayload.length>=0&&(r.encPayload=A.encPayload)),A.encIv!=null&&(typeof A.encIv=="string"?l.base64.decode(A.encIv,r.encIv=l.newBuffer(l.base64.length(A.encIv)),0):A.encIv.length>=0&&(r.encIv=A.encIv)),A.secretEncType){default:if(typeof A.secretEncType=="number"){r.secretEncType=A.secretEncType;break}break;case"UNKNOWN":case 0:r.secretEncType=0;break;case"EVENT_EDIT":case 1:r.secretEncType=1;break;case"MESSAGE_EDIT":case 2:r.secretEncType=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.targetMessageKey!=null&&A.hasOwnProperty("targetMessageKey")&&(s.targetMessageKey=d.proto.MessageKey.toObject(A.targetMessageKey,r),r.oneofs&&(s._targetMessageKey="targetMessageKey")),A.encPayload!=null&&A.hasOwnProperty("encPayload")&&(s.encPayload=r.bytes===String?l.base64.encode(A.encPayload,0,A.encPayload.length):r.bytes===Array?Array.prototype.slice.call(A.encPayload):A.encPayload,r.oneofs&&(s._encPayload="encPayload")),A.encIv!=null&&A.hasOwnProperty("encIv")&&(s.encIv=r.bytes===String?l.base64.encode(A.encIv,0,A.encIv.length):r.bytes===Array?Array.prototype.slice.call(A.encIv):A.encIv,r.oneofs&&(s._encIv="encIv")),A.secretEncType!=null&&A.hasOwnProperty("secretEncType")&&(s.secretEncType=r.enums===String?d.proto.Message.SecretEncryptedMessage.SecretEncType[A.secretEncType]===void 0?A.secretEncType:d.proto.Message.SecretEncryptedMessage.SecretEncType[A.secretEncType]:A.secretEncType,r.oneofs&&(s._secretEncType="secretEncType")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SecretEncryptedMessage"},a.SecretEncType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="EVENT_EDIT"]=1,A[i[2]="MESSAGE_EDIT"]=2,A})(),a})(),t.SendPaymentMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 2:{c.noteMessage=d.proto.Message.decode(A,A.uint32());break}case 3:{c.requestMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 4:{c.background=d.proto.PaymentBackground.decode(A,A.uint32());break}case 5:{c.transactionData=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.SendPaymentMessage)return A;var r=new d.proto.Message.SendPaymentMessage;if(A.noteMessage!=null){if(typeof A.noteMessage!="object")throw TypeError(".proto.Message.SendPaymentMessage.noteMessage: object expected");r.noteMessage=d.proto.Message.fromObject(A.noteMessage)}if(A.requestMessageKey!=null){if(typeof A.requestMessageKey!="object")throw TypeError(".proto.Message.SendPaymentMessage.requestMessageKey: object expected");r.requestMessageKey=d.proto.MessageKey.fromObject(A.requestMessageKey)}if(A.background!=null){if(typeof A.background!="object")throw TypeError(".proto.Message.SendPaymentMessage.background: object expected");r.background=d.proto.PaymentBackground.fromObject(A.background)}return A.transactionData!=null&&(r.transactionData=String(A.transactionData)),r},a.toObject=function(A,r){r||(r={});var s={};return A.noteMessage!=null&&A.hasOwnProperty("noteMessage")&&(s.noteMessage=d.proto.Message.toObject(A.noteMessage,r),r.oneofs&&(s._noteMessage="noteMessage")),A.requestMessageKey!=null&&A.hasOwnProperty("requestMessageKey")&&(s.requestMessageKey=d.proto.MessageKey.toObject(A.requestMessageKey,r),r.oneofs&&(s._requestMessageKey="requestMessageKey")),A.background!=null&&A.hasOwnProperty("background")&&(s.background=d.proto.PaymentBackground.toObject(A.background,r),r.oneofs&&(s._background="background")),A.transactionData!=null&&A.hasOwnProperty("transactionData")&&(s.transactionData=A.transactionData,r.oneofs&&(s._transactionData="transactionData")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SendPaymentMessage"},a})(),t.SenderKeyDistributionMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.groupId=A.string();break}case 2:{c.axolotlSenderKeyDistributionMessage=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.SenderKeyDistributionMessage)return A;var r=new d.proto.Message.SenderKeyDistributionMessage;return A.groupId!=null&&(r.groupId=String(A.groupId)),A.axolotlSenderKeyDistributionMessage!=null&&(typeof A.axolotlSenderKeyDistributionMessage=="string"?l.base64.decode(A.axolotlSenderKeyDistributionMessage,r.axolotlSenderKeyDistributionMessage=l.newBuffer(l.base64.length(A.axolotlSenderKeyDistributionMessage)),0):A.axolotlSenderKeyDistributionMessage.length>=0&&(r.axolotlSenderKeyDistributionMessage=A.axolotlSenderKeyDistributionMessage)),r},a.toObject=function(A,r){r||(r={});var s={};return A.groupId!=null&&A.hasOwnProperty("groupId")&&(s.groupId=A.groupId,r.oneofs&&(s._groupId="groupId")),A.axolotlSenderKeyDistributionMessage!=null&&A.hasOwnProperty("axolotlSenderKeyDistributionMessage")&&(s.axolotlSenderKeyDistributionMessage=r.bytes===String?l.base64.encode(A.axolotlSenderKeyDistributionMessage,0,A.axolotlSenderKeyDistributionMessage.length):r.bytes===Array?Array.prototype.slice.call(A.axolotlSenderKeyDistributionMessage):A.axolotlSenderKeyDistributionMessage,r.oneofs&&(s._axolotlSenderKeyDistributionMessage="axolotlSenderKeyDistributionMessage")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.SenderKeyDistributionMessage"},a})(),t.StatusNotificationMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.responseMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.originalMessageKey=d.proto.MessageKey.decode(A,A.uint32());break}case 3:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StatusNotificationMessage)return A;var r=new d.proto.Message.StatusNotificationMessage;if(A.responseMessageKey!=null){if(typeof A.responseMessageKey!="object")throw TypeError(".proto.Message.StatusNotificationMessage.responseMessageKey: object expected");r.responseMessageKey=d.proto.MessageKey.fromObject(A.responseMessageKey)}if(A.originalMessageKey!=null){if(typeof A.originalMessageKey!="object")throw TypeError(".proto.Message.StatusNotificationMessage.originalMessageKey: object expected");r.originalMessageKey=d.proto.MessageKey.fromObject(A.originalMessageKey)}switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"STATUS_ADD_YOURS":case 1:r.type=1;break;case"STATUS_RESHARE":case 2:r.type=2;break;case"STATUS_QUESTION_ANSWER_RESHARE":case 3:r.type=3;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.responseMessageKey!=null&&A.hasOwnProperty("responseMessageKey")&&(s.responseMessageKey=d.proto.MessageKey.toObject(A.responseMessageKey,r),r.oneofs&&(s._responseMessageKey="responseMessageKey")),A.originalMessageKey!=null&&A.hasOwnProperty("originalMessageKey")&&(s.originalMessageKey=d.proto.MessageKey.toObject(A.originalMessageKey,r),r.oneofs&&(s._originalMessageKey="originalMessageKey")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.StatusNotificationMessage.StatusNotificationType[A.type]===void 0?A.type:d.proto.Message.StatusNotificationMessage.StatusNotificationType[A.type]:A.type,r.oneofs&&(s._type="type")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusNotificationMessage"},a.StatusNotificationType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="STATUS_ADD_YOURS"]=1,A[i[2]="STATUS_RESHARE"]=2,A[i[3]="STATUS_QUESTION_ANSWER_RESHARE"]=3,A})(),a})(),t.StatusQuestionAnswerMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.text=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StatusQuestionAnswerMessage)return A;var r=new d.proto.Message.StatusQuestionAnswerMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.StatusQuestionAnswerMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}return A.text!=null&&(r.text=String(A.text)),r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusQuestionAnswerMessage"},a})(),t.StatusQuotedMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.type=A.int32();break}case 2:{c.text=A.string();break}case 3:{c.thumbnail=A.bytes();break}case 4:{c.originalStatusId=d.proto.MessageKey.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StatusQuotedMessage)return A;var r=new d.proto.Message.StatusQuotedMessage;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"QUESTION_ANSWER":case 1:r.type=1;break}if(A.text!=null&&(r.text=String(A.text)),A.thumbnail!=null&&(typeof A.thumbnail=="string"?l.base64.decode(A.thumbnail,r.thumbnail=l.newBuffer(l.base64.length(A.thumbnail)),0):A.thumbnail.length>=0&&(r.thumbnail=A.thumbnail)),A.originalStatusId!=null){if(typeof A.originalStatusId!="object")throw TypeError(".proto.Message.StatusQuotedMessage.originalStatusId: object expected");r.originalStatusId=d.proto.MessageKey.fromObject(A.originalStatusId)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.StatusQuotedMessage.StatusQuotedMessageType[A.type]===void 0?A.type:d.proto.Message.StatusQuotedMessage.StatusQuotedMessageType[A.type]:A.type,r.oneofs&&(s._type="type")),A.text!=null&&A.hasOwnProperty("text")&&(s.text=A.text,r.oneofs&&(s._text="text")),A.thumbnail!=null&&A.hasOwnProperty("thumbnail")&&(s.thumbnail=r.bytes===String?l.base64.encode(A.thumbnail,0,A.thumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.thumbnail):A.thumbnail,r.oneofs&&(s._thumbnail="thumbnail")),A.originalStatusId!=null&&A.hasOwnProperty("originalStatusId")&&(s.originalStatusId=d.proto.MessageKey.toObject(A.originalStatusId,r),r.oneofs&&(s._originalStatusId="originalStatusId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusQuotedMessage"},a.StatusQuotedMessageType=(function(){let i={},A=Object.create(i);return A[i[1]="QUESTION_ANSWER"]=1,A})(),a})(),t.StatusStickerInteractionMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.stickerKey=A.string();break}case 3:{c.type=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StatusStickerInteractionMessage)return A;var r=new d.proto.Message.StatusStickerInteractionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.Message.StatusStickerInteractionMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}switch(A.stickerKey!=null&&(r.stickerKey=String(A.stickerKey)),A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNKNOWN":case 0:r.type=0;break;case"REACTION":case 1:r.type=1;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.stickerKey!=null&&A.hasOwnProperty("stickerKey")&&(s.stickerKey=A.stickerKey,r.oneofs&&(s._stickerKey="stickerKey")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.Message.StatusStickerInteractionMessage.StatusStickerType[A.type]===void 0?A.type:d.proto.Message.StatusStickerInteractionMessage.StatusStickerType[A.type]:A.type,r.oneofs&&(s._type="type")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StatusStickerInteractionMessage"},a.StatusStickerType=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="REACTION"]=1,A})(),a})(),t.StickerMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.fileSha256=A.bytes();break}case 3:{c.fileEncSha256=A.bytes();break}case 4:{c.mediaKey=A.bytes();break}case 5:{c.mimetype=A.string();break}case 6:{c.height=A.uint32();break}case 7:{c.width=A.uint32();break}case 8:{c.directPath=A.string();break}case 9:{c.fileLength=A.uint64();break}case 10:{c.mediaKeyTimestamp=A.int64();break}case 11:{c.firstFrameLength=A.uint32();break}case 12:{c.firstFrameSidecar=A.bytes();break}case 13:{c.isAnimated=A.bool();break}case 16:{c.pngThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.stickerSentTs=A.int64();break}case 19:{c.isAvatar=A.bool();break}case 20:{c.isAiSticker=A.bool();break}case 21:{c.isLottie=A.bool();break}case 22:{c.accessibilityLabel=A.string();break}case 23:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StickerMessage)return A;var r=new d.proto.Message.StickerMessage;if(A.url!=null&&(r.url=String(A.url)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.directPath!=null&&(r.directPath=String(A.directPath)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.firstFrameLength!=null&&(r.firstFrameLength=A.firstFrameLength>>>0),A.firstFrameSidecar!=null&&(typeof A.firstFrameSidecar=="string"?l.base64.decode(A.firstFrameSidecar,r.firstFrameSidecar=l.newBuffer(l.base64.length(A.firstFrameSidecar)),0):A.firstFrameSidecar.length>=0&&(r.firstFrameSidecar=A.firstFrameSidecar)),A.isAnimated!=null&&(r.isAnimated=!!A.isAnimated),A.pngThumbnail!=null&&(typeof A.pngThumbnail=="string"?l.base64.decode(A.pngThumbnail,r.pngThumbnail=l.newBuffer(l.base64.length(A.pngThumbnail)),0):A.pngThumbnail.length>=0&&(r.pngThumbnail=A.pngThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.StickerMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.stickerSentTs!=null&&(l.Long?(r.stickerSentTs=l.Long.fromValue(A.stickerSentTs)).unsigned=!1:typeof A.stickerSentTs=="string"?r.stickerSentTs=parseInt(A.stickerSentTs,10):typeof A.stickerSentTs=="number"?r.stickerSentTs=A.stickerSentTs:typeof A.stickerSentTs=="object"&&(r.stickerSentTs=new l.LongBits(A.stickerSentTs.low>>>0,A.stickerSentTs.high>>>0).toNumber())),A.isAvatar!=null&&(r.isAvatar=!!A.isAvatar),A.isAiSticker!=null&&(r.isAiSticker=!!A.isAiSticker),A.isLottie!=null&&(r.isLottie=!!A.isLottie),A.accessibilityLabel!=null&&(r.accessibilityLabel=String(A.accessibilityLabel)),A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,r.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,r.oneofs&&(s._width="width")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.firstFrameLength!=null&&A.hasOwnProperty("firstFrameLength")&&(s.firstFrameLength=A.firstFrameLength,r.oneofs&&(s._firstFrameLength="firstFrameLength")),A.firstFrameSidecar!=null&&A.hasOwnProperty("firstFrameSidecar")&&(s.firstFrameSidecar=r.bytes===String?l.base64.encode(A.firstFrameSidecar,0,A.firstFrameSidecar.length):r.bytes===Array?Array.prototype.slice.call(A.firstFrameSidecar):A.firstFrameSidecar,r.oneofs&&(s._firstFrameSidecar="firstFrameSidecar")),A.isAnimated!=null&&A.hasOwnProperty("isAnimated")&&(s.isAnimated=A.isAnimated,r.oneofs&&(s._isAnimated="isAnimated")),A.pngThumbnail!=null&&A.hasOwnProperty("pngThumbnail")&&(s.pngThumbnail=r.bytes===String?l.base64.encode(A.pngThumbnail,0,A.pngThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.pngThumbnail):A.pngThumbnail,r.oneofs&&(s._pngThumbnail="pngThumbnail")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.stickerSentTs!=null&&A.hasOwnProperty("stickerSentTs")&&(typeof A.stickerSentTs=="number"?s.stickerSentTs=r.longs===String?String(A.stickerSentTs):A.stickerSentTs:s.stickerSentTs=r.longs===String?ge(A.stickerSentTs):r.longs===Number?ce(A.stickerSentTs):A.stickerSentTs,r.oneofs&&(s._stickerSentTs="stickerSentTs")),A.isAvatar!=null&&A.hasOwnProperty("isAvatar")&&(s.isAvatar=A.isAvatar,r.oneofs&&(s._isAvatar="isAvatar")),A.isAiSticker!=null&&A.hasOwnProperty("isAiSticker")&&(s.isAiSticker=A.isAiSticker,r.oneofs&&(s._isAiSticker="isAiSticker")),A.isLottie!=null&&A.hasOwnProperty("isLottie")&&(s.isLottie=A.isLottie,r.oneofs&&(s._isLottie="isLottie")),A.accessibilityLabel!=null&&A.hasOwnProperty("accessibilityLabel")&&(s.accessibilityLabel=A.accessibilityLabel,r.oneofs&&(s._accessibilityLabel="accessibilityLabel")),A.mediaKeyDomain!=null&&A.hasOwnProperty("mediaKeyDomain")&&(s.mediaKeyDomain=r.enums===String?d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]===void 0?A.mediaKeyDomain:d.proto.Message.MediaKeyDomain[A.mediaKeyDomain]:A.mediaKeyDomain,r.oneofs&&(s._mediaKeyDomain="mediaKeyDomain")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.StickerMessage"},a})(),t.StickerPackMessage=(function(){function a(i){if(this.stickers=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.stickerPackId=A.string();break}case 2:{c.name=A.string();break}case 3:{c.publisher=A.string();break}case 4:{c.stickers&&c.stickers.length||(c.stickers=[]),c.stickers.push(d.proto.Message.StickerPackMessage.Sticker.decode(A,A.uint32()));break}case 5:{c.fileLength=A.uint64();break}case 6:{c.fileSha256=A.bytes();break}case 7:{c.fileEncSha256=A.bytes();break}case 8:{c.mediaKey=A.bytes();break}case 9:{c.directPath=A.string();break}case 10:{c.caption=A.string();break}case 11:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 12:{c.packDescription=A.string();break}case 13:{c.mediaKeyTimestamp=A.int64();break}case 14:{c.trayIconFileName=A.string();break}case 15:{c.thumbnailDirectPath=A.string();break}case 16:{c.thumbnailSha256=A.bytes();break}case 17:{c.thumbnailEncSha256=A.bytes();break}case 18:{c.thumbnailHeight=A.uint32();break}case 19:{c.thumbnailWidth=A.uint32();break}case 20:{c.imageDataHash=A.string();break}case 21:{c.stickerPackSize=A.uint64();break}case 22:{c.stickerPackOrigin=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StickerPackMessage)return A;var r=new d.proto.Message.StickerPackMessage;if(A.stickerPackId!=null&&(r.stickerPackId=String(A.stickerPackId)),A.name!=null&&(r.name=String(A.name)),A.publisher!=null&&(r.publisher=String(A.publisher)),A.stickers){if(!Array.isArray(A.stickers))throw TypeError(".proto.Message.StickerPackMessage.stickers: array expected");r.stickers=[];for(var s=0;s>>0,A.fileLength.high>>>0).toNumber(!0))),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.directPath!=null&&(r.directPath=String(A.directPath)),A.caption!=null&&(r.caption=String(A.caption)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.StickerPackMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.packDescription!=null&&(r.packDescription=String(A.packDescription)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.trayIconFileName!=null&&(r.trayIconFileName=String(A.trayIconFileName)),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.thumbnailHeight!=null&&(r.thumbnailHeight=A.thumbnailHeight>>>0),A.thumbnailWidth!=null&&(r.thumbnailWidth=A.thumbnailWidth>>>0),A.imageDataHash!=null&&(r.imageDataHash=String(A.imageDataHash)),A.stickerPackSize!=null&&(l.Long?(r.stickerPackSize=l.Long.fromValue(A.stickerPackSize)).unsigned=!0:typeof A.stickerPackSize=="string"?r.stickerPackSize=parseInt(A.stickerPackSize,10):typeof A.stickerPackSize=="number"?r.stickerPackSize=A.stickerPackSize:typeof A.stickerPackSize=="object"&&(r.stickerPackSize=new l.LongBits(A.stickerPackSize.low>>>0,A.stickerPackSize.high>>>0).toNumber(!0))),A.stickerPackOrigin){default:if(typeof A.stickerPackOrigin=="number"){r.stickerPackOrigin=A.stickerPackOrigin;break}break;case"FIRST_PARTY":case 0:r.stickerPackOrigin=0;break;case"THIRD_PARTY":case 1:r.stickerPackOrigin=1;break;case"USER_CREATED":case 2:r.stickerPackOrigin=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.stickers=[]),A.stickerPackId!=null&&A.hasOwnProperty("stickerPackId")&&(s.stickerPackId=A.stickerPackId,r.oneofs&&(s._stickerPackId="stickerPackId")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.publisher!=null&&A.hasOwnProperty("publisher")&&(s.publisher=A.publisher,r.oneofs&&(s._publisher="publisher")),A.stickers&&A.stickers.length){s.stickers=[];for(var g=0;g>>3){case 1:{p.fileName=s.string();break}case 2:{p.isAnimated=s.bool();break}case 3:{p.emojis&&p.emojis.length||(p.emojis=[]),p.emojis.push(s.string());break}case 4:{p.accessibilityLabel=s.string();break}case 5:{p.isLottie=s.bool();break}case 6:{p.mimetype=s.string();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.StickerPackMessage.Sticker)return s;var g=new d.proto.Message.StickerPackMessage.Sticker;if(s.fileName!=null&&(g.fileName=String(s.fileName)),s.isAnimated!=null&&(g.isAnimated=!!s.isAnimated),s.emojis){if(!Array.isArray(s.emojis))throw TypeError(".proto.Message.StickerPackMessage.Sticker.emojis: array expected");g.emojis=[];for(var c=0;c>>3){case 1:{c.filehash&&c.filehash.length||(c.filehash=[]),c.filehash.push(A.string());break}case 2:{c.rmrSource=A.string();break}case 3:{c.requestTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.StickerSyncRMRMessage)return A;var r=new d.proto.Message.StickerSyncRMRMessage;if(A.filehash){if(!Array.isArray(A.filehash))throw TypeError(".proto.Message.StickerSyncRMRMessage.filehash: array expected");r.filehash=[];for(var s=0;s>>0,A.requestTimestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.filehash=[]),A.filehash&&A.filehash.length){s.filehash=[];for(var g=0;g>>3){case 1:{c.selectedId=A.string();break}case 2:{c.selectedDisplayText=A.string();break}case 3:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.selectedIndex=A.uint32();break}case 5:{c.selectedCarouselCardIndex=A.uint32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.TemplateButtonReplyMessage)return A;var r=new d.proto.Message.TemplateButtonReplyMessage;if(A.selectedId!=null&&(r.selectedId=String(A.selectedId)),A.selectedDisplayText!=null&&(r.selectedDisplayText=String(A.selectedDisplayText)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.TemplateButtonReplyMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}return A.selectedIndex!=null&&(r.selectedIndex=A.selectedIndex>>>0),A.selectedCarouselCardIndex!=null&&(r.selectedCarouselCardIndex=A.selectedCarouselCardIndex>>>0),r},a.toObject=function(A,r){r||(r={});var s={};return A.selectedId!=null&&A.hasOwnProperty("selectedId")&&(s.selectedId=A.selectedId,r.oneofs&&(s._selectedId="selectedId")),A.selectedDisplayText!=null&&A.hasOwnProperty("selectedDisplayText")&&(s.selectedDisplayText=A.selectedDisplayText,r.oneofs&&(s._selectedDisplayText="selectedDisplayText")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.selectedIndex!=null&&A.hasOwnProperty("selectedIndex")&&(s.selectedIndex=A.selectedIndex,r.oneofs&&(s._selectedIndex="selectedIndex")),A.selectedCarouselCardIndex!=null&&A.hasOwnProperty("selectedCarouselCardIndex")&&(s.selectedCarouselCardIndex=A.selectedCarouselCardIndex,r.oneofs&&(s._selectedCarouselCardIndex="selectedCarouselCardIndex")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.TemplateButtonReplyMessage"},a})(),t.TemplateMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 3:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 4:{c.hydratedTemplate=d.proto.Message.TemplateMessage.HydratedFourRowTemplate.decode(A,A.uint32());break}case 9:{c.templateId=A.string();break}case 1:{c.fourRowTemplate=d.proto.Message.TemplateMessage.FourRowTemplate.decode(A,A.uint32());break}case 2:{c.hydratedFourRowTemplate=d.proto.Message.TemplateMessage.HydratedFourRowTemplate.decode(A,A.uint32());break}case 5:{c.interactiveMessageTemplate=d.proto.Message.InteractiveMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.TemplateMessage)return A;var r=new d.proto.Message.TemplateMessage;if(A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.TemplateMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}if(A.hydratedTemplate!=null){if(typeof A.hydratedTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.hydratedTemplate: object expected");r.hydratedTemplate=d.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(A.hydratedTemplate)}if(A.templateId!=null&&(r.templateId=String(A.templateId)),A.fourRowTemplate!=null){if(typeof A.fourRowTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.fourRowTemplate: object expected");r.fourRowTemplate=d.proto.Message.TemplateMessage.FourRowTemplate.fromObject(A.fourRowTemplate)}if(A.hydratedFourRowTemplate!=null){if(typeof A.hydratedFourRowTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.hydratedFourRowTemplate: object expected");r.hydratedFourRowTemplate=d.proto.Message.TemplateMessage.HydratedFourRowTemplate.fromObject(A.hydratedFourRowTemplate)}if(A.interactiveMessageTemplate!=null){if(typeof A.interactiveMessageTemplate!="object")throw TypeError(".proto.Message.TemplateMessage.interactiveMessageTemplate: object expected");r.interactiveMessageTemplate=d.proto.Message.InteractiveMessage.fromObject(A.interactiveMessageTemplate)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.fourRowTemplate!=null&&A.hasOwnProperty("fourRowTemplate")&&(s.fourRowTemplate=d.proto.Message.TemplateMessage.FourRowTemplate.toObject(A.fourRowTemplate,r),r.oneofs&&(s.format="fourRowTemplate")),A.hydratedFourRowTemplate!=null&&A.hasOwnProperty("hydratedFourRowTemplate")&&(s.hydratedFourRowTemplate=d.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(A.hydratedFourRowTemplate,r),r.oneofs&&(s.format="hydratedFourRowTemplate")),A.contextInfo!=null&&A.hasOwnProperty("contextInfo")&&(s.contextInfo=d.proto.ContextInfo.toObject(A.contextInfo,r),r.oneofs&&(s._contextInfo="contextInfo")),A.hydratedTemplate!=null&&A.hasOwnProperty("hydratedTemplate")&&(s.hydratedTemplate=d.proto.Message.TemplateMessage.HydratedFourRowTemplate.toObject(A.hydratedTemplate,r),r.oneofs&&(s._hydratedTemplate="hydratedTemplate")),A.interactiveMessageTemplate!=null&&A.hasOwnProperty("interactiveMessageTemplate")&&(s.interactiveMessageTemplate=d.proto.Message.InteractiveMessage.toObject(A.interactiveMessageTemplate,r),r.oneofs&&(s.format="interactiveMessageTemplate")),A.templateId!=null&&A.hasOwnProperty("templateId")&&(s.templateId=A.templateId,r.oneofs&&(s._templateId="templateId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.TemplateMessage"},a.FourRowTemplate=(function(){function i(r){if(this.buttons=[],r)for(var s=Object.keys(r),g=0;g>>3){case 6:{p.content=d.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 7:{p.footer=d.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 8:{p.buttons&&p.buttons.length||(p.buttons=[]),p.buttons.push(d.proto.TemplateButton.decode(s,s.uint32()));break}case 1:{p.documentMessage=d.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 2:{p.highlyStructuredMessage=d.proto.Message.HighlyStructuredMessage.decode(s,s.uint32());break}case 3:{p.imageMessage=d.proto.Message.ImageMessage.decode(s,s.uint32());break}case 4:{p.videoMessage=d.proto.Message.VideoMessage.decode(s,s.uint32());break}case 5:{p.locationMessage=d.proto.Message.LocationMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.TemplateMessage.FourRowTemplate)return s;var g=new d.proto.Message.TemplateMessage.FourRowTemplate;if(s.content!=null){if(typeof s.content!="object")throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.content: object expected");g.content=d.proto.Message.HighlyStructuredMessage.fromObject(s.content)}if(s.footer!=null){if(typeof s.footer!="object")throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.footer: object expected");g.footer=d.proto.Message.HighlyStructuredMessage.fromObject(s.footer)}if(s.buttons){if(!Array.isArray(s.buttons))throw TypeError(".proto.Message.TemplateMessage.FourRowTemplate.buttons: array expected");g.buttons=[];for(var c=0;c>>3){case 6:{p.hydratedContentText=s.string();break}case 7:{p.hydratedFooterText=s.string();break}case 8:{p.hydratedButtons&&p.hydratedButtons.length||(p.hydratedButtons=[]),p.hydratedButtons.push(d.proto.HydratedTemplateButton.decode(s,s.uint32()));break}case 9:{p.templateId=s.string();break}case 10:{p.maskLinkedDevices=s.bool();break}case 1:{p.documentMessage=d.proto.Message.DocumentMessage.decode(s,s.uint32());break}case 2:{p.hydratedTitleText=s.string();break}case 3:{p.imageMessage=d.proto.Message.ImageMessage.decode(s,s.uint32());break}case 4:{p.videoMessage=d.proto.Message.VideoMessage.decode(s,s.uint32());break}case 5:{p.locationMessage=d.proto.Message.LocationMessage.decode(s,s.uint32());break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.Message.TemplateMessage.HydratedFourRowTemplate)return s;var g=new d.proto.Message.TemplateMessage.HydratedFourRowTemplate;if(s.hydratedContentText!=null&&(g.hydratedContentText=String(s.hydratedContentText)),s.hydratedFooterText!=null&&(g.hydratedFooterText=String(s.hydratedFooterText)),s.hydratedButtons){if(!Array.isArray(s.hydratedButtons))throw TypeError(".proto.Message.TemplateMessage.HydratedFourRowTemplate.hydratedButtons: array expected");g.hydratedButtons=[];for(var c=0;c>>3){case 1:{c.fbExperimentId=A.uint32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.URLMetadata)return A;var r=new d.proto.Message.URLMetadata;return A.fbExperimentId!=null&&(r.fbExperimentId=A.fbExperimentId>>>0),r},a.toObject=function(A,r){r||(r={});var s={};return A.fbExperimentId!=null&&A.hasOwnProperty("fbExperimentId")&&(s.fbExperimentId=A.fbExperimentId,r.oneofs&&(s._fbExperimentId="fbExperimentId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.Message.URLMetadata"},a})(),t.VideoEndCard=(function(){function a(e){if(e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.username=i.string();break}case 2:{g.caption=i.string();break}case 3:{g.thumbnailImageUrl=i.string();break}case 4:{g.profilePictureUrl=i.string();break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.Message.VideoEndCard)return i;var A=new d.proto.Message.VideoEndCard;return i.username!=null&&(A.username=String(i.username)),i.caption!=null&&(A.caption=String(i.caption)),i.thumbnailImageUrl!=null&&(A.thumbnailImageUrl=String(i.thumbnailImageUrl)),i.profilePictureUrl!=null&&(A.profilePictureUrl=String(i.profilePictureUrl)),A},a.toObject=function(i,A){A||(A={});var r={};return A.defaults&&(r.username="",r.caption="",r.thumbnailImageUrl="",r.profilePictureUrl=""),i.username!=null&&i.hasOwnProperty("username")&&(r.username=i.username),i.caption!=null&&i.hasOwnProperty("caption")&&(r.caption=i.caption),i.thumbnailImageUrl!=null&&i.hasOwnProperty("thumbnailImageUrl")&&(r.thumbnailImageUrl=i.thumbnailImageUrl),i.profilePictureUrl!=null&&i.hasOwnProperty("profilePictureUrl")&&(r.profilePictureUrl=i.profilePictureUrl),r},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.Message.VideoEndCard"},a})(),t.VideoMessage=(function(){function a(i){if(this.interactiveAnnotations=[],this.annotations=[],this.processedVideos=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.url=A.string();break}case 2:{c.mimetype=A.string();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileLength=A.uint64();break}case 5:{c.seconds=A.uint32();break}case 6:{c.mediaKey=A.bytes();break}case 7:{c.caption=A.string();break}case 8:{c.gifPlayback=A.bool();break}case 9:{c.height=A.uint32();break}case 10:{c.width=A.uint32();break}case 11:{c.fileEncSha256=A.bytes();break}case 12:{c.interactiveAnnotations&&c.interactiveAnnotations.length||(c.interactiveAnnotations=[]),c.interactiveAnnotations.push(d.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 13:{c.directPath=A.string();break}case 14:{c.mediaKeyTimestamp=A.int64();break}case 16:{c.jpegThumbnail=A.bytes();break}case 17:{c.contextInfo=d.proto.ContextInfo.decode(A,A.uint32());break}case 18:{c.streamingSidecar=A.bytes();break}case 19:{c.gifAttribution=A.int32();break}case 20:{c.viewOnce=A.bool();break}case 21:{c.thumbnailDirectPath=A.string();break}case 22:{c.thumbnailSha256=A.bytes();break}case 23:{c.thumbnailEncSha256=A.bytes();break}case 24:{c.staticUrl=A.string();break}case 25:{c.annotations&&c.annotations.length||(c.annotations=[]),c.annotations.push(d.proto.InteractiveAnnotation.decode(A,A.uint32()));break}case 26:{c.accessibilityLabel=A.string();break}case 27:{c.processedVideos&&c.processedVideos.length||(c.processedVideos=[]),c.processedVideos.push(d.proto.ProcessedVideo.decode(A,A.uint32()));break}case 28:{c.externalShareFullVideoDurationInSeconds=A.uint32();break}case 29:{c.motionPhotoPresentationOffsetMs=A.uint64();break}case 30:{c.metadataUrl=A.string();break}case 31:{c.videoSourceType=A.int32();break}case 32:{c.mediaKeyDomain=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.Message.VideoMessage)return A;var r=new d.proto.Message.VideoMessage;if(A.url!=null&&(r.url=String(A.url)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.seconds!=null&&(r.seconds=A.seconds>>>0),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.caption!=null&&(r.caption=String(A.caption)),A.gifPlayback!=null&&(r.gifPlayback=!!A.gifPlayback),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.interactiveAnnotations){if(!Array.isArray(A.interactiveAnnotations))throw TypeError(".proto.Message.VideoMessage.interactiveAnnotations: array expected");r.interactiveAnnotations=[];for(var s=0;s>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),A.contextInfo!=null){if(typeof A.contextInfo!="object")throw TypeError(".proto.Message.VideoMessage.contextInfo: object expected");r.contextInfo=d.proto.ContextInfo.fromObject(A.contextInfo)}switch(A.streamingSidecar!=null&&(typeof A.streamingSidecar=="string"?l.base64.decode(A.streamingSidecar,r.streamingSidecar=l.newBuffer(l.base64.length(A.streamingSidecar)),0):A.streamingSidecar.length>=0&&(r.streamingSidecar=A.streamingSidecar)),A.gifAttribution){default:if(typeof A.gifAttribution=="number"){r.gifAttribution=A.gifAttribution;break}break;case"NONE":case 0:r.gifAttribution=0;break;case"GIPHY":case 1:r.gifAttribution=1;break;case"TENOR":case 2:r.gifAttribution=2;break;case"KLIPY":case 3:r.gifAttribution=3;break}if(A.viewOnce!=null&&(r.viewOnce=!!A.viewOnce),A.thumbnailDirectPath!=null&&(r.thumbnailDirectPath=String(A.thumbnailDirectPath)),A.thumbnailSha256!=null&&(typeof A.thumbnailSha256=="string"?l.base64.decode(A.thumbnailSha256,r.thumbnailSha256=l.newBuffer(l.base64.length(A.thumbnailSha256)),0):A.thumbnailSha256.length>=0&&(r.thumbnailSha256=A.thumbnailSha256)),A.thumbnailEncSha256!=null&&(typeof A.thumbnailEncSha256=="string"?l.base64.decode(A.thumbnailEncSha256,r.thumbnailEncSha256=l.newBuffer(l.base64.length(A.thumbnailEncSha256)),0):A.thumbnailEncSha256.length>=0&&(r.thumbnailEncSha256=A.thumbnailEncSha256)),A.staticUrl!=null&&(r.staticUrl=String(A.staticUrl)),A.annotations){if(!Array.isArray(A.annotations))throw TypeError(".proto.Message.VideoMessage.annotations: array expected");r.annotations=[];for(var s=0;s>>0),A.motionPhotoPresentationOffsetMs!=null&&(l.Long?(r.motionPhotoPresentationOffsetMs=l.Long.fromValue(A.motionPhotoPresentationOffsetMs)).unsigned=!0:typeof A.motionPhotoPresentationOffsetMs=="string"?r.motionPhotoPresentationOffsetMs=parseInt(A.motionPhotoPresentationOffsetMs,10):typeof A.motionPhotoPresentationOffsetMs=="number"?r.motionPhotoPresentationOffsetMs=A.motionPhotoPresentationOffsetMs:typeof A.motionPhotoPresentationOffsetMs=="object"&&(r.motionPhotoPresentationOffsetMs=new l.LongBits(A.motionPhotoPresentationOffsetMs.low>>>0,A.motionPhotoPresentationOffsetMs.high>>>0).toNumber(!0))),A.metadataUrl!=null&&(r.metadataUrl=String(A.metadataUrl)),A.videoSourceType){default:if(typeof A.videoSourceType=="number"){r.videoSourceType=A.videoSourceType;break}break;case"USER_VIDEO":case 0:r.videoSourceType=0;break;case"AI_GENERATED":case 1:r.videoSourceType=1;break}switch(A.mediaKeyDomain){default:if(typeof A.mediaKeyDomain=="number"){r.mediaKeyDomain=A.mediaKeyDomain;break}break;case"UNSET":case 0:r.mediaKeyDomain=0;break;case"E2EE_CHAT":case 1:r.mediaKeyDomain=1;break;case"STATUS":case 2:r.mediaKeyDomain=2;break;case"CAPI":case 3:r.mediaKeyDomain=3;break;case"BOT":case 4:r.mediaKeyDomain=4;break}return r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.interactiveAnnotations=[],s.annotations=[],s.processedVideos=[]),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.seconds!=null&&A.hasOwnProperty("seconds")&&(s.seconds=A.seconds,r.oneofs&&(s._seconds="seconds")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.caption!=null&&A.hasOwnProperty("caption")&&(s.caption=A.caption,r.oneofs&&(s._caption="caption")),A.gifPlayback!=null&&A.hasOwnProperty("gifPlayback")&&(s.gifPlayback=A.gifPlayback,r.oneofs&&(s._gifPlayback="gifPlayback")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,r.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,r.oneofs&&(s._width="width")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.interactiveAnnotations&&A.interactiveAnnotations.length){s.interactiveAnnotations=[];for(var g=0;g>>3){case 1:{s.messageAddOnType=e.int32();break}case 2:{s.messageAddOn=d.proto.Message.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.status=e.int32();break}case 6:{s.addOnContextInfo=d.proto.MessageAddOnContextInfo.decode(e,e.uint32());break}case 7:{s.messageAddOnKey=d.proto.MessageKey.decode(e,e.uint32());break}case 8:{s.legacyMessage=d.proto.LegacyMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MessageAddOn)return e;var i=new d.proto.MessageAddOn;switch(e.messageAddOnType){default:if(typeof e.messageAddOnType=="number"){i.messageAddOnType=e.messageAddOnType;break}break;case"UNDEFINED":case 0:i.messageAddOnType=0;break;case"REACTION":case 1:i.messageAddOnType=1;break;case"EVENT_RESPONSE":case 2:i.messageAddOnType=2;break;case"POLL_UPDATE":case 3:i.messageAddOnType=3;break;case"PIN_IN_CHAT":case 4:i.messageAddOnType=4;break}if(e.messageAddOn!=null){if(typeof e.messageAddOn!="object")throw TypeError(".proto.MessageAddOn.messageAddOn: object expected");i.messageAddOn=d.proto.Message.fromObject(e.messageAddOn)}switch(e.senderTimestampMs!=null&&(l.Long?(i.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?i.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?i.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(i.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(i.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?i.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?i.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(i.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.status){default:if(typeof e.status=="number"){i.status=e.status;break}break;case"ERROR":case 0:i.status=0;break;case"PENDING":case 1:i.status=1;break;case"SERVER_ACK":case 2:i.status=2;break;case"DELIVERY_ACK":case 3:i.status=3;break;case"READ":case 4:i.status=4;break;case"PLAYED":case 5:i.status=5;break}if(e.addOnContextInfo!=null){if(typeof e.addOnContextInfo!="object")throw TypeError(".proto.MessageAddOn.addOnContextInfo: object expected");i.addOnContextInfo=d.proto.MessageAddOnContextInfo.fromObject(e.addOnContextInfo)}if(e.messageAddOnKey!=null){if(typeof e.messageAddOnKey!="object")throw TypeError(".proto.MessageAddOn.messageAddOnKey: object expected");i.messageAddOnKey=d.proto.MessageKey.fromObject(e.messageAddOnKey)}if(e.legacyMessage!=null){if(typeof e.legacyMessage!="object")throw TypeError(".proto.MessageAddOn.legacyMessage: object expected");i.legacyMessage=d.proto.LegacyMessage.fromObject(e.legacyMessage)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.messageAddOnType!=null&&e.hasOwnProperty("messageAddOnType")&&(A.messageAddOnType=i.enums===String?d.proto.MessageAddOn.MessageAddOnType[e.messageAddOnType]===void 0?e.messageAddOnType:d.proto.MessageAddOn.MessageAddOnType[e.messageAddOnType]:e.messageAddOnType,i.oneofs&&(A._messageAddOnType="messageAddOnType")),e.messageAddOn!=null&&e.hasOwnProperty("messageAddOn")&&(A.messageAddOn=d.proto.Message.toObject(e.messageAddOn,i),i.oneofs&&(A._messageAddOn="messageAddOn")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=i.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=i.longs===String?ge(e.senderTimestampMs):i.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,i.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=i.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=i.longs===String?ge(e.serverTimestampMs):i.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,i.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.status!=null&&e.hasOwnProperty("status")&&(A.status=i.enums===String?d.proto.WebMessageInfo.Status[e.status]===void 0?e.status:d.proto.WebMessageInfo.Status[e.status]:e.status,i.oneofs&&(A._status="status")),e.addOnContextInfo!=null&&e.hasOwnProperty("addOnContextInfo")&&(A.addOnContextInfo=d.proto.MessageAddOnContextInfo.toObject(e.addOnContextInfo,i),i.oneofs&&(A._addOnContextInfo="addOnContextInfo")),e.messageAddOnKey!=null&&e.hasOwnProperty("messageAddOnKey")&&(A.messageAddOnKey=d.proto.MessageKey.toObject(e.messageAddOnKey,i),i.oneofs&&(A._messageAddOnKey="messageAddOnKey")),e.legacyMessage!=null&&e.hasOwnProperty("legacyMessage")&&(A.legacyMessage=d.proto.LegacyMessage.toObject(e.legacyMessage,i),i.oneofs&&(A._legacyMessage="legacyMessage")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAddOn"},t.MessageAddOnType=(function(){let a={},e=Object.create(a);return e[a[0]="UNDEFINED"]=0,e[a[1]="REACTION"]=1,e[a[2]="EVENT_RESPONSE"]=2,e[a[3]="POLL_UPDATE"]=3,e[a[4]="PIN_IN_CHAT"]=4,e})(),t})(),n.MessageAddOnContextInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.messageAddOnDurationInSecs=e.uint32();break}case 2:{s.messageAddOnExpiryType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MessageAddOnContextInfo)return e;var i=new d.proto.MessageAddOnContextInfo;switch(e.messageAddOnDurationInSecs!=null&&(i.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs>>>0),e.messageAddOnExpiryType){default:if(typeof e.messageAddOnExpiryType=="number"){i.messageAddOnExpiryType=e.messageAddOnExpiryType;break}break;case"STATIC":case 1:i.messageAddOnExpiryType=1;break;case"DEPENDENT_ON_PARENT":case 2:i.messageAddOnExpiryType=2;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.messageAddOnDurationInSecs!=null&&e.hasOwnProperty("messageAddOnDurationInSecs")&&(A.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs,i.oneofs&&(A._messageAddOnDurationInSecs="messageAddOnDurationInSecs")),e.messageAddOnExpiryType!=null&&e.hasOwnProperty("messageAddOnExpiryType")&&(A.messageAddOnExpiryType=i.enums===String?d.proto.MessageContextInfo.MessageAddonExpiryType[e.messageAddOnExpiryType]===void 0?e.messageAddOnExpiryType:d.proto.MessageContextInfo.MessageAddonExpiryType[e.messageAddOnExpiryType]:e.messageAddOnExpiryType,i.oneofs&&(A._messageAddOnExpiryType="messageAddOnExpiryType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAddOnContextInfo"},t})(),n.MessageAssociation=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.associationType=e.int32();break}case 2:{s.parentMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 3:{s.messageIndex=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MessageAssociation)return e;var i=new d.proto.MessageAssociation;switch(e.associationType){default:if(typeof e.associationType=="number"){i.associationType=e.associationType;break}break;case"UNKNOWN":case 0:i.associationType=0;break;case"MEDIA_ALBUM":case 1:i.associationType=1;break;case"BOT_PLUGIN":case 2:i.associationType=2;break;case"EVENT_COVER_IMAGE":case 3:i.associationType=3;break;case"STATUS_POLL":case 4:i.associationType=4;break;case"HD_VIDEO_DUAL_UPLOAD":case 5:i.associationType=5;break;case"STATUS_EXTERNAL_RESHARE":case 6:i.associationType=6;break;case"MEDIA_POLL":case 7:i.associationType=7;break;case"STATUS_ADD_YOURS":case 8:i.associationType=8;break;case"STATUS_NOTIFICATION":case 9:i.associationType=9;break;case"HD_IMAGE_DUAL_UPLOAD":case 10:i.associationType=10;break;case"STICKER_ANNOTATION":case 11:i.associationType=11;break;case"MOTION_PHOTO":case 12:i.associationType=12;break;case"STATUS_LINK_ACTION":case 13:i.associationType=13;break;case"VIEW_ALL_REPLIES":case 14:i.associationType=14;break;case"STATUS_ADD_YOURS_AI_IMAGINE":case 15:i.associationType=15;break;case"STATUS_QUESTION":case 16:i.associationType=16;break;case"STATUS_ADD_YOURS_DIWALI":case 17:i.associationType=17;break;case"STATUS_REACTION":case 18:i.associationType=18;break;case"HEVC_VIDEO_DUAL_UPLOAD":case 19:i.associationType=19;break}if(e.parentMessageKey!=null){if(typeof e.parentMessageKey!="object")throw TypeError(".proto.MessageAssociation.parentMessageKey: object expected");i.parentMessageKey=d.proto.MessageKey.fromObject(e.parentMessageKey)}return e.messageIndex!=null&&(i.messageIndex=e.messageIndex|0),i},t.toObject=function(e,i){i||(i={});var A={};return e.associationType!=null&&e.hasOwnProperty("associationType")&&(A.associationType=i.enums===String?d.proto.MessageAssociation.AssociationType[e.associationType]===void 0?e.associationType:d.proto.MessageAssociation.AssociationType[e.associationType]:e.associationType,i.oneofs&&(A._associationType="associationType")),e.parentMessageKey!=null&&e.hasOwnProperty("parentMessageKey")&&(A.parentMessageKey=d.proto.MessageKey.toObject(e.parentMessageKey,i),i.oneofs&&(A._parentMessageKey="parentMessageKey")),e.messageIndex!=null&&e.hasOwnProperty("messageIndex")&&(A.messageIndex=e.messageIndex,i.oneofs&&(A._messageIndex="messageIndex")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageAssociation"},t.AssociationType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="MEDIA_ALBUM"]=1,e[a[2]="BOT_PLUGIN"]=2,e[a[3]="EVENT_COVER_IMAGE"]=3,e[a[4]="STATUS_POLL"]=4,e[a[5]="HD_VIDEO_DUAL_UPLOAD"]=5,e[a[6]="STATUS_EXTERNAL_RESHARE"]=6,e[a[7]="MEDIA_POLL"]=7,e[a[8]="STATUS_ADD_YOURS"]=8,e[a[9]="STATUS_NOTIFICATION"]=9,e[a[10]="HD_IMAGE_DUAL_UPLOAD"]=10,e[a[11]="STICKER_ANNOTATION"]=11,e[a[12]="MOTION_PHOTO"]=12,e[a[13]="STATUS_LINK_ACTION"]=13,e[a[14]="VIEW_ALL_REPLIES"]=14,e[a[15]="STATUS_ADD_YOURS_AI_IMAGINE"]=15,e[a[16]="STATUS_QUESTION"]=16,e[a[17]="STATUS_ADD_YOURS_DIWALI"]=17,e[a[18]="STATUS_REACTION"]=18,e[a[19]="HEVC_VIDEO_DUAL_UPLOAD"]=19,e})(),t})(),n.MessageContextInfo=(function(){function t(a){if(this.threadId=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.deviceListMetadata=d.proto.DeviceListMetadata.decode(e,e.uint32());break}case 2:{s.deviceListMetadataVersion=e.int32();break}case 3:{s.messageSecret=e.bytes();break}case 4:{s.paddingBytes=e.bytes();break}case 5:{s.messageAddOnDurationInSecs=e.uint32();break}case 6:{s.botMessageSecret=e.bytes();break}case 7:{s.botMetadata=d.proto.BotMetadata.decode(e,e.uint32());break}case 8:{s.reportingTokenVersion=e.int32();break}case 9:{s.messageAddOnExpiryType=e.int32();break}case 10:{s.messageAssociation=d.proto.MessageAssociation.decode(e,e.uint32());break}case 11:{s.capiCreatedGroup=e.bool();break}case 12:{s.supportPayload=e.string();break}case 13:{s.limitSharing=d.proto.LimitSharing.decode(e,e.uint32());break}case 14:{s.limitSharingV2=d.proto.LimitSharing.decode(e,e.uint32());break}case 15:{s.threadId&&s.threadId.length||(s.threadId=[]),s.threadId.push(d.proto.ThreadID.decode(e,e.uint32()));break}case 16:{s.weblinkRenderConfig=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MessageContextInfo)return e;var i=new d.proto.MessageContextInfo;if(e.deviceListMetadata!=null){if(typeof e.deviceListMetadata!="object")throw TypeError(".proto.MessageContextInfo.deviceListMetadata: object expected");i.deviceListMetadata=d.proto.DeviceListMetadata.fromObject(e.deviceListMetadata)}if(e.deviceListMetadataVersion!=null&&(i.deviceListMetadataVersion=e.deviceListMetadataVersion|0),e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,i.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(i.messageSecret=e.messageSecret)),e.paddingBytes!=null&&(typeof e.paddingBytes=="string"?l.base64.decode(e.paddingBytes,i.paddingBytes=l.newBuffer(l.base64.length(e.paddingBytes)),0):e.paddingBytes.length>=0&&(i.paddingBytes=e.paddingBytes)),e.messageAddOnDurationInSecs!=null&&(i.messageAddOnDurationInSecs=e.messageAddOnDurationInSecs>>>0),e.botMessageSecret!=null&&(typeof e.botMessageSecret=="string"?l.base64.decode(e.botMessageSecret,i.botMessageSecret=l.newBuffer(l.base64.length(e.botMessageSecret)),0):e.botMessageSecret.length>=0&&(i.botMessageSecret=e.botMessageSecret)),e.botMetadata!=null){if(typeof e.botMetadata!="object")throw TypeError(".proto.MessageContextInfo.botMetadata: object expected");i.botMetadata=d.proto.BotMetadata.fromObject(e.botMetadata)}switch(e.reportingTokenVersion!=null&&(i.reportingTokenVersion=e.reportingTokenVersion|0),e.messageAddOnExpiryType){default:if(typeof e.messageAddOnExpiryType=="number"){i.messageAddOnExpiryType=e.messageAddOnExpiryType;break}break;case"STATIC":case 1:i.messageAddOnExpiryType=1;break;case"DEPENDENT_ON_PARENT":case 2:i.messageAddOnExpiryType=2;break}if(e.messageAssociation!=null){if(typeof e.messageAssociation!="object")throw TypeError(".proto.MessageContextInfo.messageAssociation: object expected");i.messageAssociation=d.proto.MessageAssociation.fromObject(e.messageAssociation)}if(e.capiCreatedGroup!=null&&(i.capiCreatedGroup=!!e.capiCreatedGroup),e.supportPayload!=null&&(i.supportPayload=String(e.supportPayload)),e.limitSharing!=null){if(typeof e.limitSharing!="object")throw TypeError(".proto.MessageContextInfo.limitSharing: object expected");i.limitSharing=d.proto.LimitSharing.fromObject(e.limitSharing)}if(e.limitSharingV2!=null){if(typeof e.limitSharingV2!="object")throw TypeError(".proto.MessageContextInfo.limitSharingV2: object expected");i.limitSharingV2=d.proto.LimitSharing.fromObject(e.limitSharingV2)}if(e.threadId){if(!Array.isArray(e.threadId))throw TypeError(".proto.MessageContextInfo.threadId: array expected");i.threadId=[];for(var A=0;A>>3){case 1:{s.remoteJid=e.string();break}case 2:{s.fromMe=e.bool();break}case 3:{s.id=e.string();break}case 4:{s.participant=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MessageKey)return e;var i=new d.proto.MessageKey;return e.remoteJid!=null&&(i.remoteJid=String(e.remoteJid)),e.fromMe!=null&&(i.fromMe=!!e.fromMe),e.id!=null&&(i.id=String(e.id)),e.participant!=null&&(i.participant=String(e.participant)),i},t.toObject=function(e,i){i||(i={});var A={};return e.remoteJid!=null&&e.hasOwnProperty("remoteJid")&&(A.remoteJid=e.remoteJid,i.oneofs&&(A._remoteJid="remoteJid")),e.fromMe!=null&&e.hasOwnProperty("fromMe")&&(A.fromMe=e.fromMe,i.oneofs&&(A._fromMe="fromMe")),e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,i.oneofs&&(A._participant="participant")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageKey"},t})(),n.MessageSecretMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.version=e.sfixed32();break}case 2:{s.encIv=e.bytes();break}case 3:{s.encPayload=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MessageSecretMessage)return e;var i=new d.proto.MessageSecretMessage;return e.version!=null&&(i.version=e.version|0),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,i.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(i.encIv=e.encIv)),e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,i.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(i.encPayload=e.encPayload)),i},t.toObject=function(e,i){i||(i={});var A={};return e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,i.oneofs&&(A._version="version")),e.encIv!=null&&e.hasOwnProperty("encIv")&&(A.encIv=i.bytes===String?l.base64.encode(e.encIv,0,e.encIv.length):i.bytes===Array?Array.prototype.slice.call(e.encIv):e.encIv,i.oneofs&&(A._encIv="encIv")),e.encPayload!=null&&e.hasOwnProperty("encPayload")&&(A.encPayload=i.bytes===String?l.base64.encode(e.encPayload,0,e.encPayload.length):i.bytes===Array?Array.prototype.slice.call(e.encPayload):e.encPayload,i.oneofs&&(A._encPayload="encPayload")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MessageSecretMessage"},t})(),n.Money=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.value=e.int64();break}case 2:{s.offset=e.uint32();break}case 3:{s.currencyCode=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Money)return e;var i=new d.proto.Money;return e.value!=null&&(l.Long?(i.value=l.Long.fromValue(e.value)).unsigned=!1:typeof e.value=="string"?i.value=parseInt(e.value,10):typeof e.value=="number"?i.value=e.value:typeof e.value=="object"&&(i.value=new l.LongBits(e.value.low>>>0,e.value.high>>>0).toNumber())),e.offset!=null&&(i.offset=e.offset>>>0),e.currencyCode!=null&&(i.currencyCode=String(e.currencyCode)),i},t.toObject=function(e,i){i||(i={});var A={};return e.value!=null&&e.hasOwnProperty("value")&&(typeof e.value=="number"?A.value=i.longs===String?String(e.value):e.value:A.value=i.longs===String?ge(e.value):i.longs===Number?ce(e.value):e.value,i.oneofs&&(A._value="value")),e.offset!=null&&e.hasOwnProperty("offset")&&(A.offset=e.offset,i.oneofs&&(A._offset="offset")),e.currencyCode!=null&&e.hasOwnProperty("currencyCode")&&(A.currencyCode=e.currencyCode,i.oneofs&&(A._currencyCode="currencyCode")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Money"},t})(),n.MsgOpaqueData=(function(){function t(a){if(this.pollOptions=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.body=e.string();break}case 3:{s.caption=e.string();break}case 5:{s.lng=e.double();break}case 6:{s.isLive=e.bool();break}case 7:{s.lat=e.double();break}case 8:{s.paymentAmount1000=e.int32();break}case 9:{s.paymentNoteMsgBody=e.string();break}case 11:{s.matchedText=e.string();break}case 12:{s.title=e.string();break}case 13:{s.description=e.string();break}case 14:{s.futureproofBuffer=e.bytes();break}case 15:{s.clientUrl=e.string();break}case 16:{s.loc=e.string();break}case 17:{s.pollName=e.string();break}case 18:{s.pollOptions&&s.pollOptions.length||(s.pollOptions=[]),s.pollOptions.push(d.proto.MsgOpaqueData.PollOption.decode(e,e.uint32()));break}case 20:{s.pollSelectableOptionsCount=e.uint32();break}case 21:{s.messageSecret=e.bytes();break}case 51:{s.originalSelfAuthor=e.string();break}case 22:{s.senderTimestampMs=e.int64();break}case 23:{s.pollUpdateParentKey=e.string();break}case 24:{s.encPollVote=d.proto.PollEncValue.decode(e,e.uint32());break}case 28:{s.isSentCagPollCreation=e.bool();break}case 42:{s.pollContentType=e.int32();break}case 46:{s.pollType=e.int32();break}case 47:{s.correctOptionIndex=e.int32();break}case 41:{s.pollVotesSnapshot=d.proto.MsgOpaqueData.PollVotesSnapshot.decode(e,e.uint32());break}case 25:{s.encReactionTargetMessageKey=e.string();break}case 26:{s.encReactionEncPayload=e.bytes();break}case 27:{s.encReactionEncIv=e.bytes();break}case 29:{s.botMessageSecret=e.bytes();break}case 30:{s.targetMessageKey=e.string();break}case 31:{s.encPayload=e.bytes();break}case 32:{s.encIv=e.bytes();break}case 33:{s.eventName=e.string();break}case 34:{s.isEventCanceled=e.bool();break}case 35:{s.eventDescription=e.string();break}case 36:{s.eventJoinLink=e.string();break}case 37:{s.eventStartTime=e.int64();break}case 38:{s.eventLocation=d.proto.MsgOpaqueData.EventLocation.decode(e,e.uint32());break}case 40:{s.eventEndTime=e.int64();break}case 44:{s.eventIsScheduledCall=e.bool();break}case 45:{s.eventExtraGuestsAllowed=e.bool();break}case 43:{s.plainProtobufBytes=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MsgOpaqueData)return e;var i=new d.proto.MsgOpaqueData;if(e.body!=null&&(i.body=String(e.body)),e.caption!=null&&(i.caption=String(e.caption)),e.lng!=null&&(i.lng=Number(e.lng)),e.isLive!=null&&(i.isLive=!!e.isLive),e.lat!=null&&(i.lat=Number(e.lat)),e.paymentAmount1000!=null&&(i.paymentAmount1000=e.paymentAmount1000|0),e.paymentNoteMsgBody!=null&&(i.paymentNoteMsgBody=String(e.paymentNoteMsgBody)),e.matchedText!=null&&(i.matchedText=String(e.matchedText)),e.title!=null&&(i.title=String(e.title)),e.description!=null&&(i.description=String(e.description)),e.futureproofBuffer!=null&&(typeof e.futureproofBuffer=="string"?l.base64.decode(e.futureproofBuffer,i.futureproofBuffer=l.newBuffer(l.base64.length(e.futureproofBuffer)),0):e.futureproofBuffer.length>=0&&(i.futureproofBuffer=e.futureproofBuffer)),e.clientUrl!=null&&(i.clientUrl=String(e.clientUrl)),e.loc!=null&&(i.loc=String(e.loc)),e.pollName!=null&&(i.pollName=String(e.pollName)),e.pollOptions){if(!Array.isArray(e.pollOptions))throw TypeError(".proto.MsgOpaqueData.pollOptions: array expected");i.pollOptions=[];for(var A=0;A>>0),e.messageSecret!=null&&(typeof e.messageSecret=="string"?l.base64.decode(e.messageSecret,i.messageSecret=l.newBuffer(l.base64.length(e.messageSecret)),0):e.messageSecret.length>=0&&(i.messageSecret=e.messageSecret)),e.originalSelfAuthor!=null&&(i.originalSelfAuthor=String(e.originalSelfAuthor)),e.senderTimestampMs!=null&&(l.Long?(i.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?i.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?i.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(i.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.pollUpdateParentKey!=null&&(i.pollUpdateParentKey=String(e.pollUpdateParentKey)),e.encPollVote!=null){if(typeof e.encPollVote!="object")throw TypeError(".proto.MsgOpaqueData.encPollVote: object expected");i.encPollVote=d.proto.PollEncValue.fromObject(e.encPollVote)}switch(e.isSentCagPollCreation!=null&&(i.isSentCagPollCreation=!!e.isSentCagPollCreation),e.pollContentType){default:if(typeof e.pollContentType=="number"){i.pollContentType=e.pollContentType;break}break;case"UNKNOWN":case 0:i.pollContentType=0;break;case"TEXT":case 1:i.pollContentType=1;break;case"IMAGE":case 2:i.pollContentType=2;break}switch(e.pollType){default:if(typeof e.pollType=="number"){i.pollType=e.pollType;break}break;case"POLL":case 0:i.pollType=0;break;case"QUIZ":case 1:i.pollType=1;break}if(e.correctOptionIndex!=null&&(i.correctOptionIndex=e.correctOptionIndex|0),e.pollVotesSnapshot!=null){if(typeof e.pollVotesSnapshot!="object")throw TypeError(".proto.MsgOpaqueData.pollVotesSnapshot: object expected");i.pollVotesSnapshot=d.proto.MsgOpaqueData.PollVotesSnapshot.fromObject(e.pollVotesSnapshot)}if(e.encReactionTargetMessageKey!=null&&(i.encReactionTargetMessageKey=String(e.encReactionTargetMessageKey)),e.encReactionEncPayload!=null&&(typeof e.encReactionEncPayload=="string"?l.base64.decode(e.encReactionEncPayload,i.encReactionEncPayload=l.newBuffer(l.base64.length(e.encReactionEncPayload)),0):e.encReactionEncPayload.length>=0&&(i.encReactionEncPayload=e.encReactionEncPayload)),e.encReactionEncIv!=null&&(typeof e.encReactionEncIv=="string"?l.base64.decode(e.encReactionEncIv,i.encReactionEncIv=l.newBuffer(l.base64.length(e.encReactionEncIv)),0):e.encReactionEncIv.length>=0&&(i.encReactionEncIv=e.encReactionEncIv)),e.botMessageSecret!=null&&(typeof e.botMessageSecret=="string"?l.base64.decode(e.botMessageSecret,i.botMessageSecret=l.newBuffer(l.base64.length(e.botMessageSecret)),0):e.botMessageSecret.length>=0&&(i.botMessageSecret=e.botMessageSecret)),e.targetMessageKey!=null&&(i.targetMessageKey=String(e.targetMessageKey)),e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,i.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(i.encPayload=e.encPayload)),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,i.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(i.encIv=e.encIv)),e.eventName!=null&&(i.eventName=String(e.eventName)),e.isEventCanceled!=null&&(i.isEventCanceled=!!e.isEventCanceled),e.eventDescription!=null&&(i.eventDescription=String(e.eventDescription)),e.eventJoinLink!=null&&(i.eventJoinLink=String(e.eventJoinLink)),e.eventStartTime!=null&&(l.Long?(i.eventStartTime=l.Long.fromValue(e.eventStartTime)).unsigned=!1:typeof e.eventStartTime=="string"?i.eventStartTime=parseInt(e.eventStartTime,10):typeof e.eventStartTime=="number"?i.eventStartTime=e.eventStartTime:typeof e.eventStartTime=="object"&&(i.eventStartTime=new l.LongBits(e.eventStartTime.low>>>0,e.eventStartTime.high>>>0).toNumber())),e.eventLocation!=null){if(typeof e.eventLocation!="object")throw TypeError(".proto.MsgOpaqueData.eventLocation: object expected");i.eventLocation=d.proto.MsgOpaqueData.EventLocation.fromObject(e.eventLocation)}return e.eventEndTime!=null&&(l.Long?(i.eventEndTime=l.Long.fromValue(e.eventEndTime)).unsigned=!1:typeof e.eventEndTime=="string"?i.eventEndTime=parseInt(e.eventEndTime,10):typeof e.eventEndTime=="number"?i.eventEndTime=e.eventEndTime:typeof e.eventEndTime=="object"&&(i.eventEndTime=new l.LongBits(e.eventEndTime.low>>>0,e.eventEndTime.high>>>0).toNumber())),e.eventIsScheduledCall!=null&&(i.eventIsScheduledCall=!!e.eventIsScheduledCall),e.eventExtraGuestsAllowed!=null&&(i.eventExtraGuestsAllowed=!!e.eventExtraGuestsAllowed),e.plainProtobufBytes!=null&&(typeof e.plainProtobufBytes=="string"?l.base64.decode(e.plainProtobufBytes,i.plainProtobufBytes=l.newBuffer(l.base64.length(e.plainProtobufBytes)),0):e.plainProtobufBytes.length>=0&&(i.plainProtobufBytes=e.plainProtobufBytes)),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.pollOptions=[]),e.body!=null&&e.hasOwnProperty("body")&&(A.body=e.body,i.oneofs&&(A._body="body")),e.caption!=null&&e.hasOwnProperty("caption")&&(A.caption=e.caption,i.oneofs&&(A._caption="caption")),e.lng!=null&&e.hasOwnProperty("lng")&&(A.lng=i.json&&!isFinite(e.lng)?String(e.lng):e.lng,i.oneofs&&(A._lng="lng")),e.isLive!=null&&e.hasOwnProperty("isLive")&&(A.isLive=e.isLive,i.oneofs&&(A._isLive="isLive")),e.lat!=null&&e.hasOwnProperty("lat")&&(A.lat=i.json&&!isFinite(e.lat)?String(e.lat):e.lat,i.oneofs&&(A._lat="lat")),e.paymentAmount1000!=null&&e.hasOwnProperty("paymentAmount1000")&&(A.paymentAmount1000=e.paymentAmount1000,i.oneofs&&(A._paymentAmount1000="paymentAmount1000")),e.paymentNoteMsgBody!=null&&e.hasOwnProperty("paymentNoteMsgBody")&&(A.paymentNoteMsgBody=e.paymentNoteMsgBody,i.oneofs&&(A._paymentNoteMsgBody="paymentNoteMsgBody")),e.matchedText!=null&&e.hasOwnProperty("matchedText")&&(A.matchedText=e.matchedText,i.oneofs&&(A._matchedText="matchedText")),e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,i.oneofs&&(A._title="title")),e.description!=null&&e.hasOwnProperty("description")&&(A.description=e.description,i.oneofs&&(A._description="description")),e.futureproofBuffer!=null&&e.hasOwnProperty("futureproofBuffer")&&(A.futureproofBuffer=i.bytes===String?l.base64.encode(e.futureproofBuffer,0,e.futureproofBuffer.length):i.bytes===Array?Array.prototype.slice.call(e.futureproofBuffer):e.futureproofBuffer,i.oneofs&&(A._futureproofBuffer="futureproofBuffer")),e.clientUrl!=null&&e.hasOwnProperty("clientUrl")&&(A.clientUrl=e.clientUrl,i.oneofs&&(A._clientUrl="clientUrl")),e.loc!=null&&e.hasOwnProperty("loc")&&(A.loc=e.loc,i.oneofs&&(A._loc="loc")),e.pollName!=null&&e.hasOwnProperty("pollName")&&(A.pollName=e.pollName,i.oneofs&&(A._pollName="pollName")),e.pollOptions&&e.pollOptions.length){A.pollOptions=[];for(var r=0;r>>3){case 1:{c.degreesLatitude=A.double();break}case 2:{c.degreesLongitude=A.double();break}case 3:{c.name=A.string();break}case 4:{c.address=A.string();break}case 5:{c.url=A.string();break}case 6:{c.jpegThumbnail=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.MsgOpaqueData.EventLocation)return A;var r=new d.proto.MsgOpaqueData.EventLocation;return A.degreesLatitude!=null&&(r.degreesLatitude=Number(A.degreesLatitude)),A.degreesLongitude!=null&&(r.degreesLongitude=Number(A.degreesLongitude)),A.name!=null&&(r.name=String(A.name)),A.address!=null&&(r.address=String(A.address)),A.url!=null&&(r.url=String(A.url)),A.jpegThumbnail!=null&&(typeof A.jpegThumbnail=="string"?l.base64.decode(A.jpegThumbnail,r.jpegThumbnail=l.newBuffer(l.base64.length(A.jpegThumbnail)),0):A.jpegThumbnail.length>=0&&(r.jpegThumbnail=A.jpegThumbnail)),r},a.toObject=function(A,r){r||(r={});var s={};return A.degreesLatitude!=null&&A.hasOwnProperty("degreesLatitude")&&(s.degreesLatitude=r.json&&!isFinite(A.degreesLatitude)?String(A.degreesLatitude):A.degreesLatitude,r.oneofs&&(s._degreesLatitude="degreesLatitude")),A.degreesLongitude!=null&&A.hasOwnProperty("degreesLongitude")&&(s.degreesLongitude=r.json&&!isFinite(A.degreesLongitude)?String(A.degreesLongitude):A.degreesLongitude,r.oneofs&&(s._degreesLongitude="degreesLongitude")),A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.address!=null&&A.hasOwnProperty("address")&&(s.address=A.address,r.oneofs&&(s._address="address")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.jpegThumbnail!=null&&A.hasOwnProperty("jpegThumbnail")&&(s.jpegThumbnail=r.bytes===String?l.base64.encode(A.jpegThumbnail,0,A.jpegThumbnail.length):r.bytes===Array?Array.prototype.slice.call(A.jpegThumbnail):A.jpegThumbnail,r.oneofs&&(s._jpegThumbnail="jpegThumbnail")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.EventLocation"},a})(),t.PollContentType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="TEXT"]=1,e[a[2]="IMAGE"]=2,e})(),t.PollOption=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.hash=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.MsgOpaqueData.PollOption)return A;var r=new d.proto.MsgOpaqueData.PollOption;return A.name!=null&&(r.name=String(A.name)),A.hash!=null&&(r.hash=String(A.hash)),r},a.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.hash!=null&&A.hasOwnProperty("hash")&&(s.hash=A.hash,r.oneofs&&(s._hash="hash")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.PollOption"},a})(),t.PollType=(function(){let a={},e=Object.create(a);return e[a[0]="POLL"]=0,e[a[1]="QUIZ"]=1,e})(),t.PollVoteSnapshot=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.option=d.proto.MsgOpaqueData.PollOption.decode(A,A.uint32());break}case 2:{c.optionVoteCount=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.MsgOpaqueData.PollVoteSnapshot)return A;var r=new d.proto.MsgOpaqueData.PollVoteSnapshot;if(A.option!=null){if(typeof A.option!="object")throw TypeError(".proto.MsgOpaqueData.PollVoteSnapshot.option: object expected");r.option=d.proto.MsgOpaqueData.PollOption.fromObject(A.option)}return A.optionVoteCount!=null&&(r.optionVoteCount=A.optionVoteCount|0),r},a.toObject=function(A,r){r||(r={});var s={};return A.option!=null&&A.hasOwnProperty("option")&&(s.option=d.proto.MsgOpaqueData.PollOption.toObject(A.option,r),r.oneofs&&(s._option="option")),A.optionVoteCount!=null&&A.hasOwnProperty("optionVoteCount")&&(s.optionVoteCount=A.optionVoteCount,r.oneofs&&(s._optionVoteCount="optionVoteCount")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.MsgOpaqueData.PollVoteSnapshot"},a})(),t.PollVotesSnapshot=(function(){function a(e){if(this.pollVotes=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.pollVotes&&g.pollVotes.length||(g.pollVotes=[]),g.pollVotes.push(d.proto.MsgOpaqueData.PollVoteSnapshot.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.MsgOpaqueData.PollVotesSnapshot)return i;var A=new d.proto.MsgOpaqueData.PollVotesSnapshot;if(i.pollVotes){if(!Array.isArray(i.pollVotes))throw TypeError(".proto.MsgOpaqueData.PollVotesSnapshot.pollVotes: array expected");A.pollVotes=[];for(var r=0;r>>3){case 1:{s.currentMsg=d.proto.MsgOpaqueData.decode(e,e.uint32());break}case 2:{s.quotedMsg=d.proto.MsgOpaqueData.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.MsgRowOpaqueData)return e;var i=new d.proto.MsgRowOpaqueData;if(e.currentMsg!=null){if(typeof e.currentMsg!="object")throw TypeError(".proto.MsgRowOpaqueData.currentMsg: object expected");i.currentMsg=d.proto.MsgOpaqueData.fromObject(e.currentMsg)}if(e.quotedMsg!=null){if(typeof e.quotedMsg!="object")throw TypeError(".proto.MsgRowOpaqueData.quotedMsg: object expected");i.quotedMsg=d.proto.MsgOpaqueData.fromObject(e.quotedMsg)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.currentMsg!=null&&e.hasOwnProperty("currentMsg")&&(A.currentMsg=d.proto.MsgOpaqueData.toObject(e.currentMsg,i),i.oneofs&&(A._currentMsg="currentMsg")),e.quotedMsg!=null&&e.hasOwnProperty("quotedMsg")&&(A.quotedMsg=d.proto.MsgOpaqueData.toObject(e.quotedMsg,i),i.oneofs&&(A._quotedMsg="quotedMsg")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.MsgRowOpaqueData"},t})(),n.MutationProps=(function(){let t={},o=Object.create(t);return o[t[2]="STAR_ACTION"]=2,o[t[3]="CONTACT_ACTION"]=3,o[t[4]="MUTE_ACTION"]=4,o[t[5]="PIN_ACTION"]=5,o[t[6]="SECURITY_NOTIFICATION_SETTING"]=6,o[t[7]="PUSH_NAME_SETTING"]=7,o[t[8]="QUICK_REPLY_ACTION"]=8,o[t[11]="RECENT_EMOJI_WEIGHTS_ACTION"]=11,o[t[13]="LABEL_MESSAGE_ACTION"]=13,o[t[14]="LABEL_EDIT_ACTION"]=14,o[t[15]="LABEL_ASSOCIATION_ACTION"]=15,o[t[16]="LOCALE_SETTING"]=16,o[t[17]="ARCHIVE_CHAT_ACTION"]=17,o[t[18]="DELETE_MESSAGE_FOR_ME_ACTION"]=18,o[t[19]="KEY_EXPIRATION"]=19,o[t[20]="MARK_CHAT_AS_READ_ACTION"]=20,o[t[21]="CLEAR_CHAT_ACTION"]=21,o[t[22]="DELETE_CHAT_ACTION"]=22,o[t[23]="UNARCHIVE_CHATS_SETTING"]=23,o[t[24]="PRIMARY_FEATURE"]=24,o[t[26]="ANDROID_UNSUPPORTED_ACTIONS"]=26,o[t[27]="AGENT_ACTION"]=27,o[t[28]="SUBSCRIPTION_ACTION"]=28,o[t[29]="USER_STATUS_MUTE_ACTION"]=29,o[t[30]="TIME_FORMAT_ACTION"]=30,o[t[31]="NUX_ACTION"]=31,o[t[32]="PRIMARY_VERSION_ACTION"]=32,o[t[33]="STICKER_ACTION"]=33,o[t[34]="REMOVE_RECENT_STICKER_ACTION"]=34,o[t[35]="CHAT_ASSIGNMENT"]=35,o[t[36]="CHAT_ASSIGNMENT_OPENED_STATUS"]=36,o[t[37]="PN_FOR_LID_CHAT_ACTION"]=37,o[t[38]="MARKETING_MESSAGE_ACTION"]=38,o[t[39]="MARKETING_MESSAGE_BROADCAST_ACTION"]=39,o[t[40]="EXTERNAL_WEB_BETA_ACTION"]=40,o[t[41]="PRIVACY_SETTING_RELAY_ALL_CALLS"]=41,o[t[42]="CALL_LOG_ACTION"]=42,o[t[43]="UGC_BOT"]=43,o[t[44]="STATUS_PRIVACY"]=44,o[t[45]="BOT_WELCOME_REQUEST_ACTION"]=45,o[t[46]="DELETE_INDIVIDUAL_CALL_LOG"]=46,o[t[47]="LABEL_REORDERING_ACTION"]=47,o[t[48]="PAYMENT_INFO_ACTION"]=48,o[t[49]="CUSTOM_PAYMENT_METHODS_ACTION"]=49,o[t[50]="LOCK_CHAT_ACTION"]=50,o[t[51]="CHAT_LOCK_SETTINGS"]=51,o[t[52]="WAMO_USER_IDENTIFIER_ACTION"]=52,o[t[53]="PRIVACY_SETTING_DISABLE_LINK_PREVIEWS_ACTION"]=53,o[t[54]="DEVICE_CAPABILITIES"]=54,o[t[55]="NOTE_EDIT_ACTION"]=55,o[t[56]="FAVORITES_ACTION"]=56,o[t[57]="MERCHANT_PAYMENT_PARTNER_ACTION"]=57,o[t[58]="WAFFLE_ACCOUNT_LINK_STATE_ACTION"]=58,o[t[59]="USERNAME_CHAT_START_MODE"]=59,o[t[60]="NOTIFICATION_ACTIVITY_SETTING_ACTION"]=60,o[t[61]="LID_CONTACT_ACTION"]=61,o[t[62]="CTWA_PER_CUSTOMER_DATA_SHARING_ACTION"]=62,o[t[63]="PAYMENT_TOS_ACTION"]=63,o[t[64]="PRIVACY_SETTING_CHANNELS_PERSONALISED_RECOMMENDATION_ACTION"]=64,o[t[65]="BUSINESS_BROADCAST_ASSOCIATION_ACTION"]=65,o[t[66]="DETECTED_OUTCOMES_STATUS_ACTION"]=66,o[t[68]="MAIBA_AI_FEATURES_CONTROL_ACTION"]=68,o[t[69]="BUSINESS_BROADCAST_LIST_ACTION"]=69,o[t[70]="MUSIC_USER_ID_ACTION"]=70,o[t[71]="STATUS_POST_OPT_IN_NOTIFICATION_PREFERENCES_ACTION"]=71,o[t[72]="AVATAR_UPDATED_ACTION"]=72,o[t[73]="GALAXY_FLOW_ACTION"]=73,o[t[74]="PRIVATE_PROCESSING_SETTING_ACTION"]=74,o[t[75]="NEWSLETTER_SAVED_INTERESTS_ACTION"]=75,o[t[76]="AI_THREAD_RENAME_ACTION"]=76,o[t[77]="INTERACTIVE_MESSAGE_ACTION"]=77,o[t[10001]="SHARE_OWN_PN"]=10001,o[t[10002]="BUSINESS_BROADCAST_ACTION"]=10002,o})(),n.NoiseCertificate=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.details=e.bytes();break}case 2:{s.signature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.NoiseCertificate)return e;var i=new d.proto.NoiseCertificate;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,i.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(i.details=e.details)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,i.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(i.signature=e.signature)),i},t.toObject=function(e,i){i||(i={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=i.bytes===String?l.base64.encode(e.details,0,e.details.length):i.bytes===Array?Array.prototype.slice.call(e.details):e.details,i.oneofs&&(A._details="details")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=i.bytes===String?l.base64.encode(e.signature,0,e.signature.length):i.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,i.oneofs&&(A._signature="signature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NoiseCertificate"},t.Details=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.serial=A.uint32();break}case 2:{c.issuer=A.string();break}case 3:{c.expires=A.uint64();break}case 4:{c.subject=A.string();break}case 5:{c.key=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.NoiseCertificate.Details)return A;var r=new d.proto.NoiseCertificate.Details;return A.serial!=null&&(r.serial=A.serial>>>0),A.issuer!=null&&(r.issuer=String(A.issuer)),A.expires!=null&&(l.Long?(r.expires=l.Long.fromValue(A.expires)).unsigned=!0:typeof A.expires=="string"?r.expires=parseInt(A.expires,10):typeof A.expires=="number"?r.expires=A.expires:typeof A.expires=="object"&&(r.expires=new l.LongBits(A.expires.low>>>0,A.expires.high>>>0).toNumber(!0))),A.subject!=null&&(r.subject=String(A.subject)),A.key!=null&&(typeof A.key=="string"?l.base64.decode(A.key,r.key=l.newBuffer(l.base64.length(A.key)),0):A.key.length>=0&&(r.key=A.key)),r},a.toObject=function(A,r){r||(r={});var s={};return A.serial!=null&&A.hasOwnProperty("serial")&&(s.serial=A.serial,r.oneofs&&(s._serial="serial")),A.issuer!=null&&A.hasOwnProperty("issuer")&&(s.issuer=A.issuer,r.oneofs&&(s._issuer="issuer")),A.expires!=null&&A.hasOwnProperty("expires")&&(typeof A.expires=="number"?s.expires=r.longs===String?String(A.expires):A.expires:s.expires=r.longs===String?ge(A.expires,!0):r.longs===Number?ce(A.expires,!0):A.expires,r.oneofs&&(s._expires="expires")),A.subject!=null&&A.hasOwnProperty("subject")&&(s.subject=A.subject,r.oneofs&&(s._subject="subject")),A.key!=null&&A.hasOwnProperty("key")&&(s.key=r.bytes===String?l.base64.encode(A.key,0,A.key.length):r.bytes===Array?Array.prototype.slice.call(A.key):A.key,r.oneofs&&(s._key="key")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.NoiseCertificate.Details"},a})(),t})(),n.NotificationMessageInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.key=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=d.proto.Message.decode(e,e.uint32());break}case 3:{s.messageTimestamp=e.uint64();break}case 4:{s.participant=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.NotificationMessageInfo)return e;var i=new d.proto.NotificationMessageInfo;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.NotificationMessageInfo.key: object expected");i.key=d.proto.MessageKey.fromObject(e.key)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.NotificationMessageInfo.message: object expected");i.message=d.proto.Message.fromObject(e.message)}return e.messageTimestamp!=null&&(l.Long?(i.messageTimestamp=l.Long.fromValue(e.messageTimestamp)).unsigned=!0:typeof e.messageTimestamp=="string"?i.messageTimestamp=parseInt(e.messageTimestamp,10):typeof e.messageTimestamp=="number"?i.messageTimestamp=e.messageTimestamp:typeof e.messageTimestamp=="object"&&(i.messageTimestamp=new l.LongBits(e.messageTimestamp.low>>>0,e.messageTimestamp.high>>>0).toNumber(!0))),e.participant!=null&&(i.participant=String(e.participant)),i},t.toObject=function(e,i){i||(i={});var A={};return e.key!=null&&e.hasOwnProperty("key")&&(A.key=d.proto.MessageKey.toObject(e.key,i),i.oneofs&&(A._key="key")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=d.proto.Message.toObject(e.message,i),i.oneofs&&(A._message="message")),e.messageTimestamp!=null&&e.hasOwnProperty("messageTimestamp")&&(typeof e.messageTimestamp=="number"?A.messageTimestamp=i.longs===String?String(e.messageTimestamp):e.messageTimestamp:A.messageTimestamp=i.longs===String?ge(e.messageTimestamp,!0):i.longs===Number?ce(e.messageTimestamp,!0):e.messageTimestamp,i.oneofs&&(A._messageTimestamp="messageTimestamp")),e.participant!=null&&e.hasOwnProperty("participant")&&(A.participant=e.participant,i.oneofs&&(A._participant="participant")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NotificationMessageInfo"},t})(),n.NotificationSettings=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.messageVibrate=e.string();break}case 2:{s.messagePopup=e.string();break}case 3:{s.messageLight=e.string();break}case 4:{s.lowPriorityNotifications=e.bool();break}case 5:{s.reactionsMuted=e.bool();break}case 6:{s.callVibrate=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.NotificationSettings)return e;var i=new d.proto.NotificationSettings;return e.messageVibrate!=null&&(i.messageVibrate=String(e.messageVibrate)),e.messagePopup!=null&&(i.messagePopup=String(e.messagePopup)),e.messageLight!=null&&(i.messageLight=String(e.messageLight)),e.lowPriorityNotifications!=null&&(i.lowPriorityNotifications=!!e.lowPriorityNotifications),e.reactionsMuted!=null&&(i.reactionsMuted=!!e.reactionsMuted),e.callVibrate!=null&&(i.callVibrate=String(e.callVibrate)),i},t.toObject=function(e,i){i||(i={});var A={};return e.messageVibrate!=null&&e.hasOwnProperty("messageVibrate")&&(A.messageVibrate=e.messageVibrate,i.oneofs&&(A._messageVibrate="messageVibrate")),e.messagePopup!=null&&e.hasOwnProperty("messagePopup")&&(A.messagePopup=e.messagePopup,i.oneofs&&(A._messagePopup="messagePopup")),e.messageLight!=null&&e.hasOwnProperty("messageLight")&&(A.messageLight=e.messageLight,i.oneofs&&(A._messageLight="messageLight")),e.lowPriorityNotifications!=null&&e.hasOwnProperty("lowPriorityNotifications")&&(A.lowPriorityNotifications=e.lowPriorityNotifications,i.oneofs&&(A._lowPriorityNotifications="lowPriorityNotifications")),e.reactionsMuted!=null&&e.hasOwnProperty("reactionsMuted")&&(A.reactionsMuted=e.reactionsMuted,i.oneofs&&(A._reactionsMuted="reactionsMuted")),e.callVibrate!=null&&e.hasOwnProperty("callVibrate")&&(A.callVibrate=e.callVibrate,i.oneofs&&(A._callVibrate="callVibrate")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.NotificationSettings"},t})(),n.PairingRequest=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.companionPublicKey=e.bytes();break}case 2:{s.companionIdentityKey=e.bytes();break}case 3:{s.advSecret=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PairingRequest)return e;var i=new d.proto.PairingRequest;return e.companionPublicKey!=null&&(typeof e.companionPublicKey=="string"?l.base64.decode(e.companionPublicKey,i.companionPublicKey=l.newBuffer(l.base64.length(e.companionPublicKey)),0):e.companionPublicKey.length>=0&&(i.companionPublicKey=e.companionPublicKey)),e.companionIdentityKey!=null&&(typeof e.companionIdentityKey=="string"?l.base64.decode(e.companionIdentityKey,i.companionIdentityKey=l.newBuffer(l.base64.length(e.companionIdentityKey)),0):e.companionIdentityKey.length>=0&&(i.companionIdentityKey=e.companionIdentityKey)),e.advSecret!=null&&(typeof e.advSecret=="string"?l.base64.decode(e.advSecret,i.advSecret=l.newBuffer(l.base64.length(e.advSecret)),0):e.advSecret.length>=0&&(i.advSecret=e.advSecret)),i},t.toObject=function(e,i){i||(i={});var A={};return e.companionPublicKey!=null&&e.hasOwnProperty("companionPublicKey")&&(A.companionPublicKey=i.bytes===String?l.base64.encode(e.companionPublicKey,0,e.companionPublicKey.length):i.bytes===Array?Array.prototype.slice.call(e.companionPublicKey):e.companionPublicKey,i.oneofs&&(A._companionPublicKey="companionPublicKey")),e.companionIdentityKey!=null&&e.hasOwnProperty("companionIdentityKey")&&(A.companionIdentityKey=i.bytes===String?l.base64.encode(e.companionIdentityKey,0,e.companionIdentityKey.length):i.bytes===Array?Array.prototype.slice.call(e.companionIdentityKey):e.companionIdentityKey,i.oneofs&&(A._companionIdentityKey="companionIdentityKey")),e.advSecret!=null&&e.hasOwnProperty("advSecret")&&(A.advSecret=i.bytes===String?l.base64.encode(e.advSecret,0,e.advSecret.length):i.bytes===Array?Array.prototype.slice.call(e.advSecret):e.advSecret,i.oneofs&&(A._advSecret="advSecret")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PairingRequest"},t})(),n.PastParticipant=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.userJid=e.string();break}case 2:{s.leaveReason=e.int32();break}case 3:{s.leaveTs=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PastParticipant)return e;var i=new d.proto.PastParticipant;switch(e.userJid!=null&&(i.userJid=String(e.userJid)),e.leaveReason){default:if(typeof e.leaveReason=="number"){i.leaveReason=e.leaveReason;break}break;case"LEFT":case 0:i.leaveReason=0;break;case"REMOVED":case 1:i.leaveReason=1;break}return e.leaveTs!=null&&(l.Long?(i.leaveTs=l.Long.fromValue(e.leaveTs)).unsigned=!0:typeof e.leaveTs=="string"?i.leaveTs=parseInt(e.leaveTs,10):typeof e.leaveTs=="number"?i.leaveTs=e.leaveTs:typeof e.leaveTs=="object"&&(i.leaveTs=new l.LongBits(e.leaveTs.low>>>0,e.leaveTs.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};return e.userJid!=null&&e.hasOwnProperty("userJid")&&(A.userJid=e.userJid,i.oneofs&&(A._userJid="userJid")),e.leaveReason!=null&&e.hasOwnProperty("leaveReason")&&(A.leaveReason=i.enums===String?d.proto.PastParticipant.LeaveReason[e.leaveReason]===void 0?e.leaveReason:d.proto.PastParticipant.LeaveReason[e.leaveReason]:e.leaveReason,i.oneofs&&(A._leaveReason="leaveReason")),e.leaveTs!=null&&e.hasOwnProperty("leaveTs")&&(typeof e.leaveTs=="number"?A.leaveTs=i.longs===String?String(e.leaveTs):e.leaveTs:A.leaveTs=i.longs===String?ge(e.leaveTs,!0):i.longs===Number?ce(e.leaveTs,!0):e.leaveTs,i.oneofs&&(A._leaveTs="leaveTs")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PastParticipant"},t.LeaveReason=(function(){let a={},e=Object.create(a);return e[a[0]="LEFT"]=0,e[a[1]="REMOVED"]=1,e})(),t})(),n.PastParticipants=(function(){function t(a){if(this.pastParticipants=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.groupJid=e.string();break}case 2:{s.pastParticipants&&s.pastParticipants.length||(s.pastParticipants=[]),s.pastParticipants.push(d.proto.PastParticipant.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PastParticipants)return e;var i=new d.proto.PastParticipants;if(e.groupJid!=null&&(i.groupJid=String(e.groupJid)),e.pastParticipants){if(!Array.isArray(e.pastParticipants))throw TypeError(".proto.PastParticipants.pastParticipants: array expected");i.pastParticipants=[];for(var A=0;A>>3){case 1:{s.currentLthash=e.bytes();break}case 2:{s.newLthash=e.bytes();break}case 3:{s.patchVersion=e.bytes();break}case 4:{s.collectionName=e.bytes();break}case 5:{s.firstFourBytesFromAHashOfSnapshotMacKey=e.bytes();break}case 6:{s.newLthashSubtract=e.bytes();break}case 7:{s.numberAdd=e.int32();break}case 8:{s.numberRemove=e.int32();break}case 9:{s.numberOverride=e.int32();break}case 10:{s.senderPlatform=e.int32();break}case 11:{s.isSenderPrimary=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PatchDebugData)return e;var i=new d.proto.PatchDebugData;switch(e.currentLthash!=null&&(typeof e.currentLthash=="string"?l.base64.decode(e.currentLthash,i.currentLthash=l.newBuffer(l.base64.length(e.currentLthash)),0):e.currentLthash.length>=0&&(i.currentLthash=e.currentLthash)),e.newLthash!=null&&(typeof e.newLthash=="string"?l.base64.decode(e.newLthash,i.newLthash=l.newBuffer(l.base64.length(e.newLthash)),0):e.newLthash.length>=0&&(i.newLthash=e.newLthash)),e.patchVersion!=null&&(typeof e.patchVersion=="string"?l.base64.decode(e.patchVersion,i.patchVersion=l.newBuffer(l.base64.length(e.patchVersion)),0):e.patchVersion.length>=0&&(i.patchVersion=e.patchVersion)),e.collectionName!=null&&(typeof e.collectionName=="string"?l.base64.decode(e.collectionName,i.collectionName=l.newBuffer(l.base64.length(e.collectionName)),0):e.collectionName.length>=0&&(i.collectionName=e.collectionName)),e.firstFourBytesFromAHashOfSnapshotMacKey!=null&&(typeof e.firstFourBytesFromAHashOfSnapshotMacKey=="string"?l.base64.decode(e.firstFourBytesFromAHashOfSnapshotMacKey,i.firstFourBytesFromAHashOfSnapshotMacKey=l.newBuffer(l.base64.length(e.firstFourBytesFromAHashOfSnapshotMacKey)),0):e.firstFourBytesFromAHashOfSnapshotMacKey.length>=0&&(i.firstFourBytesFromAHashOfSnapshotMacKey=e.firstFourBytesFromAHashOfSnapshotMacKey)),e.newLthashSubtract!=null&&(typeof e.newLthashSubtract=="string"?l.base64.decode(e.newLthashSubtract,i.newLthashSubtract=l.newBuffer(l.base64.length(e.newLthashSubtract)),0):e.newLthashSubtract.length>=0&&(i.newLthashSubtract=e.newLthashSubtract)),e.numberAdd!=null&&(i.numberAdd=e.numberAdd|0),e.numberRemove!=null&&(i.numberRemove=e.numberRemove|0),e.numberOverride!=null&&(i.numberOverride=e.numberOverride|0),e.senderPlatform){default:if(typeof e.senderPlatform=="number"){i.senderPlatform=e.senderPlatform;break}break;case"ANDROID":case 0:i.senderPlatform=0;break;case"SMBA":case 1:i.senderPlatform=1;break;case"IPHONE":case 2:i.senderPlatform=2;break;case"SMBI":case 3:i.senderPlatform=3;break;case"WEB":case 4:i.senderPlatform=4;break;case"UWP":case 5:i.senderPlatform=5;break;case"DARWIN":case 6:i.senderPlatform=6;break;case"IPAD":case 7:i.senderPlatform=7;break;case"WEAROS":case 8:i.senderPlatform=8;break;case"WASG":case 9:i.senderPlatform=9;break;case"WEARM":case 10:i.senderPlatform=10;break;case"CAPI":case 11:i.senderPlatform=11;break}return e.isSenderPrimary!=null&&(i.isSenderPrimary=!!e.isSenderPrimary),i},t.toObject=function(e,i){i||(i={});var A={};return e.currentLthash!=null&&e.hasOwnProperty("currentLthash")&&(A.currentLthash=i.bytes===String?l.base64.encode(e.currentLthash,0,e.currentLthash.length):i.bytes===Array?Array.prototype.slice.call(e.currentLthash):e.currentLthash,i.oneofs&&(A._currentLthash="currentLthash")),e.newLthash!=null&&e.hasOwnProperty("newLthash")&&(A.newLthash=i.bytes===String?l.base64.encode(e.newLthash,0,e.newLthash.length):i.bytes===Array?Array.prototype.slice.call(e.newLthash):e.newLthash,i.oneofs&&(A._newLthash="newLthash")),e.patchVersion!=null&&e.hasOwnProperty("patchVersion")&&(A.patchVersion=i.bytes===String?l.base64.encode(e.patchVersion,0,e.patchVersion.length):i.bytes===Array?Array.prototype.slice.call(e.patchVersion):e.patchVersion,i.oneofs&&(A._patchVersion="patchVersion")),e.collectionName!=null&&e.hasOwnProperty("collectionName")&&(A.collectionName=i.bytes===String?l.base64.encode(e.collectionName,0,e.collectionName.length):i.bytes===Array?Array.prototype.slice.call(e.collectionName):e.collectionName,i.oneofs&&(A._collectionName="collectionName")),e.firstFourBytesFromAHashOfSnapshotMacKey!=null&&e.hasOwnProperty("firstFourBytesFromAHashOfSnapshotMacKey")&&(A.firstFourBytesFromAHashOfSnapshotMacKey=i.bytes===String?l.base64.encode(e.firstFourBytesFromAHashOfSnapshotMacKey,0,e.firstFourBytesFromAHashOfSnapshotMacKey.length):i.bytes===Array?Array.prototype.slice.call(e.firstFourBytesFromAHashOfSnapshotMacKey):e.firstFourBytesFromAHashOfSnapshotMacKey,i.oneofs&&(A._firstFourBytesFromAHashOfSnapshotMacKey="firstFourBytesFromAHashOfSnapshotMacKey")),e.newLthashSubtract!=null&&e.hasOwnProperty("newLthashSubtract")&&(A.newLthashSubtract=i.bytes===String?l.base64.encode(e.newLthashSubtract,0,e.newLthashSubtract.length):i.bytes===Array?Array.prototype.slice.call(e.newLthashSubtract):e.newLthashSubtract,i.oneofs&&(A._newLthashSubtract="newLthashSubtract")),e.numberAdd!=null&&e.hasOwnProperty("numberAdd")&&(A.numberAdd=e.numberAdd,i.oneofs&&(A._numberAdd="numberAdd")),e.numberRemove!=null&&e.hasOwnProperty("numberRemove")&&(A.numberRemove=e.numberRemove,i.oneofs&&(A._numberRemove="numberRemove")),e.numberOverride!=null&&e.hasOwnProperty("numberOverride")&&(A.numberOverride=e.numberOverride,i.oneofs&&(A._numberOverride="numberOverride")),e.senderPlatform!=null&&e.hasOwnProperty("senderPlatform")&&(A.senderPlatform=i.enums===String?d.proto.PatchDebugData.Platform[e.senderPlatform]===void 0?e.senderPlatform:d.proto.PatchDebugData.Platform[e.senderPlatform]:e.senderPlatform,i.oneofs&&(A._senderPlatform="senderPlatform")),e.isSenderPrimary!=null&&e.hasOwnProperty("isSenderPrimary")&&(A.isSenderPrimary=e.isSenderPrimary,i.oneofs&&(A._isSenderPrimary="isSenderPrimary")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PatchDebugData"},t.Platform=(function(){let a={},e=Object.create(a);return e[a[0]="ANDROID"]=0,e[a[1]="SMBA"]=1,e[a[2]="IPHONE"]=2,e[a[3]="SMBI"]=3,e[a[4]="WEB"]=4,e[a[5]="UWP"]=5,e[a[6]="DARWIN"]=6,e[a[7]="IPAD"]=7,e[a[8]="WEAROS"]=8,e[a[9]="WASG"]=9,e[a[10]="WEARM"]=10,e[a[11]="CAPI"]=11,e})(),t})(),n.PaymentBackground=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.string();break}case 2:{s.fileLength=e.uint64();break}case 3:{s.width=e.uint32();break}case 4:{s.height=e.uint32();break}case 5:{s.mimetype=e.string();break}case 6:{s.placeholderArgb=e.fixed32();break}case 7:{s.textArgb=e.fixed32();break}case 8:{s.subtextArgb=e.fixed32();break}case 9:{s.mediaData=d.proto.PaymentBackground.MediaData.decode(e,e.uint32());break}case 10:{s.type=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PaymentBackground)return e;var i=new d.proto.PaymentBackground;if(e.id!=null&&(i.id=String(e.id)),e.fileLength!=null&&(l.Long?(i.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?i.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?i.fileLength=e.fileLength:typeof e.fileLength=="object"&&(i.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.width!=null&&(i.width=e.width>>>0),e.height!=null&&(i.height=e.height>>>0),e.mimetype!=null&&(i.mimetype=String(e.mimetype)),e.placeholderArgb!=null&&(i.placeholderArgb=e.placeholderArgb>>>0),e.textArgb!=null&&(i.textArgb=e.textArgb>>>0),e.subtextArgb!=null&&(i.subtextArgb=e.subtextArgb>>>0),e.mediaData!=null){if(typeof e.mediaData!="object")throw TypeError(".proto.PaymentBackground.mediaData: object expected");i.mediaData=d.proto.PaymentBackground.MediaData.fromObject(e.mediaData)}switch(e.type){default:if(typeof e.type=="number"){i.type=e.type;break}break;case"UNKNOWN":case 0:i.type=0;break;case"DEFAULT":case 1:i.type=1;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=i.longs===String?String(e.fileLength):e.fileLength:A.fileLength=i.longs===String?ge(e.fileLength,!0):i.longs===Number?ce(e.fileLength,!0):e.fileLength,i.oneofs&&(A._fileLength="fileLength")),e.width!=null&&e.hasOwnProperty("width")&&(A.width=e.width,i.oneofs&&(A._width="width")),e.height!=null&&e.hasOwnProperty("height")&&(A.height=e.height,i.oneofs&&(A._height="height")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,i.oneofs&&(A._mimetype="mimetype")),e.placeholderArgb!=null&&e.hasOwnProperty("placeholderArgb")&&(A.placeholderArgb=e.placeholderArgb,i.oneofs&&(A._placeholderArgb="placeholderArgb")),e.textArgb!=null&&e.hasOwnProperty("textArgb")&&(A.textArgb=e.textArgb,i.oneofs&&(A._textArgb="textArgb")),e.subtextArgb!=null&&e.hasOwnProperty("subtextArgb")&&(A.subtextArgb=e.subtextArgb,i.oneofs&&(A._subtextArgb="subtextArgb")),e.mediaData!=null&&e.hasOwnProperty("mediaData")&&(A.mediaData=d.proto.PaymentBackground.MediaData.toObject(e.mediaData,i),i.oneofs&&(A._mediaData="mediaData")),e.type!=null&&e.hasOwnProperty("type")&&(A.type=i.enums===String?d.proto.PaymentBackground.Type[e.type]===void 0?e.type:d.proto.PaymentBackground.Type[e.type]:e.type,i.oneofs&&(A._type="type")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PaymentBackground"},t.MediaData=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.mediaKey=A.bytes();break}case 2:{c.mediaKeyTimestamp=A.int64();break}case 3:{c.fileSha256=A.bytes();break}case 4:{c.fileEncSha256=A.bytes();break}case 5:{c.directPath=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.PaymentBackground.MediaData)return A;var r=new d.proto.PaymentBackground.MediaData;return A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mediaKeyTimestamp!=null&&(l.Long?(r.mediaKeyTimestamp=l.Long.fromValue(A.mediaKeyTimestamp)).unsigned=!1:typeof A.mediaKeyTimestamp=="string"?r.mediaKeyTimestamp=parseInt(A.mediaKeyTimestamp,10):typeof A.mediaKeyTimestamp=="number"?r.mediaKeyTimestamp=A.mediaKeyTimestamp:typeof A.mediaKeyTimestamp=="object"&&(r.mediaKeyTimestamp=new l.LongBits(A.mediaKeyTimestamp.low>>>0,A.mediaKeyTimestamp.high>>>0).toNumber())),A.fileSha256!=null&&(typeof A.fileSha256=="string"?l.base64.decode(A.fileSha256,r.fileSha256=l.newBuffer(l.base64.length(A.fileSha256)),0):A.fileSha256.length>=0&&(r.fileSha256=A.fileSha256)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.directPath!=null&&(r.directPath=String(A.directPath)),r},a.toObject=function(A,r){r||(r={});var s={};return A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mediaKeyTimestamp!=null&&A.hasOwnProperty("mediaKeyTimestamp")&&(typeof A.mediaKeyTimestamp=="number"?s.mediaKeyTimestamp=r.longs===String?String(A.mediaKeyTimestamp):A.mediaKeyTimestamp:s.mediaKeyTimestamp=r.longs===String?ge(A.mediaKeyTimestamp):r.longs===Number?ce(A.mediaKeyTimestamp):A.mediaKeyTimestamp,r.oneofs&&(s._mediaKeyTimestamp="mediaKeyTimestamp")),A.fileSha256!=null&&A.hasOwnProperty("fileSha256")&&(s.fileSha256=r.bytes===String?l.base64.encode(A.fileSha256,0,A.fileSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileSha256):A.fileSha256,r.oneofs&&(s._fileSha256="fileSha256")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.PaymentBackground.MediaData"},a})(),t.Type=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="DEFAULT"]=1,e})(),t})(),n.PaymentInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.currencyDeprecated=e.int32();break}case 2:{s.amount1000=e.uint64();break}case 3:{s.receiverJid=e.string();break}case 4:{s.status=e.int32();break}case 5:{s.transactionTimestamp=e.uint64();break}case 6:{s.requestMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 7:{s.expiryTimestamp=e.uint64();break}case 8:{s.futureproofed=e.bool();break}case 9:{s.currency=e.string();break}case 10:{s.txnStatus=e.int32();break}case 11:{s.useNoviFiatFormat=e.bool();break}case 12:{s.primaryAmount=d.proto.Money.decode(e,e.uint32());break}case 13:{s.exchangeAmount=d.proto.Money.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PaymentInfo)return e;var i=new d.proto.PaymentInfo;switch(e.currencyDeprecated){default:if(typeof e.currencyDeprecated=="number"){i.currencyDeprecated=e.currencyDeprecated;break}break;case"UNKNOWN_CURRENCY":case 0:i.currencyDeprecated=0;break;case"INR":case 1:i.currencyDeprecated=1;break}switch(e.amount1000!=null&&(l.Long?(i.amount1000=l.Long.fromValue(e.amount1000)).unsigned=!0:typeof e.amount1000=="string"?i.amount1000=parseInt(e.amount1000,10):typeof e.amount1000=="number"?i.amount1000=e.amount1000:typeof e.amount1000=="object"&&(i.amount1000=new l.LongBits(e.amount1000.low>>>0,e.amount1000.high>>>0).toNumber(!0))),e.receiverJid!=null&&(i.receiverJid=String(e.receiverJid)),e.status){default:if(typeof e.status=="number"){i.status=e.status;break}break;case"UNKNOWN_STATUS":case 0:i.status=0;break;case"PROCESSING":case 1:i.status=1;break;case"SENT":case 2:i.status=2;break;case"NEED_TO_ACCEPT":case 3:i.status=3;break;case"COMPLETE":case 4:i.status=4;break;case"COULD_NOT_COMPLETE":case 5:i.status=5;break;case"REFUNDED":case 6:i.status=6;break;case"EXPIRED":case 7:i.status=7;break;case"REJECTED":case 8:i.status=8;break;case"CANCELLED":case 9:i.status=9;break;case"WAITING_FOR_PAYER":case 10:i.status=10;break;case"WAITING":case 11:i.status=11;break}if(e.transactionTimestamp!=null&&(l.Long?(i.transactionTimestamp=l.Long.fromValue(e.transactionTimestamp)).unsigned=!0:typeof e.transactionTimestamp=="string"?i.transactionTimestamp=parseInt(e.transactionTimestamp,10):typeof e.transactionTimestamp=="number"?i.transactionTimestamp=e.transactionTimestamp:typeof e.transactionTimestamp=="object"&&(i.transactionTimestamp=new l.LongBits(e.transactionTimestamp.low>>>0,e.transactionTimestamp.high>>>0).toNumber(!0))),e.requestMessageKey!=null){if(typeof e.requestMessageKey!="object")throw TypeError(".proto.PaymentInfo.requestMessageKey: object expected");i.requestMessageKey=d.proto.MessageKey.fromObject(e.requestMessageKey)}switch(e.expiryTimestamp!=null&&(l.Long?(i.expiryTimestamp=l.Long.fromValue(e.expiryTimestamp)).unsigned=!0:typeof e.expiryTimestamp=="string"?i.expiryTimestamp=parseInt(e.expiryTimestamp,10):typeof e.expiryTimestamp=="number"?i.expiryTimestamp=e.expiryTimestamp:typeof e.expiryTimestamp=="object"&&(i.expiryTimestamp=new l.LongBits(e.expiryTimestamp.low>>>0,e.expiryTimestamp.high>>>0).toNumber(!0))),e.futureproofed!=null&&(i.futureproofed=!!e.futureproofed),e.currency!=null&&(i.currency=String(e.currency)),e.txnStatus){default:if(typeof e.txnStatus=="number"){i.txnStatus=e.txnStatus;break}break;case"UNKNOWN":case 0:i.txnStatus=0;break;case"PENDING_SETUP":case 1:i.txnStatus=1;break;case"PENDING_RECEIVER_SETUP":case 2:i.txnStatus=2;break;case"INIT":case 3:i.txnStatus=3;break;case"SUCCESS":case 4:i.txnStatus=4;break;case"COMPLETED":case 5:i.txnStatus=5;break;case"FAILED":case 6:i.txnStatus=6;break;case"FAILED_RISK":case 7:i.txnStatus=7;break;case"FAILED_PROCESSING":case 8:i.txnStatus=8;break;case"FAILED_RECEIVER_PROCESSING":case 9:i.txnStatus=9;break;case"FAILED_DA":case 10:i.txnStatus=10;break;case"FAILED_DA_FINAL":case 11:i.txnStatus=11;break;case"REFUNDED_TXN":case 12:i.txnStatus=12;break;case"REFUND_FAILED":case 13:i.txnStatus=13;break;case"REFUND_FAILED_PROCESSING":case 14:i.txnStatus=14;break;case"REFUND_FAILED_DA":case 15:i.txnStatus=15;break;case"EXPIRED_TXN":case 16:i.txnStatus=16;break;case"AUTH_CANCELED":case 17:i.txnStatus=17;break;case"AUTH_CANCEL_FAILED_PROCESSING":case 18:i.txnStatus=18;break;case"AUTH_CANCEL_FAILED":case 19:i.txnStatus=19;break;case"COLLECT_INIT":case 20:i.txnStatus=20;break;case"COLLECT_SUCCESS":case 21:i.txnStatus=21;break;case"COLLECT_FAILED":case 22:i.txnStatus=22;break;case"COLLECT_FAILED_RISK":case 23:i.txnStatus=23;break;case"COLLECT_REJECTED":case 24:i.txnStatus=24;break;case"COLLECT_EXPIRED":case 25:i.txnStatus=25;break;case"COLLECT_CANCELED":case 26:i.txnStatus=26;break;case"COLLECT_CANCELLING":case 27:i.txnStatus=27;break;case"IN_REVIEW":case 28:i.txnStatus=28;break;case"REVERSAL_SUCCESS":case 29:i.txnStatus=29;break;case"REVERSAL_PENDING":case 30:i.txnStatus=30;break;case"REFUND_PENDING":case 31:i.txnStatus=31;break}if(e.useNoviFiatFormat!=null&&(i.useNoviFiatFormat=!!e.useNoviFiatFormat),e.primaryAmount!=null){if(typeof e.primaryAmount!="object")throw TypeError(".proto.PaymentInfo.primaryAmount: object expected");i.primaryAmount=d.proto.Money.fromObject(e.primaryAmount)}if(e.exchangeAmount!=null){if(typeof e.exchangeAmount!="object")throw TypeError(".proto.PaymentInfo.exchangeAmount: object expected");i.exchangeAmount=d.proto.Money.fromObject(e.exchangeAmount)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.currencyDeprecated!=null&&e.hasOwnProperty("currencyDeprecated")&&(A.currencyDeprecated=i.enums===String?d.proto.PaymentInfo.Currency[e.currencyDeprecated]===void 0?e.currencyDeprecated:d.proto.PaymentInfo.Currency[e.currencyDeprecated]:e.currencyDeprecated,i.oneofs&&(A._currencyDeprecated="currencyDeprecated")),e.amount1000!=null&&e.hasOwnProperty("amount1000")&&(typeof e.amount1000=="number"?A.amount1000=i.longs===String?String(e.amount1000):e.amount1000:A.amount1000=i.longs===String?ge(e.amount1000,!0):i.longs===Number?ce(e.amount1000,!0):e.amount1000,i.oneofs&&(A._amount1000="amount1000")),e.receiverJid!=null&&e.hasOwnProperty("receiverJid")&&(A.receiverJid=e.receiverJid,i.oneofs&&(A._receiverJid="receiverJid")),e.status!=null&&e.hasOwnProperty("status")&&(A.status=i.enums===String?d.proto.PaymentInfo.Status[e.status]===void 0?e.status:d.proto.PaymentInfo.Status[e.status]:e.status,i.oneofs&&(A._status="status")),e.transactionTimestamp!=null&&e.hasOwnProperty("transactionTimestamp")&&(typeof e.transactionTimestamp=="number"?A.transactionTimestamp=i.longs===String?String(e.transactionTimestamp):e.transactionTimestamp:A.transactionTimestamp=i.longs===String?ge(e.transactionTimestamp,!0):i.longs===Number?ce(e.transactionTimestamp,!0):e.transactionTimestamp,i.oneofs&&(A._transactionTimestamp="transactionTimestamp")),e.requestMessageKey!=null&&e.hasOwnProperty("requestMessageKey")&&(A.requestMessageKey=d.proto.MessageKey.toObject(e.requestMessageKey,i),i.oneofs&&(A._requestMessageKey="requestMessageKey")),e.expiryTimestamp!=null&&e.hasOwnProperty("expiryTimestamp")&&(typeof e.expiryTimestamp=="number"?A.expiryTimestamp=i.longs===String?String(e.expiryTimestamp):e.expiryTimestamp:A.expiryTimestamp=i.longs===String?ge(e.expiryTimestamp,!0):i.longs===Number?ce(e.expiryTimestamp,!0):e.expiryTimestamp,i.oneofs&&(A._expiryTimestamp="expiryTimestamp")),e.futureproofed!=null&&e.hasOwnProperty("futureproofed")&&(A.futureproofed=e.futureproofed,i.oneofs&&(A._futureproofed="futureproofed")),e.currency!=null&&e.hasOwnProperty("currency")&&(A.currency=e.currency,i.oneofs&&(A._currency="currency")),e.txnStatus!=null&&e.hasOwnProperty("txnStatus")&&(A.txnStatus=i.enums===String?d.proto.PaymentInfo.TxnStatus[e.txnStatus]===void 0?e.txnStatus:d.proto.PaymentInfo.TxnStatus[e.txnStatus]:e.txnStatus,i.oneofs&&(A._txnStatus="txnStatus")),e.useNoviFiatFormat!=null&&e.hasOwnProperty("useNoviFiatFormat")&&(A.useNoviFiatFormat=e.useNoviFiatFormat,i.oneofs&&(A._useNoviFiatFormat="useNoviFiatFormat")),e.primaryAmount!=null&&e.hasOwnProperty("primaryAmount")&&(A.primaryAmount=d.proto.Money.toObject(e.primaryAmount,i),i.oneofs&&(A._primaryAmount="primaryAmount")),e.exchangeAmount!=null&&e.hasOwnProperty("exchangeAmount")&&(A.exchangeAmount=d.proto.Money.toObject(e.exchangeAmount,i),i.oneofs&&(A._exchangeAmount="exchangeAmount")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PaymentInfo"},t.Currency=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_CURRENCY"]=0,e[a[1]="INR"]=1,e})(),t.Status=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_STATUS"]=0,e[a[1]="PROCESSING"]=1,e[a[2]="SENT"]=2,e[a[3]="NEED_TO_ACCEPT"]=3,e[a[4]="COMPLETE"]=4,e[a[5]="COULD_NOT_COMPLETE"]=5,e[a[6]="REFUNDED"]=6,e[a[7]="EXPIRED"]=7,e[a[8]="REJECTED"]=8,e[a[9]="CANCELLED"]=9,e[a[10]="WAITING_FOR_PAYER"]=10,e[a[11]="WAITING"]=11,e})(),t.TxnStatus=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="PENDING_SETUP"]=1,e[a[2]="PENDING_RECEIVER_SETUP"]=2,e[a[3]="INIT"]=3,e[a[4]="SUCCESS"]=4,e[a[5]="COMPLETED"]=5,e[a[6]="FAILED"]=6,e[a[7]="FAILED_RISK"]=7,e[a[8]="FAILED_PROCESSING"]=8,e[a[9]="FAILED_RECEIVER_PROCESSING"]=9,e[a[10]="FAILED_DA"]=10,e[a[11]="FAILED_DA_FINAL"]=11,e[a[12]="REFUNDED_TXN"]=12,e[a[13]="REFUND_FAILED"]=13,e[a[14]="REFUND_FAILED_PROCESSING"]=14,e[a[15]="REFUND_FAILED_DA"]=15,e[a[16]="EXPIRED_TXN"]=16,e[a[17]="AUTH_CANCELED"]=17,e[a[18]="AUTH_CANCEL_FAILED_PROCESSING"]=18,e[a[19]="AUTH_CANCEL_FAILED"]=19,e[a[20]="COLLECT_INIT"]=20,e[a[21]="COLLECT_SUCCESS"]=21,e[a[22]="COLLECT_FAILED"]=22,e[a[23]="COLLECT_FAILED_RISK"]=23,e[a[24]="COLLECT_REJECTED"]=24,e[a[25]="COLLECT_EXPIRED"]=25,e[a[26]="COLLECT_CANCELED"]=26,e[a[27]="COLLECT_CANCELLING"]=27,e[a[28]="IN_REVIEW"]=28,e[a[29]="REVERSAL_SUCCESS"]=29,e[a[30]="REVERSAL_PENDING"]=30,e[a[31]="REFUND_PENDING"]=31,e})(),t})(),n.PhoneNumberToLIDMapping=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.pnJid=e.string();break}case 2:{s.lidJid=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PhoneNumberToLIDMapping)return e;var i=new d.proto.PhoneNumberToLIDMapping;return e.pnJid!=null&&(i.pnJid=String(e.pnJid)),e.lidJid!=null&&(i.lidJid=String(e.lidJid)),i},t.toObject=function(e,i){i||(i={});var A={};return e.pnJid!=null&&e.hasOwnProperty("pnJid")&&(A.pnJid=e.pnJid,i.oneofs&&(A._pnJid="pnJid")),e.lidJid!=null&&e.hasOwnProperty("lidJid")&&(A.lidJid=e.lidJid,i.oneofs&&(A._lidJid="lidJid")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PhoneNumberToLIDMapping"},t})(),n.PhotoChange=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.oldPhoto=e.bytes();break}case 2:{s.newPhoto=e.bytes();break}case 3:{s.newPhotoId=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PhotoChange)return e;var i=new d.proto.PhotoChange;return e.oldPhoto!=null&&(typeof e.oldPhoto=="string"?l.base64.decode(e.oldPhoto,i.oldPhoto=l.newBuffer(l.base64.length(e.oldPhoto)),0):e.oldPhoto.length>=0&&(i.oldPhoto=e.oldPhoto)),e.newPhoto!=null&&(typeof e.newPhoto=="string"?l.base64.decode(e.newPhoto,i.newPhoto=l.newBuffer(l.base64.length(e.newPhoto)),0):e.newPhoto.length>=0&&(i.newPhoto=e.newPhoto)),e.newPhotoId!=null&&(i.newPhotoId=e.newPhotoId>>>0),i},t.toObject=function(e,i){i||(i={});var A={};return e.oldPhoto!=null&&e.hasOwnProperty("oldPhoto")&&(A.oldPhoto=i.bytes===String?l.base64.encode(e.oldPhoto,0,e.oldPhoto.length):i.bytes===Array?Array.prototype.slice.call(e.oldPhoto):e.oldPhoto,i.oneofs&&(A._oldPhoto="oldPhoto")),e.newPhoto!=null&&e.hasOwnProperty("newPhoto")&&(A.newPhoto=i.bytes===String?l.base64.encode(e.newPhoto,0,e.newPhoto.length):i.bytes===Array?Array.prototype.slice.call(e.newPhoto):e.newPhoto,i.oneofs&&(A._newPhoto="newPhoto")),e.newPhotoId!=null&&e.hasOwnProperty("newPhotoId")&&(A.newPhotoId=e.newPhotoId,i.oneofs&&(A._newPhotoId="newPhotoId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PhotoChange"},t})(),n.PinInChat=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.type=e.int32();break}case 2:{s.key=d.proto.MessageKey.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.messageAddOnContextInfo=d.proto.MessageAddOnContextInfo.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PinInChat)return e;var i=new d.proto.PinInChat;switch(e.type){default:if(typeof e.type=="number"){i.type=e.type;break}break;case"UNKNOWN_TYPE":case 0:i.type=0;break;case"PIN_FOR_ALL":case 1:i.type=1;break;case"UNPIN_FOR_ALL":case 2:i.type=2;break}if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.PinInChat.key: object expected");i.key=d.proto.MessageKey.fromObject(e.key)}if(e.senderTimestampMs!=null&&(l.Long?(i.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?i.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?i.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(i.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(i.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?i.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?i.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(i.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.messageAddOnContextInfo!=null){if(typeof e.messageAddOnContextInfo!="object")throw TypeError(".proto.PinInChat.messageAddOnContextInfo: object expected");i.messageAddOnContextInfo=d.proto.MessageAddOnContextInfo.fromObject(e.messageAddOnContextInfo)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=i.enums===String?d.proto.PinInChat.Type[e.type]===void 0?e.type:d.proto.PinInChat.Type[e.type]:e.type,i.oneofs&&(A._type="type")),e.key!=null&&e.hasOwnProperty("key")&&(A.key=d.proto.MessageKey.toObject(e.key,i),i.oneofs&&(A._key="key")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=i.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=i.longs===String?ge(e.senderTimestampMs):i.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,i.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=i.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=i.longs===String?ge(e.serverTimestampMs):i.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,i.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.messageAddOnContextInfo!=null&&e.hasOwnProperty("messageAddOnContextInfo")&&(A.messageAddOnContextInfo=d.proto.MessageAddOnContextInfo.toObject(e.messageAddOnContextInfo,i),i.oneofs&&(A._messageAddOnContextInfo="messageAddOnContextInfo")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PinInChat"},t.Type=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN_TYPE"]=0,e[a[1]="PIN_FOR_ALL"]=1,e[a[2]="UNPIN_FOR_ALL"]=2,e})(),t})(),n.Point=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.xDeprecated=e.int32();break}case 2:{s.yDeprecated=e.int32();break}case 3:{s.x=e.double();break}case 4:{s.y=e.double();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Point)return e;var i=new d.proto.Point;return e.xDeprecated!=null&&(i.xDeprecated=e.xDeprecated|0),e.yDeprecated!=null&&(i.yDeprecated=e.yDeprecated|0),e.x!=null&&(i.x=Number(e.x)),e.y!=null&&(i.y=Number(e.y)),i},t.toObject=function(e,i){i||(i={});var A={};return e.xDeprecated!=null&&e.hasOwnProperty("xDeprecated")&&(A.xDeprecated=e.xDeprecated,i.oneofs&&(A._xDeprecated="xDeprecated")),e.yDeprecated!=null&&e.hasOwnProperty("yDeprecated")&&(A.yDeprecated=e.yDeprecated,i.oneofs&&(A._yDeprecated="yDeprecated")),e.x!=null&&e.hasOwnProperty("x")&&(A.x=i.json&&!isFinite(e.x)?String(e.x):e.x,i.oneofs&&(A._x="x")),e.y!=null&&e.hasOwnProperty("y")&&(A.y=i.json&&!isFinite(e.y)?String(e.y):e.y,i.oneofs&&(A._y="y")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Point"},t})(),n.PollAdditionalMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.pollInvalidated=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PollAdditionalMetadata)return e;var i=new d.proto.PollAdditionalMetadata;return e.pollInvalidated!=null&&(i.pollInvalidated=!!e.pollInvalidated),i},t.toObject=function(e,i){i||(i={});var A={};return e.pollInvalidated!=null&&e.hasOwnProperty("pollInvalidated")&&(A.pollInvalidated=e.pollInvalidated,i.oneofs&&(A._pollInvalidated="pollInvalidated")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollAdditionalMetadata"},t})(),n.PollEncValue=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.encPayload=e.bytes();break}case 2:{s.encIv=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PollEncValue)return e;var i=new d.proto.PollEncValue;return e.encPayload!=null&&(typeof e.encPayload=="string"?l.base64.decode(e.encPayload,i.encPayload=l.newBuffer(l.base64.length(e.encPayload)),0):e.encPayload.length>=0&&(i.encPayload=e.encPayload)),e.encIv!=null&&(typeof e.encIv=="string"?l.base64.decode(e.encIv,i.encIv=l.newBuffer(l.base64.length(e.encIv)),0):e.encIv.length>=0&&(i.encIv=e.encIv)),i},t.toObject=function(e,i){i||(i={});var A={};return e.encPayload!=null&&e.hasOwnProperty("encPayload")&&(A.encPayload=i.bytes===String?l.base64.encode(e.encPayload,0,e.encPayload.length):i.bytes===Array?Array.prototype.slice.call(e.encPayload):e.encPayload,i.oneofs&&(A._encPayload="encPayload")),e.encIv!=null&&e.hasOwnProperty("encIv")&&(A.encIv=i.bytes===String?l.base64.encode(e.encIv,0,e.encIv.length):i.bytes===Array?Array.prototype.slice.call(e.encIv):e.encIv,i.oneofs&&(A._encIv="encIv")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollEncValue"},t})(),n.PollUpdate=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.pollUpdateMessageKey=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.vote=d.proto.Message.PollVoteMessage.decode(e,e.uint32());break}case 3:{s.senderTimestampMs=e.int64();break}case 4:{s.serverTimestampMs=e.int64();break}case 5:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PollUpdate)return e;var i=new d.proto.PollUpdate;if(e.pollUpdateMessageKey!=null){if(typeof e.pollUpdateMessageKey!="object")throw TypeError(".proto.PollUpdate.pollUpdateMessageKey: object expected");i.pollUpdateMessageKey=d.proto.MessageKey.fromObject(e.pollUpdateMessageKey)}if(e.vote!=null){if(typeof e.vote!="object")throw TypeError(".proto.PollUpdate.vote: object expected");i.vote=d.proto.Message.PollVoteMessage.fromObject(e.vote)}return e.senderTimestampMs!=null&&(l.Long?(i.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?i.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?i.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(i.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.serverTimestampMs!=null&&(l.Long?(i.serverTimestampMs=l.Long.fromValue(e.serverTimestampMs)).unsigned=!1:typeof e.serverTimestampMs=="string"?i.serverTimestampMs=parseInt(e.serverTimestampMs,10):typeof e.serverTimestampMs=="number"?i.serverTimestampMs=e.serverTimestampMs:typeof e.serverTimestampMs=="object"&&(i.serverTimestampMs=new l.LongBits(e.serverTimestampMs.low>>>0,e.serverTimestampMs.high>>>0).toNumber())),e.unread!=null&&(i.unread=!!e.unread),i},t.toObject=function(e,i){i||(i={});var A={};return e.pollUpdateMessageKey!=null&&e.hasOwnProperty("pollUpdateMessageKey")&&(A.pollUpdateMessageKey=d.proto.MessageKey.toObject(e.pollUpdateMessageKey,i),i.oneofs&&(A._pollUpdateMessageKey="pollUpdateMessageKey")),e.vote!=null&&e.hasOwnProperty("vote")&&(A.vote=d.proto.Message.PollVoteMessage.toObject(e.vote,i),i.oneofs&&(A._vote="vote")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=i.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=i.longs===String?ge(e.senderTimestampMs):i.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,i.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.serverTimestampMs!=null&&e.hasOwnProperty("serverTimestampMs")&&(typeof e.serverTimestampMs=="number"?A.serverTimestampMs=i.longs===String?String(e.serverTimestampMs):e.serverTimestampMs:A.serverTimestampMs=i.longs===String?ge(e.serverTimestampMs):i.longs===Number?ce(e.serverTimestampMs):e.serverTimestampMs,i.oneofs&&(A._serverTimestampMs="serverTimestampMs")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,i.oneofs&&(A._unread="unread")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PollUpdate"},t})(),n.PreKeyRecordStructure=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.uint32();break}case 2:{s.publicKey=e.bytes();break}case 3:{s.privateKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PreKeyRecordStructure)return e;var i=new d.proto.PreKeyRecordStructure;return e.id!=null&&(i.id=e.id>>>0),e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,i.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(i.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,i.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(i.privateKey=e.privateKey)),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=i.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):i.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,i.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=i.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):i.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,i.oneofs&&(A._privateKey="privateKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PreKeyRecordStructure"},t})(),n.PreKeySignalMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 5:{s.registrationId=e.uint32();break}case 1:{s.preKeyId=e.uint32();break}case 6:{s.signedPreKeyId=e.uint32();break}case 2:{s.baseKey=e.bytes();break}case 3:{s.identityKey=e.bytes();break}case 4:{s.message=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PreKeySignalMessage)return e;var i=new d.proto.PreKeySignalMessage;return e.registrationId!=null&&(i.registrationId=e.registrationId>>>0),e.preKeyId!=null&&(i.preKeyId=e.preKeyId>>>0),e.signedPreKeyId!=null&&(i.signedPreKeyId=e.signedPreKeyId>>>0),e.baseKey!=null&&(typeof e.baseKey=="string"?l.base64.decode(e.baseKey,i.baseKey=l.newBuffer(l.base64.length(e.baseKey)),0):e.baseKey.length>=0&&(i.baseKey=e.baseKey)),e.identityKey!=null&&(typeof e.identityKey=="string"?l.base64.decode(e.identityKey,i.identityKey=l.newBuffer(l.base64.length(e.identityKey)),0):e.identityKey.length>=0&&(i.identityKey=e.identityKey)),e.message!=null&&(typeof e.message=="string"?l.base64.decode(e.message,i.message=l.newBuffer(l.base64.length(e.message)),0):e.message.length>=0&&(i.message=e.message)),i},t.toObject=function(e,i){i||(i={});var A={};return e.preKeyId!=null&&e.hasOwnProperty("preKeyId")&&(A.preKeyId=e.preKeyId,i.oneofs&&(A._preKeyId="preKeyId")),e.baseKey!=null&&e.hasOwnProperty("baseKey")&&(A.baseKey=i.bytes===String?l.base64.encode(e.baseKey,0,e.baseKey.length):i.bytes===Array?Array.prototype.slice.call(e.baseKey):e.baseKey,i.oneofs&&(A._baseKey="baseKey")),e.identityKey!=null&&e.hasOwnProperty("identityKey")&&(A.identityKey=i.bytes===String?l.base64.encode(e.identityKey,0,e.identityKey.length):i.bytes===Array?Array.prototype.slice.call(e.identityKey):e.identityKey,i.oneofs&&(A._identityKey="identityKey")),e.message!=null&&e.hasOwnProperty("message")&&(A.message=i.bytes===String?l.base64.encode(e.message,0,e.message.length):i.bytes===Array?Array.prototype.slice.call(e.message):e.message,i.oneofs&&(A._message="message")),e.registrationId!=null&&e.hasOwnProperty("registrationId")&&(A.registrationId=e.registrationId,i.oneofs&&(A._registrationId="registrationId")),e.signedPreKeyId!=null&&e.hasOwnProperty("signedPreKeyId")&&(A.signedPreKeyId=e.signedPreKeyId,i.oneofs&&(A._signedPreKeyId="signedPreKeyId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PreKeySignalMessage"},t})(),n.PremiumMessageInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.serverCampaignId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PremiumMessageInfo)return e;var i=new d.proto.PremiumMessageInfo;return e.serverCampaignId!=null&&(i.serverCampaignId=String(e.serverCampaignId)),i},t.toObject=function(e,i){i||(i={});var A={};return e.serverCampaignId!=null&&e.hasOwnProperty("serverCampaignId")&&(A.serverCampaignId=e.serverCampaignId,i.oneofs&&(A._serverCampaignId="serverCampaignId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PremiumMessageInfo"},t})(),n.PrimaryEphemeralIdentity=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.publicKey=e.bytes();break}case 2:{s.nonce=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.PrimaryEphemeralIdentity)return e;var i=new d.proto.PrimaryEphemeralIdentity;return e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,i.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(i.publicKey=e.publicKey)),e.nonce!=null&&(typeof e.nonce=="string"?l.base64.decode(e.nonce,i.nonce=l.newBuffer(l.base64.length(e.nonce)),0):e.nonce.length>=0&&(i.nonce=e.nonce)),i},t.toObject=function(e,i){i||(i={});var A={};return e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=i.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):i.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,i.oneofs&&(A._publicKey="publicKey")),e.nonce!=null&&e.hasOwnProperty("nonce")&&(A.nonce=i.bytes===String?l.base64.encode(e.nonce,0,e.nonce.length):i.bytes===Array?Array.prototype.slice.call(e.nonce):e.nonce,i.oneofs&&(A._nonce="nonce")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.PrimaryEphemeralIdentity"},t})(),n.PrivacySystemMessage=(function(){let t={},o=Object.create(t);return o[t[1]="E2EE_MSG"]=1,o[t[2]="NE2EE_SELF"]=2,o[t[3]="NE2EE_OTHER"]=3,o})(),n.ProcessedVideo=(function(){function t(a){if(this.capabilities=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.directPath=e.string();break}case 2:{s.fileSha256=e.bytes();break}case 3:{s.height=e.uint32();break}case 4:{s.width=e.uint32();break}case 5:{s.fileLength=e.uint64();break}case 6:{s.bitrate=e.uint32();break}case 7:{s.quality=e.int32();break}case 8:{s.capabilities&&s.capabilities.length||(s.capabilities=[]),s.capabilities.push(e.string());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ProcessedVideo)return e;var i=new d.proto.ProcessedVideo;switch(e.directPath!=null&&(i.directPath=String(e.directPath)),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,i.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(i.fileSha256=e.fileSha256)),e.height!=null&&(i.height=e.height>>>0),e.width!=null&&(i.width=e.width>>>0),e.fileLength!=null&&(l.Long?(i.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?i.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?i.fileLength=e.fileLength:typeof e.fileLength=="object"&&(i.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.bitrate!=null&&(i.bitrate=e.bitrate>>>0),e.quality){default:if(typeof e.quality=="number"){i.quality=e.quality;break}break;case"UNDEFINED":case 0:i.quality=0;break;case"LOW":case 1:i.quality=1;break;case"MID":case 2:i.quality=2;break;case"HIGH":case 3:i.quality=3;break}if(e.capabilities){if(!Array.isArray(e.capabilities))throw TypeError(".proto.ProcessedVideo.capabilities: array expected");i.capabilities=[];for(var A=0;A>>3){case 1:{s.companionEphemeralIdentity=e.bytes();break}case 2:{s.commitment=d.proto.CompanionCommitment.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ProloguePayload)return e;var i=new d.proto.ProloguePayload;if(e.companionEphemeralIdentity!=null&&(typeof e.companionEphemeralIdentity=="string"?l.base64.decode(e.companionEphemeralIdentity,i.companionEphemeralIdentity=l.newBuffer(l.base64.length(e.companionEphemeralIdentity)),0):e.companionEphemeralIdentity.length>=0&&(i.companionEphemeralIdentity=e.companionEphemeralIdentity)),e.commitment!=null){if(typeof e.commitment!="object")throw TypeError(".proto.ProloguePayload.commitment: object expected");i.commitment=d.proto.CompanionCommitment.fromObject(e.commitment)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.companionEphemeralIdentity!=null&&e.hasOwnProperty("companionEphemeralIdentity")&&(A.companionEphemeralIdentity=i.bytes===String?l.base64.encode(e.companionEphemeralIdentity,0,e.companionEphemeralIdentity.length):i.bytes===Array?Array.prototype.slice.call(e.companionEphemeralIdentity):e.companionEphemeralIdentity,i.oneofs&&(A._companionEphemeralIdentity="companionEphemeralIdentity")),e.commitment!=null&&e.hasOwnProperty("commitment")&&(A.commitment=d.proto.CompanionCommitment.toObject(e.commitment,i),i.oneofs&&(A._commitment="commitment")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ProloguePayload"},t})(),n.Pushname=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.string();break}case 2:{s.pushname=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Pushname)return e;var i=new d.proto.Pushname;return e.id!=null&&(i.id=String(e.id)),e.pushname!=null&&(i.pushname=String(e.pushname)),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.pushname!=null&&e.hasOwnProperty("pushname")&&(A.pushname=e.pushname,i.oneofs&&(A._pushname="pushname")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Pushname"},t})(),n.QuarantinedMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.originalData=e.bytes();break}case 2:{s.extractedText=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.QuarantinedMessage)return e;var i=new d.proto.QuarantinedMessage;return e.originalData!=null&&(typeof e.originalData=="string"?l.base64.decode(e.originalData,i.originalData=l.newBuffer(l.base64.length(e.originalData)),0):e.originalData.length>=0&&(i.originalData=e.originalData)),e.extractedText!=null&&(i.extractedText=String(e.extractedText)),i},t.toObject=function(e,i){i||(i={});var A={};return e.originalData!=null&&e.hasOwnProperty("originalData")&&(A.originalData=i.bytes===String?l.base64.encode(e.originalData,0,e.originalData.length):i.bytes===Array?Array.prototype.slice.call(e.originalData):e.originalData,i.oneofs&&(A._originalData="originalData")),e.extractedText!=null&&e.hasOwnProperty("extractedText")&&(A.extractedText=e.extractedText,i.oneofs&&(A._extractedText="extractedText")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.QuarantinedMessage"},t})(),n.Reaction=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.key=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.text=e.string();break}case 3:{s.groupingKey=e.string();break}case 4:{s.senderTimestampMs=e.int64();break}case 5:{s.unread=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Reaction)return e;var i=new d.proto.Reaction;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.Reaction.key: object expected");i.key=d.proto.MessageKey.fromObject(e.key)}return e.text!=null&&(i.text=String(e.text)),e.groupingKey!=null&&(i.groupingKey=String(e.groupingKey)),e.senderTimestampMs!=null&&(l.Long?(i.senderTimestampMs=l.Long.fromValue(e.senderTimestampMs)).unsigned=!1:typeof e.senderTimestampMs=="string"?i.senderTimestampMs=parseInt(e.senderTimestampMs,10):typeof e.senderTimestampMs=="number"?i.senderTimestampMs=e.senderTimestampMs:typeof e.senderTimestampMs=="object"&&(i.senderTimestampMs=new l.LongBits(e.senderTimestampMs.low>>>0,e.senderTimestampMs.high>>>0).toNumber())),e.unread!=null&&(i.unread=!!e.unread),i},t.toObject=function(e,i){i||(i={});var A={};return e.key!=null&&e.hasOwnProperty("key")&&(A.key=d.proto.MessageKey.toObject(e.key,i),i.oneofs&&(A._key="key")),e.text!=null&&e.hasOwnProperty("text")&&(A.text=e.text,i.oneofs&&(A._text="text")),e.groupingKey!=null&&e.hasOwnProperty("groupingKey")&&(A.groupingKey=e.groupingKey,i.oneofs&&(A._groupingKey="groupingKey")),e.senderTimestampMs!=null&&e.hasOwnProperty("senderTimestampMs")&&(typeof e.senderTimestampMs=="number"?A.senderTimestampMs=i.longs===String?String(e.senderTimestampMs):e.senderTimestampMs:A.senderTimestampMs=i.longs===String?ge(e.senderTimestampMs):i.longs===Number?ce(e.senderTimestampMs):e.senderTimestampMs,i.oneofs&&(A._senderTimestampMs="senderTimestampMs")),e.unread!=null&&e.hasOwnProperty("unread")&&(A.unread=e.unread,i.oneofs&&(A._unread="unread")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Reaction"},t})(),n.RecentEmojiWeight=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.emoji=e.string();break}case 2:{s.weight=e.float();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.RecentEmojiWeight)return e;var i=new d.proto.RecentEmojiWeight;return e.emoji!=null&&(i.emoji=String(e.emoji)),e.weight!=null&&(i.weight=Number(e.weight)),i},t.toObject=function(e,i){i||(i={});var A={};return e.emoji!=null&&e.hasOwnProperty("emoji")&&(A.emoji=e.emoji,i.oneofs&&(A._emoji="emoji")),e.weight!=null&&e.hasOwnProperty("weight")&&(A.weight=i.json&&!isFinite(e.weight)?String(e.weight):e.weight,i.oneofs&&(A._weight="weight")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.RecentEmojiWeight"},t})(),n.RecordStructure=(function(){function t(a){if(this.previousSessions=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.currentSession=d.proto.SessionStructure.decode(e,e.uint32());break}case 2:{s.previousSessions&&s.previousSessions.length||(s.previousSessions=[]),s.previousSessions.push(d.proto.SessionStructure.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.RecordStructure)return e;var i=new d.proto.RecordStructure;if(e.currentSession!=null){if(typeof e.currentSession!="object")throw TypeError(".proto.RecordStructure.currentSession: object expected");i.currentSession=d.proto.SessionStructure.fromObject(e.currentSession)}if(e.previousSessions){if(!Array.isArray(e.previousSessions))throw TypeError(".proto.RecordStructure.previousSessions: array expected");i.previousSessions=[];for(var A=0;A>>3){case 1:{s.minVersion=e.uint32();break}case 2:{s.maxVersion=e.uint32();break}case 3:{s.notReportableMinVersion=e.uint32();break}case 4:{s.never=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.Reportable)return e;var i=new d.proto.Reportable;return e.minVersion!=null&&(i.minVersion=e.minVersion>>>0),e.maxVersion!=null&&(i.maxVersion=e.maxVersion>>>0),e.notReportableMinVersion!=null&&(i.notReportableMinVersion=e.notReportableMinVersion>>>0),e.never!=null&&(i.never=!!e.never),i},t.toObject=function(e,i){i||(i={});var A={};return e.minVersion!=null&&e.hasOwnProperty("minVersion")&&(A.minVersion=e.minVersion,i.oneofs&&(A._minVersion="minVersion")),e.maxVersion!=null&&e.hasOwnProperty("maxVersion")&&(A.maxVersion=e.maxVersion,i.oneofs&&(A._maxVersion="maxVersion")),e.notReportableMinVersion!=null&&e.hasOwnProperty("notReportableMinVersion")&&(A.notReportableMinVersion=e.notReportableMinVersion,i.oneofs&&(A._notReportableMinVersion="notReportableMinVersion")),e.never!=null&&e.hasOwnProperty("never")&&(A.never=e.never,i.oneofs&&(A._never="never")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.Reportable"},t})(),n.ReportingTokenInfo=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.reportingTag=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ReportingTokenInfo)return e;var i=new d.proto.ReportingTokenInfo;return e.reportingTag!=null&&(typeof e.reportingTag=="string"?l.base64.decode(e.reportingTag,i.reportingTag=l.newBuffer(l.base64.length(e.reportingTag)),0):e.reportingTag.length>=0&&(i.reportingTag=e.reportingTag)),i},t.toObject=function(e,i){i||(i={});var A={};return e.reportingTag!=null&&e.hasOwnProperty("reportingTag")&&(A.reportingTag=i.bytes===String?l.base64.encode(e.reportingTag,0,e.reportingTag.length):i.bytes===Array?Array.prototype.slice.call(e.reportingTag):e.reportingTag,i.oneofs&&(A._reportingTag="reportingTag")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ReportingTokenInfo"},t})(),n.SenderKeyDistributionMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.uint32();break}case 2:{s.iteration=e.uint32();break}case 3:{s.chainKey=e.bytes();break}case 4:{s.signingKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SenderKeyDistributionMessage)return e;var i=new d.proto.SenderKeyDistributionMessage;return e.id!=null&&(i.id=e.id>>>0),e.iteration!=null&&(i.iteration=e.iteration>>>0),e.chainKey!=null&&(typeof e.chainKey=="string"?l.base64.decode(e.chainKey,i.chainKey=l.newBuffer(l.base64.length(e.chainKey)),0):e.chainKey.length>=0&&(i.chainKey=e.chainKey)),e.signingKey!=null&&(typeof e.signingKey=="string"?l.base64.decode(e.signingKey,i.signingKey=l.newBuffer(l.base64.length(e.signingKey)),0):e.signingKey.length>=0&&(i.signingKey=e.signingKey)),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.iteration!=null&&e.hasOwnProperty("iteration")&&(A.iteration=e.iteration,i.oneofs&&(A._iteration="iteration")),e.chainKey!=null&&e.hasOwnProperty("chainKey")&&(A.chainKey=i.bytes===String?l.base64.encode(e.chainKey,0,e.chainKey.length):i.bytes===Array?Array.prototype.slice.call(e.chainKey):e.chainKey,i.oneofs&&(A._chainKey="chainKey")),e.signingKey!=null&&e.hasOwnProperty("signingKey")&&(A.signingKey=i.bytes===String?l.base64.encode(e.signingKey,0,e.signingKey.length):i.bytes===Array?Array.prototype.slice.call(e.signingKey):e.signingKey,i.oneofs&&(A._signingKey="signingKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SenderKeyDistributionMessage"},t})(),n.SenderKeyMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.uint32();break}case 2:{s.iteration=e.uint32();break}case 3:{s.ciphertext=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SenderKeyMessage)return e;var i=new d.proto.SenderKeyMessage;return e.id!=null&&(i.id=e.id>>>0),e.iteration!=null&&(i.iteration=e.iteration>>>0),e.ciphertext!=null&&(typeof e.ciphertext=="string"?l.base64.decode(e.ciphertext,i.ciphertext=l.newBuffer(l.base64.length(e.ciphertext)),0):e.ciphertext.length>=0&&(i.ciphertext=e.ciphertext)),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.iteration!=null&&e.hasOwnProperty("iteration")&&(A.iteration=e.iteration,i.oneofs&&(A._iteration="iteration")),e.ciphertext!=null&&e.hasOwnProperty("ciphertext")&&(A.ciphertext=i.bytes===String?l.base64.encode(e.ciphertext,0,e.ciphertext.length):i.bytes===Array?Array.prototype.slice.call(e.ciphertext):e.ciphertext,i.oneofs&&(A._ciphertext="ciphertext")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SenderKeyMessage"},t})(),n.SenderKeyRecordStructure=(function(){function t(o){if(this.senderKeyStates=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.senderKeyStates&&r.senderKeyStates.length||(r.senderKeyStates=[]),r.senderKeyStates.push(d.proto.SenderKeyStateStructure.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.SenderKeyRecordStructure)return a;var e=new d.proto.SenderKeyRecordStructure;if(a.senderKeyStates){if(!Array.isArray(a.senderKeyStates))throw TypeError(".proto.SenderKeyRecordStructure.senderKeyStates: array expected");e.senderKeyStates=[];for(var i=0;i>>3){case 1:{s.senderKeyId=e.uint32();break}case 2:{s.senderChainKey=d.proto.SenderKeyStateStructure.SenderChainKey.decode(e,e.uint32());break}case 3:{s.senderSigningKey=d.proto.SenderKeyStateStructure.SenderSigningKey.decode(e,e.uint32());break}case 4:{s.senderMessageKeys&&s.senderMessageKeys.length||(s.senderMessageKeys=[]),s.senderMessageKeys.push(d.proto.SenderKeyStateStructure.SenderMessageKey.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SenderKeyStateStructure)return e;var i=new d.proto.SenderKeyStateStructure;if(e.senderKeyId!=null&&(i.senderKeyId=e.senderKeyId>>>0),e.senderChainKey!=null){if(typeof e.senderChainKey!="object")throw TypeError(".proto.SenderKeyStateStructure.senderChainKey: object expected");i.senderChainKey=d.proto.SenderKeyStateStructure.SenderChainKey.fromObject(e.senderChainKey)}if(e.senderSigningKey!=null){if(typeof e.senderSigningKey!="object")throw TypeError(".proto.SenderKeyStateStructure.senderSigningKey: object expected");i.senderSigningKey=d.proto.SenderKeyStateStructure.SenderSigningKey.fromObject(e.senderSigningKey)}if(e.senderMessageKeys){if(!Array.isArray(e.senderMessageKeys))throw TypeError(".proto.SenderKeyStateStructure.senderMessageKeys: array expected");i.senderMessageKeys=[];for(var A=0;A>>3){case 1:{c.iteration=A.uint32();break}case 2:{c.seed=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SenderKeyStateStructure.SenderChainKey)return A;var r=new d.proto.SenderKeyStateStructure.SenderChainKey;return A.iteration!=null&&(r.iteration=A.iteration>>>0),A.seed!=null&&(typeof A.seed=="string"?l.base64.decode(A.seed,r.seed=l.newBuffer(l.base64.length(A.seed)),0):A.seed.length>=0&&(r.seed=A.seed)),r},a.toObject=function(A,r){r||(r={});var s={};return A.iteration!=null&&A.hasOwnProperty("iteration")&&(s.iteration=A.iteration,r.oneofs&&(s._iteration="iteration")),A.seed!=null&&A.hasOwnProperty("seed")&&(s.seed=r.bytes===String?l.base64.encode(A.seed,0,A.seed.length):r.bytes===Array?Array.prototype.slice.call(A.seed):A.seed,r.oneofs&&(s._seed="seed")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderChainKey"},a})(),t.SenderMessageKey=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.iteration=A.uint32();break}case 2:{c.seed=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SenderKeyStateStructure.SenderMessageKey)return A;var r=new d.proto.SenderKeyStateStructure.SenderMessageKey;return A.iteration!=null&&(r.iteration=A.iteration>>>0),A.seed!=null&&(typeof A.seed=="string"?l.base64.decode(A.seed,r.seed=l.newBuffer(l.base64.length(A.seed)),0):A.seed.length>=0&&(r.seed=A.seed)),r},a.toObject=function(A,r){r||(r={});var s={};return A.iteration!=null&&A.hasOwnProperty("iteration")&&(s.iteration=A.iteration,r.oneofs&&(s._iteration="iteration")),A.seed!=null&&A.hasOwnProperty("seed")&&(s.seed=r.bytes===String?l.base64.encode(A.seed,0,A.seed.length):r.bytes===Array?Array.prototype.slice.call(A.seed):A.seed,r.oneofs&&(s._seed="seed")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderMessageKey"},a})(),t.SenderSigningKey=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.public=A.bytes();break}case 2:{c.private=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SenderKeyStateStructure.SenderSigningKey)return A;var r=new d.proto.SenderKeyStateStructure.SenderSigningKey;return A.public!=null&&(typeof A.public=="string"?l.base64.decode(A.public,r.public=l.newBuffer(l.base64.length(A.public)),0):A.public.length>=0&&(r.public=A.public)),A.private!=null&&(typeof A.private=="string"?l.base64.decode(A.private,r.private=l.newBuffer(l.base64.length(A.private)),0):A.private.length>=0&&(r.private=A.private)),r},a.toObject=function(A,r){r||(r={});var s={};return A.public!=null&&A.hasOwnProperty("public")&&(s.public=r.bytes===String?l.base64.encode(A.public,0,A.public.length):r.bytes===Array?Array.prototype.slice.call(A.public):A.public,r.oneofs&&(s._public="public")),A.private!=null&&A.hasOwnProperty("private")&&(s.private=r.bytes===String?l.base64.encode(A.private,0,A.private.length):r.bytes===Array?Array.prototype.slice.call(A.private):A.private,r.oneofs&&(s._private="private")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SenderKeyStateStructure.SenderSigningKey"},a})(),t})(),n.ServerErrorReceipt=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.stanzaId=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ServerErrorReceipt)return e;var i=new d.proto.ServerErrorReceipt;return e.stanzaId!=null&&(i.stanzaId=String(e.stanzaId)),i},t.toObject=function(e,i){i||(i={});var A={};return e.stanzaId!=null&&e.hasOwnProperty("stanzaId")&&(A.stanzaId=e.stanzaId,i.oneofs&&(A._stanzaId="stanzaId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ServerErrorReceipt"},t})(),n.SessionStructure=(function(){function t(a){if(this.receiverChains=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.sessionVersion=e.uint32();break}case 2:{s.localIdentityPublic=e.bytes();break}case 3:{s.remoteIdentityPublic=e.bytes();break}case 4:{s.rootKey=e.bytes();break}case 5:{s.previousCounter=e.uint32();break}case 6:{s.senderChain=d.proto.SessionStructure.Chain.decode(e,e.uint32());break}case 7:{s.receiverChains&&s.receiverChains.length||(s.receiverChains=[]),s.receiverChains.push(d.proto.SessionStructure.Chain.decode(e,e.uint32()));break}case 8:{s.pendingKeyExchange=d.proto.SessionStructure.PendingKeyExchange.decode(e,e.uint32());break}case 9:{s.pendingPreKey=d.proto.SessionStructure.PendingPreKey.decode(e,e.uint32());break}case 10:{s.remoteRegistrationId=e.uint32();break}case 11:{s.localRegistrationId=e.uint32();break}case 12:{s.needsRefresh=e.bool();break}case 13:{s.aliceBaseKey=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SessionStructure)return e;var i=new d.proto.SessionStructure;if(e.sessionVersion!=null&&(i.sessionVersion=e.sessionVersion>>>0),e.localIdentityPublic!=null&&(typeof e.localIdentityPublic=="string"?l.base64.decode(e.localIdentityPublic,i.localIdentityPublic=l.newBuffer(l.base64.length(e.localIdentityPublic)),0):e.localIdentityPublic.length>=0&&(i.localIdentityPublic=e.localIdentityPublic)),e.remoteIdentityPublic!=null&&(typeof e.remoteIdentityPublic=="string"?l.base64.decode(e.remoteIdentityPublic,i.remoteIdentityPublic=l.newBuffer(l.base64.length(e.remoteIdentityPublic)),0):e.remoteIdentityPublic.length>=0&&(i.remoteIdentityPublic=e.remoteIdentityPublic)),e.rootKey!=null&&(typeof e.rootKey=="string"?l.base64.decode(e.rootKey,i.rootKey=l.newBuffer(l.base64.length(e.rootKey)),0):e.rootKey.length>=0&&(i.rootKey=e.rootKey)),e.previousCounter!=null&&(i.previousCounter=e.previousCounter>>>0),e.senderChain!=null){if(typeof e.senderChain!="object")throw TypeError(".proto.SessionStructure.senderChain: object expected");i.senderChain=d.proto.SessionStructure.Chain.fromObject(e.senderChain)}if(e.receiverChains){if(!Array.isArray(e.receiverChains))throw TypeError(".proto.SessionStructure.receiverChains: array expected");i.receiverChains=[];for(var A=0;A>>0),e.localRegistrationId!=null&&(i.localRegistrationId=e.localRegistrationId>>>0),e.needsRefresh!=null&&(i.needsRefresh=!!e.needsRefresh),e.aliceBaseKey!=null&&(typeof e.aliceBaseKey=="string"?l.base64.decode(e.aliceBaseKey,i.aliceBaseKey=l.newBuffer(l.base64.length(e.aliceBaseKey)),0):e.aliceBaseKey.length>=0&&(i.aliceBaseKey=e.aliceBaseKey)),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.receiverChains=[]),e.sessionVersion!=null&&e.hasOwnProperty("sessionVersion")&&(A.sessionVersion=e.sessionVersion,i.oneofs&&(A._sessionVersion="sessionVersion")),e.localIdentityPublic!=null&&e.hasOwnProperty("localIdentityPublic")&&(A.localIdentityPublic=i.bytes===String?l.base64.encode(e.localIdentityPublic,0,e.localIdentityPublic.length):i.bytes===Array?Array.prototype.slice.call(e.localIdentityPublic):e.localIdentityPublic,i.oneofs&&(A._localIdentityPublic="localIdentityPublic")),e.remoteIdentityPublic!=null&&e.hasOwnProperty("remoteIdentityPublic")&&(A.remoteIdentityPublic=i.bytes===String?l.base64.encode(e.remoteIdentityPublic,0,e.remoteIdentityPublic.length):i.bytes===Array?Array.prototype.slice.call(e.remoteIdentityPublic):e.remoteIdentityPublic,i.oneofs&&(A._remoteIdentityPublic="remoteIdentityPublic")),e.rootKey!=null&&e.hasOwnProperty("rootKey")&&(A.rootKey=i.bytes===String?l.base64.encode(e.rootKey,0,e.rootKey.length):i.bytes===Array?Array.prototype.slice.call(e.rootKey):e.rootKey,i.oneofs&&(A._rootKey="rootKey")),e.previousCounter!=null&&e.hasOwnProperty("previousCounter")&&(A.previousCounter=e.previousCounter,i.oneofs&&(A._previousCounter="previousCounter")),e.senderChain!=null&&e.hasOwnProperty("senderChain")&&(A.senderChain=d.proto.SessionStructure.Chain.toObject(e.senderChain,i),i.oneofs&&(A._senderChain="senderChain")),e.receiverChains&&e.receiverChains.length){A.receiverChains=[];for(var r=0;r>>3){case 1:{c.senderRatchetKey=A.bytes();break}case 2:{c.senderRatchetKeyPrivate=A.bytes();break}case 3:{c.chainKey=d.proto.SessionStructure.Chain.ChainKey.decode(A,A.uint32());break}case 4:{c.messageKeys&&c.messageKeys.length||(c.messageKeys=[]),c.messageKeys.push(d.proto.SessionStructure.Chain.MessageKey.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SessionStructure.Chain)return A;var r=new d.proto.SessionStructure.Chain;if(A.senderRatchetKey!=null&&(typeof A.senderRatchetKey=="string"?l.base64.decode(A.senderRatchetKey,r.senderRatchetKey=l.newBuffer(l.base64.length(A.senderRatchetKey)),0):A.senderRatchetKey.length>=0&&(r.senderRatchetKey=A.senderRatchetKey)),A.senderRatchetKeyPrivate!=null&&(typeof A.senderRatchetKeyPrivate=="string"?l.base64.decode(A.senderRatchetKeyPrivate,r.senderRatchetKeyPrivate=l.newBuffer(l.base64.length(A.senderRatchetKeyPrivate)),0):A.senderRatchetKeyPrivate.length>=0&&(r.senderRatchetKeyPrivate=A.senderRatchetKeyPrivate)),A.chainKey!=null){if(typeof A.chainKey!="object")throw TypeError(".proto.SessionStructure.Chain.chainKey: object expected");r.chainKey=d.proto.SessionStructure.Chain.ChainKey.fromObject(A.chainKey)}if(A.messageKeys){if(!Array.isArray(A.messageKeys))throw TypeError(".proto.SessionStructure.Chain.messageKeys: array expected");r.messageKeys=[];for(var s=0;s>>3){case 1:{p.index=s.uint32();break}case 2:{p.key=s.bytes();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.SessionStructure.Chain.ChainKey)return s;var g=new d.proto.SessionStructure.Chain.ChainKey;return s.index!=null&&(g.index=s.index>>>0),s.key!=null&&(typeof s.key=="string"?l.base64.decode(s.key,g.key=l.newBuffer(l.base64.length(s.key)),0):s.key.length>=0&&(g.key=s.key)),g},i.toObject=function(s,g){g||(g={});var c={};return s.index!=null&&s.hasOwnProperty("index")&&(c.index=s.index,g.oneofs&&(c._index="index")),s.key!=null&&s.hasOwnProperty("key")&&(c.key=g.bytes===String?l.base64.encode(s.key,0,s.key.length):g.bytes===Array?Array.prototype.slice.call(s.key):s.key,g.oneofs&&(c._key="key")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.SessionStructure.Chain.ChainKey"},i})(),a.MessageKey=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.index=s.uint32();break}case 2:{p.cipherKey=s.bytes();break}case 3:{p.macKey=s.bytes();break}case 4:{p.iv=s.bytes();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.SessionStructure.Chain.MessageKey)return s;var g=new d.proto.SessionStructure.Chain.MessageKey;return s.index!=null&&(g.index=s.index>>>0),s.cipherKey!=null&&(typeof s.cipherKey=="string"?l.base64.decode(s.cipherKey,g.cipherKey=l.newBuffer(l.base64.length(s.cipherKey)),0):s.cipherKey.length>=0&&(g.cipherKey=s.cipherKey)),s.macKey!=null&&(typeof s.macKey=="string"?l.base64.decode(s.macKey,g.macKey=l.newBuffer(l.base64.length(s.macKey)),0):s.macKey.length>=0&&(g.macKey=s.macKey)),s.iv!=null&&(typeof s.iv=="string"?l.base64.decode(s.iv,g.iv=l.newBuffer(l.base64.length(s.iv)),0):s.iv.length>=0&&(g.iv=s.iv)),g},i.toObject=function(s,g){g||(g={});var c={};return s.index!=null&&s.hasOwnProperty("index")&&(c.index=s.index,g.oneofs&&(c._index="index")),s.cipherKey!=null&&s.hasOwnProperty("cipherKey")&&(c.cipherKey=g.bytes===String?l.base64.encode(s.cipherKey,0,s.cipherKey.length):g.bytes===Array?Array.prototype.slice.call(s.cipherKey):s.cipherKey,g.oneofs&&(c._cipherKey="cipherKey")),s.macKey!=null&&s.hasOwnProperty("macKey")&&(c.macKey=g.bytes===String?l.base64.encode(s.macKey,0,s.macKey.length):g.bytes===Array?Array.prototype.slice.call(s.macKey):s.macKey,g.oneofs&&(c._macKey="macKey")),s.iv!=null&&s.hasOwnProperty("iv")&&(c.iv=g.bytes===String?l.base64.encode(s.iv,0,s.iv.length):g.bytes===Array?Array.prototype.slice.call(s.iv):s.iv,g.oneofs&&(c._iv="iv")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.SessionStructure.Chain.MessageKey"},i})(),a})(),t.PendingKeyExchange=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.sequence=A.uint32();break}case 2:{c.localBaseKey=A.bytes();break}case 3:{c.localBaseKeyPrivate=A.bytes();break}case 4:{c.localRatchetKey=A.bytes();break}case 5:{c.localRatchetKeyPrivate=A.bytes();break}case 7:{c.localIdentityKey=A.bytes();break}case 8:{c.localIdentityKeyPrivate=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SessionStructure.PendingKeyExchange)return A;var r=new d.proto.SessionStructure.PendingKeyExchange;return A.sequence!=null&&(r.sequence=A.sequence>>>0),A.localBaseKey!=null&&(typeof A.localBaseKey=="string"?l.base64.decode(A.localBaseKey,r.localBaseKey=l.newBuffer(l.base64.length(A.localBaseKey)),0):A.localBaseKey.length>=0&&(r.localBaseKey=A.localBaseKey)),A.localBaseKeyPrivate!=null&&(typeof A.localBaseKeyPrivate=="string"?l.base64.decode(A.localBaseKeyPrivate,r.localBaseKeyPrivate=l.newBuffer(l.base64.length(A.localBaseKeyPrivate)),0):A.localBaseKeyPrivate.length>=0&&(r.localBaseKeyPrivate=A.localBaseKeyPrivate)),A.localRatchetKey!=null&&(typeof A.localRatchetKey=="string"?l.base64.decode(A.localRatchetKey,r.localRatchetKey=l.newBuffer(l.base64.length(A.localRatchetKey)),0):A.localRatchetKey.length>=0&&(r.localRatchetKey=A.localRatchetKey)),A.localRatchetKeyPrivate!=null&&(typeof A.localRatchetKeyPrivate=="string"?l.base64.decode(A.localRatchetKeyPrivate,r.localRatchetKeyPrivate=l.newBuffer(l.base64.length(A.localRatchetKeyPrivate)),0):A.localRatchetKeyPrivate.length>=0&&(r.localRatchetKeyPrivate=A.localRatchetKeyPrivate)),A.localIdentityKey!=null&&(typeof A.localIdentityKey=="string"?l.base64.decode(A.localIdentityKey,r.localIdentityKey=l.newBuffer(l.base64.length(A.localIdentityKey)),0):A.localIdentityKey.length>=0&&(r.localIdentityKey=A.localIdentityKey)),A.localIdentityKeyPrivate!=null&&(typeof A.localIdentityKeyPrivate=="string"?l.base64.decode(A.localIdentityKeyPrivate,r.localIdentityKeyPrivate=l.newBuffer(l.base64.length(A.localIdentityKeyPrivate)),0):A.localIdentityKeyPrivate.length>=0&&(r.localIdentityKeyPrivate=A.localIdentityKeyPrivate)),r},a.toObject=function(A,r){r||(r={});var s={};return A.sequence!=null&&A.hasOwnProperty("sequence")&&(s.sequence=A.sequence,r.oneofs&&(s._sequence="sequence")),A.localBaseKey!=null&&A.hasOwnProperty("localBaseKey")&&(s.localBaseKey=r.bytes===String?l.base64.encode(A.localBaseKey,0,A.localBaseKey.length):r.bytes===Array?Array.prototype.slice.call(A.localBaseKey):A.localBaseKey,r.oneofs&&(s._localBaseKey="localBaseKey")),A.localBaseKeyPrivate!=null&&A.hasOwnProperty("localBaseKeyPrivate")&&(s.localBaseKeyPrivate=r.bytes===String?l.base64.encode(A.localBaseKeyPrivate,0,A.localBaseKeyPrivate.length):r.bytes===Array?Array.prototype.slice.call(A.localBaseKeyPrivate):A.localBaseKeyPrivate,r.oneofs&&(s._localBaseKeyPrivate="localBaseKeyPrivate")),A.localRatchetKey!=null&&A.hasOwnProperty("localRatchetKey")&&(s.localRatchetKey=r.bytes===String?l.base64.encode(A.localRatchetKey,0,A.localRatchetKey.length):r.bytes===Array?Array.prototype.slice.call(A.localRatchetKey):A.localRatchetKey,r.oneofs&&(s._localRatchetKey="localRatchetKey")),A.localRatchetKeyPrivate!=null&&A.hasOwnProperty("localRatchetKeyPrivate")&&(s.localRatchetKeyPrivate=r.bytes===String?l.base64.encode(A.localRatchetKeyPrivate,0,A.localRatchetKeyPrivate.length):r.bytes===Array?Array.prototype.slice.call(A.localRatchetKeyPrivate):A.localRatchetKeyPrivate,r.oneofs&&(s._localRatchetKeyPrivate="localRatchetKeyPrivate")),A.localIdentityKey!=null&&A.hasOwnProperty("localIdentityKey")&&(s.localIdentityKey=r.bytes===String?l.base64.encode(A.localIdentityKey,0,A.localIdentityKey.length):r.bytes===Array?Array.prototype.slice.call(A.localIdentityKey):A.localIdentityKey,r.oneofs&&(s._localIdentityKey="localIdentityKey")),A.localIdentityKeyPrivate!=null&&A.hasOwnProperty("localIdentityKeyPrivate")&&(s.localIdentityKeyPrivate=r.bytes===String?l.base64.encode(A.localIdentityKeyPrivate,0,A.localIdentityKeyPrivate.length):r.bytes===Array?Array.prototype.slice.call(A.localIdentityKeyPrivate):A.localIdentityKeyPrivate,r.oneofs&&(s._localIdentityKeyPrivate="localIdentityKeyPrivate")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SessionStructure.PendingKeyExchange"},a})(),t.PendingPreKey=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.preKeyId=A.uint32();break}case 3:{c.signedPreKeyId=A.int32();break}case 2:{c.baseKey=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SessionStructure.PendingPreKey)return A;var r=new d.proto.SessionStructure.PendingPreKey;return A.preKeyId!=null&&(r.preKeyId=A.preKeyId>>>0),A.signedPreKeyId!=null&&(r.signedPreKeyId=A.signedPreKeyId|0),A.baseKey!=null&&(typeof A.baseKey=="string"?l.base64.decode(A.baseKey,r.baseKey=l.newBuffer(l.base64.length(A.baseKey)),0):A.baseKey.length>=0&&(r.baseKey=A.baseKey)),r},a.toObject=function(A,r){r||(r={});var s={};return A.preKeyId!=null&&A.hasOwnProperty("preKeyId")&&(s.preKeyId=A.preKeyId,r.oneofs&&(s._preKeyId="preKeyId")),A.baseKey!=null&&A.hasOwnProperty("baseKey")&&(s.baseKey=r.bytes===String?l.base64.encode(A.baseKey,0,A.baseKey.length):r.bytes===Array?Array.prototype.slice.call(A.baseKey):A.baseKey,r.oneofs&&(s._baseKey="baseKey")),A.signedPreKeyId!=null&&A.hasOwnProperty("signedPreKeyId")&&(s.signedPreKeyId=A.signedPreKeyId,r.oneofs&&(s._signedPreKeyId="signedPreKeyId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SessionStructure.PendingPreKey"},a})(),t})(),n.SessionTransparencyMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.disclaimerText=e.string();break}case 2:{s.hcaId=e.string();break}case 3:{s.sessionTransparencyType=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SessionTransparencyMetadata)return e;var i=new d.proto.SessionTransparencyMetadata;switch(e.disclaimerText!=null&&(i.disclaimerText=String(e.disclaimerText)),e.hcaId!=null&&(i.hcaId=String(e.hcaId)),e.sessionTransparencyType){default:if(typeof e.sessionTransparencyType=="number"){i.sessionTransparencyType=e.sessionTransparencyType;break}break;case"UNKNOWN_TYPE":case 0:i.sessionTransparencyType=0;break;case"NY_AI_SAFETY_DISCLAIMER":case 1:i.sessionTransparencyType=1;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.disclaimerText!=null&&e.hasOwnProperty("disclaimerText")&&(A.disclaimerText=e.disclaimerText,i.oneofs&&(A._disclaimerText="disclaimerText")),e.hcaId!=null&&e.hasOwnProperty("hcaId")&&(A.hcaId=e.hcaId,i.oneofs&&(A._hcaId="hcaId")),e.sessionTransparencyType!=null&&e.hasOwnProperty("sessionTransparencyType")&&(A.sessionTransparencyType=i.enums===String?d.proto.SessionTransparencyType[e.sessionTransparencyType]===void 0?e.sessionTransparencyType:d.proto.SessionTransparencyType[e.sessionTransparencyType]:e.sessionTransparencyType,i.oneofs&&(A._sessionTransparencyType="sessionTransparencyType")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SessionTransparencyMetadata"},t})(),n.SessionTransparencyType=(function(){let t={},o=Object.create(t);return o[t[0]="UNKNOWN_TYPE"]=0,o[t[1]="NY_AI_SAFETY_DISCLAIMER"]=1,o})(),n.SignalMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.ratchetKey=e.bytes();break}case 2:{s.counter=e.uint32();break}case 3:{s.previousCounter=e.uint32();break}case 4:{s.ciphertext=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SignalMessage)return e;var i=new d.proto.SignalMessage;return e.ratchetKey!=null&&(typeof e.ratchetKey=="string"?l.base64.decode(e.ratchetKey,i.ratchetKey=l.newBuffer(l.base64.length(e.ratchetKey)),0):e.ratchetKey.length>=0&&(i.ratchetKey=e.ratchetKey)),e.counter!=null&&(i.counter=e.counter>>>0),e.previousCounter!=null&&(i.previousCounter=e.previousCounter>>>0),e.ciphertext!=null&&(typeof e.ciphertext=="string"?l.base64.decode(e.ciphertext,i.ciphertext=l.newBuffer(l.base64.length(e.ciphertext)),0):e.ciphertext.length>=0&&(i.ciphertext=e.ciphertext)),i},t.toObject=function(e,i){i||(i={});var A={};return e.ratchetKey!=null&&e.hasOwnProperty("ratchetKey")&&(A.ratchetKey=i.bytes===String?l.base64.encode(e.ratchetKey,0,e.ratchetKey.length):i.bytes===Array?Array.prototype.slice.call(e.ratchetKey):e.ratchetKey,i.oneofs&&(A._ratchetKey="ratchetKey")),e.counter!=null&&e.hasOwnProperty("counter")&&(A.counter=e.counter,i.oneofs&&(A._counter="counter")),e.previousCounter!=null&&e.hasOwnProperty("previousCounter")&&(A.previousCounter=e.previousCounter,i.oneofs&&(A._previousCounter="previousCounter")),e.ciphertext!=null&&e.hasOwnProperty("ciphertext")&&(A.ciphertext=i.bytes===String?l.base64.encode(e.ciphertext,0,e.ciphertext.length):i.bytes===Array?Array.prototype.slice.call(e.ciphertext):e.ciphertext,i.oneofs&&(A._ciphertext="ciphertext")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SignalMessage"},t})(),n.SignedPreKeyRecordStructure=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.id=e.uint32();break}case 2:{s.publicKey=e.bytes();break}case 3:{s.privateKey=e.bytes();break}case 4:{s.signature=e.bytes();break}case 5:{s.timestamp=e.fixed64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SignedPreKeyRecordStructure)return e;var i=new d.proto.SignedPreKeyRecordStructure;return e.id!=null&&(i.id=e.id>>>0),e.publicKey!=null&&(typeof e.publicKey=="string"?l.base64.decode(e.publicKey,i.publicKey=l.newBuffer(l.base64.length(e.publicKey)),0):e.publicKey.length>=0&&(i.publicKey=e.publicKey)),e.privateKey!=null&&(typeof e.privateKey=="string"?l.base64.decode(e.privateKey,i.privateKey=l.newBuffer(l.base64.length(e.privateKey)),0):e.privateKey.length>=0&&(i.privateKey=e.privateKey)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,i.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(i.signature=e.signature)),e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),i},t.toObject=function(e,i){i||(i={});var A={};return e.id!=null&&e.hasOwnProperty("id")&&(A.id=e.id,i.oneofs&&(A._id="id")),e.publicKey!=null&&e.hasOwnProperty("publicKey")&&(A.publicKey=i.bytes===String?l.base64.encode(e.publicKey,0,e.publicKey.length):i.bytes===Array?Array.prototype.slice.call(e.publicKey):e.publicKey,i.oneofs&&(A._publicKey="publicKey")),e.privateKey!=null&&e.hasOwnProperty("privateKey")&&(A.privateKey=i.bytes===String?l.base64.encode(e.privateKey,0,e.privateKey.length):i.bytes===Array?Array.prototype.slice.call(e.privateKey):e.privateKey,i.oneofs&&(A._privateKey="privateKey")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=i.bytes===String?l.base64.encode(e.signature,0,e.signature.length):i.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,i.oneofs&&(A._signature="signature")),e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=i.longs===String?String(e.timestamp):e.timestamp:A.timestamp=i.longs===String?ge(e.timestamp):i.longs===Number?ce(e.timestamp):e.timestamp,i.oneofs&&(A._timestamp="timestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SignedPreKeyRecordStructure"},t})(),n.StatusAttribution=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.type=e.int32();break}case 2:{s.actionUrl=e.string();break}case 3:{s.statusReshare=d.proto.StatusAttribution.StatusReshare.decode(e,e.uint32());break}case 4:{s.externalShare=d.proto.StatusAttribution.ExternalShare.decode(e,e.uint32());break}case 5:{s.music=d.proto.StatusAttribution.Music.decode(e,e.uint32());break}case 6:{s.groupStatus=d.proto.StatusAttribution.GroupStatus.decode(e,e.uint32());break}case 7:{s.rlAttribution=d.proto.StatusAttribution.RLAttribution.decode(e,e.uint32());break}case 8:{s.aiCreatedAttribution=d.proto.StatusAttribution.AiCreatedAttribution.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.StatusAttribution)return e;var i=new d.proto.StatusAttribution;switch(e.type){default:if(typeof e.type=="number"){i.type=e.type;break}break;case"UNKNOWN":case 0:i.type=0;break;case"RESHARE":case 1:i.type=1;break;case"EXTERNAL_SHARE":case 2:i.type=2;break;case"MUSIC":case 3:i.type=3;break;case"STATUS_MENTION":case 4:i.type=4;break;case"GROUP_STATUS":case 5:i.type=5;break;case"RL_ATTRIBUTION":case 6:i.type=6;break;case"AI_CREATED":case 7:i.type=7;break;case"LAYOUTS":case 8:i.type=8;break}if(e.actionUrl!=null&&(i.actionUrl=String(e.actionUrl)),e.statusReshare!=null){if(typeof e.statusReshare!="object")throw TypeError(".proto.StatusAttribution.statusReshare: object expected");i.statusReshare=d.proto.StatusAttribution.StatusReshare.fromObject(e.statusReshare)}if(e.externalShare!=null){if(typeof e.externalShare!="object")throw TypeError(".proto.StatusAttribution.externalShare: object expected");i.externalShare=d.proto.StatusAttribution.ExternalShare.fromObject(e.externalShare)}if(e.music!=null){if(typeof e.music!="object")throw TypeError(".proto.StatusAttribution.music: object expected");i.music=d.proto.StatusAttribution.Music.fromObject(e.music)}if(e.groupStatus!=null){if(typeof e.groupStatus!="object")throw TypeError(".proto.StatusAttribution.groupStatus: object expected");i.groupStatus=d.proto.StatusAttribution.GroupStatus.fromObject(e.groupStatus)}if(e.rlAttribution!=null){if(typeof e.rlAttribution!="object")throw TypeError(".proto.StatusAttribution.rlAttribution: object expected");i.rlAttribution=d.proto.StatusAttribution.RLAttribution.fromObject(e.rlAttribution)}if(e.aiCreatedAttribution!=null){if(typeof e.aiCreatedAttribution!="object")throw TypeError(".proto.StatusAttribution.aiCreatedAttribution: object expected");i.aiCreatedAttribution=d.proto.StatusAttribution.AiCreatedAttribution.fromObject(e.aiCreatedAttribution)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.type!=null&&e.hasOwnProperty("type")&&(A.type=i.enums===String?d.proto.StatusAttribution.Type[e.type]===void 0?e.type:d.proto.StatusAttribution.Type[e.type]:e.type,i.oneofs&&(A._type="type")),e.actionUrl!=null&&e.hasOwnProperty("actionUrl")&&(A.actionUrl=e.actionUrl,i.oneofs&&(A._actionUrl="actionUrl")),e.statusReshare!=null&&e.hasOwnProperty("statusReshare")&&(A.statusReshare=d.proto.StatusAttribution.StatusReshare.toObject(e.statusReshare,i),i.oneofs&&(A.attributionData="statusReshare")),e.externalShare!=null&&e.hasOwnProperty("externalShare")&&(A.externalShare=d.proto.StatusAttribution.ExternalShare.toObject(e.externalShare,i),i.oneofs&&(A.attributionData="externalShare")),e.music!=null&&e.hasOwnProperty("music")&&(A.music=d.proto.StatusAttribution.Music.toObject(e.music,i),i.oneofs&&(A.attributionData="music")),e.groupStatus!=null&&e.hasOwnProperty("groupStatus")&&(A.groupStatus=d.proto.StatusAttribution.GroupStatus.toObject(e.groupStatus,i),i.oneofs&&(A.attributionData="groupStatus")),e.rlAttribution!=null&&e.hasOwnProperty("rlAttribution")&&(A.rlAttribution=d.proto.StatusAttribution.RLAttribution.toObject(e.rlAttribution,i),i.oneofs&&(A.attributionData="rlAttribution")),e.aiCreatedAttribution!=null&&e.hasOwnProperty("aiCreatedAttribution")&&(A.aiCreatedAttribution=d.proto.StatusAttribution.AiCreatedAttribution.toObject(e.aiCreatedAttribution,i),i.oneofs&&(A.attributionData="aiCreatedAttribution")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusAttribution"},t.AiCreatedAttribution=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.source=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.StatusAttribution.AiCreatedAttribution)return A;var r=new d.proto.StatusAttribution.AiCreatedAttribution;switch(A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"STATUS_MIMICRY":case 1:r.source=1;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?d.proto.StatusAttribution.AiCreatedAttribution.Source[A.source]===void 0?A.source:d.proto.StatusAttribution.AiCreatedAttribution.Source[A.source]:A.source,r.oneofs&&(s._source="source")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.AiCreatedAttribution"},a.Source=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="STATUS_MIMICRY"]=1,A})(),a})(),t.ExternalShare=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.actionUrl=A.string();break}case 2:{c.source=A.int32();break}case 3:{c.duration=A.int32();break}case 4:{c.actionFallbackUrl=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.StatusAttribution.ExternalShare)return A;var r=new d.proto.StatusAttribution.ExternalShare;switch(A.actionUrl!=null&&(r.actionUrl=String(A.actionUrl)),A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"INSTAGRAM":case 1:r.source=1;break;case"FACEBOOK":case 2:r.source=2;break;case"MESSENGER":case 3:r.source=3;break;case"SPOTIFY":case 4:r.source=4;break;case"YOUTUBE":case 5:r.source=5;break;case"PINTEREST":case 6:r.source=6;break;case"THREADS":case 7:r.source=7;break;case"APPLE_MUSIC":case 8:r.source=8;break;case"SHARECHAT":case 9:r.source=9;break;case"GOOGLE_PHOTOS":case 10:r.source=10;break}return A.duration!=null&&(r.duration=A.duration|0),A.actionFallbackUrl!=null&&(r.actionFallbackUrl=String(A.actionFallbackUrl)),r},a.toObject=function(A,r){r||(r={});var s={};return A.actionUrl!=null&&A.hasOwnProperty("actionUrl")&&(s.actionUrl=A.actionUrl,r.oneofs&&(s._actionUrl="actionUrl")),A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?d.proto.StatusAttribution.ExternalShare.Source[A.source]===void 0?A.source:d.proto.StatusAttribution.ExternalShare.Source[A.source]:A.source,r.oneofs&&(s._source="source")),A.duration!=null&&A.hasOwnProperty("duration")&&(s.duration=A.duration,r.oneofs&&(s._duration="duration")),A.actionFallbackUrl!=null&&A.hasOwnProperty("actionFallbackUrl")&&(s.actionFallbackUrl=A.actionFallbackUrl,r.oneofs&&(s._actionFallbackUrl="actionFallbackUrl")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.ExternalShare"},a.Source=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="INSTAGRAM"]=1,A[i[2]="FACEBOOK"]=2,A[i[3]="MESSENGER"]=3,A[i[4]="SPOTIFY"]=4,A[i[5]="YOUTUBE"]=5,A[i[6]="PINTEREST"]=6,A[i[7]="THREADS"]=7,A[i[8]="APPLE_MUSIC"]=8,A[i[9]="SHARECHAT"]=9,A[i[10]="GOOGLE_PHOTOS"]=10,A})(),a})(),t.GroupStatus=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.authorJid=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.StatusAttribution.GroupStatus)return A;var r=new d.proto.StatusAttribution.GroupStatus;return A.authorJid!=null&&(r.authorJid=String(A.authorJid)),r},a.toObject=function(A,r){r||(r={});var s={};return A.authorJid!=null&&A.hasOwnProperty("authorJid")&&(s.authorJid=A.authorJid,r.oneofs&&(s._authorJid="authorJid")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.GroupStatus"},a})(),t.Music=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.authorName=A.string();break}case 2:{c.songId=A.string();break}case 3:{c.title=A.string();break}case 4:{c.author=A.string();break}case 5:{c.artistAttribution=A.string();break}case 6:{c.isExplicit=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.StatusAttribution.Music)return A;var r=new d.proto.StatusAttribution.Music;return A.authorName!=null&&(r.authorName=String(A.authorName)),A.songId!=null&&(r.songId=String(A.songId)),A.title!=null&&(r.title=String(A.title)),A.author!=null&&(r.author=String(A.author)),A.artistAttribution!=null&&(r.artistAttribution=String(A.artistAttribution)),A.isExplicit!=null&&(r.isExplicit=!!A.isExplicit),r},a.toObject=function(A,r){r||(r={});var s={};return A.authorName!=null&&A.hasOwnProperty("authorName")&&(s.authorName=A.authorName,r.oneofs&&(s._authorName="authorName")),A.songId!=null&&A.hasOwnProperty("songId")&&(s.songId=A.songId,r.oneofs&&(s._songId="songId")),A.title!=null&&A.hasOwnProperty("title")&&(s.title=A.title,r.oneofs&&(s._title="title")),A.author!=null&&A.hasOwnProperty("author")&&(s.author=A.author,r.oneofs&&(s._author="author")),A.artistAttribution!=null&&A.hasOwnProperty("artistAttribution")&&(s.artistAttribution=A.artistAttribution,r.oneofs&&(s._artistAttribution="artistAttribution")),A.isExplicit!=null&&A.hasOwnProperty("isExplicit")&&(s.isExplicit=A.isExplicit,r.oneofs&&(s._isExplicit="isExplicit")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.Music"},a})(),t.RLAttribution=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.source=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.StatusAttribution.RLAttribution)return A;var r=new d.proto.StatusAttribution.RLAttribution;switch(A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"RAY_BAN_META_GLASSES":case 1:r.source=1;break;case"OAKLEY_META_GLASSES":case 2:r.source=2;break;case"HYPERNOVA_GLASSES":case 3:r.source=3;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?d.proto.StatusAttribution.RLAttribution.Source[A.source]===void 0?A.source:d.proto.StatusAttribution.RLAttribution.Source[A.source]:A.source,r.oneofs&&(s._source="source")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.RLAttribution"},a.Source=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="RAY_BAN_META_GLASSES"]=1,A[i[2]="OAKLEY_META_GLASSES"]=2,A[i[3]="HYPERNOVA_GLASSES"]=3,A})(),a})(),t.StatusReshare=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.source=A.int32();break}case 2:{c.metadata=d.proto.StatusAttribution.StatusReshare.Metadata.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.StatusAttribution.StatusReshare)return A;var r=new d.proto.StatusAttribution.StatusReshare;switch(A.source){default:if(typeof A.source=="number"){r.source=A.source;break}break;case"UNKNOWN":case 0:r.source=0;break;case"INTERNAL_RESHARE":case 1:r.source=1;break;case"MENTION_RESHARE":case 2:r.source=2;break;case"CHANNEL_RESHARE":case 3:r.source=3;break;case"FORWARD":case 4:r.source=4;break}if(A.metadata!=null){if(typeof A.metadata!="object")throw TypeError(".proto.StatusAttribution.StatusReshare.metadata: object expected");r.metadata=d.proto.StatusAttribution.StatusReshare.Metadata.fromObject(A.metadata)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.source!=null&&A.hasOwnProperty("source")&&(s.source=r.enums===String?d.proto.StatusAttribution.StatusReshare.Source[A.source]===void 0?A.source:d.proto.StatusAttribution.StatusReshare.Source[A.source]:A.source,r.oneofs&&(s._source="source")),A.metadata!=null&&A.hasOwnProperty("metadata")&&(s.metadata=d.proto.StatusAttribution.StatusReshare.Metadata.toObject(A.metadata,r),r.oneofs&&(s._metadata="metadata")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.StatusAttribution.StatusReshare"},a.Metadata=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.duration=s.int32();break}case 2:{p.channelJid=s.string();break}case 3:{p.channelMessageId=s.int32();break}case 4:{p.hasMultipleReshares=s.bool();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.StatusAttribution.StatusReshare.Metadata)return s;var g=new d.proto.StatusAttribution.StatusReshare.Metadata;return s.duration!=null&&(g.duration=s.duration|0),s.channelJid!=null&&(g.channelJid=String(s.channelJid)),s.channelMessageId!=null&&(g.channelMessageId=s.channelMessageId|0),s.hasMultipleReshares!=null&&(g.hasMultipleReshares=!!s.hasMultipleReshares),g},i.toObject=function(s,g){g||(g={});var c={};return s.duration!=null&&s.hasOwnProperty("duration")&&(c.duration=s.duration,g.oneofs&&(c._duration="duration")),s.channelJid!=null&&s.hasOwnProperty("channelJid")&&(c.channelJid=s.channelJid,g.oneofs&&(c._channelJid="channelJid")),s.channelMessageId!=null&&s.hasOwnProperty("channelMessageId")&&(c.channelMessageId=s.channelMessageId,g.oneofs&&(c._channelMessageId="channelMessageId")),s.hasMultipleReshares!=null&&s.hasOwnProperty("hasMultipleReshares")&&(c.hasMultipleReshares=s.hasMultipleReshares,g.oneofs&&(c._hasMultipleReshares="hasMultipleReshares")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.StatusAttribution.StatusReshare.Metadata"},i})(),a.Source=(function(){let i={},A=Object.create(i);return A[i[0]="UNKNOWN"]=0,A[i[1]="INTERNAL_RESHARE"]=1,A[i[2]="MENTION_RESHARE"]=2,A[i[3]="CHANNEL_RESHARE"]=3,A[i[4]="FORWARD"]=4,A})(),a})(),t.Type=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="RESHARE"]=1,e[a[2]="EXTERNAL_SHARE"]=2,e[a[3]="MUSIC"]=3,e[a[4]="STATUS_MENTION"]=4,e[a[5]="GROUP_STATUS"]=5,e[a[6]="RL_ATTRIBUTION"]=6,e[a[7]="AI_CREATED"]=7,e[a[8]="LAYOUTS"]=8,e})(),t})(),n.StatusMentionMessage=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.quotedStatus=d.proto.Message.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.StatusMentionMessage)return e;var i=new d.proto.StatusMentionMessage;if(e.quotedStatus!=null){if(typeof e.quotedStatus!="object")throw TypeError(".proto.StatusMentionMessage.quotedStatus: object expected");i.quotedStatus=d.proto.Message.fromObject(e.quotedStatus)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.quotedStatus!=null&&e.hasOwnProperty("quotedStatus")&&(A.quotedStatus=d.proto.Message.toObject(e.quotedStatus,i),i.oneofs&&(A._quotedStatus="quotedStatus")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusMentionMessage"},t})(),n.StatusPSA=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 44:{s.campaignId=e.uint64();break}case 45:{s.campaignExpirationTimestamp=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.StatusPSA)return e;var i=new d.proto.StatusPSA;return e.campaignId!=null&&(l.Long?(i.campaignId=l.Long.fromValue(e.campaignId)).unsigned=!0:typeof e.campaignId=="string"?i.campaignId=parseInt(e.campaignId,10):typeof e.campaignId=="number"?i.campaignId=e.campaignId:typeof e.campaignId=="object"&&(i.campaignId=new l.LongBits(e.campaignId.low>>>0,e.campaignId.high>>>0).toNumber(!0))),e.campaignExpirationTimestamp!=null&&(l.Long?(i.campaignExpirationTimestamp=l.Long.fromValue(e.campaignExpirationTimestamp)).unsigned=!0:typeof e.campaignExpirationTimestamp=="string"?i.campaignExpirationTimestamp=parseInt(e.campaignExpirationTimestamp,10):typeof e.campaignExpirationTimestamp=="number"?i.campaignExpirationTimestamp=e.campaignExpirationTimestamp:typeof e.campaignExpirationTimestamp=="object"&&(i.campaignExpirationTimestamp=new l.LongBits(e.campaignExpirationTimestamp.low>>>0,e.campaignExpirationTimestamp.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};if(i.defaults)if(l.Long){var r=new l.Long(0,0,!0);A.campaignId=i.longs===String?r.toString():i.longs===Number?r.toNumber():r}else A.campaignId=i.longs===String?"0":0;return e.campaignId!=null&&e.hasOwnProperty("campaignId")&&(typeof e.campaignId=="number"?A.campaignId=i.longs===String?String(e.campaignId):e.campaignId:A.campaignId=i.longs===String?ge(e.campaignId,!0):i.longs===Number?ce(e.campaignId,!0):e.campaignId),e.campaignExpirationTimestamp!=null&&e.hasOwnProperty("campaignExpirationTimestamp")&&(typeof e.campaignExpirationTimestamp=="number"?A.campaignExpirationTimestamp=i.longs===String?String(e.campaignExpirationTimestamp):e.campaignExpirationTimestamp:A.campaignExpirationTimestamp=i.longs===String?ge(e.campaignExpirationTimestamp,!0):i.longs===Number?ce(e.campaignExpirationTimestamp,!0):e.campaignExpirationTimestamp,i.oneofs&&(A._campaignExpirationTimestamp="campaignExpirationTimestamp")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StatusPSA"},t})(),n.StickerMetadata=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.url=e.string();break}case 2:{s.fileSha256=e.bytes();break}case 3:{s.fileEncSha256=e.bytes();break}case 4:{s.mediaKey=e.bytes();break}case 5:{s.mimetype=e.string();break}case 6:{s.height=e.uint32();break}case 7:{s.width=e.uint32();break}case 8:{s.directPath=e.string();break}case 9:{s.fileLength=e.uint64();break}case 10:{s.weight=e.float();break}case 11:{s.lastStickerSentTs=e.int64();break}case 12:{s.isLottie=e.bool();break}case 13:{s.imageHash=e.string();break}case 14:{s.isAvatarSticker=e.bool();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.StickerMetadata)return e;var i=new d.proto.StickerMetadata;return e.url!=null&&(i.url=String(e.url)),e.fileSha256!=null&&(typeof e.fileSha256=="string"?l.base64.decode(e.fileSha256,i.fileSha256=l.newBuffer(l.base64.length(e.fileSha256)),0):e.fileSha256.length>=0&&(i.fileSha256=e.fileSha256)),e.fileEncSha256!=null&&(typeof e.fileEncSha256=="string"?l.base64.decode(e.fileEncSha256,i.fileEncSha256=l.newBuffer(l.base64.length(e.fileEncSha256)),0):e.fileEncSha256.length>=0&&(i.fileEncSha256=e.fileEncSha256)),e.mediaKey!=null&&(typeof e.mediaKey=="string"?l.base64.decode(e.mediaKey,i.mediaKey=l.newBuffer(l.base64.length(e.mediaKey)),0):e.mediaKey.length>=0&&(i.mediaKey=e.mediaKey)),e.mimetype!=null&&(i.mimetype=String(e.mimetype)),e.height!=null&&(i.height=e.height>>>0),e.width!=null&&(i.width=e.width>>>0),e.directPath!=null&&(i.directPath=String(e.directPath)),e.fileLength!=null&&(l.Long?(i.fileLength=l.Long.fromValue(e.fileLength)).unsigned=!0:typeof e.fileLength=="string"?i.fileLength=parseInt(e.fileLength,10):typeof e.fileLength=="number"?i.fileLength=e.fileLength:typeof e.fileLength=="object"&&(i.fileLength=new l.LongBits(e.fileLength.low>>>0,e.fileLength.high>>>0).toNumber(!0))),e.weight!=null&&(i.weight=Number(e.weight)),e.lastStickerSentTs!=null&&(l.Long?(i.lastStickerSentTs=l.Long.fromValue(e.lastStickerSentTs)).unsigned=!1:typeof e.lastStickerSentTs=="string"?i.lastStickerSentTs=parseInt(e.lastStickerSentTs,10):typeof e.lastStickerSentTs=="number"?i.lastStickerSentTs=e.lastStickerSentTs:typeof e.lastStickerSentTs=="object"&&(i.lastStickerSentTs=new l.LongBits(e.lastStickerSentTs.low>>>0,e.lastStickerSentTs.high>>>0).toNumber())),e.isLottie!=null&&(i.isLottie=!!e.isLottie),e.imageHash!=null&&(i.imageHash=String(e.imageHash)),e.isAvatarSticker!=null&&(i.isAvatarSticker=!!e.isAvatarSticker),i},t.toObject=function(e,i){i||(i={});var A={};return e.url!=null&&e.hasOwnProperty("url")&&(A.url=e.url,i.oneofs&&(A._url="url")),e.fileSha256!=null&&e.hasOwnProperty("fileSha256")&&(A.fileSha256=i.bytes===String?l.base64.encode(e.fileSha256,0,e.fileSha256.length):i.bytes===Array?Array.prototype.slice.call(e.fileSha256):e.fileSha256,i.oneofs&&(A._fileSha256="fileSha256")),e.fileEncSha256!=null&&e.hasOwnProperty("fileEncSha256")&&(A.fileEncSha256=i.bytes===String?l.base64.encode(e.fileEncSha256,0,e.fileEncSha256.length):i.bytes===Array?Array.prototype.slice.call(e.fileEncSha256):e.fileEncSha256,i.oneofs&&(A._fileEncSha256="fileEncSha256")),e.mediaKey!=null&&e.hasOwnProperty("mediaKey")&&(A.mediaKey=i.bytes===String?l.base64.encode(e.mediaKey,0,e.mediaKey.length):i.bytes===Array?Array.prototype.slice.call(e.mediaKey):e.mediaKey,i.oneofs&&(A._mediaKey="mediaKey")),e.mimetype!=null&&e.hasOwnProperty("mimetype")&&(A.mimetype=e.mimetype,i.oneofs&&(A._mimetype="mimetype")),e.height!=null&&e.hasOwnProperty("height")&&(A.height=e.height,i.oneofs&&(A._height="height")),e.width!=null&&e.hasOwnProperty("width")&&(A.width=e.width,i.oneofs&&(A._width="width")),e.directPath!=null&&e.hasOwnProperty("directPath")&&(A.directPath=e.directPath,i.oneofs&&(A._directPath="directPath")),e.fileLength!=null&&e.hasOwnProperty("fileLength")&&(typeof e.fileLength=="number"?A.fileLength=i.longs===String?String(e.fileLength):e.fileLength:A.fileLength=i.longs===String?ge(e.fileLength,!0):i.longs===Number?ce(e.fileLength,!0):e.fileLength,i.oneofs&&(A._fileLength="fileLength")),e.weight!=null&&e.hasOwnProperty("weight")&&(A.weight=i.json&&!isFinite(e.weight)?String(e.weight):e.weight,i.oneofs&&(A._weight="weight")),e.lastStickerSentTs!=null&&e.hasOwnProperty("lastStickerSentTs")&&(typeof e.lastStickerSentTs=="number"?A.lastStickerSentTs=i.longs===String?String(e.lastStickerSentTs):e.lastStickerSentTs:A.lastStickerSentTs=i.longs===String?ge(e.lastStickerSentTs):i.longs===Number?ce(e.lastStickerSentTs):e.lastStickerSentTs,i.oneofs&&(A._lastStickerSentTs="lastStickerSentTs")),e.isLottie!=null&&e.hasOwnProperty("isLottie")&&(A.isLottie=e.isLottie,i.oneofs&&(A._isLottie="isLottie")),e.imageHash!=null&&e.hasOwnProperty("imageHash")&&(A.imageHash=e.imageHash,i.oneofs&&(A._imageHash="imageHash")),e.isAvatarSticker!=null&&e.hasOwnProperty("isAvatarSticker")&&(A.isAvatarSticker=e.isAvatarSticker,i.oneofs&&(A._isAvatarSticker="isAvatarSticker")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.StickerMetadata"},t})(),n.SyncActionData=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.index=e.bytes();break}case 2:{s.value=d.proto.SyncActionValue.decode(e,e.uint32());break}case 3:{s.padding=e.bytes();break}case 4:{s.version=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncActionData)return e;var i=new d.proto.SyncActionData;if(e.index!=null&&(typeof e.index=="string"?l.base64.decode(e.index,i.index=l.newBuffer(l.base64.length(e.index)),0):e.index.length>=0&&(i.index=e.index)),e.value!=null){if(typeof e.value!="object")throw TypeError(".proto.SyncActionData.value: object expected");i.value=d.proto.SyncActionValue.fromObject(e.value)}return e.padding!=null&&(typeof e.padding=="string"?l.base64.decode(e.padding,i.padding=l.newBuffer(l.base64.length(e.padding)),0):e.padding.length>=0&&(i.padding=e.padding)),e.version!=null&&(i.version=e.version|0),i},t.toObject=function(e,i){i||(i={});var A={};return e.index!=null&&e.hasOwnProperty("index")&&(A.index=i.bytes===String?l.base64.encode(e.index,0,e.index.length):i.bytes===Array?Array.prototype.slice.call(e.index):e.index,i.oneofs&&(A._index="index")),e.value!=null&&e.hasOwnProperty("value")&&(A.value=d.proto.SyncActionValue.toObject(e.value,i),i.oneofs&&(A._value="value")),e.padding!=null&&e.hasOwnProperty("padding")&&(A.padding=i.bytes===String?l.base64.encode(e.padding,0,e.padding.length):i.bytes===Array?Array.prototype.slice.call(e.padding):e.padding,i.oneofs&&(A._padding="padding")),e.version!=null&&e.hasOwnProperty("version")&&(A.version=e.version,i.oneofs&&(A._version="version")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncActionData"},t})(),n.SyncActionValue=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.timestamp=e.int64();break}case 2:{s.starAction=d.proto.SyncActionValue.StarAction.decode(e,e.uint32());break}case 3:{s.contactAction=d.proto.SyncActionValue.ContactAction.decode(e,e.uint32());break}case 4:{s.muteAction=d.proto.SyncActionValue.MuteAction.decode(e,e.uint32());break}case 5:{s.pinAction=d.proto.SyncActionValue.PinAction.decode(e,e.uint32());break}case 7:{s.pushNameSetting=d.proto.SyncActionValue.PushNameSetting.decode(e,e.uint32());break}case 8:{s.quickReplyAction=d.proto.SyncActionValue.QuickReplyAction.decode(e,e.uint32());break}case 11:{s.recentEmojiWeightsAction=d.proto.SyncActionValue.RecentEmojiWeightsAction.decode(e,e.uint32());break}case 14:{s.labelEditAction=d.proto.SyncActionValue.LabelEditAction.decode(e,e.uint32());break}case 15:{s.labelAssociationAction=d.proto.SyncActionValue.LabelAssociationAction.decode(e,e.uint32());break}case 16:{s.localeSetting=d.proto.SyncActionValue.LocaleSetting.decode(e,e.uint32());break}case 17:{s.archiveChatAction=d.proto.SyncActionValue.ArchiveChatAction.decode(e,e.uint32());break}case 18:{s.deleteMessageForMeAction=d.proto.SyncActionValue.DeleteMessageForMeAction.decode(e,e.uint32());break}case 19:{s.keyExpiration=d.proto.SyncActionValue.KeyExpiration.decode(e,e.uint32());break}case 20:{s.markChatAsReadAction=d.proto.SyncActionValue.MarkChatAsReadAction.decode(e,e.uint32());break}case 21:{s.clearChatAction=d.proto.SyncActionValue.ClearChatAction.decode(e,e.uint32());break}case 22:{s.deleteChatAction=d.proto.SyncActionValue.DeleteChatAction.decode(e,e.uint32());break}case 23:{s.unarchiveChatsSetting=d.proto.SyncActionValue.UnarchiveChatsSetting.decode(e,e.uint32());break}case 24:{s.primaryFeature=d.proto.SyncActionValue.PrimaryFeature.decode(e,e.uint32());break}case 26:{s.androidUnsupportedActions=d.proto.SyncActionValue.AndroidUnsupportedActions.decode(e,e.uint32());break}case 27:{s.agentAction=d.proto.SyncActionValue.AgentAction.decode(e,e.uint32());break}case 28:{s.subscriptionAction=d.proto.SyncActionValue.SubscriptionAction.decode(e,e.uint32());break}case 29:{s.userStatusMuteAction=d.proto.SyncActionValue.UserStatusMuteAction.decode(e,e.uint32());break}case 30:{s.timeFormatAction=d.proto.SyncActionValue.TimeFormatAction.decode(e,e.uint32());break}case 31:{s.nuxAction=d.proto.SyncActionValue.NuxAction.decode(e,e.uint32());break}case 32:{s.primaryVersionAction=d.proto.SyncActionValue.PrimaryVersionAction.decode(e,e.uint32());break}case 33:{s.stickerAction=d.proto.SyncActionValue.StickerAction.decode(e,e.uint32());break}case 34:{s.removeRecentStickerAction=d.proto.SyncActionValue.RemoveRecentStickerAction.decode(e,e.uint32());break}case 35:{s.chatAssignment=d.proto.SyncActionValue.ChatAssignmentAction.decode(e,e.uint32());break}case 36:{s.chatAssignmentOpenedStatus=d.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.decode(e,e.uint32());break}case 37:{s.pnForLidChatAction=d.proto.SyncActionValue.PnForLidChatAction.decode(e,e.uint32());break}case 38:{s.marketingMessageAction=d.proto.SyncActionValue.MarketingMessageAction.decode(e,e.uint32());break}case 39:{s.marketingMessageBroadcastAction=d.proto.SyncActionValue.MarketingMessageBroadcastAction.decode(e,e.uint32());break}case 40:{s.externalWebBetaAction=d.proto.SyncActionValue.ExternalWebBetaAction.decode(e,e.uint32());break}case 41:{s.privacySettingRelayAllCalls=d.proto.SyncActionValue.PrivacySettingRelayAllCalls.decode(e,e.uint32());break}case 42:{s.callLogAction=d.proto.SyncActionValue.CallLogAction.decode(e,e.uint32());break}case 43:{s.ugcBot=d.proto.SyncActionValue.UGCBot.decode(e,e.uint32());break}case 44:{s.statusPrivacy=d.proto.SyncActionValue.StatusPrivacyAction.decode(e,e.uint32());break}case 45:{s.botWelcomeRequestAction=d.proto.SyncActionValue.BotWelcomeRequestAction.decode(e,e.uint32());break}case 46:{s.deleteIndividualCallLog=d.proto.SyncActionValue.DeleteIndividualCallLogAction.decode(e,e.uint32());break}case 47:{s.labelReorderingAction=d.proto.SyncActionValue.LabelReorderingAction.decode(e,e.uint32());break}case 48:{s.paymentInfoAction=d.proto.SyncActionValue.PaymentInfoAction.decode(e,e.uint32());break}case 49:{s.customPaymentMethodsAction=d.proto.SyncActionValue.CustomPaymentMethodsAction.decode(e,e.uint32());break}case 50:{s.lockChatAction=d.proto.SyncActionValue.LockChatAction.decode(e,e.uint32());break}case 51:{s.chatLockSettings=d.proto.ChatLockSettings.decode(e,e.uint32());break}case 52:{s.wamoUserIdentifierAction=d.proto.SyncActionValue.WamoUserIdentifierAction.decode(e,e.uint32());break}case 53:{s.privacySettingDisableLinkPreviewsAction=d.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.decode(e,e.uint32());break}case 54:{s.deviceCapabilities=d.proto.DeviceCapabilities.decode(e,e.uint32());break}case 55:{s.noteEditAction=d.proto.SyncActionValue.NoteEditAction.decode(e,e.uint32());break}case 56:{s.favoritesAction=d.proto.SyncActionValue.FavoritesAction.decode(e,e.uint32());break}case 57:{s.merchantPaymentPartnerAction=d.proto.SyncActionValue.MerchantPaymentPartnerAction.decode(e,e.uint32());break}case 58:{s.waffleAccountLinkStateAction=d.proto.SyncActionValue.WaffleAccountLinkStateAction.decode(e,e.uint32());break}case 59:{s.usernameChatStartMode=d.proto.SyncActionValue.UsernameChatStartModeAction.decode(e,e.uint32());break}case 60:{s.notificationActivitySettingAction=d.proto.SyncActionValue.NotificationActivitySettingAction.decode(e,e.uint32());break}case 61:{s.lidContactAction=d.proto.SyncActionValue.LidContactAction.decode(e,e.uint32());break}case 62:{s.ctwaPerCustomerDataSharingAction=d.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.decode(e,e.uint32());break}case 63:{s.paymentTosAction=d.proto.SyncActionValue.PaymentTosAction.decode(e,e.uint32());break}case 64:{s.privacySettingChannelsPersonalisedRecommendationAction=d.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.decode(e,e.uint32());break}case 65:{s.businessBroadcastAssociationAction=d.proto.SyncActionValue.BusinessBroadcastAssociationAction.decode(e,e.uint32());break}case 66:{s.detectedOutcomesStatusAction=d.proto.SyncActionValue.DetectedOutcomesStatusAction.decode(e,e.uint32());break}case 68:{s.maibaAiFeaturesControlAction=d.proto.SyncActionValue.MaibaAIFeaturesControlAction.decode(e,e.uint32());break}case 69:{s.businessBroadcastListAction=d.proto.SyncActionValue.BusinessBroadcastListAction.decode(e,e.uint32());break}case 70:{s.musicUserIdAction=d.proto.SyncActionValue.MusicUserIdAction.decode(e,e.uint32());break}case 71:{s.statusPostOptInNotificationPreferencesAction=d.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.decode(e,e.uint32());break}case 72:{s.avatarUpdatedAction=d.proto.SyncActionValue.AvatarUpdatedAction.decode(e,e.uint32());break}case 74:{s.privateProcessingSettingAction=d.proto.SyncActionValue.PrivateProcessingSettingAction.decode(e,e.uint32());break}case 75:{s.newsletterSavedInterestsAction=d.proto.SyncActionValue.NewsletterSavedInterestsAction.decode(e,e.uint32());break}case 76:{s.aiThreadRenameAction=d.proto.SyncActionValue.AiThreadRenameAction.decode(e,e.uint32());break}case 77:{s.interactiveMessageAction=d.proto.SyncActionValue.InteractiveMessageAction.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncActionValue)return e;var i=new d.proto.SyncActionValue;if(e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!1:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber())),e.starAction!=null){if(typeof e.starAction!="object")throw TypeError(".proto.SyncActionValue.starAction: object expected");i.starAction=d.proto.SyncActionValue.StarAction.fromObject(e.starAction)}if(e.contactAction!=null){if(typeof e.contactAction!="object")throw TypeError(".proto.SyncActionValue.contactAction: object expected");i.contactAction=d.proto.SyncActionValue.ContactAction.fromObject(e.contactAction)}if(e.muteAction!=null){if(typeof e.muteAction!="object")throw TypeError(".proto.SyncActionValue.muteAction: object expected");i.muteAction=d.proto.SyncActionValue.MuteAction.fromObject(e.muteAction)}if(e.pinAction!=null){if(typeof e.pinAction!="object")throw TypeError(".proto.SyncActionValue.pinAction: object expected");i.pinAction=d.proto.SyncActionValue.PinAction.fromObject(e.pinAction)}if(e.pushNameSetting!=null){if(typeof e.pushNameSetting!="object")throw TypeError(".proto.SyncActionValue.pushNameSetting: object expected");i.pushNameSetting=d.proto.SyncActionValue.PushNameSetting.fromObject(e.pushNameSetting)}if(e.quickReplyAction!=null){if(typeof e.quickReplyAction!="object")throw TypeError(".proto.SyncActionValue.quickReplyAction: object expected");i.quickReplyAction=d.proto.SyncActionValue.QuickReplyAction.fromObject(e.quickReplyAction)}if(e.recentEmojiWeightsAction!=null){if(typeof e.recentEmojiWeightsAction!="object")throw TypeError(".proto.SyncActionValue.recentEmojiWeightsAction: object expected");i.recentEmojiWeightsAction=d.proto.SyncActionValue.RecentEmojiWeightsAction.fromObject(e.recentEmojiWeightsAction)}if(e.labelEditAction!=null){if(typeof e.labelEditAction!="object")throw TypeError(".proto.SyncActionValue.labelEditAction: object expected");i.labelEditAction=d.proto.SyncActionValue.LabelEditAction.fromObject(e.labelEditAction)}if(e.labelAssociationAction!=null){if(typeof e.labelAssociationAction!="object")throw TypeError(".proto.SyncActionValue.labelAssociationAction: object expected");i.labelAssociationAction=d.proto.SyncActionValue.LabelAssociationAction.fromObject(e.labelAssociationAction)}if(e.localeSetting!=null){if(typeof e.localeSetting!="object")throw TypeError(".proto.SyncActionValue.localeSetting: object expected");i.localeSetting=d.proto.SyncActionValue.LocaleSetting.fromObject(e.localeSetting)}if(e.archiveChatAction!=null){if(typeof e.archiveChatAction!="object")throw TypeError(".proto.SyncActionValue.archiveChatAction: object expected");i.archiveChatAction=d.proto.SyncActionValue.ArchiveChatAction.fromObject(e.archiveChatAction)}if(e.deleteMessageForMeAction!=null){if(typeof e.deleteMessageForMeAction!="object")throw TypeError(".proto.SyncActionValue.deleteMessageForMeAction: object expected");i.deleteMessageForMeAction=d.proto.SyncActionValue.DeleteMessageForMeAction.fromObject(e.deleteMessageForMeAction)}if(e.keyExpiration!=null){if(typeof e.keyExpiration!="object")throw TypeError(".proto.SyncActionValue.keyExpiration: object expected");i.keyExpiration=d.proto.SyncActionValue.KeyExpiration.fromObject(e.keyExpiration)}if(e.markChatAsReadAction!=null){if(typeof e.markChatAsReadAction!="object")throw TypeError(".proto.SyncActionValue.markChatAsReadAction: object expected");i.markChatAsReadAction=d.proto.SyncActionValue.MarkChatAsReadAction.fromObject(e.markChatAsReadAction)}if(e.clearChatAction!=null){if(typeof e.clearChatAction!="object")throw TypeError(".proto.SyncActionValue.clearChatAction: object expected");i.clearChatAction=d.proto.SyncActionValue.ClearChatAction.fromObject(e.clearChatAction)}if(e.deleteChatAction!=null){if(typeof e.deleteChatAction!="object")throw TypeError(".proto.SyncActionValue.deleteChatAction: object expected");i.deleteChatAction=d.proto.SyncActionValue.DeleteChatAction.fromObject(e.deleteChatAction)}if(e.unarchiveChatsSetting!=null){if(typeof e.unarchiveChatsSetting!="object")throw TypeError(".proto.SyncActionValue.unarchiveChatsSetting: object expected");i.unarchiveChatsSetting=d.proto.SyncActionValue.UnarchiveChatsSetting.fromObject(e.unarchiveChatsSetting)}if(e.primaryFeature!=null){if(typeof e.primaryFeature!="object")throw TypeError(".proto.SyncActionValue.primaryFeature: object expected");i.primaryFeature=d.proto.SyncActionValue.PrimaryFeature.fromObject(e.primaryFeature)}if(e.androidUnsupportedActions!=null){if(typeof e.androidUnsupportedActions!="object")throw TypeError(".proto.SyncActionValue.androidUnsupportedActions: object expected");i.androidUnsupportedActions=d.proto.SyncActionValue.AndroidUnsupportedActions.fromObject(e.androidUnsupportedActions)}if(e.agentAction!=null){if(typeof e.agentAction!="object")throw TypeError(".proto.SyncActionValue.agentAction: object expected");i.agentAction=d.proto.SyncActionValue.AgentAction.fromObject(e.agentAction)}if(e.subscriptionAction!=null){if(typeof e.subscriptionAction!="object")throw TypeError(".proto.SyncActionValue.subscriptionAction: object expected");i.subscriptionAction=d.proto.SyncActionValue.SubscriptionAction.fromObject(e.subscriptionAction)}if(e.userStatusMuteAction!=null){if(typeof e.userStatusMuteAction!="object")throw TypeError(".proto.SyncActionValue.userStatusMuteAction: object expected");i.userStatusMuteAction=d.proto.SyncActionValue.UserStatusMuteAction.fromObject(e.userStatusMuteAction)}if(e.timeFormatAction!=null){if(typeof e.timeFormatAction!="object")throw TypeError(".proto.SyncActionValue.timeFormatAction: object expected");i.timeFormatAction=d.proto.SyncActionValue.TimeFormatAction.fromObject(e.timeFormatAction)}if(e.nuxAction!=null){if(typeof e.nuxAction!="object")throw TypeError(".proto.SyncActionValue.nuxAction: object expected");i.nuxAction=d.proto.SyncActionValue.NuxAction.fromObject(e.nuxAction)}if(e.primaryVersionAction!=null){if(typeof e.primaryVersionAction!="object")throw TypeError(".proto.SyncActionValue.primaryVersionAction: object expected");i.primaryVersionAction=d.proto.SyncActionValue.PrimaryVersionAction.fromObject(e.primaryVersionAction)}if(e.stickerAction!=null){if(typeof e.stickerAction!="object")throw TypeError(".proto.SyncActionValue.stickerAction: object expected");i.stickerAction=d.proto.SyncActionValue.StickerAction.fromObject(e.stickerAction)}if(e.removeRecentStickerAction!=null){if(typeof e.removeRecentStickerAction!="object")throw TypeError(".proto.SyncActionValue.removeRecentStickerAction: object expected");i.removeRecentStickerAction=d.proto.SyncActionValue.RemoveRecentStickerAction.fromObject(e.removeRecentStickerAction)}if(e.chatAssignment!=null){if(typeof e.chatAssignment!="object")throw TypeError(".proto.SyncActionValue.chatAssignment: object expected");i.chatAssignment=d.proto.SyncActionValue.ChatAssignmentAction.fromObject(e.chatAssignment)}if(e.chatAssignmentOpenedStatus!=null){if(typeof e.chatAssignmentOpenedStatus!="object")throw TypeError(".proto.SyncActionValue.chatAssignmentOpenedStatus: object expected");i.chatAssignmentOpenedStatus=d.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.fromObject(e.chatAssignmentOpenedStatus)}if(e.pnForLidChatAction!=null){if(typeof e.pnForLidChatAction!="object")throw TypeError(".proto.SyncActionValue.pnForLidChatAction: object expected");i.pnForLidChatAction=d.proto.SyncActionValue.PnForLidChatAction.fromObject(e.pnForLidChatAction)}if(e.marketingMessageAction!=null){if(typeof e.marketingMessageAction!="object")throw TypeError(".proto.SyncActionValue.marketingMessageAction: object expected");i.marketingMessageAction=d.proto.SyncActionValue.MarketingMessageAction.fromObject(e.marketingMessageAction)}if(e.marketingMessageBroadcastAction!=null){if(typeof e.marketingMessageBroadcastAction!="object")throw TypeError(".proto.SyncActionValue.marketingMessageBroadcastAction: object expected");i.marketingMessageBroadcastAction=d.proto.SyncActionValue.MarketingMessageBroadcastAction.fromObject(e.marketingMessageBroadcastAction)}if(e.externalWebBetaAction!=null){if(typeof e.externalWebBetaAction!="object")throw TypeError(".proto.SyncActionValue.externalWebBetaAction: object expected");i.externalWebBetaAction=d.proto.SyncActionValue.ExternalWebBetaAction.fromObject(e.externalWebBetaAction)}if(e.privacySettingRelayAllCalls!=null){if(typeof e.privacySettingRelayAllCalls!="object")throw TypeError(".proto.SyncActionValue.privacySettingRelayAllCalls: object expected");i.privacySettingRelayAllCalls=d.proto.SyncActionValue.PrivacySettingRelayAllCalls.fromObject(e.privacySettingRelayAllCalls)}if(e.callLogAction!=null){if(typeof e.callLogAction!="object")throw TypeError(".proto.SyncActionValue.callLogAction: object expected");i.callLogAction=d.proto.SyncActionValue.CallLogAction.fromObject(e.callLogAction)}if(e.ugcBot!=null){if(typeof e.ugcBot!="object")throw TypeError(".proto.SyncActionValue.ugcBot: object expected");i.ugcBot=d.proto.SyncActionValue.UGCBot.fromObject(e.ugcBot)}if(e.statusPrivacy!=null){if(typeof e.statusPrivacy!="object")throw TypeError(".proto.SyncActionValue.statusPrivacy: object expected");i.statusPrivacy=d.proto.SyncActionValue.StatusPrivacyAction.fromObject(e.statusPrivacy)}if(e.botWelcomeRequestAction!=null){if(typeof e.botWelcomeRequestAction!="object")throw TypeError(".proto.SyncActionValue.botWelcomeRequestAction: object expected");i.botWelcomeRequestAction=d.proto.SyncActionValue.BotWelcomeRequestAction.fromObject(e.botWelcomeRequestAction)}if(e.deleteIndividualCallLog!=null){if(typeof e.deleteIndividualCallLog!="object")throw TypeError(".proto.SyncActionValue.deleteIndividualCallLog: object expected");i.deleteIndividualCallLog=d.proto.SyncActionValue.DeleteIndividualCallLogAction.fromObject(e.deleteIndividualCallLog)}if(e.labelReorderingAction!=null){if(typeof e.labelReorderingAction!="object")throw TypeError(".proto.SyncActionValue.labelReorderingAction: object expected");i.labelReorderingAction=d.proto.SyncActionValue.LabelReorderingAction.fromObject(e.labelReorderingAction)}if(e.paymentInfoAction!=null){if(typeof e.paymentInfoAction!="object")throw TypeError(".proto.SyncActionValue.paymentInfoAction: object expected");i.paymentInfoAction=d.proto.SyncActionValue.PaymentInfoAction.fromObject(e.paymentInfoAction)}if(e.customPaymentMethodsAction!=null){if(typeof e.customPaymentMethodsAction!="object")throw TypeError(".proto.SyncActionValue.customPaymentMethodsAction: object expected");i.customPaymentMethodsAction=d.proto.SyncActionValue.CustomPaymentMethodsAction.fromObject(e.customPaymentMethodsAction)}if(e.lockChatAction!=null){if(typeof e.lockChatAction!="object")throw TypeError(".proto.SyncActionValue.lockChatAction: object expected");i.lockChatAction=d.proto.SyncActionValue.LockChatAction.fromObject(e.lockChatAction)}if(e.chatLockSettings!=null){if(typeof e.chatLockSettings!="object")throw TypeError(".proto.SyncActionValue.chatLockSettings: object expected");i.chatLockSettings=d.proto.ChatLockSettings.fromObject(e.chatLockSettings)}if(e.wamoUserIdentifierAction!=null){if(typeof e.wamoUserIdentifierAction!="object")throw TypeError(".proto.SyncActionValue.wamoUserIdentifierAction: object expected");i.wamoUserIdentifierAction=d.proto.SyncActionValue.WamoUserIdentifierAction.fromObject(e.wamoUserIdentifierAction)}if(e.privacySettingDisableLinkPreviewsAction!=null){if(typeof e.privacySettingDisableLinkPreviewsAction!="object")throw TypeError(".proto.SyncActionValue.privacySettingDisableLinkPreviewsAction: object expected");i.privacySettingDisableLinkPreviewsAction=d.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.fromObject(e.privacySettingDisableLinkPreviewsAction)}if(e.deviceCapabilities!=null){if(typeof e.deviceCapabilities!="object")throw TypeError(".proto.SyncActionValue.deviceCapabilities: object expected");i.deviceCapabilities=d.proto.DeviceCapabilities.fromObject(e.deviceCapabilities)}if(e.noteEditAction!=null){if(typeof e.noteEditAction!="object")throw TypeError(".proto.SyncActionValue.noteEditAction: object expected");i.noteEditAction=d.proto.SyncActionValue.NoteEditAction.fromObject(e.noteEditAction)}if(e.favoritesAction!=null){if(typeof e.favoritesAction!="object")throw TypeError(".proto.SyncActionValue.favoritesAction: object expected");i.favoritesAction=d.proto.SyncActionValue.FavoritesAction.fromObject(e.favoritesAction)}if(e.merchantPaymentPartnerAction!=null){if(typeof e.merchantPaymentPartnerAction!="object")throw TypeError(".proto.SyncActionValue.merchantPaymentPartnerAction: object expected");i.merchantPaymentPartnerAction=d.proto.SyncActionValue.MerchantPaymentPartnerAction.fromObject(e.merchantPaymentPartnerAction)}if(e.waffleAccountLinkStateAction!=null){if(typeof e.waffleAccountLinkStateAction!="object")throw TypeError(".proto.SyncActionValue.waffleAccountLinkStateAction: object expected");i.waffleAccountLinkStateAction=d.proto.SyncActionValue.WaffleAccountLinkStateAction.fromObject(e.waffleAccountLinkStateAction)}if(e.usernameChatStartMode!=null){if(typeof e.usernameChatStartMode!="object")throw TypeError(".proto.SyncActionValue.usernameChatStartMode: object expected");i.usernameChatStartMode=d.proto.SyncActionValue.UsernameChatStartModeAction.fromObject(e.usernameChatStartMode)}if(e.notificationActivitySettingAction!=null){if(typeof e.notificationActivitySettingAction!="object")throw TypeError(".proto.SyncActionValue.notificationActivitySettingAction: object expected");i.notificationActivitySettingAction=d.proto.SyncActionValue.NotificationActivitySettingAction.fromObject(e.notificationActivitySettingAction)}if(e.lidContactAction!=null){if(typeof e.lidContactAction!="object")throw TypeError(".proto.SyncActionValue.lidContactAction: object expected");i.lidContactAction=d.proto.SyncActionValue.LidContactAction.fromObject(e.lidContactAction)}if(e.ctwaPerCustomerDataSharingAction!=null){if(typeof e.ctwaPerCustomerDataSharingAction!="object")throw TypeError(".proto.SyncActionValue.ctwaPerCustomerDataSharingAction: object expected");i.ctwaPerCustomerDataSharingAction=d.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.fromObject(e.ctwaPerCustomerDataSharingAction)}if(e.paymentTosAction!=null){if(typeof e.paymentTosAction!="object")throw TypeError(".proto.SyncActionValue.paymentTosAction: object expected");i.paymentTosAction=d.proto.SyncActionValue.PaymentTosAction.fromObject(e.paymentTosAction)}if(e.privacySettingChannelsPersonalisedRecommendationAction!=null){if(typeof e.privacySettingChannelsPersonalisedRecommendationAction!="object")throw TypeError(".proto.SyncActionValue.privacySettingChannelsPersonalisedRecommendationAction: object expected");i.privacySettingChannelsPersonalisedRecommendationAction=d.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.fromObject(e.privacySettingChannelsPersonalisedRecommendationAction)}if(e.businessBroadcastAssociationAction!=null){if(typeof e.businessBroadcastAssociationAction!="object")throw TypeError(".proto.SyncActionValue.businessBroadcastAssociationAction: object expected");i.businessBroadcastAssociationAction=d.proto.SyncActionValue.BusinessBroadcastAssociationAction.fromObject(e.businessBroadcastAssociationAction)}if(e.detectedOutcomesStatusAction!=null){if(typeof e.detectedOutcomesStatusAction!="object")throw TypeError(".proto.SyncActionValue.detectedOutcomesStatusAction: object expected");i.detectedOutcomesStatusAction=d.proto.SyncActionValue.DetectedOutcomesStatusAction.fromObject(e.detectedOutcomesStatusAction)}if(e.maibaAiFeaturesControlAction!=null){if(typeof e.maibaAiFeaturesControlAction!="object")throw TypeError(".proto.SyncActionValue.maibaAiFeaturesControlAction: object expected");i.maibaAiFeaturesControlAction=d.proto.SyncActionValue.MaibaAIFeaturesControlAction.fromObject(e.maibaAiFeaturesControlAction)}if(e.businessBroadcastListAction!=null){if(typeof e.businessBroadcastListAction!="object")throw TypeError(".proto.SyncActionValue.businessBroadcastListAction: object expected");i.businessBroadcastListAction=d.proto.SyncActionValue.BusinessBroadcastListAction.fromObject(e.businessBroadcastListAction)}if(e.musicUserIdAction!=null){if(typeof e.musicUserIdAction!="object")throw TypeError(".proto.SyncActionValue.musicUserIdAction: object expected");i.musicUserIdAction=d.proto.SyncActionValue.MusicUserIdAction.fromObject(e.musicUserIdAction)}if(e.statusPostOptInNotificationPreferencesAction!=null){if(typeof e.statusPostOptInNotificationPreferencesAction!="object")throw TypeError(".proto.SyncActionValue.statusPostOptInNotificationPreferencesAction: object expected");i.statusPostOptInNotificationPreferencesAction=d.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.fromObject(e.statusPostOptInNotificationPreferencesAction)}if(e.avatarUpdatedAction!=null){if(typeof e.avatarUpdatedAction!="object")throw TypeError(".proto.SyncActionValue.avatarUpdatedAction: object expected");i.avatarUpdatedAction=d.proto.SyncActionValue.AvatarUpdatedAction.fromObject(e.avatarUpdatedAction)}if(e.privateProcessingSettingAction!=null){if(typeof e.privateProcessingSettingAction!="object")throw TypeError(".proto.SyncActionValue.privateProcessingSettingAction: object expected");i.privateProcessingSettingAction=d.proto.SyncActionValue.PrivateProcessingSettingAction.fromObject(e.privateProcessingSettingAction)}if(e.newsletterSavedInterestsAction!=null){if(typeof e.newsletterSavedInterestsAction!="object")throw TypeError(".proto.SyncActionValue.newsletterSavedInterestsAction: object expected");i.newsletterSavedInterestsAction=d.proto.SyncActionValue.NewsletterSavedInterestsAction.fromObject(e.newsletterSavedInterestsAction)}if(e.aiThreadRenameAction!=null){if(typeof e.aiThreadRenameAction!="object")throw TypeError(".proto.SyncActionValue.aiThreadRenameAction: object expected");i.aiThreadRenameAction=d.proto.SyncActionValue.AiThreadRenameAction.fromObject(e.aiThreadRenameAction)}if(e.interactiveMessageAction!=null){if(typeof e.interactiveMessageAction!="object")throw TypeError(".proto.SyncActionValue.interactiveMessageAction: object expected");i.interactiveMessageAction=d.proto.SyncActionValue.InteractiveMessageAction.fromObject(e.interactiveMessageAction)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.timestamp!=null&&e.hasOwnProperty("timestamp")&&(typeof e.timestamp=="number"?A.timestamp=i.longs===String?String(e.timestamp):e.timestamp:A.timestamp=i.longs===String?ge(e.timestamp):i.longs===Number?ce(e.timestamp):e.timestamp,i.oneofs&&(A._timestamp="timestamp")),e.starAction!=null&&e.hasOwnProperty("starAction")&&(A.starAction=d.proto.SyncActionValue.StarAction.toObject(e.starAction,i),i.oneofs&&(A._starAction="starAction")),e.contactAction!=null&&e.hasOwnProperty("contactAction")&&(A.contactAction=d.proto.SyncActionValue.ContactAction.toObject(e.contactAction,i),i.oneofs&&(A._contactAction="contactAction")),e.muteAction!=null&&e.hasOwnProperty("muteAction")&&(A.muteAction=d.proto.SyncActionValue.MuteAction.toObject(e.muteAction,i),i.oneofs&&(A._muteAction="muteAction")),e.pinAction!=null&&e.hasOwnProperty("pinAction")&&(A.pinAction=d.proto.SyncActionValue.PinAction.toObject(e.pinAction,i),i.oneofs&&(A._pinAction="pinAction")),e.pushNameSetting!=null&&e.hasOwnProperty("pushNameSetting")&&(A.pushNameSetting=d.proto.SyncActionValue.PushNameSetting.toObject(e.pushNameSetting,i),i.oneofs&&(A._pushNameSetting="pushNameSetting")),e.quickReplyAction!=null&&e.hasOwnProperty("quickReplyAction")&&(A.quickReplyAction=d.proto.SyncActionValue.QuickReplyAction.toObject(e.quickReplyAction,i),i.oneofs&&(A._quickReplyAction="quickReplyAction")),e.recentEmojiWeightsAction!=null&&e.hasOwnProperty("recentEmojiWeightsAction")&&(A.recentEmojiWeightsAction=d.proto.SyncActionValue.RecentEmojiWeightsAction.toObject(e.recentEmojiWeightsAction,i),i.oneofs&&(A._recentEmojiWeightsAction="recentEmojiWeightsAction")),e.labelEditAction!=null&&e.hasOwnProperty("labelEditAction")&&(A.labelEditAction=d.proto.SyncActionValue.LabelEditAction.toObject(e.labelEditAction,i),i.oneofs&&(A._labelEditAction="labelEditAction")),e.labelAssociationAction!=null&&e.hasOwnProperty("labelAssociationAction")&&(A.labelAssociationAction=d.proto.SyncActionValue.LabelAssociationAction.toObject(e.labelAssociationAction,i),i.oneofs&&(A._labelAssociationAction="labelAssociationAction")),e.localeSetting!=null&&e.hasOwnProperty("localeSetting")&&(A.localeSetting=d.proto.SyncActionValue.LocaleSetting.toObject(e.localeSetting,i),i.oneofs&&(A._localeSetting="localeSetting")),e.archiveChatAction!=null&&e.hasOwnProperty("archiveChatAction")&&(A.archiveChatAction=d.proto.SyncActionValue.ArchiveChatAction.toObject(e.archiveChatAction,i),i.oneofs&&(A._archiveChatAction="archiveChatAction")),e.deleteMessageForMeAction!=null&&e.hasOwnProperty("deleteMessageForMeAction")&&(A.deleteMessageForMeAction=d.proto.SyncActionValue.DeleteMessageForMeAction.toObject(e.deleteMessageForMeAction,i),i.oneofs&&(A._deleteMessageForMeAction="deleteMessageForMeAction")),e.keyExpiration!=null&&e.hasOwnProperty("keyExpiration")&&(A.keyExpiration=d.proto.SyncActionValue.KeyExpiration.toObject(e.keyExpiration,i),i.oneofs&&(A._keyExpiration="keyExpiration")),e.markChatAsReadAction!=null&&e.hasOwnProperty("markChatAsReadAction")&&(A.markChatAsReadAction=d.proto.SyncActionValue.MarkChatAsReadAction.toObject(e.markChatAsReadAction,i),i.oneofs&&(A._markChatAsReadAction="markChatAsReadAction")),e.clearChatAction!=null&&e.hasOwnProperty("clearChatAction")&&(A.clearChatAction=d.proto.SyncActionValue.ClearChatAction.toObject(e.clearChatAction,i),i.oneofs&&(A._clearChatAction="clearChatAction")),e.deleteChatAction!=null&&e.hasOwnProperty("deleteChatAction")&&(A.deleteChatAction=d.proto.SyncActionValue.DeleteChatAction.toObject(e.deleteChatAction,i),i.oneofs&&(A._deleteChatAction="deleteChatAction")),e.unarchiveChatsSetting!=null&&e.hasOwnProperty("unarchiveChatsSetting")&&(A.unarchiveChatsSetting=d.proto.SyncActionValue.UnarchiveChatsSetting.toObject(e.unarchiveChatsSetting,i),i.oneofs&&(A._unarchiveChatsSetting="unarchiveChatsSetting")),e.primaryFeature!=null&&e.hasOwnProperty("primaryFeature")&&(A.primaryFeature=d.proto.SyncActionValue.PrimaryFeature.toObject(e.primaryFeature,i),i.oneofs&&(A._primaryFeature="primaryFeature")),e.androidUnsupportedActions!=null&&e.hasOwnProperty("androidUnsupportedActions")&&(A.androidUnsupportedActions=d.proto.SyncActionValue.AndroidUnsupportedActions.toObject(e.androidUnsupportedActions,i),i.oneofs&&(A._androidUnsupportedActions="androidUnsupportedActions")),e.agentAction!=null&&e.hasOwnProperty("agentAction")&&(A.agentAction=d.proto.SyncActionValue.AgentAction.toObject(e.agentAction,i),i.oneofs&&(A._agentAction="agentAction")),e.subscriptionAction!=null&&e.hasOwnProperty("subscriptionAction")&&(A.subscriptionAction=d.proto.SyncActionValue.SubscriptionAction.toObject(e.subscriptionAction,i),i.oneofs&&(A._subscriptionAction="subscriptionAction")),e.userStatusMuteAction!=null&&e.hasOwnProperty("userStatusMuteAction")&&(A.userStatusMuteAction=d.proto.SyncActionValue.UserStatusMuteAction.toObject(e.userStatusMuteAction,i),i.oneofs&&(A._userStatusMuteAction="userStatusMuteAction")),e.timeFormatAction!=null&&e.hasOwnProperty("timeFormatAction")&&(A.timeFormatAction=d.proto.SyncActionValue.TimeFormatAction.toObject(e.timeFormatAction,i),i.oneofs&&(A._timeFormatAction="timeFormatAction")),e.nuxAction!=null&&e.hasOwnProperty("nuxAction")&&(A.nuxAction=d.proto.SyncActionValue.NuxAction.toObject(e.nuxAction,i),i.oneofs&&(A._nuxAction="nuxAction")),e.primaryVersionAction!=null&&e.hasOwnProperty("primaryVersionAction")&&(A.primaryVersionAction=d.proto.SyncActionValue.PrimaryVersionAction.toObject(e.primaryVersionAction,i),i.oneofs&&(A._primaryVersionAction="primaryVersionAction")),e.stickerAction!=null&&e.hasOwnProperty("stickerAction")&&(A.stickerAction=d.proto.SyncActionValue.StickerAction.toObject(e.stickerAction,i),i.oneofs&&(A._stickerAction="stickerAction")),e.removeRecentStickerAction!=null&&e.hasOwnProperty("removeRecentStickerAction")&&(A.removeRecentStickerAction=d.proto.SyncActionValue.RemoveRecentStickerAction.toObject(e.removeRecentStickerAction,i),i.oneofs&&(A._removeRecentStickerAction="removeRecentStickerAction")),e.chatAssignment!=null&&e.hasOwnProperty("chatAssignment")&&(A.chatAssignment=d.proto.SyncActionValue.ChatAssignmentAction.toObject(e.chatAssignment,i),i.oneofs&&(A._chatAssignment="chatAssignment")),e.chatAssignmentOpenedStatus!=null&&e.hasOwnProperty("chatAssignmentOpenedStatus")&&(A.chatAssignmentOpenedStatus=d.proto.SyncActionValue.ChatAssignmentOpenedStatusAction.toObject(e.chatAssignmentOpenedStatus,i),i.oneofs&&(A._chatAssignmentOpenedStatus="chatAssignmentOpenedStatus")),e.pnForLidChatAction!=null&&e.hasOwnProperty("pnForLidChatAction")&&(A.pnForLidChatAction=d.proto.SyncActionValue.PnForLidChatAction.toObject(e.pnForLidChatAction,i),i.oneofs&&(A._pnForLidChatAction="pnForLidChatAction")),e.marketingMessageAction!=null&&e.hasOwnProperty("marketingMessageAction")&&(A.marketingMessageAction=d.proto.SyncActionValue.MarketingMessageAction.toObject(e.marketingMessageAction,i),i.oneofs&&(A._marketingMessageAction="marketingMessageAction")),e.marketingMessageBroadcastAction!=null&&e.hasOwnProperty("marketingMessageBroadcastAction")&&(A.marketingMessageBroadcastAction=d.proto.SyncActionValue.MarketingMessageBroadcastAction.toObject(e.marketingMessageBroadcastAction,i),i.oneofs&&(A._marketingMessageBroadcastAction="marketingMessageBroadcastAction")),e.externalWebBetaAction!=null&&e.hasOwnProperty("externalWebBetaAction")&&(A.externalWebBetaAction=d.proto.SyncActionValue.ExternalWebBetaAction.toObject(e.externalWebBetaAction,i),i.oneofs&&(A._externalWebBetaAction="externalWebBetaAction")),e.privacySettingRelayAllCalls!=null&&e.hasOwnProperty("privacySettingRelayAllCalls")&&(A.privacySettingRelayAllCalls=d.proto.SyncActionValue.PrivacySettingRelayAllCalls.toObject(e.privacySettingRelayAllCalls,i),i.oneofs&&(A._privacySettingRelayAllCalls="privacySettingRelayAllCalls")),e.callLogAction!=null&&e.hasOwnProperty("callLogAction")&&(A.callLogAction=d.proto.SyncActionValue.CallLogAction.toObject(e.callLogAction,i),i.oneofs&&(A._callLogAction="callLogAction")),e.ugcBot!=null&&e.hasOwnProperty("ugcBot")&&(A.ugcBot=d.proto.SyncActionValue.UGCBot.toObject(e.ugcBot,i),i.oneofs&&(A._ugcBot="ugcBot")),e.statusPrivacy!=null&&e.hasOwnProperty("statusPrivacy")&&(A.statusPrivacy=d.proto.SyncActionValue.StatusPrivacyAction.toObject(e.statusPrivacy,i),i.oneofs&&(A._statusPrivacy="statusPrivacy")),e.botWelcomeRequestAction!=null&&e.hasOwnProperty("botWelcomeRequestAction")&&(A.botWelcomeRequestAction=d.proto.SyncActionValue.BotWelcomeRequestAction.toObject(e.botWelcomeRequestAction,i),i.oneofs&&(A._botWelcomeRequestAction="botWelcomeRequestAction")),e.deleteIndividualCallLog!=null&&e.hasOwnProperty("deleteIndividualCallLog")&&(A.deleteIndividualCallLog=d.proto.SyncActionValue.DeleteIndividualCallLogAction.toObject(e.deleteIndividualCallLog,i),i.oneofs&&(A._deleteIndividualCallLog="deleteIndividualCallLog")),e.labelReorderingAction!=null&&e.hasOwnProperty("labelReorderingAction")&&(A.labelReorderingAction=d.proto.SyncActionValue.LabelReorderingAction.toObject(e.labelReorderingAction,i),i.oneofs&&(A._labelReorderingAction="labelReorderingAction")),e.paymentInfoAction!=null&&e.hasOwnProperty("paymentInfoAction")&&(A.paymentInfoAction=d.proto.SyncActionValue.PaymentInfoAction.toObject(e.paymentInfoAction,i),i.oneofs&&(A._paymentInfoAction="paymentInfoAction")),e.customPaymentMethodsAction!=null&&e.hasOwnProperty("customPaymentMethodsAction")&&(A.customPaymentMethodsAction=d.proto.SyncActionValue.CustomPaymentMethodsAction.toObject(e.customPaymentMethodsAction,i),i.oneofs&&(A._customPaymentMethodsAction="customPaymentMethodsAction")),e.lockChatAction!=null&&e.hasOwnProperty("lockChatAction")&&(A.lockChatAction=d.proto.SyncActionValue.LockChatAction.toObject(e.lockChatAction,i),i.oneofs&&(A._lockChatAction="lockChatAction")),e.chatLockSettings!=null&&e.hasOwnProperty("chatLockSettings")&&(A.chatLockSettings=d.proto.ChatLockSettings.toObject(e.chatLockSettings,i),i.oneofs&&(A._chatLockSettings="chatLockSettings")),e.wamoUserIdentifierAction!=null&&e.hasOwnProperty("wamoUserIdentifierAction")&&(A.wamoUserIdentifierAction=d.proto.SyncActionValue.WamoUserIdentifierAction.toObject(e.wamoUserIdentifierAction,i),i.oneofs&&(A._wamoUserIdentifierAction="wamoUserIdentifierAction")),e.privacySettingDisableLinkPreviewsAction!=null&&e.hasOwnProperty("privacySettingDisableLinkPreviewsAction")&&(A.privacySettingDisableLinkPreviewsAction=d.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction.toObject(e.privacySettingDisableLinkPreviewsAction,i),i.oneofs&&(A._privacySettingDisableLinkPreviewsAction="privacySettingDisableLinkPreviewsAction")),e.deviceCapabilities!=null&&e.hasOwnProperty("deviceCapabilities")&&(A.deviceCapabilities=d.proto.DeviceCapabilities.toObject(e.deviceCapabilities,i),i.oneofs&&(A._deviceCapabilities="deviceCapabilities")),e.noteEditAction!=null&&e.hasOwnProperty("noteEditAction")&&(A.noteEditAction=d.proto.SyncActionValue.NoteEditAction.toObject(e.noteEditAction,i),i.oneofs&&(A._noteEditAction="noteEditAction")),e.favoritesAction!=null&&e.hasOwnProperty("favoritesAction")&&(A.favoritesAction=d.proto.SyncActionValue.FavoritesAction.toObject(e.favoritesAction,i),i.oneofs&&(A._favoritesAction="favoritesAction")),e.merchantPaymentPartnerAction!=null&&e.hasOwnProperty("merchantPaymentPartnerAction")&&(A.merchantPaymentPartnerAction=d.proto.SyncActionValue.MerchantPaymentPartnerAction.toObject(e.merchantPaymentPartnerAction,i),i.oneofs&&(A._merchantPaymentPartnerAction="merchantPaymentPartnerAction")),e.waffleAccountLinkStateAction!=null&&e.hasOwnProperty("waffleAccountLinkStateAction")&&(A.waffleAccountLinkStateAction=d.proto.SyncActionValue.WaffleAccountLinkStateAction.toObject(e.waffleAccountLinkStateAction,i),i.oneofs&&(A._waffleAccountLinkStateAction="waffleAccountLinkStateAction")),e.usernameChatStartMode!=null&&e.hasOwnProperty("usernameChatStartMode")&&(A.usernameChatStartMode=d.proto.SyncActionValue.UsernameChatStartModeAction.toObject(e.usernameChatStartMode,i),i.oneofs&&(A._usernameChatStartMode="usernameChatStartMode")),e.notificationActivitySettingAction!=null&&e.hasOwnProperty("notificationActivitySettingAction")&&(A.notificationActivitySettingAction=d.proto.SyncActionValue.NotificationActivitySettingAction.toObject(e.notificationActivitySettingAction,i),i.oneofs&&(A._notificationActivitySettingAction="notificationActivitySettingAction")),e.lidContactAction!=null&&e.hasOwnProperty("lidContactAction")&&(A.lidContactAction=d.proto.SyncActionValue.LidContactAction.toObject(e.lidContactAction,i),i.oneofs&&(A._lidContactAction="lidContactAction")),e.ctwaPerCustomerDataSharingAction!=null&&e.hasOwnProperty("ctwaPerCustomerDataSharingAction")&&(A.ctwaPerCustomerDataSharingAction=d.proto.SyncActionValue.CtwaPerCustomerDataSharingAction.toObject(e.ctwaPerCustomerDataSharingAction,i),i.oneofs&&(A._ctwaPerCustomerDataSharingAction="ctwaPerCustomerDataSharingAction")),e.paymentTosAction!=null&&e.hasOwnProperty("paymentTosAction")&&(A.paymentTosAction=d.proto.SyncActionValue.PaymentTosAction.toObject(e.paymentTosAction,i),i.oneofs&&(A._paymentTosAction="paymentTosAction")),e.privacySettingChannelsPersonalisedRecommendationAction!=null&&e.hasOwnProperty("privacySettingChannelsPersonalisedRecommendationAction")&&(A.privacySettingChannelsPersonalisedRecommendationAction=d.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction.toObject(e.privacySettingChannelsPersonalisedRecommendationAction,i),i.oneofs&&(A._privacySettingChannelsPersonalisedRecommendationAction="privacySettingChannelsPersonalisedRecommendationAction")),e.businessBroadcastAssociationAction!=null&&e.hasOwnProperty("businessBroadcastAssociationAction")&&(A.businessBroadcastAssociationAction=d.proto.SyncActionValue.BusinessBroadcastAssociationAction.toObject(e.businessBroadcastAssociationAction,i),i.oneofs&&(A._businessBroadcastAssociationAction="businessBroadcastAssociationAction")),e.detectedOutcomesStatusAction!=null&&e.hasOwnProperty("detectedOutcomesStatusAction")&&(A.detectedOutcomesStatusAction=d.proto.SyncActionValue.DetectedOutcomesStatusAction.toObject(e.detectedOutcomesStatusAction,i),i.oneofs&&(A._detectedOutcomesStatusAction="detectedOutcomesStatusAction")),e.maibaAiFeaturesControlAction!=null&&e.hasOwnProperty("maibaAiFeaturesControlAction")&&(A.maibaAiFeaturesControlAction=d.proto.SyncActionValue.MaibaAIFeaturesControlAction.toObject(e.maibaAiFeaturesControlAction,i),i.oneofs&&(A._maibaAiFeaturesControlAction="maibaAiFeaturesControlAction")),e.businessBroadcastListAction!=null&&e.hasOwnProperty("businessBroadcastListAction")&&(A.businessBroadcastListAction=d.proto.SyncActionValue.BusinessBroadcastListAction.toObject(e.businessBroadcastListAction,i),i.oneofs&&(A._businessBroadcastListAction="businessBroadcastListAction")),e.musicUserIdAction!=null&&e.hasOwnProperty("musicUserIdAction")&&(A.musicUserIdAction=d.proto.SyncActionValue.MusicUserIdAction.toObject(e.musicUserIdAction,i),i.oneofs&&(A._musicUserIdAction="musicUserIdAction")),e.statusPostOptInNotificationPreferencesAction!=null&&e.hasOwnProperty("statusPostOptInNotificationPreferencesAction")&&(A.statusPostOptInNotificationPreferencesAction=d.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction.toObject(e.statusPostOptInNotificationPreferencesAction,i),i.oneofs&&(A._statusPostOptInNotificationPreferencesAction="statusPostOptInNotificationPreferencesAction")),e.avatarUpdatedAction!=null&&e.hasOwnProperty("avatarUpdatedAction")&&(A.avatarUpdatedAction=d.proto.SyncActionValue.AvatarUpdatedAction.toObject(e.avatarUpdatedAction,i),i.oneofs&&(A._avatarUpdatedAction="avatarUpdatedAction")),e.privateProcessingSettingAction!=null&&e.hasOwnProperty("privateProcessingSettingAction")&&(A.privateProcessingSettingAction=d.proto.SyncActionValue.PrivateProcessingSettingAction.toObject(e.privateProcessingSettingAction,i),i.oneofs&&(A._privateProcessingSettingAction="privateProcessingSettingAction")),e.newsletterSavedInterestsAction!=null&&e.hasOwnProperty("newsletterSavedInterestsAction")&&(A.newsletterSavedInterestsAction=d.proto.SyncActionValue.NewsletterSavedInterestsAction.toObject(e.newsletterSavedInterestsAction,i),i.oneofs&&(A._newsletterSavedInterestsAction="newsletterSavedInterestsAction")),e.aiThreadRenameAction!=null&&e.hasOwnProperty("aiThreadRenameAction")&&(A.aiThreadRenameAction=d.proto.SyncActionValue.AiThreadRenameAction.toObject(e.aiThreadRenameAction,i),i.oneofs&&(A._aiThreadRenameAction="aiThreadRenameAction")),e.interactiveMessageAction!=null&&e.hasOwnProperty("interactiveMessageAction")&&(A.interactiveMessageAction=d.proto.SyncActionValue.InteractiveMessageAction.toObject(e.interactiveMessageAction,i),i.oneofs&&(A._interactiveMessageAction="interactiveMessageAction")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncActionValue"},t.AgentAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.deviceID=A.int32();break}case 3:{c.isDeleted=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.AgentAction)return A;var r=new d.proto.SyncActionValue.AgentAction;return A.name!=null&&(r.name=String(A.name)),A.deviceID!=null&&(r.deviceID=A.deviceID|0),A.isDeleted!=null&&(r.isDeleted=!!A.isDeleted),r},a.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.deviceID!=null&&A.hasOwnProperty("deviceID")&&(s.deviceID=A.deviceID,r.oneofs&&(s._deviceID="deviceID")),A.isDeleted!=null&&A.hasOwnProperty("isDeleted")&&(s.isDeleted=A.isDeleted,r.oneofs&&(s._isDeleted="isDeleted")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AgentAction"},a})(),t.AiThreadRenameAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.newTitle=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.AiThreadRenameAction)return A;var r=new d.proto.SyncActionValue.AiThreadRenameAction;return A.newTitle!=null&&(r.newTitle=String(A.newTitle)),r},a.toObject=function(A,r){r||(r={});var s={};return A.newTitle!=null&&A.hasOwnProperty("newTitle")&&(s.newTitle=A.newTitle,r.oneofs&&(s._newTitle="newTitle")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AiThreadRenameAction"},a})(),t.AndroidUnsupportedActions=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.allowed=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.AndroidUnsupportedActions)return A;var r=new d.proto.SyncActionValue.AndroidUnsupportedActions;return A.allowed!=null&&(r.allowed=!!A.allowed),r},a.toObject=function(A,r){r||(r={});var s={};return A.allowed!=null&&A.hasOwnProperty("allowed")&&(s.allowed=A.allowed,r.oneofs&&(s._allowed="allowed")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.AndroidUnsupportedActions"},a})(),t.ArchiveChatAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.archived=A.bool();break}case 2:{c.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.ArchiveChatAction)return A;var r=new d.proto.SyncActionValue.ArchiveChatAction;if(A.archived!=null&&(r.archived=!!A.archived),A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.ArchiveChatAction.messageRange: object expected");r.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.archived!=null&&A.hasOwnProperty("archived")&&(s.archived=A.archived,r.oneofs&&(s._archived="archived")),A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ArchiveChatAction"},a})(),t.AvatarUpdatedAction=(function(){function a(i){if(this.recentAvatarStickers=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.eventType=A.int32();break}case 2:{c.recentAvatarStickers&&c.recentAvatarStickers.length||(c.recentAvatarStickers=[]),c.recentAvatarStickers.push(d.proto.SyncActionValue.StickerAction.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.AvatarUpdatedAction)return A;var r=new d.proto.SyncActionValue.AvatarUpdatedAction;switch(A.eventType){default:if(typeof A.eventType=="number"){r.eventType=A.eventType;break}break;case"UPDATED":case 0:r.eventType=0;break;case"CREATED":case 1:r.eventType=1;break;case"DELETED":case 2:r.eventType=2;break}if(A.recentAvatarStickers){if(!Array.isArray(A.recentAvatarStickers))throw TypeError(".proto.SyncActionValue.AvatarUpdatedAction.recentAvatarStickers: array expected");r.recentAvatarStickers=[];for(var s=0;s>>3){case 1:{c.isSent=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.BotWelcomeRequestAction)return A;var r=new d.proto.SyncActionValue.BotWelcomeRequestAction;return A.isSent!=null&&(r.isSent=!!A.isSent),r},a.toObject=function(A,r){r||(r={});var s={};return A.isSent!=null&&A.hasOwnProperty("isSent")&&(s.isSent=A.isSent,r.oneofs&&(s._isSent="isSent")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BotWelcomeRequestAction"},a})(),t.BroadcastListParticipant=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.lidJid=A.string();break}case 2:{c.pnJid=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.BroadcastListParticipant)return A;var r=new d.proto.SyncActionValue.BroadcastListParticipant;return A.lidJid!=null&&(r.lidJid=String(A.lidJid)),A.pnJid!=null&&(r.pnJid=String(A.pnJid)),r},a.toObject=function(A,r){r||(r={});var s={};return r.defaults&&(s.lidJid=""),A.lidJid!=null&&A.hasOwnProperty("lidJid")&&(s.lidJid=A.lidJid),A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,r.oneofs&&(s._pnJid="pnJid")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BroadcastListParticipant"},a})(),t.BusinessBroadcastAssociationAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.deleted=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.BusinessBroadcastAssociationAction)return A;var r=new d.proto.SyncActionValue.BusinessBroadcastAssociationAction;return A.deleted!=null&&(r.deleted=!!A.deleted),r},a.toObject=function(A,r){r||(r={});var s={};return A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,r.oneofs&&(s._deleted="deleted")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.BusinessBroadcastAssociationAction"},a})(),t.BusinessBroadcastListAction=(function(){function a(i){if(this.participants=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.deleted=A.bool();break}case 2:{c.participants&&c.participants.length||(c.participants=[]),c.participants.push(d.proto.SyncActionValue.BroadcastListParticipant.decode(A,A.uint32()));break}case 3:{c.listName=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.BusinessBroadcastListAction)return A;var r=new d.proto.SyncActionValue.BusinessBroadcastListAction;if(A.deleted!=null&&(r.deleted=!!A.deleted),A.participants){if(!Array.isArray(A.participants))throw TypeError(".proto.SyncActionValue.BusinessBroadcastListAction.participants: array expected");r.participants=[];for(var s=0;s>>3){case 1:{c.callLogRecord=d.proto.CallLogRecord.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.CallLogAction)return A;var r=new d.proto.SyncActionValue.CallLogAction;if(A.callLogRecord!=null){if(typeof A.callLogRecord!="object")throw TypeError(".proto.SyncActionValue.CallLogAction.callLogRecord: object expected");r.callLogRecord=d.proto.CallLogRecord.fromObject(A.callLogRecord)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.callLogRecord!=null&&A.hasOwnProperty("callLogRecord")&&(s.callLogRecord=d.proto.CallLogRecord.toObject(A.callLogRecord,r),r.oneofs&&(s._callLogRecord="callLogRecord")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.CallLogAction"},a})(),t.ChatAssignmentAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.deviceAgentID=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.ChatAssignmentAction)return A;var r=new d.proto.SyncActionValue.ChatAssignmentAction;return A.deviceAgentID!=null&&(r.deviceAgentID=String(A.deviceAgentID)),r},a.toObject=function(A,r){r||(r={});var s={};return A.deviceAgentID!=null&&A.hasOwnProperty("deviceAgentID")&&(s.deviceAgentID=A.deviceAgentID,r.oneofs&&(s._deviceAgentID="deviceAgentID")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ChatAssignmentAction"},a})(),t.ChatAssignmentOpenedStatusAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.chatOpened=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.ChatAssignmentOpenedStatusAction)return A;var r=new d.proto.SyncActionValue.ChatAssignmentOpenedStatusAction;return A.chatOpened!=null&&(r.chatOpened=!!A.chatOpened),r},a.toObject=function(A,r){r||(r={});var s={};return A.chatOpened!=null&&A.hasOwnProperty("chatOpened")&&(s.chatOpened=A.chatOpened,r.oneofs&&(s._chatOpened="chatOpened")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ChatAssignmentOpenedStatusAction"},a})(),t.ClearChatAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.ClearChatAction)return A;var r=new d.proto.SyncActionValue.ClearChatAction;if(A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.ClearChatAction.messageRange: object expected");r.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ClearChatAction"},a})(),t.ContactAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.fullName=A.string();break}case 2:{c.firstName=A.string();break}case 3:{c.lidJid=A.string();break}case 4:{c.saveOnPrimaryAddressbook=A.bool();break}case 5:{c.pnJid=A.string();break}case 6:{c.username=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.ContactAction)return A;var r=new d.proto.SyncActionValue.ContactAction;return A.fullName!=null&&(r.fullName=String(A.fullName)),A.firstName!=null&&(r.firstName=String(A.firstName)),A.lidJid!=null&&(r.lidJid=String(A.lidJid)),A.saveOnPrimaryAddressbook!=null&&(r.saveOnPrimaryAddressbook=!!A.saveOnPrimaryAddressbook),A.pnJid!=null&&(r.pnJid=String(A.pnJid)),A.username!=null&&(r.username=String(A.username)),r},a.toObject=function(A,r){r||(r={});var s={};return A.fullName!=null&&A.hasOwnProperty("fullName")&&(s.fullName=A.fullName,r.oneofs&&(s._fullName="fullName")),A.firstName!=null&&A.hasOwnProperty("firstName")&&(s.firstName=A.firstName,r.oneofs&&(s._firstName="firstName")),A.lidJid!=null&&A.hasOwnProperty("lidJid")&&(s.lidJid=A.lidJid,r.oneofs&&(s._lidJid="lidJid")),A.saveOnPrimaryAddressbook!=null&&A.hasOwnProperty("saveOnPrimaryAddressbook")&&(s.saveOnPrimaryAddressbook=A.saveOnPrimaryAddressbook,r.oneofs&&(s._saveOnPrimaryAddressbook="saveOnPrimaryAddressbook")),A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,r.oneofs&&(s._pnJid="pnJid")),A.username!=null&&A.hasOwnProperty("username")&&(s.username=A.username,r.oneofs&&(s._username="username")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ContactAction"},a})(),t.CtwaPerCustomerDataSharingAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isCtwaPerCustomerDataSharingEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.CtwaPerCustomerDataSharingAction)return A;var r=new d.proto.SyncActionValue.CtwaPerCustomerDataSharingAction;return A.isCtwaPerCustomerDataSharingEnabled!=null&&(r.isCtwaPerCustomerDataSharingEnabled=!!A.isCtwaPerCustomerDataSharingEnabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.isCtwaPerCustomerDataSharingEnabled!=null&&A.hasOwnProperty("isCtwaPerCustomerDataSharingEnabled")&&(s.isCtwaPerCustomerDataSharingEnabled=A.isCtwaPerCustomerDataSharingEnabled,r.oneofs&&(s._isCtwaPerCustomerDataSharingEnabled="isCtwaPerCustomerDataSharingEnabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.CtwaPerCustomerDataSharingAction"},a})(),t.CustomPaymentMethod=(function(){function a(e){if(this.metadata=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.credentialId=i.string();break}case 2:{g.country=i.string();break}case 3:{g.type=i.string();break}case 4:{g.metadata&&g.metadata.length||(g.metadata=[]),g.metadata.push(d.proto.SyncActionValue.CustomPaymentMethodMetadata.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.CustomPaymentMethod)return i;var A=new d.proto.SyncActionValue.CustomPaymentMethod;if(i.credentialId!=null&&(A.credentialId=String(i.credentialId)),i.country!=null&&(A.country=String(i.country)),i.type!=null&&(A.type=String(i.type)),i.metadata){if(!Array.isArray(i.metadata))throw TypeError(".proto.SyncActionValue.CustomPaymentMethod.metadata: array expected");A.metadata=[];for(var r=0;r>>3){case 1:{g.key=i.string();break}case 2:{g.value=i.string();break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.CustomPaymentMethodMetadata)return i;var A=new d.proto.SyncActionValue.CustomPaymentMethodMetadata;return i.key!=null&&(A.key=String(i.key)),i.value!=null&&(A.value=String(i.value)),A},a.toObject=function(i,A){A||(A={});var r={};return A.defaults&&(r.key="",r.value=""),i.key!=null&&i.hasOwnProperty("key")&&(r.key=i.key),i.value!=null&&i.hasOwnProperty("value")&&(r.value=i.value),r},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.SyncActionValue.CustomPaymentMethodMetadata"},a})(),t.CustomPaymentMethodsAction=(function(){function a(e){if(this.customPaymentMethods=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.customPaymentMethods&&g.customPaymentMethods.length||(g.customPaymentMethods=[]),g.customPaymentMethods.push(d.proto.SyncActionValue.CustomPaymentMethod.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.CustomPaymentMethodsAction)return i;var A=new d.proto.SyncActionValue.CustomPaymentMethodsAction;if(i.customPaymentMethods){if(!Array.isArray(i.customPaymentMethods))throw TypeError(".proto.SyncActionValue.CustomPaymentMethodsAction.customPaymentMethods: array expected");A.customPaymentMethods=[];for(var r=0;r>>3){case 1:{c.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.DeleteChatAction)return A;var r=new d.proto.SyncActionValue.DeleteChatAction;if(A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.DeleteChatAction.messageRange: object expected");r.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteChatAction"},a})(),t.DeleteIndividualCallLogAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.peerJid=A.string();break}case 2:{c.isIncoming=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.DeleteIndividualCallLogAction)return A;var r=new d.proto.SyncActionValue.DeleteIndividualCallLogAction;return A.peerJid!=null&&(r.peerJid=String(A.peerJid)),A.isIncoming!=null&&(r.isIncoming=!!A.isIncoming),r},a.toObject=function(A,r){r||(r={});var s={};return A.peerJid!=null&&A.hasOwnProperty("peerJid")&&(s.peerJid=A.peerJid,r.oneofs&&(s._peerJid="peerJid")),A.isIncoming!=null&&A.hasOwnProperty("isIncoming")&&(s.isIncoming=A.isIncoming,r.oneofs&&(s._isIncoming="isIncoming")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteIndividualCallLogAction"},a})(),t.DeleteMessageForMeAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.deleteMedia=A.bool();break}case 2:{c.messageTimestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.DeleteMessageForMeAction)return A;var r=new d.proto.SyncActionValue.DeleteMessageForMeAction;return A.deleteMedia!=null&&(r.deleteMedia=!!A.deleteMedia),A.messageTimestamp!=null&&(l.Long?(r.messageTimestamp=l.Long.fromValue(A.messageTimestamp)).unsigned=!1:typeof A.messageTimestamp=="string"?r.messageTimestamp=parseInt(A.messageTimestamp,10):typeof A.messageTimestamp=="number"?r.messageTimestamp=A.messageTimestamp:typeof A.messageTimestamp=="object"&&(r.messageTimestamp=new l.LongBits(A.messageTimestamp.low>>>0,A.messageTimestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.deleteMedia!=null&&A.hasOwnProperty("deleteMedia")&&(s.deleteMedia=A.deleteMedia,r.oneofs&&(s._deleteMedia="deleteMedia")),A.messageTimestamp!=null&&A.hasOwnProperty("messageTimestamp")&&(typeof A.messageTimestamp=="number"?s.messageTimestamp=r.longs===String?String(A.messageTimestamp):A.messageTimestamp:s.messageTimestamp=r.longs===String?ge(A.messageTimestamp):r.longs===Number?ce(A.messageTimestamp):A.messageTimestamp,r.oneofs&&(s._messageTimestamp="messageTimestamp")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DeleteMessageForMeAction"},a})(),t.DetectedOutcomesStatusAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.DetectedOutcomesStatusAction)return A;var r=new d.proto.SyncActionValue.DetectedOutcomesStatusAction;return A.isEnabled!=null&&(r.isEnabled=!!A.isEnabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.isEnabled!=null&&A.hasOwnProperty("isEnabled")&&(s.isEnabled=A.isEnabled,r.oneofs&&(s._isEnabled="isEnabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.DetectedOutcomesStatusAction"},a})(),t.ExternalWebBetaAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isOptIn=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.ExternalWebBetaAction)return A;var r=new d.proto.SyncActionValue.ExternalWebBetaAction;return A.isOptIn!=null&&(r.isOptIn=!!A.isOptIn),r},a.toObject=function(A,r){r||(r={});var s={};return A.isOptIn!=null&&A.hasOwnProperty("isOptIn")&&(s.isOptIn=A.isOptIn,r.oneofs&&(s._isOptIn="isOptIn")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.ExternalWebBetaAction"},a})(),t.FavoritesAction=(function(){function a(e){if(this.favorites=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.favorites&&g.favorites.length||(g.favorites=[]),g.favorites.push(d.proto.SyncActionValue.FavoritesAction.Favorite.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.FavoritesAction)return i;var A=new d.proto.SyncActionValue.FavoritesAction;if(i.favorites){if(!Array.isArray(i.favorites))throw TypeError(".proto.SyncActionValue.FavoritesAction.favorites: array expected");A.favorites=[];for(var r=0;r>>3){case 1:{I.id=r.string();break}default:r.skipType(p&7);break}}return I},e.fromObject=function(r){if(r instanceof d.proto.SyncActionValue.FavoritesAction.Favorite)return r;var s=new d.proto.SyncActionValue.FavoritesAction.Favorite;return r.id!=null&&(s.id=String(r.id)),s},e.toObject=function(r,s){s||(s={});var g={};return r.id!=null&&r.hasOwnProperty("id")&&(g.id=r.id,s.oneofs&&(g._id="id")),g},e.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},e.getTypeUrl=function(r){return r===void 0&&(r="type.googleapis.com"),r+"/proto.SyncActionValue.FavoritesAction.Favorite"},e})(),a})(),t.InteractiveMessageAction=(function(){function a(e){if(e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.type=i.int32();break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.InteractiveMessageAction)return i;var A=new d.proto.SyncActionValue.InteractiveMessageAction;switch(i.type){default:if(typeof i.type=="number"){A.type=i.type;break}break;case"DISABLE_CTA":case 1:A.type=1;break}return A},a.toObject=function(i,A){A||(A={});var r={};return A.defaults&&(r.type=A.enums===String?"DISABLE_CTA":1),i.type!=null&&i.hasOwnProperty("type")&&(r.type=A.enums===String?d.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[i.type]===void 0?i.type:d.proto.SyncActionValue.InteractiveMessageAction.InteractiveMessageActionMode[i.type]:i.type),r},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.SyncActionValue.InteractiveMessageAction"},a.InteractiveMessageActionMode=(function(){let e={},i=Object.create(e);return i[e[1]="DISABLE_CTA"]=1,i})(),a})(),t.KeyExpiration=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.expiredKeyEpoch=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.KeyExpiration)return A;var r=new d.proto.SyncActionValue.KeyExpiration;return A.expiredKeyEpoch!=null&&(r.expiredKeyEpoch=A.expiredKeyEpoch|0),r},a.toObject=function(A,r){r||(r={});var s={};return A.expiredKeyEpoch!=null&&A.hasOwnProperty("expiredKeyEpoch")&&(s.expiredKeyEpoch=A.expiredKeyEpoch,r.oneofs&&(s._expiredKeyEpoch="expiredKeyEpoch")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.KeyExpiration"},a})(),t.LabelAssociationAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.labeled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.LabelAssociationAction)return A;var r=new d.proto.SyncActionValue.LabelAssociationAction;return A.labeled!=null&&(r.labeled=!!A.labeled),r},a.toObject=function(A,r){r||(r={});var s={};return A.labeled!=null&&A.hasOwnProperty("labeled")&&(s.labeled=A.labeled,r.oneofs&&(s._labeled="labeled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LabelAssociationAction"},a})(),t.LabelEditAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.color=A.int32();break}case 3:{c.predefinedId=A.int32();break}case 4:{c.deleted=A.bool();break}case 5:{c.orderIndex=A.int32();break}case 6:{c.isActive=A.bool();break}case 7:{c.type=A.int32();break}case 8:{c.isImmutable=A.bool();break}case 9:{c.muteEndTimeMs=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.LabelEditAction)return A;var r=new d.proto.SyncActionValue.LabelEditAction;switch(A.name!=null&&(r.name=String(A.name)),A.color!=null&&(r.color=A.color|0),A.predefinedId!=null&&(r.predefinedId=A.predefinedId|0),A.deleted!=null&&(r.deleted=!!A.deleted),A.orderIndex!=null&&(r.orderIndex=A.orderIndex|0),A.isActive!=null&&(r.isActive=!!A.isActive),A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"NONE":case 0:r.type=0;break;case"UNREAD":case 1:r.type=1;break;case"GROUPS":case 2:r.type=2;break;case"FAVORITES":case 3:r.type=3;break;case"PREDEFINED":case 4:r.type=4;break;case"CUSTOM":case 5:r.type=5;break;case"COMMUNITY":case 6:r.type=6;break;case"SERVER_ASSIGNED":case 7:r.type=7;break;case"DRAFTED":case 8:r.type=8;break;case"AI_HANDOFF":case 9:r.type=9;break}return A.isImmutable!=null&&(r.isImmutable=!!A.isImmutable),A.muteEndTimeMs!=null&&(l.Long?(r.muteEndTimeMs=l.Long.fromValue(A.muteEndTimeMs)).unsigned=!1:typeof A.muteEndTimeMs=="string"?r.muteEndTimeMs=parseInt(A.muteEndTimeMs,10):typeof A.muteEndTimeMs=="number"?r.muteEndTimeMs=A.muteEndTimeMs:typeof A.muteEndTimeMs=="object"&&(r.muteEndTimeMs=new l.LongBits(A.muteEndTimeMs.low>>>0,A.muteEndTimeMs.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.color!=null&&A.hasOwnProperty("color")&&(s.color=A.color,r.oneofs&&(s._color="color")),A.predefinedId!=null&&A.hasOwnProperty("predefinedId")&&(s.predefinedId=A.predefinedId,r.oneofs&&(s._predefinedId="predefinedId")),A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,r.oneofs&&(s._deleted="deleted")),A.orderIndex!=null&&A.hasOwnProperty("orderIndex")&&(s.orderIndex=A.orderIndex,r.oneofs&&(s._orderIndex="orderIndex")),A.isActive!=null&&A.hasOwnProperty("isActive")&&(s.isActive=A.isActive,r.oneofs&&(s._isActive="isActive")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.SyncActionValue.LabelEditAction.ListType[A.type]===void 0?A.type:d.proto.SyncActionValue.LabelEditAction.ListType[A.type]:A.type,r.oneofs&&(s._type="type")),A.isImmutable!=null&&A.hasOwnProperty("isImmutable")&&(s.isImmutable=A.isImmutable,r.oneofs&&(s._isImmutable="isImmutable")),A.muteEndTimeMs!=null&&A.hasOwnProperty("muteEndTimeMs")&&(typeof A.muteEndTimeMs=="number"?s.muteEndTimeMs=r.longs===String?String(A.muteEndTimeMs):A.muteEndTimeMs:s.muteEndTimeMs=r.longs===String?ge(A.muteEndTimeMs):r.longs===Number?ce(A.muteEndTimeMs):A.muteEndTimeMs,r.oneofs&&(s._muteEndTimeMs="muteEndTimeMs")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LabelEditAction"},a.ListType=(function(){let i={},A=Object.create(i);return A[i[0]="NONE"]=0,A[i[1]="UNREAD"]=1,A[i[2]="GROUPS"]=2,A[i[3]="FAVORITES"]=3,A[i[4]="PREDEFINED"]=4,A[i[5]="CUSTOM"]=5,A[i[6]="COMMUNITY"]=6,A[i[7]="SERVER_ASSIGNED"]=7,A[i[8]="DRAFTED"]=8,A[i[9]="AI_HANDOFF"]=9,A})(),a})(),t.LabelReorderingAction=(function(){function a(e){if(this.sortedLabelIds=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{if(g.sortedLabelIds&&g.sortedLabelIds.length||(g.sortedLabelIds=[]),(c&7)===2)for(var I=i.uint32()+i.pos;i.pos>>3){case 1:{c.fullName=A.string();break}case 2:{c.firstName=A.string();break}case 3:{c.username=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.LidContactAction)return A;var r=new d.proto.SyncActionValue.LidContactAction;return A.fullName!=null&&(r.fullName=String(A.fullName)),A.firstName!=null&&(r.firstName=String(A.firstName)),A.username!=null&&(r.username=String(A.username)),r},a.toObject=function(A,r){r||(r={});var s={};return A.fullName!=null&&A.hasOwnProperty("fullName")&&(s.fullName=A.fullName,r.oneofs&&(s._fullName="fullName")),A.firstName!=null&&A.hasOwnProperty("firstName")&&(s.firstName=A.firstName,r.oneofs&&(s._firstName="firstName")),A.username!=null&&A.hasOwnProperty("username")&&(s.username=A.username,r.oneofs&&(s._username="username")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LidContactAction"},a})(),t.LocaleSetting=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.locale=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.LocaleSetting)return A;var r=new d.proto.SyncActionValue.LocaleSetting;return A.locale!=null&&(r.locale=String(A.locale)),r},a.toObject=function(A,r){r||(r={});var s={};return A.locale!=null&&A.hasOwnProperty("locale")&&(s.locale=A.locale,r.oneofs&&(s._locale="locale")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LocaleSetting"},a})(),t.LockChatAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.locked=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.LockChatAction)return A;var r=new d.proto.SyncActionValue.LockChatAction;return A.locked!=null&&(r.locked=!!A.locked),r},a.toObject=function(A,r){r||(r={});var s={};return A.locked!=null&&A.hasOwnProperty("locked")&&(s.locked=A.locked,r.oneofs&&(s._locked="locked")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.LockChatAction"},a})(),t.MaibaAIFeaturesControlAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.aiFeatureStatus=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MaibaAIFeaturesControlAction)return A;var r=new d.proto.SyncActionValue.MaibaAIFeaturesControlAction;switch(A.aiFeatureStatus){default:if(typeof A.aiFeatureStatus=="number"){r.aiFeatureStatus=A.aiFeatureStatus;break}break;case"ENABLED":case 0:r.aiFeatureStatus=0;break;case"ENABLED_HAS_LEARNING":case 1:r.aiFeatureStatus=1;break;case"DISABLED":case 2:r.aiFeatureStatus=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.aiFeatureStatus!=null&&A.hasOwnProperty("aiFeatureStatus")&&(s.aiFeatureStatus=r.enums===String?d.proto.SyncActionValue.MaibaAIFeaturesControlAction.MaibaAIFeatureStatus[A.aiFeatureStatus]===void 0?A.aiFeatureStatus:d.proto.SyncActionValue.MaibaAIFeaturesControlAction.MaibaAIFeatureStatus[A.aiFeatureStatus]:A.aiFeatureStatus,r.oneofs&&(s._aiFeatureStatus="aiFeatureStatus")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MaibaAIFeaturesControlAction"},a.MaibaAIFeatureStatus=(function(){let i={},A=Object.create(i);return A[i[0]="ENABLED"]=0,A[i[1]="ENABLED_HAS_LEARNING"]=1,A[i[2]="DISABLED"]=2,A})(),a})(),t.MarkChatAsReadAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.read=A.bool();break}case 2:{c.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MarkChatAsReadAction)return A;var r=new d.proto.SyncActionValue.MarkChatAsReadAction;if(A.read!=null&&(r.read=!!A.read),A.messageRange!=null){if(typeof A.messageRange!="object")throw TypeError(".proto.SyncActionValue.MarkChatAsReadAction.messageRange: object expected");r.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.fromObject(A.messageRange)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.read!=null&&A.hasOwnProperty("read")&&(s.read=A.read,r.oneofs&&(s._read="read")),A.messageRange!=null&&A.hasOwnProperty("messageRange")&&(s.messageRange=d.proto.SyncActionValue.SyncActionMessageRange.toObject(A.messageRange,r),r.oneofs&&(s._messageRange="messageRange")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarkChatAsReadAction"},a})(),t.MarketingMessageAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.name=A.string();break}case 2:{c.message=A.string();break}case 3:{c.type=A.int32();break}case 4:{c.createdAt=A.int64();break}case 5:{c.lastSentAt=A.int64();break}case 6:{c.isDeleted=A.bool();break}case 7:{c.mediaId=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MarketingMessageAction)return A;var r=new d.proto.SyncActionValue.MarketingMessageAction;switch(A.name!=null&&(r.name=String(A.name)),A.message!=null&&(r.message=String(A.message)),A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"PERSONALIZED":case 0:r.type=0;break}return A.createdAt!=null&&(l.Long?(r.createdAt=l.Long.fromValue(A.createdAt)).unsigned=!1:typeof A.createdAt=="string"?r.createdAt=parseInt(A.createdAt,10):typeof A.createdAt=="number"?r.createdAt=A.createdAt:typeof A.createdAt=="object"&&(r.createdAt=new l.LongBits(A.createdAt.low>>>0,A.createdAt.high>>>0).toNumber())),A.lastSentAt!=null&&(l.Long?(r.lastSentAt=l.Long.fromValue(A.lastSentAt)).unsigned=!1:typeof A.lastSentAt=="string"?r.lastSentAt=parseInt(A.lastSentAt,10):typeof A.lastSentAt=="number"?r.lastSentAt=A.lastSentAt:typeof A.lastSentAt=="object"&&(r.lastSentAt=new l.LongBits(A.lastSentAt.low>>>0,A.lastSentAt.high>>>0).toNumber())),A.isDeleted!=null&&(r.isDeleted=!!A.isDeleted),A.mediaId!=null&&(r.mediaId=String(A.mediaId)),r},a.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),A.message!=null&&A.hasOwnProperty("message")&&(s.message=A.message,r.oneofs&&(s._message="message")),A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[A.type]===void 0?A.type:d.proto.SyncActionValue.MarketingMessageAction.MarketingMessagePrototypeType[A.type]:A.type,r.oneofs&&(s._type="type")),A.createdAt!=null&&A.hasOwnProperty("createdAt")&&(typeof A.createdAt=="number"?s.createdAt=r.longs===String?String(A.createdAt):A.createdAt:s.createdAt=r.longs===String?ge(A.createdAt):r.longs===Number?ce(A.createdAt):A.createdAt,r.oneofs&&(s._createdAt="createdAt")),A.lastSentAt!=null&&A.hasOwnProperty("lastSentAt")&&(typeof A.lastSentAt=="number"?s.lastSentAt=r.longs===String?String(A.lastSentAt):A.lastSentAt:s.lastSentAt=r.longs===String?ge(A.lastSentAt):r.longs===Number?ce(A.lastSentAt):A.lastSentAt,r.oneofs&&(s._lastSentAt="lastSentAt")),A.isDeleted!=null&&A.hasOwnProperty("isDeleted")&&(s.isDeleted=A.isDeleted,r.oneofs&&(s._isDeleted="isDeleted")),A.mediaId!=null&&A.hasOwnProperty("mediaId")&&(s.mediaId=A.mediaId,r.oneofs&&(s._mediaId="mediaId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarketingMessageAction"},a.MarketingMessagePrototypeType=(function(){let i={},A=Object.create(i);return A[i[0]="PERSONALIZED"]=0,A})(),a})(),t.MarketingMessageBroadcastAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.repliedCount=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MarketingMessageBroadcastAction)return A;var r=new d.proto.SyncActionValue.MarketingMessageBroadcastAction;return A.repliedCount!=null&&(r.repliedCount=A.repliedCount|0),r},a.toObject=function(A,r){r||(r={});var s={};return A.repliedCount!=null&&A.hasOwnProperty("repliedCount")&&(s.repliedCount=A.repliedCount,r.oneofs&&(s._repliedCount="repliedCount")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MarketingMessageBroadcastAction"},a})(),t.MerchantPaymentPartnerAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.status=A.int32();break}case 2:{c.country=A.string();break}case 3:{c.gatewayName=A.string();break}case 4:{c.credentialId=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MerchantPaymentPartnerAction)return A;var r=new d.proto.SyncActionValue.MerchantPaymentPartnerAction;switch(A.status){default:if(typeof A.status=="number"){r.status=A.status;break}break;case"ACTIVE":case 0:r.status=0;break;case"INACTIVE":case 1:r.status=1;break}return A.country!=null&&(r.country=String(A.country)),A.gatewayName!=null&&(r.gatewayName=String(A.gatewayName)),A.credentialId!=null&&(r.credentialId=String(A.credentialId)),r},a.toObject=function(A,r){r||(r={});var s={};return r.defaults&&(s.status=r.enums===String?"ACTIVE":0,s.country=""),A.status!=null&&A.hasOwnProperty("status")&&(s.status=r.enums===String?d.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[A.status]===void 0?A.status:d.proto.SyncActionValue.MerchantPaymentPartnerAction.Status[A.status]:A.status),A.country!=null&&A.hasOwnProperty("country")&&(s.country=A.country),A.gatewayName!=null&&A.hasOwnProperty("gatewayName")&&(s.gatewayName=A.gatewayName,r.oneofs&&(s._gatewayName="gatewayName")),A.credentialId!=null&&A.hasOwnProperty("credentialId")&&(s.credentialId=A.credentialId,r.oneofs&&(s._credentialId="credentialId")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MerchantPaymentPartnerAction"},a.Status=(function(){let i={},A=Object.create(i);return A[i[0]="ACTIVE"]=0,A[i[1]="INACTIVE"]=1,A})(),a})(),t.MusicUserIdAction=(function(){function a(i){if(this.musicUserIdMap={},i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.musicUserId=A.string();break}case 2:{c.musicUserIdMap===l.emptyObject&&(c.musicUserIdMap={});var f=A.uint32()+A.pos;for(I="",p="";A.pos>>3){case 1:I=A.string();break;case 2:p=A.string();break;default:A.skipType(Q&7);break}}c.musicUserIdMap[I]=p;break}default:A.skipType(B&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MusicUserIdAction)return A;var r=new d.proto.SyncActionValue.MusicUserIdAction;if(A.musicUserId!=null&&(r.musicUserId=String(A.musicUserId)),A.musicUserIdMap){if(typeof A.musicUserIdMap!="object")throw TypeError(".proto.SyncActionValue.MusicUserIdAction.musicUserIdMap: object expected");r.musicUserIdMap={};for(var s=Object.keys(A.musicUserIdMap),g=0;g>>3){case 1:{c.muted=A.bool();break}case 2:{c.muteEndTimestamp=A.int64();break}case 3:{c.autoMuted=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.MuteAction)return A;var r=new d.proto.SyncActionValue.MuteAction;return A.muted!=null&&(r.muted=!!A.muted),A.muteEndTimestamp!=null&&(l.Long?(r.muteEndTimestamp=l.Long.fromValue(A.muteEndTimestamp)).unsigned=!1:typeof A.muteEndTimestamp=="string"?r.muteEndTimestamp=parseInt(A.muteEndTimestamp,10):typeof A.muteEndTimestamp=="number"?r.muteEndTimestamp=A.muteEndTimestamp:typeof A.muteEndTimestamp=="object"&&(r.muteEndTimestamp=new l.LongBits(A.muteEndTimestamp.low>>>0,A.muteEndTimestamp.high>>>0).toNumber())),A.autoMuted!=null&&(r.autoMuted=!!A.autoMuted),r},a.toObject=function(A,r){r||(r={});var s={};return A.muted!=null&&A.hasOwnProperty("muted")&&(s.muted=A.muted,r.oneofs&&(s._muted="muted")),A.muteEndTimestamp!=null&&A.hasOwnProperty("muteEndTimestamp")&&(typeof A.muteEndTimestamp=="number"?s.muteEndTimestamp=r.longs===String?String(A.muteEndTimestamp):A.muteEndTimestamp:s.muteEndTimestamp=r.longs===String?ge(A.muteEndTimestamp):r.longs===Number?ce(A.muteEndTimestamp):A.muteEndTimestamp,r.oneofs&&(s._muteEndTimestamp="muteEndTimestamp")),A.autoMuted!=null&&A.hasOwnProperty("autoMuted")&&(s.autoMuted=A.autoMuted,r.oneofs&&(s._autoMuted="autoMuted")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.MuteAction"},a})(),t.NewsletterSavedInterestsAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.newsletterSavedInterests=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.NewsletterSavedInterestsAction)return A;var r=new d.proto.SyncActionValue.NewsletterSavedInterestsAction;return A.newsletterSavedInterests!=null&&(r.newsletterSavedInterests=String(A.newsletterSavedInterests)),r},a.toObject=function(A,r){r||(r={});var s={};return A.newsletterSavedInterests!=null&&A.hasOwnProperty("newsletterSavedInterests")&&(s.newsletterSavedInterests=A.newsletterSavedInterests,r.oneofs&&(s._newsletterSavedInterests="newsletterSavedInterests")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NewsletterSavedInterestsAction"},a})(),t.NoteEditAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.type=A.int32();break}case 2:{c.chatJid=A.string();break}case 3:{c.createdAt=A.int64();break}case 4:{c.deleted=A.bool();break}case 5:{c.unstructuredContent=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.NoteEditAction)return A;var r=new d.proto.SyncActionValue.NoteEditAction;switch(A.type){default:if(typeof A.type=="number"){r.type=A.type;break}break;case"UNSTRUCTURED":case 1:r.type=1;break;case"STRUCTURED":case 2:r.type=2;break}return A.chatJid!=null&&(r.chatJid=String(A.chatJid)),A.createdAt!=null&&(l.Long?(r.createdAt=l.Long.fromValue(A.createdAt)).unsigned=!1:typeof A.createdAt=="string"?r.createdAt=parseInt(A.createdAt,10):typeof A.createdAt=="number"?r.createdAt=A.createdAt:typeof A.createdAt=="object"&&(r.createdAt=new l.LongBits(A.createdAt.low>>>0,A.createdAt.high>>>0).toNumber())),A.deleted!=null&&(r.deleted=!!A.deleted),A.unstructuredContent!=null&&(r.unstructuredContent=String(A.unstructuredContent)),r},a.toObject=function(A,r){r||(r={});var s={};return A.type!=null&&A.hasOwnProperty("type")&&(s.type=r.enums===String?d.proto.SyncActionValue.NoteEditAction.NoteType[A.type]===void 0?A.type:d.proto.SyncActionValue.NoteEditAction.NoteType[A.type]:A.type,r.oneofs&&(s._type="type")),A.chatJid!=null&&A.hasOwnProperty("chatJid")&&(s.chatJid=A.chatJid,r.oneofs&&(s._chatJid="chatJid")),A.createdAt!=null&&A.hasOwnProperty("createdAt")&&(typeof A.createdAt=="number"?s.createdAt=r.longs===String?String(A.createdAt):A.createdAt:s.createdAt=r.longs===String?ge(A.createdAt):r.longs===Number?ce(A.createdAt):A.createdAt,r.oneofs&&(s._createdAt="createdAt")),A.deleted!=null&&A.hasOwnProperty("deleted")&&(s.deleted=A.deleted,r.oneofs&&(s._deleted="deleted")),A.unstructuredContent!=null&&A.hasOwnProperty("unstructuredContent")&&(s.unstructuredContent=A.unstructuredContent,r.oneofs&&(s._unstructuredContent="unstructuredContent")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NoteEditAction"},a.NoteType=(function(){let i={},A=Object.create(i);return A[i[1]="UNSTRUCTURED"]=1,A[i[2]="STRUCTURED"]=2,A})(),a})(),t.NotificationActivitySettingAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.notificationActivitySetting=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.NotificationActivitySettingAction)return A;var r=new d.proto.SyncActionValue.NotificationActivitySettingAction;switch(A.notificationActivitySetting){default:if(typeof A.notificationActivitySetting=="number"){r.notificationActivitySetting=A.notificationActivitySetting;break}break;case"DEFAULT_ALL_MESSAGES":case 0:r.notificationActivitySetting=0;break;case"ALL_MESSAGES":case 1:r.notificationActivitySetting=1;break;case"HIGHLIGHTS":case 2:r.notificationActivitySetting=2;break;case"DEFAULT_HIGHLIGHTS":case 3:r.notificationActivitySetting=3;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.notificationActivitySetting!=null&&A.hasOwnProperty("notificationActivitySetting")&&(s.notificationActivitySetting=r.enums===String?d.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[A.notificationActivitySetting]===void 0?A.notificationActivitySetting:d.proto.SyncActionValue.NotificationActivitySettingAction.NotificationActivitySetting[A.notificationActivitySetting]:A.notificationActivitySetting,r.oneofs&&(s._notificationActivitySetting="notificationActivitySetting")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NotificationActivitySettingAction"},a.NotificationActivitySetting=(function(){let i={},A=Object.create(i);return A[i[0]="DEFAULT_ALL_MESSAGES"]=0,A[i[1]="ALL_MESSAGES"]=1,A[i[2]="HIGHLIGHTS"]=2,A[i[3]="DEFAULT_HIGHLIGHTS"]=3,A})(),a})(),t.NuxAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.acknowledged=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.NuxAction)return A;var r=new d.proto.SyncActionValue.NuxAction;return A.acknowledged!=null&&(r.acknowledged=!!A.acknowledged),r},a.toObject=function(A,r){r||(r={});var s={};return A.acknowledged!=null&&A.hasOwnProperty("acknowledged")&&(s.acknowledged=A.acknowledged,r.oneofs&&(s._acknowledged="acknowledged")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.NuxAction"},a})(),t.PaymentInfoAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.cpi=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PaymentInfoAction)return A;var r=new d.proto.SyncActionValue.PaymentInfoAction;return A.cpi!=null&&(r.cpi=String(A.cpi)),r},a.toObject=function(A,r){r||(r={});var s={};return A.cpi!=null&&A.hasOwnProperty("cpi")&&(s.cpi=A.cpi,r.oneofs&&(s._cpi="cpi")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PaymentInfoAction"},a})(),t.PaymentTosAction=(function(){function a(e){if(e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.paymentNotice=i.int32();break}case 2:{g.accepted=i.bool();break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.PaymentTosAction)return i;var A=new d.proto.SyncActionValue.PaymentTosAction;switch(i.paymentNotice){default:if(typeof i.paymentNotice=="number"){A.paymentNotice=i.paymentNotice;break}break;case"BR_PAY_PRIVACY_POLICY":case 0:A.paymentNotice=0;break}return i.accepted!=null&&(A.accepted=!!i.accepted),A},a.toObject=function(i,A){A||(A={});var r={};return A.defaults&&(r.paymentNotice=A.enums===String?"BR_PAY_PRIVACY_POLICY":0,r.accepted=!1),i.paymentNotice!=null&&i.hasOwnProperty("paymentNotice")&&(r.paymentNotice=A.enums===String?d.proto.SyncActionValue.PaymentTosAction.PaymentNotice[i.paymentNotice]===void 0?i.paymentNotice:d.proto.SyncActionValue.PaymentTosAction.PaymentNotice[i.paymentNotice]:i.paymentNotice),i.accepted!=null&&i.hasOwnProperty("accepted")&&(r.accepted=i.accepted),r},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.SyncActionValue.PaymentTosAction"},a.PaymentNotice=(function(){let e={},i=Object.create(e);return i[e[0]="BR_PAY_PRIVACY_POLICY"]=0,i})(),a})(),t.PinAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.pinned=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PinAction)return A;var r=new d.proto.SyncActionValue.PinAction;return A.pinned!=null&&(r.pinned=!!A.pinned),r},a.toObject=function(A,r){r||(r={});var s={};return A.pinned!=null&&A.hasOwnProperty("pinned")&&(s.pinned=A.pinned,r.oneofs&&(s._pinned="pinned")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PinAction"},a})(),t.PnForLidChatAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.pnJid=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PnForLidChatAction)return A;var r=new d.proto.SyncActionValue.PnForLidChatAction;return A.pnJid!=null&&(r.pnJid=String(A.pnJid)),r},a.toObject=function(A,r){r||(r={});var s={};return A.pnJid!=null&&A.hasOwnProperty("pnJid")&&(s.pnJid=A.pnJid,r.oneofs&&(s._pnJid="pnJid")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PnForLidChatAction"},a})(),t.PrimaryFeature=(function(){function a(e){if(this.flags=[],e)for(var i=Object.keys(e),A=0;A>>3){case 1:{g.flags&&g.flags.length||(g.flags=[]),g.flags.push(i.string());break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.PrimaryFeature)return i;var A=new d.proto.SyncActionValue.PrimaryFeature;if(i.flags){if(!Array.isArray(i.flags))throw TypeError(".proto.SyncActionValue.PrimaryFeature.flags: array expected");A.flags=[];for(var r=0;r>>3){case 1:{c.version=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PrimaryVersionAction)return A;var r=new d.proto.SyncActionValue.PrimaryVersionAction;return A.version!=null&&(r.version=String(A.version)),r},a.toObject=function(A,r){r||(r={});var s={};return A.version!=null&&A.hasOwnProperty("version")&&(s.version=A.version,r.oneofs&&(s._version="version")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrimaryVersionAction"},a})(),t.PrivacySettingChannelsPersonalisedRecommendationAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isUserOptedOut=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction)return A;var r=new d.proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction;return A.isUserOptedOut!=null&&(r.isUserOptedOut=!!A.isUserOptedOut),r},a.toObject=function(A,r){r||(r={});var s={};return A.isUserOptedOut!=null&&A.hasOwnProperty("isUserOptedOut")&&(s.isUserOptedOut=A.isUserOptedOut,r.oneofs&&(s._isUserOptedOut="isUserOptedOut")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingChannelsPersonalisedRecommendationAction"},a})(),t.PrivacySettingDisableLinkPreviewsAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isPreviewsDisabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction)return A;var r=new d.proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction;return A.isPreviewsDisabled!=null&&(r.isPreviewsDisabled=!!A.isPreviewsDisabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.isPreviewsDisabled!=null&&A.hasOwnProperty("isPreviewsDisabled")&&(s.isPreviewsDisabled=A.isPreviewsDisabled,r.oneofs&&(s._isPreviewsDisabled="isPreviewsDisabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingDisableLinkPreviewsAction"},a})(),t.PrivacySettingRelayAllCalls=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PrivacySettingRelayAllCalls)return A;var r=new d.proto.SyncActionValue.PrivacySettingRelayAllCalls;return A.isEnabled!=null&&(r.isEnabled=!!A.isEnabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.isEnabled!=null&&A.hasOwnProperty("isEnabled")&&(s.isEnabled=A.isEnabled,r.oneofs&&(s._isEnabled="isEnabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivacySettingRelayAllCalls"},a})(),t.PrivateProcessingSettingAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.privateProcessingStatus=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PrivateProcessingSettingAction)return A;var r=new d.proto.SyncActionValue.PrivateProcessingSettingAction;switch(A.privateProcessingStatus){default:if(typeof A.privateProcessingStatus=="number"){r.privateProcessingStatus=A.privateProcessingStatus;break}break;case"UNDEFINED":case 0:r.privateProcessingStatus=0;break;case"ENABLED":case 1:r.privateProcessingStatus=1;break;case"DISABLED":case 2:r.privateProcessingStatus=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.privateProcessingStatus!=null&&A.hasOwnProperty("privateProcessingStatus")&&(s.privateProcessingStatus=r.enums===String?d.proto.SyncActionValue.PrivateProcessingSettingAction.PrivateProcessingStatus[A.privateProcessingStatus]===void 0?A.privateProcessingStatus:d.proto.SyncActionValue.PrivateProcessingSettingAction.PrivateProcessingStatus[A.privateProcessingStatus]:A.privateProcessingStatus,r.oneofs&&(s._privateProcessingStatus="privateProcessingStatus")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PrivateProcessingSettingAction"},a.PrivateProcessingStatus=(function(){let i={},A=Object.create(i);return A[i[0]="UNDEFINED"]=0,A[i[1]="ENABLED"]=1,A[i[2]="DISABLED"]=2,A})(),a})(),t.PushNameSetting=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.name=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.PushNameSetting)return A;var r=new d.proto.SyncActionValue.PushNameSetting;return A.name!=null&&(r.name=String(A.name)),r},a.toObject=function(A,r){r||(r={});var s={};return A.name!=null&&A.hasOwnProperty("name")&&(s.name=A.name,r.oneofs&&(s._name="name")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.PushNameSetting"},a})(),t.QuickReplyAction=(function(){function a(i){if(this.keywords=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.shortcut=A.string();break}case 2:{c.message=A.string();break}case 3:{c.keywords&&c.keywords.length||(c.keywords=[]),c.keywords.push(A.string());break}case 4:{c.count=A.int32();break}case 5:{c.deleted=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.QuickReplyAction)return A;var r=new d.proto.SyncActionValue.QuickReplyAction;if(A.shortcut!=null&&(r.shortcut=String(A.shortcut)),A.message!=null&&(r.message=String(A.message)),A.keywords){if(!Array.isArray(A.keywords))throw TypeError(".proto.SyncActionValue.QuickReplyAction.keywords: array expected");r.keywords=[];for(var s=0;s>>3){case 1:{g.weights&&g.weights.length||(g.weights=[]),g.weights.push(d.proto.RecentEmojiWeight.decode(i,i.uint32()));break}default:i.skipType(c&7);break}}return g},a.fromObject=function(i){if(i instanceof d.proto.SyncActionValue.RecentEmojiWeightsAction)return i;var A=new d.proto.SyncActionValue.RecentEmojiWeightsAction;if(i.weights){if(!Array.isArray(i.weights))throw TypeError(".proto.SyncActionValue.RecentEmojiWeightsAction.weights: array expected");A.weights=[];for(var r=0;r>>3){case 1:{c.lastStickerSentTs=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.RemoveRecentStickerAction)return A;var r=new d.proto.SyncActionValue.RemoveRecentStickerAction;return A.lastStickerSentTs!=null&&(l.Long?(r.lastStickerSentTs=l.Long.fromValue(A.lastStickerSentTs)).unsigned=!1:typeof A.lastStickerSentTs=="string"?r.lastStickerSentTs=parseInt(A.lastStickerSentTs,10):typeof A.lastStickerSentTs=="number"?r.lastStickerSentTs=A.lastStickerSentTs:typeof A.lastStickerSentTs=="object"&&(r.lastStickerSentTs=new l.LongBits(A.lastStickerSentTs.low>>>0,A.lastStickerSentTs.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.lastStickerSentTs!=null&&A.hasOwnProperty("lastStickerSentTs")&&(typeof A.lastStickerSentTs=="number"?s.lastStickerSentTs=r.longs===String?String(A.lastStickerSentTs):A.lastStickerSentTs:s.lastStickerSentTs=r.longs===String?ge(A.lastStickerSentTs):r.longs===Number?ce(A.lastStickerSentTs):A.lastStickerSentTs,r.oneofs&&(s._lastStickerSentTs="lastStickerSentTs")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.RemoveRecentStickerAction"},a})(),t.StarAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.starred=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.StarAction)return A;var r=new d.proto.SyncActionValue.StarAction;return A.starred!=null&&(r.starred=!!A.starred),r},a.toObject=function(A,r){r||(r={});var s={};return A.starred!=null&&A.hasOwnProperty("starred")&&(s.starred=A.starred,r.oneofs&&(s._starred="starred")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StarAction"},a})(),t.StatusPostOptInNotificationPreferencesAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.enabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction)return A;var r=new d.proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction;return A.enabled!=null&&(r.enabled=!!A.enabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.enabled!=null&&A.hasOwnProperty("enabled")&&(s.enabled=A.enabled,r.oneofs&&(s._enabled="enabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StatusPostOptInNotificationPreferencesAction"},a})(),t.StatusPrivacyAction=(function(){function a(i){if(this.userJid=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.mode=A.int32();break}case 2:{c.userJid&&c.userJid.length||(c.userJid=[]),c.userJid.push(A.string());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.StatusPrivacyAction)return A;var r=new d.proto.SyncActionValue.StatusPrivacyAction;switch(A.mode){default:if(typeof A.mode=="number"){r.mode=A.mode;break}break;case"ALLOW_LIST":case 0:r.mode=0;break;case"DENY_LIST":case 1:r.mode=1;break;case"CONTACTS":case 2:r.mode=2;break;case"CLOSE_FRIENDS":case 3:r.mode=3;break}if(A.userJid){if(!Array.isArray(A.userJid))throw TypeError(".proto.SyncActionValue.StatusPrivacyAction.userJid: array expected");r.userJid=[];for(var s=0;s>>3){case 1:{c.url=A.string();break}case 2:{c.fileEncSha256=A.bytes();break}case 3:{c.mediaKey=A.bytes();break}case 4:{c.mimetype=A.string();break}case 5:{c.height=A.uint32();break}case 6:{c.width=A.uint32();break}case 7:{c.directPath=A.string();break}case 8:{c.fileLength=A.uint64();break}case 9:{c.isFavorite=A.bool();break}case 10:{c.deviceIdHint=A.uint32();break}case 11:{c.isLottie=A.bool();break}case 12:{c.imageHash=A.string();break}case 13:{c.isAvatarSticker=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.StickerAction)return A;var r=new d.proto.SyncActionValue.StickerAction;return A.url!=null&&(r.url=String(A.url)),A.fileEncSha256!=null&&(typeof A.fileEncSha256=="string"?l.base64.decode(A.fileEncSha256,r.fileEncSha256=l.newBuffer(l.base64.length(A.fileEncSha256)),0):A.fileEncSha256.length>=0&&(r.fileEncSha256=A.fileEncSha256)),A.mediaKey!=null&&(typeof A.mediaKey=="string"?l.base64.decode(A.mediaKey,r.mediaKey=l.newBuffer(l.base64.length(A.mediaKey)),0):A.mediaKey.length>=0&&(r.mediaKey=A.mediaKey)),A.mimetype!=null&&(r.mimetype=String(A.mimetype)),A.height!=null&&(r.height=A.height>>>0),A.width!=null&&(r.width=A.width>>>0),A.directPath!=null&&(r.directPath=String(A.directPath)),A.fileLength!=null&&(l.Long?(r.fileLength=l.Long.fromValue(A.fileLength)).unsigned=!0:typeof A.fileLength=="string"?r.fileLength=parseInt(A.fileLength,10):typeof A.fileLength=="number"?r.fileLength=A.fileLength:typeof A.fileLength=="object"&&(r.fileLength=new l.LongBits(A.fileLength.low>>>0,A.fileLength.high>>>0).toNumber(!0))),A.isFavorite!=null&&(r.isFavorite=!!A.isFavorite),A.deviceIdHint!=null&&(r.deviceIdHint=A.deviceIdHint>>>0),A.isLottie!=null&&(r.isLottie=!!A.isLottie),A.imageHash!=null&&(r.imageHash=String(A.imageHash)),A.isAvatarSticker!=null&&(r.isAvatarSticker=!!A.isAvatarSticker),r},a.toObject=function(A,r){r||(r={});var s={};return A.url!=null&&A.hasOwnProperty("url")&&(s.url=A.url,r.oneofs&&(s._url="url")),A.fileEncSha256!=null&&A.hasOwnProperty("fileEncSha256")&&(s.fileEncSha256=r.bytes===String?l.base64.encode(A.fileEncSha256,0,A.fileEncSha256.length):r.bytes===Array?Array.prototype.slice.call(A.fileEncSha256):A.fileEncSha256,r.oneofs&&(s._fileEncSha256="fileEncSha256")),A.mediaKey!=null&&A.hasOwnProperty("mediaKey")&&(s.mediaKey=r.bytes===String?l.base64.encode(A.mediaKey,0,A.mediaKey.length):r.bytes===Array?Array.prototype.slice.call(A.mediaKey):A.mediaKey,r.oneofs&&(s._mediaKey="mediaKey")),A.mimetype!=null&&A.hasOwnProperty("mimetype")&&(s.mimetype=A.mimetype,r.oneofs&&(s._mimetype="mimetype")),A.height!=null&&A.hasOwnProperty("height")&&(s.height=A.height,r.oneofs&&(s._height="height")),A.width!=null&&A.hasOwnProperty("width")&&(s.width=A.width,r.oneofs&&(s._width="width")),A.directPath!=null&&A.hasOwnProperty("directPath")&&(s.directPath=A.directPath,r.oneofs&&(s._directPath="directPath")),A.fileLength!=null&&A.hasOwnProperty("fileLength")&&(typeof A.fileLength=="number"?s.fileLength=r.longs===String?String(A.fileLength):A.fileLength:s.fileLength=r.longs===String?ge(A.fileLength,!0):r.longs===Number?ce(A.fileLength,!0):A.fileLength,r.oneofs&&(s._fileLength="fileLength")),A.isFavorite!=null&&A.hasOwnProperty("isFavorite")&&(s.isFavorite=A.isFavorite,r.oneofs&&(s._isFavorite="isFavorite")),A.deviceIdHint!=null&&A.hasOwnProperty("deviceIdHint")&&(s.deviceIdHint=A.deviceIdHint,r.oneofs&&(s._deviceIdHint="deviceIdHint")),A.isLottie!=null&&A.hasOwnProperty("isLottie")&&(s.isLottie=A.isLottie,r.oneofs&&(s._isLottie="isLottie")),A.imageHash!=null&&A.hasOwnProperty("imageHash")&&(s.imageHash=A.imageHash,r.oneofs&&(s._imageHash="imageHash")),A.isAvatarSticker!=null&&A.hasOwnProperty("isAvatarSticker")&&(s.isAvatarSticker=A.isAvatarSticker,r.oneofs&&(s._isAvatarSticker="isAvatarSticker")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.StickerAction"},a})(),t.SubscriptionAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.isDeactivated=A.bool();break}case 2:{c.isAutoRenewing=A.bool();break}case 3:{c.expirationDate=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.SubscriptionAction)return A;var r=new d.proto.SyncActionValue.SubscriptionAction;return A.isDeactivated!=null&&(r.isDeactivated=!!A.isDeactivated),A.isAutoRenewing!=null&&(r.isAutoRenewing=!!A.isAutoRenewing),A.expirationDate!=null&&(l.Long?(r.expirationDate=l.Long.fromValue(A.expirationDate)).unsigned=!1:typeof A.expirationDate=="string"?r.expirationDate=parseInt(A.expirationDate,10):typeof A.expirationDate=="number"?r.expirationDate=A.expirationDate:typeof A.expirationDate=="object"&&(r.expirationDate=new l.LongBits(A.expirationDate.low>>>0,A.expirationDate.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.isDeactivated!=null&&A.hasOwnProperty("isDeactivated")&&(s.isDeactivated=A.isDeactivated,r.oneofs&&(s._isDeactivated="isDeactivated")),A.isAutoRenewing!=null&&A.hasOwnProperty("isAutoRenewing")&&(s.isAutoRenewing=A.isAutoRenewing,r.oneofs&&(s._isAutoRenewing="isAutoRenewing")),A.expirationDate!=null&&A.hasOwnProperty("expirationDate")&&(typeof A.expirationDate=="number"?s.expirationDate=r.longs===String?String(A.expirationDate):A.expirationDate:s.expirationDate=r.longs===String?ge(A.expirationDate):r.longs===Number?ce(A.expirationDate):A.expirationDate,r.oneofs&&(s._expirationDate="expirationDate")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.SubscriptionAction"},a})(),t.SyncActionMessage=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.key=d.proto.MessageKey.decode(A,A.uint32());break}case 2:{c.timestamp=A.int64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.SyncActionMessage)return A;var r=new d.proto.SyncActionValue.SyncActionMessage;if(A.key!=null){if(typeof A.key!="object")throw TypeError(".proto.SyncActionValue.SyncActionMessage.key: object expected");r.key=d.proto.MessageKey.fromObject(A.key)}return A.timestamp!=null&&(l.Long?(r.timestamp=l.Long.fromValue(A.timestamp)).unsigned=!1:typeof A.timestamp=="string"?r.timestamp=parseInt(A.timestamp,10):typeof A.timestamp=="number"?r.timestamp=A.timestamp:typeof A.timestamp=="object"&&(r.timestamp=new l.LongBits(A.timestamp.low>>>0,A.timestamp.high>>>0).toNumber())),r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=d.proto.MessageKey.toObject(A.key,r),r.oneofs&&(s._key="key")),A.timestamp!=null&&A.hasOwnProperty("timestamp")&&(typeof A.timestamp=="number"?s.timestamp=r.longs===String?String(A.timestamp):A.timestamp:s.timestamp=r.longs===String?ge(A.timestamp):r.longs===Number?ce(A.timestamp):A.timestamp,r.oneofs&&(s._timestamp="timestamp")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.SyncActionMessage"},a})(),t.SyncActionMessageRange=(function(){function a(i){if(this.messages=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.lastMessageTimestamp=A.int64();break}case 2:{c.lastSystemMessageTimestamp=A.int64();break}case 3:{c.messages&&c.messages.length||(c.messages=[]),c.messages.push(d.proto.SyncActionValue.SyncActionMessage.decode(A,A.uint32()));break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.SyncActionMessageRange)return A;var r=new d.proto.SyncActionValue.SyncActionMessageRange;if(A.lastMessageTimestamp!=null&&(l.Long?(r.lastMessageTimestamp=l.Long.fromValue(A.lastMessageTimestamp)).unsigned=!1:typeof A.lastMessageTimestamp=="string"?r.lastMessageTimestamp=parseInt(A.lastMessageTimestamp,10):typeof A.lastMessageTimestamp=="number"?r.lastMessageTimestamp=A.lastMessageTimestamp:typeof A.lastMessageTimestamp=="object"&&(r.lastMessageTimestamp=new l.LongBits(A.lastMessageTimestamp.low>>>0,A.lastMessageTimestamp.high>>>0).toNumber())),A.lastSystemMessageTimestamp!=null&&(l.Long?(r.lastSystemMessageTimestamp=l.Long.fromValue(A.lastSystemMessageTimestamp)).unsigned=!1:typeof A.lastSystemMessageTimestamp=="string"?r.lastSystemMessageTimestamp=parseInt(A.lastSystemMessageTimestamp,10):typeof A.lastSystemMessageTimestamp=="number"?r.lastSystemMessageTimestamp=A.lastSystemMessageTimestamp:typeof A.lastSystemMessageTimestamp=="object"&&(r.lastSystemMessageTimestamp=new l.LongBits(A.lastSystemMessageTimestamp.low>>>0,A.lastSystemMessageTimestamp.high>>>0).toNumber())),A.messages){if(!Array.isArray(A.messages))throw TypeError(".proto.SyncActionValue.SyncActionMessageRange.messages: array expected");r.messages=[];for(var s=0;s>>3){case 1:{c.isTwentyFourHourFormatEnabled=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.TimeFormatAction)return A;var r=new d.proto.SyncActionValue.TimeFormatAction;return A.isTwentyFourHourFormatEnabled!=null&&(r.isTwentyFourHourFormatEnabled=!!A.isTwentyFourHourFormatEnabled),r},a.toObject=function(A,r){r||(r={});var s={};return A.isTwentyFourHourFormatEnabled!=null&&A.hasOwnProperty("isTwentyFourHourFormatEnabled")&&(s.isTwentyFourHourFormatEnabled=A.isTwentyFourHourFormatEnabled,r.oneofs&&(s._isTwentyFourHourFormatEnabled="isTwentyFourHourFormatEnabled")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.TimeFormatAction"},a})(),t.UGCBot=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.definition=A.bytes();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.UGCBot)return A;var r=new d.proto.SyncActionValue.UGCBot;return A.definition!=null&&(typeof A.definition=="string"?l.base64.decode(A.definition,r.definition=l.newBuffer(l.base64.length(A.definition)),0):A.definition.length>=0&&(r.definition=A.definition)),r},a.toObject=function(A,r){r||(r={});var s={};return A.definition!=null&&A.hasOwnProperty("definition")&&(s.definition=r.bytes===String?l.base64.encode(A.definition,0,A.definition.length):r.bytes===Array?Array.prototype.slice.call(A.definition):A.definition,r.oneofs&&(s._definition="definition")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UGCBot"},a})(),t.UnarchiveChatsSetting=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.unarchiveChats=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.UnarchiveChatsSetting)return A;var r=new d.proto.SyncActionValue.UnarchiveChatsSetting;return A.unarchiveChats!=null&&(r.unarchiveChats=!!A.unarchiveChats),r},a.toObject=function(A,r){r||(r={});var s={};return A.unarchiveChats!=null&&A.hasOwnProperty("unarchiveChats")&&(s.unarchiveChats=A.unarchiveChats,r.oneofs&&(s._unarchiveChats="unarchiveChats")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UnarchiveChatsSetting"},a})(),t.UserStatusMuteAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.muted=A.bool();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.UserStatusMuteAction)return A;var r=new d.proto.SyncActionValue.UserStatusMuteAction;return A.muted!=null&&(r.muted=!!A.muted),r},a.toObject=function(A,r){r||(r={});var s={};return A.muted!=null&&A.hasOwnProperty("muted")&&(s.muted=A.muted,r.oneofs&&(s._muted="muted")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UserStatusMuteAction"},a})(),t.UsernameChatStartModeAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.chatStartMode=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.UsernameChatStartModeAction)return A;var r=new d.proto.SyncActionValue.UsernameChatStartModeAction;switch(A.chatStartMode){default:if(typeof A.chatStartMode=="number"){r.chatStartMode=A.chatStartMode;break}break;case"LID":case 1:r.chatStartMode=1;break;case"PN":case 2:r.chatStartMode=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.chatStartMode!=null&&A.hasOwnProperty("chatStartMode")&&(s.chatStartMode=r.enums===String?d.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[A.chatStartMode]===void 0?A.chatStartMode:d.proto.SyncActionValue.UsernameChatStartModeAction.ChatStartMode[A.chatStartMode]:A.chatStartMode,r.oneofs&&(s._chatStartMode="chatStartMode")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.UsernameChatStartModeAction"},a.ChatStartMode=(function(){let i={},A=Object.create(i);return A[i[1]="LID"]=1,A[i[2]="PN"]=2,A})(),a})(),t.WaffleAccountLinkStateAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 2:{c.linkState=A.int32();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.WaffleAccountLinkStateAction)return A;var r=new d.proto.SyncActionValue.WaffleAccountLinkStateAction;switch(A.linkState){default:if(typeof A.linkState=="number"){r.linkState=A.linkState;break}break;case"ACTIVE":case 0:r.linkState=0;break;case"PAUSED":case 1:r.linkState=1;break;case"UNLINKED":case 2:r.linkState=2;break}return r},a.toObject=function(A,r){r||(r={});var s={};return A.linkState!=null&&A.hasOwnProperty("linkState")&&(s.linkState=r.enums===String?d.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[A.linkState]===void 0?A.linkState:d.proto.SyncActionValue.WaffleAccountLinkStateAction.AccountLinkState[A.linkState]:A.linkState,r.oneofs&&(s._linkState="linkState")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.WaffleAccountLinkStateAction"},a.AccountLinkState=(function(){let i={},A=Object.create(i);return A[i[0]="ACTIVE"]=0,A[i[1]="PAUSED"]=1,A[i[2]="UNLINKED"]=2,A})(),a})(),t.WamoUserIdentifierAction=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.identifier=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.SyncActionValue.WamoUserIdentifierAction)return A;var r=new d.proto.SyncActionValue.WamoUserIdentifierAction;return A.identifier!=null&&(r.identifier=String(A.identifier)),r},a.toObject=function(A,r){r||(r={});var s={};return A.identifier!=null&&A.hasOwnProperty("identifier")&&(s.identifier=A.identifier,r.oneofs&&(s._identifier="identifier")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.SyncActionValue.WamoUserIdentifierAction"},a})(),t})(),n.SyncdIndex=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.blob=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdIndex)return e;var i=new d.proto.SyncdIndex;return e.blob!=null&&(typeof e.blob=="string"?l.base64.decode(e.blob,i.blob=l.newBuffer(l.base64.length(e.blob)),0):e.blob.length>=0&&(i.blob=e.blob)),i},t.toObject=function(e,i){i||(i={});var A={};return e.blob!=null&&e.hasOwnProperty("blob")&&(A.blob=i.bytes===String?l.base64.encode(e.blob,0,e.blob.length):i.bytes===Array?Array.prototype.slice.call(e.blob):e.blob,i.oneofs&&(A._blob="blob")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdIndex"},t})(),n.SyncdMutation=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.operation=e.int32();break}case 2:{s.record=d.proto.SyncdRecord.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdMutation)return e;var i=new d.proto.SyncdMutation;switch(e.operation){default:if(typeof e.operation=="number"){i.operation=e.operation;break}break;case"SET":case 0:i.operation=0;break;case"REMOVE":case 1:i.operation=1;break}if(e.record!=null){if(typeof e.record!="object")throw TypeError(".proto.SyncdMutation.record: object expected");i.record=d.proto.SyncdRecord.fromObject(e.record)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.operation!=null&&e.hasOwnProperty("operation")&&(A.operation=i.enums===String?d.proto.SyncdMutation.SyncdOperation[e.operation]===void 0?e.operation:d.proto.SyncdMutation.SyncdOperation[e.operation]:e.operation,i.oneofs&&(A._operation="operation")),e.record!=null&&e.hasOwnProperty("record")&&(A.record=d.proto.SyncdRecord.toObject(e.record,i),i.oneofs&&(A._record="record")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdMutation"},t.SyncdOperation=(function(){let a={},e=Object.create(a);return e[a[0]="SET"]=0,e[a[1]="REMOVE"]=1,e})(),t})(),n.SyncdMutations=(function(){function t(o){if(this.mutations=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.mutations&&r.mutations.length||(r.mutations=[]),r.mutations.push(d.proto.SyncdMutation.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.SyncdMutations)return a;var e=new d.proto.SyncdMutations;if(a.mutations){if(!Array.isArray(a.mutations))throw TypeError(".proto.SyncdMutations.mutations: array expected");e.mutations=[];for(var i=0;i>>3){case 1:{s.version=d.proto.SyncdVersion.decode(e,e.uint32());break}case 2:{s.mutations&&s.mutations.length||(s.mutations=[]),s.mutations.push(d.proto.SyncdMutation.decode(e,e.uint32()));break}case 3:{s.externalMutations=d.proto.ExternalBlobReference.decode(e,e.uint32());break}case 4:{s.snapshotMac=e.bytes();break}case 5:{s.patchMac=e.bytes();break}case 6:{s.keyId=d.proto.KeyId.decode(e,e.uint32());break}case 7:{s.exitCode=d.proto.ExitCode.decode(e,e.uint32());break}case 8:{s.deviceIndex=e.uint32();break}case 9:{s.clientDebugData=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdPatch)return e;var i=new d.proto.SyncdPatch;if(e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.SyncdPatch.version: object expected");i.version=d.proto.SyncdVersion.fromObject(e.version)}if(e.mutations){if(!Array.isArray(e.mutations))throw TypeError(".proto.SyncdPatch.mutations: array expected");i.mutations=[];for(var A=0;A=0&&(i.snapshotMac=e.snapshotMac)),e.patchMac!=null&&(typeof e.patchMac=="string"?l.base64.decode(e.patchMac,i.patchMac=l.newBuffer(l.base64.length(e.patchMac)),0):e.patchMac.length>=0&&(i.patchMac=e.patchMac)),e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdPatch.keyId: object expected");i.keyId=d.proto.KeyId.fromObject(e.keyId)}if(e.exitCode!=null){if(typeof e.exitCode!="object")throw TypeError(".proto.SyncdPatch.exitCode: object expected");i.exitCode=d.proto.ExitCode.fromObject(e.exitCode)}return e.deviceIndex!=null&&(i.deviceIndex=e.deviceIndex>>>0),e.clientDebugData!=null&&(typeof e.clientDebugData=="string"?l.base64.decode(e.clientDebugData,i.clientDebugData=l.newBuffer(l.base64.length(e.clientDebugData)),0):e.clientDebugData.length>=0&&(i.clientDebugData=e.clientDebugData)),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.mutations=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=d.proto.SyncdVersion.toObject(e.version,i),i.oneofs&&(A._version="version")),e.mutations&&e.mutations.length){A.mutations=[];for(var r=0;r>>3){case 1:{s.index=d.proto.SyncdIndex.decode(e,e.uint32());break}case 2:{s.value=d.proto.SyncdValue.decode(e,e.uint32());break}case 3:{s.keyId=d.proto.KeyId.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdRecord)return e;var i=new d.proto.SyncdRecord;if(e.index!=null){if(typeof e.index!="object")throw TypeError(".proto.SyncdRecord.index: object expected");i.index=d.proto.SyncdIndex.fromObject(e.index)}if(e.value!=null){if(typeof e.value!="object")throw TypeError(".proto.SyncdRecord.value: object expected");i.value=d.proto.SyncdValue.fromObject(e.value)}if(e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdRecord.keyId: object expected");i.keyId=d.proto.KeyId.fromObject(e.keyId)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.index!=null&&e.hasOwnProperty("index")&&(A.index=d.proto.SyncdIndex.toObject(e.index,i),i.oneofs&&(A._index="index")),e.value!=null&&e.hasOwnProperty("value")&&(A.value=d.proto.SyncdValue.toObject(e.value,i),i.oneofs&&(A._value="value")),e.keyId!=null&&e.hasOwnProperty("keyId")&&(A.keyId=d.proto.KeyId.toObject(e.keyId,i),i.oneofs&&(A._keyId="keyId")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdRecord"},t})(),n.SyncdSnapshot=(function(){function t(a){if(this.records=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.version=d.proto.SyncdVersion.decode(e,e.uint32());break}case 2:{s.records&&s.records.length||(s.records=[]),s.records.push(d.proto.SyncdRecord.decode(e,e.uint32()));break}case 3:{s.mac=e.bytes();break}case 4:{s.keyId=d.proto.KeyId.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdSnapshot)return e;var i=new d.proto.SyncdSnapshot;if(e.version!=null){if(typeof e.version!="object")throw TypeError(".proto.SyncdSnapshot.version: object expected");i.version=d.proto.SyncdVersion.fromObject(e.version)}if(e.records){if(!Array.isArray(e.records))throw TypeError(".proto.SyncdSnapshot.records: array expected");i.records=[];for(var A=0;A=0&&(i.mac=e.mac)),e.keyId!=null){if(typeof e.keyId!="object")throw TypeError(".proto.SyncdSnapshot.keyId: object expected");i.keyId=d.proto.KeyId.fromObject(e.keyId)}return i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.records=[]),e.version!=null&&e.hasOwnProperty("version")&&(A.version=d.proto.SyncdVersion.toObject(e.version,i),i.oneofs&&(A._version="version")),e.records&&e.records.length){A.records=[];for(var r=0;r>>3){case 1:{s.blob=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdValue)return e;var i=new d.proto.SyncdValue;return e.blob!=null&&(typeof e.blob=="string"?l.base64.decode(e.blob,i.blob=l.newBuffer(l.base64.length(e.blob)),0):e.blob.length>=0&&(i.blob=e.blob)),i},t.toObject=function(e,i){i||(i={});var A={};return e.blob!=null&&e.hasOwnProperty("blob")&&(A.blob=i.bytes===String?l.base64.encode(e.blob,0,e.blob.length):i.bytes===Array?Array.prototype.slice.call(e.blob):e.blob,i.oneofs&&(A._blob="blob")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdValue"},t})(),n.SyncdVersion=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.version=e.uint64();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.SyncdVersion)return e;var i=new d.proto.SyncdVersion;return e.version!=null&&(l.Long?(i.version=l.Long.fromValue(e.version)).unsigned=!0:typeof e.version=="string"?i.version=parseInt(e.version,10):typeof e.version=="number"?i.version=e.version:typeof e.version=="object"&&(i.version=new l.LongBits(e.version.low>>>0,e.version.high>>>0).toNumber(!0))),i},t.toObject=function(e,i){i||(i={});var A={};return e.version!=null&&e.hasOwnProperty("version")&&(typeof e.version=="number"?A.version=i.longs===String?String(e.version):e.version:A.version=i.longs===String?ge(e.version,!0):i.longs===Number?ce(e.version,!0):e.version,i.oneofs&&(A._version="version")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.SyncdVersion"},t})(),n.TapLinkAction=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.title=e.string();break}case 2:{s.tapUrl=e.string();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.TapLinkAction)return e;var i=new d.proto.TapLinkAction;return e.title!=null&&(i.title=String(e.title)),e.tapUrl!=null&&(i.tapUrl=String(e.tapUrl)),i},t.toObject=function(e,i){i||(i={});var A={};return e.title!=null&&e.hasOwnProperty("title")&&(A.title=e.title,i.oneofs&&(A._title="title")),e.tapUrl!=null&&e.hasOwnProperty("tapUrl")&&(A.tapUrl=e.tapUrl,i.oneofs&&(A._tapUrl="tapUrl")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.TapLinkAction"},t})(),n.TemplateButton=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 4:{s.index=e.uint32();break}case 1:{s.quickReplyButton=d.proto.TemplateButton.QuickReplyButton.decode(e,e.uint32());break}case 2:{s.urlButton=d.proto.TemplateButton.URLButton.decode(e,e.uint32());break}case 3:{s.callButton=d.proto.TemplateButton.CallButton.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.TemplateButton)return e;var i=new d.proto.TemplateButton;if(e.index!=null&&(i.index=e.index>>>0),e.quickReplyButton!=null){if(typeof e.quickReplyButton!="object")throw TypeError(".proto.TemplateButton.quickReplyButton: object expected");i.quickReplyButton=d.proto.TemplateButton.QuickReplyButton.fromObject(e.quickReplyButton)}if(e.urlButton!=null){if(typeof e.urlButton!="object")throw TypeError(".proto.TemplateButton.urlButton: object expected");i.urlButton=d.proto.TemplateButton.URLButton.fromObject(e.urlButton)}if(e.callButton!=null){if(typeof e.callButton!="object")throw TypeError(".proto.TemplateButton.callButton: object expected");i.callButton=d.proto.TemplateButton.CallButton.fromObject(e.callButton)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.quickReplyButton!=null&&e.hasOwnProperty("quickReplyButton")&&(A.quickReplyButton=d.proto.TemplateButton.QuickReplyButton.toObject(e.quickReplyButton,i),i.oneofs&&(A.button="quickReplyButton")),e.urlButton!=null&&e.hasOwnProperty("urlButton")&&(A.urlButton=d.proto.TemplateButton.URLButton.toObject(e.urlButton,i),i.oneofs&&(A.button="urlButton")),e.callButton!=null&&e.hasOwnProperty("callButton")&&(A.callButton=d.proto.TemplateButton.CallButton.toObject(e.callButton,i),i.oneofs&&(A.button="callButton")),e.index!=null&&e.hasOwnProperty("index")&&(A.index=e.index,i.oneofs&&(A._index="index")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.TemplateButton"},t.CallButton=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayText=d.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.phoneNumber=d.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.TemplateButton.CallButton)return A;var r=new d.proto.TemplateButton.CallButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.CallButton.displayText: object expected");r.displayText=d.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}if(A.phoneNumber!=null){if(typeof A.phoneNumber!="object")throw TypeError(".proto.TemplateButton.CallButton.phoneNumber: object expected");r.phoneNumber=d.proto.Message.HighlyStructuredMessage.fromObject(A.phoneNumber)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=d.proto.Message.HighlyStructuredMessage.toObject(A.displayText,r),r.oneofs&&(s._displayText="displayText")),A.phoneNumber!=null&&A.hasOwnProperty("phoneNumber")&&(s.phoneNumber=d.proto.Message.HighlyStructuredMessage.toObject(A.phoneNumber,r),r.oneofs&&(s._phoneNumber="phoneNumber")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.CallButton"},a})(),t.QuickReplyButton=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayText=d.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.id=A.string();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.TemplateButton.QuickReplyButton)return A;var r=new d.proto.TemplateButton.QuickReplyButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.QuickReplyButton.displayText: object expected");r.displayText=d.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}return A.id!=null&&(r.id=String(A.id)),r},a.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=d.proto.Message.HighlyStructuredMessage.toObject(A.displayText,r),r.oneofs&&(s._displayText="displayText")),A.id!=null&&A.hasOwnProperty("id")&&(s.id=A.id,r.oneofs&&(s._id="id")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.QuickReplyButton"},a})(),t.URLButton=(function(){function a(i){if(i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.displayText=d.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}case 2:{c.url=d.proto.Message.HighlyStructuredMessage.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.TemplateButton.URLButton)return A;var r=new d.proto.TemplateButton.URLButton;if(A.displayText!=null){if(typeof A.displayText!="object")throw TypeError(".proto.TemplateButton.URLButton.displayText: object expected");r.displayText=d.proto.Message.HighlyStructuredMessage.fromObject(A.displayText)}if(A.url!=null){if(typeof A.url!="object")throw TypeError(".proto.TemplateButton.URLButton.url: object expected");r.url=d.proto.Message.HighlyStructuredMessage.fromObject(A.url)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.displayText!=null&&A.hasOwnProperty("displayText")&&(s.displayText=d.proto.Message.HighlyStructuredMessage.toObject(A.displayText,r),r.oneofs&&(s._displayText="displayText")),A.url!=null&&A.hasOwnProperty("url")&&(s.url=d.proto.Message.HighlyStructuredMessage.toObject(A.url,r),r.oneofs&&(s._url="url")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.TemplateButton.URLButton"},a})(),t})(),n.ThreadID=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.threadType=e.int32();break}case 2:{s.threadKey=d.proto.MessageKey.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.ThreadID)return e;var i=new d.proto.ThreadID;switch(e.threadType){default:if(typeof e.threadType=="number"){i.threadType=e.threadType;break}break;case"UNKNOWN":case 0:i.threadType=0;break;case"VIEW_REPLIES":case 1:i.threadType=1;break;case"AI_THREAD":case 2:i.threadType=2;break}if(e.threadKey!=null){if(typeof e.threadKey!="object")throw TypeError(".proto.ThreadID.threadKey: object expected");i.threadKey=d.proto.MessageKey.fromObject(e.threadKey)}return i},t.toObject=function(e,i){i||(i={});var A={};return e.threadType!=null&&e.hasOwnProperty("threadType")&&(A.threadType=i.enums===String?d.proto.ThreadID.ThreadType[e.threadType]===void 0?e.threadType:d.proto.ThreadID.ThreadType[e.threadType]:e.threadType,i.oneofs&&(A._threadType="threadType")),e.threadKey!=null&&e.hasOwnProperty("threadKey")&&(A.threadKey=d.proto.MessageKey.toObject(e.threadKey,i),i.oneofs&&(A._threadKey="threadKey")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.ThreadID"},t.ThreadType=(function(){let a={},e=Object.create(a);return e[a[0]="UNKNOWN"]=0,e[a[1]="VIEW_REPLIES"]=1,e[a[2]="AI_THREAD"]=2,e})(),t})(),n.UrlTrackingMap=(function(){function t(o){if(this.urlTrackingMapElements=[],o)for(var a=Object.keys(o),e=0;e>>3){case 1:{r.urlTrackingMapElements&&r.urlTrackingMapElements.length||(r.urlTrackingMapElements=[]),r.urlTrackingMapElements.push(d.proto.UrlTrackingMap.UrlTrackingMapElement.decode(a,a.uint32()));break}default:a.skipType(s&7);break}}return r},t.fromObject=function(a){if(a instanceof d.proto.UrlTrackingMap)return a;var e=new d.proto.UrlTrackingMap;if(a.urlTrackingMapElements){if(!Array.isArray(a.urlTrackingMapElements))throw TypeError(".proto.UrlTrackingMap.urlTrackingMapElements: array expected");e.urlTrackingMapElements=[];for(var i=0;i>>3){case 1:{g.originalUrl=i.string();break}case 2:{g.unconsentedUsersUrl=i.string();break}case 3:{g.consentedUsersUrl=i.string();break}case 4:{g.cardIndex=i.uint32();break}default:i.skipType(c&7);break}}return g},o.fromObject=function(i){if(i instanceof d.proto.UrlTrackingMap.UrlTrackingMapElement)return i;var A=new d.proto.UrlTrackingMap.UrlTrackingMapElement;return i.originalUrl!=null&&(A.originalUrl=String(i.originalUrl)),i.unconsentedUsersUrl!=null&&(A.unconsentedUsersUrl=String(i.unconsentedUsersUrl)),i.consentedUsersUrl!=null&&(A.consentedUsersUrl=String(i.consentedUsersUrl)),i.cardIndex!=null&&(A.cardIndex=i.cardIndex>>>0),A},o.toObject=function(i,A){A||(A={});var r={};return i.originalUrl!=null&&i.hasOwnProperty("originalUrl")&&(r.originalUrl=i.originalUrl,A.oneofs&&(r._originalUrl="originalUrl")),i.unconsentedUsersUrl!=null&&i.hasOwnProperty("unconsentedUsersUrl")&&(r.unconsentedUsersUrl=i.unconsentedUsersUrl,A.oneofs&&(r._unconsentedUsersUrl="unconsentedUsersUrl")),i.consentedUsersUrl!=null&&i.hasOwnProperty("consentedUsersUrl")&&(r.consentedUsersUrl=i.consentedUsersUrl,A.oneofs&&(r._consentedUsersUrl="consentedUsersUrl")),i.cardIndex!=null&&i.hasOwnProperty("cardIndex")&&(r.cardIndex=i.cardIndex,A.oneofs&&(r._cardIndex="cardIndex")),r},o.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},o.getTypeUrl=function(i){return i===void 0&&(i="type.googleapis.com"),i+"/proto.UrlTrackingMap.UrlTrackingMapElement"},o})(),t})(),n.UserPassword=(function(){function t(a){if(this.transformerArg=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.encoding=e.int32();break}case 2:{s.transformer=e.int32();break}case 3:{s.transformerArg&&s.transformerArg.length||(s.transformerArg=[]),s.transformerArg.push(d.proto.UserPassword.TransformerArg.decode(e,e.uint32()));break}case 4:{s.transformedData=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.UserPassword)return e;var i=new d.proto.UserPassword;switch(e.encoding){default:if(typeof e.encoding=="number"){i.encoding=e.encoding;break}break;case"UTF8":case 0:i.encoding=0;break;case"UTF8_BROKEN":case 1:i.encoding=1;break}switch(e.transformer){default:if(typeof e.transformer=="number"){i.transformer=e.transformer;break}break;case"NONE":case 0:i.transformer=0;break;case"PBKDF2_HMAC_SHA512":case 1:i.transformer=1;break;case"PBKDF2_HMAC_SHA384":case 2:i.transformer=2;break}if(e.transformerArg){if(!Array.isArray(e.transformerArg))throw TypeError(".proto.UserPassword.transformerArg: array expected");i.transformerArg=[];for(var A=0;A=0&&(i.transformedData=e.transformedData)),i},t.toObject=function(e,i){i||(i={});var A={};if((i.arrays||i.defaults)&&(A.transformerArg=[]),e.encoding!=null&&e.hasOwnProperty("encoding")&&(A.encoding=i.enums===String?d.proto.UserPassword.Encoding[e.encoding]===void 0?e.encoding:d.proto.UserPassword.Encoding[e.encoding]:e.encoding,i.oneofs&&(A._encoding="encoding")),e.transformer!=null&&e.hasOwnProperty("transformer")&&(A.transformer=i.enums===String?d.proto.UserPassword.Transformer[e.transformer]===void 0?e.transformer:d.proto.UserPassword.Transformer[e.transformer]:e.transformer,i.oneofs&&(A._transformer="transformer")),e.transformerArg&&e.transformerArg.length){A.transformerArg=[];for(var r=0;r>>3){case 1:{c.key=A.string();break}case 2:{c.value=d.proto.UserPassword.TransformerArg.Value.decode(A,A.uint32());break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.UserPassword.TransformerArg)return A;var r=new d.proto.UserPassword.TransformerArg;if(A.key!=null&&(r.key=String(A.key)),A.value!=null){if(typeof A.value!="object")throw TypeError(".proto.UserPassword.TransformerArg.value: object expected");r.value=d.proto.UserPassword.TransformerArg.Value.fromObject(A.value)}return r},a.toObject=function(A,r){r||(r={});var s={};return A.key!=null&&A.hasOwnProperty("key")&&(s.key=A.key,r.oneofs&&(s._key="key")),A.value!=null&&A.hasOwnProperty("value")&&(s.value=d.proto.UserPassword.TransformerArg.Value.toObject(A.value,r),r.oneofs&&(s._value="value")),s},a.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},a.getTypeUrl=function(A){return A===void 0&&(A="type.googleapis.com"),A+"/proto.UserPassword.TransformerArg"},a.Value=(function(){function i(r){if(r)for(var s=Object.keys(r),g=0;g>>3){case 1:{p.asBlob=s.bytes();break}case 2:{p.asUnsignedInteger=s.uint32();break}default:s.skipType(B&7);break}}return p},i.fromObject=function(s){if(s instanceof d.proto.UserPassword.TransformerArg.Value)return s;var g=new d.proto.UserPassword.TransformerArg.Value;return s.asBlob!=null&&(typeof s.asBlob=="string"?l.base64.decode(s.asBlob,g.asBlob=l.newBuffer(l.base64.length(s.asBlob)),0):s.asBlob.length>=0&&(g.asBlob=s.asBlob)),s.asUnsignedInteger!=null&&(g.asUnsignedInteger=s.asUnsignedInteger>>>0),g},i.toObject=function(s,g){g||(g={});var c={};return s.asBlob!=null&&s.hasOwnProperty("asBlob")&&(c.asBlob=g.bytes===String?l.base64.encode(s.asBlob,0,s.asBlob.length):g.bytes===Array?Array.prototype.slice.call(s.asBlob):s.asBlob,g.oneofs&&(c.value="asBlob")),s.asUnsignedInteger!=null&&s.hasOwnProperty("asUnsignedInteger")&&(c.asUnsignedInteger=s.asUnsignedInteger,g.oneofs&&(c.value="asUnsignedInteger")),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/proto.UserPassword.TransformerArg.Value"},i})(),a})(),t})(),n.UserReceipt=(function(){function t(a){if(this.pendingDeviceJid=[],this.deliveredDeviceJid=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.userJid=e.string();break}case 2:{s.receiptTimestamp=e.int64();break}case 3:{s.readTimestamp=e.int64();break}case 4:{s.playedTimestamp=e.int64();break}case 5:{s.pendingDeviceJid&&s.pendingDeviceJid.length||(s.pendingDeviceJid=[]),s.pendingDeviceJid.push(e.string());break}case 6:{s.deliveredDeviceJid&&s.deliveredDeviceJid.length||(s.deliveredDeviceJid=[]),s.deliveredDeviceJid.push(e.string());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.UserReceipt)return e;var i=new d.proto.UserReceipt;if(e.userJid!=null&&(i.userJid=String(e.userJid)),e.receiptTimestamp!=null&&(l.Long?(i.receiptTimestamp=l.Long.fromValue(e.receiptTimestamp)).unsigned=!1:typeof e.receiptTimestamp=="string"?i.receiptTimestamp=parseInt(e.receiptTimestamp,10):typeof e.receiptTimestamp=="number"?i.receiptTimestamp=e.receiptTimestamp:typeof e.receiptTimestamp=="object"&&(i.receiptTimestamp=new l.LongBits(e.receiptTimestamp.low>>>0,e.receiptTimestamp.high>>>0).toNumber())),e.readTimestamp!=null&&(l.Long?(i.readTimestamp=l.Long.fromValue(e.readTimestamp)).unsigned=!1:typeof e.readTimestamp=="string"?i.readTimestamp=parseInt(e.readTimestamp,10):typeof e.readTimestamp=="number"?i.readTimestamp=e.readTimestamp:typeof e.readTimestamp=="object"&&(i.readTimestamp=new l.LongBits(e.readTimestamp.low>>>0,e.readTimestamp.high>>>0).toNumber())),e.playedTimestamp!=null&&(l.Long?(i.playedTimestamp=l.Long.fromValue(e.playedTimestamp)).unsigned=!1:typeof e.playedTimestamp=="string"?i.playedTimestamp=parseInt(e.playedTimestamp,10):typeof e.playedTimestamp=="number"?i.playedTimestamp=e.playedTimestamp:typeof e.playedTimestamp=="object"&&(i.playedTimestamp=new l.LongBits(e.playedTimestamp.low>>>0,e.playedTimestamp.high>>>0).toNumber())),e.pendingDeviceJid){if(!Array.isArray(e.pendingDeviceJid))throw TypeError(".proto.UserReceipt.pendingDeviceJid: array expected");i.pendingDeviceJid=[];for(var A=0;A>>3){case 1:{s.details=e.bytes();break}case 2:{s.signature=e.bytes();break}case 3:{s.serverSignature=e.bytes();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.VerifiedNameCertificate)return e;var i=new d.proto.VerifiedNameCertificate;return e.details!=null&&(typeof e.details=="string"?l.base64.decode(e.details,i.details=l.newBuffer(l.base64.length(e.details)),0):e.details.length>=0&&(i.details=e.details)),e.signature!=null&&(typeof e.signature=="string"?l.base64.decode(e.signature,i.signature=l.newBuffer(l.base64.length(e.signature)),0):e.signature.length>=0&&(i.signature=e.signature)),e.serverSignature!=null&&(typeof e.serverSignature=="string"?l.base64.decode(e.serverSignature,i.serverSignature=l.newBuffer(l.base64.length(e.serverSignature)),0):e.serverSignature.length>=0&&(i.serverSignature=e.serverSignature)),i},t.toObject=function(e,i){i||(i={});var A={};return e.details!=null&&e.hasOwnProperty("details")&&(A.details=i.bytes===String?l.base64.encode(e.details,0,e.details.length):i.bytes===Array?Array.prototype.slice.call(e.details):e.details,i.oneofs&&(A._details="details")),e.signature!=null&&e.hasOwnProperty("signature")&&(A.signature=i.bytes===String?l.base64.encode(e.signature,0,e.signature.length):i.bytes===Array?Array.prototype.slice.call(e.signature):e.signature,i.oneofs&&(A._signature="signature")),e.serverSignature!=null&&e.hasOwnProperty("serverSignature")&&(A.serverSignature=i.bytes===String?l.base64.encode(e.serverSignature,0,e.serverSignature.length):i.bytes===Array?Array.prototype.slice.call(e.serverSignature):e.serverSignature,i.oneofs&&(A._serverSignature="serverSignature")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.VerifiedNameCertificate"},t.Details=(function(){function a(i){if(this.localizedNames=[],i)for(var A=Object.keys(i),r=0;r>>3){case 1:{c.serial=A.uint64();break}case 2:{c.issuer=A.string();break}case 4:{c.verifiedName=A.string();break}case 8:{c.localizedNames&&c.localizedNames.length||(c.localizedNames=[]),c.localizedNames.push(d.proto.LocalizedName.decode(A,A.uint32()));break}case 10:{c.issueTime=A.uint64();break}default:A.skipType(I&7);break}}return c},a.fromObject=function(A){if(A instanceof d.proto.VerifiedNameCertificate.Details)return A;var r=new d.proto.VerifiedNameCertificate.Details;if(A.serial!=null&&(l.Long?(r.serial=l.Long.fromValue(A.serial)).unsigned=!0:typeof A.serial=="string"?r.serial=parseInt(A.serial,10):typeof A.serial=="number"?r.serial=A.serial:typeof A.serial=="object"&&(r.serial=new l.LongBits(A.serial.low>>>0,A.serial.high>>>0).toNumber(!0))),A.issuer!=null&&(r.issuer=String(A.issuer)),A.verifiedName!=null&&(r.verifiedName=String(A.verifiedName)),A.localizedNames){if(!Array.isArray(A.localizedNames))throw TypeError(".proto.VerifiedNameCertificate.Details.localizedNames: array expected");r.localizedNames=[];for(var s=0;s>>0,A.issueTime.high>>>0).toNumber(!0))),r},a.toObject=function(A,r){r||(r={});var s={};if((r.arrays||r.defaults)&&(s.localizedNames=[]),A.serial!=null&&A.hasOwnProperty("serial")&&(typeof A.serial=="number"?s.serial=r.longs===String?String(A.serial):A.serial:s.serial=r.longs===String?ge(A.serial,!0):r.longs===Number?ce(A.serial,!0):A.serial,r.oneofs&&(s._serial="serial")),A.issuer!=null&&A.hasOwnProperty("issuer")&&(s.issuer=A.issuer,r.oneofs&&(s._issuer="issuer")),A.verifiedName!=null&&A.hasOwnProperty("verifiedName")&&(s.verifiedName=A.verifiedName,r.oneofs&&(s._verifiedName="verifiedName")),A.localizedNames&&A.localizedNames.length){s.localizedNames=[];for(var g=0;g>>3){case 1:{s.filename=e.string();break}case 2:{s.opacity=e.uint32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.WallpaperSettings)return e;var i=new d.proto.WallpaperSettings;return e.filename!=null&&(i.filename=String(e.filename)),e.opacity!=null&&(i.opacity=e.opacity>>>0),i},t.toObject=function(e,i){i||(i={});var A={};return e.filename!=null&&e.hasOwnProperty("filename")&&(A.filename=e.filename,i.oneofs&&(A._filename="filename")),e.opacity!=null&&e.hasOwnProperty("opacity")&&(A.opacity=e.opacity,i.oneofs&&(A._opacity="opacity")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.WallpaperSettings"},t})(),n.WebFeatures=(function(){function t(a){if(a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.labelsDisplay=e.int32();break}case 2:{s.voipIndividualOutgoing=e.int32();break}case 3:{s.groupsV3=e.int32();break}case 4:{s.groupsV3Create=e.int32();break}case 5:{s.changeNumberV2=e.int32();break}case 6:{s.queryStatusV3Thumbnail=e.int32();break}case 7:{s.liveLocations=e.int32();break}case 8:{s.queryVname=e.int32();break}case 9:{s.voipIndividualIncoming=e.int32();break}case 10:{s.quickRepliesQuery=e.int32();break}case 11:{s.payments=e.int32();break}case 12:{s.stickerPackQuery=e.int32();break}case 13:{s.liveLocationsFinal=e.int32();break}case 14:{s.labelsEdit=e.int32();break}case 15:{s.mediaUpload=e.int32();break}case 18:{s.mediaUploadRichQuickReplies=e.int32();break}case 19:{s.vnameV2=e.int32();break}case 20:{s.videoPlaybackUrl=e.int32();break}case 21:{s.statusRanking=e.int32();break}case 22:{s.voipIndividualVideo=e.int32();break}case 23:{s.thirdPartyStickers=e.int32();break}case 24:{s.frequentlyForwardedSetting=e.int32();break}case 25:{s.groupsV4JoinPermission=e.int32();break}case 26:{s.recentStickers=e.int32();break}case 27:{s.catalog=e.int32();break}case 28:{s.starredStickers=e.int32();break}case 29:{s.voipGroupCall=e.int32();break}case 30:{s.templateMessage=e.int32();break}case 31:{s.templateMessageInteractivity=e.int32();break}case 32:{s.ephemeralMessages=e.int32();break}case 33:{s.e2ENotificationSync=e.int32();break}case 34:{s.recentStickersV2=e.int32();break}case 36:{s.recentStickersV3=e.int32();break}case 37:{s.userNotice=e.int32();break}case 39:{s.support=e.int32();break}case 40:{s.groupUiiCleanup=e.int32();break}case 41:{s.groupDogfoodingInternalOnly=e.int32();break}case 42:{s.settingsSync=e.int32();break}case 43:{s.archiveV2=e.int32();break}case 44:{s.ephemeralAllowGroupMembers=e.int32();break}case 45:{s.ephemeral24HDuration=e.int32();break}case 46:{s.mdForceUpgrade=e.int32();break}case 47:{s.disappearingMode=e.int32();break}case 48:{s.externalMdOptInAvailable=e.int32();break}case 49:{s.noDeleteMessageTimeLimit=e.int32();break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.WebFeatures)return e;var i=new d.proto.WebFeatures;switch(e.labelsDisplay){default:if(typeof e.labelsDisplay=="number"){i.labelsDisplay=e.labelsDisplay;break}break;case"NOT_STARTED":case 0:i.labelsDisplay=0;break;case"FORCE_UPGRADE":case 1:i.labelsDisplay=1;break;case"DEVELOPMENT":case 2:i.labelsDisplay=2;break;case"PRODUCTION":case 3:i.labelsDisplay=3;break}switch(e.voipIndividualOutgoing){default:if(typeof e.voipIndividualOutgoing=="number"){i.voipIndividualOutgoing=e.voipIndividualOutgoing;break}break;case"NOT_STARTED":case 0:i.voipIndividualOutgoing=0;break;case"FORCE_UPGRADE":case 1:i.voipIndividualOutgoing=1;break;case"DEVELOPMENT":case 2:i.voipIndividualOutgoing=2;break;case"PRODUCTION":case 3:i.voipIndividualOutgoing=3;break}switch(e.groupsV3){default:if(typeof e.groupsV3=="number"){i.groupsV3=e.groupsV3;break}break;case"NOT_STARTED":case 0:i.groupsV3=0;break;case"FORCE_UPGRADE":case 1:i.groupsV3=1;break;case"DEVELOPMENT":case 2:i.groupsV3=2;break;case"PRODUCTION":case 3:i.groupsV3=3;break}switch(e.groupsV3Create){default:if(typeof e.groupsV3Create=="number"){i.groupsV3Create=e.groupsV3Create;break}break;case"NOT_STARTED":case 0:i.groupsV3Create=0;break;case"FORCE_UPGRADE":case 1:i.groupsV3Create=1;break;case"DEVELOPMENT":case 2:i.groupsV3Create=2;break;case"PRODUCTION":case 3:i.groupsV3Create=3;break}switch(e.changeNumberV2){default:if(typeof e.changeNumberV2=="number"){i.changeNumberV2=e.changeNumberV2;break}break;case"NOT_STARTED":case 0:i.changeNumberV2=0;break;case"FORCE_UPGRADE":case 1:i.changeNumberV2=1;break;case"DEVELOPMENT":case 2:i.changeNumberV2=2;break;case"PRODUCTION":case 3:i.changeNumberV2=3;break}switch(e.queryStatusV3Thumbnail){default:if(typeof e.queryStatusV3Thumbnail=="number"){i.queryStatusV3Thumbnail=e.queryStatusV3Thumbnail;break}break;case"NOT_STARTED":case 0:i.queryStatusV3Thumbnail=0;break;case"FORCE_UPGRADE":case 1:i.queryStatusV3Thumbnail=1;break;case"DEVELOPMENT":case 2:i.queryStatusV3Thumbnail=2;break;case"PRODUCTION":case 3:i.queryStatusV3Thumbnail=3;break}switch(e.liveLocations){default:if(typeof e.liveLocations=="number"){i.liveLocations=e.liveLocations;break}break;case"NOT_STARTED":case 0:i.liveLocations=0;break;case"FORCE_UPGRADE":case 1:i.liveLocations=1;break;case"DEVELOPMENT":case 2:i.liveLocations=2;break;case"PRODUCTION":case 3:i.liveLocations=3;break}switch(e.queryVname){default:if(typeof e.queryVname=="number"){i.queryVname=e.queryVname;break}break;case"NOT_STARTED":case 0:i.queryVname=0;break;case"FORCE_UPGRADE":case 1:i.queryVname=1;break;case"DEVELOPMENT":case 2:i.queryVname=2;break;case"PRODUCTION":case 3:i.queryVname=3;break}switch(e.voipIndividualIncoming){default:if(typeof e.voipIndividualIncoming=="number"){i.voipIndividualIncoming=e.voipIndividualIncoming;break}break;case"NOT_STARTED":case 0:i.voipIndividualIncoming=0;break;case"FORCE_UPGRADE":case 1:i.voipIndividualIncoming=1;break;case"DEVELOPMENT":case 2:i.voipIndividualIncoming=2;break;case"PRODUCTION":case 3:i.voipIndividualIncoming=3;break}switch(e.quickRepliesQuery){default:if(typeof e.quickRepliesQuery=="number"){i.quickRepliesQuery=e.quickRepliesQuery;break}break;case"NOT_STARTED":case 0:i.quickRepliesQuery=0;break;case"FORCE_UPGRADE":case 1:i.quickRepliesQuery=1;break;case"DEVELOPMENT":case 2:i.quickRepliesQuery=2;break;case"PRODUCTION":case 3:i.quickRepliesQuery=3;break}switch(e.payments){default:if(typeof e.payments=="number"){i.payments=e.payments;break}break;case"NOT_STARTED":case 0:i.payments=0;break;case"FORCE_UPGRADE":case 1:i.payments=1;break;case"DEVELOPMENT":case 2:i.payments=2;break;case"PRODUCTION":case 3:i.payments=3;break}switch(e.stickerPackQuery){default:if(typeof e.stickerPackQuery=="number"){i.stickerPackQuery=e.stickerPackQuery;break}break;case"NOT_STARTED":case 0:i.stickerPackQuery=0;break;case"FORCE_UPGRADE":case 1:i.stickerPackQuery=1;break;case"DEVELOPMENT":case 2:i.stickerPackQuery=2;break;case"PRODUCTION":case 3:i.stickerPackQuery=3;break}switch(e.liveLocationsFinal){default:if(typeof e.liveLocationsFinal=="number"){i.liveLocationsFinal=e.liveLocationsFinal;break}break;case"NOT_STARTED":case 0:i.liveLocationsFinal=0;break;case"FORCE_UPGRADE":case 1:i.liveLocationsFinal=1;break;case"DEVELOPMENT":case 2:i.liveLocationsFinal=2;break;case"PRODUCTION":case 3:i.liveLocationsFinal=3;break}switch(e.labelsEdit){default:if(typeof e.labelsEdit=="number"){i.labelsEdit=e.labelsEdit;break}break;case"NOT_STARTED":case 0:i.labelsEdit=0;break;case"FORCE_UPGRADE":case 1:i.labelsEdit=1;break;case"DEVELOPMENT":case 2:i.labelsEdit=2;break;case"PRODUCTION":case 3:i.labelsEdit=3;break}switch(e.mediaUpload){default:if(typeof e.mediaUpload=="number"){i.mediaUpload=e.mediaUpload;break}break;case"NOT_STARTED":case 0:i.mediaUpload=0;break;case"FORCE_UPGRADE":case 1:i.mediaUpload=1;break;case"DEVELOPMENT":case 2:i.mediaUpload=2;break;case"PRODUCTION":case 3:i.mediaUpload=3;break}switch(e.mediaUploadRichQuickReplies){default:if(typeof e.mediaUploadRichQuickReplies=="number"){i.mediaUploadRichQuickReplies=e.mediaUploadRichQuickReplies;break}break;case"NOT_STARTED":case 0:i.mediaUploadRichQuickReplies=0;break;case"FORCE_UPGRADE":case 1:i.mediaUploadRichQuickReplies=1;break;case"DEVELOPMENT":case 2:i.mediaUploadRichQuickReplies=2;break;case"PRODUCTION":case 3:i.mediaUploadRichQuickReplies=3;break}switch(e.vnameV2){default:if(typeof e.vnameV2=="number"){i.vnameV2=e.vnameV2;break}break;case"NOT_STARTED":case 0:i.vnameV2=0;break;case"FORCE_UPGRADE":case 1:i.vnameV2=1;break;case"DEVELOPMENT":case 2:i.vnameV2=2;break;case"PRODUCTION":case 3:i.vnameV2=3;break}switch(e.videoPlaybackUrl){default:if(typeof e.videoPlaybackUrl=="number"){i.videoPlaybackUrl=e.videoPlaybackUrl;break}break;case"NOT_STARTED":case 0:i.videoPlaybackUrl=0;break;case"FORCE_UPGRADE":case 1:i.videoPlaybackUrl=1;break;case"DEVELOPMENT":case 2:i.videoPlaybackUrl=2;break;case"PRODUCTION":case 3:i.videoPlaybackUrl=3;break}switch(e.statusRanking){default:if(typeof e.statusRanking=="number"){i.statusRanking=e.statusRanking;break}break;case"NOT_STARTED":case 0:i.statusRanking=0;break;case"FORCE_UPGRADE":case 1:i.statusRanking=1;break;case"DEVELOPMENT":case 2:i.statusRanking=2;break;case"PRODUCTION":case 3:i.statusRanking=3;break}switch(e.voipIndividualVideo){default:if(typeof e.voipIndividualVideo=="number"){i.voipIndividualVideo=e.voipIndividualVideo;break}break;case"NOT_STARTED":case 0:i.voipIndividualVideo=0;break;case"FORCE_UPGRADE":case 1:i.voipIndividualVideo=1;break;case"DEVELOPMENT":case 2:i.voipIndividualVideo=2;break;case"PRODUCTION":case 3:i.voipIndividualVideo=3;break}switch(e.thirdPartyStickers){default:if(typeof e.thirdPartyStickers=="number"){i.thirdPartyStickers=e.thirdPartyStickers;break}break;case"NOT_STARTED":case 0:i.thirdPartyStickers=0;break;case"FORCE_UPGRADE":case 1:i.thirdPartyStickers=1;break;case"DEVELOPMENT":case 2:i.thirdPartyStickers=2;break;case"PRODUCTION":case 3:i.thirdPartyStickers=3;break}switch(e.frequentlyForwardedSetting){default:if(typeof e.frequentlyForwardedSetting=="number"){i.frequentlyForwardedSetting=e.frequentlyForwardedSetting;break}break;case"NOT_STARTED":case 0:i.frequentlyForwardedSetting=0;break;case"FORCE_UPGRADE":case 1:i.frequentlyForwardedSetting=1;break;case"DEVELOPMENT":case 2:i.frequentlyForwardedSetting=2;break;case"PRODUCTION":case 3:i.frequentlyForwardedSetting=3;break}switch(e.groupsV4JoinPermission){default:if(typeof e.groupsV4JoinPermission=="number"){i.groupsV4JoinPermission=e.groupsV4JoinPermission;break}break;case"NOT_STARTED":case 0:i.groupsV4JoinPermission=0;break;case"FORCE_UPGRADE":case 1:i.groupsV4JoinPermission=1;break;case"DEVELOPMENT":case 2:i.groupsV4JoinPermission=2;break;case"PRODUCTION":case 3:i.groupsV4JoinPermission=3;break}switch(e.recentStickers){default:if(typeof e.recentStickers=="number"){i.recentStickers=e.recentStickers;break}break;case"NOT_STARTED":case 0:i.recentStickers=0;break;case"FORCE_UPGRADE":case 1:i.recentStickers=1;break;case"DEVELOPMENT":case 2:i.recentStickers=2;break;case"PRODUCTION":case 3:i.recentStickers=3;break}switch(e.catalog){default:if(typeof e.catalog=="number"){i.catalog=e.catalog;break}break;case"NOT_STARTED":case 0:i.catalog=0;break;case"FORCE_UPGRADE":case 1:i.catalog=1;break;case"DEVELOPMENT":case 2:i.catalog=2;break;case"PRODUCTION":case 3:i.catalog=3;break}switch(e.starredStickers){default:if(typeof e.starredStickers=="number"){i.starredStickers=e.starredStickers;break}break;case"NOT_STARTED":case 0:i.starredStickers=0;break;case"FORCE_UPGRADE":case 1:i.starredStickers=1;break;case"DEVELOPMENT":case 2:i.starredStickers=2;break;case"PRODUCTION":case 3:i.starredStickers=3;break}switch(e.voipGroupCall){default:if(typeof e.voipGroupCall=="number"){i.voipGroupCall=e.voipGroupCall;break}break;case"NOT_STARTED":case 0:i.voipGroupCall=0;break;case"FORCE_UPGRADE":case 1:i.voipGroupCall=1;break;case"DEVELOPMENT":case 2:i.voipGroupCall=2;break;case"PRODUCTION":case 3:i.voipGroupCall=3;break}switch(e.templateMessage){default:if(typeof e.templateMessage=="number"){i.templateMessage=e.templateMessage;break}break;case"NOT_STARTED":case 0:i.templateMessage=0;break;case"FORCE_UPGRADE":case 1:i.templateMessage=1;break;case"DEVELOPMENT":case 2:i.templateMessage=2;break;case"PRODUCTION":case 3:i.templateMessage=3;break}switch(e.templateMessageInteractivity){default:if(typeof e.templateMessageInteractivity=="number"){i.templateMessageInteractivity=e.templateMessageInteractivity;break}break;case"NOT_STARTED":case 0:i.templateMessageInteractivity=0;break;case"FORCE_UPGRADE":case 1:i.templateMessageInteractivity=1;break;case"DEVELOPMENT":case 2:i.templateMessageInteractivity=2;break;case"PRODUCTION":case 3:i.templateMessageInteractivity=3;break}switch(e.ephemeralMessages){default:if(typeof e.ephemeralMessages=="number"){i.ephemeralMessages=e.ephemeralMessages;break}break;case"NOT_STARTED":case 0:i.ephemeralMessages=0;break;case"FORCE_UPGRADE":case 1:i.ephemeralMessages=1;break;case"DEVELOPMENT":case 2:i.ephemeralMessages=2;break;case"PRODUCTION":case 3:i.ephemeralMessages=3;break}switch(e.e2ENotificationSync){default:if(typeof e.e2ENotificationSync=="number"){i.e2ENotificationSync=e.e2ENotificationSync;break}break;case"NOT_STARTED":case 0:i.e2ENotificationSync=0;break;case"FORCE_UPGRADE":case 1:i.e2ENotificationSync=1;break;case"DEVELOPMENT":case 2:i.e2ENotificationSync=2;break;case"PRODUCTION":case 3:i.e2ENotificationSync=3;break}switch(e.recentStickersV2){default:if(typeof e.recentStickersV2=="number"){i.recentStickersV2=e.recentStickersV2;break}break;case"NOT_STARTED":case 0:i.recentStickersV2=0;break;case"FORCE_UPGRADE":case 1:i.recentStickersV2=1;break;case"DEVELOPMENT":case 2:i.recentStickersV2=2;break;case"PRODUCTION":case 3:i.recentStickersV2=3;break}switch(e.recentStickersV3){default:if(typeof e.recentStickersV3=="number"){i.recentStickersV3=e.recentStickersV3;break}break;case"NOT_STARTED":case 0:i.recentStickersV3=0;break;case"FORCE_UPGRADE":case 1:i.recentStickersV3=1;break;case"DEVELOPMENT":case 2:i.recentStickersV3=2;break;case"PRODUCTION":case 3:i.recentStickersV3=3;break}switch(e.userNotice){default:if(typeof e.userNotice=="number"){i.userNotice=e.userNotice;break}break;case"NOT_STARTED":case 0:i.userNotice=0;break;case"FORCE_UPGRADE":case 1:i.userNotice=1;break;case"DEVELOPMENT":case 2:i.userNotice=2;break;case"PRODUCTION":case 3:i.userNotice=3;break}switch(e.support){default:if(typeof e.support=="number"){i.support=e.support;break}break;case"NOT_STARTED":case 0:i.support=0;break;case"FORCE_UPGRADE":case 1:i.support=1;break;case"DEVELOPMENT":case 2:i.support=2;break;case"PRODUCTION":case 3:i.support=3;break}switch(e.groupUiiCleanup){default:if(typeof e.groupUiiCleanup=="number"){i.groupUiiCleanup=e.groupUiiCleanup;break}break;case"NOT_STARTED":case 0:i.groupUiiCleanup=0;break;case"FORCE_UPGRADE":case 1:i.groupUiiCleanup=1;break;case"DEVELOPMENT":case 2:i.groupUiiCleanup=2;break;case"PRODUCTION":case 3:i.groupUiiCleanup=3;break}switch(e.groupDogfoodingInternalOnly){default:if(typeof e.groupDogfoodingInternalOnly=="number"){i.groupDogfoodingInternalOnly=e.groupDogfoodingInternalOnly;break}break;case"NOT_STARTED":case 0:i.groupDogfoodingInternalOnly=0;break;case"FORCE_UPGRADE":case 1:i.groupDogfoodingInternalOnly=1;break;case"DEVELOPMENT":case 2:i.groupDogfoodingInternalOnly=2;break;case"PRODUCTION":case 3:i.groupDogfoodingInternalOnly=3;break}switch(e.settingsSync){default:if(typeof e.settingsSync=="number"){i.settingsSync=e.settingsSync;break}break;case"NOT_STARTED":case 0:i.settingsSync=0;break;case"FORCE_UPGRADE":case 1:i.settingsSync=1;break;case"DEVELOPMENT":case 2:i.settingsSync=2;break;case"PRODUCTION":case 3:i.settingsSync=3;break}switch(e.archiveV2){default:if(typeof e.archiveV2=="number"){i.archiveV2=e.archiveV2;break}break;case"NOT_STARTED":case 0:i.archiveV2=0;break;case"FORCE_UPGRADE":case 1:i.archiveV2=1;break;case"DEVELOPMENT":case 2:i.archiveV2=2;break;case"PRODUCTION":case 3:i.archiveV2=3;break}switch(e.ephemeralAllowGroupMembers){default:if(typeof e.ephemeralAllowGroupMembers=="number"){i.ephemeralAllowGroupMembers=e.ephemeralAllowGroupMembers;break}break;case"NOT_STARTED":case 0:i.ephemeralAllowGroupMembers=0;break;case"FORCE_UPGRADE":case 1:i.ephemeralAllowGroupMembers=1;break;case"DEVELOPMENT":case 2:i.ephemeralAllowGroupMembers=2;break;case"PRODUCTION":case 3:i.ephemeralAllowGroupMembers=3;break}switch(e.ephemeral24HDuration){default:if(typeof e.ephemeral24HDuration=="number"){i.ephemeral24HDuration=e.ephemeral24HDuration;break}break;case"NOT_STARTED":case 0:i.ephemeral24HDuration=0;break;case"FORCE_UPGRADE":case 1:i.ephemeral24HDuration=1;break;case"DEVELOPMENT":case 2:i.ephemeral24HDuration=2;break;case"PRODUCTION":case 3:i.ephemeral24HDuration=3;break}switch(e.mdForceUpgrade){default:if(typeof e.mdForceUpgrade=="number"){i.mdForceUpgrade=e.mdForceUpgrade;break}break;case"NOT_STARTED":case 0:i.mdForceUpgrade=0;break;case"FORCE_UPGRADE":case 1:i.mdForceUpgrade=1;break;case"DEVELOPMENT":case 2:i.mdForceUpgrade=2;break;case"PRODUCTION":case 3:i.mdForceUpgrade=3;break}switch(e.disappearingMode){default:if(typeof e.disappearingMode=="number"){i.disappearingMode=e.disappearingMode;break}break;case"NOT_STARTED":case 0:i.disappearingMode=0;break;case"FORCE_UPGRADE":case 1:i.disappearingMode=1;break;case"DEVELOPMENT":case 2:i.disappearingMode=2;break;case"PRODUCTION":case 3:i.disappearingMode=3;break}switch(e.externalMdOptInAvailable){default:if(typeof e.externalMdOptInAvailable=="number"){i.externalMdOptInAvailable=e.externalMdOptInAvailable;break}break;case"NOT_STARTED":case 0:i.externalMdOptInAvailable=0;break;case"FORCE_UPGRADE":case 1:i.externalMdOptInAvailable=1;break;case"DEVELOPMENT":case 2:i.externalMdOptInAvailable=2;break;case"PRODUCTION":case 3:i.externalMdOptInAvailable=3;break}switch(e.noDeleteMessageTimeLimit){default:if(typeof e.noDeleteMessageTimeLimit=="number"){i.noDeleteMessageTimeLimit=e.noDeleteMessageTimeLimit;break}break;case"NOT_STARTED":case 0:i.noDeleteMessageTimeLimit=0;break;case"FORCE_UPGRADE":case 1:i.noDeleteMessageTimeLimit=1;break;case"DEVELOPMENT":case 2:i.noDeleteMessageTimeLimit=2;break;case"PRODUCTION":case 3:i.noDeleteMessageTimeLimit=3;break}return i},t.toObject=function(e,i){i||(i={});var A={};return e.labelsDisplay!=null&&e.hasOwnProperty("labelsDisplay")&&(A.labelsDisplay=i.enums===String?d.proto.WebFeatures.Flag[e.labelsDisplay]===void 0?e.labelsDisplay:d.proto.WebFeatures.Flag[e.labelsDisplay]:e.labelsDisplay,i.oneofs&&(A._labelsDisplay="labelsDisplay")),e.voipIndividualOutgoing!=null&&e.hasOwnProperty("voipIndividualOutgoing")&&(A.voipIndividualOutgoing=i.enums===String?d.proto.WebFeatures.Flag[e.voipIndividualOutgoing]===void 0?e.voipIndividualOutgoing:d.proto.WebFeatures.Flag[e.voipIndividualOutgoing]:e.voipIndividualOutgoing,i.oneofs&&(A._voipIndividualOutgoing="voipIndividualOutgoing")),e.groupsV3!=null&&e.hasOwnProperty("groupsV3")&&(A.groupsV3=i.enums===String?d.proto.WebFeatures.Flag[e.groupsV3]===void 0?e.groupsV3:d.proto.WebFeatures.Flag[e.groupsV3]:e.groupsV3,i.oneofs&&(A._groupsV3="groupsV3")),e.groupsV3Create!=null&&e.hasOwnProperty("groupsV3Create")&&(A.groupsV3Create=i.enums===String?d.proto.WebFeatures.Flag[e.groupsV3Create]===void 0?e.groupsV3Create:d.proto.WebFeatures.Flag[e.groupsV3Create]:e.groupsV3Create,i.oneofs&&(A._groupsV3Create="groupsV3Create")),e.changeNumberV2!=null&&e.hasOwnProperty("changeNumberV2")&&(A.changeNumberV2=i.enums===String?d.proto.WebFeatures.Flag[e.changeNumberV2]===void 0?e.changeNumberV2:d.proto.WebFeatures.Flag[e.changeNumberV2]:e.changeNumberV2,i.oneofs&&(A._changeNumberV2="changeNumberV2")),e.queryStatusV3Thumbnail!=null&&e.hasOwnProperty("queryStatusV3Thumbnail")&&(A.queryStatusV3Thumbnail=i.enums===String?d.proto.WebFeatures.Flag[e.queryStatusV3Thumbnail]===void 0?e.queryStatusV3Thumbnail:d.proto.WebFeatures.Flag[e.queryStatusV3Thumbnail]:e.queryStatusV3Thumbnail,i.oneofs&&(A._queryStatusV3Thumbnail="queryStatusV3Thumbnail")),e.liveLocations!=null&&e.hasOwnProperty("liveLocations")&&(A.liveLocations=i.enums===String?d.proto.WebFeatures.Flag[e.liveLocations]===void 0?e.liveLocations:d.proto.WebFeatures.Flag[e.liveLocations]:e.liveLocations,i.oneofs&&(A._liveLocations="liveLocations")),e.queryVname!=null&&e.hasOwnProperty("queryVname")&&(A.queryVname=i.enums===String?d.proto.WebFeatures.Flag[e.queryVname]===void 0?e.queryVname:d.proto.WebFeatures.Flag[e.queryVname]:e.queryVname,i.oneofs&&(A._queryVname="queryVname")),e.voipIndividualIncoming!=null&&e.hasOwnProperty("voipIndividualIncoming")&&(A.voipIndividualIncoming=i.enums===String?d.proto.WebFeatures.Flag[e.voipIndividualIncoming]===void 0?e.voipIndividualIncoming:d.proto.WebFeatures.Flag[e.voipIndividualIncoming]:e.voipIndividualIncoming,i.oneofs&&(A._voipIndividualIncoming="voipIndividualIncoming")),e.quickRepliesQuery!=null&&e.hasOwnProperty("quickRepliesQuery")&&(A.quickRepliesQuery=i.enums===String?d.proto.WebFeatures.Flag[e.quickRepliesQuery]===void 0?e.quickRepliesQuery:d.proto.WebFeatures.Flag[e.quickRepliesQuery]:e.quickRepliesQuery,i.oneofs&&(A._quickRepliesQuery="quickRepliesQuery")),e.payments!=null&&e.hasOwnProperty("payments")&&(A.payments=i.enums===String?d.proto.WebFeatures.Flag[e.payments]===void 0?e.payments:d.proto.WebFeatures.Flag[e.payments]:e.payments,i.oneofs&&(A._payments="payments")),e.stickerPackQuery!=null&&e.hasOwnProperty("stickerPackQuery")&&(A.stickerPackQuery=i.enums===String?d.proto.WebFeatures.Flag[e.stickerPackQuery]===void 0?e.stickerPackQuery:d.proto.WebFeatures.Flag[e.stickerPackQuery]:e.stickerPackQuery,i.oneofs&&(A._stickerPackQuery="stickerPackQuery")),e.liveLocationsFinal!=null&&e.hasOwnProperty("liveLocationsFinal")&&(A.liveLocationsFinal=i.enums===String?d.proto.WebFeatures.Flag[e.liveLocationsFinal]===void 0?e.liveLocationsFinal:d.proto.WebFeatures.Flag[e.liveLocationsFinal]:e.liveLocationsFinal,i.oneofs&&(A._liveLocationsFinal="liveLocationsFinal")),e.labelsEdit!=null&&e.hasOwnProperty("labelsEdit")&&(A.labelsEdit=i.enums===String?d.proto.WebFeatures.Flag[e.labelsEdit]===void 0?e.labelsEdit:d.proto.WebFeatures.Flag[e.labelsEdit]:e.labelsEdit,i.oneofs&&(A._labelsEdit="labelsEdit")),e.mediaUpload!=null&&e.hasOwnProperty("mediaUpload")&&(A.mediaUpload=i.enums===String?d.proto.WebFeatures.Flag[e.mediaUpload]===void 0?e.mediaUpload:d.proto.WebFeatures.Flag[e.mediaUpload]:e.mediaUpload,i.oneofs&&(A._mediaUpload="mediaUpload")),e.mediaUploadRichQuickReplies!=null&&e.hasOwnProperty("mediaUploadRichQuickReplies")&&(A.mediaUploadRichQuickReplies=i.enums===String?d.proto.WebFeatures.Flag[e.mediaUploadRichQuickReplies]===void 0?e.mediaUploadRichQuickReplies:d.proto.WebFeatures.Flag[e.mediaUploadRichQuickReplies]:e.mediaUploadRichQuickReplies,i.oneofs&&(A._mediaUploadRichQuickReplies="mediaUploadRichQuickReplies")),e.vnameV2!=null&&e.hasOwnProperty("vnameV2")&&(A.vnameV2=i.enums===String?d.proto.WebFeatures.Flag[e.vnameV2]===void 0?e.vnameV2:d.proto.WebFeatures.Flag[e.vnameV2]:e.vnameV2,i.oneofs&&(A._vnameV2="vnameV2")),e.videoPlaybackUrl!=null&&e.hasOwnProperty("videoPlaybackUrl")&&(A.videoPlaybackUrl=i.enums===String?d.proto.WebFeatures.Flag[e.videoPlaybackUrl]===void 0?e.videoPlaybackUrl:d.proto.WebFeatures.Flag[e.videoPlaybackUrl]:e.videoPlaybackUrl,i.oneofs&&(A._videoPlaybackUrl="videoPlaybackUrl")),e.statusRanking!=null&&e.hasOwnProperty("statusRanking")&&(A.statusRanking=i.enums===String?d.proto.WebFeatures.Flag[e.statusRanking]===void 0?e.statusRanking:d.proto.WebFeatures.Flag[e.statusRanking]:e.statusRanking,i.oneofs&&(A._statusRanking="statusRanking")),e.voipIndividualVideo!=null&&e.hasOwnProperty("voipIndividualVideo")&&(A.voipIndividualVideo=i.enums===String?d.proto.WebFeatures.Flag[e.voipIndividualVideo]===void 0?e.voipIndividualVideo:d.proto.WebFeatures.Flag[e.voipIndividualVideo]:e.voipIndividualVideo,i.oneofs&&(A._voipIndividualVideo="voipIndividualVideo")),e.thirdPartyStickers!=null&&e.hasOwnProperty("thirdPartyStickers")&&(A.thirdPartyStickers=i.enums===String?d.proto.WebFeatures.Flag[e.thirdPartyStickers]===void 0?e.thirdPartyStickers:d.proto.WebFeatures.Flag[e.thirdPartyStickers]:e.thirdPartyStickers,i.oneofs&&(A._thirdPartyStickers="thirdPartyStickers")),e.frequentlyForwardedSetting!=null&&e.hasOwnProperty("frequentlyForwardedSetting")&&(A.frequentlyForwardedSetting=i.enums===String?d.proto.WebFeatures.Flag[e.frequentlyForwardedSetting]===void 0?e.frequentlyForwardedSetting:d.proto.WebFeatures.Flag[e.frequentlyForwardedSetting]:e.frequentlyForwardedSetting,i.oneofs&&(A._frequentlyForwardedSetting="frequentlyForwardedSetting")),e.groupsV4JoinPermission!=null&&e.hasOwnProperty("groupsV4JoinPermission")&&(A.groupsV4JoinPermission=i.enums===String?d.proto.WebFeatures.Flag[e.groupsV4JoinPermission]===void 0?e.groupsV4JoinPermission:d.proto.WebFeatures.Flag[e.groupsV4JoinPermission]:e.groupsV4JoinPermission,i.oneofs&&(A._groupsV4JoinPermission="groupsV4JoinPermission")),e.recentStickers!=null&&e.hasOwnProperty("recentStickers")&&(A.recentStickers=i.enums===String?d.proto.WebFeatures.Flag[e.recentStickers]===void 0?e.recentStickers:d.proto.WebFeatures.Flag[e.recentStickers]:e.recentStickers,i.oneofs&&(A._recentStickers="recentStickers")),e.catalog!=null&&e.hasOwnProperty("catalog")&&(A.catalog=i.enums===String?d.proto.WebFeatures.Flag[e.catalog]===void 0?e.catalog:d.proto.WebFeatures.Flag[e.catalog]:e.catalog,i.oneofs&&(A._catalog="catalog")),e.starredStickers!=null&&e.hasOwnProperty("starredStickers")&&(A.starredStickers=i.enums===String?d.proto.WebFeatures.Flag[e.starredStickers]===void 0?e.starredStickers:d.proto.WebFeatures.Flag[e.starredStickers]:e.starredStickers,i.oneofs&&(A._starredStickers="starredStickers")),e.voipGroupCall!=null&&e.hasOwnProperty("voipGroupCall")&&(A.voipGroupCall=i.enums===String?d.proto.WebFeatures.Flag[e.voipGroupCall]===void 0?e.voipGroupCall:d.proto.WebFeatures.Flag[e.voipGroupCall]:e.voipGroupCall,i.oneofs&&(A._voipGroupCall="voipGroupCall")),e.templateMessage!=null&&e.hasOwnProperty("templateMessage")&&(A.templateMessage=i.enums===String?d.proto.WebFeatures.Flag[e.templateMessage]===void 0?e.templateMessage:d.proto.WebFeatures.Flag[e.templateMessage]:e.templateMessage,i.oneofs&&(A._templateMessage="templateMessage")),e.templateMessageInteractivity!=null&&e.hasOwnProperty("templateMessageInteractivity")&&(A.templateMessageInteractivity=i.enums===String?d.proto.WebFeatures.Flag[e.templateMessageInteractivity]===void 0?e.templateMessageInteractivity:d.proto.WebFeatures.Flag[e.templateMessageInteractivity]:e.templateMessageInteractivity,i.oneofs&&(A._templateMessageInteractivity="templateMessageInteractivity")),e.ephemeralMessages!=null&&e.hasOwnProperty("ephemeralMessages")&&(A.ephemeralMessages=i.enums===String?d.proto.WebFeatures.Flag[e.ephemeralMessages]===void 0?e.ephemeralMessages:d.proto.WebFeatures.Flag[e.ephemeralMessages]:e.ephemeralMessages,i.oneofs&&(A._ephemeralMessages="ephemeralMessages")),e.e2ENotificationSync!=null&&e.hasOwnProperty("e2ENotificationSync")&&(A.e2ENotificationSync=i.enums===String?d.proto.WebFeatures.Flag[e.e2ENotificationSync]===void 0?e.e2ENotificationSync:d.proto.WebFeatures.Flag[e.e2ENotificationSync]:e.e2ENotificationSync,i.oneofs&&(A._e2ENotificationSync="e2ENotificationSync")),e.recentStickersV2!=null&&e.hasOwnProperty("recentStickersV2")&&(A.recentStickersV2=i.enums===String?d.proto.WebFeatures.Flag[e.recentStickersV2]===void 0?e.recentStickersV2:d.proto.WebFeatures.Flag[e.recentStickersV2]:e.recentStickersV2,i.oneofs&&(A._recentStickersV2="recentStickersV2")),e.recentStickersV3!=null&&e.hasOwnProperty("recentStickersV3")&&(A.recentStickersV3=i.enums===String?d.proto.WebFeatures.Flag[e.recentStickersV3]===void 0?e.recentStickersV3:d.proto.WebFeatures.Flag[e.recentStickersV3]:e.recentStickersV3,i.oneofs&&(A._recentStickersV3="recentStickersV3")),e.userNotice!=null&&e.hasOwnProperty("userNotice")&&(A.userNotice=i.enums===String?d.proto.WebFeatures.Flag[e.userNotice]===void 0?e.userNotice:d.proto.WebFeatures.Flag[e.userNotice]:e.userNotice,i.oneofs&&(A._userNotice="userNotice")),e.support!=null&&e.hasOwnProperty("support")&&(A.support=i.enums===String?d.proto.WebFeatures.Flag[e.support]===void 0?e.support:d.proto.WebFeatures.Flag[e.support]:e.support,i.oneofs&&(A._support="support")),e.groupUiiCleanup!=null&&e.hasOwnProperty("groupUiiCleanup")&&(A.groupUiiCleanup=i.enums===String?d.proto.WebFeatures.Flag[e.groupUiiCleanup]===void 0?e.groupUiiCleanup:d.proto.WebFeatures.Flag[e.groupUiiCleanup]:e.groupUiiCleanup,i.oneofs&&(A._groupUiiCleanup="groupUiiCleanup")),e.groupDogfoodingInternalOnly!=null&&e.hasOwnProperty("groupDogfoodingInternalOnly")&&(A.groupDogfoodingInternalOnly=i.enums===String?d.proto.WebFeatures.Flag[e.groupDogfoodingInternalOnly]===void 0?e.groupDogfoodingInternalOnly:d.proto.WebFeatures.Flag[e.groupDogfoodingInternalOnly]:e.groupDogfoodingInternalOnly,i.oneofs&&(A._groupDogfoodingInternalOnly="groupDogfoodingInternalOnly")),e.settingsSync!=null&&e.hasOwnProperty("settingsSync")&&(A.settingsSync=i.enums===String?d.proto.WebFeatures.Flag[e.settingsSync]===void 0?e.settingsSync:d.proto.WebFeatures.Flag[e.settingsSync]:e.settingsSync,i.oneofs&&(A._settingsSync="settingsSync")),e.archiveV2!=null&&e.hasOwnProperty("archiveV2")&&(A.archiveV2=i.enums===String?d.proto.WebFeatures.Flag[e.archiveV2]===void 0?e.archiveV2:d.proto.WebFeatures.Flag[e.archiveV2]:e.archiveV2,i.oneofs&&(A._archiveV2="archiveV2")),e.ephemeralAllowGroupMembers!=null&&e.hasOwnProperty("ephemeralAllowGroupMembers")&&(A.ephemeralAllowGroupMembers=i.enums===String?d.proto.WebFeatures.Flag[e.ephemeralAllowGroupMembers]===void 0?e.ephemeralAllowGroupMembers:d.proto.WebFeatures.Flag[e.ephemeralAllowGroupMembers]:e.ephemeralAllowGroupMembers,i.oneofs&&(A._ephemeralAllowGroupMembers="ephemeralAllowGroupMembers")),e.ephemeral24HDuration!=null&&e.hasOwnProperty("ephemeral24HDuration")&&(A.ephemeral24HDuration=i.enums===String?d.proto.WebFeatures.Flag[e.ephemeral24HDuration]===void 0?e.ephemeral24HDuration:d.proto.WebFeatures.Flag[e.ephemeral24HDuration]:e.ephemeral24HDuration,i.oneofs&&(A._ephemeral24HDuration="ephemeral24HDuration")),e.mdForceUpgrade!=null&&e.hasOwnProperty("mdForceUpgrade")&&(A.mdForceUpgrade=i.enums===String?d.proto.WebFeatures.Flag[e.mdForceUpgrade]===void 0?e.mdForceUpgrade:d.proto.WebFeatures.Flag[e.mdForceUpgrade]:e.mdForceUpgrade,i.oneofs&&(A._mdForceUpgrade="mdForceUpgrade")),e.disappearingMode!=null&&e.hasOwnProperty("disappearingMode")&&(A.disappearingMode=i.enums===String?d.proto.WebFeatures.Flag[e.disappearingMode]===void 0?e.disappearingMode:d.proto.WebFeatures.Flag[e.disappearingMode]:e.disappearingMode,i.oneofs&&(A._disappearingMode="disappearingMode")),e.externalMdOptInAvailable!=null&&e.hasOwnProperty("externalMdOptInAvailable")&&(A.externalMdOptInAvailable=i.enums===String?d.proto.WebFeatures.Flag[e.externalMdOptInAvailable]===void 0?e.externalMdOptInAvailable:d.proto.WebFeatures.Flag[e.externalMdOptInAvailable]:e.externalMdOptInAvailable,i.oneofs&&(A._externalMdOptInAvailable="externalMdOptInAvailable")),e.noDeleteMessageTimeLimit!=null&&e.hasOwnProperty("noDeleteMessageTimeLimit")&&(A.noDeleteMessageTimeLimit=i.enums===String?d.proto.WebFeatures.Flag[e.noDeleteMessageTimeLimit]===void 0?e.noDeleteMessageTimeLimit:d.proto.WebFeatures.Flag[e.noDeleteMessageTimeLimit]:e.noDeleteMessageTimeLimit,i.oneofs&&(A._noDeleteMessageTimeLimit="noDeleteMessageTimeLimit")),A},t.prototype.toJSON=function(){return this.constructor.toObject(this,v.default.util.toJSONOptions)},t.getTypeUrl=function(e){return e===void 0&&(e="type.googleapis.com"),e+"/proto.WebFeatures"},t.Flag=(function(){let a={},e=Object.create(a);return e[a[0]="NOT_STARTED"]=0,e[a[1]="FORCE_UPGRADE"]=1,e[a[2]="DEVELOPMENT"]=2,e[a[3]="PRODUCTION"]=3,e})(),t})(),n.WebLinkRenderConfig=(function(){let t={},o=Object.create(t);return o[t[0]="WEBVIEW"]=0,o[t[1]="SYSTEM"]=1,o})(),n.WebMessageInfo=(function(){function t(a){if(this.messageStubParameters=[],this.labels=[],this.userReceipt=[],this.reactions=[],this.pollUpdates=[],this.eventResponses=[],this.statusMentions=[],this.messageAddOns=[],this.statusMentionSources=[],this.supportAiCitations=[],a)for(var e=Object.keys(a),i=0;i>>3){case 1:{s.key=d.proto.MessageKey.decode(e,e.uint32());break}case 2:{s.message=d.proto.Message.decode(e,e.uint32());break}case 3:{s.messageTimestamp=e.uint64();break}case 4:{s.status=e.int32();break}case 5:{s.participant=e.string();break}case 6:{s.messageC2STimestamp=e.uint64();break}case 16:{s.ignore=e.bool();break}case 17:{s.starred=e.bool();break}case 18:{s.broadcast=e.bool();break}case 19:{s.pushName=e.string();break}case 20:{s.mediaCiphertextSha256=e.bytes();break}case 21:{s.multicast=e.bool();break}case 22:{s.urlText=e.bool();break}case 23:{s.urlNumber=e.bool();break}case 24:{s.messageStubType=e.int32();break}case 25:{s.clearMedia=e.bool();break}case 26:{s.messageStubParameters&&s.messageStubParameters.length||(s.messageStubParameters=[]),s.messageStubParameters.push(e.string());break}case 27:{s.duration=e.uint32();break}case 28:{s.labels&&s.labels.length||(s.labels=[]),s.labels.push(e.string());break}case 29:{s.paymentInfo=d.proto.PaymentInfo.decode(e,e.uint32());break}case 30:{s.finalLiveLocation=d.proto.Message.LiveLocationMessage.decode(e,e.uint32());break}case 31:{s.quotedPaymentInfo=d.proto.PaymentInfo.decode(e,e.uint32());break}case 32:{s.ephemeralStartTimestamp=e.uint64();break}case 33:{s.ephemeralDuration=e.uint32();break}case 34:{s.ephemeralOffToOn=e.bool();break}case 35:{s.ephemeralOutOfSync=e.bool();break}case 36:{s.bizPrivacyStatus=e.int32();break}case 37:{s.verifiedBizName=e.string();break}case 38:{s.mediaData=d.proto.MediaData.decode(e,e.uint32());break}case 39:{s.photoChange=d.proto.PhotoChange.decode(e,e.uint32());break}case 40:{s.userReceipt&&s.userReceipt.length||(s.userReceipt=[]),s.userReceipt.push(d.proto.UserReceipt.decode(e,e.uint32()));break}case 41:{s.reactions&&s.reactions.length||(s.reactions=[]),s.reactions.push(d.proto.Reaction.decode(e,e.uint32()));break}case 42:{s.quotedStickerData=d.proto.MediaData.decode(e,e.uint32());break}case 43:{s.futureproofData=e.bytes();break}case 44:{s.statusPsa=d.proto.StatusPSA.decode(e,e.uint32());break}case 45:{s.pollUpdates&&s.pollUpdates.length||(s.pollUpdates=[]),s.pollUpdates.push(d.proto.PollUpdate.decode(e,e.uint32()));break}case 46:{s.pollAdditionalMetadata=d.proto.PollAdditionalMetadata.decode(e,e.uint32());break}case 47:{s.agentId=e.string();break}case 48:{s.statusAlreadyViewed=e.bool();break}case 49:{s.messageSecret=e.bytes();break}case 50:{s.keepInChat=d.proto.KeepInChat.decode(e,e.uint32());break}case 51:{s.originalSelfAuthorUserJidString=e.string();break}case 52:{s.revokeMessageTimestamp=e.uint64();break}case 54:{s.pinInChat=d.proto.PinInChat.decode(e,e.uint32());break}case 55:{s.premiumMessageInfo=d.proto.PremiumMessageInfo.decode(e,e.uint32());break}case 56:{s.is1PBizBotMessage=e.bool();break}case 57:{s.isGroupHistoryMessage=e.bool();break}case 58:{s.botMessageInvokerJid=e.string();break}case 59:{s.commentMetadata=d.proto.CommentMetadata.decode(e,e.uint32());break}case 61:{s.eventResponses&&s.eventResponses.length||(s.eventResponses=[]),s.eventResponses.push(d.proto.EventResponse.decode(e,e.uint32()));break}case 62:{s.reportingTokenInfo=d.proto.ReportingTokenInfo.decode(e,e.uint32());break}case 63:{s.newsletterServerId=e.uint64();break}case 64:{s.eventAdditionalMetadata=d.proto.EventAdditionalMetadata.decode(e,e.uint32());break}case 65:{s.isMentionedInStatus=e.bool();break}case 66:{s.statusMentions&&s.statusMentions.length||(s.statusMentions=[]),s.statusMentions.push(e.string());break}case 67:{s.targetMessageId=d.proto.MessageKey.decode(e,e.uint32());break}case 68:{s.messageAddOns&&s.messageAddOns.length||(s.messageAddOns=[]),s.messageAddOns.push(d.proto.MessageAddOn.decode(e,e.uint32()));break}case 69:{s.statusMentionMessageInfo=d.proto.StatusMentionMessage.decode(e,e.uint32());break}case 70:{s.isSupportAiMessage=e.bool();break}case 71:{s.statusMentionSources&&s.statusMentionSources.length||(s.statusMentionSources=[]),s.statusMentionSources.push(e.string());break}case 72:{s.supportAiCitations&&s.supportAiCitations.length||(s.supportAiCitations=[]),s.supportAiCitations.push(d.proto.Citation.decode(e,e.uint32()));break}case 73:{s.botTargetId=e.string();break}case 74:{s.groupHistoryIndividualMessageInfo=d.proto.GroupHistoryIndividualMessageInfo.decode(e,e.uint32());break}case 75:{s.groupHistoryBundleInfo=d.proto.GroupHistoryBundleInfo.decode(e,e.uint32());break}case 76:{s.interactiveMessageAdditionalMetadata=d.proto.InteractiveMessageAdditionalMetadata.decode(e,e.uint32());break}case 77:{s.quarantinedMessage=d.proto.QuarantinedMessage.decode(e,e.uint32());break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.WebMessageInfo)return e;var i=new d.proto.WebMessageInfo;if(e.key!=null){if(typeof e.key!="object")throw TypeError(".proto.WebMessageInfo.key: object expected");i.key=d.proto.MessageKey.fromObject(e.key)}if(e.message!=null){if(typeof e.message!="object")throw TypeError(".proto.WebMessageInfo.message: object expected");i.message=d.proto.Message.fromObject(e.message)}switch(e.messageTimestamp!=null&&(l.Long?(i.messageTimestamp=l.Long.fromValue(e.messageTimestamp)).unsigned=!0:typeof e.messageTimestamp=="string"?i.messageTimestamp=parseInt(e.messageTimestamp,10):typeof e.messageTimestamp=="number"?i.messageTimestamp=e.messageTimestamp:typeof e.messageTimestamp=="object"&&(i.messageTimestamp=new l.LongBits(e.messageTimestamp.low>>>0,e.messageTimestamp.high>>>0).toNumber(!0))),e.status){default:if(typeof e.status=="number"){i.status=e.status;break}break;case"ERROR":case 0:i.status=0;break;case"PENDING":case 1:i.status=1;break;case"SERVER_ACK":case 2:i.status=2;break;case"DELIVERY_ACK":case 3:i.status=3;break;case"READ":case 4:i.status=4;break;case"PLAYED":case 5:i.status=5;break}switch(e.participant!=null&&(i.participant=String(e.participant)),e.messageC2STimestamp!=null&&(l.Long?(i.messageC2STimestamp=l.Long.fromValue(e.messageC2STimestamp)).unsigned=!0:typeof e.messageC2STimestamp=="string"?i.messageC2STimestamp=parseInt(e.messageC2STimestamp,10):typeof e.messageC2STimestamp=="number"?i.messageC2STimestamp=e.messageC2STimestamp:typeof e.messageC2STimestamp=="object"&&(i.messageC2STimestamp=new l.LongBits(e.messageC2STimestamp.low>>>0,e.messageC2STimestamp.high>>>0).toNumber(!0))),e.ignore!=null&&(i.ignore=!!e.ignore),e.starred!=null&&(i.starred=!!e.starred),e.broadcast!=null&&(i.broadcast=!!e.broadcast),e.pushName!=null&&(i.pushName=String(e.pushName)),e.mediaCiphertextSha256!=null&&(typeof e.mediaCiphertextSha256=="string"?l.base64.decode(e.mediaCiphertextSha256,i.mediaCiphertextSha256=l.newBuffer(l.base64.length(e.mediaCiphertextSha256)),0):e.mediaCiphertextSha256.length>=0&&(i.mediaCiphertextSha256=e.mediaCiphertextSha256)),e.multicast!=null&&(i.multicast=!!e.multicast),e.urlText!=null&&(i.urlText=!!e.urlText),e.urlNumber!=null&&(i.urlNumber=!!e.urlNumber),e.messageStubType){default:if(typeof e.messageStubType=="number"){i.messageStubType=e.messageStubType;break}break;case"UNKNOWN":case 0:i.messageStubType=0;break;case"REVOKE":case 1:i.messageStubType=1;break;case"CIPHERTEXT":case 2:i.messageStubType=2;break;case"FUTUREPROOF":case 3:i.messageStubType=3;break;case"NON_VERIFIED_TRANSITION":case 4:i.messageStubType=4;break;case"UNVERIFIED_TRANSITION":case 5:i.messageStubType=5;break;case"VERIFIED_TRANSITION":case 6:i.messageStubType=6;break;case"VERIFIED_LOW_UNKNOWN":case 7:i.messageStubType=7;break;case"VERIFIED_HIGH":case 8:i.messageStubType=8;break;case"VERIFIED_INITIAL_UNKNOWN":case 9:i.messageStubType=9;break;case"VERIFIED_INITIAL_LOW":case 10:i.messageStubType=10;break;case"VERIFIED_INITIAL_HIGH":case 11:i.messageStubType=11;break;case"VERIFIED_TRANSITION_ANY_TO_NONE":case 12:i.messageStubType=12;break;case"VERIFIED_TRANSITION_ANY_TO_HIGH":case 13:i.messageStubType=13;break;case"VERIFIED_TRANSITION_HIGH_TO_LOW":case 14:i.messageStubType=14;break;case"VERIFIED_TRANSITION_HIGH_TO_UNKNOWN":case 15:i.messageStubType=15;break;case"VERIFIED_TRANSITION_UNKNOWN_TO_LOW":case 16:i.messageStubType=16;break;case"VERIFIED_TRANSITION_LOW_TO_UNKNOWN":case 17:i.messageStubType=17;break;case"VERIFIED_TRANSITION_NONE_TO_LOW":case 18:i.messageStubType=18;break;case"VERIFIED_TRANSITION_NONE_TO_UNKNOWN":case 19:i.messageStubType=19;break;case"GROUP_CREATE":case 20:i.messageStubType=20;break;case"GROUP_CHANGE_SUBJECT":case 21:i.messageStubType=21;break;case"GROUP_CHANGE_ICON":case 22:i.messageStubType=22;break;case"GROUP_CHANGE_INVITE_LINK":case 23:i.messageStubType=23;break;case"GROUP_CHANGE_DESCRIPTION":case 24:i.messageStubType=24;break;case"GROUP_CHANGE_RESTRICT":case 25:i.messageStubType=25;break;case"GROUP_CHANGE_ANNOUNCE":case 26:i.messageStubType=26;break;case"GROUP_PARTICIPANT_ADD":case 27:i.messageStubType=27;break;case"GROUP_PARTICIPANT_REMOVE":case 28:i.messageStubType=28;break;case"GROUP_PARTICIPANT_PROMOTE":case 29:i.messageStubType=29;break;case"GROUP_PARTICIPANT_DEMOTE":case 30:i.messageStubType=30;break;case"GROUP_PARTICIPANT_INVITE":case 31:i.messageStubType=31;break;case"GROUP_PARTICIPANT_LEAVE":case 32:i.messageStubType=32;break;case"GROUP_PARTICIPANT_CHANGE_NUMBER":case 33:i.messageStubType=33;break;case"BROADCAST_CREATE":case 34:i.messageStubType=34;break;case"BROADCAST_ADD":case 35:i.messageStubType=35;break;case"BROADCAST_REMOVE":case 36:i.messageStubType=36;break;case"GENERIC_NOTIFICATION":case 37:i.messageStubType=37;break;case"E2E_IDENTITY_CHANGED":case 38:i.messageStubType=38;break;case"E2E_ENCRYPTED":case 39:i.messageStubType=39;break;case"CALL_MISSED_VOICE":case 40:i.messageStubType=40;break;case"CALL_MISSED_VIDEO":case 41:i.messageStubType=41;break;case"INDIVIDUAL_CHANGE_NUMBER":case 42:i.messageStubType=42;break;case"GROUP_DELETE":case 43:i.messageStubType=43;break;case"GROUP_ANNOUNCE_MODE_MESSAGE_BOUNCE":case 44:i.messageStubType=44;break;case"CALL_MISSED_GROUP_VOICE":case 45:i.messageStubType=45;break;case"CALL_MISSED_GROUP_VIDEO":case 46:i.messageStubType=46;break;case"PAYMENT_CIPHERTEXT":case 47:i.messageStubType=47;break;case"PAYMENT_FUTUREPROOF":case 48:i.messageStubType=48;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_FAILED":case 49:i.messageStubType=49;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_REFUNDED":case 50:i.messageStubType=50;break;case"PAYMENT_TRANSACTION_STATUS_UPDATE_REFUND_FAILED":case 51:i.messageStubType=51;break;case"PAYMENT_TRANSACTION_STATUS_RECEIVER_PENDING_SETUP":case 52:i.messageStubType=52;break;case"PAYMENT_TRANSACTION_STATUS_RECEIVER_SUCCESS_AFTER_HICCUP":case 53:i.messageStubType=53;break;case"PAYMENT_ACTION_ACCOUNT_SETUP_REMINDER":case 54:i.messageStubType=54;break;case"PAYMENT_ACTION_SEND_PAYMENT_REMINDER":case 55:i.messageStubType=55;break;case"PAYMENT_ACTION_SEND_PAYMENT_INVITATION":case 56:i.messageStubType=56;break;case"PAYMENT_ACTION_REQUEST_DECLINED":case 57:i.messageStubType=57;break;case"PAYMENT_ACTION_REQUEST_EXPIRED":case 58:i.messageStubType=58;break;case"PAYMENT_ACTION_REQUEST_CANCELLED":case 59:i.messageStubType=59;break;case"BIZ_VERIFIED_TRANSITION_TOP_TO_BOTTOM":case 60:i.messageStubType=60;break;case"BIZ_VERIFIED_TRANSITION_BOTTOM_TO_TOP":case 61:i.messageStubType=61;break;case"BIZ_INTRO_TOP":case 62:i.messageStubType=62;break;case"BIZ_INTRO_BOTTOM":case 63:i.messageStubType=63;break;case"BIZ_NAME_CHANGE":case 64:i.messageStubType=64;break;case"BIZ_MOVE_TO_CONSUMER_APP":case 65:i.messageStubType=65;break;case"BIZ_TWO_TIER_MIGRATION_TOP":case 66:i.messageStubType=66;break;case"BIZ_TWO_TIER_MIGRATION_BOTTOM":case 67:i.messageStubType=67;break;case"OVERSIZED":case 68:i.messageStubType=68;break;case"GROUP_CHANGE_NO_FREQUENTLY_FORWARDED":case 69:i.messageStubType=69;break;case"GROUP_V4_ADD_INVITE_SENT":case 70:i.messageStubType=70;break;case"GROUP_PARTICIPANT_ADD_REQUEST_JOIN":case 71:i.messageStubType=71;break;case"CHANGE_EPHEMERAL_SETTING":case 72:i.messageStubType=72;break;case"E2E_DEVICE_CHANGED":case 73:i.messageStubType=73;break;case"VIEWED_ONCE":case 74:i.messageStubType=74;break;case"E2E_ENCRYPTED_NOW":case 75:i.messageStubType=75;break;case"BLUE_MSG_BSP_FB_TO_BSP_PREMISE":case 76:i.messageStubType=76;break;case"BLUE_MSG_BSP_FB_TO_SELF_FB":case 77:i.messageStubType=77;break;case"BLUE_MSG_BSP_FB_TO_SELF_PREMISE":case 78:i.messageStubType=78;break;case"BLUE_MSG_BSP_FB_UNVERIFIED":case 79:i.messageStubType=79;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 80:i.messageStubType=80;break;case"BLUE_MSG_BSP_FB_VERIFIED":case 81:i.messageStubType=81;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 82:i.messageStubType=82;break;case"BLUE_MSG_BSP_PREMISE_TO_SELF_PREMISE":case 83:i.messageStubType=83;break;case"BLUE_MSG_BSP_PREMISE_UNVERIFIED":case 84:i.messageStubType=84;break;case"BLUE_MSG_BSP_PREMISE_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 85:i.messageStubType=85;break;case"BLUE_MSG_BSP_PREMISE_VERIFIED":case 86:i.messageStubType=86;break;case"BLUE_MSG_BSP_PREMISE_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 87:i.messageStubType=87;break;case"BLUE_MSG_CONSUMER_TO_BSP_FB_UNVERIFIED":case 88:i.messageStubType=88;break;case"BLUE_MSG_CONSUMER_TO_BSP_PREMISE_UNVERIFIED":case 89:i.messageStubType=89;break;case"BLUE_MSG_CONSUMER_TO_SELF_FB_UNVERIFIED":case 90:i.messageStubType=90;break;case"BLUE_MSG_CONSUMER_TO_SELF_PREMISE_UNVERIFIED":case 91:i.messageStubType=91;break;case"BLUE_MSG_SELF_FB_TO_BSP_PREMISE":case 92:i.messageStubType=92;break;case"BLUE_MSG_SELF_FB_TO_SELF_PREMISE":case 93:i.messageStubType=93;break;case"BLUE_MSG_SELF_FB_UNVERIFIED":case 94:i.messageStubType=94;break;case"BLUE_MSG_SELF_FB_UNVERIFIED_TO_SELF_PREMISE_VERIFIED":case 95:i.messageStubType=95;break;case"BLUE_MSG_SELF_FB_VERIFIED":case 96:i.messageStubType=96;break;case"BLUE_MSG_SELF_FB_VERIFIED_TO_SELF_PREMISE_UNVERIFIED":case 97:i.messageStubType=97;break;case"BLUE_MSG_SELF_PREMISE_TO_BSP_PREMISE":case 98:i.messageStubType=98;break;case"BLUE_MSG_SELF_PREMISE_UNVERIFIED":case 99:i.messageStubType=99;break;case"BLUE_MSG_SELF_PREMISE_VERIFIED":case 100:i.messageStubType=100;break;case"BLUE_MSG_TO_BSP_FB":case 101:i.messageStubType=101;break;case"BLUE_MSG_TO_CONSUMER":case 102:i.messageStubType=102;break;case"BLUE_MSG_TO_SELF_FB":case 103:i.messageStubType=103;break;case"BLUE_MSG_UNVERIFIED_TO_BSP_FB_VERIFIED":case 104:i.messageStubType=104;break;case"BLUE_MSG_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 105:i.messageStubType=105;break;case"BLUE_MSG_UNVERIFIED_TO_SELF_FB_VERIFIED":case 106:i.messageStubType=106;break;case"BLUE_MSG_UNVERIFIED_TO_VERIFIED":case 107:i.messageStubType=107;break;case"BLUE_MSG_VERIFIED_TO_BSP_FB_UNVERIFIED":case 108:i.messageStubType=108;break;case"BLUE_MSG_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 109:i.messageStubType=109;break;case"BLUE_MSG_VERIFIED_TO_SELF_FB_UNVERIFIED":case 110:i.messageStubType=110;break;case"BLUE_MSG_VERIFIED_TO_UNVERIFIED":case 111:i.messageStubType=111;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 112:i.messageStubType=112;break;case"BLUE_MSG_BSP_FB_UNVERIFIED_TO_SELF_FB_VERIFIED":case 113:i.messageStubType=113;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 114:i.messageStubType=114;break;case"BLUE_MSG_BSP_FB_VERIFIED_TO_SELF_FB_UNVERIFIED":case 115:i.messageStubType=115;break;case"BLUE_MSG_SELF_FB_UNVERIFIED_TO_BSP_PREMISE_VERIFIED":case 116:i.messageStubType=116;break;case"BLUE_MSG_SELF_FB_VERIFIED_TO_BSP_PREMISE_UNVERIFIED":case 117:i.messageStubType=117;break;case"E2E_IDENTITY_UNAVAILABLE":case 118:i.messageStubType=118;break;case"GROUP_CREATING":case 119:i.messageStubType=119;break;case"GROUP_CREATE_FAILED":case 120:i.messageStubType=120;break;case"GROUP_BOUNCED":case 121:i.messageStubType=121;break;case"BLOCK_CONTACT":case 122:i.messageStubType=122;break;case"EPHEMERAL_SETTING_NOT_APPLIED":case 123:i.messageStubType=123;break;case"SYNC_FAILED":case 124:i.messageStubType=124;break;case"SYNCING":case 125:i.messageStubType=125;break;case"BIZ_PRIVACY_MODE_INIT_FB":case 126:i.messageStubType=126;break;case"BIZ_PRIVACY_MODE_INIT_BSP":case 127:i.messageStubType=127;break;case"BIZ_PRIVACY_MODE_TO_FB":case 128:i.messageStubType=128;break;case"BIZ_PRIVACY_MODE_TO_BSP":case 129:i.messageStubType=129;break;case"DISAPPEARING_MODE":case 130:i.messageStubType=130;break;case"E2E_DEVICE_FETCH_FAILED":case 131:i.messageStubType=131;break;case"ADMIN_REVOKE":case 132:i.messageStubType=132;break;case"GROUP_INVITE_LINK_GROWTH_LOCKED":case 133:i.messageStubType=133;break;case"COMMUNITY_LINK_PARENT_GROUP":case 134:i.messageStubType=134;break;case"COMMUNITY_LINK_SIBLING_GROUP":case 135:i.messageStubType=135;break;case"COMMUNITY_LINK_SUB_GROUP":case 136:i.messageStubType=136;break;case"COMMUNITY_UNLINK_PARENT_GROUP":case 137:i.messageStubType=137;break;case"COMMUNITY_UNLINK_SIBLING_GROUP":case 138:i.messageStubType=138;break;case"COMMUNITY_UNLINK_SUB_GROUP":case 139:i.messageStubType=139;break;case"GROUP_PARTICIPANT_ACCEPT":case 140:i.messageStubType=140;break;case"GROUP_PARTICIPANT_LINKED_GROUP_JOIN":case 141:i.messageStubType=141;break;case"COMMUNITY_CREATE":case 142:i.messageStubType=142;break;case"EPHEMERAL_KEEP_IN_CHAT":case 143:i.messageStubType=143;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST":case 144:i.messageStubType=144;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE":case 145:i.messageStubType=145;break;case"INTEGRITY_UNLINK_PARENT_GROUP":case 146:i.messageStubType=146;break;case"COMMUNITY_PARTICIPANT_PROMOTE":case 147:i.messageStubType=147;break;case"COMMUNITY_PARTICIPANT_DEMOTE":case 148:i.messageStubType=148;break;case"COMMUNITY_PARENT_GROUP_DELETED":case 149:i.messageStubType=149;break;case"COMMUNITY_LINK_PARENT_GROUP_MEMBERSHIP_APPROVAL":case 150:i.messageStubType=150;break;case"GROUP_PARTICIPANT_JOINED_GROUP_AND_PARENT_GROUP":case 151:i.messageStubType=151;break;case"MASKED_THREAD_CREATED":case 152:i.messageStubType=152;break;case"MASKED_THREAD_UNMASKED":case 153:i.messageStubType=153;break;case"BIZ_CHAT_ASSIGNMENT":case 154:i.messageStubType=154;break;case"CHAT_PSA":case 155:i.messageStubType=155;break;case"CHAT_POLL_CREATION_MESSAGE":case 156:i.messageStubType=156;break;case"CAG_MASKED_THREAD_CREATED":case 157:i.messageStubType=157;break;case"COMMUNITY_PARENT_GROUP_SUBJECT_CHANGED":case 158:i.messageStubType=158;break;case"CAG_INVITE_AUTO_ADD":case 159:i.messageStubType=159;break;case"BIZ_CHAT_ASSIGNMENT_UNASSIGN":case 160:i.messageStubType=160;break;case"CAG_INVITE_AUTO_JOINED":case 161:i.messageStubType=161;break;case"SCHEDULED_CALL_START_MESSAGE":case 162:i.messageStubType=162;break;case"COMMUNITY_INVITE_RICH":case 163:i.messageStubType=163;break;case"COMMUNITY_INVITE_AUTO_ADD_RICH":case 164:i.messageStubType=164;break;case"SUB_GROUP_INVITE_RICH":case 165:i.messageStubType=165;break;case"SUB_GROUP_PARTICIPANT_ADD_RICH":case 166:i.messageStubType=166;break;case"COMMUNITY_LINK_PARENT_GROUP_RICH":case 167:i.messageStubType=167;break;case"COMMUNITY_PARTICIPANT_ADD_RICH":case 168:i.messageStubType=168;break;case"SILENCED_UNKNOWN_CALLER_AUDIO":case 169:i.messageStubType=169;break;case"SILENCED_UNKNOWN_CALLER_VIDEO":case 170:i.messageStubType=170;break;case"GROUP_MEMBER_ADD_MODE":case 171:i.messageStubType=171;break;case"GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD":case 172:i.messageStubType=172;break;case"COMMUNITY_CHANGE_DESCRIPTION":case 173:i.messageStubType=173;break;case"SENDER_INVITE":case 174:i.messageStubType=174;break;case"RECEIVER_INVITE":case 175:i.messageStubType=175;break;case"COMMUNITY_ALLOW_MEMBER_ADDED_GROUPS":case 176:i.messageStubType=176;break;case"PINNED_MESSAGE_IN_CHAT":case 177:i.messageStubType=177;break;case"PAYMENT_INVITE_SETUP_INVITER":case 178:i.messageStubType=178;break;case"PAYMENT_INVITE_SETUP_INVITEE_RECEIVE_ONLY":case 179:i.messageStubType=179;break;case"PAYMENT_INVITE_SETUP_INVITEE_SEND_AND_RECEIVE":case 180:i.messageStubType=180;break;case"LINKED_GROUP_CALL_START":case 181:i.messageStubType=181;break;case"REPORT_TO_ADMIN_ENABLED_STATUS":case 182:i.messageStubType=182;break;case"EMPTY_SUBGROUP_CREATE":case 183:i.messageStubType=183;break;case"SCHEDULED_CALL_CANCEL":case 184:i.messageStubType=184;break;case"SUBGROUP_ADMIN_TRIGGERED_AUTO_ADD_RICH":case 185:i.messageStubType=185;break;case"GROUP_CHANGE_RECENT_HISTORY_SHARING":case 186:i.messageStubType=186;break;case"PAID_MESSAGE_SERVER_CAMPAIGN_ID":case 187:i.messageStubType=187;break;case"GENERAL_CHAT_CREATE":case 188:i.messageStubType=188;break;case"GENERAL_CHAT_ADD":case 189:i.messageStubType=189;break;case"GENERAL_CHAT_AUTO_ADD_DISABLED":case 190:i.messageStubType=190;break;case"SUGGESTED_SUBGROUP_ANNOUNCE":case 191:i.messageStubType=191;break;case"BIZ_BOT_1P_MESSAGING_ENABLED":case 192:i.messageStubType=192;break;case"CHANGE_USERNAME":case 193:i.messageStubType=193;break;case"BIZ_COEX_PRIVACY_INIT_SELF":case 194:i.messageStubType=194;break;case"BIZ_COEX_PRIVACY_TRANSITION_SELF":case 195:i.messageStubType=195;break;case"SUPPORT_AI_EDUCATION":case 196:i.messageStubType=196;break;case"BIZ_BOT_3P_MESSAGING_ENABLED":case 197:i.messageStubType=197;break;case"REMINDER_SETUP_MESSAGE":case 198:i.messageStubType=198;break;case"REMINDER_SENT_MESSAGE":case 199:i.messageStubType=199;break;case"REMINDER_CANCEL_MESSAGE":case 200:i.messageStubType=200;break;case"BIZ_COEX_PRIVACY_INIT":case 201:i.messageStubType=201;break;case"BIZ_COEX_PRIVACY_TRANSITION":case 202:i.messageStubType=202;break;case"GROUP_DEACTIVATED":case 203:i.messageStubType=203;break;case"COMMUNITY_DEACTIVATE_SIBLING_GROUP":case 204:i.messageStubType=204;break;case"EVENT_UPDATED":case 205:i.messageStubType=205;break;case"EVENT_CANCELED":case 206:i.messageStubType=206;break;case"COMMUNITY_OWNER_UPDATED":case 207:i.messageStubType=207;break;case"COMMUNITY_SUB_GROUP_VISIBILITY_HIDDEN":case 208:i.messageStubType=208;break;case"CAPI_GROUP_NE2EE_SYSTEM_MESSAGE":case 209:i.messageStubType=209;break;case"STATUS_MENTION":case 210:i.messageStubType=210;break;case"USER_CONTROLS_SYSTEM_MESSAGE":case 211:i.messageStubType=211;break;case"SUPPORT_SYSTEM_MESSAGE":case 212:i.messageStubType=212;break;case"CHANGE_LID":case 213:i.messageStubType=213;break;case"BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_IN_MESSAGE":case 214:i.messageStubType=214;break;case"BIZ_CUSTOMER_3PD_DATA_SHARING_OPT_OUT_MESSAGE":case 215:i.messageStubType=215;break;case"CHANGE_LIMIT_SHARING":case 216:i.messageStubType=216;break;case"GROUP_MEMBER_LINK_MODE":case 217:i.messageStubType=217;break;case"BIZ_AUTOMATICALLY_LABELED_CHAT_SYSTEM_MESSAGE":case 218:i.messageStubType=218;break;case"PHONE_NUMBER_HIDING_CHAT_DEPRECATED_MESSAGE":case 219:i.messageStubType=219;break;case"QUARANTINED_MESSAGE":case 220:i.messageStubType=220;break;case"GROUP_MEMBER_SHARE_GROUP_HISTORY_MODE":case 221:i.messageStubType=221;break}if(e.clearMedia!=null&&(i.clearMedia=!!e.clearMedia),e.messageStubParameters){if(!Array.isArray(e.messageStubParameters))throw TypeError(".proto.WebMessageInfo.messageStubParameters: array expected");i.messageStubParameters=[];for(var A=0;A>>0),e.labels){if(!Array.isArray(e.labels))throw TypeError(".proto.WebMessageInfo.labels: array expected");i.labels=[];for(var A=0;A>>0,e.ephemeralStartTimestamp.high>>>0).toNumber(!0))),e.ephemeralDuration!=null&&(i.ephemeralDuration=e.ephemeralDuration>>>0),e.ephemeralOffToOn!=null&&(i.ephemeralOffToOn=!!e.ephemeralOffToOn),e.ephemeralOutOfSync!=null&&(i.ephemeralOutOfSync=!!e.ephemeralOutOfSync),e.bizPrivacyStatus){default:if(typeof e.bizPrivacyStatus=="number"){i.bizPrivacyStatus=e.bizPrivacyStatus;break}break;case"E2EE":case 0:i.bizPrivacyStatus=0;break;case"FB":case 2:i.bizPrivacyStatus=2;break;case"BSP":case 1:i.bizPrivacyStatus=1;break;case"BSP_AND_FB":case 3:i.bizPrivacyStatus=3;break}if(e.verifiedBizName!=null&&(i.verifiedBizName=String(e.verifiedBizName)),e.mediaData!=null){if(typeof e.mediaData!="object")throw TypeError(".proto.WebMessageInfo.mediaData: object expected");i.mediaData=d.proto.MediaData.fromObject(e.mediaData)}if(e.photoChange!=null){if(typeof e.photoChange!="object")throw TypeError(".proto.WebMessageInfo.photoChange: object expected");i.photoChange=d.proto.PhotoChange.fromObject(e.photoChange)}if(e.userReceipt){if(!Array.isArray(e.userReceipt))throw TypeError(".proto.WebMessageInfo.userReceipt: array expected");i.userReceipt=[];for(var A=0;A=0&&(i.futureproofData=e.futureproofData)),e.statusPsa!=null){if(typeof e.statusPsa!="object")throw TypeError(".proto.WebMessageInfo.statusPsa: object expected");i.statusPsa=d.proto.StatusPSA.fromObject(e.statusPsa)}if(e.pollUpdates){if(!Array.isArray(e.pollUpdates))throw TypeError(".proto.WebMessageInfo.pollUpdates: array expected");i.pollUpdates=[];for(var A=0;A=0&&(i.messageSecret=e.messageSecret)),e.keepInChat!=null){if(typeof e.keepInChat!="object")throw TypeError(".proto.WebMessageInfo.keepInChat: object expected");i.keepInChat=d.proto.KeepInChat.fromObject(e.keepInChat)}if(e.originalSelfAuthorUserJidString!=null&&(i.originalSelfAuthorUserJidString=String(e.originalSelfAuthorUserJidString)),e.revokeMessageTimestamp!=null&&(l.Long?(i.revokeMessageTimestamp=l.Long.fromValue(e.revokeMessageTimestamp)).unsigned=!0:typeof e.revokeMessageTimestamp=="string"?i.revokeMessageTimestamp=parseInt(e.revokeMessageTimestamp,10):typeof e.revokeMessageTimestamp=="number"?i.revokeMessageTimestamp=e.revokeMessageTimestamp:typeof e.revokeMessageTimestamp=="object"&&(i.revokeMessageTimestamp=new l.LongBits(e.revokeMessageTimestamp.low>>>0,e.revokeMessageTimestamp.high>>>0).toNumber(!0))),e.pinInChat!=null){if(typeof e.pinInChat!="object")throw TypeError(".proto.WebMessageInfo.pinInChat: object expected");i.pinInChat=d.proto.PinInChat.fromObject(e.pinInChat)}if(e.premiumMessageInfo!=null){if(typeof e.premiumMessageInfo!="object")throw TypeError(".proto.WebMessageInfo.premiumMessageInfo: object expected");i.premiumMessageInfo=d.proto.PremiumMessageInfo.fromObject(e.premiumMessageInfo)}if(e.is1PBizBotMessage!=null&&(i.is1PBizBotMessage=!!e.is1PBizBotMessage),e.isGroupHistoryMessage!=null&&(i.isGroupHistoryMessage=!!e.isGroupHistoryMessage),e.botMessageInvokerJid!=null&&(i.botMessageInvokerJid=String(e.botMessageInvokerJid)),e.commentMetadata!=null){if(typeof e.commentMetadata!="object")throw TypeError(".proto.WebMessageInfo.commentMetadata: object expected");i.commentMetadata=d.proto.CommentMetadata.fromObject(e.commentMetadata)}if(e.eventResponses){if(!Array.isArray(e.eventResponses))throw TypeError(".proto.WebMessageInfo.eventResponses: array expected");i.eventResponses=[];for(var A=0;A>>0,e.newsletterServerId.high>>>0).toNumber(!0))),e.eventAdditionalMetadata!=null){if(typeof e.eventAdditionalMetadata!="object")throw TypeError(".proto.WebMessageInfo.eventAdditionalMetadata: object expected");i.eventAdditionalMetadata=d.proto.EventAdditionalMetadata.fromObject(e.eventAdditionalMetadata)}if(e.isMentionedInStatus!=null&&(i.isMentionedInStatus=!!e.isMentionedInStatus),e.statusMentions){if(!Array.isArray(e.statusMentions))throw TypeError(".proto.WebMessageInfo.statusMentions: array expected");i.statusMentions=[];for(var A=0;A>>3){case 2:{s.timestamp=e.uint64();break}case 3:{s.unreadChats=e.uint32();break}case 4:{s.notifyMessageCount=e.uint32();break}case 5:{s.notifyMessages&&s.notifyMessages.length||(s.notifyMessages=[]),s.notifyMessages.push(d.proto.WebMessageInfo.decode(e,e.uint32()));break}default:e.skipType(g&7);break}}return s},t.fromObject=function(e){if(e instanceof d.proto.WebNotificationsInfo)return e;var i=new d.proto.WebNotificationsInfo;if(e.timestamp!=null&&(l.Long?(i.timestamp=l.Long.fromValue(e.timestamp)).unsigned=!0:typeof e.timestamp=="string"?i.timestamp=parseInt(e.timestamp,10):typeof e.timestamp=="number"?i.timestamp=e.timestamp:typeof e.timestamp=="object"&&(i.timestamp=new l.LongBits(e.timestamp.low>>>0,e.timestamp.high>>>0).toNumber(!0))),e.unreadChats!=null&&(i.unreadChats=e.unreadChats>>>0),e.notifyMessageCount!=null&&(i.notifyMessageCount=e.notifyMessageCount>>>0),e.notifyMessages){if(!Array.isArray(e.notifyMessages))throw TypeError(".proto.WebNotificationsInfo.notifyMessages: array expected");i.notifyMessages=[];for(var A=0;ANi.hasSubscribers||PB.hasSubscribers,I7=new Set,c7=typeof process=="object"&&process?process:{},axe=(n,t,o,a)=>{typeof c7.emitWarning=="function"?c7.emitWarning(n,t,o,a):console.error(`[${o}] ${t}: ${n}`)},oxe=n=>!I7.has(n),tI=n=>!!n&&n===Math.floor(n)&&n>0&&isFinite(n),l7=n=>tI(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?wD:null:null,wD=class extends Array{constructor(n){super(n),this.fill(0)}},nxe=class GB{heap;length;static#e=!1;static create(t){let o=l7(t);if(!o)return[];GB.#e=!0;let a=new GB(t,o);return GB.#e=!1,a}constructor(t,o){if(!GB.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new o(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},Jg=class p7{#e;#A;#t;#r;#I;#o;#c;#i;get perf(){return this.#i}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#a;#s;#p;#g;#l;#n;#h;#d;#C;#u;#B;#f;#m;#w;#Q;#y;#b;#E;#k;static unsafeExposeInternals(t){return{starts:t.#m,ttls:t.#w,autopurgeTimers:t.#Q,sizes:t.#f,keyMap:t.#p,keyList:t.#g,valList:t.#l,next:t.#n,prev:t.#h,get head(){return t.#d},get tail(){return t.#C},free:t.#u,isBackgroundFetch:o=>t.#v(o),backgroundFetch:(o,a,e,i)=>t.#q(o,a,e,i),moveToTail:o=>t.#$(o),indexes:o=>t.#x(o),rindexes:o=>t.#K(o),isStale:o=>t.#N(o)}}get max(){return this.#e}get maxSize(){return this.#A}get calculatedSize(){return this.#s}get size(){return this.#a}get fetchMethod(){return this.#o}get memoMethod(){return this.#c}get dispose(){return this.#t}get onInsert(){return this.#r}get disposeAfter(){return this.#I}constructor(t){let{max:o=0,ttl:a,ttlResolution:e=1,ttlAutopurge:i,updateAgeOnGet:A,updateAgeOnHas:r,allowStale:s,dispose:g,onInsert:c,disposeAfter:I,noDisposeOnSet:p,noUpdateTTL:B,maxSize:f=0,maxEntrySize:Q=0,sizeCalculation:y,fetchMethod:m,memoMethod:T,noDeleteOnFetchRejection:_,noDeleteOnStaleGet:R,allowStaleOnFetchRejection:L,allowStaleOnFetchAbort:U,ignoreFetchAbort:F,backgroundFetchSize:q=1,perf:z}=t;if(this.backgroundFetchSize=q,z!==void 0&&typeof z?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#i=z??ixe,o!==0&&!tI(o))throw new TypeError("max option must be a nonnegative integer");let K=o?l7(o):Array;if(!K)throw new Error("invalid max value: "+o);if(this.#e=o,this.#A=f,this.maxEntrySize=Q||this.#A,this.sizeCalculation=y,this.sizeCalculation){if(!this.#A&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(T!==void 0&&typeof T!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#c=T,m!==void 0&&typeof m!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#o=m,this.#b=!!m,this.#p=new Map,this.#g=Array.from({length:o}).fill(void 0),this.#l=Array.from({length:o}).fill(void 0),this.#n=new K(o),this.#h=new K(o),this.#d=0,this.#C=0,this.#u=nxe.create(o),this.#a=0,this.#s=0,typeof g=="function"&&(this.#t=g),typeof c=="function"&&(this.#r=c),typeof I=="function"?(this.#I=I,this.#B=[]):(this.#I=void 0,this.#B=void 0),this.#y=!!this.#t,this.#k=!!this.#r,this.#E=!!this.#I,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!B,this.noDeleteOnFetchRejection=!!_,this.allowStaleOnFetchRejection=!!L,this.allowStaleOnFetchAbort=!!U,this.ignoreFetchAbort=!!F,this.maxEntrySize!==0){if(this.#A!==0&&!tI(this.#A))throw new TypeError("maxSize must be a positive integer if specified");if(!tI(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!s,this.noDeleteOnStaleGet=!!R,this.updateAgeOnGet=!!A,this.updateAgeOnHas=!!r,this.ttlResolution=tI(e)||e===0?e:1,this.ttlAutopurge=!!i,this.ttl=a||0,this.ttl){if(!tI(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M()}if(this.#e===0&&this.ttl===0&&this.#A===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#A){let G="LRU_CACHE_UNBOUNDED";oxe(G)&&(I7.add(G),axe("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",G,p7))}}getRemainingTTL(t){return this.#p.has(t)?1/0:0}#M(){let t=new wD(this.#e),o=new wD(this.#e);this.#w=t,this.#m=o;let a=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#Q=a,this.#T=(s,g,c=this.#i.now())=>{o[s]=g!==0?c:0,t[s]=g,e(s,g)},this.#D=s=>{o[s]=t[s]!==0?this.#i.now():0,e(s,t[s])};let e=this.ttlAutopurge?(s,g)=>{if(a?.[s]&&(clearTimeout(a[s]),a[s]=void 0),g&&g!==0&&a){let c=setTimeout(()=>{this.#N(s)?(this.#j(this.#g[s],"expire"),a[s]=void 0):e(s,r(s))},g+1);c.unref&&c.unref(),a[s]=c}}:()=>{};this.#S=(s,g)=>{if(t[g]){let c=t[g],I=o[g];if(!c||!I)return;s.ttl=c,s.start=I,s.now=i||A();let p=s.now-I;s.remainingTTL=c-p}};let i=0,A=()=>{let s=this.#i.now();if(this.ttlResolution>0){i=s;let g=setTimeout(()=>i=0,this.ttlResolution);g.unref&&g.unref()}return s};this.getRemainingTTL=s=>{let g=this.#p.get(s);return g===void 0?0:r(g)};let r=s=>{let g=t[s],c=o[s];if(!g||!c)return 1/0;let I=(i||A())-c;return g-I};this.#N=s=>{let g=o[s],c=t[s];return!!c&&!!g&&(i||A())-g>c}}#D=()=>{};#S=()=>{};#T=()=>{};#N=()=>!1;#P(){let t=new wD(this.#e);this.#s=0,this.#f=t,this.#_=o=>{this.#s-=t[o],t[o]=0},this.#R=(o,a,e,i)=>{if(!tI(e)){if(this.#v(a))return this.backgroundFetchSize;if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(e=i(a,o),!tI(e))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return e},this.#G=(o,a,e)=>{if(t[o]=a,this.#A){let i=this.#A-t[o];for(;this.#s>i;)this.#F(!0)}this.#s+=t[o],e&&(e.entrySize=a,e.totalCalculatedSize=this.#s)}}#_=t=>{};#G=(t,o,a)=>{};#R=(t,o,a,e)=>{if(a||e)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:t=this.allowStale}={}){if(this.#a)for(let o=this.#C;this.#J(o)&&((t||!this.#N(o))&&(yield o),o!==this.#d);)o=this.#h[o]}*#K({allowStale:t=this.allowStale}={}){if(this.#a)for(let o=this.#d;this.#J(o)&&((t||!this.#N(o))&&(yield o),o!==this.#C);)o=this.#n[o]}#J(t){return t!==void 0&&this.#p.get(this.#g[t])===t}*entries(){for(let t of this.#x())this.#l[t]!==void 0&&this.#g[t]!==void 0&&!this.#v(this.#l[t])&&(yield[this.#g[t],this.#l[t]])}*rentries(){for(let t of this.#K())this.#l[t]!==void 0&&this.#g[t]!==void 0&&!this.#v(this.#l[t])&&(yield[this.#g[t],this.#l[t]])}*keys(){for(let t of this.#x()){let o=this.#g[t];o!==void 0&&!this.#v(this.#l[t])&&(yield o)}}*rkeys(){for(let t of this.#K()){let o=this.#g[t];o!==void 0&&!this.#v(this.#l[t])&&(yield o)}}*values(){for(let t of this.#x())this.#l[t]!==void 0&&!this.#v(this.#l[t])&&(yield this.#l[t])}*rvalues(){for(let t of this.#K())this.#l[t]!==void 0&&!this.#v(this.#l[t])&&(yield this.#l[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,o={}){for(let a of this.#x()){let e=this.#l[a],i=this.#v(e)?e.__staleWhileFetching:e;if(i!==void 0&&t(i,this.#g[a],this))return this.#X(this.#g[a],o)}}forEach(t,o=this){for(let a of this.#x()){let e=this.#l[a],i=this.#v(e)?e.__staleWhileFetching:e;i!==void 0&&t.call(o,i,this.#g[a],this)}}rforEach(t,o=this){for(let a of this.#K()){let e=this.#l[a],i=this.#v(e)?e.__staleWhileFetching:e;i!==void 0&&t.call(o,i,this.#g[a],this)}}purgeStale(){let t=!1;for(let o of this.#K({allowStale:!0}))this.#N(o)&&(this.#j(this.#g[o],"expire"),t=!0);return t}info(t){let o=this.#p.get(t);if(o===void 0)return;let a=this.#l[o],e=this.#v(a)?a.__staleWhileFetching:a;if(e===void 0)return;let i={value:e};if(this.#w&&this.#m){let A=this.#w[o],r=this.#m[o];if(A&&r){let s=A-(this.#i.now()-r);i.ttl=s,i.start=Date.now()}}return this.#f&&(i.size=this.#f[o]),i}dump(){let t=[];for(let o of this.#x({allowStale:!0})){let a=this.#g[o],e=this.#l[o],i=this.#v(e)?e.__staleWhileFetching:e;if(i===void 0||a===void 0)continue;let A={value:i};if(this.#w&&this.#m){A.ttl=this.#w[o];let r=this.#i.now()-this.#m[o];A.start=Math.floor(Date.now()-r)}this.#f&&(A.size=this.#f[o]),t.unshift([a,A])}return t}load(t){this.clear();for(let[o,a]of t){if(a.start){let e=Date.now()-a.start;a.start=this.#i.now()-e}this.#U(o,a.value,a)}}set(t,o,a={}){let{status:e=Ni.hasSubscribers?{}:void 0}=a;a.status=e,e&&(e.op="set",e.key=t,o!==void 0&&(e.value=o),e.cache=this);let i=this.#U(t,o,a);return e&&Ni.hasSubscribers&&Ni.publish(e),i}#U(t,o,a,e){let{ttl:i=this.ttl,start:A,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:g}=a,c=this.#v(o);if(o===void 0)return g&&(g.set="deleted"),this.delete(t),this;let{noUpdateTTL:I=this.noUpdateTTL}=a;g&&!c&&(g.value=o);let p=this.#R(t,o,a.size||0,s,g);if(this.maxEntrySize&&p>this.maxEntrySize)return this.#j(t,"set"),g&&(g.set="miss",g.maxEntrySizeExceeded=!0),this;let B=this.#a===0?void 0:this.#p.get(t);if(B===void 0)B=this.#a===0?this.#C:this.#u.length!==0?this.#u.pop():this.#a===this.#e?this.#F(!1):this.#a,this.#g[B]=t,this.#l[B]=o,this.#p.set(t,B),this.#n[this.#C]=B,this.#h[B]=this.#C,this.#C=B,this.#a++,this.#G(B,p,g),g&&(g.set="add"),I=!1,this.#k&&!c&&this.#r?.(o,t,"add");else{this.#$(B);let f=this.#l[B];if(o!==f){if(!r)if(this.#v(f)){f!==e&&f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Q}=f;Q!==void 0&&Q!==o&&(this.#y&&this.#t?.(Q,t,"set"),this.#E&&this.#B?.push([Q,t,"set"]))}else this.#y&&this.#t?.(f,t,"set"),this.#E&&this.#B?.push([f,t,"set"]);if(this.#_(B),this.#G(B,p,g),this.#l[B]=o,!c){let Q=f&&this.#v(f)?f.__staleWhileFetching:f,y=Q===void 0?"add":o!==Q?"replace":"update";g&&(g.set=y,Q!==void 0&&(g.oldValue=Q)),this.#k&&this.onInsert?.(o,t,y)}}else c||(g&&(g.set="update"),this.#k&&this.onInsert?.(o,t,"update"))}if(i!==0&&!this.#w&&this.#M(),this.#w&&(I||this.#T(B,i,A),g&&this.#S(g,B)),!r&&this.#E&&this.#B){let f=this.#B,Q;for(;Q=f?.shift();)this.#I?.(...Q)}return this}pop(){try{for(;this.#a;){let t=this.#l[this.#d];if(this.#F(!0),this.#v(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#E&&this.#B){let t=this.#B,o;for(;o=t?.shift();)this.#I?.(...o)}}}#F(t){let o=this.#d,a=this.#g[o],e=this.#l[o],i=this.#v(e);i&&e.__abortController.abort(new Error("evicted"));let A=i?e.__staleWhileFetching:e;return(this.#y||this.#E)&&A!==void 0&&(this.#y&&this.#t?.(A,a,"evict"),this.#E&&this.#B?.push([A,a,"evict"])),this.#_(o),this.#Q?.[o]&&(clearTimeout(this.#Q[o]),this.#Q[o]=void 0),t&&(this.#g[o]=void 0,this.#l[o]=void 0,this.#u.push(o)),this.#a===1?(this.#d=this.#C=0,this.#u.length=0):this.#d=this.#n[o],this.#p.delete(a),this.#a--,o}has(t,o={}){let{status:a=Ni.hasSubscribers?{}:void 0}=o;o.status=a,a&&(a.op="has",a.key=t,a.cache=this);let e=this.#L(t,o);return Ni.hasSubscribers&&Ni.publish(a),e}#L(t,o={}){let{updateAgeOnHas:a=this.updateAgeOnHas,status:e}=o,i=this.#p.get(t);if(i!==void 0){let A=this.#l[i];if(this.#v(A)&&A.__staleWhileFetching===void 0)return!1;if(this.#N(i))e&&(e.has="stale",this.#S(e,i));else return a&&this.#D(i),e&&(e.has="hit",this.#S(e,i)),!0}else e&&(e.has="miss");return!1}peek(t,o={}){let{status:a=dL()?{}:void 0}=o;a&&(a.op="peek",a.key=t,a.cache=this),o.status=a;let e=this.#V(t,o);return Ni.hasSubscribers&&Ni.publish(a),e}#V(t,o){let{status:a,allowStale:e=this.allowStale}=o,i=this.#p.get(t);if(i===void 0||!e&&this.#N(i)){a&&(a.peek=i===void 0?"miss":"stale");return}let A=this.#l[i],r=this.#v(A)?A.__staleWhileFetching:A;return a&&(r!==void 0?(a.peek="hit",a.value=r):a.peek="miss"),r}#q(t,o,a,e){let i=o===void 0?void 0:this.#l[o];if(this.#v(i))return i;let A=new AbortController,{signal:r}=a;r?.addEventListener("abort",()=>A.abort(r.reason),{signal:A.signal});let s={signal:A.signal,options:a,context:e},g=(Q,y=!1)=>{let{aborted:m}=A.signal,T=a.ignoreFetchAbort&&Q!==void 0,_=a.ignoreFetchAbort||!!(a.allowStaleOnFetchAbort&&Q!==void 0);if(a.status&&(m&&!y?(a.status.fetchAborted=!0,a.status.fetchError=A.signal.reason,T&&(a.status.fetchAbortIgnored=!0)):a.status.fetchResolved=!0),m&&!T&&!y)return I(A.signal.reason,_);let R=B,L=this.#l[o];return(L===B||L===void 0&&T&&y)&&(Q===void 0?R.__staleWhileFetching!==void 0?this.#l[o]=R.__staleWhileFetching:this.#j(t,"fetch"):(a.status&&(a.status.fetchUpdated=!0),this.#U(t,Q,s.options,R))),Q},c=Q=>(a.status&&(a.status.fetchRejected=!0,a.status.fetchError=Q),I(Q,!1)),I=(Q,y)=>{let{aborted:m}=A.signal,T=m&&a.allowStaleOnFetchAbort,_=T||a.allowStaleOnFetchRejection,R=_||a.noDeleteOnFetchRejection,L=B;if(this.#l[o]===B&&(!R||!y&&L.__staleWhileFetching===void 0?this.#j(t,"fetch"):T||(this.#l[o]=L.__staleWhileFetching)),_)return a.status&&L.__staleWhileFetching!==void 0&&(a.status.returnedStale=!0),L.__staleWhileFetching;if(L.__returned===L)throw Q},p=(Q,y)=>{let m=this.#o?.(t,i,s);A.signal.addEventListener("abort",()=>{(!a.ignoreFetchAbort||a.allowStaleOnFetchAbort)&&(Q(void 0),a.allowStaleOnFetchAbort&&(Q=T=>g(T,!0)))}),m&&m instanceof Promise?m.then(T=>Q(T===void 0?void 0:T),y):m!==void 0&&Q(m)};a.status&&(a.status.fetchDispatched=!0);let B=new Promise(p).then(g,c),f=Object.assign(B,{__abortController:A,__staleWhileFetching:i,__returned:void 0});return o===void 0?(this.#U(t,f,{...s.options,status:void 0}),o=this.#p.get(t)):this.#l[o]=f,f}#v(t){if(!this.#b)return!1;let o=t;return!!o&&o instanceof Promise&&o.hasOwnProperty("__staleWhileFetching")&&o.__abortController instanceof AbortController}fetch(t,o={}){let a=PB.hasSubscribers,{status:e=dL()?{}:void 0}=o;o.status=e,e&&o.context&&(e.context=o.context);let i=this.#W(t,o);return e&&a&&(e.trace=!0,PB.tracePromise(()=>i,e).catch(()=>{})),i}async#W(t,o={}){let{allowStale:a=this.allowStale,updateAgeOnGet:e=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:A=this.ttl,noDisposeOnSet:r=this.noDisposeOnSet,size:s=0,sizeCalculation:g=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:I=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:B=this.ignoreFetchAbort,allowStaleOnFetchAbort:f=this.allowStaleOnFetchAbort,context:Q,forceRefresh:y=!1,status:m,signal:T}=o;if(m&&(m.op="fetch",m.key=t,y&&(m.forceRefresh=!0),m.cache=this),!this.#b)return m&&(m.fetch="get"),this.#X(t,{allowStale:a,updateAgeOnGet:e,noDeleteOnStaleGet:i,status:m});let _={allowStale:a,updateAgeOnGet:e,noDeleteOnStaleGet:i,ttl:A,noDisposeOnSet:r,size:s,sizeCalculation:g,noUpdateTTL:c,noDeleteOnFetchRejection:I,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:f,ignoreFetchAbort:B,status:m,signal:T},R=this.#p.get(t);if(R===void 0){m&&(m.fetch="miss");let L=this.#q(t,R,_,Q);return L.__returned=L}else{let L=this.#l[R];if(this.#v(L)){let z=a&&L.__staleWhileFetching!==void 0;return m&&(m.fetch="inflight",z&&(m.returnedStale=!0)),z?L.__staleWhileFetching:L.__returned=L}let U=this.#N(R);if(!y&&!U)return m&&(m.fetch="hit"),this.#$(R),e&&this.#D(R),m&&this.#S(m,R),L;let F=this.#q(t,R,_,Q),q=F.__staleWhileFetching!==void 0&&a;return m&&(m.fetch=U?"stale":"refresh",q&&U&&(m.returnedStale=!0)),q?F.__staleWhileFetching:F.__returned=F}}forceFetch(t,o={}){let a=PB.hasSubscribers,{status:e=dL()?{}:void 0}=o;o.status=e,e&&o.context&&(e.context=o.context);let i=this.#H(t,o);return e&&a&&(e.trace=!0,PB.tracePromise(()=>i,e).catch(()=>{})),i}async#H(t,o={}){let a=await this.#W(t,o);if(a===void 0)throw new Error("fetch() returned undefined");return a}memo(t,o={}){let{status:a=Ni.hasSubscribers?{}:void 0}=o;o.status=a,a&&(a.op="memo",a.key=t,o.context&&(a.context=o.context),a.cache=this);let e=this.#Z(t,o);return a&&(a.value=e),Ni.hasSubscribers&&Ni.publish(a),e}#Z(t,o={}){let a=this.#c;if(!a)throw new Error("no memoMethod provided to constructor");let{context:e,status:i,forceRefresh:A,...r}=o;i&&A&&(i.forceRefresh=!0);let s=this.#X(t,r),g=A||s===void 0;if(i&&(i.memo=g?"miss":"hit",g||(i.value=s)),!g)return s;let c=a(t,s,{options:r,context:e});return i&&(i.value=c),this.#U(t,c,r),c}get(t,o={}){let{status:a=Ni.hasSubscribers?{}:void 0}=o;o.status=a,a&&(a.op="get",a.key=t,a.cache=this);let e=this.#X(t,o);return a&&(e!==void 0&&(a.value=e),Ni.hasSubscribers&&Ni.publish(a)),e}#X(t,o={}){let{allowStale:a=this.allowStale,updateAgeOnGet:e=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:A}=o,r=this.#p.get(t);if(r===void 0){A&&(A.get="miss");return}let s=this.#l[r],g=this.#v(s);return A&&this.#S(A,r),this.#N(r)?g?(A&&(A.get="stale-fetching"),a&&s.__staleWhileFetching!==void 0?(A&&(A.returnedStale=!0),s.__staleWhileFetching):void 0):(i||this.#j(t,"expire"),A&&(A.get="stale"),a?(A&&(A.returnedStale=!0),s):void 0):(A&&(A.get=g?"fetching":"hit"),this.#$(r),e&&this.#D(r),g?s.__staleWhileFetching:s)}#ie(t,o){this.#h[o]=t,this.#n[t]=o}#$(t){t!==this.#C&&(t===this.#d?this.#d=this.#n[t]:this.#ie(this.#h[t],this.#n[t]),this.#ie(this.#C,t),this.#C=t)}delete(t){return this.#j(t,"delete")}#j(t,o){Ni.hasSubscribers&&Ni.publish({op:"delete",delete:o,key:t,cache:this});let a=!1;if(this.#a!==0){let e=this.#p.get(t);if(e!==void 0)if(this.#Q?.[e]&&(clearTimeout(this.#Q[e]),this.#Q[e]=void 0),a=!0,this.#a===1)this.#Ae(o);else{this.#_(e);let i=this.#l[e];if(this.#v(i)?i.__abortController.abort(new Error("deleted")):(this.#y||this.#E)&&(this.#y&&this.#t?.(i,t,o),this.#E&&this.#B?.push([i,t,o])),this.#p.delete(t),this.#g[e]=void 0,this.#l[e]=void 0,e===this.#C)this.#C=this.#h[e];else if(e===this.#d)this.#d=this.#n[e];else{let A=this.#h[e];this.#n[A]=this.#n[e];let r=this.#n[e];this.#h[r]=this.#h[e]}this.#a--,this.#u.push(e)}}if(this.#E&&this.#B?.length){let e=this.#B,i;for(;i=e?.shift();)this.#I?.(...i)}return a}clear(){return this.#Ae("delete")}#Ae(t){for(let o of this.#K({allowStale:!0})){let a=this.#l[o];if(this.#v(a))a.__abortController.abort(new Error("deleted"));else{let e=this.#g[o];this.#y&&this.#t?.(a,e,t),this.#E&&this.#B?.push([a,e,t])}}if(this.#p.clear(),this.#l.fill(void 0),this.#g.fill(void 0),this.#w&&this.#m){this.#w.fill(0),this.#m.fill(0);for(let o of this.#Q??[])o!==void 0&&clearTimeout(o);this.#Q?.fill(void 0)}if(this.#f&&this.#f.fill(0),this.#d=0,this.#C=0,this.#u.length=0,this.#s=0,this.#a=0,this.#E&&this.#B){let o=this.#B,a;for(;a=o?.shift();)this.#I?.(...a)}}};var xD=ze(Jr(),1);import{createHash as jxe,randomBytes as VB}from"crypto";var g$=["critical_block","critical_unblock_low","regular_high","regular_low","regular"];var OSA=ze(Jr(),1),Ei;(function(n){n[n.Connecting=0]="Connecting",n[n.AwaitingInitialSync=1]="AwaitingInitialSync",n[n.Syncing=2]="Syncing",n[n.Online=3]="Online"})(Ei||(Ei={}));var iI;(function(n){n.BIZ_COMMERCE_VIOLATION_ALCOHOL="BIZ_COMMERCE_VIOLATION_ALCOHOL",n.BIZ_COMMERCE_VIOLATION_ADULT="BIZ_COMMERCE_VIOLATION_ADULT",n.BIZ_COMMERCE_VIOLATION_ANIMALS="BIZ_COMMERCE_VIOLATION_ANIMALS",n.BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS="BIZ_COMMERCE_VIOLATION_BODY_PARTS_FLUIDS",n.BIZ_COMMERCE_VIOLATION_DATING="BIZ_COMMERCE_VIOLATION_DATING",n.BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS="BIZ_COMMERCE_VIOLATION_DIGITAL_SERVICES_PRODUCTS",n.BIZ_COMMERCE_VIOLATION_DRUGS="BIZ_COMMERCE_VIOLATION_DRUGS",n.BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC="BIZ_COMMERCE_VIOLATION_DRUGS_ONLY_OTC",n.BIZ_COMMERCE_VIOLATION_GAMBLING="BIZ_COMMERCE_VIOLATION_GAMBLING",n.BIZ_COMMERCE_VIOLATION_HEALTHCARE="BIZ_COMMERCE_VIOLATION_HEALTHCARE",n.BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY="BIZ_COMMERCE_VIOLATION_REAL_FAKE_CURRENCY",n.BIZ_COMMERCE_VIOLATION_SUPPLEMENTS="BIZ_COMMERCE_VIOLATION_SUPPLEMENTS",n.BIZ_COMMERCE_VIOLATION_TOBACCO="BIZ_COMMERCE_VIOLATION_TOBACCO",n.BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT="BIZ_COMMERCE_VIOLATION_VIOLENT_CONTENT",n.BIZ_COMMERCE_VIOLATION_WEAPONS="BIZ_COMMERCE_VIOLATION_WEAPONS",n.BIZ_QUALITY="BIZ_QUALITY",n.DEFAULT="DEFAULT",n.WEB_COMPANION_ONLY="WEB_COMPANION_ONLY"})(iI||(iI={}));var c$;(function(n){n.NONE="NONE",n.FIRST_WARNING="FIRST_WARNING",n.SECOND_WARNING="SECOND_WARNING",n.CAPPED="CAPPED"})(c$||(c$={}));var I$;(function(n){n.NOT_ELIGIBLE="NOT_ELIGIBLE",n.NOT_ACTIVE="NOT_ACTIVE",n.ACTIVE="ACTIVE",n.ACTIVE_UPGRADE_AVAILABLE="ACTIVE_UPGRADE_AVAILABLE"})(I$||(I$={}));var l$;(function(n){n.NOT_ELIGIBLE="NOT_ELIGIBLE",n.ELIGIBLE="ELIGIBLE",n.ACTIVE_IN_CURRENT_CYCLE="ACTIVE_IN_CURRENT_CYCLE",n.EXHAUSTED="EXHAUSTED"})(l$||(l$={}));var RA=ne.WebMessageInfo.StubType,bh=ne.WebMessageInfo.Status,LB;(function(n){n.PN="pn",n.LID="lid"})(LB||(LB={}));var Ri;(function(n){n.xwa2_newsletter_create="xwa2_newsletter_create",n.xwa2_newsletter_subscribers="xwa2_newsletter_subscribers",n.xwa2_newsletter_view="xwa2_newsletter_view",n.xwa2_newsletter_metadata="xwa2_newsletter",n.xwa2_newsletter_admin_count="xwa2_newsletter_admin",n.xwa2_newsletter_mute_v2="xwa2_newsletter_mute_v2",n.xwa2_newsletter_unmute_v2="xwa2_newsletter_unmute_v2",n.xwa2_newsletter_follow="xwa2_newsletter_follow",n.xwa2_newsletter_unfollow="xwa2_newsletter_unfollow",n.xwa2_newsletter_join_v2="xwa2_newsletter_join_v2",n.xwa2_newsletter_leave_v2="xwa2_newsletter_leave_v2",n.xwa2_newsletter_change_owner="xwa2_newsletter_change_owner",n.xwa2_newsletter_demote="xwa2_newsletter_demote",n.xwa2_newsletter_delete_v2="xwa2_newsletter_delete_v2",n.xwa2_fetch_account_reachout_timelock="xwa2_fetch_account_reachout_timelock",n.xwa2_message_capping_info="xwa2_message_capping_info"})(Ri||(Ri={}));var ui;(function(n){n.CREATE="8823471724422422",n.UPDATE_METADATA="24250201037901610",n.METADATA="6563316087068696",n.SUBSCRIBERS="9783111038412085",n.FOLLOW="24404358912487870",n.UNFOLLOW="9767147403369991",n.MUTE="29766401636284406",n.UNMUTE="9864994326891137",n.ADMIN_COUNT="7130823597031706",n.CHANGE_OWNER="7341777602580933",n.DEMOTE="6551828931592903",n.DELETE="30062808666639665",n.REACHOUT_TIMELOCK="23983697327930364",n.MESSAGE_CAPPING_INFO="24503548349331633"})(ui||(ui={}));var ar;(function(n){n[n.connectionClosed=428]="connectionClosed",n[n.connectionLost=408]="connectionLost",n[n.connectionReplaced=440]="connectionReplaced",n[n.timedOut=408]="timedOut",n[n.loggedOut=401]="loggedOut",n[n.badSession=500]="badSession",n[n.restartRequired=515]="restartRequired",n[n.multideviceMismatch=411]="multideviceMismatch",n[n.forbidden=403]="forbidden",n[n.unavailableService=503]="unavailableService"})(ar||(ar={}));var UB={};Lr(UB,{DOUBLE_BYTE_TOKENS:()=>p$,SINGLE_BYTE_TOKENS:()=>d$,TAGS:()=>fxe,TOKEN_MAP:()=>wL});var fxe={LIST_EMPTY:0,DICTIONARY_0:236,DICTIONARY_1:237,DICTIONARY_2:238,DICTIONARY_3:239,INTEROP_JID:245,FB_JID:246,AD_JID:247,LIST_8:248,LIST_16:249,JID_PAIR:250,HEX_8:251,BINARY_8:252,BINARY_20:253,BINARY_32:254,NIBBLE_8:255,PACKED_MAX:127},p$=[["read-self","active","fbns","protocol","reaction","screen_width","heartbeat","deviceid","2:47DEQpj8","uploadfieldstat","voip_settings","retry","priority","longitude","conflict","false","ig_professional","replaced","preaccept","cover_photo","uncompressed","encopt","ppic","04","passive","status-revoke-drop","keygen","540","offer","rate","opus","latitude","w:gp2","ver","4","business_profile","medium","sender","prev_v_id","email","website","invited","sign_credential","05","transport","skey","reason","peer_abtest_bucket","America/Sao_Paulo","appid","refresh","100","06","404","101","104","107","102","109","103","member_add_mode","105","transaction-id","110","106","outgoing","108","111","tokens","followers","ig_handle","self_pid","tue","dec","thu","joinable","peer_pid","mon","features","wed","peer_device_presence","pn","delete","07","fri","audio_duration","admin","connected","delta","rcat","disable","collection","08","480","sat","phash","all","invite","accept","critical_unblock_low","group_update","signed_credential","blinded_credential","eph_setting","net","09","background_location","refresh_id","Asia/Kolkata","privacy_mode_ts","account_sync","voip_payload_type","service_areas","acs_public_key","v_id","0a","fallback_class","relay","actual_actors","metadata","w:biz","5","connected-limit","notice","0b","host_storage","fb_page","subject","privatestats","invis","groupadd","010","note.m4r","uuid","0c","8000","sun","372","1020","stage","1200","720","canonical","fb","011","video_duration","0d","1140","superadmin","012","Opening.m4r","keystore_attestation","dleq_proof","013","timestamp","ab_key","w:sync:app:state","0e","vertical","600","p_v_id","6","likes","014","500","1260","creator","0f","rte","destination","group","group_info","syncd_anti_tampering_fatal_exception_enabled","015","dl_bw","Asia/Jakarta","vp8/h.264","online","1320","fb:multiway","10","timeout","016","nse_retry","urn:xmpp:whatsapp:dirty","017","a_v_id","web_shops_chat_header_button_enabled","nse_call","inactive-upgrade","none","web","groups","2250","mms_hot_content_timespan_in_seconds","contact_blacklist","nse_read","suspended_group_deletion_notification","binary_version","018","https://www.whatsapp.com/otp/copy/","reg_push","shops_hide_catalog_attachment_entrypoint","server_sync",".","ephemeral_messages_allowed_values","019","mms_vcache_aggregation_enabled","iphone","America/Argentina/Buenos_Aires","01a","mms_vcard_autodownload_size_kb","nse_ver","shops_header_dropdown_menu_item","dhash","catalog_status","communities_mvp_new_iqs_serverprop","blocklist","default","11","ephemeral_messages_enabled","01b","original_dimensions","8","mms4_media_retry_notification_encryption_enabled","mms4_server_error_receipt_encryption_enabled","original_image_url","sync","multiway","420","companion_enc_static","shops_profile_drawer_entrypoint","01c","vcard_as_document_size_kb","status_video_max_duration","request_image_url","01d","regular_high","s_t","abt","share_ext_min_preliminary_image_quality","01e","32","syncd_key_rotation_enabled","data_namespace","md_downgrade_read_receipts2","patch","polltype","ephemeral_messages_setting","userrate","15","partial_pjpeg_bw_threshold","played-self","catalog_exists","01f","mute_v2"],["reject","dirty","announcement","020","13","9","status_video_max_bitrate","fb:thrift_iq","offline_batch","022","full","ctwa_first_business_reply_logging","h.264","smax_id","group_description_length","https://www.whatsapp.com/otp/code","status_image_max_edge","smb_upsell_business_profile_enabled","021","web_upgrade_to_md_modal","14","023","s_o","smaller_video_thumbs_status_enabled","media_max_autodownload","960","blocking_status","peer_msg","joinable_group_call_client_version","group_call_video_maximization_enabled","return_snapshot","high","America/Mexico_City","entry_point_block_logging_enabled","pop","024","1050","16","1380","one_tap_calling_in_group_chat_size","regular_low","inline_joinable_education_enabled","hq_image_max_edge","locked","America/Bogota","smb_biztools_deeplink_enabled","status_image_quality","1088","025","payments_upi_intent_transaction_limit","voip","w:g2","027","md_pin_chat_enabled","026","multi_scan_pjpeg_download_enabled","shops_product_grid","transaction_id","ctwa_context_enabled","20","fna","hq_image_quality","alt_jpeg_doc_detection_quality","group_call_max_participants","pkey","America/Belem","image_max_kbytes","web_cart_v1_1_order_message_changes_enabled","ctwa_context_enterprise_enabled","urn:xmpp:whatsapp:account","840","Asia/Kuala_Lumpur","max_participants","video_remux_after_repair_enabled","stella_addressbook_restriction_type","660","900","780","context_menu_ios13_enabled","mute-state","ref","payments_request_messages","029","frskmsg","vcard_max_size_kb","sample_buffer_gif_player_enabled","match_last_seen","510","4983","video_max_bitrate","028","w:comms:chat","17","frequently_forwarded_max","groups_privacy_blacklist","Asia/Karachi","02a","web_download_document_thumb_mms_enabled","02b","hist_sync","biz_block_reasons_version","1024","18","web_is_direct_connection_for_plm_transparent","view_once_write","file_max_size","paid_convo_id","online_privacy_setting","video_max_edge","view_once_read","enhanced_storage_management","multi_scan_pjpeg_encoding_enabled","ctwa_context_forward_enabled","video_transcode_downgrade_enable","template_doc_mime_types","hq_image_bw_threshold","30","body","u_aud_limit_sil_restarts_ctrl","other","participating","w:biz:directory","1110","vp8","4018","meta","doc_detection_image_max_edge","image_quality","1170","02c","smb_upsell_chat_banner_enabled","key_expiry_time_second","pid","stella_interop_enabled","19","linked_device_max_count","md_device_sync_enabled","02d","02e","360","enhanced_block_enabled","ephemeral_icon_in_forwarding","paid_convo_status","gif_provider","project_name","server-error","canonical_url_validation_enabled","wallpapers_v2","syncd_clear_chat_delete_chat_enabled","medianotify","02f","shops_required_tos_version","vote","reset_skey_on_id_change","030","image_max_edge","multicast_limit_global","ul_bw","21","25","5000","poll","570","22","031","1280","WhatsApp","032","bloks_shops_enabled","50","upload_host_switching_enabled","web_ctwa_context_compose_enabled","ptt_forwarded_features_enabled","unblocked","partial_pjpeg_enabled","fbid:devices","height","ephemeral_group_query_ts","group_join_permissions","order","033","alt_jpeg_status_quality","migrate","popular-bank","win_uwp_deprecation_killswitch_enabled","web_download_status_thumb_mms_enabled","blocking","url_text","035","web_forwarding_limit_to_groups","1600","val","1000","syncd_msg_date_enabled","bank-ref-id","max_subject","payments_web_enabled","web_upload_document_thumb_mms_enabled","size","request","ephemeral","24","receipt_agg","ptt_remember_play_position","sampling_weight","enc_rekey","mute_always","037","034","23","036","action","click_to_chat_qr_enabled","width","disabled","038","md_blocklist_v2","played_self_enabled","web_buttons_message_enabled","flow_id","clear","450","fbid:thread","bloks_session_state","America/Lima","attachment_picker_refresh","download_host_switching_enabled","1792","u_aud_limit_sil_restarts_test2","custom_urls","device_fanout","optimistic_upload","2000","key_cipher_suite","web_smb_upsell_in_biz_profile_enabled","e","039","siri_post_status_shortcut","pair-device","lg","lc","stream_attribution_url","model","mspjpeg_phash_gen","catalog_send_all","new_multi_vcards_ui","share_biz_vcard_enabled","-","clean","200","md_blocklist_v2_server","03b","03a","web_md_migration_experience","ptt_conversation_waveform","u_aud_limit_sil_restarts_test1"],["64","ptt_playback_speed_enabled","web_product_list_message_enabled","paid_convo_ts","27","manufacturer","psp-routing","grp_uii_cleanup","ptt_draft_enabled","03c","business_initiated","web_catalog_products_onoff","web_upload_link_thumb_mms_enabled","03e","mediaretry","35","hfm_string_changes","28","America/Fortaleza","max_keys","md_mhfs_days","streaming_upload_chunk_size","5541","040","03d","2675","03f","...","512","mute","48","041","alt_jpeg_quality","60","042","md_smb_quick_reply","5183","c","1343","40","1230","043","044","mms_cat_v1_forward_hot_override_enabled","user_notice","ptt_waveform_send","047","Asia/Calcutta","250","md_privacy_v2","31","29","128","md_messaging_enabled","046","crypto","690","045","enc_iv","75","failure","ptt_oot_playback","AIzaSyDR5yfaG7OG8sMTUj8kfQEb8T9pN8BM6Lk","w","048","2201","web_large_files_ui","Asia/Makassar","812","status_collapse_muted","1334","257","2HP4dm","049","patches","1290","43cY6T","America/Caracas","web_sticker_maker","campaign","ptt_pausable_enabled","33","42","attestation","biz","04b","query_linked","s","125","04a","810","availability","1411","responsiveness_v2_m1","catalog_not_created","34","America/Santiago","1465","enc_p","04d","status_info","04f","key_version","..","04c","04e","md_group_notification","1598","1215","web_cart_enabled","37","630","1920","2394","-1","vcard","38","elapsed","36","828","peer","pricing_category","1245","invalid","stella_ios_enabled","2687","45","1528","39","u_is_redial_audio_1104_ctrl","1025","1455","58","2524","2603","054","bsp_system_message_enabled","web_pip_redesign","051","verify_apps","1974","1272","1322","1755","052","70","050","1063","1135","1361","80","1096","1828","1851","1251","1921","key_config_id","1254","1566","1252","2525","critical_block","1669","max_available","w:auth:backup:token","product","2530","870","1022","participant_uuid","web_cart_on_off","1255","1432","1867","41","1415","1440","240","1204","1608","1690","1846","1483","1687","1749","69","url_number","053","1325","1040","365","59","Asia/Riyadh","1177","test_recommended","057","1612","43","1061","1518","1635","055","1034","1375","750","1430","event_code","1682","503","55","865","78","1309","1365","44","America/Guayaquil","535","LIMITED","1377","1613","1420","1599","1822","05a","1681","password","1111","1214","1376","1478","47","1082","4282","Europe/Istanbul","1307","46","058","1124","256","rate-overlimit","retail","u_a_socket_err_fix_succ_test","1292","1370","1388","520","861","psa","regular","1181","1766","05b","1183","1213","1304","1537"],["1724","profile_picture","1071","1314","1605","407","990","1710","746","pricing_model","056","059","061","1119","6027","65","877","1607","05d","917","seen","1516","49","470","973","1037","1350","1394","1480","1796","keys","794","1536","1594","2378","1333","1524","1825","116","309","52","808","827","909","495","1660","361","957","google","1357","1565","1967","996","1775","586","736","1052","1670","bank","177","1416","2194","2222","1454","1839","1275","53","997","1629","6028","smba","1378","1410","05c","1849","727","create","1559","536","1106","1310","1944","670","1297","1316","1762","en","1148","1295","1551","1853","1890","1208","1784","7200","05f","178","1283","1332","381","643","1056","1238","2024","2387","179","981","1547","1705","05e","290","903","1069","1285","2436","062","251","560","582","719","56","1700","2321","325","448","613","777","791","51","488","902","Asia/Almaty","is_hidden","1398","1527","1893","1999","2367","2642","237","busy","065","067","233","590","993","1511","54","723","860","363","487","522","605","995","1321","1691","1865","2447","2462","NON_TRANSACTIONAL","433","871","432","1004","1207","2032","2050","2379","2446","279","636","703","904","248","370","691","700","1068","1655","2334","060","063","364","533","534","567","1191","1210","1473","1827","069","701","2531","514","prev_dhash","064","496","790","1046","1139","1505","1521","1108","207","544","637","final","1173","1293","1694","1939","1951","1993","2353","2515","504","601","857","modify","spam_request","p_121_aa_1101_test4","866","1427","1502","1638","1744","2153","068","382","725","1704","1864","1990","2003","Asia/Dubai","508","531","1387","1474","1632","2307","2386","819","2014","066","387","1468","1706","2186","2261","471","728","1147","1372","1961"]],d$=["","xmlstreamstart","xmlstreamend","s.whatsapp.net","type","participant","from","receipt","id","notification","disappearing_mode","status","jid","broadcast","user","devices","device_hash","to","offline","message","result","class","xmlns","duration","notify","iq","t","ack","g.us","enc","urn:xmpp:whatsapp:push","presence","config_value","picture","verified_name","config_code","key-index-list","contact","mediatype","routing_info","edge_routing","get","read","urn:xmpp:ping","fallback_hostname","0","chatstate","business_hours_config","unavailable","download_buckets","skmsg","verified_level","composing","handshake","device-list","media","text","fallback_ip4","media_conn","device","creation","location","config","item","fallback_ip6","count","w:profile:picture","image","business","2","hostname","call-creator","display_name","relaylatency","platform","abprops","success","msg","offline_preview","prop","key-index","v","day_of_week","pkmsg","version","1","ping","w:p","download","video","set","specific_hours","props","primary","unknown","hash","commerce_experience","last","subscribe","max_buckets","call","profile","member_since_text","close_time","call-id","sticker","mode","participants","value","query","profile_options","open_time","code","list","host","ts","contacts","upload","lid","preview","update","usync","w:stats","delivery","auth_ttl","context","fail","cart_enabled","appdata","category","atn","direct_connection","decrypt-fail","relay_id","mmg-fallback.whatsapp.net","target","available","name","last_id","mmg.whatsapp.net","categories","401","is_new","index","tctoken","ip4","token_id","latency","recipient","edit","ip6","add","thumbnail-document","26","paused","true","identity","stream:error","key","sidelist","background","audio","3","thumbnail-image","biz-cover-photo","cat","gcm","thumbnail-video","error","auth","deny","serial","in","registration","thumbnail-link","remove","00","gif","thumbnail-gif","tag","capability","multicast","item-not-found","description","business_hours","config_expo_key","md-app-state","expiration","fallback","ttl","300","md-msg-hist","device_orientation","out","w:m","open_24h","side_list","token","inactive","01","document","te2","played","encrypt","msgr","hide","direct_path","12","state","not-authorized","url","terminate","signature","status-revoke-delay","02","te","linked_accounts","trusted_contact","timezone","ptt","kyc-id","privacy_token","readreceipts","appointment_only","address","expected_ts","privacy","7","android","interactive","device-identity","enabled","attribute_padding","1080","03","screen_height"],wL={};for(let[n,t]of d$.entries())wL[t]={index:n};for(let[n,t]of p$.entries())for(let[o,a]of t.entries())wL[a]={dict:n,index:o};var OA="@s.whatsapp.net";var h$="0@c.us";var Zt;(function(n){n[n.WHATSAPP=0]="WHATSAPP",n[n.LID=1]="LID",n[n.HOSTED=128]="HOSTED",n[n.HOSTED_LID=129]="HOSTED_LID"})(Zt||(Zt={}));var E$=(n,t)=>{switch(t){case Zt.LID:return"lid";case Zt.HOSTED:return"hosted";case Zt.HOSTED_LID:return"hosted.lid";case Zt.WHATSAPP:default:return n}},Dr=(n,t,o,a)=>`${n||""}${a?`_${a}`:""}${o?`:${o}`:""}@${t}`,pA=n=>{let t=typeof n=="string"?n.indexOf("@"):-1;if(t<0)return;let o=n.slice(t+1),a=n.slice(0,t),[e,i]=a.split(":"),[A,r]=e.split("_"),s=Zt.WHATSAPP;return o==="lid"?s=Zt.LID:o==="hosted"?s=Zt.HOSTED:o==="hosted.lid"?s=Zt.HOSTED_LID:r&&(s=parseInt(r)),{server:o,user:A,domainType:s,device:i?+i:void 0}},ft=(n,t)=>pA(n)?.user===pA(t)?.user,Mh=n=>n?.endsWith("@bot"),Rt=n=>n?.endsWith("@s.whatsapp.net"),qA=n=>n?.endsWith("@lid"),HB=n=>n?.endsWith("@broadcast"),qr=n=>n?.endsWith("@g.us"),zg=n=>n==="status@broadcast",aI=n=>n?.endsWith("@newsletter"),Or=n=>n?.endsWith("@hosted"),Ci=n=>n?.endsWith("@hosted.lid"),Qxe=/^1313555\d{4}$|^131655500\d{2}$/,u$=n=>n&&Qxe.test(n.split("@")[0])&&n.endsWith("@c.us"),BA=n=>{let t=pA(n);if(!t)return"";let{user:o,server:a}=t;return Dr(o,a==="c.us"?"s.whatsapp.net":a)},C$=(n,t)=>{let a=pA(n)?.device||0,{server:e,user:i}=pA(t);return Dr(i,e,a)};var B$=(n,t=UB,o=[0])=>{let a=f$(n,t,o);return Buffer.from(a)},f$=({tag:n,attrs:t,content:o},a,e)=>{let{TAGS:i,TOKEN_MAP:A}=a,r=F=>e.push(F&255),s=(F,q,z=!1)=>{for(let K=0;K>G*8&255)}},g=F=>{for(let q of F)e.push(q)},c=F=>{g([F>>8&255,F&255])},I=F=>g([F>>16&15,F>>8&255,F&255]),p=F=>{if(F>=4294967296)throw new Error("string too large to encode: "+F);F>=1<<20?(r(i.BINARY_32),s(F,4)):F>=256?(r(i.BINARY_20),I(F)):(r(i.BINARY_8),r(F))},B=F=>{let q=Buffer.from(F,"utf-8");p(q.length),g(q)},f=({domainType:F,device:q,user:z,server:K})=>{typeof q<"u"?(r(i.AD_JID),r(F||0),r(q||0),R(z)):(r(i.JID_PAIR),z.length?R(z):r(i.LIST_EMPTY),R(K))},Q=F=>{switch(F){case"-":return 10;case".":return 11;case"\0":return 15;default:if(F>="0"&&F<="9")return F.charCodeAt(0)-48;throw new Error(`invalid byte for nibble "${F}"`)}},y=F=>{if(F>="0"&&F<="9")return F.charCodeAt(0)-48;if(F>="A"&&F<="F")return 10+F.charCodeAt(0)-65;if(F>="a"&&F<="f")return 10+F.charCodeAt(0)-97;if(F==="\0")return 15;throw new Error(`Invalid hex char "${F}"`)},m=(F,q)=>{if(F.length>i.PACKED_MAX)throw new Error("Too many bytes to pack");r(q==="nibble"?i.NIBBLE_8:i.HEX_8);let z=Math.ceil(F.length/2);F.length%2!==0&&(z|=128),r(z);let K=q==="nibble"?Q:y,G=(H,N)=>K(H)<<4|K(N),V=Math.floor(F.length/2);for(let H=0;H{if(!F||F.length>i.PACKED_MAX)return!1;for(let q of F)if(!(q>="0"&&q<="9")&&q!=="-"&&q!==".")return!1;return!0},_=F=>{if(!F||F.length>i.PACKED_MAX)return!1;for(let q of F)if(!(q>="0"&&q<="9")&&!(q>="A"&&q<="F"))return!1;return!0},R=F=>{if(F==null){r(i.LIST_EMPTY);return}if(F===""){B(F);return}let q=A[F];if(q)typeof q.dict=="number"&&r(i.DICTIONARY_0+q.dict),r(q.index);else if(T(F))m(F,"nibble");else if(_(F))m(F,"hex");else{let z=pA(F);z?f(z):B(F)}},L=F=>{F===0?r(i.LIST_EMPTY):F<256?g([i.LIST_8,F]):(r(i.LIST_16),c(F))};if(!n)throw new Error("Invalid node: tag cannot be undefined");let U=Object.keys(t||{}).filter(F=>typeof t[F]<"u"&&t[F]!==null);L(2*U.length+1+(typeof o<"u"?1:0)),R(n);for(let F of U)typeof t[F]=="string"&&(R(F),R(t[F]));if(typeof o=="string")R(o);else if(Buffer.isBuffer(o)||o instanceof Uint8Array)p(o.length),g(o);else if(Array.isArray(o)){let F=o.filter(q=>q&&(q.tag||Buffer.isBuffer(q)||q instanceof Uint8Array||typeof q=="string"));L(F.length);for(let q of F)f$(q,a,e)}else if(!(typeof o>"u"))throw new Error(`invalid children for header "${n}": ${o} (${typeof o})`);return e};import{promisify as yxe}from"util";import{inflate as mxe}from"zlib";var Sxe=yxe(mxe),wxe=async n=>(2&n.readUInt8()?n=await Sxe(n.slice(1)):n=n.slice(1),n),Q$=(n,t,o={index:0})=>{let{DOUBLE_BYTE_TOKENS:a,SINGLE_BYTE_TOKENS:e,TAGS:i}=t,A=k=>{if(o.index+k>n.length)throw new Error("end of stream")},r=()=>{let k=n[o.index];return o.index+=1,k},s=()=>(A(1),r()),g=k=>{A(k);let J=n.slice(o.index,o.index+k);return o.index+=k,J},c=k=>g(k).toString("utf-8"),I=(k,J=!1)=>{A(k);let X=0;for(let ie=0;ie(A(3),((r()&15)<<16)+(r()<<8)+r()),B=k=>{if(k>=0&&k<16)return k<10?48+k:65+k-10;throw new Error("invalid hex: "+k)},f=k=>{if(k>=0&&k<=9)return 48+k;switch(k){case 10:return 45;case 11:return 46;case 15:return 0;default:throw new Error("invalid nibble: "+k)}},Q=(k,J)=>{if(k===i.NIBBLE_8)return f(J);if(k===i.HEX_8)return B(J);throw new Error("unknown tag: "+k)},y=k=>{let J=s(),X="";for(let ie=0;ie<(J&127);ie++){let De=s();X+=String.fromCharCode(Q(k,(De&240)>>4)),X+=String.fromCharCode(Q(k,De&15))}return J>>7!==0&&(X=X.slice(0,-1)),X},m=k=>k===i.LIST_EMPTY||k===i.LIST_8||k===i.LIST_16,T=k=>{switch(k){case i.LIST_EMPTY:return 0;case i.LIST_8:return s();case i.LIST_16:return I(2);default:throw new Error("invalid tag for list size: "+k)}},_=()=>{let k=F(s()),J=F(s());if(J)return(k||"")+"@"+J;throw new Error("invalid jid pair: "+k+", "+J)},R=()=>{let k=s(),J=Number(k),X=s(),ie=F(s()),De="s.whatsapp.net";return J===Zt.LID?De="lid":J===Zt.HOSTED?De="hosted":J===Zt.HOSTED_LID&&(De="hosted.lid"),Dr(ie,De,X)},L=()=>{let k=F(s()),J=I(2),X=F(s());return`${k}:${J}@${X}`},U=()=>{let k=F(s()),J=I(2),X=I(2),ie="interop",De=o.index;try{ie=F(s())}catch{o.index=De}return`${X}-${k}:${J}@${ie}`},F=k=>{if(k>=1&&k{let J=[],X=T(k);for(let ie=0;ie{let X=a[k];if(!X)throw new Error(`Invalid double token dict (${k})`);let ie=X[J];if(typeof ie>"u")throw new Error(`Invalid double token (${J})`);return ie},K=T(s()),G=F(s());if(!K||!G.length)throw new Error("invalid node");let V={},H;if(K===0||!G)throw new Error("invalid node");let N=K-1>>1;for(let k=0;k{let t=await wxe(n);return Q$(t,UB)};var S$=ze(Jr(),1);var m$=new WeakMap,PA=(n,t)=>{if(!n||!Array.isArray(n.content))return[];let o=m$.get(n);if(!o){o=new Map;for(let a of n.content){let e=o.get(a.tag);e||o.set(a.tag,e=[]),e.push(a)}m$.set(n,o)}return o.get(t)||[]},le=(n,t)=>PA(n,t)[0],Gs=({content:n})=>Array.isArray(n)?n:[],ki=(n,t)=>{let o=le(n,t)?.content;if(Buffer.isBuffer(o)||o instanceof Uint8Array)return o},jA=(n,t)=>{let o=le(n,t)?.content;if(Buffer.isBuffer(o)||o instanceof Uint8Array)return Buffer.from(o).toString("utf-8");if(typeof o=="string")return o},oI=(n,t,o)=>{let a=ki(n,t);if(a)return Dxe(a,o)},Za=n=>{let t=le(n,"error");if(t)throw new S$.Boom(t.attrs.text||"Unknown error",{data:+t.attrs.code})},DL=(n,t)=>PA(n,t).reduce((e,{attrs:i})=>(typeof i.name=="string"?e[i.name]=i.value||i.config_value:e[i.config_code]=i.value||i.config_value,e),{});function Dxe(n,t){let o=0;for(let a=0;a" ".repeat(n);function Jn(n,t=0){if(!n)return n;if(typeof n=="string")return ND(t)+n;if(n instanceof Uint8Array)return ND(t)+Buffer.from(n).toString("hex");if(Array.isArray(n))return n.map(i=>ND(t+1)+Jn(i,t+1)).join(` `);let o=Jn(n.content,t+1),a=`<${n.tag} ${Object.entries(n.attrs||{}).filter(([,i])=>i!==void 0).map(([i,A])=>`${i}='${A}'`).join(" ")}`,e=o?`> ${o} ${ND(t)}`:"/>";return a+e}var gI=ze(Xc(),1);import{createCipheriv as NL,createDecipheriv as RL,createHash as Hxe,createHmac as Kxe,randomBytes as xxe}from"crypto";var JB=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,w$.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,w$.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_expandedappstatekeys_free(t,0)}get indexKey(){let t=ae.expandedappstatekeys_indexKey(this.__wbg_ptr);return mA(t)}get patchMacKey(){let t=ae.expandedappstatekeys_patchMacKey(this.__wbg_ptr);return mA(t)}get snapshotMacKey(){let t=ae.expandedappstatekeys_snapshotMacKey(this.__wbg_ptr);return mA(t)}get valueEncryptionKey(){let t=ae.expandedappstatekeys_valueEncryptionKey(this.__wbg_ptr);return mA(t)}get valueMacKey(){let t=ae.expandedappstatekeys_valueMacKey(this.__wbg_ptr);return mA(t)}};Symbol.dispose&&(JB.prototype[Symbol.dispose]=JB.prototype.free);var kD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,D$.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_groupcipher_free(t,0)}decrypt(t){let o=Pt(t,ae.__wbindgen_export),a=KA,e=ae.groupcipher_decrypt(this.__wbg_ptr,o,a);return mA(e)}encrypt(t){let o=Pt(t,ae.__wbindgen_export),a=KA,e=ae.groupcipher_encrypt(this.__wbg_ptr,o,a);return mA(e)}constructor(t,o,a){let e=zn(o,ae.__wbindgen_export,ae.__wbindgen_export2),i=KA;nI(a,sI);let A=ae.groupcipher_new(iA(t),e,i,a.__wbg_ptr);return this.__wbg_ptr=A>>>0,D$.register(this,this.__wbg_ptr,this),this}};Symbol.dispose&&(kD.prototype[Symbol.dispose]=kD.prototype.free);var vD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,O$.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_groupsessionbuilder_free(t,0)}create(t){nI(t,Rh);let o=ae.groupsessionbuilder_create(this.__wbg_ptr,t.__wbg_ptr);return mA(o)}constructor(t){let o=ae.groupsessionbuilder_new(iA(t));return this.__wbg_ptr=o>>>0,O$.register(this,this.__wbg_ptr,this),this}process(t,o){nI(t,Rh),nI(o,Nh);let a=ae.groupsessionbuilder_process(this.__wbg_ptr,t.__wbg_ptr,o.__wbg_ptr);return mA(a)}};Symbol.dispose&&(vD.prototype[Symbol.dispose]=vD.prototype.free);var qB=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,b$.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,b$.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_internalbinarynode_free(t,0)}get attrs(){let t=ae.internalbinarynode_attrs(this.__wbg_ptr);return mA(t)}get content(){let t=ae.internalbinarynode_content(this.__wbg_ptr);return mA(t)}set attrs(t){ae.internalbinarynode_set_attrs(this.__wbg_ptr,iA(t))}set content(t){ae.internalbinarynode_set_content(this.__wbg_ptr,iA(t))}get tag(){let t,o;try{let i=ae.__wbindgen_add_to_stack_pointer(-16);ae.internalbinarynode_tag(i,this.__wbg_ptr);var a=eA().getInt32(i+0,!0),e=eA().getInt32(i+4,!0);return t=a,o=e,vr(a,e)}finally{ae.__wbindgen_add_to_stack_pointer(16),ae.__wbindgen_export4(t,o,1)}}toJSON(){let t=ae.internalbinarynode_toJSON(this.__wbg_ptr);return mA(t)}};Symbol.dispose&&(qB.prototype[Symbol.dispose]=qB.prototype.free);var Th=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,M$.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_lthashantitampering_free(t,0)}constructor(){let t=ae.lthashantitampering_new();return this.__wbg_ptr=t>>>0,M$.register(this,this.__wbg_ptr,this),this}subtractThenAdd(t,o,a){try{let r=ae.__wbindgen_add_to_stack_pointer(-16),s=Pt(t,ae.__wbindgen_export),g=KA,c=G$(o,ae.__wbindgen_export),I=KA,p=G$(a,ae.__wbindgen_export),B=KA;ae.lthashantitampering_subtractThenAdd(r,this.__wbg_ptr,s,g,c,I,p,B);var e=eA().getInt32(r+0,!0),i=eA().getInt32(r+4,!0),A=eA().getInt32(r+8,!0);if(A)throw mA(i);return mA(e)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(Th.prototype[Symbol.dispose]=Th.prototype.free);var PD=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,OL.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,OL.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_lthashstate_free(t,0)}clone(){let t=ae.lthashstate_clone(this.__wbg_ptr);return n.__wrap(t)}deleteValueMac(t){let o=zn(t,ae.__wbindgen_export,ae.__wbindgen_export2),a=KA;return ae.lthashstate_deleteValueMac(this.__wbg_ptr,o,a)!==0}getValueMac(t){let o=zn(t,ae.__wbindgen_export,ae.__wbindgen_export2),a=KA,e=ae.lthashstate_getValueMac(this.__wbg_ptr,o,a);return mA(e)}hasValueMac(t){let o=zn(t,ae.__wbindgen_export,ae.__wbindgen_export2),a=KA;return ae.lthashstate_hasValueMac(this.__wbg_ptr,o,a)!==0}get hash(){let t=ae.lthashstate_hash(this.__wbg_ptr);return mA(t)}constructor(){let t=ae.lthashstate_new();return this.__wbg_ptr=t>>>0,OL.register(this,this.__wbg_ptr,this),this}setValueMac(t,o){let a=zn(t,ae.__wbindgen_export,ae.__wbindgen_export2),e=KA,i=Pt(o,ae.__wbindgen_export),A=KA;ae.lthashstate_setValueMac(this.__wbg_ptr,a,e,i,A)}set hash(t){let o=Pt(t,ae.__wbindgen_export),a=KA;ae.lthashstate_set_hash(this.__wbg_ptr,o,a)}set version(t){ae.lthashstate_set_version(this.__wbg_ptr,t)}get version(){let t=ae.lthashstate_version(this.__wbg_ptr);return BigInt.asUintN(64,t)}};Symbol.dispose&&(PD.prototype[Symbol.dispose]=PD.prototype.free);var GD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,_$.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_noisesession_free(t,0)}authenticate(t){let o=Pt(t,ae.__wbindgen_export),a=KA;ae.noisesession_authenticate(this.__wbg_ptr,o,a)}get bufferedBytes(){return ae.noisesession_bufferedBytes(this.__wbg_ptr)>>>0}clearBuffer(){ae.noisesession_clearBuffer(this.__wbg_ptr)}decodeFrame(t){try{let i=ae.__wbindgen_add_to_stack_pointer(-16),A=Pt(t,ae.__wbindgen_export),r=KA;ae.noisesession_decodeFrame(i,this.__wbg_ptr,A,r);var o=eA().getInt32(i+0,!0),a=eA().getInt32(i+4,!0),e=eA().getInt32(i+8,!0);if(e)throw mA(a);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}decrypt(t){try{let i=ae.__wbindgen_add_to_stack_pointer(-16),A=Pt(t,ae.__wbindgen_export),r=KA;ae.noisesession_decrypt(i,this.__wbg_ptr,A,r);var o=eA().getInt32(i+0,!0),a=eA().getInt32(i+4,!0),e=eA().getInt32(i+8,!0);if(e)throw mA(a);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}encodeFrame(t){try{let i=ae.__wbindgen_add_to_stack_pointer(-16);ae.noisesession_encodeFrame(i,this.__wbg_ptr,iA(t));var o=eA().getInt32(i+0,!0),a=eA().getInt32(i+4,!0),e=eA().getInt32(i+8,!0);if(e)throw mA(a);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}encodeFrameRaw(t){try{let i=ae.__wbindgen_add_to_stack_pointer(-16),A=Pt(t,ae.__wbindgen_export),r=KA;ae.noisesession_encodeFrameRaw(i,this.__wbg_ptr,A,r);var o=eA().getInt32(i+0,!0),a=eA().getInt32(i+4,!0),e=eA().getInt32(i+8,!0);if(e)throw mA(a);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}encrypt(t){try{let i=ae.__wbindgen_add_to_stack_pointer(-16),A=Pt(t,ae.__wbindgen_export),r=KA;ae.noisesession_encrypt(i,this.__wbg_ptr,A,r);var o=eA().getInt32(i+0,!0),a=eA().getInt32(i+4,!0),e=eA().getInt32(i+8,!0);if(e)throw mA(a);return mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}finishInit(){try{let a=ae.__wbindgen_add_to_stack_pointer(-16);ae.noisesession_finishInit(a,this.__wbg_ptr);var t=eA().getInt32(a+0,!0),o=eA().getInt32(a+4,!0);if(o)throw mA(t)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}getHash(){let t=ae.noisesession_getHash(this.__wbg_ptr);return mA(t)}get isFinished(){return ae.noisesession_isFinished(this.__wbg_ptr)!==0}mixIntoKey(t){try{let e=ae.__wbindgen_add_to_stack_pointer(-16),i=Pt(t,ae.__wbindgen_export),A=KA;ae.noisesession_mixIntoKey(e,this.__wbg_ptr,i,A);var o=eA().getInt32(e+0,!0),a=eA().getInt32(e+4,!0);if(a)throw mA(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}constructor(t,o,a){try{let g=ae.__wbindgen_add_to_stack_pointer(-16),c=Pt(t,ae.__wbindgen_export),I=KA,p=Pt(o,ae.__wbindgen_export),B=KA;var e=qn(a)?0:Pt(a,ae.__wbindgen_export),i=KA;ae.noisesession_new(g,c,I,p,B,e,i);var A=eA().getInt32(g+0,!0),r=eA().getInt32(g+4,!0),s=eA().getInt32(g+8,!0);if(s)throw mA(r);return this.__wbg_ptr=A>>>0,_$.register(this,this.__wbg_ptr,this),this}finally{ae.__wbindgen_add_to_stack_pointer(16)}}processHandshakeFinish(t,o,a){try{let r=ae.__wbindgen_add_to_stack_pointer(-16),s=Pt(t,ae.__wbindgen_export),g=KA,c=Pt(o,ae.__wbindgen_export),I=KA,p=Pt(a,ae.__wbindgen_export),B=KA;ae.noisesession_processHandshakeFinish(r,this.__wbg_ptr,s,g,c,I,p,B);var e=eA().getInt32(r+0,!0),i=eA().getInt32(r+4,!0),A=eA().getInt32(r+8,!0);if(A)throw mA(i);return mA(e)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}processHandshakeInit(t,o,a,e){try{let s=ae.__wbindgen_add_to_stack_pointer(-16),g=Pt(t,ae.__wbindgen_export),c=KA,I=Pt(o,ae.__wbindgen_export),p=KA,B=Pt(a,ae.__wbindgen_export),f=KA,Q=Pt(e,ae.__wbindgen_export),y=KA;ae.noisesession_processHandshakeInit(s,this.__wbg_ptr,g,c,I,p,B,f,Q,y);var i=eA().getInt32(s+0,!0),A=eA().getInt32(s+4,!0),r=eA().getInt32(s+8,!0);if(r)throw mA(A);return mA(i)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(GD.prototype[Symbol.dispose]=GD.prototype.free);var sI=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,bL.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,bL.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_protocoladdress_free(t,0)}get deviceId(){return ae.protocoladdress_deviceId(this.__wbg_ptr)>>>0}static from(t){try{let i=ae.__wbindgen_add_to_stack_pointer(-16);ae.protocoladdress_from(i,iA(t));var o=eA().getInt32(i+0,!0),a=eA().getInt32(i+4,!0),e=eA().getInt32(i+8,!0);if(e)throw mA(a);return n.__wrap(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}get id(){let t,o;try{let i=ae.__wbindgen_add_to_stack_pointer(-16);ae.protocoladdress_id(i,this.__wbg_ptr);var a=eA().getInt32(i+0,!0),e=eA().getInt32(i+4,!0);return t=a,o=e,vr(a,e)}finally{ae.__wbindgen_add_to_stack_pointer(16),ae.__wbindgen_export4(t,o,1)}}is(t){return nI(t,n),ae.protocoladdress_is(this.__wbg_ptr,t.__wbg_ptr)!==0}constructor(t,o){try{let A=ae.__wbindgen_add_to_stack_pointer(-16);ae.protocoladdress_new(A,iA(t),iA(o));var a=eA().getInt32(A+0,!0),e=eA().getInt32(A+4,!0),i=eA().getInt32(A+8,!0);if(i)throw mA(e);return this.__wbg_ptr=a>>>0,bL.register(this,this.__wbg_ptr,this),this}finally{ae.__wbindgen_add_to_stack_pointer(16)}}toString(){let t,o;try{let i=ae.__wbindgen_add_to_stack_pointer(-16);ae.protocoladdress_toString(i,this.__wbg_ptr);var a=eA().getInt32(i+0,!0),e=eA().getInt32(i+4,!0);return t=a,o=e,vr(a,e)}finally{ae.__wbindgen_add_to_stack_pointer(16),ae.__wbindgen_export4(t,o,1)}}};Symbol.dispose&&(sI.prototype[Symbol.dispose]=sI.prototype.free);var Nh=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,T$.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,T$.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_senderkeydistributionmessage_free(t,0)}static deserialize(t){try{let i=ae.__wbindgen_add_to_stack_pointer(-16),A=Pt(t,ae.__wbindgen_export),r=KA;ae.senderkeydistributionmessage_deserialize(i,A,r);var o=eA().getInt32(i+0,!0),a=eA().getInt32(i+4,!0),e=eA().getInt32(i+8,!0);if(e)throw mA(a);return n.__wrap(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}serialize(){let t=ae.senderkeydistributionmessage_serialize(this.__wbg_ptr);return mA(t)}};Symbol.dispose&&(Nh.prototype[Symbol.dispose]=Nh.prototype.free);var Rh=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,N$.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_senderkeyname_free(t,0)}constructor(t,o){let a=zn(t,ae.__wbindgen_export,ae.__wbindgen_export2),e=KA;nI(o,sI);let i=ae.senderkeyname_new(a,e,o.__wbg_ptr);return this.__wbg_ptr=i>>>0,N$.register(this,this.__wbg_ptr,this),this}toString(){let t,o;try{let i=ae.__wbindgen_add_to_stack_pointer(-16);ae.senderkeyname_toString(i,this.__wbg_ptr);var a=eA().getInt32(i+0,!0),e=eA().getInt32(i+4,!0);return t=a,o=e,vr(a,e)}finally{ae.__wbindgen_add_to_stack_pointer(16),ae.__wbindgen_export4(t,o,1)}}};Symbol.dispose&&(Rh.prototype[Symbol.dispose]=Rh.prototype.free);var FD=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,ML.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,ML.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_senderkeyrecord_free(t,0)}static deserialize(t){try{let i=ae.__wbindgen_add_to_stack_pointer(-16),A=Pt(t,ae.__wbindgen_export),r=KA;ae.senderkeyrecord_deserialize(i,A,r);var o=eA().getInt32(i+0,!0),a=eA().getInt32(i+4,!0),e=eA().getInt32(i+8,!0);if(e)throw mA(a);return n.__wrap(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}isEmpty(){return ae.senderkeyrecord_isEmpty(this.__wbg_ptr)!==0}constructor(){let t=ae.senderkeyrecord_new();return this.__wbg_ptr=t>>>0,ML.register(this,this.__wbg_ptr,this),this}serialize(){try{let e=ae.__wbindgen_add_to_stack_pointer(-16);ae.senderkeyrecord_serialize(e,this.__wbg_ptr);var t=eA().getInt32(e+0,!0),o=eA().getInt32(e+4,!0),a=eA().getInt32(e+8,!0);if(a)throw mA(o);return mA(t)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(FD.prototype[Symbol.dispose]=FD.prototype.free);var LD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,R$.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_sessionbuilder_free(t,0)}initOutgoing(t){let o=ae.sessionbuilder_initOutgoing(this.__wbg_ptr,iA(t));return mA(o)}constructor(t,o){nI(o,sI);let a=ae.sessionbuilder_new(iA(t),o.__wbg_ptr);return this.__wbg_ptr=a>>>0,R$.register(this,this.__wbg_ptr,this),this}processPreKeyBundle(t){let o=ae.sessionbuilder_processPreKeyBundle(this.__wbg_ptr,iA(t));return mA(o)}};Symbol.dispose&&(LD.prototype[Symbol.dispose]=LD.prototype.free);var UD=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,k$.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_sessioncipher_free(t,0)}decryptPreKeyWhisperMessage(t){let o=Pt(t,ae.__wbindgen_export),a=KA,e=ae.sessioncipher_decryptPreKeyWhisperMessage(this.__wbg_ptr,o,a);return mA(e)}decryptWhisperMessage(t){let o=Pt(t,ae.__wbindgen_export),a=KA,e=ae.sessioncipher_decryptWhisperMessage(this.__wbg_ptr,o,a);return mA(e)}encrypt(t){let o=Pt(t,ae.__wbindgen_export),a=KA,e=ae.sessioncipher_encrypt(this.__wbg_ptr,o,a);return mA(e)}hasOpenSession(){let t=ae.sessioncipher_hasOpenSession(this.__wbg_ptr);return mA(t)}constructor(t,o){nI(o,sI);let a=ae.sessioncipher_new(iA(t),o.__wbg_ptr);return this.__wbg_ptr=a>>>0,k$.register(this,this.__wbg_ptr,this),this}};Symbol.dispose&&(UD.prototype[Symbol.dispose]=UD.prototype.free);var zB=class n{static __wrap(t){t=t>>>0;let o=Object.create(n.prototype);return o.__wbg_ptr=t,v$.register(o,o.__wbg_ptr,o),o}__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,v$.unregister(this),t}free(){let t=this.__destroy_into_raw();ae.__wbg_sessionrecord_free(t,0)}static deserialize(t){try{let i=ae.__wbindgen_add_to_stack_pointer(-16);ae.sessionrecord_deserialize(i,iA(t));var o=eA().getInt32(i+0,!0),a=eA().getInt32(i+4,!0),e=eA().getInt32(i+8,!0);if(e)throw mA(a);return n.__wrap(o)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}haveOpenSession(){return ae.sessionrecord_haveOpenSession(this.__wbg_ptr)!==0}serialize(){let t=ae.sessionrecord_serialize(this.__wbg_ptr);return mA(t)}};Symbol.dispose&&(zB.prototype[Symbol.dispose]=zB.prototype.free);function F$(n){let t=Pt(n,ae.__wbindgen_export),o=KA,a=ae.expandAppStateKeys(t,o);return JB.__wrap(a)}function Vn(n,t,o){try{let A=ae.__wbindgen_add_to_stack_pointer(-16),r=Pt(n,ae.__wbindgen_export),s=KA;ae.hkdf(A,r,s,t,iA(o));var a=eA().getInt32(A+0,!0),e=eA().getInt32(A+4,!0),i=eA().getInt32(A+8,!0);if(i)throw mA(e);return mA(a)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}function Oxe(){return{__proto__:null,"./whatsapp_rust_bridge_bg.js":{__proto__:null,__wbg_Error_83742b46f01ce22d:function(t,o){let a=Error(vr(t,o));return iA(a)},__wbg_Number_a5a435bd7bbec835:function(t){return Number(Fe(t))},__wbg_String_8564e559799eccda:function(t,o){let a=String(Fe(o)),e=zn(a,ae.__wbindgen_export,ae.__wbindgen_export2),i=KA;eA().setInt32(t+4,i,!0),eA().setInt32(t+0,e,!0)},__wbg___wbindgen_bigint_get_as_i64_447a76b5c6ef7bda:function(t,o){let a=Fe(o),e=typeof a=="bigint"?a:void 0;eA().setBigInt64(t+8,qn(e)?BigInt(0):e,!0),eA().setInt32(t+0,!qn(e),!0)},__wbg___wbindgen_boolean_get_c0f3f60bac5a78d1:function(t){let o=Fe(t),a=typeof o=="boolean"?o:void 0;return qn(a)?16777215:a?1:0},__wbg___wbindgen_debug_string_5398f5bb970e0daa:function(t,o){let a=TL(Fe(o)),e=zn(a,ae.__wbindgen_export,ae.__wbindgen_export2),i=KA;eA().setInt32(t+4,i,!0),eA().setInt32(t+0,e,!0)},__wbg___wbindgen_in_41dbb8413020e076:function(t,o){return Fe(t)in Fe(o)},__wbg___wbindgen_is_bigint_e2141d4f045b7eda:function(t){return typeof Fe(t)=="bigint"},__wbg___wbindgen_is_function_3c846841762788c1:function(t){return typeof Fe(t)=="function"},__wbg___wbindgen_is_null_0b605fc6b167c56f:function(t){return Fe(t)===null},__wbg___wbindgen_is_object_781bc9f159099513:function(t){let o=Fe(t);return typeof o=="object"&&o!==null},__wbg___wbindgen_is_undefined_52709e72fb9f179c:function(t){return Fe(t)===void 0},__wbg___wbindgen_jsval_eq_ee31bfad3e536463:function(t,o){return Fe(t)===Fe(o)},__wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b:function(t,o){return Fe(t)==Fe(o)},__wbg___wbindgen_number_get_34bb9d9dcfa21373:function(t,o){let a=Fe(o),e=typeof a=="number"?a:void 0;eA().setFloat64(t+8,qn(e)?0:e,!0),eA().setInt32(t+0,!qn(e),!0)},__wbg___wbindgen_string_get_395e606bd0ee4427:function(t,o){let a=Fe(o),e=typeof a=="string"?a:void 0;var i=qn(e)?0:zn(e,ae.__wbindgen_export,ae.__wbindgen_export2),A=KA;eA().setInt32(t+4,A,!0),eA().setInt32(t+0,i,!0)},__wbg___wbindgen_throw_6ddd609b62940d55:function(t,o){throw new Error(vr(t,o))},__wbg__wbg_cb_unref_6b5b6b8576d35cb1:function(t){Fe(t)._wbg_cb_unref()},__wbg_attrs_eb268b5ce109b817:function(t){let o=Fe(t).attrs;return iA(o)},__wbg_call_2d781c1f4d5c0ef8:function(){return kr(function(t,o,a){let e=Fe(t).call(Fe(o),Fe(a));return iA(e)},arguments)},__wbg_call_e133b57c9155d22c:function(){return kr(function(t,o){let a=Fe(t).call(Fe(o));return iA(a)},arguments)},__wbg_content_54fb4ecf37d1b68a:function(t){let o=Fe(t).content;return iA(o)},__wbg_debug_10ca7029b12f8d85:function(t,o,a,e){Fe(t).debug(Fe(o),a===0?void 0:vr(a,e))},__wbg_done_08ce71ee07e3bd17:function(t){return Fe(t).done},__wbg_entries_e8a20ff8c9757101:function(t){let o=Object.entries(Fe(t));return iA(o)},__wbg_error_9cce413345f88385:function(t,o,a,e){Fe(t).error(Fe(o),a===0?void 0:vr(a,e))},__wbg_from_4bdf88943703fd48:function(t){let o=Array.from(Fe(t));return iA(o)},__wbg_getOurIdentity_85a51d9b5b46c006:function(){return kr(function(t){let o=Fe(t).getOurIdentity();return iA(o)},arguments)},__wbg_getOurRegistrationId_6d41d022f3c2af8a:function(){return kr(function(t){let o=Fe(t).getOurRegistrationId();return iA(o)},arguments)},__wbg_getRandomValues_3f44b700395062e5:function(){return kr(function(t,o){globalThis.crypto.getRandomValues(KB(t,o))},arguments)},__wbg_get_326e41e095fb2575:function(){return kr(function(t,o){let a=Reflect.get(Fe(t),Fe(o));return iA(a)},arguments)},__wbg_get_3ef1eba1850ade27:function(){return kr(function(t,o){let a=Reflect.get(Fe(t),Fe(o));return iA(a)},arguments)},__wbg_get_a8ee5c45dabc1b3b:function(t,o){let a=Fe(t)[o>>>0];return iA(a)},__wbg_get_unchecked_329cfe50afab7352:function(t,o){let a=Fe(t)[o>>>0];return iA(a)},__wbg_get_with_ref_key_6412cf3094599694:function(t,o){let a=Fe(t)[Fe(o)];return iA(a)},__wbg_has_926ef2ff40b308cf:function(){return kr(function(t,o){return Reflect.has(Fe(t),Fe(o))},arguments)},__wbg_info_b728e87a346ff6a2:function(t,o,a,e){Fe(t).info(Fe(o),a===0?void 0:vr(a,e))},__wbg_instanceof_ArrayBuffer_101e2bf31071a9f6:function(t){let o;try{o=Fe(t)instanceof ArrayBuffer}catch{o=!1}return o},__wbg_instanceof_Map_f194b366846aca0c:function(t){let o;try{o=Fe(t)instanceof Map}catch{o=!1}return o},__wbg_instanceof_Object_be1962063fcc0c9f:function(t){let o;try{o=Fe(t)instanceof Object}catch{o=!1}return o},__wbg_instanceof_Promise_7c3bdd7805c2c6e6:function(t){let o;try{o=Fe(t)instanceof Promise}catch{o=!1}return o},__wbg_instanceof_Uint8Array_740438561a5b956d:function(t){let o;try{o=Fe(t)instanceof Uint8Array}catch{o=!1}return o},__wbg_internalbinarynode_new:function(t){let o=qB.__wrap(t);return iA(o)},__wbg_isArray_33b91feb269ff46e:function(t){return Array.isArray(Fe(t))},__wbg_isSafeInteger_ecd6a7f9c3e053cd:function(t){return Number.isSafeInteger(Fe(t))},__wbg_isTrustedIdentity_8beedd37958ed6af:function(){return kr(function(t,o,a,e,i){let A=Fe(t).isTrustedIdentity(vr(o,a),Fe(e),i>>>0);return iA(A)},arguments)},__wbg_iterator_d8f549ec8fb061b1:function(){return iA(Symbol.iterator)},__wbg_keys_ab0d051a1c55236d:function(t){let o=Object.keys(Fe(t));return iA(o)},__wbg_length_b3416cf66a5452c8:function(t){return Fe(t).length},__wbg_length_ea16607d7b61445b:function(t){return Fe(t).length},__wbg_level_4b50b181832c5acf:function(t,o){let a=Fe(o).level,e=zn(a,ae.__wbindgen_export,ae.__wbindgen_export2),i=KA;eA().setInt32(t+4,i,!0),eA().setInt32(t+0,e,!0)},__wbg_loadPreKey_db3458e3339f7328:function(){return kr(function(t,o){let a=Fe(t).loadPreKey(o>>>0);return iA(a)},arguments)},__wbg_loadSenderKey_fd075b57283fd71b:function(){return kr(function(t,o,a){let e=Fe(t).loadSenderKey(vr(o,a));return iA(e)},arguments)},__wbg_loadSession_8564b20b09724f27:function(){return kr(function(t,o,a){let e=Fe(t).loadSession(vr(o,a));return iA(e)},arguments)},__wbg_loadSignedPreKey_3d5c6c6819f3adf3:function(){return kr(function(t,o){let a=Fe(t).loadSignedPreKey(o>>>0);return iA(a)},arguments)},__wbg_new_5f486cdf45a04d78:function(t){let o=new Uint8Array(Fe(t));return iA(o)},__wbg_new_7dce085c132c6f91:function(t,o){let a=new TypeError(vr(t,o));return iA(a)},__wbg_new_a70fbab9066b301f:function(){let t=new Array;return iA(t)},__wbg_new_ab79df5bd7c26067:function(){let t=new Object;return iA(t)},__wbg_new_from_slice_22da9388ac046e50:function(t,o){let a=new Uint8Array(KB(t,o));return iA(a)},__wbg_new_typed_aaaeaf29cf802876:function(t,o){try{var a={a:t,b:o},e=(A,r)=>{let s=a.a;a.a=0;try{return Mxe(s,a.b,A,r)}finally{a.a=s}};let i=new Promise(e);return iA(i)}finally{a.a=a.b=0}},__wbg_new_with_length_3259a525196bd8cc:function(t){let o=new Array(t>>>0);return iA(o)},__wbg_new_with_length_825018a1616e9e55:function(t){let o=new Uint8Array(t>>>0);return iA(o)},__wbg_next_11b99ee6237339e3:function(){return kr(function(t){let o=Fe(t).next();return iA(o)},arguments)},__wbg_next_e01a967809d1aa68:function(t){let o=Fe(t).next;return iA(o)},__wbg_parse_e9eddd2a82c706eb:function(){return kr(function(t,o){let a=JSON.parse(vr(t,o));return iA(a)},arguments)},__wbg_prototypesetcall_d62e5099504357e6:function(t,o,a){Uint8Array.prototype.set.call(KB(t,o),Fe(a))},__wbg_push_e87b0e732085a946:function(t,o){return Fe(t).push(Fe(o))},__wbg_queueMicrotask_0c399741342fb10f:function(t){let o=Fe(t).queueMicrotask;return iA(o)},__wbg_queueMicrotask_a082d78ce798393e:function(t){queueMicrotask(Fe(t))},__wbg_removePreKey_c0b0a066eb6f2e1e:function(){return kr(function(t,o){let a=Fe(t).removePreKey(o>>>0);return iA(a)},arguments)},__wbg_resolve_ae8d83246e5bcc12:function(t){let o=Promise.resolve(Fe(t));return iA(o)},__wbg_senderkeydistributionmessage_new:function(t){let o=Nh.__wrap(t);return iA(o)},__wbg_sessionrecord_new:function(t){let o=zB.__wrap(t);return iA(o)},__wbg_set_282384002438957f:function(t,o,a){Fe(t)[o>>>0]=mA(a)},__wbg_set_6be42768c690e380:function(t,o,a){Fe(t)[mA(o)]=mA(a)},__wbg_set_7eaa4f96924fd6b3:function(){return kr(function(t,o,a){return Reflect.set(Fe(t),Fe(o),Fe(a))},arguments)},__wbg_set_8c0b3ffcf05d61c2:function(t,o,a){Fe(t).set(KB(o,a))},__wbg_static_accessor_GLOBAL_8adb955bd33fac2f:function(){let t=typeof global>"u"?null:global;return qn(t)?0:iA(t)},__wbg_static_accessor_GLOBAL_THIS_ad356e0db91c7913:function(){let t=typeof globalThis>"u"?null:globalThis;return qn(t)?0:iA(t)},__wbg_static_accessor_SELF_f207c857566db248:function(){let t=typeof self>"u"?null:self;return qn(t)?0:iA(t)},__wbg_static_accessor_WINDOW_bb9f1ba69d61b386:function(){let t=typeof window>"u"?null:window;return qn(t)?0:iA(t)},__wbg_storeSenderKey_8a6c9ec5f7e1cd2e:function(){return kr(function(t,o,a,e){let i=Fe(t).storeSenderKey(vr(o,a),Fe(e));return iA(i)},arguments)},__wbg_storeSessionRaw_09b5cc73064d12d8:function(){return kr(function(t,o,a,e){let i=Fe(t).storeSessionRaw(vr(o,a),Fe(e));return iA(i)},arguments)},__wbg_storeSession_4d419555ce654965:function(){return kr(function(t,o,a,e){let i=Fe(t).storeSession(vr(o,a),mA(e));return iA(i)},arguments)},__wbg_tag_33cfe8e9ee66b4db:function(t,o){let a=Fe(o).tag,e=zn(a,ae.__wbindgen_export,ae.__wbindgen_export2),i=KA;eA().setInt32(t+4,i,!0),eA().setInt32(t+0,e,!0)},__wbg_then_098abe61755d12f6:function(t,o){let a=Fe(t).then(Fe(o));return iA(a)},__wbg_then_9e335f6dd892bc11:function(t,o,a){let e=Fe(t).then(Fe(o),Fe(a));return iA(e)},__wbg_trace_58264fbce2ceb5e6:function(t,o,a,e){Fe(t).trace(Fe(o),a===0?void 0:vr(a,e))},__wbg_value_21fc78aab0322612:function(t){let o=Fe(t).value;return iA(o)},__wbg_warn_db531770752932a9:function(t,o,a,e){Fe(t).warn(Fe(o),a===0?void 0:vr(a,e))},__wbindgen_cast_0000000000000001:function(t,o){let a=Txe(t,o,ae.__wasm_bindgen_func_elem_694,bxe);return iA(a)},__wbindgen_cast_0000000000000002:function(t){return iA(t)},__wbindgen_cast_0000000000000003:function(t){return iA(t)},__wbindgen_cast_0000000000000004:function(t,o){let a=KB(t,o);return iA(a)},__wbindgen_cast_0000000000000005:function(t,o){let a=vr(t,o);return iA(a)},__wbindgen_cast_0000000000000006:function(t){let o=BigInt.asUintN(64,t);return iA(o)},__wbindgen_object_clone_ref:function(t){let o=Fe(t);return iA(o)},__wbindgen_object_drop_ref:function(t){mA(t)}}}}function bxe(n,t,o){try{let i=ae.__wbindgen_add_to_stack_pointer(-16);ae.__wasm_bindgen_func_elem_699(i,n,t,iA(o));var a=eA().getInt32(i+0,!0),e=eA().getInt32(i+4,!0);if(e)throw mA(a)}finally{ae.__wbindgen_add_to_stack_pointer(16)}}function Mxe(n,t,o,a){ae.__wasm_bindgen_func_elem_1248(n,t,iA(o),iA(a))}var w$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_expandedappstatekeys_free(n>>>0,1)),D$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_groupcipher_free(n>>>0,1)),O$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_groupsessionbuilder_free(n>>>0,1)),b$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_internalbinarynode_free(n>>>0,1)),M$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_lthashantitampering_free(n>>>0,1)),OL=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_lthashstate_free(n>>>0,1)),_$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_noisesession_free(n>>>0,1)),bL=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_protocoladdress_free(n>>>0,1)),T$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_senderkeydistributionmessage_free(n>>>0,1)),N$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_senderkeyname_free(n>>>0,1)),ML=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_senderkeyrecord_free(n>>>0,1)),R$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_sessionbuilder_free(n>>>0,1)),k$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_sessioncipher_free(n>>>0,1)),v$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>ae.__wbg_sessionrecord_free(n>>>0,1));function iA(n){YB===Vg.length&&Vg.push(Vg.length+1);let t=YB;return YB=Vg[t],Vg[t]=n,t}function nI(n,t){if(!(n instanceof t))throw new Error(`expected instance of ${t.name}`)}var P$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>n.dtor(n.a,n.b));function TL(n){let t=typeof n;if(t=="number"||t=="boolean"||n==null)return`${n}`;if(t=="string")return`"${n}"`;if(t=="symbol"){let e=n.description;return e==null?"Symbol":`Symbol(${e})`}if(t=="function"){let e=n.name;return typeof e=="string"&&e.length>0?`Function(${e})`:"Function"}if(Array.isArray(n)){let e=n.length,i="[";e>0&&(i+=TL(n[0]));for(let A=1;A1)a=o[1];else return toString.call(n);if(a=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message} -${n.stack}`:a}function _xe(n){n<1028||(Vg[n]=YB,YB=n)}function KB(n,t){return n=n>>>0,_h().subarray(n/1,n/1+t)}var jl=null;function eA(){return(jl===null||jl.buffer.detached===!0||jl.buffer.detached===void 0&&jl.buffer!==ae.memory.buffer)&&(jl=new DataView(ae.memory.buffer)),jl}function vr(n,t){return n=n>>>0,Rxe(n,t)}var xB=null;function _h(){return(xB===null||xB.byteLength===0)&&(xB=new Uint8Array(ae.memory.buffer)),xB}function Fe(n){return Vg[n]}function kr(n,t){try{return n.apply(this,t)}catch(o){ae.__wbindgen_export3(iA(o))}}var Vg=new Array(1024).fill(void 0);Vg.push(void 0,null,!0,!1);var YB=Vg.length;function qn(n){return n==null}function Txe(n,t,o,a){let e={a:n,b:t,cnt:1,dtor:o},i=(...A)=>{e.cnt++;let r=e.a;e.a=0;try{return a(r,e.b,...A)}finally{e.a=r,i._wbg_cb_unref()}};return i._wbg_cb_unref=()=>{--e.cnt===0&&(e.dtor(e.a,e.b),e.a=0,P$.unregister(e))},P$.register(i,e,e),i}function Pt(n,t){let o=t(n.length*1,1)>>>0;return _h().set(n,o/1),KA=n.length,o}function G$(n,t){let o=t(n.length*4,4)>>>0,a=eA();for(let e=0;e>>0;return _h().subarray(s,s+r.length).set(r),KA=r.length,s}let a=n.length,e=t(a,1)>>>0,i=_h(),A=0;for(;A127)break;i[e+A]=r}if(A!==a){A!==0&&(n=n.slice(A)),e=o(e,a,a=A+n.length*3,1)>>>0;let r=_h().subarray(e+A,e+a),s=jB.encodeInto(n,r);A+=s.written,e=o(e,a,A,1)>>>0}return KA=A,e}function mA(n){let t=Fe(n);return _xe(n),t}var RD=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});RD.decode();var Nxe=2146435072,_L=0;function Rxe(n,t){return _L+=t,_L>=Nxe&&(RD=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),RD.decode(),_L=t),RD.decode(_h().subarray(n,n+t))}var jB=new TextEncoder;"encodeInto"in jB||(jB.encodeInto=function(n,t){let o=jB.encode(n);return t.set(o),{read:n.length,written:o.length}});var KA=0,kxe,ae;function vxe(n,t){return ae=n.exports,kxe=t,jl=null,xB=null,ae}function L$(n){if(ae!==void 0)return ae;n!==void 0&&(Object.getPrototypeOf(n)===Object.prototype?{module:n}=n:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=Oxe();n instanceof WebAssembly.Module||(n=new WebAssembly.Module(n));let o=new WebAssembly.Instance(n,t);return vxe(o,n)}var Pxe=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function U$(n){let t=atob(n),o=new Uint8Array(t.length);for(let a=0;an.length===33?n:Buffer.concat([Wg,n]),br={generateKeyPair:()=>{let{pubKey:n,privKey:t}=gI.generateKeyPair();return{private:Buffer.from(t),public:Buffer.from(n.slice(1))}},sharedKey:(n,t)=>{let o=gI.calculateAgreement(An(t),n);return Buffer.from(o)},sign:(n,t)=>gI.calculateSignature(n,t),verify:(n,t,o)=>{try{return gI.verifySignature(An(n),t,o),!0}catch{return!1}}},HD=(n,t)=>{let o=br.generateKeyPair(),a=An(o.public),e=br.sign(n.private,a);return{keyPair:o,signature:e,keyId:t}},K$=16;function Jl(n,t,o,a){let e=NL("aes-256-gcm",t,o);return e.setAAD(a),Buffer.concat([e.update(n),e.final(),e.getAuthTag()])}function ql(n,t,o,a){let e=RL("aes-256-gcm",t,o),i=n.slice(0,n.length-K$),A=n.slice(n.length-K$);return e.setAAD(a),e.setAuthTag(A),Buffer.concat([e.update(i),e.final()])}function x$(n,t,o){let a=NL("aes-256-ctr",t,o);return Buffer.concat([a.update(n),a.final()])}function Y$(n,t,o){let a=RL("aes-256-ctr",t,o);return Buffer.concat([a.update(n),a.final()])}function j$(n,t){return Yxe(n.subarray(16),t,n.subarray(0,16))}function Yxe(n,t,o){let a=RL("aes-256-cbc",t,o);return Buffer.concat([a.update(n),a.final()])}function J$(n,t){let o=xxe(16),a=NL("aes-256-cbc",t,o);return Buffer.concat([o,a.update(n),a.final()])}function Wn(n,t,o="sha256"){return Kxe(o,t).update(n).digest()}function kh(n){return Hxe("sha256").update(n).digest()}async function KD(n,t){let a=new TextEncoder().encode(n),e=new Uint8Array(t instanceof Uint8Array?t:new Uint8Array(t)),i=await H$.importKey("raw",a,{name:"PBKDF2"},!1,["deriveBits"]),A=await H$.deriveBits({name:"PBKDF2",salt:e,iterations:2<<16,hash:"SHA-256"},i,256);return Buffer.from(A)}var WB={replacer:(n,t)=>Buffer.isBuffer(t)||t instanceof Uint8Array||t?.type==="Buffer"?{type:"Buffer",data:Buffer.from(t?.data||t).toString("base64")}:t,reviver:(n,t)=>{if(typeof t=="object"&&t!==null&&t.type==="Buffer"&&typeof t.data=="string")return Buffer.from(t.data,"base64");if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let o=Object.keys(t);if(o.length>0&&o.every(a=>!isNaN(parseInt(a,10)))){let a=Object.values(t);if(a.every(e=>typeof e=="number"))return Buffer.from(a)}}return t}},vh=(n,t="me")=>(n?.fromMe?t:n?.participantAlt||n?.remoteJidAlt||n?.participant||n?.remoteJid)||"",V$=n=>n==null||n==="",Jxe=n=>{let o=(VB(1)[0]&15)+1;return Buffer.concat([n,Buffer.alloc(o,o)])},W$=n=>{let t=new Uint8Array(n);if(t.length===0)throw new Error("unpadPkcs7 given empty bytes");var o=t[t.length-1];if(o>t.length)throw new Error(`unpad given ${t.length} bytes, but pad is ${o}`);return new Uint8Array(t.buffer,t.byteOffset,t.length-o)},Z$=n=>(n.sort(),"2:"+kh(Buffer.from(n.join(""))).toString("base64").slice(0,6)),Ph=n=>Jxe(ne.Message.encode(n).finish()),X$=()=>Uint16Array.from(VB(2))[0]&16383,Zg=(n,t=4)=>{let o=n,a=new Uint8Array(t);for(let e=t-1;e>=0;e--)a[e]=255&o,o>>>=8;return a},zr=n=>typeof n=="object"&&n?"toNumber"in n?n.toNumber():n.low:n||0,vi=(n=new Date)=>Math.floor(n.getTime()/1e3);var ZB=n=>$$(n).delay,$$=n=>{let t=new Error().stack,o,a;return{delay:new Promise((A,r)=>{o=setTimeout(A,n),a=r}),cancel:()=>{clearTimeout(o),a(new xD.Boom("Cancelled",{statusCode:500,data:{stack:t}}))}}};async function Gh(n,t){if(!n)return new Promise(t);let o=new Error().stack,{delay:a,cancel:e}=$$(n);return new Promise((A,r)=>{a.then(()=>r(new xD.Boom("Timed Out",{statusCode:ar.timedOut,data:{stack:o}}))).catch(s=>r(s)),t(A,r)}).finally(e)}var Vr=n=>{let t=Buffer.alloc(44);if(t.writeBigUInt64BE(BigInt(Math.floor(Date.now()/1e3))),n){let e=hA(n);e?.user&&(t.write(e.user,8),t.write("@c.us",8+e.user.length))}return VB(16).copy(t,28),"3EB0"+jxe("sha256").update(t).digest().toString("hex").toUpperCase().substring(0,18)},kL=()=>"3EB0"+VB(18).toString("hex").toUpperCase();function vL(n,t){return async(o,a)=>{let e,i;await Gh(a,(A,r)=>{i=({connection:s,lastDisconnect:g})=>{s==="close"&&r(g?.error||new xD.Boom("Connection Closed",{statusCode:ar.connectionClosed}))},n.on("connection.update",i),e=async s=>{await o(s)&&A()},n.on(t,e)}).finally(()=>{n.off(t,e),n.off("connection.update",i)})}}var eee=n=>vL(n,"connection.update");var Aee=()=>{let n=VB(4);return`${n.readUInt16BE()}.${n.readUInt16BE(2)}-`},qxe={sender:ne.WebMessageInfo.Status.SERVER_ACK,played:ne.WebMessageInfo.Status.PLAYED,read:ne.WebMessageInfo.Status.READ,"read-self":ne.WebMessageInfo.Status.READ},tee=n=>{let t=qxe[n];return typeof n>"u"?ne.WebMessageInfo.Status.DELIVERY_ACK:t},zxe={conflict:ar.connectionReplaced},ree=n=>{let[t]=Gs(n),o=t?.tag||"unknown",a=+(n.attrs.code||zxe[o]||ar.badSession);return a===ar.restartRequired&&(o="restart required"),{reason:o,statusCode:a}},iee=({tag:n,attrs:t})=>{let o;switch(n){case"offer":case"offer_notice":o="offer";break;case"terminate":t.reason==="timeout"?o="timeout":o="terminate";break;case"preaccept":o="preaccept";break;case"transport":o="transport";break;case"relaylatency":o="relaylatency";break;case"reject":o="reject";break;case"accept":o="accept";break;default:o="ringing";break}return o},q$="Unexpected server response: ",aee=n=>{let t=500;if(n?.message?.includes(q$)){let o=+n?.message.slice(q$.length);!Number.isNaN(o)&&o>=400&&(t=o)}else(n?.code?.startsWith("E")||n?.message?.includes("timed out"))&&(t=408);return t};function YD(n){for(let t in n)typeof n[t]>"u"&&delete n[t];return n}var z$="123456789ABCDEFGHJKLMNPQRSTVWXYZ";function oee(n){let t=0,o=0,a=[];for(let e of n)for(t=t<<8|e&255,o+=8;o>=5;)a.push(z$.charAt(t>>>o-5&31)),o-=5;return o>0&&a.push(z$.charAt(t<<5-o&31)),a.join("")}function nee(n){return ne.Message.encode(n).finish()}var zl=ze(Jr(),1);var Vxe=async(n,t)=>qA(n)||Ci(n)?n:await t.lidMapping.getLIDForPN(n)||n,Wxe=async(n,t,o,a,e)=>{let{senderAlt:i}=JD(n);if(i&&qA(i)&&Rt(t)&&a===t)try{await o.lidMapping.storeLIDPNMappings([{lid:i,pn:t}]),await o.migrateSession(t,i),e.debug({sender:t,senderAlt:i},"Stored LID mapping from envelope")}catch(A){e.warn({sender:t,senderAlt:i,error:A},"Failed to store LID mapping")}},jD="Message absent from node",see="Key used already or never filled",gee="Your account has been restricted",Zxe={maxRetries:3,baseDelayMs:100,sessionRecordErrors:["No session record","SessionError: No session record"]},Vl={SenderReachoutTimelocked:463,ParsingError:487,UnrecognizedStanza:488,UnrecognizedStanzaClass:489,UnrecognizedStanzaType:490,InvalidProtobuf:491,InvalidHostedCompanionStanza:493,MissingMessageSecret:495,SignalErrorOldCounter:496,MessageDeletedOnPeer:499,UnhandledError:500,UnsupportedAdminRevoke:550,UnsupportedLIDGroup:551,DBOperationFailed:552},PL={MessageAccountRestriction:"463",SmaxInvalid:"479"},JD=n=>{let t,o,a=n.attrs.participant||n.attrs.from,e=n.attrs.addressing_mode||(a?.endsWith("lid")?"lid":"pn");return e==="lid"?(t=n.attrs.participant_pn||n.attrs.sender_pn||n.attrs.peer_recipient_pn,o=n.attrs.recipient_pn):(t=n.attrs.participant_lid||n.attrs.sender_lid||n.attrs.peer_recipient_lid,o=n.attrs.recipient_lid),{addressingMode:e,senderAlt:t,recipientAlt:o}};function GL(n,t,o){let a,e,i,A=!1,r=n.attrs.id,s=n.attrs.from,g=n.attrs.participant,c=n.attrs.recipient;if(!r)throw new zl.Boom("Invalid message stanza: missing id attribute",{data:n});if(!s)throw new zl.Boom("Invalid message stanza: missing from attribute",{data:n});let I=JD(n),p=m=>Dt(m,t),B=m=>Dt(m,o);if(Rt(s)||qA(s)||Ci(s)||Or(s)){if(c&&!Mh(c)){if(!p(s)&&!B(s))throw new zl.Boom("receipient present, but msg not from me",{data:n});(p(s)||B(s))&&(A=!0),e=c}else(p(s)||B(s))&&(A=!0),e=s;a="chat",i=s}else if(qr(s)){if(!g)throw new zl.Boom("No participant in group message");(p(g)||B(g))&&(A=!0),a="group",i=g,e=s}else if(HB(s)){if(!g)throw new zl.Boom("No participant in group message");let m=p(g);zg(s)?a=m?"direct_peer_status":"other_status":a=m?"peer_broadcast":"other_broadcast",A=m,e=s,i=g}else if(aI(s))a="newsletter",e=s,i=s,(p(s)||B(s))&&(A=!0);else throw new zl.Boom("Unknown message type",{data:n});let f=n?.attrs?.notify,Q={remoteJid:e,remoteJidAlt:qr(e)?void 0:I.senderAlt,remoteJidUsername:qr(e)?void 0:n.attrs.peer_recipient_username||n.attrs.recipient_username,fromMe:A,id:r,participant:g,participantAlt:qr(e)?I.senderAlt:void 0,participantUsername:n.attrs.participant?n.attrs.participant_username:void 0,addressingMode:I.addressingMode,...a==="newsletter"&&n.attrs.server_id?{server_id:n.attrs.server_id}:{}},y={key:Q,category:n.attrs.category,messageTimestamp:+n.attrs.t,pushName:f,broadcast:HB(s)};return Q.fromMe&&(y.status=ne.WebMessageInfo.Status.SERVER_ACK),{fullMessage:y,author:i,sender:a==="chat"?i:e}}var cee=(n,t,o,a,e)=>{let{fullMessage:i,author:A,sender:r}=GL(n,t,o);return{fullMessage:i,category:n.attrs.category,author:A,async decrypt(){let s=0;if(Array.isArray(n.content))for(let{tag:g,attrs:c,content:I}of n.content){if(g==="verified_name"&&I instanceof Uint8Array){let f=ne.VerifiedNameCertificate.decode(I),Q=ne.VerifiedNameCertificate.Details.decode(f.details);i.verifiedBizName=Q.verifiedName}if(g==="unavailable"&&c.type==="view_once"&&(i.key.isViewOnce=!0),c.count&&g==="enc"&&(i.retryCount=Number(c.count)),g!=="enc"&&g!=="plaintext"||!(I instanceof Uint8Array))continue;s+=1;let p,B=await Vxe(A,a);g!=="plaintext"&&await Wxe(n,A,a,B,e);try{let f=g==="plaintext"?"plaintext":c.type;switch(f){case"skmsg":p=await a.decryptGroupMessage({group:r,authorJid:A,msg:I});break;case"pkmsg":case"msg":p=await a.decryptMessage({jid:B,type:f,ciphertext:I});break;case"plaintext":p=I;break;default:throw new Error(`Unknown e2e type: ${f}`)}let Q=ne.Message.decode(f!=="plaintext"?W$(p):p);if(Q=Q.deviceSentMessage?.message||Q,Q.senderKeyDistributionMessage)try{await a.processSenderKeyDistributionMessage({authorJid:A,item:Q.senderKeyDistributionMessage})}catch(y){e.error({key:i.key,err:y},"failed to process sender key distribution message")}i.message?Object.assign(i.message,Q):i.message=Q}catch(f){let Q={key:i.key,err:f,messageType:g==="plaintext"?"plaintext":c.type,sender:r,author:A,isSessionRecordError:Xxe(f)};e.error(Q,"failed to decrypt message"),i.messageStubType=ne.WebMessageInfo.StubType.CIPHERTEXT,i.messageStubParameters=[f.message.toString()]}}!s&&!i.key?.isViewOnce&&(i.messageStubType=ne.WebMessageInfo.StubType.CIPHERTEXT,i.messageStubParameters=[jD])}}};function Xxe(n){let t=n?.message||n?.toString()||"";return Zxe.sessionRecordErrors.some(o=>t.includes(o))}var nc=ze(Jr(),1);import{randomBytes as ZU}from"crypto";import{promises as XU}from"fs";var Xn=ze(Jr(),1);import{exec as Xze}from"child_process";import*as So from"crypto";import{once as SE}from"events";import{createReadStream as xb,createWriteStream as xU,promises as DE}from"fs";import{tmpdir as Pne}from"os";import{join as Hb}from"path";import{Readable as xf,Transform as $ze}from"stream";import{URL as YU}from"url";var jU=()=>Pne(),Gne=async()=>{let[n,t]=await Promise.all([import("jimp").catch(()=>{}),Promise.resolve().then(()=>(Qre(),fre)).catch(()=>{})]);if(t)return{sharp:t};if(n)return{jimp:n};throw new Xn.Boom("No image processing library available")},eVe=n=>`WhatsApp ${Vne[n]} Keys`,Yb=async(n,t,o)=>{let{stream:a}=await Yf(n);o?.debug("got stream for raw upload");let e=So.createHash("sha256"),i=Hb(Pne(),t+Vr()),A=xU(i),r=0;try{for await(let g of a)r+=g.length,e.update(g),A.write(g)||await SE(A,"drain");A.end(),await SE(A,"finish"),a.destroy();let s=e.digest();return o?.debug("hashed data for raw upload"),{filePath:i,fileSha256:s,fileLength:r}}catch(s){A.destroy(),a.destroy();try{await DE.unlink(i)}catch{}throw s}};async function Fne(n,t){if(!n)throw new Xn.Boom("Cannot derive from empty media key");typeof n=="string"&&(n=Buffer.from(n.replace("data:;base64,",""),"base64"));let o=Vn(n,112,{info:eVe(t)});return{iv:o.slice(0,16),cipherKey:o.slice(16,48),macKey:o.slice(48,80)}}var AVe=async(n,t,o,a)=>new Promise((e,i)=>{let A=`ffmpeg -ss ${o} -i ${n} -y -vf scale=${a.width}:-1 -vframes 1 -f image2 ${t}`;Xze(A,r=>{r?i(r):e()})}),JU=async(n,t=32)=>{n instanceof xf&&(n=await Kb(n));let o=await Gne();if("sharp"in o&&typeof o.sharp?.default=="function"){let a=o.sharp.default(n),e=await a.metadata();return{buffer:await a.resize(t).jpeg({quality:50}).toBuffer(),original:{width:e.width,height:e.height}}}else if("jimp"in o&&typeof o.jimp?.Jimp=="object"){let a=await o.jimp.Jimp.read(n),e={width:a.width,height:a.height};return{buffer:await a.resize({w:t,mode:o.jimp.ResizeStrategy.BILINEAR}).getBuffer("image/jpeg",{quality:50}),original:e}}else throw new Xn.Boom("No image processing library available")},tVe=n=>encodeURIComponent(n.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=+$/,"")),jb=async(n,t)=>{let o,{width:a=640,height:e=640}=t||{};if(Buffer.isBuffer(n))o=n;else{let{stream:r}=await Yf(n);o=await Kb(r)}let i=await Gne(),A;if("sharp"in i&&typeof i.sharp?.default=="function")A=i.sharp.default(o).resize(a,e).jpeg({quality:50}).toBuffer();else if("jimp"in i&&typeof i.jimp?.Jimp=="function"){let r=await i.jimp.Jimp.read(o),s=Math.min(r.width,r.height);A=r.crop({x:0,y:0,w:s,h:s}).resize({w:a,h:e,mode:i.jimp.ResizeStrategy.BILINEAR}).getBuffer("image/jpeg",{quality:50})}else throw new Xn.Boom("No image processing library available");return{img:await A}};async function Lne(n){let t=await Promise.resolve().then(()=>(kne(),Rne)),o,a={duration:!0};return Buffer.isBuffer(n)?o=await t.parseBuffer(n,void 0,a):typeof n=="string"?o=await t.parseFile(n,a):o=await t.parseStream(n,void 0,a),o.format.duration}async function Une(n,t){try{let{default:o}=await import("audio-decode"),a;if(Buffer.isBuffer(n))a=n;else if(typeof n=="string"){let p=xb(n);a=await Kb(p)}else a=await Kb(n);let i=(await o(a)).getChannelData(0),A=64,r=Math.floor(i.length/A),s=[];for(let p=0;pp*g);return new Uint8Array(c.map(p=>Math.floor(100*p)))}catch(o){t?.debug("Failed to generate waveform: "+o)}}var vne=n=>{let t=new xf({read:()=>{}});return t.push(n),t.push(null),t},Kb=async n=>{let t=[];for await(let o of n)t.push(o);return n.destroy(),Buffer.concat(t)},Yf=async(n,t)=>{if(Buffer.isBuffer(n))return{stream:vne(n),type:"buffer"};if("stream"in n)return{stream:n.stream,type:"readable"};let o=n.url.toString();if(o.startsWith("data:")){let a=Buffer.from(o.split(",")[1],"base64");return{stream:vne(a),type:"buffer"}}return o.startsWith("http://")||o.startsWith("https://")?{stream:await Jb(n.url,t),type:"remote"}:{stream:xb(n.url),type:"file"}};async function Hne(n,t,o){let a,e;if(t==="image"){let{buffer:i,original:A}=await JU(n);a=i.toString("base64"),A.width&&A.height&&(e={width:A.width,height:A.height})}else if(t==="video"){let i=Hb(jU(),Vr()+".jpg");try{await AVe(n,i,"00:00:00",{width:32,height:32}),a=(await DE.readFile(i)).toString("base64"),await DE.unlink(i)}catch(A){o.logger?.debug("could not generate video thumb: "+A)}}return{thumbnail:a,originalImageDimensions:e}}var Jb=async(n,t={})=>{let o=await fetch(n.toString(),{dispatcher:t.dispatcher,method:"GET",headers:t.headers});if(!o.ok)throw new Xn.Boom(`Failed to fetch stream from ${n}`,{statusCode:o.status,data:{url:n}});return o.body instanceof xf?o.body:xf.fromWeb(o.body)},Kne=async(n,t,{logger:o,saveOriginalFileIfRequired:a,opts:e}={})=>{let{stream:i,type:A}=await Yf(n,e);o?.debug("fetched media stream");let r=So.randomBytes(32),{cipherKey:s,iv:g,macKey:c}=await Fne(r,t),I=Hb(jU(),t+Vr()+"-enc"),p=xU(I),B,f;a&&(f=Hb(jU(),t+Vr()+"-original"),B=xU(f));let Q=0,y=So.createCipheriv("aes-256-cbc",s,g),m=So.createHmac("sha256",c).update(g),T=So.createHash("sha256"),_=So.createHash("sha256"),R=async L=>{_.update(L),m.update(L),p.write(L)||await SE(p,"drain")};try{for await(let K of i){if(Q+=K.length,A==="remote"&&e?.maxContentLength&&Q+K.length>e.maxContentLength)throw new Xn.Boom(`content length exceeded when encrypting "${A}"`,{data:{media:n,type:A}});B&&(B.write(K)||await SE(B,"drain")),T.update(K),await R(y.update(K))}await R(y.final());let L=m.digest().slice(0,10);_.update(L);let U=T.digest(),F=_.digest();p.write(L);let q=SE(p,"finish"),z=B?SE(B,"finish"):Promise.resolve();return p.end(),B?.end?.(),i.destroy(),await q,await z,o?.debug("encrypted data successfully"),{mediaKey:r,originalFilePath:f,encFilePath:I,mac:L,fileEncSha256:F,fileSha256:U,fileLength:Q}}catch(L){p.destroy(),B?.destroy?.(),y.destroy(),m.destroy(),T.destroy(),_.destroy(),i.destroy();try{await DE.unlink(I),f&&await DE.unlink(f)}catch(U){o?.error({err:U},"failed deleting tmp files")}throw L}},qU="mmg.whatsapp.net",wE=16,KU=n=>Math.floor(n/wE)*wE,jf=(n,t=qU)=>`https://${t}${n}`,rVe=n=>{if(n)try{return new YU(n).host}catch{return}},OE=async({mediaKey:n,directPath:t,url:o},a,e={})=>{let i=e.host??rVe(o),A=t?jf(t,i):o;if(!A)throw new Xn.Boom("No valid media URL or directPath present in message",{statusCode:400});let r=await Fne(n,a);return iVe(A,r,e)},iVe=async(n,{cipherKey:t,iv:o},{startByte:a,endByte:e,options:i}={})=>{let A=0,r=0,s=!1;if(a){let m=KU(a||0);m&&(r=m-wE,A=m,s=!0)}let g=e?KU(e||0)+wE:void 0,c=i?.headers?i.headers:void 0,I={...c?Array.isArray(c)?Object.fromEntries(c):c:{},Origin:Jf};(r||g)&&(I.Range=`bytes=${r}-`,g&&(I.Range+=g));let p=await Jb(n,{...i||{},headers:I}),B=Buffer.from([]),f,Q=(m,T)=>{if(a||e){let _=A>=a?void 0:Math.max(a-A,0),R=A+m.lengththis.push(U)),_()}catch(U){_(U)}},final(m){try{Q(f.final(),T=>this.push(T)),m()}catch(T){m(T)}}});return p.pipe(y,{end:!0})};var aVe=()=>typeof process<"u"&&process.versions?.node!==null&&typeof process.versions.bun>"u"&&typeof globalThis.Deno>"u",xne=async({url:n,filePath:t,headers:o,timeoutMs:a,agent:e},i=0)=>{if(i>5)throw new Error("Too many redirects");let A=new YU(n),r=A.protocol==="https:"?await import("https"):await import("http"),g=(await DE.stat(t)).size;return new Promise((c,I)=>{let p=r.request({hostname:A.hostname,port:A.port||(A.protocol==="https:"?443:80),path:A.pathname+A.search,method:"POST",headers:{...o,"Content-Length":g},agent:e,timeout:a},f=>{if(f.statusCode&&f.statusCode>=300&&f.statusCode<400&&f.headers.location){f.resume();let y=new YU(f.headers.location,n).toString();c(xne({url:y,filePath:t,headers:o,timeoutMs:a,agent:e},i+1));return}let Q="";f.on("data",y=>Q+=y),f.on("end",()=>{try{c(JSON.parse(Q))}catch{c(void 0)}})});p.on("error",I),p.on("timeout",()=>{p.destroy(),I(new Error("Upload timeout"))});let B=xb(t);B.pipe(p),B.on("error",f=>{p.destroy(),I(f)})})},oVe=async({url:n,filePath:t,headers:o,timeoutMs:a,agent:e})=>{let i=xb(t),A=xf.toWeb(i),r=typeof e?.dispatch=="function"?e:void 0,s=await fetch(n,{...r?{dispatcher:r}:{},method:"POST",body:A,headers:o,duplex:"half",signal:a?AbortSignal.timeout(a):void 0});try{return await s.json()}catch{return}},nVe=async(n,t)=>aVe()?(t?.debug("Using Node.js https module for upload (avoids undici buffering bug)"),xne(n)):(t?.debug("Using web-standard Fetch API for upload"),oVe(n)),Yne=({customUploadHosts:n,fetchAgent:t,logger:o,options:a},e)=>async(i,{mediaType:A,fileEncSha256B64:r,timeoutMs:s})=>{let g=await e(!1),c,I=[...n,...g.hosts];r=tVe(r);let B={...(()=>{let f=a?.headers;return f?Array.isArray(f)?Object.fromEntries(f):f:{}})(),"Content-Type":"application/octet-stream",Origin:Jf};for(let{hostname:f}of I){o.debug(`uploading to "${f}"`);let Q=encodeURIComponent(g.auth),y=`https://${f}${VU[A]}/${r}?auth=${Q}&token=${r}`,m;try{if(m=await nVe({url:y,filePath:i,headers:B,timeoutMs:s,agent:t},o),m?.url||m?.direct_path){c={mediaUrl:m.url,directPath:m.direct_path,meta_hmac:m.meta_hmac,fbid:m.fbid,ts:m.ts};break}else throw g=await e(!0),new Error(`upload failed, reason: ${JSON.stringify(m)}`)}catch(T){let _=f===I[g.hosts.length-1]?.hostname;o.warn({trace:T?.stack,uploadResult:m},`Error in uploading to ${f} ${_?"":", retrying..."}`)}}if(!c)throw new Xn.Boom("Media upload failed on all hosts",{statusCode:500});return c},jne=n=>Vn(n,32,{info:"WhatsApp Media Retry Notification"}),Jne=(n,t,o)=>{let a={stanzaId:n.id},e=ne.ServerErrorReceipt.encode(a).finish(),i=So.randomBytes(12),A=jne(t),r=Jl(e,A,i,Buffer.from(n.id));return{tag:"receipt",attrs:{id:n.id,to:BA(o),type:"server-error"},content:[{tag:"encrypt",attrs:{},content:[{tag:"enc_p",attrs:{},content:r},{tag:"enc_iv",attrs:{},content:i}]},{tag:"rmr",attrs:{jid:n.remoteJid,from_me:(!!n.fromMe).toString(),participant:n.participant||void 0}}]}},qne=n=>{let t=le(n,"rmr"),o={key:{id:n.attrs.id,remoteJid:t.attrs.jid,fromMe:t.attrs.from_me==="true",participant:t.attrs.participant}},a=le(n,"error");if(a){let e=+a.attrs.code;o.error=new Xn.Boom(`Failed to re-upload media (${e})`,{data:a.attrs,statusCode:zU(e)})}else{let e=le(n,"encrypt"),i=ki(e,"enc_p"),A=ki(e,"enc_iv");i&&A?o.media={ciphertext:i,iv:A}:o.error=new Xn.Boom("Failed to re-upload media (missing ciphertext)",{statusCode:404})}return o},zne=({ciphertext:n,iv:t},o,a)=>{let e=jne(o),i=ql(n,e,t,Buffer.from(a));return ne.MediaRetryNotification.decode(i)},zU=n=>sVe[n],sVe={[ne.MediaRetryNotification.ResultType.SUCCESS]:200,[ne.MediaRetryNotification.ResultType.DECRYPTION_ERROR]:412,[ne.MediaRetryNotification.ResultType.NOT_FOUND]:404,[ne.MediaRetryNotification.ResultType.GENERAL_ERROR]:418};import{createHmac as gVe}from"crypto";var cVe=[{f:1},{f:3,s:[{f:2},{f:3},{f:8},{f:11},{f:17,s:[{f:21},{f:22}]},{f:25}]},{f:4,s:[{f:1},{f:16},{f:17,s:[{f:21},{f:22}]}]},{f:5,s:[{f:3},{f:4},{f:5},{f:16},{f:17,s:[{f:21},{f:22}]}]},{f:6,s:[{f:1},{f:17,s:[{f:21},{f:22}]},{f:30}]},{f:7,s:[{f:2},{f:7},{f:10},{f:17,s:[{f:21},{f:22}]},{f:20}]},{f:8,s:[{f:2},{f:7},{f:9},{f:17,s:[{f:21},{f:22}]},{f:21}]},{f:9,s:[{f:2},{f:6},{f:7},{f:13},{f:17,s:[{f:21},{f:22}]},{f:20}]},{f:12,s:[{f:1},{f:2},{f:14,m:!0},{f:15}]},{f:18,s:[{f:6},{f:16},{f:17,s:[{f:21},{f:22}]}]},{f:26,s:[{f:4},{f:5},{f:8},{f:13},{f:17,s:[{f:21},{f:22}]}]},{f:28,s:[{f:1},{f:2},{f:4},{f:5},{f:6},{f:7,s:[{f:21},{f:22}]}]},{f:37,s:[{f:1,m:!0}]},{f:49,s:[{f:2},{f:3,s:[{f:1},{f:2}]},{f:5,s:[{f:21},{f:22}]},{f:8,s:[{f:1},{f:2}]}]},{f:53,s:[{f:1,m:!0}]},{f:55,s:[{f:1,m:!0}]},{f:58,s:[{f:1,m:!0}]},{f:59,s:[{f:1,m:!0}]},{f:60,s:[{f:2},{f:3,s:[{f:1},{f:2}]},{f:5,s:[{f:21},{f:22}]},{f:8,s:[{f:1},{f:2}]}]},{f:64,s:[{f:2},{f:3,s:[{f:1},{f:2}]},{f:5,s:[{f:21},{f:22}]},{f:8,s:[{f:1},{f:2}]}]},{f:66,s:[{f:2},{f:6},{f:7},{f:13},{f:17,s:[{f:21},{f:22}]},{f:20}]},{f:74,s:[{f:1,m:!0}]},{f:87,s:[{f:1,m:!0}]},{f:88,s:[{f:1},{f:2,s:[{f:1}]},{f:3,s:[{f:21},{f:22}]}]},{f:92,s:[{f:1,m:!0}]},{f:93,s:[{f:1,m:!0}]},{f:94,s:[{f:1,m:!0}]}],Zne=n=>{let t=new Map;for(let o of n)t.set(o.f,{m:o.m,children:o.s?Zne(o.s):void 0});return t},IVe=Zne(cVe),lVe=new Map,pVe="Report Token",qb={VARINT:0,FIXED64:1,BYTES:2,FIXED32:5},zb=n=>!n.reactionMessage&&!n.encReactionMessage&&!n.encEventResponseMessage&&!n.pollUpdateMessage,dVe=(n,t,o,a,e)=>{let i=Buffer.concat([Buffer.from(t,"utf8"),Buffer.from(o,"utf8"),Buffer.from(a,"utf8"),Buffer.from(n,"utf8")]);return Vn(e,32,{info:i.toString("latin1")})},Xne=(n,t)=>{let o=[],a=0;for(;a>3,A=e.value&7,r=a;a+=e.bytes;let s=t.get(i),g=I=>I>n.length?!1:(o.push({num:i,bytes:n.subarray(r,I)}),a=I,!0),c=I=>I>n.length?!1:(a=I,!0);if(A===qb.VARINT){let I=WU(n,a);if(!I.ok)return null;let p=a+I.bytes;if(!s){if(!c(p))return null;continue}if(!g(p))return null;continue}if(A===qb.FIXED64){let I=a+8;if(!s){if(!c(I))return null;continue}if(!g(I))return null;continue}if(A===qb.FIXED32){let I=a+4;if(!s){if(!c(I))return null;continue}if(!g(I))return null;continue}if(A===qb.BYTES){let I=WU(n,a);if(!I.ok)return null;let p=a+I.bytes,B=p+I.value;if(B>n.length)return null;if(!s){a=B;continue}if(s.m||s.children){let f=Xne(n.subarray(p,B),s.children??lVe);if(f===null)return null;if(f.length>0){let Q=Wne(e.value),y=Wne(f.length);o.push({num:i,bytes:Buffer.concat([Q,y,f])})}a=B;continue}o.push({num:i,bytes:n.subarray(r,B)}),a=B;continue}return null}return o.length===0?Buffer.alloc(0):(o.sort((e,i)=>e.num-i.num),Buffer.concat(o.map(e=>e.bytes)))},WU=(n,t)=>{let o=0,a=0,e=0;for(;t+a35)return{value:0,bytes:0,ok:!1}}return{value:0,bytes:0,ok:!1}},Wne=n=>{let t=[],o=n>>>0;for(;o>127;)t.push(o&127|128),o>>>=7;return t.push(o),Buffer.from(t)},$ne=async(n,t,o)=>{let a=t.messageContextInfo?.messageSecret;if(!a||!o.id)return null;let e=o.fromMe?o.remoteJid:o.participant||o.remoteJid,i=o.fromMe&&o.participant||o.remoteJid,A=dVe(pVe,o.id,e,i,a),r=Xne(n,IVe);if(!r||r.length===0)return null;let s=gVe("sha256",A).update(r).digest().subarray(0,16);return{tag:"reporting",attrs:{},content:[{tag:"reporting_token",attrs:{v:"2"},content:s}]}};var hVe={image:"image/jpeg",video:"video/mp4",document:"application/pdf",audio:"audio/ogg; codecs=opus",sticker:"image/webp","product-catalog-image":"image/jpeg"},ese={image:ne.Message.ImageMessage,video:ne.Message.VideoMessage,audio:ne.Message.AudioMessage,sticker:ne.Message.StickerMessage,document:ne.Message.DocumentMessage},EVe=n=>n.match(sse)?.[0],uVe=async(n,t,o)=>{let a=EVe(n);if(t&&a)try{return await t(a)}catch(e){o?.warn({trace:e.stack},"url generation failed")}},Ase=async n=>{let t;if(typeof n=="number")t=n>0?n:4294967295+Number(n)+1;else{let o=n.trim().replace("#","");return o.length<=6&&(o="FF"+o.padStart(6,"0")),t=parseInt(o,16),t}},qf=async(n,t)=>{let o=t.logger,a;for(let U of gse)U in n&&(a=U);if(!a)throw new nc.Boom("Invalid media type",{statusCode:400});let e={...n,media:n[a]};delete e[a];let i=typeof e.media=="object"&&"url"in e.media&&!!e.media.url&&!!t.mediaCache&&a+":"+e.media.url.toString();if(a==="document"&&!e.fileName&&(e.fileName="file"),e.mimetype||(e.mimetype=hVe[a]),i){let U=await t.mediaCache.get(i);if(U){o?.debug({cacheableKey:i},"got media cache hit");let F=ne.Message.decode(U),q=`${a}Message`;return Object.assign(F[q],{...e,media:void 0}),F}}if(!!t.jid&&aI(t.jid)){o?.info({key:i},"Preparing raw media for newsletter");let{filePath:U,fileSha256:F,fileLength:q}=await Yb(e.media,t.mediaTypeOverride||a,o),z=F.toString("base64"),{mediaUrl:K,directPath:G}=await t.upload(U,{fileEncSha256B64:z,mediaType:a,timeoutMs:t.mediaUploadTimeoutMs});await XU.unlink(U);let V=ne.Message.fromObject({[`${a}Message`]:ese[a].fromObject({url:K,directPath:G,fileSha256:F,fileLength:q,...e,media:void 0})});return e.ptv&&(V.ptvMessage=V.videoMessage,delete V.videoMessage),V.stickerMessage&&(V.stickerMessage.stickerSentTs=Date.now()),i&&(o?.debug({cacheableKey:i},"set cache"),await t.mediaCache.set(i,ne.Message.encode(V).finish())),V}let r=a==="audio"&&typeof e.seconds>"u",s=(a==="image"||a==="video")&&typeof e.jpegThumbnail>"u",g=a==="audio"&&e.ptt===!0&&typeof e.waveform>"u",c=t.backgroundColor&&a==="audio"&&e.ptt===!0,I=r||s,{mediaKey:p,encFilePath:B,originalFilePath:f,fileEncSha256:Q,fileSha256:y,fileLength:m}=await Kne(e.media,t.mediaTypeOverride||a,{logger:o,saveOriginalFileIfRequired:I,opts:t.options}),T=Q.toString("base64"),[{mediaUrl:_,directPath:R}]=await Promise.all([(async()=>{let U=await t.upload(B,{fileEncSha256B64:T,mediaType:a,timeoutMs:t.mediaUploadTimeoutMs});return o?.debug({mediaType:a,cacheableKey:i},"uploaded media"),U})(),(async()=>{try{if(s){let{thumbnail:U,originalImageDimensions:F}=await Hne(f,a,t);e.jpegThumbnail=U,!e.width&&F&&(e.width=F.width,e.height=F.height,o?.debug("set dimensions")),o?.debug("generated thumbnail")}r&&(e.seconds=await Lne(f),o?.debug("computed audio duration")),g&&(e.waveform=await Une(f,o),o?.debug("processed waveform")),c&&(e.backgroundArgb=await Ase(t.backgroundColor),o?.debug("computed backgroundColor audio status"))}catch(U){o?.warn({trace:U.stack},"failed to obtain extra info")}})()]).finally(async()=>{try{await XU.unlink(B),f&&await XU.unlink(f),o?.debug("removed tmp files")}catch{o?.warn("failed to remove tmp file")}}),L=ne.Message.fromObject({[`${a}Message`]:ese[a].fromObject({url:_,directPath:R,mediaKey:p,fileEncSha256:Q,fileSha256:y,fileLength:m,mediaKeyTimestamp:vi(),...e,media:void 0})});return e.ptv&&(L.ptvMessage=L.videoMessage,delete L.videoMessage),i&&(o?.debug({cacheableKey:i},"set cache"),await t.mediaCache.set(i,ne.Message.encode(L).finish())),L},CVe=n=>{n=n||0;let t={ephemeralMessage:{message:{protocolMessage:{type:ne.Message.ProtocolMessage.Type.EPHEMERAL_SETTING,ephemeralExpiration:n}}}};return ne.Message.fromObject(t)},BVe=(n,t)=>{let o=n.message;if(!o)throw new nc.Boom("no content in message",{statusCode:400});o=Si(o),o=ne.Message.decode(ne.Message.encode(o).finish());let a=Object.keys(o)[0],e=o?.[a]?.contextInfo?.forwardingScore||0;e+=n.key.fromMe&&!t?0:1,a==="conversation"&&(o.extendedTextMessage={text:o[a]},delete o.conversation,a="extendedTextMessage");let i=o?.[a];return e>0?i.contextInfo={forwardingScore:e,isForwarded:!0}:i.contextInfo={},o},mi=(n,t)=>typeof n=="object"&&n!==null&&t in n&&n[t]!==null&&n[t]!==void 0;function Ep(n,t){return typeof n=="object"&&n!==null&&t in n&&n[t]!==null}var fVe=async(n,t)=>{var o,a;let e={};if(mi(n,"text")){let i={text:n.text},A=n.linkPreview;if(typeof A>"u"&&(A=await uVe(n.text,t.getUrlInfo,t.logger)),A){i.matchedText=A["matched-text"],i.jpegThumbnail=A.jpegThumbnail,i.description=A.description,i.title=A.title,i.previewType=0;let r=A.highQualityThumbnail;r&&(i.thumbnailDirectPath=r.directPath,i.mediaKey=r.mediaKey,i.mediaKeyTimestamp=r.mediaKeyTimestamp,i.thumbnailWidth=r.width,i.thumbnailHeight=r.height,i.thumbnailSha256=r.fileSha256,i.thumbnailEncSha256=r.fileEncSha256)}t.backgroundColor&&(i.backgroundArgb=await Ase(t.backgroundColor)),t.font&&(i.font=t.font),e.extendedTextMessage=i}else if(mi(n,"contacts")){let i=n.contacts.contacts.length;if(!i)throw new nc.Boom("require atleast 1 contact",{statusCode:400});i===1?e.contactMessage=ne.Message.ContactMessage.create(n.contacts.contacts[0]):e.contactsArrayMessage=ne.Message.ContactsArrayMessage.create(n.contacts)}else if(mi(n,"location"))e.locationMessage=ne.Message.LocationMessage.create(n.location);else if(mi(n,"react"))n.react.senderTimestampMs||(n.react.senderTimestampMs=Date.now()),e.reactionMessage=ne.Message.ReactionMessage.create(n.react);else if(mi(n,"delete"))e.protocolMessage={key:n.delete,type:ne.Message.ProtocolMessage.Type.REVOKE};else if(mi(n,"forward"))e=BVe(n.forward,n.force);else if(mi(n,"disappearingMessagesInChat")){let i=typeof n.disappearingMessagesInChat=="boolean"?n.disappearingMessagesInChat?Vf:0:n.disappearingMessagesInChat;e=CVe(i)}else if(mi(n,"groupInvite")){if(e.groupInviteMessage={},e.groupInviteMessage.inviteCode=n.groupInvite.inviteCode,e.groupInviteMessage.inviteExpiration=n.groupInvite.inviteExpiration,e.groupInviteMessage.caption=n.groupInvite.text,e.groupInviteMessage.groupJid=n.groupInvite.jid,e.groupInviteMessage.groupName=n.groupInvite.subject,t.getProfilePicUrl){let i=await t.getProfilePicUrl(n.groupInvite.jid,"preview");if(i){let A=await fetch(i,{method:"GET",dispatcher:t?.options?.dispatcher});if(A.ok){let r=Buffer.from(await A.arrayBuffer());e.groupInviteMessage.jpegThumbnail=r}}}}else if(mi(n,"pin"))e.pinInChatMessage={},e.messageContextInfo={},e.pinInChatMessage.key=n.pin,e.pinInChatMessage.type=n.type,e.pinInChatMessage.senderTimestampMs=Date.now(),e.messageContextInfo.messageAddOnDurationInSecs=n.type===1?n.time||86400:0;else if(mi(n,"buttonReply"))switch(n.type){case"template":e.templateButtonReplyMessage={selectedDisplayText:n.buttonReply.displayText,selectedId:n.buttonReply.id,selectedIndex:n.buttonReply.index};break;case"plain":e.buttonsResponseMessage={selectedButtonId:n.buttonReply.id,selectedDisplayText:n.buttonReply.displayText,type:ne.Message.ButtonsResponseMessage.Type.DISPLAY_TEXT};break}else if(Ep(n,"ptv")&&n.ptv){let{videoMessage:i}=await qf({video:n.video},t);e.ptvMessage=i}else if(mi(n,"product")){let{imageMessage:i}=await qf({image:n.product.productImage},t);e.productMessage=ne.Message.ProductMessage.create({...n,product:{...n.product,productImage:i}})}else if(mi(n,"listReply"))e.listResponseMessage={...n.listReply};else if(mi(n,"event")){e.eventMessage={};let i=Math.floor(n.event.startDate.getTime()/1e3);if(n.event.call&&t.getCallLink){let A=await t.getCallLink(n.event.call,{startTime:i});e.eventMessage.joinLink=(n.event.call==="audio"?nse:ose)+A}e.messageContextInfo={messageSecret:n.event.messageSecret||ZU(32)},e.eventMessage.name=n.event.name,e.eventMessage.description=n.event.description,e.eventMessage.startTime=i,e.eventMessage.endTime=n.event.endDate?n.event.endDate.getTime()/1e3:void 0,e.eventMessage.isCanceled=n.event.isCancelled??!1,e.eventMessage.extraGuestsAllowed=n.event.extraGuestsAllowed,e.eventMessage.isScheduleCall=n.event.isScheduleCall??!1,e.eventMessage.location=n.event.location}else if(mi(n,"poll")){if((o=n.poll).selectableCount||(o.selectableCount=0),(a=n.poll).toAnnouncementGroup||(a.toAnnouncementGroup=!1),!Array.isArray(n.poll.values))throw new nc.Boom("Invalid poll values",{statusCode:400});if(n.poll.selectableCount<0||n.poll.selectableCount>n.poll.values.length)throw new nc.Boom(`poll.selectableCount in poll should be >= 0 and <= ${n.poll.values.length}`,{statusCode:400});e.messageContextInfo={messageSecret:n.poll.messageSecret||ZU(32)};let i={name:n.poll.name,selectableOptionsCount:n.poll.selectableCount,options:n.poll.values.map(A=>({optionName:A}))};n.poll.toAnnouncementGroup?e.pollCreationMessageV2=i:n.poll.selectableCount===1?e.pollCreationMessageV3=i:e.pollCreationMessage=i}else mi(n,"album")?e.albumMessage={expectedImageCount:n.album.expectedImageCount,expectedVideoCount:n.album.expectedVideoCount}:mi(n,"sharePhoneNumber")?e.protocolMessage={type:ne.Message.ProtocolMessage.Type.SHARE_PHONE_NUMBER}:mi(n,"requestPhoneNumber")?e.requestPhoneNumberMessage={}:mi(n,"limitSharing")?e.protocolMessage={type:ne.Message.ProtocolMessage.Type.LIMIT_SHARING,limitSharing:{sharingLimited:n.limitSharing===!0,trigger:1,limitSharingSettingTimestamp:Date.now(),initiatedByMe:!0}}:e=await qf(n,t);if(Ep(n,"viewOnce")&&n.viewOnce&&(e={viewOnceMessage:{message:e}}),Ep(n,"mentions")&&n.mentions?.length||Ep(n,"mentionAll")&&n.mentionAll){let i=Object.keys(e)[0],A=e[i];A&&"contextInfo"in A?(A.contextInfo=A.contextInfo||{},n.mentions?.length&&(A.contextInfo.mentionedJid=n.mentions),n.mentionAll&&(A.contextInfo.nonJidMentions=1)):A&&(A.contextInfo={mentionedJid:n.mentions,nonJidMentions:n.mentionAll?1:0})}if(Ep(n,"edit")&&(e={protocolMessage:{key:n.edit,editedMessage:e,timestampMs:Date.now(),type:ne.Message.ProtocolMessage.Type.MESSAGE_EDIT}}),Ep(n,"contextInfo")&&n.contextInfo){let i=Object.keys(e)[0],A=e[i];"contextInfo"in A&&A.contextInfo?A.contextInfo={...A.contextInfo,...n.contextInfo}:A&&(A.contextInfo=n.contextInfo)}return Ep(n,"albumParentKey")&&n.albumParentKey&&(e.messageContextInfo={...e.messageContextInfo,messageAssociation:{associationType:ne.MessageAssociation.AssociationType.MEDIA_ALBUM,parentMessageKey:n.albumParentKey}}),zb(e)&&(e.messageContextInfo=e.messageContextInfo||{},e.messageContextInfo.messageSecret||(e.messageContextInfo.messageSecret=ZU(32))),ne.Message.create(e)},QVe=(n,t,o)=>{o.timestamp||(o.timestamp=new Date);let a=Si(t),e=zf(a),i=vi(o.timestamp),{quoted:A,userJid:r}=o;if(A&&!aI(n)){let g=A.key.fromMe?r:A.participant||A.key.participant||A.key.remoteJid,c=Si(A.message),I=zf(c);c=ne.Message.create({[I]:c[I]});let p=c[I];typeof p=="object"&&p&&"contextInfo"in p&&delete p.contextInfo;let B="contextInfo"in a[e]&&a[e]?.contextInfo||{};B.participant=BA(g),B.stanzaId=A.key.id,B.quotedMessage=c,n!==A.key.remoteJid&&(B.remoteJid=A.key.remoteJid),B&&a[e]&&(a[e].contextInfo=B)}o?.ephemeralExpiration&&e!=="protocolMessage"&&e!=="ephemeralMessage"&&!aI(n)&&(a[e].contextInfo={...a[e].contextInfo||{},expiration:o.ephemeralExpiration||Vf}),t=ne.Message.create(t);let s={key:{remoteJid:n,fromMe:!0,id:o?.messageId||Vr()},message:t,messageTimestamp:i,messageStubParameters:[],participant:qr(n)||zg(n)?r:void 0,status:bh.PENDING};return ne.WebMessageInfo.fromObject(s)},tse=async(n,t,o)=>(o.logger=o?.logger?.child({msgId:o.messageId}),QVe(n,await fVe(t,{...o,jid:n}),o)),zf=n=>{if(n)return Object.keys(n).find(a=>(a==="conversation"||a.includes("Message"))&&a!=="senderKeyDistributionMessage")},Si=n=>{if(!n)return;for(let o=0;o<5;o++){let a=t(n);if(!a)break;n=a.message}return n;function t(o){return o?.ephemeralMessage||o?.viewOnceMessage||o?.documentWithCaptionMessage||o?.viewOnceMessageV2||o?.viewOnceMessageV2Extension||o?.editedMessage||o?.associatedChildMessage||o?.groupStatusMessage||o?.groupStatusMessageV2}},rse=n=>{let t=o=>o.imageMessage?{imageMessage:o.imageMessage}:o.documentMessage?{documentMessage:o.documentMessage}:o.videoMessage?{videoMessage:o.videoMessage}:o.locationMessage?{locationMessage:o.locationMessage}:{conversation:"contentText"in o?o.contentText:"hydratedContentText"in o?o.hydratedContentText:""};return n=Si(n),n?.buttonsMessage?t(n.buttonsMessage):n?.templateMessage?.hydratedFourRowTemplate?t(n?.templateMessage?.hydratedFourRowTemplate):n?.templateMessage?.hydratedTemplate?t(n?.templateMessage?.hydratedTemplate):n?.templateMessage?.fourRowTemplate?t(n?.templateMessage?.fourRowTemplate):n};var $U=(n,t)=>{n.userReceipt=n.userReceipt||[];let o=n.userReceipt.find(a=>a.userJid===t.userJid);o?Object.assign(o,t):n.userReceipt.push(t)},eH=(n,t)=>{let o=vh(t.key),a=(n.reactions||[]).filter(e=>vh(e.key)!==o);t.text=t.text||"",a.push(t),n.reactions=a};var ise=n=>{let t={};for(let{remoteJid:o,id:a,participant:e,fromMe:i}of n)if(!i){let A=`${o}:${e||""}`;t[A]||(t[A]={jid:o,participant:e,messageIds:[]}),t[A].messageIds.push(a)}return Object.values(t)},yVe=[410,404],AH=async(n,t,o,a)=>{return await i().catch(async A=>{if(a&&typeof A?.status=="number"&&yVe.includes(A.status))return a.logger.info({key:n.key},"sending reupload media request..."),n=await a.reuploadRequest(n),await i();throw A});async function i(){let A=rse(n.message);if(!A)throw new nc.Boom("No message present",{statusCode:400,data:n});let r=zf(A),s=r?.replace("Message",""),g=A[r];if(!g||typeof g!="object"||!("url"in g)&&!("thumbnailDirectPath"in g))throw new nc.Boom(`"${r}" message is not a media message`);let c;"thumbnailDirectPath"in g&&!("url"in g)?(c={directPath:g.thumbnailDirectPath,mediaKey:g.mediaKey},s="thumbnail-link"):c=g;let I=await OE(c,s,o);if(t==="buffer"){let p=[];for await(let B of I)p.push(B);return Buffer.concat(p)}return I}},ase=n=>{n=rse(n);let t=n?.documentMessage||n?.imageMessage||n?.videoMessage||n?.audioMessage||n?.stickerMessage;if(!t)throw new nc.Boom("given message is not a media message",{statusCode:400,data:n});return t};var Vb=ze(Jr(),1);import{createHash as DVe}from"crypto";function mVe(n,t){let o=[];for(let a=0;a({identifier:{name:n,deviceId:0},identifierKey:An(t)}),SVe=async({get:n},t,o)=>{let a=[];for(let e=t;e{let o=n.nextPreKeyId-n.firstUnuploadedPreKeyId,a=t-o,e=n.nextPreKeyId+a-1,i={};if(a>0)for(let A=n.nextPreKeyId;A<=e;A++)i[A]=br.generateKeyPair();return{newPreKeys:i,lastPreKeyId:e,preKeysRange:[n.firstUnuploadedPreKeyId,t]}},Wf=n=>({tag:"skey",attrs:{},content:[{tag:"id",attrs:{},content:Zg(n.keyId,3)},{tag:"value",attrs:{},content:n.keyPair.public},{tag:"signature",attrs:{},content:n.signature}]}),rH=(n,t)=>({tag:"key",attrs:{},content:[{tag:"id",attrs:{},content:Zg(t,3)},{tag:"value",attrs:{},content:n.public}]}),tH=n=>typeof n=="number"&&Number.isInteger(n),Ise=n=>{let t=le(n,"keys");if(!t)return null;let o=ki(t,"type");if(!o||o.length!==1||o[0]!==Wg[0])return null;let a=ki(t,"identity"),e=le(t,"skey");if(!a||a.length!==32||!e)return null;let i=oI(n,"registration",4);if(!tH(i))return null;let A=ki(e,"value"),r=ki(e,"signature"),s=oI(e,"id",3);if(!A||A.length!==32||!r||!tH(s))return null;let g=le(t,"key"),c;if(g){let I=ki(g,"value"),p=oI(g,"id",3);if(!I||I.length!==32||!tH(p))return null;c={keyId:p,publicKey:An(I)}}return{registrationId:i,identityKey:An(a),signedPreKey:{keyId:s,publicKey:An(A),signature:r},preKey:c}},lse=async(n,t)=>{let o=A=>A?{keyId:oI(A,"id",3),publicKey:An(ki(A,"value")),signature:ki(A,"signature")}:void 0,a=PA(le(n,"list"),"user");for(let A of a)Za(A);let i=mVe(a,100);for(let A of i)for(let r of A){let s=le(r,"skey"),g=le(r,"key"),c=ki(r,"identity"),I=r.attrs.jid,p=oI(r,"registration",4);await t.injectE2ESession({jid:I,session:{registrationId:p,identityKey:An(c),signedPreKey:o(s),preKey:o(g)}})}},pse=(n,t,o,a)=>{let{user:e,device:i}=hA(t),A=[];for(let r of n){let{devices:s,id:g}=r,c=hA(g),{user:I,server:p}=c,{domainType:B}=c,f=s?.deviceList;if(Array.isArray(f))for(let{id:Q,keyIndex:y,isHosted:m}of f)(!a||Q!==0)&&(e!==I&&o!==I||i!==Q)&&(Q===0||y)&&(m&&(B=B===Zt.LID?Zt.HOSTED_LID:Zt.HOSTED),A.push({user:I,device:Q,domainType:B,server:E$(p,B)}))}return A},iH=async({creds:n,keys:t},o)=>{let{newPreKeys:a,lastPreKeyId:e,preKeysRange:i}=wVe(n,o),A={nextPreKeyId:Math.max(e+1,n.nextPreKeyId),firstUnuploadedPreKeyId:Math.max(n.firstUnuploadedPreKeyId,e+1)};await t.set({"pre-key":a});let r=await SVe(t,i[0],i[0]+i[1]);return{update:A,preKeys:r}},dse=async(n,t)=>{let{creds:o}=n,{update:a,preKeys:e}=await iH(n,t),i={tag:"iq",attrs:{xmlns:"encrypt",type:"set",to:OA},content:[{tag:"registration",attrs:{},content:Zg(o.registrationId)},{tag:"type",attrs:{},content:Wg},{tag:"identity",attrs:{},content:o.signedIdentityKey.public},{tag:"list",attrs:{},content:Object.keys(e).map(A=>rH(e[+A],+A))},Wf(o.signedPreKey)]};return{update:a,node:i}};var OVe=n=>({appVersion:{primary:n.version[0],secondary:n.version[1],tertiary:n.version[2]},platform:n.browser[1].toLocaleLowerCase().includes("android")?ne.ClientPayload.UserAgent.Platform.ANDROID:ne.ClientPayload.UserAgent.Platform.WEB,releaseChannel:ne.ClientPayload.UserAgent.ReleaseChannel.RELEASE,osVersion:"0.1",device:"Desktop",osBuildNumber:"0.1",localeLanguageIso6391:"en",mnc:"000",mcc:"000",localeCountryIso31661Alpha2:n.countryCode}),hse={"Mac OS":ne.ClientPayload.WebInfo.WebSubPlatform.DARWIN,Windows:ne.ClientPayload.WebInfo.WebSubPlatform.WIN32},bVe=n=>{let t=ne.ClientPayload.WebInfo.WebSubPlatform.WEB_BROWSER;return n.syncFullHistory&&hse[n.browser[0]]&&n.browser[1]==="Desktop"&&(t=hse[n.browser[0]]),{webSubPlatform:t}},Ese=n=>{let t={connectType:ne.ClientPayload.ConnectType.WIFI_UNKNOWN,connectReason:ne.ClientPayload.ConnectReason.USER_ACTIVATED,userAgent:OVe(n)};return n.browser[1].toLocaleLowerCase().includes("android")||(t.webInfo=bVe(n)),n.pushName&&(t.pushName=n.pushName),t},use=(n,t)=>{let{user:o,device:a}=hA(n),e={...Ese(t),passive:!0,pull:!0,username:+o,device:a,lidDbMigrated:!1};return ne.ClientPayload.fromObject(e)},MVe=n=>{let t=n.toUpperCase();return t==="ANDROID"?ne.DeviceProps.PlatformType.ANDROID_PHONE:ne.DeviceProps.PlatformType[t]||ne.DeviceProps.PlatformType.CHROME},Cse=({registrationId:n,signedPreKey:t,signedIdentityKey:o},a)=>{let e=DVe("md5").update(a.version.join(".")).digest(),i={os:a.browser[0],platformType:MVe(a.browser[1]),requireFullSync:a.syncFullHistory,historySyncConfig:{storageQuotaMb:10240,inlineInitialPayloadInE2EeMsg:!0,recentSyncDaysLimit:void 0,supportCallLogHistory:!1,supportBotUserAgentChatHistory:!0,supportCagReactionsAndPolls:!0,supportBizHostedMsg:!0,supportRecentSyncChunkMessageCountTuning:!0,supportHostedGroupMsg:!0,supportFbidBotChatHistory:!0,supportAddOnHistorySyncMigration:void 0,supportMessageAssociation:!0,supportGroupHistory:!1,onDemandReady:void 0,supportGuestChat:void 0},version:{primary:10,secondary:15,tertiary:7}},A=ne.DeviceProps.encode(i).finish(),r={...Ese(a),passive:!1,pull:!1,devicePairingData:{buildHash:e,deviceProps:A,eRegid:Zg(n),eKeytype:Wg,eIdent:o.public,eSkeyId:Zg(t.keyId,3),eSkeyVal:t.keyPair.public,eSkeySig:t.signature}};return ne.ClientPayload.fromObject(r)},Bse=(n,{advSecretKey:t,signedIdentityKey:o,signalIdentities:a})=>{let e=n.attrs.id,i=le(n,"pair-success"),A=le(i,"device-identity"),r=le(i,"platform"),s=le(i,"device"),g=le(i,"biz");if(!A||!s)throw new Vb.Boom("Missing device-identity or device in pair success node",{data:n});let c=g?.attrs.name,I=s.attrs.jid,p=s.attrs.lid,{details:B,hmac:f,accountType:Q}=ne.ADVSignedDeviceIdentityHMAC.decode(A.content),y=Buffer.from([]);Q!==void 0&&Q===ne.ADVEncryptionType.HOSTED&&(y=aH);let m=Wn(Buffer.concat([y,B]),Buffer.from(t,"base64"));if(Buffer.compare(f,m)!==0)throw new Vb.Boom("Invalid account signature");let T=ne.ADVSignedDeviceIdentity.decode(B),{accountSignatureKey:_,accountSignature:R,details:L}=T,U=ne.ADVDeviceIdentity.decode(L),F=U.deviceType===ne.ADVEncryptionType.HOSTED?aH:fse,q=Buffer.concat([F,L,o.public]);if(!br.verify(_,q,R))throw new Vb.Boom("Failed to verify account signature");let z=Buffer.concat([Qse,L,o.public,_]);T.deviceSignature=br.sign(o.private,z);let K=cse(p,_),G=Zf(T,!1),V={tag:"iq",attrs:{to:OA,type:"result",id:e},content:[{tag:"pair-device-sign",attrs:{},content:[{tag:"device-identity",attrs:{"key-index":U.keyIndex.toString()},content:G}]}]};return{creds:{account:T,me:{id:I,name:c,lid:p},signalIdentities:[...a||[],K],platform:r?.attrs.name},reply:V}},Zf=(n,t)=>(n={...n},(!t||!n.accountSignatureKey?.length)&&(n.accountSignatureKey=null),ne.ADVSignedDeviceIdentity.encode(n).finish());var bE=ze(Jr(),1);var Sse=12,yse=Buffer.alloc(0),mse=n=>{let t=new ArrayBuffer(Sse);return new DataView(t).setUint32(8,n),new Uint8Array(t)},oH=class{constructor(t,o){this.encKey=t,this.decKey=o,this.readCounter=0,this.writeCounter=0,this.iv=new Uint8Array(Sse)}encrypt(t){let o=this.writeCounter++;return this.iv[8]=o>>>24&255,this.iv[9]=o>>>16&255,this.iv[10]=o>>>8&255,this.iv[11]=o&255,Jl(t,this.encKey,this.iv,yse)}decrypt(t){let o=this.readCounter++;return this.iv[8]=o>>>24&255,this.iv[9]=o>>>16&255,this.iv[10]=o>>>8&255,this.iv[11]=o&255,ql(t,this.decKey,this.iv,yse)}},wse=({keyPair:{private:n,public:t},NOISE_HEADER:o,logger:a,routingInfo:e})=>{a=a.child({class:"ns"});let i=Buffer.from(Dse),A=i.byteLength===32?i:kh(i),r=A,s=A,g=A,c=0,I=!1,p=Buffer.alloc(0),B=null,f=!1,Q=null,y;e?(y=Buffer.alloc(7+e.byteLength+o.length),y.write("ED",0,"utf8"),y.writeUint8(0,2),y.writeUint8(1,3),y.writeUint8(e.byteLength>>16,4),y.writeUint16BE(e.byteLength&65535,5),y.set(e,7),y.set(o,7+e.byteLength)):y=Buffer.from(o);let m=q=>{B||(A=kh(Buffer.concat([A,q])))},T=q=>{if(B)return B.encrypt(q);let z=Jl(q,s,mse(c++),A);return m(z),z},_=q=>{if(B)return B.decrypt(q);let z=ql(q,g,mse(c++),A);return m(q),z},R=q=>{let z=Vn(Buffer.from(q),64,{salt:r,info:""});return[z.subarray(0,32),z.subarray(32)]},L=q=>{let[z,K]=R(q);r=z,s=K,g=K,c=0},U=async()=>{f=!0;let[q,z]=R(new Uint8Array(0));B=new oH(q,z),f=!1,a.trace("Noise handler transitioned to Transport state"),Q&&(a.trace({length:p.length},"Flushing buffered frames after transport ready"),await F(Q),Q=null)},F=async q=>{let z;for(;;){if(p.length<3||(z=p[0]<<16|p[1]<<8|p[2],p.length{m(q.ephemeral),L(br.sharedKey(n,q.ephemeral));let K=_(q.static);L(br.sharedKey(n,K));let G=_(q.payload),{intermediate:V,leaf:H}=ne.CertChain.decode(G);if(!H?.details||!H?.signature)throw new bE.Boom("invalid noise leaf certificate",{statusCode:400});if(!V?.details||!V?.signature)throw new bE.Boom("invalid noise intermediate certificate",{statusCode:400});let N=ne.CertChain.NoiseCertificate.Details.decode(V.details),{issuerSerial:k}=N,J=br.verify(N.key,H.details,H.signature),X=br.verify(nH.PUBLIC_KEY,V.details,V.signature);if(!J)throw new bE.Boom("noise certificate signature invalid",{statusCode:400});if(!X)throw new bE.Boom("noise intermediate certificate signature invalid",{statusCode:400});if(k!==nH.SERIAL)throw new bE.Boom("certification match failed",{statusCode:400});let ie=T(z.public);return L(br.sharedKey(z.private,q.ephemeral)),ie},encodeFrame:q=>{B&&(q=B.encrypt(q));let z=q.byteLength,K=I?0:y.length,G=Buffer.allocUnsafe(K+3+z);return I||(G.set(y),I=!0),G[K]=z>>>16&255,G[K+1]=z>>>8&255,G[K+2]=z&255,G.set(q,K+3),G},decodeFrame:async(q,z)=>{if(f){p=Buffer.concat([p,q]),Q=z;return}p.length===0?p=Buffer.from(q):p=Buffer.concat([p,q]),await F(z)}}};import{pipeline as _Ve}from"stream/promises";import{promisify as TVe}from"util";import{createInflate as NVe,inflate as RVe}from"zlib";var kVe=TVe(RVe),vVe=n=>{for(let t of n){let o=t.message;if(!o?.key?.fromMe||!o.userReceipt?.length)continue;let a=o.userReceipt[0]?.userJid;if(a&&(Rt(a)||Or(a)))return a}},PVe=async(n,t)=>{let o=await OE(n,"md-msg-hist",{options:t}),a=NVe(),e=[];a.on("data",r=>e.push(r)),await _Ve(o,a);let i=Buffer.concat(e);return ne.HistorySync.decode(i)},GVe=(n,t)=>{let o=[],a=[],e=[],i=[];t?.trace({progress:n.progress},"processing history of type "+n.syncType?.toString());for(let A of n.phoneNumberToLidMappings||[])A.lidJid&&A.pnJid&&i.push({lid:A.lidJid,pn:A.pnJid});switch(n.syncType){case ne.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP:case ne.HistorySync.HistorySyncType.RECENT:case ne.HistorySync.HistorySyncType.FULL:case ne.HistorySync.HistorySyncType.ON_DEMAND:for(let A of n.conversations){a.push({id:A.id,name:A.displayName||A.name||A.username||void 0,username:A.username||void 0,lid:A.lidJid||A.accountLid||void 0,phoneNumber:A.pnJid||void 0});let r=A.id,s=qA(r)||Ci(r),g=Rt(r)||Or(r);if(s&&A.pnJid)i.push({lid:r,pn:A.pnJid});else if(g&&A.lidJid)i.push({lid:A.lidJid,pn:r});else if(s&&!A.pnJid){let I=vVe(A.messages||[]);I&&i.push({lid:r,pn:I})}let c=A.messages||[];delete A.messages;for(let I of c){let p=I.message;o.push(p),A.messages?.length||(A.messages=[{message:p}]),!p.key.fromMe&&!A.lastMessageRecvTimestamp&&(A.lastMessageRecvTimestamp=zr(p.messageTimestamp)),(p.messageStubType===RA.BIZ_PRIVACY_MODE_TO_BSP||p.messageStubType===RA.BIZ_PRIVACY_MODE_TO_FB)&&p.messageStubParameters?.[0]&&a.push({id:p.key.participant||p.key.remoteJid,verifiedName:p.messageStubParameters?.[0]})}e.push(A)}break;case ne.HistorySync.HistorySyncType.PUSH_NAME:for(let A of n.pushnames)a.push({id:A.id,notify:A.pushname});break}return{chats:e,contacts:a,messages:o,lidPnMappings:i,pastParticipants:n.pastParticipants,syncType:n.syncType,progress:n.progress}},Ose=async(n,t,o)=>{let a;return n.initialHistBootstrapInlinePayload?a=ne.HistorySync.decode(await kVe(n.initialHistBootstrapInlinePayload)):a=await PVe(n,t),GVe(a,o)},Wb=n=>(n?Si(n):void 0)?.protocolMessage?.historySyncNotification;var pn=ze(Jr(),1);var ig;(function(n){n.Chat="label_jid",n.Message="label_message"})(ig||(ig={}));var bse=new Th;var Mse=(n,t,o)=>{let a=[];if(!t)return o?.warn({hasFullName:!!n.fullName,hasLidJid:!!n.lidJid,hasPnJid:!!n.pnJid},"contactAction sync: missing id in index"),a;let e=n.lidJid,i=Rt(t),A=i?t:n.pnJid||void 0;return a.push({event:"contacts.upsert",data:[{id:t,name:n.fullName||n.firstName||n.username||void 0,username:n.username||void 0,lid:e||void 0,phoneNumber:A}]}),e&&qA(e)&&i&&a.push({event:"lid-mapping.update",data:{lid:e,pn:t}}),a},_se=(n,t)=>{for(let o of t)o.event==="contacts.upsert"?n.emit("contacts.upsert",o.data):n.emit("lid-mapping.update",o.data)};var Xf=n=>{let t=F$(n);return{indexKey:t.indexKey,valueEncryptionKey:t.valueEncryptionKey,valueMacKey:t.valueMacKey,snapshotMacKey:t.snapshotMacKey,patchMacKey:t.patchMacKey}},Tse=(n,t,o,a)=>{let e=n===ne.SyncdMutation.SyncdOperation.SET?1:2,i=typeof o=="string"?Buffer.from(o,"base64"):o,A=new Uint8Array(1+i.length);A[0]=e,A.set(i,1);let r=new Uint8Array(8);r[7]=A.length;let s=new Uint8Array(A.length+t.length+r.length);return s.set(A,0),s.set(t,A.length),s.set(r,A.length+t.length),Wn(s,a,"sha512").subarray(0,32)},Nse=n=>{let t=Buffer.alloc(8);return t.writeUint32BE(n,4),t},Rse=({indexValueMap:n,hash:t})=>{n={...n};let o=[],a=[];return{mix:({indexMac:e,valueMac:i,operation:A})=>{let r=Buffer.from(e).toString("base64"),s=n[r];if(A===ne.SyncdMutation.SyncdOperation.REMOVE){if(!s)return;delete n[r]}else o.push(i),n[r]={valueMac:i};s&&a.push(s.valueMac)},finish:()=>{let e=bse.subtractThenAdd(t,a,o);return{hash:Buffer.from(e),indexValueMap:n}}}},sH=(n,t,o,a)=>{let e=Buffer.concat([n,Nse(t),Buffer.from(o,"utf-8")]);return Wn(e,a,"sha256")},kse=(n,t,o,a,e)=>{let i=Buffer.concat([n,...t,Nse(o),Buffer.from(a,"utf-8")]);return Wn(i,e)},Zb=()=>({version:0,hash:Buffer.alloc(128),indexValueMap:{}}),gH=n=>((typeof n.version!="number"||isNaN(n.version))&&(n.version=0),n),cH=2,$f=n=>n?.data?.isMissingKey===!0,vse=(n,t)=>t>=cH||n?.name==="TypeError",Pse=async({type:n,index:t,syncAction:o,apiVersion:a,operation:e},i,A,r)=>{let s=i?await r(i):void 0;if(!s)throw new pn.Boom(`myAppStateKey ("${i}") not present`,{data:{isMissingKey:!0}});let g=Buffer.from(i,"base64");A={...A,indexValueMap:{...A.indexValueMap}};let c=Buffer.from(JSON.stringify(t)),I=ne.SyncActionData.fromObject({index:c,value:o,padding:new Uint8Array(0),version:a}),p=ne.SyncActionData.encode(I).finish(),B=Xf(s.keyData),f=J$(p,B.valueEncryptionKey),Q=Tse(e,f,g,B.valueMacKey),y=Wn(c,B.indexKey),m=Rse(A);m.mix({indexMac:y,valueMac:Q,operation:e}),Object.assign(A,m.finish()),A.version+=1;let T=sH(A.hash,A.version,n,B.snapshotMacKey),_={patchMac:kse(T,[Q],A.version,n,B.patchMacKey),snapshotMac:T,keyId:{id:g},mutations:[{operation:e,record:{index:{blob:y},value:{blob:Buffer.concat([f,Q])},keyId:{id:g}}}]},R=y.toString("base64");return A.indexValueMap[R]={valueMac:Q},{patch:_,state:A}},Gse=async(n,t,o,a,e)=>{let i=Rse(t),A=new Map;for(let s of n){let g="operation"in s?s.operation:ne.SyncdMutation.SyncdOperation.SET,c="record"in s&&s.record?s.record:s,I;try{I=await r(c.keyId.id)}catch(T){if($f(T))throw T;continue}let p=c.value.blob,B=p.subarray(0,-32),f=p.subarray(-32);if(e){let T=Tse(g,B,c.keyId.id,I.valueMacKey);if(Buffer.compare(T,f)!==0)continue}let Q;try{Q=j$(B,I.valueEncryptionKey)}catch{continue}let y=ne.SyncActionData.decode(Q);if(e){let T=Wn(y.index,I.indexKey);if(Buffer.compare(T,c.index.blob)!==0)throw new pn.Boom("HMAC index verification failed")}let m=Buffer.from(y.index).toString();a({syncAction:y,index:JSON.parse(m)}),i.mix({indexMac:c.index.blob,valueMac:f,operation:g})}return i.finish();async function r(s){let g=Buffer.from(s).toString("base64"),c=A.get(g);if(c)return c;let I=await o(g);if(!I)throw new pn.Boom(`failed to find key "${g}" to decode mutation`,{data:{isMissingKey:!0,msgMutations:n}});let p=Xf(I.keyData);return A.set(g,p),p}},FVe=async(n,t,o,a,e,i)=>{if(i){let r=Buffer.from(n.keyId.id).toString("base64"),s=await a(r);if(!s)throw new pn.Boom(`failed to find key "${r}" to decode patch`,{data:{isMissingKey:!0,msg:n}});let g=Xf(s.keyData),c=n.mutations.map(p=>p.record.value.blob.slice(-32)),I=kse(n.snapshotMac,c,zr(n.version.version),t,g.patchMacKey);if(Buffer.compare(I,n.patchMac)!==0)throw new pn.Boom("Invalid patch mac")}return await Gse(n.mutations,o,a,e,i)},Fse=async(n,t)=>{let o=le(n,"sync"),a=PA(o,"collection"),e={};return await Promise.all(a.map(async i=>{let A=le(i,"patches"),r=PA(A||i,"patch"),s=le(i,"snapshot"),g=[],c=i.attrs.name,I=i.attrs.has_more_patches==="true",p;if(s&&s.content){Buffer.isBuffer(s)||(s.content=Buffer.from(Object.values(s.content)));let B=ne.ExternalBlobReference.decode(s.content),f=await Lse(B,t);p=ne.SyncdSnapshot.decode(f)}for(let{content:B}of r)if(B){Buffer.isBuffer(B)||(B=Buffer.from(Object.values(B)));let f=ne.SyncdPatch.decode(B);f.version||(f.version={version:+i.attrs.version+1}),g.push(f)}e[c]={patches:g,hasMorePatches:I,snapshot:p}})),e},Lse=async(n,t)=>{let o=await OE(n,"md-app-state",{options:t}),a=[];for await(let e of o)a.push(e);return Buffer.concat(a)},LVe=async(n,t)=>{let o=await Lse(n,t);return ne.SyncdMutations.decode(o)},Use=async(n,t,o,a,e=!0,i)=>{let A=Zb();A.version=zr(t.version.version);let r={},s=typeof a>"u"||A.version>a,{hash:g,indexValueMap:c}=await Gse(t.records,A,o,s?I=>{let p=I.syncAction.index?.toString();r[p]=I}:()=>{},e);if(A.hash=g,A.indexValueMap=c,e){let I=Buffer.from(t.keyId.id).toString("base64"),p=await o(I);if(!p)throw new pn.Boom(`failed to find key "${I}" to decode mutation`,{data:{isMissingKey:!0}});let B=Xf(p.keyData),f=sH(A.hash,A.version,n,B.snapshotMacKey);Buffer.compare(t.mac,f)!==0&&i?.warn({name:n,version:A.version},"LTHash verification failed on snapshot, continuing with partial state")}return{state:A,mutationMap:r}},IH=async(n,t,o,a,e,i,A,r=!0)=>{let s={...o,indexValueMap:{...o.indexValueMap}},g={};for(let c of t){let{version:I,keyId:p,snapshotMac:B}=c;if(c.externalMutations){A?.trace({name:n,version:I},"downloading external patch");let m=await LVe(c.externalMutations,e);A?.debug({name:n,version:I,mutations:m.mutations.length},"downloaded external patch"),c.mutations?.push(...m.mutations)}let f=zr(I.version);s.version=f;let Q=typeof i>"u"||f>i,y;try{y=await FVe(c,n,s,a,Q?m=>{let T=m.syncAction.index?.toString();g[T]=m}:()=>{},r)}catch(m){if($f(m))throw m;A?.warn({name:n,version:f,error:m.message},"failed to decode patch, skipping");continue}if(s.hash=y.hash,s.indexValueMap=y.indexValueMap,r){let m=Buffer.from(p.id).toString("base64"),T=await a(m);if(!T)throw new pn.Boom(`failed to find key "${m}" to decode mutation`,{data:{isMissingKey:!0}});let _=Xf(T.keyData),R=sH(s.hash,s.version,n,_.snapshotMacKey);if(Buffer.compare(B,R)!==0){A?.warn({name:n,version:s.version},"LTHash verification failed, skipping remaining patches");break}}c.mutations=[]}return{state:s,mutationMap:g}},Hse=(n,t)=>{let o=ne.SyncdMutation.SyncdOperation,a=i=>{let A;return Array.isArray(i)?A={lastMessageTimestamp:i[i.length-1]?.messageTimestamp,messages:i?.length?i.map(s=>{if(!s.key?.id||!s.key?.remoteJid)throw new pn.Boom("Incomplete key",{statusCode:400,data:s});if(qr(s.key.remoteJid)&&!s.key.fromMe&&!s.key.participant)throw new pn.Boom("Expected not from me message to have participant",{statusCode:400,data:s});if(!s.messageTimestamp||!zr(s.messageTimestamp))throw new pn.Boom("Missing timestamp in last message list",{statusCode:400,data:s});return s.key.participant&&(s.key.participant=BA(s.key.participant)),s}):void 0}:A=i,A},e;if("mute"in n)e={syncAction:{muteAction:{muted:!!n.mute,muteEndTimestamp:n.mute||void 0}},index:["mute",t],type:"regular_high",apiVersion:2,operation:o.SET};else if("archive"in n)e={syncAction:{archiveChatAction:{archived:!!n.archive,messageRange:a(n.lastMessages)}},index:["archive",t],type:"regular_low",apiVersion:3,operation:o.SET};else if("markRead"in n)e={syncAction:{markChatAsReadAction:{read:n.markRead,messageRange:a(n.lastMessages)}},index:["markChatAsRead",t],type:"regular_low",apiVersion:3,operation:o.SET};else if("deleteForMe"in n){let{timestamp:i,key:A,deleteMedia:r}=n.deleteForMe;e={syncAction:{deleteMessageForMeAction:{deleteMedia:r,messageTimestamp:i}},index:["deleteMessageForMe",t,A.id,A.fromMe?"1":"0","0"],type:"regular_high",apiVersion:3,operation:o.SET}}else if("clear"in n)e={syncAction:{clearChatAction:{messageRange:a(n.lastMessages)}},index:["clearChat",t,"1","0"],type:"regular_high",apiVersion:6,operation:o.SET};else if("pin"in n)e={syncAction:{pinAction:{pinned:!!n.pin}},index:["pin_v1",t],type:"regular_low",apiVersion:5,operation:o.SET};else if("contact"in n)e={syncAction:{contactAction:n.contact||{}},index:["contact",t],type:"critical_unblock_low",apiVersion:2,operation:n.contact?o.SET:o.REMOVE};else if("disableLinkPreviews"in n)e={syncAction:{privacySettingDisableLinkPreviewsAction:n.disableLinkPreviews||{}},index:["setting_disableLinkPreviews"],type:"regular",apiVersion:8,operation:o.SET};else if("star"in n){let i=n.star.messages[0];e={syncAction:{starAction:{starred:!!n.star.star}},index:["star",t,i.id,i.fromMe?"1":"0","0"],type:"regular_low",apiVersion:2,operation:o.SET}}else if("delete"in n)e={syncAction:{deleteChatAction:{messageRange:a(n.lastMessages)}},index:["deleteChat",t,"1"],type:"regular_high",apiVersion:6,operation:o.SET};else if("pushNameSetting"in n)e={syncAction:{pushNameSetting:{name:n.pushNameSetting}},index:["setting_pushName"],type:"critical_block",apiVersion:1,operation:o.SET};else if("quickReply"in n)e={syncAction:{quickReplyAction:{count:0,deleted:n.quickReply.deleted||!1,keywords:[],message:n.quickReply.message||"",shortcut:n.quickReply.shortcut||""}},index:["quick_reply",n.quickReply.timestamp||String(Math.floor(Date.now()/1e3))],type:"regular",apiVersion:2,operation:o.SET};else if("addLabel"in n)e={syncAction:{labelEditAction:{name:n.addLabel.name,color:n.addLabel.color,predefinedId:n.addLabel.predefinedId,deleted:n.addLabel.deleted}},index:["label_edit",n.addLabel.id],type:"regular",apiVersion:3,operation:o.SET};else if("addChatLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!0}},index:[ig.Chat,n.addChatLabel.labelId,t],type:"regular",apiVersion:3,operation:o.SET};else if("removeChatLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!1}},index:[ig.Chat,n.removeChatLabel.labelId,t],type:"regular",apiVersion:3,operation:o.SET};else if("addMessageLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!0}},index:[ig.Message,n.addMessageLabel.labelId,t,n.addMessageLabel.messageId,"0","0"],type:"regular",apiVersion:3,operation:o.SET};else if("removeMessageLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!1}},index:[ig.Message,n.removeMessageLabel.labelId,t,n.removeMessageLabel.messageId,"0","0"],type:"regular",apiVersion:3,operation:o.SET};else throw new pn.Boom("not supported");return e.syncAction.timestamp=Date.now(),e},Kse=(n,t,o,a,e)=>{let i=!!a,A=a?.accountSettings;e?.trace({syncAction:n,initialSync:!!a},"processing sync action");let{syncAction:{value:r},index:[s,g,c,I]}=n;if(r?.muteAction)t.emit("chats.update",[{id:g,muteEndTime:r.muteAction?.muted?zr(r.muteAction.muteEndTimestamp):null,conditional:p(g,void 0)}]);else if(r?.archiveChatAction||s==="archive"||s==="unarchive"){let f=r?.archiveChatAction,Q=f?f.archived:s==="archive",y=A?.unarchiveChats?f?.messageRange:void 0;t.emit("chats.update",[{id:g,archived:Q,conditional:p(g,y)}])}else if(r?.markChatAsReadAction){let f=r.markChatAsReadAction,Q=i&&f.read;t.emit("chats.update",[{id:g,unreadCount:Q?null:f?.read?0:-1,conditional:p(g,f?.messageRange)}])}else if(r?.deleteMessageForMeAction||s==="deleteMessageForMe")t.emit("messages.delete",{keys:[{remoteJid:g,id:c,fromMe:I==="1"}]});else if(r?.contactAction){let f=Mse(r.contactAction,g,e);_se(t,f)}else if(r?.pushNameSetting){let f=r?.pushNameSetting?.name;f&&o?.name!==f&&t.emit("creds.update",{me:{...o,name:f}})}else if(r?.pinAction)t.emit("chats.update",[{id:g,pinned:r.pinAction?.pinned?zr(r.timestamp):null,conditional:p(g,void 0)}]);else if(r?.unarchiveChatsSetting){let f=!!r.unarchiveChatsSetting.unarchiveChats;t.emit("creds.update",{accountSettings:{unarchiveChats:f}}),e?.info(`archive setting updated => '${r.unarchiveChatsSetting.unarchiveChats}'`),A&&(A.unarchiveChats=f)}else if(r?.starAction||s==="star"){let f=r?.starAction?.starred;typeof f!="boolean"&&(f=n.index[n.index.length-1]==="1"),t.emit("messages.update",[{key:{remoteJid:g,id:c,fromMe:I==="1"},update:{starred:f}}])}else if(r?.deleteChatAction||s==="deleteChat")i||t.emit("chats.delete",[g]);else if(r?.labelEditAction){let{name:f,color:Q,deleted:y,predefinedId:m}=r.labelEditAction;t.emit("labels.edit",{id:g,name:f,color:Q,deleted:y,predefinedId:m?String(m):void 0})}else r?.labelAssociationAction?t.emit("labels.association",{type:r.labelAssociationAction.labeled?"add":"remove",association:s===ig.Chat?{type:ig.Chat,chatId:n.index[2],labelId:n.index[1]}:{type:ig.Message,chatId:n.index[2],messageId:n.index[3],labelId:n.index[1]}}):r?.localeSetting?.locale?t.emit("settings.update",{setting:"locale",value:r.localeSetting.locale}):r?.timeFormatAction?t.emit("settings.update",{setting:"timeFormat",value:r.timeFormatAction}):r?.pnForLidChatAction?r.pnForLidChatAction.pnJid&&t.emit("lid-mapping.update",{lid:g,pn:r.pnForLidChatAction.pnJid}):r?.privacySettingRelayAllCalls?t.emit("settings.update",{setting:"privacySettingRelayAllCalls",value:r.privacySettingRelayAllCalls}):r?.statusPrivacy?t.emit("settings.update",{setting:"statusPrivacy",value:r.statusPrivacy}):r?.lockChatAction?t.emit("chats.lock",{id:g,locked:!!r.lockChatAction.locked}):r?.privacySettingDisableLinkPreviewsAction?t.emit("settings.update",{setting:"disableLinkPreviews",value:r.privacySettingDisableLinkPreviewsAction}):r?.notificationActivitySettingAction?.notificationActivitySetting?t.emit("settings.update",{setting:"notificationActivitySetting",value:r.notificationActivitySettingAction.notificationActivitySetting}):r?.lidContactAction?t.emit("contacts.upsert",[{id:g,name:r.lidContactAction.fullName||r.lidContactAction.firstName||r.lidContactAction.username||void 0,username:r.lidContactAction.username||void 0,lid:g,phoneNumber:void 0}]):r?.privacySettingChannelsPersonalisedRecommendationAction?t.emit("settings.update",{setting:"channelsPersonalisedRecommendation",value:r.privacySettingChannelsPersonalisedRecommendationAction}):e?.debug({syncAction:n,id:g},"unprocessable update");function p(f,Q){return i?y=>{let m=y.historySets.chats[f]||y.chatUpserts[f];if(m)return Q?B(m,Q):!0}:void 0}function B(f,Q){let y=Number(Q?.lastMessageTimestamp||Q?.lastSystemMessageTimestamp||0),m=Number(f?.lastMessageRecvTimestamp||0);return y>=m}};var UVe=class{_eventListeners;_maxListeners;_logger;_throwOnEmitError=!1;_throwOnEmptyListeners=!1;_errorEvent="error";constructor(n){this._eventListeners=new Map,this._maxListeners=100,this._logger=n?.logger,n?.throwOnEmitError!==void 0&&(this._throwOnEmitError=n.throwOnEmitError),n?.throwOnEmptyListeners!==void 0&&(this._throwOnEmptyListeners=n.throwOnEmptyListeners)}get logger(){return this._logger}set logger(n){this._logger=n}get throwOnEmitError(){return this._throwOnEmitError}set throwOnEmitError(n){this._throwOnEmitError=n}get throwOnEmptyListeners(){return this._throwOnEmptyListeners}set throwOnEmptyListeners(n){this._throwOnEmptyListeners=n}once(n,t){let o=(...a)=>{this.off(n,o),t(...a)};return this.on(n,o),this}listenerCount(n){if(n===void 0)return this.getAllListeners().length;let t=this._eventListeners.get(n);return t?t.length:0}eventNames(){return[...this._eventListeners.keys()]}rawListeners(n){return n===void 0?this.getAllListeners():this._eventListeners.get(n)??[]}prependListener(n,t){let o=this._eventListeners.get(n)??[];return o.unshift(t),this._eventListeners.set(n,o),this}prependOnceListener(n,t){let o=(...a)=>{this.off(n,o),t(...a)};return this.prependListener(n,o),this}maxListeners(){return this._maxListeners}addListener(n,t){return this.on(n,t),this}on(n,t){this._eventListeners.has(n)||this._eventListeners.set(n,[]);let o=this._eventListeners.get(n);return o&&(o.length>=this._maxListeners&&console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${o.length+1} ${n} listeners added. Use setMaxListeners() to increase limit.`),o.push(t)),this}removeListener(n,t){return this.off(n,t),this}off(n,t){let o=this._eventListeners.get(n)??[],a=o.indexOf(t);return a!==-1&&o.splice(a,1),o.length===0&&this._eventListeners.delete(n),this}emit(n,...t){let o=!1,a=this._eventListeners.get(n);if(a&&a.length>0)for(let e of a)e(...t),o=!0;if(n===this._errorEvent){let e=t[0]instanceof Error?t[0]:new Error(`${t[0]}`);if(this._throwOnEmitError&&!o)throw e;if(this.listeners(this._errorEvent).length===0&&this._throwOnEmptyListeners===!0)throw e}return this.sendLog(n,t),o}listeners(n){return this._eventListeners.get(n)??[]}removeAllListeners(n){return n!==void 0?this._eventListeners.delete(n):this._eventListeners.clear(),this}setMaxListeners(n){this._maxListeners=n;for(let t of this._eventListeners.values())t.length>n&&t.splice(n)}getAllListeners(){let n=[];for(let t of this._eventListeners.values())n=[...n,...t];return n}sendLog(n,t){if(!this._logger)return;let o;switch(typeof t=="string"?o=t:Array.isArray(t)&&t.length>0&&t[0]instanceof Error?o=t[0].message:t instanceof Error?o=t.message:Array.isArray(t)&&t.length>0&&typeof t[0]?.message=="string"?o=t[0].message:o=JSON.stringify(t),n){case"error":{this._logger.error?.(o,{event:n,data:t});break}case"warn":{this._logger.warn?.(o,{event:n,data:t});break}case"trace":{this._logger.trace?.(o,{event:n,data:t});break}case"debug":{this._logger.debug?.(o,{event:n,data:t});break}case"fatal":{this._logger.fatal?.(o,{event:n,data:t});break}default:{this._logger.info?.(o,{event:n,data:t});break}}}},_I=class extends UVe{_hooks;_throwOnHookError=!1;_enforceBeforeAfter=!1;_deprecatedHooks;_allowDeprecated=!0;constructor(n){super({logger:n?.logger,throwOnEmitError:n?.throwOnEmitError,throwOnEmptyListeners:n?.throwOnEmptyListeners}),this._hooks=new Map,this._deprecatedHooks=n?.deprecatedHooks?new Map(n.deprecatedHooks):new Map,n?.throwOnHookError!==void 0?this._throwOnHookError=n.throwOnHookError:n?.throwHookErrors!==void 0&&(this._throwOnHookError=n.throwHookErrors),n?.enforceBeforeAfter!==void 0&&(this._enforceBeforeAfter=n.enforceBeforeAfter),n?.allowDeprecated!==void 0&&(this._allowDeprecated=n.allowDeprecated)}get hooks(){return this._hooks}get throwHookErrors(){return this._throwOnHookError}set throwHookErrors(n){this._throwOnHookError=n}get throwOnHookError(){return this._throwOnHookError}set throwOnHookError(n){this._throwOnHookError=n}get enforceBeforeAfter(){return this._enforceBeforeAfter}set enforceBeforeAfter(n){this._enforceBeforeAfter=n}get deprecatedHooks(){return this._deprecatedHooks}set deprecatedHooks(n){this._deprecatedHooks=n}get allowDeprecated(){return this._allowDeprecated}set allowDeprecated(n){this._allowDeprecated=n}validateHookName(n){if(this._enforceBeforeAfter){let t=n.trim().toLocaleLowerCase();if(!t.startsWith("before")&&!t.startsWith("after"))throw new Error(`Hook event "${n}" must start with "before" or "after" when enforceBeforeAfter is enabled`)}}checkDeprecatedHook(n){if(this._deprecatedHooks.has(n)){let t=this._deprecatedHooks.get(n),o=`Hook "${n}" is deprecated${t?`: ${t}`:""}`;return this.emit("warn",{hook:n,message:o}),this._allowDeprecated}return!0}onHook(n,t){this.onHookEntry({event:n,handler:t})}onHookEntry(n){if(this.validateHookName(n.event),!this.checkDeprecatedHook(n.event))return;let t=this._hooks.get(n.event);t?t.push(n.handler):this._hooks.set(n.event,[n.handler])}addHook(n,t){this.onHookEntry({event:n,handler:t})}onHooks(n){for(let t of n)this.onHook(t.event,t.handler)}prependHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);o?o.unshift(t):this._hooks.set(n,[t])}prependOnceHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=async(...a)=>(this.removeHook(n,o),t(...a));this.prependHook(n,o)}onceHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=async(...a)=>(this.removeHook(n,o),t(...a));this.onHook(n,o)}removeHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);if(o){let a=o.indexOf(t);a!==-1&&o.splice(a,1)}}removeHooks(n){for(let t of n)this.removeHook(t.event,t.handler)}async hook(n,...t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);if(o)for(let a of o)try{await a(...t)}catch(e){let i=`${n}: ${e.message}`;if(this.emit("error",new Error(i)),this._throwOnHookError)throw new Error(i)}}hookSync(n,...t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);if(o){for(let a of o)if(a.constructor.name!=="AsyncFunction")try{a(...t)}catch(e){let i=`${n}: ${e.message}`;if(this.emit("error",new Error(i)),this._throwOnHookError)throw new Error(i)}}}async beforeHook(n,...t){await this.hook(`before:${n}`,...t)}async afterHook(n,...t){await this.hook(`after:${n}`,...t)}async callHook(n,...t){await this.hook(n,...t)}getHooks(n){if(this.validateHookName(n),!!this.checkDeprecatedHook(n))return this._hooks.get(n)}clearHooks(){this._hooks.clear()}};var HVe=class{_enabled=!0;_maxSize=4e3;_store=new Map;_keys=[];constructor(n){n?.enabled!==void 0&&(this._enabled=n.enabled),n?.maxSize!==void 0&&(this._maxSize=n.maxSize)}get enabled(){return this._enabled}set enabled(n){this._enabled=n}get maxSize(){return this._maxSize}set maxSize(n){this._maxSize=n}get store(){return this._store}get size(){return this._store.size}get(n){return this._store.get(n)}set(n,t){if(this._enabled){if(this._store.has(n)){this._store.set(n,t);return}if(this._store.size>=this._maxSize){let o=this._keys.shift();o&&this._store.delete(o)}this._keys.push(n),this._store.set(n,t)}}has(n){return this._store.has(n)}clear(){this._store.clear(),this._keys=[]}},KVe=class{get name(){return"crc32"}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let i=n;t=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}let o=3988292384,a=4294967295;for(let i=0;i>>1^o&-(a&1)}return a=(a^4294967295)>>>0,a.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}},Xb=class{_algorithm="SHA-256";constructor(n){n?.algorithm&&(this._algorithm=n?.algorithm)}get name(){return this._algorithm}async toHash(n){let t=await crypto.subtle.digest(this._algorithm,n);return Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,"0")).join("")}},xVe=class{get name(){return"djb2"}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let e=n;t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let o=5381;for(let e=0;e>>0;return o.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}},YVe=class{get name(){return"fnv1"}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let A=n;t=new Uint8Array(A.buffer,A.byteOffset,A.byteLength)}let o=2166136261,a=16777619,e=o;for(let A=0;A>>0;return e.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}},jVe=class{_seed;constructor(n=0){this._seed=n>>>0}get name(){return"murmur"}get seed(){return this._seed}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let c=n;t=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}let o=3432918353,a=461845907,e=t.length,i=Math.floor(e/4),A=this._seed;for(let c=0;c>>16,A=this._imul(A,2246822507),A^=A>>>13,A=this._imul(A,3266489909),A^=A>>>16,A=A>>>0,A.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}_imul(n,t){if(Math.imul)return Math.imul(n,t);let o=n>>>16&65535,a=n&65535,e=t>>>16&65535,i=t&65535;return a*i+(o*i+a*e<<16>>>0)|0}_rotl32(n,t){return n<>>32-t}},JVe=class{_providers=new Map;_getFuzzy=!0;constructor(n){n?.providers&&this.loadProviders(n?.providers),n?.getFuzzy!==void 0&&(this._getFuzzy=!!n?.getFuzzy)}loadProviders(n){for(let t of n)this._providers.set(t.name,t)}get providers(){return this._providers}set providers(n){this._providers=n}get names(){return Array.from(this._providers.keys())}get(n,t){let o=t?.fuzzy??this._getFuzzy;n=n.trim();let a=this._providers.get(n);return a===void 0&&o===!0&&(n=n.toLowerCase(),a=this._providers.get(n)),a===void 0&&o===!0&&(n=n.replaceAll("-",""),a=this._providers.get(n)),a}add(n){this._providers.set(n.name,n)}remove(n){return this._providers.delete(n)}},lH=class extends _I{_parse=JSON.parse;_stringify=JSON.stringify;_providers=new JVe;_defaultAlgorithm="SHA-256";_defaultAlgorithmSync="djb2";_cache;constructor(n){super(n),n?.parse&&(this._parse=n.parse),n?.stringify&&(this._stringify=n.stringify),n?.defaultAlgorithm&&(this._defaultAlgorithm=n.defaultAlgorithm),n?.defaultAlgorithmSync&&(this._defaultAlgorithmSync=n.defaultAlgorithmSync),this._cache=new HVe(n?.cache),this.loadProviders(n?.providers,{includeBase:n?.includeBase??!0})}get parse(){return this._parse}set parse(n){this._parse=n}get stringify(){return this._stringify}set stringify(n){this._stringify=n}get providers(){return this._providers}set providers(n){this._providers=n}get names(){return this._providers.names}get defaultAlgorithm(){return this._defaultAlgorithm}set defaultAlgorithm(n){this._defaultAlgorithm=n}get defaultAlgorithmSync(){return this._defaultAlgorithmSync}set defaultAlgorithmSync(n){this._defaultAlgorithmSync=n}get cache(){return this._cache}async toHash(n,t){let o={data:n,algorithm:t?.algorithm??this._defaultAlgorithm,maxLength:t?.maxLength};await this.beforeHook("toHash",o);let a=this._stringify(o.data),e=`${o.algorithm}:${a}`;if(this._cache.enabled){let c=this._cache.get(e);if(c!==void 0){let I=c;t?.maxLength&&I.length>t.maxLength&&(I=I.substring(0,t.maxLength));let p={hash:I,data:o.data,algorithm:o.algorithm};return await this.afterHook("toHash",p),p.hash}}let A=new TextEncoder().encode(a),r=this._providers.get(o.algorithm);r||(this.emit("warn",`Invalid algorithm '${o.algorithm}' not found. Falling back to default algorithm '${this._defaultAlgorithm}'.`),r=new Xb({algorithm:this._defaultAlgorithm}));let s=await r.toHash(A);this._cache.enabled&&this._cache.set(e,s),t?.maxLength&&s.length>t?.maxLength&&(s=s.substring(0,t.maxLength));let g={hash:s,data:o.data,algorithm:o.algorithm};return await this.afterHook("toHash",g),g.hash}async toNumber(n,t={}){let{min:o=0,max:a=100,algorithm:e=this._defaultAlgorithm,hashLength:i=16}=t;if(o>a)throw new Error("min cannot be greater than max");let A=await this.toHash(n,{algorithm:e,maxLength:i}),r=Number.parseInt(A,16),s=a-o+1;return o+r%s}toHashSync(n,t){let o={data:n,algorithm:t?.algorithm??this._defaultAlgorithmSync,maxLength:t?.maxLength};this.hookSync("before:toHashSync",o);let a=o.algorithm,e=this._stringify(o.data),i=`${a}:${e}`;if(this._cache.enabled){let I=this._cache.get(i);if(I!==void 0){let p=I;t?.maxLength&&p.length>t.maxLength&&(p=p.substring(0,t.maxLength));let B={hash:p,data:o.data,algorithm:a};return this.hookSync("after:toHashSync",B),B.hash}}let r=new TextEncoder().encode(e),s=this._providers.get(a);if(!s&&(this.emit("warn",`Invalid algorithm '${a}' not found. Falling back to default algorithm '${this._defaultAlgorithmSync}'.`),s=this._providers.get(this._defaultAlgorithmSync),!s))throw new Error(`Hash provider '${this._defaultAlgorithmSync}' (default) not found`);if(!s.toHashSync)throw new Error(`Hash provider '${a}' does not support synchronous hashing. Use toHash() instead or choose a different algorithm (djb2, fnv1, murmur, crc32).`);let g=s.toHashSync(r);this._cache.enabled&&this._cache.set(i,g),t?.maxLength&&g.length>t?.maxLength&&(g=g.substring(0,t.maxLength));let c={hash:g,data:o.data,algorithm:o.algorithm};return this.hookSync("after:toHashSync",c),c.hash}toNumberSync(n,t={}){let{min:o=0,max:a=100,algorithm:e=this._defaultAlgorithmSync,hashLength:i=16}=t;if(o>a)throw new Error("min cannot be greater than max");let A=this.toHashSync(n,{algorithm:e,maxLength:i}),r=Number.parseInt(A,16),s=a-o+1;return o+r%s}loadProviders(n,t={includeBase:!0}){if(n)for(let o of n)this._providers.add(o);t.includeBase&&(this.providers.add(new Xb({algorithm:"SHA-256"})),this.providers.add(new Xb({algorithm:"SHA-384"})),this.providers.add(new Xb({algorithm:"SHA-512"})),this.providers.add(new KVe),this.providers.add(new xVe),this.providers.add(new YVe),this.providers.add(new jVe))}};var hH=n=>{let t;if(n!==void 0){if(typeof n=="number")t=n;else{if(typeof n!="string")return;if(n=n.trim(),Number.isNaN(Number(n))){let o=/^([\d.]+)\s*(ms|s|m|h|hr|d)$/i.exec(n);if(!o)throw new Error(`Unsupported time format: "${n}". Use 'ms', 's', 'm', 'h', 'hr', or 'd'.`);let[,a,e]=o,i=Number.parseFloat(a);switch(e.toLowerCase()){case"ms":t=i;break;case"s":t=i*1e3;break;case"m":t=i*1e3*60;break;case"h":t=i*1e3*60*60;break;case"hr":t=i*1e3*60*60;break;case"d":t=i*1e3*60*60*24;break;default:t=Number(n)}}else t=Number(n)}return t}},up=(n,t)=>{t??=new Date;let o=hH(n);return o===void 0?t.getTime():t.getTime()+o};var eQ=(function(n){return n.SHA256="SHA-256",n.SHA384="SHA-384",n.SHA512="SHA-512",n.DJB2="djb2",n.FNV1="fnv1",n.MURMER="murmer",n.CRC32="crc32",n})({});function pH(n,t={algorithm:"djb2",serialize:JSON.stringify}){let o=t?.algorithm??"djb2",a=(t?.serialize??JSON.stringify)(n);return new lH().toHashSync(a,{algorithm:o})}function xse(n,t={min:0,max:10,algorithm:"djb2",serialize:JSON.stringify}){let o=t?.min??0,a=t?.max??10,e=t?.algorithm??"djb2",i=t?.serialize??JSON.stringify,A=t?.hashLength??16;if(o>=a)throw new Error(`Invalid range: min (${o}) must be less than max (${a})`);let r=i(n);return new lH().toNumberSync(r,{algorithm:e,min:o,max:a,hashLength:A})}function EH(n,t){let{ttl:o,keyPrefix:a,cache:e,serialize:i}=t;return(...A)=>{let r=qVe(n,A,{keyPrefix:a,serialize:i});t.createKey&&(r=t.createKey(n,A,t));let s=e.get(r);if(s===void 0)try{s=n(...A),e.set(r,s,o)}catch(g){e.emit("error",g),t.cacheErrors&&e.set(r,g,o)}return s}}function uH(n,t,o){let a=typeof n=="function"?n(o):n,e;try{e=o.cache.get(a)}catch(i){if(o.cache.emit("error",i),o.throwErrors===!0||o.throwErrors==="store")throw i}if(e===void 0)try{try{e=t()}catch(i){throw new $b(i,"function")}try{o.cache.set(a,e,o.ttl)}catch(i){throw new $b(i,"store")}}catch(i){let A=i instanceof $b?i.context:void 0,r=i instanceof $b?i.error:i;if(o.cache.emit("error",r),o.cacheErrors&&A==="function")try{o.cache.set(a,r,o.ttl)}catch(s){o.cache.emit("error",s)}if(o.throwErrors===!0||o.throwErrors===A)throw r}return e}function qVe(n,t,o){let{keyPrefix:a,serialize:e}=o||{};return a?`${a}::${n.name}::${pH(t,{serialize:e})}`:`${n.name}::${pH(t,{serialize:e})}`}var $b=class{error;context;constructor(n,t){this.error=n,this.context=t}};var TI=class{_counters={hits:0,misses:0,gets:0,sets:0,deletes:0,clears:0,count:0};_vsize=0;_ksize=0;_enabled=!1;_lastUpdated;_lastReset;_subscriptions=[];_trackedKeys=new Map;_trackKeys=!1;_maxTrackedKeys;constructor(n){n?.enabled&&(this._enabled=n.enabled),n?.trackKeys&&(this._trackKeys=n.trackKeys),n?.maxTrackedKeys!==void 0&&(this._maxTrackedKeys=n.maxTrackedKeys),n?.emitter&&n?.eventMap&&this.subscribe(n.emitter,n.eventMap)}get enabled(){return this._enabled}set enabled(n){this._enabled=n}get trackKeys(){return this._trackKeys}set trackKeys(n){this._trackKeys=n}get maxTrackedKeys(){return this._maxTrackedKeys}set maxTrackedKeys(n){this._maxTrackedKeys=n}get trackedKeys(){return this._trackedKeys}get hits(){return this._counters.hits}get misses(){return this._counters.misses}get gets(){return this._counters.gets}get sets(){return this._counters.sets}get deletes(){return this._counters.deletes}get clears(){return this._counters.clears}get vsize(){return this._vsize}get ksize(){return this._ksize}get count(){return this._counters.count}get hitRate(){let n=this._counters.hits+this._counters.misses;return n===0?0:this._counters.hits/n}get missRate(){let n=this._counters.hits+this._counters.misses;return n===0?0:this._counters.misses/n}get lastUpdated(){return this._lastUpdated}get lastReset(){return this._lastReset}increment(n,t=1){this._enabled&&(this._counters[n]+=t,this.touch())}decrement(n,t=1){this._enabled&&(this._counters[n]-=t,this.touch())}incrementHits(n=1){this.increment("hits",n)}incrementMisses(n=1){this.increment("misses",n)}incrementGets(n=1){this.increment("gets",n)}incrementSets(n=1){this.increment("sets",n)}incrementDeletes(n=1){this.increment("deletes",n)}incrementClears(n=1){this.increment("clears",n)}incrementVSize(n){this._enabled&&(this._vsize+=this.roughSizeOfObject(n),this.touch())}decreaseVSize(n){this._enabled&&(this._vsize=Math.max(0,this._vsize-this.roughSizeOfObject(n)),this.touch())}incrementKSize(n){this._enabled&&(this._ksize+=this.roughSizeOfString(n),this.touch())}decreaseKSize(n){this._enabled&&(this._ksize=Math.max(0,this._ksize-this.roughSizeOfString(n)),this.touch())}incrementCount(n=1){this.increment("count",n)}decreaseCount(n=1){this._enabled&&(this._counters.count=Math.max(0,this._counters.count-n),this.touch())}setCount(n){this._enabled&&(this._counters.count=n,this.touch())}roughSizeOfString(n){return n.length*2}roughSizeOfObject(n){let t=[],o=[n],a=0;for(;o.length>0;){let e=o.pop();if(typeof e=="boolean")a+=4;else if(typeof e=="string")a+=e.length*2;else if(typeof e=="number")a+=8;else{if(e==null){a+=4;continue}if(t.includes(e))continue;t.push(e);for(let i in e)a+=i.length*2,o.push(e[i])}}return a}enable(){this._enabled=!0}disable(){this._enabled=!1}clear(){this.reset()}reset(){this._counters={hits:0,misses:0,gets:0,sets:0,deletes:0,clears:0,count:0},this._vsize=0,this._ksize=0,this._trackedKeys.clear(),this._lastReset=Date.now(),this._lastUpdated=void 0}resetStoreValues(){this._vsize=0,this._ksize=0,this._counters.count=0}toJSON(){return{enabled:this._enabled,hits:this._counters.hits,misses:this._counters.misses,gets:this._counters.gets,sets:this._counters.sets,deletes:this._counters.deletes,clears:this._counters.clears,vsize:this._vsize,ksize:this._ksize,count:this._counters.count,hitRate:this.hitRate,missRate:this.missRate,trackedKeys:this._trackedKeys.size,lastUpdated:this._lastUpdated,lastReset:this._lastReset}}snapshot(){return this.toJSON()}recordKey(n,t,o=1){if(!this._enabled||!this._trackKeys)return;let a=this._trackedKeys.get(n);a||(a={hits:0,misses:0,gets:0,sets:0,deletes:0},this._trackedKeys.set(n,a),this.pruneTrackedKeys(n)),a[t]+=o,this.touch()}mostUsedKeys(n=100,t){return this.sortedKeyEntries(t,"desc").slice(0,n)}leastUsedKeys(n=100,t){return this.sortedKeyEntries(t,"asc").slice(0,n)}keyStats(n){let t=this._trackedKeys.get(n);return t?this.toKeyEntry(n,t):void 0}clearKeys(){this._trackedKeys.clear()}totalOf(n){return n.hits+n.misses+n.gets+n.sets+n.deletes}toKeyEntry(n,t){let o=t.hits+t.misses;return{key:n,count:this.totalOf(t),hits:t.hits,misses:t.misses,gets:t.gets,sets:t.sets,deletes:t.deletes,hitRate:o===0?0:t.hits/o}}sortedKeyEntries(n,t){let o=[];for(let[e,i]of this._trackedKeys)o.push(this.toKeyEntry(e,i));let a=t==="asc"?1:-1;return o.sort((e,i)=>{let A=n?e[n]:e.count,r=n?i[n]:i.count;return A!==r?(A-r)*a:e.keythis.totalOf(a[1])-this.totalOf(e[1]));for(let[a]of o){if(this._trackedKeys.size<=t)break;a!==n&&this._trackedKeys.delete(a)}}subscribe(n,t){for(let[o,a]of Object.entries(t)){let e=(...i)=>{this.applyEvent(a,i)};n.on(o,e),this._subscriptions.push({emitter:n,event:o,listener:e})}}unsubscribe(n){let t=[];for(let o of this._subscriptions){if(n&&o.emitter!==n){t.push(o);continue}(o.emitter.off??o.emitter.removeListener)?.call(o.emitter,o.event,o.listener)}this._subscriptions=t}applyEvent(n,t){if(this._enabled){if(typeof n=="function"){n(this,...t);return}if(Array.isArray(n)){for(let o of n)this.increment(o);return}this.increment(n)}}touch(){this._lastUpdated=Date.now()}};var zVe=class{value;prev=void 0;next=void 0;constructor(n){this.value=n}},CH=class{head=void 0;tail=void 0;nodesMap=new Map;addToFront(n){let t=new zVe(n);this.head?(t.next=this.head,this.head.prev=t,this.head=t):this.head=this.tail=t,this.nodesMap.set(n,t)}moveToFront(n){let t=this.nodesMap.get(n);if(!t||this.head===t)return;t.prev&&(t.prev.next=t.next);t.next&&(t.next.prev=t.prev);t===this.tail&&(this.tail=t.prev),t.prev=void 0,t.next=this.head;this.head&&(this.head.prev=t),this.head=t,this.tail??=t}getOldest(){return this.tail?this.tail.value:void 0}removeOldest(){if(!this.tail)return;let n=this.tail.value;return this.tail.prev?(this.tail=this.tail.prev,this.tail.next=void 0):this.head=this.tail=void 0,this.nodesMap.delete(n),n}remove(n){let t=this.nodesMap.get(n);return t?(t.prev?t.prev.next=t.next:(this.head=t.next,this.head&&(this.head.prev=void 0)),t.next?t.next.prev=t.prev:(this.tail=t.prev,this.tail&&(this.tail.next=void 0)),this.nodesMap.delete(n),!0):!1}get size(){return this.nodesMap.size}};var Yse=16777216,BH=class extends _I{_lru=new CH;_storeHashSize=16;_storeHashAlgorithm=eQ.DJB2;_store=Array.from({length:this._storeHashSize},()=>new Map);_ttl;_maxTtl;_useClone=!0;_lruSize=0;_checkInterval=0;_interval=0;_stats=new TI({enabled:!1});constructor(n){super(),n?.ttl&&this.setTtl(n.ttl),n?.maxTtl!==void 0&&this.setMaxTtl(n.maxTtl),n?.useClone!==void 0&&(this._useClone=n.useClone),n?.stats&&(this._stats.enabled=n.stats),n?.storeHashSize&&n.storeHashSize>0&&(this._storeHashSize=n.storeHashSize),n?.lruSize&&(n.lruSize>16777216?this.emit("error",new Error(`LRU size cannot be larger than ${Yse} due to Map limitations.`)):this._lruSize=n.lruSize),n?.checkInterval&&(this._checkInterval=n.checkInterval),n?.storeHashAlgorithm&&(this._storeHashAlgorithm=n.storeHashAlgorithm),this._store=Array.from({length:this._storeHashSize},()=>new Map),this.startIntervalCheck()}get ttl(){return this._ttl}set ttl(n){this.setTtl(n)}get maxTtl(){return this._maxTtl}set maxTtl(n){this.setMaxTtl(n)}get useClone(){return this._useClone}set useClone(n){this._useClone=n}get lruSize(){return this._lruSize}set lruSize(n){if(n>16777216){this.emit("error",new Error(`LRU size cannot be larger than ${Yse} due to Map limitations.`));return}if(this._lruSize=n,this._lruSize===0){this._lru=new CH;return}this.lruResize()}get checkInterval(){return this._checkInterval}set checkInterval(n){this._checkInterval=n}get size(){let n=0;for(let t of this._store)n+=t.size;return n}get stats(){return this._stats}get storeHashSize(){return this._storeHashSize}set storeHashSize(n){n!==this._storeHashSize&&(this._storeHashSize=n,this._store=Array.from({length:this._storeHashSize},()=>new Map),this._stats.enabled&&this._stats.resetStoreValues())}get storeHashAlgorithm(){return this._storeHashAlgorithm}set storeHashAlgorithm(n){this._storeHashAlgorithm=n}get keys(){let n=[];for(let t of this._store)for(let o of t.keys()){let a=t.get(o);if(a&&this.hasExpired(a)){this.recordExpiration(a),t.delete(o),this.lruRemove(o);continue}n.push(o)}return n.values()}get items(){let n=[];for(let t of this._store)for(let o of t.values()){if(this.hasExpired(o)){this.recordExpiration(o),t.delete(o.key),this.lruRemove(o.key);continue}n.push(o)}return n.values()}get store(){return this._store}get(n){this.hookSync("BEFORE_GET",n);let t=this.getStore(n),o=t.get(n);if(!o){this.recordRead(!1),this.hookSync("AFTER_GET",{key:n,result:void 0});return}if(o.expires&&Date.now()>o.expires){this.recordExpiration(o),t.delete(n),this.lruRemove(n),this.recordRead(!1),this.hookSync("AFTER_GET",{key:n,result:void 0});return}this.lruMoveToFront(n);let a;return this._useClone?a=this.clone(o.value):a=o.value,this.recordRead(!0),this.hookSync("AFTER_GET",{key:n,result:a}),a}getMany(n){this.hookSync("BEFORE_GET_MANY",n);let t=[];for(let o of n)t.push(this.get(o));return this.hookSync("AFTER_GET_MANY",{keys:n,result:t}),t}getRaw(n){let t=this.getStore(n),o=t.get(n);if(!o){this.recordRead(!1);return}if(o.expires&&Date.now()>o.expires){this.recordExpiration(o),t.delete(n),this.lruRemove(n),this.recordRead(!1);return}return this.lruMoveToFront(n),this.recordRead(!0),o}getManyRaw(n){let t=[];for(let o of n)t.push(this.getRaw(o));return t}set(n,t,o){let a={key:n,value:t,ttl:o};this.hookSync("BEFORE_SET",a);let e=this.getStore(a.key),i,A=a.ttl;if(A!==void 0||this._ttl!==void 0)if(typeof A=="object"){if(A.expire&&(i=typeof A.expire=="number"?A.expire:A.expire.getTime()),A.ttl){let s=up(A.ttl);s!==void 0&&(i=s)}}else{let s=up(A??this._ttl);s!==void 0&&(i=s)}if(this._maxTtl!==void 0){let s=up(this._maxTtl);(i===void 0||i>s)&&(i=s)}if(this._lruSize>0){if(e.has(a.key))this.lruMoveToFront(a.key);else if(this.lruAddToFront(a.key),this._lru.size>this._lruSize){let s=this._lru.getOldest();s&&(this._lru.removeOldest(),this.delete(s))}}if(this._stats.enabled){let s=e.get(a.key);s?this._stats.decreaseVSize(s.value):(this._stats.incrementKSize(a.key),this._stats.incrementCount()),this._stats.incrementVSize(a.value),this._stats.incrementSets()}let r={key:a.key,value:a.value,expires:i};e.set(a.key,r),this.hookSync("AFTER_SET",a)}setMany(n){this.hookSync("BEFORE_SET_MANY",n);for(let t of n)this.set(t.key,t.value,t.ttl);this.hookSync("AFTER_SET_MANY",n)}has(n){return!!this.get(n)}hasMany(n){let t=[];for(let o of n){let a=this.get(o);t.push(!!a)}return t}take(n){let t=this.get(n);if(t)return this.delete(n),t}takeMany(n){let t=[];for(let o of n)t.push(this.take(o));return t}delete(n){this.hookSync("BEFORE_DELETE",n);let t=this.getStore(n);if(this._stats.enabled){let o=t.get(n);o&&(this._stats.decreaseKSize(n),this._stats.decreaseVSize(o.value),this._stats.decreaseCount(),this._stats.incrementDeletes())}t.delete(n),this.lruRemove(n),this.hookSync("AFTER_DELETE",n)}deleteMany(n){this.hookSync("BEFORE_DELETE_MANY",n);for(let t of n)this.delete(t);this.hookSync("AFTER_DELETE_MANY",n)}clear(){this.hookSync("BEFORE_CLEAR"),this._store=Array.from({length:this._storeHashSize},()=>new Map),this._lru=new CH,this._stats.enabled&&(this._stats.resetStoreValues(),this._stats.incrementClears()),this.hookSync("AFTER_CLEAR")}getStore(n){let t=this.getKeyStoreHash(n);return this._store[t]||=new Map,this._store[t]}getKeyStoreHash(n){return this._store.length===1?0:typeof this._storeHashAlgorithm=="function"?this._storeHashAlgorithm(n,this._storeHashSize):xse(n,{min:0,max:this._storeHashSize-1,algorithm:this._storeHashAlgorithm})}clone(n){return this.isPrimitive(n)?n:structuredClone(n)}lruAddToFront(n){this._lruSize!==0&&this._lru.addToFront(n)}lruMoveToFront(n){this._lruSize!==0&&this._lru.moveToFront(n)}lruRemove(n){this._lruSize!==0&&this._lru.remove(n)}lruResize(){for(;this._lru.size>this._lruSize;){let n=this._lru.getOldest();n&&(this._lru.removeOldest(),this.delete(n))}}checkExpiration(){for(let n of this._store)for(let t of n.values())t.expires&&Date.now()>t.expires&&(this.recordExpiration(t),n.delete(t.key),this.lruRemove(t.key))}startIntervalCheck(){if(this._checkInterval>0){this._interval&&clearInterval(this._interval),this._interval=setInterval(()=>{this.checkExpiration()},this._checkInterval).unref()}}stopIntervalCheck(){this._interval&&clearInterval(this._interval),this._interval=0,this._checkInterval=0}wrap(n,t){return EH(n,{ttl:t?.ttl??this._ttl,keyPrefix:t?.keyPrefix,createKey:t?.createKey,cache:this})}getOrSet(n,t,o){return uH(n,t,{cache:this,ttl:o?.ttl??this._ttl,cacheErrors:o?.cacheErrors,throwErrors:o?.throwErrors})}recordRead(n){this._stats.enabled&&(n?this._stats.incrementHits():this._stats.incrementMisses(),this._stats.incrementGets())}recordExpiration(n){this._stats.enabled&&(this._stats.decreaseKSize(n.key),this._stats.decreaseVSize(n.value),this._stats.decreaseCount())}isPrimitive(n){return n==null||typeof n=="string"||typeof n=="number"||typeof n=="boolean"}setTtl(n){typeof n=="string"||n===void 0?this._ttl=n:n>0?this._ttl=n:this._ttl=void 0}setMaxTtl(n){typeof n=="string"||n===void 0?this._maxTtl=n:n>0?this._maxTtl=n:this._maxTtl=void 0}hasExpired(n){return!!(n.expires&&Date.now()>n.expires)}};var AWe=class extends _I{options={stdTTL:0,checkperiod:600,useClones:!0,deleteOnExpire:!0,maxKeys:-1};store=new Map;_stats=new TI({enabled:!0});_cacheable=new BH;intervalId=0;constructor(n){super(),n&&(this.options={...this.options,...n}),this.startInterval()}set(n,t,o=0){if(typeof n!="string"&&typeof n!="number")throw this.createError("The key argument has to be of type `string` or `number`. Found: `__key`",n);if(o&&typeof o!="number"&&typeof o!="string")throw this.createError("The ttl argument has to be a number or a string for shorthand ttl.",this.formatKey(n));let a=this.formatKey(n),e=0;this.options.stdTTL&&(e=this.getExpirationTimestamp(this.options.stdTTL)),o&&(e=this.getExpirationTimestamp(o));let i=0;if(e&&e>0&&(i=e),this.options.maxKeys){let{maxKeys:A}=this.options;if(A>-1&&this.store.size>=A)throw this.createError("Cache max keys amount exceeded",this.formatKey(n))}return this.store.set(a,{key:a,value:t,ttl:i}),this.emit("set",a,t,e),this._stats.incrementKSize(a),this._stats.incrementVSize(t),this._stats.setCount(this.store.size),!0}mset(n){if(!Array.isArray(n))throw this.createError("The keys argument has to be an array.");for(let t of n)this.set(t.key,t.value,t.ttl);return!0}get(n){let t=this.store.get(this.formatKey(n));if(t){if(t.ttl>0){if(t.ttl0){let n=this.options.checkperiod*1e3;this.intervalId=setInterval(()=>{this.checkData()},n).unref();return}this.intervalId=0}stopInterval(){this.intervalId!==0&&(clearInterval(this.intervalId),this.intervalId=0)}formatKey(n){return n.toString()}getExpirationTimestamp(n){if(typeof n=="string")return up(n);let t=Date.now(),o=n*1e3;return t+o}checkData(){for(let[n,t]of this.store.entries())t.ttl>0&&t.ttl{let i={resolve:a,reject:e,weight:t,priority:o},A=Jse(this._queue,r=>o<=r.priority);A===-1&&t<=this._value?this._dispatchItem(i):this._queue.splice(A+1,0,i)})}runExclusive(t){return rWe(this,arguments,void 0,function*(o,a=1,e=0){let[i,A]=yield this.acquire(a,e);try{return yield o(i)}finally{A()}})}waitForUnlock(t=1,o=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return this._couldLockImmediately(t,o)?Promise.resolve():new Promise(a=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),iWe(this._weightedWaiters[t-1],{resolve:a,priority:o})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatchQueue()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatchQueue()}cancel(){this._queue.forEach(t=>t.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(t){let o=this._value;this._value-=t.weight,t.resolve([o,this._newReleaser(t.weight)])}_newReleaser(t){let o=!1;return()=>{o||(o=!0,this.release(t))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let t=this._value;t>0;t--){let o=this._weightedWaiters[t-1];o&&(o.forEach(a=>a.resolve()),this._weightedWaiters[t-1]=[])}else{let t=this._queue[0].priority;for(let o=this._value;o>0;o--){let a=this._weightedWaiters[o-1];if(!a)continue;let e=a.findIndex(i=>i.priority<=t);(e===-1?a:a.splice(0,e)).forEach((i=>i.resolve()))}}}_couldLockImmediately(t,o){return(this._queue.length===0||this._queue[0].priorityt.priority<=a.priority);n.splice(o+1,0,t)}function Jse(n,t){for(let o=n.length-1;o>=0;o--)if(t(n[o]))return o;return-1}var aWe=function(n,t,o,a){function e(i){return i instanceof o?i:new o(function(A){A(i)})}return new(o||(o=Promise))(function(i,A){function r(c){try{g(a.next(c))}catch(I){A(I)}}function s(c){try{g(a.throw(c))}catch(I){A(I)}}function g(c){c.done?i(c.value):e(c.value).then(r,s)}g((a=a.apply(n,t||[])).next())})},gc=class{constructor(t){this._semaphore=new fH(1,t)}acquire(){return aWe(this,arguments,void 0,function*(t=0){let[,o]=yield this._semaphore.acquire(1,t);return o})}runExclusive(t,o=0){return this._semaphore.runExclusive(()=>t(),1,o)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(t=0){return this._semaphore.waitForUnlock(1,t)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};import{randomBytes as cWe}from"crypto";var yH=ze(zse(),1);var mH=class n extends Error{name="TimeoutError";constructor(t,o){super(t,o),Error.captureStackTrace?.(this,n)}},Vse=n=>n.reason??new DOMException("This operation was aborted.","AbortError");function SH(n,t){let{milliseconds:o,fallback:a,message:e,customTimers:i={setTimeout,clearTimeout},signal:A}=t,r,s,c=new Promise((I,p)=>{if(typeof o!="number"||Math.sign(o)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${o}\``);if(A?.aborted){p(Vse(A));return}if(A&&(s=()=>{p(Vse(A))},A.addEventListener("abort",s,{once:!0})),n.then(I,p),o===Number.POSITIVE_INFINITY)return;let B=new mH;r=i.setTimeout.call(void 0,()=>{if(a){try{I(a())}catch(f){p(f)}return}typeof n.cancel=="function"&&n.cancel(),e===!1?I():e instanceof Error?p(e):(B.message=e??`Promise timed out after ${o} milliseconds`,p(B))},o)}).finally(()=>{c.clear(),s&&A&&A.removeEventListener("abort",s)});return c.clear=()=>{i.clearTimeout.call(void 0,r),r=void 0},c}function wH(n,t,o){let a=0,e=n.length;for(;e>0;){let i=Math.trunc(e/2),A=a+i;o(n[A],t)<=0?(a=++A,e-=i+1):e=i}return a}var sWe=100,ME=class{#e=[];#A=0;enqueue(t,o){let{priority:a=0,id:e}=o??{},{size:i}=this,A={priority:a,id:e,run:t};if(i===0){this.#e.length=0,this.#A=0,this.#e.push(A);return}if(this.#e.at(-1).priority>=a){this.#e.push(A);return}this.#t();let r=wH(this.#e,A,(s,g)=>g.priority-s.priority);this.#e.splice(r,0,A)}setPriority(t,o){let a=this.#e.findIndex((i,A)=>A>=this.#A&&i.id===t);if(a===-1)throw new ReferenceError(`No promise function with the id "${t}" exists in the queue.`);let[e]=this.#e.splice(a,1);this.enqueue(e.run,{priority:o,id:t})}remove(t){let o=this.#e.findIndex((a,e)=>esWe&&this.#A>this.#e.length/2&&this.#t(),t?.run}filter(t){let o=[];for(let a=this.#A;a=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);if(t.strict&&t.interval===0)throw new TypeError("The `strict` option requires a non-zero `interval`");if(t.strict&&t.intervalCap===Number.POSITIVE_INFINITY)throw new TypeError("The `strict` option requires a finite `intervalCap`");if(this.#e=t.carryoverIntervalCount??t.carryoverConcurrencyCount??!1,this.#A=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#r=t.intervalCap,this.#c=t.interval,this.#p=t.strict,this.#n=new t.queueClass,this.#h=t.queueClass,this.concurrency=t.concurrency,t.timeout!==void 0&&!(Number.isFinite(t.timeout)&&t.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${t.timeout}\` (${typeof t.timeout})`);this.timeout=t.timeout,this.#u=t.autoStart===!1,this.#J()}#w(t){for(;this.#l=this.#c)this.#l++;else break}(this.#l>100&&this.#l>this.#g.length/2||this.#l===this.#g.length)&&(this.#g=this.#g.slice(this.#l),this.#l=0)}#Q(t){this.#p?this.#g.push(t):this.#t++}#y(){this.#p?this.#g.length>this.#l&&this.#g.pop():this.#t>0&&this.#t--}#b(){return this.#g.length-this.#l}get#E(){return this.#A?!0:this.#p?this.#b()=this.#r){let a=this.#g[this.#l],e=this.#c-(t-a);return this.#T(e),!0}return!1}if(this.#a===void 0){let o=this.#i-t;if(o<0)this.#t=this.#e?this.#d:0;else return this.#T(o),!0}return!1}#T(t){this.#s===void 0&&(this.#s=setTimeout(()=>{this.#D()},t))}#N(){this.#a&&(clearInterval(this.#a),this.#a=void 0)}#P(){this.#s&&(clearTimeout(this.#s),this.#s=void 0)}#_(){if(this.#n.size===0){if(this.#N(),this.emit("empty"),this.#d===0){if(this.#P(),this.#p&&this.#l>0){let o=Date.now();this.#w(o)}this.emit("idle")}return!1}let t=!1;if(!this.#u){let o=Date.now(),a=!this.#S(o);if(this.#E&&this.#k){let e=this.#n.dequeue();this.#A||(this.#Q(o),this.#U()),a&&this.#G(),this.emit("active"),e(),t=!0}}return t}#G(){this.#A||this.#a!==void 0||this.#p||(this.#a=setInterval(()=>{this.#R()},this.#c),this.#i=Date.now()+this.#c)}#R(){this.#p||(this.#a!==void 0&&(this.#t===0&&this.#d===0?this.#N():this.#i=Date.now()+this.#c),this.#t=this.#e?this.#d:0),this.#x(),this.#U()}#x(){for(;this.#_(););}get concurrency(){return this.#C}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#C=t,this.#x()}setPriority(t,o){if(typeof o!="number"||!Number.isFinite(o))throw new TypeError(`Expected \`priority\` to be a finite number, got \`${o}\` (${typeof o})`);this.#n.setPriority(t,o)}async add(t,o={}){if(o={timeout:this.timeout,...o,id:o.id??(this.#B++).toString()},o.timeout!==void 0&&!(Number.isFinite(o.timeout)&&o.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${o.timeout}\` (${typeof o.timeout})`);return new Promise((a,e)=>{let i=Symbol(`task-${o.id}`),A=()=>{},r=async()=>{A(),this.#d++,this.#f.set(i,{id:o.id,priority:o.priority??0,startTime:Date.now(),timeout:o.timeout});let g;try{try{o.signal?.throwIfAborted()}catch(p){throw this.#F(),this.#f.delete(i),p}let c=t({signal:o.signal});if(o.timeout!==void 0&&(c=SH(Promise.resolve(c),{milliseconds:o.timeout,message:`Task timed out after ${o.timeout}ms (queue has ${this.#d} running, ${this.#n.size} waiting)`})),o.signal){let{signal:p}=o;c=Promise.race([c,new Promise((B,f)=>{g=()=>{f(p.reason)},p.addEventListener("abort",g,{once:!0})})])}let I=await c;a(I),this.emit("completed",I)}catch(c){e(c),this.emit("error",c)}finally{g&&o.signal?.removeEventListener("abort",g),this.#f.delete(i),queueMicrotask(()=>{this.#M()})}};this.#n.enqueue(r,o);let s=()=>{if(this.#n instanceof ME){this.#n.remove(r);return}this.#n.remove?.(o.id)};if(o.signal){let{signal:g}=o,c=()=>{A(),s(),e(g.reason),this.#_(),this.emit("next")};if(A=()=>{g.removeEventListener("abort",c),this.#m.delete(A)},g.aborted){c();return}g.addEventListener("abort",c,{once:!0}),this.#m.add(A)}this.emit("add"),this.#_()})}async addAll(t,o){return Promise.all(t.map(async a=>this.add(a,o)))}start(){return this.#u?(this.#u=!1,this.#x(),this):this}pause(){this.#u=!0}clear(){for(let t of this.#m)t();this.#n=new this.#h,this.#N(),this.#L(),this.emit("empty"),this.#d===0&&(this.#P(),this.emit("idle")),this.emit("next")}async onEmpty(){this.#n.size!==0&&await this.#K("empty")}async onSizeLessThan(t){this.#n.sizethis.#n.size{let a=e=>{this.off("error",a),o(e)};this.on("error",a)})}async#K(t,o){let a=Array.isArray(t)?t:[t];return new Promise(e=>{let i=()=>{if(!(o&&!o())){for(let A of a)this.off(A,i);e()}};for(let A of a)this.on(A,i)})}get size(){return this.#n.size}sizeBy(t){return this.#n.filter(t).length}get pending(){return this.#d}get isPaused(){return this.#u}#J(){this.#A||(this.on("add",()=>{this.#n.size>0&&this.#U()}),this.on("next",()=>{this.#U()}))}#U(){this.#A||this.#o||(this.#o=!0,queueMicrotask(()=>{this.#o=!1,this.#L()}))}#F(){this.#A||(this.#y(),this.#U())}#L(){let t=this.#I;if(this.#A||this.#n.size===0){t&&(this.#I=!1,this.emit("rateLimitCleared"));return}let o;if(this.#p){let e=Date.now();this.#w(e),o=this.#b()}else o=this.#t;let a=o>=this.#r;a!==t&&(this.#I=a,this.emit(a?"rateLimit":"rateLimitCleared"))}get isRateLimited(){return this.#I}get isSaturated(){return this.#d===this.#C&&this.#n.size>0||this.isRateLimited&&this.#n.size>0}get runningTasks(){return[...this.#f.values()].map(t=>({...t,timeoutRemaining:t.timeout?Math.max(0,t.startTime+t.timeout-Date.now()):void 0}))}};var AM=class{constructor(t,o){this.store=t,this.logger=o,this.queues=new Map}getQueue(t){return this.queues.has(t)||this.queues.set(t,new Cp({concurrency:1})),this.queues.get(t)}async processOperations(t,o,a,e,i){let A=t[o];if(A)return this.getQueue(o).add(async()=>{a[o]=a[o]||{},e[o]=e[o]||{};let r=[],s={};for(let g in A)A[g]===null?r.push(g):s[g]=A[g];Object.keys(s).length>0&&(Object.assign(a[o],s),Object.assign(e[o],s)),r.length>0&&await this.processDeletions(o,r,a,e,i)})}async processDeletions(t,o,a,e,i){if(i)for(let A of o)a[t]?.[A]?(a[t][A]=null,e[t][A]=null):this.logger.warn(`Skipping deletion of non-existent ${t} in transaction: ${A}`);else{let A=await this.store.get(t,o);for(let r of o)A[r]?(a[t][r]=null,e[t][r]=null):this.logger.warn(`Skipping deletion of non-existent ${t}: ${r}`)}}async validateDeletions(t,o){let a=t[o];if(a)return this.getQueue(o).add(async()=>{let e=Object.keys(a).filter(A=>a[A]===null);if(e.length===0)return;let i=await this.store.get(o,e);for(let A of e)i[A]||(this.logger.warn(`Skipping deletion of non-existent ${o}: ${A}`),delete t[o][A])})}};var Zse=(n,t,{maxCommitRetries:o,delayBetweenTriesMs:a})=>{let e=new gWe,i=new Map,A=new Map,r=new Map,s=new AM(n,t);function g(Q){return i.has(Q)||i.set(Q,new Cp({concurrency:1})),i.get(Q)}function c(Q){return A.has(Q)||(A.set(Q,new gc),r.set(Q,0)),A.get(Q)}function I(Q){let y=r.get(Q)??0;r.set(Q,y+1)}function p(Q){let y=(r.get(Q)??1)-1;if(r.set(Q,y),y<=0){let m=A.get(Q);m&&!m.isLocked()&&(A.delete(Q),r.delete(Q))}}function B(){return!!e.getStore()}async function f(Q){if(Object.keys(Q).length===0){t.trace("no mutations in transaction");return}t.trace("committing transaction");for(let y=0;y{let m=e.getStore();if(!m)return n.get(Q,y);let T=m.cache[Q]||{},_=y.filter(L=>!(L in T));if(_.length>0){m.dbQueries++,t.trace({type:Q,count:_.length},"fetching missing keys in transaction");let L=await c(Q).runExclusive(()=>n.get(Q,_));m.cache[Q]=m.cache[Q]||{},Object.assign(m.cache[Q],L)}let R={};for(let L of y){let U=m.cache[Q]?.[L];U!=null&&(R[L]=U)}return R},set:async Q=>{let y=e.getStore();if(!y){let m=Object.keys(Q);for(let T of m){let _=T;_==="pre-key"&&await s.validateDeletions(Q,_)}await Promise.all(m.map(T=>g(T).add(async()=>{let _={[T]:Q[T]};await n.set(_)})));return}t.trace({types:Object.keys(Q)},"caching in transaction");for(let m in Q){let T=m;y.cache[T]=y.cache[T]||{},y.mutations[T]=y.mutations[T]||{},T==="pre-key"?await s.processOperations(Q,T,y.cache,y.mutations,!0):(Object.assign(y.cache[T],Q[T]),Object.assign(y.mutations[T],Q[T]))}},isInTransaction:B,transaction:async(Q,y)=>{if(e.getStore())return t.trace("reusing existing transaction context"),Q();let T=c(y);I(y);try{return await T.runExclusive(async()=>{let _={cache:{},mutations:{},dbQueries:0};t.trace("entering transaction");try{let R=await e.run(_,Q);return await f(_.mutations),t.trace({dbQueries:_.dbQueries},"transaction completed"),R}catch(R){throw t.error({error:R},"transaction failed, rolling back"),R}})}finally{p(y)}}}},Xse=n=>{let t=n.me?.id;if(!t)throw new Wse.Boom("Cannot proceed: socket is not authenticated yet (creds.me.id is missing)",{statusCode:401});return t},$se=()=>{let n=br.generateKeyPair();return{noiseKey:br.generateKeyPair(),pairingEphemeralKeyPair:br.generateKeyPair(),signedIdentityKey:n,signedPreKey:HD(n,1),registrationId:X$(),advSecretKey:cWe(32).toString("base64"),processedHistoryMessages:[],nextPreKeyId:1,firstUnuploadedPreKeyId:1,accountSyncCounter:0,accountSettings:{unarchiveChats:!1},registered:!1,pairingCode:void 0,lastPropHash:void 0,routingInfo:void 0,additionalData:void 0}};import{mkdir as IWe,readFile as lWe,stat as pWe,unlink as dWe,writeFile as hWe}from"fs/promises";import{join as DH}from"path";var ege=new Map,OH=n=>{let t=ege.get(n);return t||(t=new gc,ege.set(n,t)),t},Age=async n=>{let t=async(r,s)=>{let g=DH(n,i(s));return OH(g).acquire().then(async I=>{try{await hWe(g,JSON.stringify(r,WB.replacer))}finally{I()}})},o=async r=>{try{let s=DH(n,i(r));return await OH(s).acquire().then(async c=>{try{let I=await lWe(s,{encoding:"utf-8"});return JSON.parse(I,WB.reviver)}finally{c()}})}catch{return null}},a=async r=>{try{let s=DH(n,i(r));return OH(s).acquire().then(async c=>{try{await dWe(s)}catch{}finally{c()}})}catch{}},e=await pWe(n).catch(()=>{});if(e){if(!e.isDirectory())throw new Error(`found something that is not a directory at ${n}, either delete it or specify a different location`)}else await IWe(n,{recursive:!0});let i=r=>r?.replace(/\//g,"__")?.replace(/:/g,"-"),A=await o("creds.json")||$se();return{state:{creds:A,keys:{get:async(r,s)=>{let g={};return await Promise.all(s.map(async c=>{let I=await o(`${r}-${c}.json`);r==="app-state-sync-key"&&I&&(I=ne.Message.AppStateSyncKeyData.fromObject(I)),g[c]=I})),g},set:async r=>{let s=[];for(let g in r)for(let c in r[g]){let I=r[g][c],p=`${g}-${c}.json`;s.push(I?t(I,p):a(p))}await Promise.all(s)}}},saveCreds:async()=>t(A,"creds.json")}};var EWe=192,uWe=async(n,{thumbnailWidth:t,fetchOpts:o})=>{let a=await Jb(n,o);return await JU(a,t)},tge=async(n,t={thumbnailWidth:EWe,fetchOpts:{timeout:3e3}})=>{try{let o=0,a=5,{getLinkPreview:e}=await import("link-preview-js"),i=n;!n.startsWith("https://")&&!n.startsWith("http://")&&(i="https://"+i);let A=await e(i,{...t.fetchOpts,followRedirects:"follow",handleRedirects:(r,s)=>{let g=new URL(r),c=new URL(s);return o>=a?!1:c.hostname===g.hostname||c.hostname==="www."+g.hostname||"www."+c.hostname===g.hostname?(o+=1,!0):!1},headers:t.fetchOpts?.headers});if(A&&"title"in A&&A.title){let[r]=A.images,s={"canonical-url":A.url,"matched-text":n,title:A.title,description:A.description,originalThumbnailUrl:r};if(t.uploadImage){let{imageMessage:g}=await qf({image:{url:r}},{upload:t.uploadImage,mediaTypeOverride:"thumbnail-link",options:t.fetchOpts});s.jpegThumbnail=g?.jpegThumbnail?Buffer.from(g.jpegThumbnail):void 0,s.highQualityThumbnail=g||void 0}else try{s.jpegThumbnail=r?(await uWe(r,t)).buffer:void 0}catch(g){t.logger?.debug({err:g.stack,url:i},"error in generating thumbnail")}return s}}catch(o){if(!o.message.includes("receive a valid"))throw o}};import OWe from"events";var MH=ze(Jr(),1);var CWe=/^1313555\d{4}$|^131655500\d{2}$/;function BWe(n){if(!n)return!1;let t=n.split("@")[0]??"";return t==="0"||CWe.test(t)||Mh(n)?!1:!!(Rt(n)||qA(n)||Or(n)||Ci(n)||n.endsWith("@c.us"))}var tM=604800,fWe=4,RI="__index";async function rM(n){let o=(await n.get("tctoken",[RI]))[RI];if(!o?.token?.length)return[];try{let a=JSON.parse(Buffer.from(o.token).toString());return Array.isArray(a)?a.filter(e=>typeof e=="string"&&e.length>0&&e!==RI):[]}catch{return[]}}async function _E(n,t){let o=await rM(n),a=new Set(o);for(let e of t)e&&e!==RI&&a.add(e);return{[RI]:{token:Buffer.from(JSON.stringify([...a]))}}}function Bp(n){if(n==null)return!0;let t=typeof n=="string"?parseInt(n):n;if(isNaN(t))return!0;let o=Math.floor(Date.now()/1e3),i=(Math.floor(o/tM)-(fWe-1))*tM;return ta}async function ag(n,t){return qA(n)?n:await t(n)??n}async function tQ(n,t,o,a){return t?qA(n)?n:await o(n)??n:qA(n)&&a?await a(n)??n:n}async function bH({authState:n,jid:t,baseContent:o=[],getLIDForPN:a}){try{let e=await ag(t,a),A=(await n.keys.get("tctoken",[e]))?.[e],r=A?.token,s=A?.timestamp;if(!r?.length||s===void 0||Bp(s)){if(r){let g=A?.senderTimestamp!==void 0?{token:Buffer.alloc(0),senderTimestamp:A.senderTimestamp}:null;await n.keys.set({tctoken:{[e]:g}})}return o.length>0?o:void 0}return o.push({tag:"tctoken",attrs:{t:String(s)},content:r}),o}catch{return o.length>0?o:void 0}}async function TE({result:n,fallbackJid:t,keys:o,getLIDForPN:a,onNewJidStored:e}){let i=le(n,"tokens");if(!i)return;let A=PA(i,"token");for(let r of A){if(r.attrs.type!=="trusted_contact"||!(r.content instanceof Uint8Array))continue;let s=BA(t||r.attrs.jid);if(!BWe(s))continue;let g=await ag(s,a),I=(await o.get("tctoken",[g]))[g],p=I?.timestamp?Number(I.timestamp):0,B=r.attrs.t?Number(r.attrs.t):0;B&&(p>0&&p>B||(await o.set({tctoken:{[g]:{...I,token:Buffer.from(r.content),timestamp:r.attrs.t}}}),e?.(g)))}}var QWe=new Set([RA.CALL_MISSED_GROUP_VIDEO,RA.CALL_MISSED_GROUP_VOICE,RA.CALL_MISSED_VIDEO,RA.CALL_MISSED_VOICE]),yWe=new Set([RA.GROUP_PARTICIPANT_ADD]);async function mWe(n,t,o,a){let e=t.lidMapping.getLIDForPN.bind(t.lidMapping),i=[];for(let g of n){let c=g.tcTokenTimestamp?zr(g.tcTokenTimestamp):0;if(g.tcToken?.length&&c>0){let I=BA(g.id),p=await ag(I,e);i.push({storageJid:p,token:Buffer.from(g.tcToken),ts:c,senderTs:g.tcTokenSenderTimestamp?zr(g.tcTokenSenderTimestamp):void 0})}}if(!i.length)return;let A=i.map(g=>g.storageJid),r=await o.get("tctoken",A),s={};for(let g of i){let c=r[g.storageJid],I=c?.timestamp?Number(c.timestamp):0;I>0&&I>=g.ts||(s[g.storageJid]={...c,token:g.token,timestamp:String(g.ts),...g.senderTs!==void 0?{senderTimestamp:g.senderTs}:{}})}if(Object.keys(s).length){a?.debug({count:Object.keys(s).length},"storing tctokens from history sync");try{let g=await _E(o,Object.keys(s));await o.set({tctoken:{...s,...g}})}catch(g){a?.warn({err:g},"failed to store tctokens from history sync")}}}var ige=(n,t,o)=>{Or(n.key.remoteJid)||Ci(n.key.remoteJid)?n.key.remoteJid=Dr(hA(n.key?.remoteJid)?.user,Or(n.key.remoteJid)?"s.whatsapp.net":"lid"):n.key.remoteJid=BA(n.key.remoteJid),Or(n.key.participant)||Ci(n.key.participant)?n.key.participant=Dr(hA(n.key.participant)?.user,Or(n.key.participant)?"s.whatsapp.net":"lid"):n.key.participant=BA(n.key.participant);let a=Si(n.message);a?.reactionMessage&&e(a.reactionMessage.key),a?.pollUpdateMessage&&e(a.pollUpdateMessage.pollCreationMessageKey);function e(i){n.key.fromMe||(i.fromMe=i.fromMe?!1:Dt(i.participant||i.remoteJid,t)||Dt(i.participant||i.remoteJid,o),i.remoteJid=n.key.remoteJid,i.participant=i.participant||n.key.participant)}},_H=n=>{let t=Si(n.message),o=!!zf(t);return(!!t||QWe.has(n.messageStubType)||yWe.has(n.messageStubType))&&o&&!t?.protocolMessage&&!t?.reactionMessage&&!t?.pollUpdateMessage},TH=n=>!n.key.fromMe&&!n.messageStubType,SWe=({remoteJid:n,participant:t,fromMe:o})=>{if(!n)throw new MH.Boom("Cannot derive chat id: message key is missing remoteJid",{data:{remoteJid:n,participant:t,fromMe:o}});if(HB(n)&&!zg(n)&&!o){if(!t)throw new MH.Boom("Cannot derive chat id: broadcast message key is missing participant",{data:{remoteJid:n,fromMe:o}});return t}return n};function wWe({encPayload:n,encIv:t},{eventCreatorJid:o,eventMsgId:a,eventEncKey:e,responderJid:i}){let A=Buffer.concat([I(a),I(o),I(i),I("Event Response"),new Uint8Array([1])]),r=Wn(e,new Uint8Array(32),"sha256"),s=Wn(A,r,"sha256"),g=I(`${a}\0${i}`),c=ql(n,s,t,g);return ne.Message.EventResponseMessage.decode(c);function I(p){return Buffer.from(p)}}var DWe=async(n,{shouldProcessHistoryMsg:t,placeholderResendCache:o,ev:a,creds:e,signalRepository:i,keyStore:A,logger:r,options:s,getMessage:g})=>{let c=e.me.id,{accountSettings:I}=e,p={id:BA(SWe(n.key))},B=_H(n);B&&(p.messages=[{message:n}],p.conversationTimestamp=zr(n.messageTimestamp),TH(n)&&(p.unreadCount=(p.unreadCount||0)+1));let f=Si(n.message);(B||f?.reactionMessage?.key?.fromMe)&&I?.unarchiveChats&&(p.archived=!1,p.readOnly=!1);let Q=f?.protocolMessage;if(Q){let y=new Set([ne.Message.ProtocolMessage.Type.HISTORY_SYNC_NOTIFICATION,ne.Message.ProtocolMessage.Type.APP_STATE_SYNC_KEY_SHARE,ne.Message.ProtocolMessage.Type.LID_MIGRATION_MAPPING_SYNC,ne.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE]);if(Q.type!==null&&Q.type!==void 0&&y.has(Q.type)&&!n.key.fromMe){r?.warn({msgId:n.key.id,type:Q.type,from:n.key.participant||n.key.remoteJid},"dropping spoofed self-only protocolMessage from non-self origin");return}switch(Q.type){case ne.Message.ProtocolMessage.Type.HISTORY_SYNC_NOTIFICATION:let m=Q.historySyncNotification,T=t,_=!e.processedHistoryMessages?.length;if(r?.info({histNotification:m,process:T,id:n.key.id,isLatest:_},"got history notification"),T){m.syncType!==ne.HistorySync.HistorySyncType.ON_DEMAND&&a.emit("creds.update",{processedHistoryMessages:[...e.processedHistoryMessages||[],{key:n.key,messageTimestamp:n.messageTimestamp}]});let G=await Ose(m,s,r);G.lidPnMappings?.length&&(r?.debug({count:G.lidPnMappings.length},"processing LID-PN mappings from history sync"),await i.lidMapping.storeLIDPNMappings(G.lidPnMappings).catch(V=>r?.warn({err:V},"failed to store LID-PN mappings from history sync"))),await mWe(G.chats,i,A,r),a.emit("messaging-history.set",{...G,isLatest:m.syncType!==ne.HistorySync.HistorySyncType.ON_DEMAND?_:void 0,chunkOrder:m.chunkOrder,peerDataRequestSessionId:m.peerDataRequestSessionId})}break;case ne.Message.ProtocolMessage.Type.APP_STATE_SYNC_KEY_SHARE:let R=Q.appStateSyncKeyShare.keys;if(R?.length){let G="";await A.transaction(async()=>{let V=[];for(let{keyData:H,keyId:N}of R){let k=Buffer.from(N.keyId).toString("base64");V.push(k),await A.set({"app-state-sync-key":{[k]:H}}),G=k}r?.info({newAppStateSyncKeyId:G,newKeys:V},"injecting new app state sync keys")},c),a.emit("creds.update",{myAppStateKeyId:G})}else r?.info({protocolMsg:Q},"recv app state sync with 0 keys");break;case ne.Message.ProtocolMessage.Type.REVOKE:a.emit("messages.update",[{key:{...n.key,id:Q.key.id},update:{message:null,messageStubType:RA.REVOKE,key:n.key}}]);break;case ne.Message.ProtocolMessage.Type.EPHEMERAL_SETTING:Object.assign(p,{ephemeralSettingTimestamp:zr(n.messageTimestamp),ephemeralExpiration:Q.ephemeralExpiration||null});break;case ne.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE:let L=Q.peerDataOperationRequestResponseMessage;if(L){let G=L.peerDataOperationResult||[];for(let V of G){let H=V?.placeholderMessageResendResponse;if(H?.webMessageInfoBytes)try{let N=ne.WebMessageInfo.decode(H.webMessageInfoBytes),k=N.key?.id,J=k?await o?.get(k):void 0;k&&await o?.del(k);let X;J&&typeof J=="object"?(J.message=N.message,N.messageTimestamp&&(J.messageTimestamp=N.messageTimestamp),X=J):X=N,r?.debug({msgId:k,requestId:L.stanzaId},"received placeholder resend"),a.emit("messages.upsert",{messages:[X],type:"notify",requestId:L.stanzaId})}catch(N){r?.warn({err:N,stanzaId:L.stanzaId},"failed to decode placeholder resend response")}}}break;case ne.Message.ProtocolMessage.Type.MESSAGE_EDIT:a.emit("messages.update",[{key:{...n.key,id:Q.key?.id},update:{message:{editedMessage:{message:Q.editedMessage}},messageTimestamp:Q.timestampMs?Math.floor(zr(Q.timestampMs)/1e3):n.messageTimestamp}}]);break;case ne.Message.ProtocolMessage.Type.GROUP_MEMBER_LABEL_CHANGE:let U=Q.memberLabel;U?.label&&a.emit("group.member-tag.update",{groupId:p.id,label:U.label,participant:n.key.participant,participantAlt:n.key.participantAlt,messageTimestamp:Number(n.messageTimestamp)});break;case ne.Message.ProtocolMessage.Type.LID_MIGRATION_MAPPING_SYNC:let F=Q.lidMigrationMappingSyncMessage?.encodedMappingPayload,{pnToLidMappings:q,chatDbMigrationTimestamp:z}=ne.LIDMigrationMappingSyncPayload.decode(F);r?.debug({pnToLidMappings:q,chatDbMigrationTimestamp:z},"got lid mappings and chat db migration timestamp");let K=[];for(let{pn:G,latestLid:V,assignedLid:H}of q){let N=V||H;K.push({lid:`${N}@lid`,pn:`${G}@s.whatsapp.net`})}if(await i.lidMapping.storeLIDPNMappings(K),K.length)for(let{pn:G,lid:V}of K)await i.migrateSession(G,V)}}else if(f?.reactionMessage){let y={...f.reactionMessage,key:n.key};a.emit("messages.reaction",[{reaction:y,key:f.reactionMessage?.key}])}else if(f?.encEventResponseMessage){let y=f.encEventResponseMessage,m=y.eventCreationMessageKey,T=await g(m);if(T)try{let _=BA(c),R=m.participant||m.remoteJid,L=qA(R)?await i.lidMapping.getPNForLID(R):R,U=vh({remoteJid:BA(L),fromMe:_===L},_),F=vh(n.key,_),q=T?.messageContextInfo?.messageSecret;if(!q)r?.warn({creationMsgKey:m},"event response: missing messageSecret for decryption");else{let z=wWe(y,{eventEncKey:q,eventCreatorJid:U,eventMsgId:m.id,responderJid:F}),K={eventResponseMessageKey:n.key,senderTimestampMs:z.timestampMs,response:z};a.emit("messages.update",[{key:m,update:{eventResponses:[K]}}])}}catch(_){r?.warn({err:_,creationMsgKey:m},"failed to decrypt event response")}else r?.warn({creationMsgKey:m},"event creation message not found, cannot decrypt response")}else if(n.messageStubType){let y=n.key?.remoteJid,m,T=U=>a.emit("group-participants.update",{id:y,author:n.key.participant,authorPn:n.key.participantAlt,authorUsername:n.key.participantUsername,participants:m,action:U}),_=U=>{a.emit("groups.update",[{id:y,...U,author:n.key.participant??void 0,authorPn:n.key.participantAlt,authorUsername:n.key.participantUsername}])},R=(U,F,q)=>{a.emit("group.join-request",{id:y,author:n.key.participant,authorPn:n.key.participantAlt,authorUsername:n.key.participantUsername,participant:U.lid,participantPn:U.pn,action:F,method:q})},L=()=>m.find(U=>Dt(c,U.phoneNumber));switch(n.messageStubType){case RA.GROUP_PARTICIPANT_CHANGE_NUMBER:m=n.messageStubParameters.map(J=>JSON.parse(J))||[],T("modify");break;case RA.GROUP_PARTICIPANT_LEAVE:case RA.GROUP_PARTICIPANT_REMOVE:m=n.messageStubParameters.map(J=>JSON.parse(J))||[],T("remove"),L()&&(p.readOnly=!0);break;case RA.GROUP_PARTICIPANT_ADD:case RA.GROUP_PARTICIPANT_INVITE:case RA.GROUP_PARTICIPANT_ADD_REQUEST_JOIN:m=n.messageStubParameters.map(J=>JSON.parse(J))||[],L()&&(p.readOnly=!1),T("add");break;case RA.GROUP_PARTICIPANT_DEMOTE:m=n.messageStubParameters.map(J=>JSON.parse(J))||[],T("demote");break;case RA.GROUP_PARTICIPANT_PROMOTE:m=n.messageStubParameters.map(J=>JSON.parse(J))||[],T("promote");break;case RA.GROUP_CHANGE_ANNOUNCE:let U=n.messageStubParameters?.[0];_({announce:U==="true"||U==="on"});break;case RA.GROUP_CHANGE_RESTRICT:let F=n.messageStubParameters?.[0];_({restrict:F==="true"||F==="on"});break;case RA.GROUP_CHANGE_SUBJECT:let q=n.messageStubParameters?.[0];p.name=q,_({subject:q});break;case RA.GROUP_CHANGE_DESCRIPTION:let z=n.messageStubParameters?.[0];p.description=z,_({desc:z});break;case RA.GROUP_CHANGE_INVITE_LINK:let K=n.messageStubParameters?.[0];_({inviteCode:K});break;case RA.GROUP_MEMBER_ADD_MODE:let G=n.messageStubParameters?.[0];_({memberAddMode:G==="all_member_add"});break;case RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE:let V=n.messageStubParameters?.[0];_({joinApprovalMode:V==="on"});break;case RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD:let H=JSON.parse(n.messageStubParameters?.[0]),N=n.messageStubParameters?.[1],k=n.messageStubParameters?.[2];R(H,N,k);break}}Object.keys(p).length>1&&a.emit("chats.update",[p])},age=DWe;var bWe=["messaging-history.set","chats.upsert","chats.update","chats.delete","contacts.upsert","contacts.update","messages.upsert","messages.update","messages.delete","messages.reaction","message-receipt.update","groups.update"],MWe=new Set(bWe),oge=n=>{let t=new OWe,o=new Set,a=NH(),e=!1,i=null,A=null,r=0,s=1e4,g=3e4;t.on("event",p=>{for(let B in p)t.emit(B,p[B])});function c(){e||(n.debug("Event buffer activated"),e=!0,r=0,i&&clearTimeout(i),i=setTimeout(()=>{e&&(n.warn("Buffer timeout reached, auto-flushing"),I())},g)),r++}function I(){if(!e)return!1;n.debug({bufferCount:r},"Flushing event buffer"),e=!1,r=0,i&&(clearTimeout(i),i=null),A&&(clearTimeout(A),A=null),o.size>s&&(n.debug({cacheSize:o.size},"Clearing history cache"),o.clear());let p=NH(),B=Object.values(a.chatUpdates),f=0;for(let y of B)y.conditional&&(f+=1,p.chatUpdates[y.id]=y,delete a.chatUpdates[y.id]);let Q=TWe(a);return Object.keys(Q).length&&t.emit("event",Q),a=p,n.trace({conditionalChatUpdatesLeft:f},"released buffered events"),!0}return{process(p){let B=async f=>{await p(f)};return t.on("event",B),()=>{t.off("event",B)}},emit(p,B){if(p==="messages.upsert"){let{type:f}=B,Q=Object.values(a.messageUpserts);if(Q.length>0){let y=Q[0].type;y!==f&&(n.debug({bufferedType:y,newType:f},"messages.upsert type mismatch, emitting buffered messages"),t.emit("event",{"messages.upsert":{messages:Q.map(m=>m.message),type:y}}),a.messageUpserts={})}}return e&&MWe.has(p)?(_We(a,o,p,B,n),!0):t.emit("event",{[p]:B})},isBuffering(){return e},buffer:c,flush:I,createBufferedFunction(p){return async(...B)=>{c();try{let f=await p(...B);return r===1&&setTimeout(()=>{e&&r===1&&I()},100),f}catch(f){throw f}finally{r=Math.max(0,r-1),r===0&&(A||(A=setTimeout(I,100)))}}},on:(...p)=>t.on(...p),off:(...p)=>t.off(...p),removeAllListeners:(...p)=>t.removeAllListeners(...p),destroy(){i&&(clearTimeout(i),i=null),A&&(clearTimeout(A),A=null),o.clear(),a=NH(),e=!1,r=0,t.removeAllListeners(),n.debug("Event buffer destroyed")}}},NH=()=>({historySets:{chats:{},messages:{},contacts:{},isLatest:!1,empty:!0},chatUpserts:{},chatUpdates:{},chatDeletes:new Set,contactUpserts:{},contactUpdates:{},messageUpserts:{},messageUpdates:{},messageReactions:{},messageDeletes:{},messageReceipts:{},groupUpdates:{}});function _We(n,t,o,a,e){switch(o){case"messaging-history.set":for(let Q of a.chats){let y=Q.id||"",m=n.historySets.chats[y];m&&(m.endOfHistoryTransferType=Q.endOfHistoryTransferType),!m&&!t.has(y)&&(n.historySets.chats[y]=Q,t.add(y),i(Q))}for(let Q of a.contacts){let y=n.historySets.contacts[Q.id];if(y)Object.assign(y,YD(Q));else{let m=`c:${Q.id}`,T=Q.notify||Q.name||Q.verifiedName;(!t.has(m)||T)&&(n.historySets.contacts[Q.id]=Q,t.add(m))}}for(let Q of a.messages){let y=NE(Q.key);!n.historySets.messages[y]&&!t.has(y)&&(n.historySets.messages[y]=Q,t.add(y))}if(n.historySets.empty=!1,n.historySets.syncType=a.syncType,a.pastParticipants?.length){let Q=new Map,y=T=>`${T.userJid||""}:${T.leaveTs||""}:${T.leaveReason||""}`,m=T=>{let _=T.groupJid??JSON.stringify(T),R=Q.get(_);if(!R){Q.set(_,{...T,pastParticipants:[...T.pastParticipants||[]]});return}let L=new Set((R.pastParticipants||[]).map(y));for(let U of T.pastParticipants||[]){let F=y(U);L.has(F)||(R.pastParticipants.push(U),L.add(F))}};for(let T of n.historySets.pastParticipants||[])m(T);for(let T of a.pastParticipants)m(T);n.historySets.pastParticipants=[...Q.values()]}n.historySets.progress=a.progress,n.historySets.chunkOrder=a.chunkOrder,n.historySets.peerDataRequestSessionId=a.peerDataRequestSessionId,n.historySets.isLatest=a.isLatest||n.historySets.isLatest;break;case"chats.upsert":for(let Q of a){let y=Q.id||"",m=n.chatUpserts[y];y&&!m&&(m=n.historySets.chats[y],m&&e.debug({chatId:y},"absorbed chat upsert in chat set")),m?m=iM(m,Q):(m=Q,n.chatUpserts[y]=m),i(m),n.chatDeletes.has(y)&&n.chatDeletes.delete(y)}break;case"chats.update":for(let Q of a){let y=Q.id,m=Q.conditional?Q.conditional(n):!0;if(m){delete Q.conditional;let T=n.historySets.chats[y]||n.chatUpserts[y];if(T)iM(T,Q);else{let _=n.chatUpdates[y]||{};n.chatUpdates[y]=iM(_,Q)}}else m===void 0&&(n.chatUpdates[y]=Q);n.chatDeletes.has(y)&&n.chatDeletes.delete(y)}break;case"chats.delete":for(let Q of a)n.chatDeletes.has(Q)||n.chatDeletes.add(Q),n.chatUpdates[Q]&&delete n.chatUpdates[Q],n.chatUpserts[Q]&&delete n.chatUpserts[Q],n.historySets.chats[Q]&&delete n.historySets.chats[Q];break;case"contacts.upsert":for(let Q of a){let y=n.contactUpserts[Q.id];y||(y=n.historySets.contacts[Q.id],y&&e.debug({contactId:Q.id},"absorbed contact upsert in contact set")),y?y=Object.assign(y,YD(Q)):(y=Q,n.contactUpserts[Q.id]=y),n.contactUpdates[Q.id]&&(y=Object.assign(n.contactUpdates[Q.id],YD(Q)),delete n.contactUpdates[Q.id])}break;case"contacts.update":let r=a;for(let Q of r){let y=Q.id,m=n.historySets.contacts[y]||n.contactUpserts[y];if(m)Object.assign(m,Q);else{let T=n.contactUpdates[y]||{};n.contactUpdates[y]=Object.assign(T,Q)}}break;case"messages.upsert":let{messages:s,type:g}=a;for(let Q of s){let y=NE(Q.key),m=n.messageUpserts[y]?.message;m||(m=n.historySets.messages[y],m&&e.debug({messageId:y},"absorbed message upsert in message set")),m&&(Q.messageTimestamp=m.messageTimestamp),n.messageUpdates[y]&&(e.debug("absorbed prior message update in message upsert"),Object.assign(Q,n.messageUpdates[y].update),delete n.messageUpdates[y]),n.historySets.messages[y]?n.historySets.messages[y]=Q:n.messageUpserts[y]={message:Q,type:g==="notify"||n.messageUpserts[y]?.type==="notify"?"notify":g}}break;case"messages.update":let c=a;for(let{key:Q,update:y}of c){let m=NE(Q),T=n.historySets.messages[m]||n.messageUpserts[m]?.message;if(T)Object.assign(T,y),y.status===bh.READ&&!Q.fromMe&&A(T);else{let _=n.messageUpdates[m]||{key:Q,update:{}};Object.assign(_.update,y),n.messageUpdates[m]=_}}break;case"messages.delete":let I=a;if("keys"in I){let{keys:Q}=I;for(let y of Q){let m=NE(y);n.messageDeletes[m]||(n.messageDeletes[m]=y),n.messageUpserts[m]&&delete n.messageUpserts[m],n.messageUpdates[m]&&delete n.messageUpdates[m]}}break;case"messages.reaction":let p=a;for(let{key:Q,reaction:y}of p){let m=NE(Q),T=n.messageUpserts[m];T?eH(T.message,y):(n.messageReactions[m]=n.messageReactions[m]||{key:Q,reactions:[]},eH(n.messageReactions[m],y))}break;case"message-receipt.update":let B=a;for(let{key:Q,receipt:y}of B){let m=NE(Q),T=n.messageUpserts[m];T?$U(T.message,y):(n.messageReceipts[m]=n.messageReceipts[m]||{key:Q,userReceipt:[]},$U(n.messageReceipts[m],y))}break;case"groups.update":let f=a;for(let Q of f){let y=Q.id,m=n.groupUpdates[y]||{};n.groupUpdates[y]||(n.groupUpdates[y]=Object.assign(m,Q))}break;default:throw new Error(`"${o}" cannot be buffered`)}function i(r){let s=r.id||"",g=n.chatUpdates[s];if(g){let c=g.conditional?g.conditional(n):!0;c?(delete g.conditional,e.debug({chatId:s},"absorbed chat update in existing chat"),Object.assign(r,iM(g,r)),delete n.chatUpdates[s]):c===!1&&(e.debug({chatId:s},"chat update condition fail, removing"),delete n.chatUpdates[s])}}function A(r){let s=r.key.remoteJid,g=n.chatUpdates[s]||n.chatUpserts[s];_H(r)&&TH(r)&&typeof g?.unreadCount=="number"&&g.unreadCount>0&&(e.debug({chatId:g.id},"decrementing chat counter"),g.unreadCount-=1,g.unreadCount===0&&delete g.unreadCount)}}function TWe(n){let t={};n.historySets.empty||(t["messaging-history.set"]={chats:Object.values(n.historySets.chats),messages:Object.values(n.historySets.messages),contacts:Object.values(n.historySets.contacts),pastParticipants:n.historySets.pastParticipants,syncType:n.historySets.syncType,progress:n.historySets.progress,isLatest:n.historySets.isLatest,chunkOrder:n.historySets.chunkOrder,peerDataRequestSessionId:n.historySets.peerDataRequestSessionId});let o=Object.values(n.chatUpserts);o.length&&(t["chats.upsert"]=o);let a=Object.values(n.chatUpdates);a.length&&(t["chats.update"]=a);let e=Array.from(n.chatDeletes);e.length&&(t["chats.delete"]=e);let i=Object.values(n.messageUpserts);if(i.length){let B=i[0].type;t["messages.upsert"]={messages:i.map(f=>f.message),type:B}}let A=Object.values(n.messageUpdates);A.length&&(t["messages.update"]=A);let r=Object.values(n.messageDeletes);r.length&&(t["messages.delete"]={keys:r});let s=Object.values(n.messageReactions).flatMap(({key:B,reactions:f})=>f.flatMap(Q=>({key:B,reaction:Q})));s.length&&(t["messages.reaction"]=s);let g=Object.values(n.messageReceipts).flatMap(({key:B,userReceipt:f})=>f.flatMap(Q=>({key:B,receipt:Q})));g.length&&(t["message-receipt.update"]=g);let c=Object.values(n.contactUpserts);c.length&&(t["contacts.upsert"]=c);let I=Object.values(n.contactUpdates);I.length&&(t["contacts.update"]=I);let p=Object.values(n.groupUpdates);return p.length&&(t["groups.update"]=p),t}function iM(n,t){return t.unreadCount===null&&n.unreadCount<0&&(n.unreadCount=void 0,t.unreadCount=void 0),typeof n.unreadCount=="number"&&typeof t.unreadCount=="number"&&(t={...t},t.unreadCount>=0&&(t.unreadCount=Math.max(t.unreadCount,0)+Math.max(n.unreadCount,0))),Object.assign(n,t)}var NE=n=>`${n.remoteJid},${n.id},${n.fromMe?"1":"0"}`;var NWe=512,RH="\0",nge=3600*1e3,RWe=3e3,cc;(function(n){n[n.UnknownError=0]="UnknownError",n[n.SignalErrorNoSession=1]="SignalErrorNoSession",n[n.SignalErrorInvalidKey=2]="SignalErrorInvalidKey",n[n.SignalErrorInvalidKeyId=3]="SignalErrorInvalidKeyId",n[n.SignalErrorInvalidMessage=4]="SignalErrorInvalidMessage",n[n.SignalErrorInvalidSignature=5]="SignalErrorInvalidSignature",n[n.SignalErrorFutureMessage=6]="SignalErrorFutureMessage",n[n.SignalErrorBadMac=7]="SignalErrorBadMac",n[n.SignalErrorInvalidSession=8]="SignalErrorInvalidSession",n[n.SignalErrorInvalidMsgKey=9]="SignalErrorInvalidMsgKey",n[n.BadBroadcastEphemeralSetting=10]="BadBroadcastEphemeralSetting",n[n.UnknownCompanionNoPrekey=11]="UnknownCompanionNoPrekey",n[n.AdvFailure=12]="AdvFailure",n[n.StatusRevokeDelay=13]="StatusRevokeDelay"})(cc||(cc={}));var sge=new Set([cc.SignalErrorInvalidMessage,cc.SignalErrorBadMac]),aM=class{constructor(t,o){this.logger=t,this.recentMessagesMap=new Jg({max:NWe,ttl:300*1e3,ttlAutopurge:!0,dispose:(a,e)=>{let i=e.lastIndexOf(RH);if(i>-1){let A=e.slice(i+RH.length);this.messageKeyIndex.delete(A)}}}),this.messageKeyIndex=new Map,this.sessionRecreateHistory=new Jg({ttl:nge*2,ttlAutopurge:!0}),this.retryCounters=new Jg({ttl:900*1e3,ttlAutopurge:!0,updateAgeOnGet:!0}),this.baseKeys=new Jg({max:1024,ttl:900*1e3,ttlAutopurge:!0}),this.pendingPhoneRequests={},this.maxMsgRetryCount=5,this.statistics={totalRetries:0,successfulRetries:0,failedRetries:0,mediaRetries:0,sessionRecreations:0,phoneRequests:0},this.maxMsgRetryCount=o}addRecentMessage(t,o,a){let e={to:t,id:o},i=this.keyToString(e);this.recentMessagesMap.set(i,{message:a,timestamp:Date.now()}),this.messageKeyIndex.set(o,i),this.logger.debug(`Added message to retry cache: ${t}/${o}`)}getRecentMessage(t,o){let a={to:t,id:o},e=this.keyToString(a);return this.recentMessagesMap.get(e)}shouldRecreateSession(t,o,a){if(!o)return this.sessionRecreateHistory.set(t,Date.now()),this.statistics.sessionRecreations++,{reason:"we don't have a Signal session with them",recreate:!0};if(a!==void 0&&sge.has(a))return this.sessionRecreateHistory.set(t,Date.now()),this.statistics.sessionRecreations++,this.logger.warn({jid:t,errorCode:cc[a]},"MAC error detected, forcing immediate session recreation"),{reason:`MAC error (code ${a}: ${cc[a]}), immediate session recreation`,recreate:!0};let e=Date.now(),i=this.sessionRecreateHistory.get(t);return!i||e-i>nge?(this.sessionRecreateHistory.set(t,e),this.statistics.sessionRecreations++,{reason:"retry count > 1 and over an hour since last recreation",recreate:!0}):{reason:"",recreate:!1}}parseRetryErrorCode(t){if(t===void 0||t==="")return;let o=parseInt(t,10);if(!Number.isNaN(o))return o>=cc.UnknownError&&o<=cc.StatusRevokeDelay?o:cc.UnknownError}isMacError(t){return t!==void 0&&sge.has(t)}incrementRetryCount(t){return this.retryCounters.set(t,(this.retryCounters.get(t)||0)+1),this.statistics.totalRetries++,this.retryCounters.get(t)}getRetryCount(t){return this.retryCounters.get(t)||0}hasExceededMaxRetries(t){return this.getRetryCount(t)>=this.maxMsgRetryCount}markRetrySuccess(t){this.statistics.successfulRetries++,this.retryCounters.delete(t),this.cancelPendingPhoneRequest(t),this.removeRecentMessage(t)}markRetryFailed(t){this.statistics.failedRetries++,this.retryCounters.delete(t),this.cancelPendingPhoneRequest(t),this.removeRecentMessage(t)}schedulePhoneRequest(t,o,a=RWe){this.cancelPendingPhoneRequest(t),this.pendingPhoneRequests[t]=setTimeout(()=>{delete this.pendingPhoneRequests[t],this.statistics.phoneRequests++,o()},a),this.logger.debug(`Scheduled phone request for message ${t} with ${a}ms delay`)}cancelPendingPhoneRequest(t){let o=this.pendingPhoneRequests[t];o&&(clearTimeout(o),delete this.pendingPhoneRequests[t],this.logger.debug(`Cancelled pending phone request for message ${t}`))}clear(){this.recentMessagesMap.clear(),this.messageKeyIndex.clear(),this.sessionRecreateHistory.clear(),this.retryCounters.clear(),this.baseKeys.clear();for(let t of Object.keys(this.pendingPhoneRequests))this.cancelPendingPhoneRequest(t);this.statistics={totalRetries:0,successfulRetries:0,failedRetries:0,mediaRetries:0,sessionRecreations:0,phoneRequests:0}}saveBaseKey(t,o,a){this.baseKeys.set(`${t}:${o}`,a)}hasSameBaseKey(t,o,a){let e=this.baseKeys.get(`${t}:${o}`);if(!e||e.length!==a.length)return!1;for(let i=0;i["Ubuntu",n,"22.04.4"],macOS:n=>["Mac OS",n,"14.4.1"],baileys:n=>["Baileys",n,"6.5.0"],windows:n=>["Windows",n,"10.0.22631"],android:n=>[n,"Android",""],appropriate:n=>[PWe[kWe()]||"Ubuntu",n,vWe()]};var $n;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.CHROME=1]="CHROME",n[n.EDGE=2]="EDGE",n[n.FIREFOX=3]="FIREFOX",n[n.IE=4]="IE",n[n.OPERA=5]="OPERA",n[n.SAFARI=6]="SAFARI",n[n.ELECTRON=7]="ELECTRON",n[n.UWP=8]="UWP",n[n.OTHER_WEB_CLIENT=9]="OTHER_WEB_CLIENT"})($n||($n={}));var GWe={Chrome:$n.CHROME,Edge:$n.EDGE,Firefox:$n.FIREFOX,IE:$n.IE,Opera:$n.OPERA,Safari:$n.SAFARI},FWe=([n,t])=>t==="Desktop"?n==="Windows"?$n.UWP:$n.ELECTRON:GWe[t]||$n.OTHER_WEB_CLIENT,kH=n=>FWe(n).toString(),gge=(n,t,o,a,e)=>"https://wa.me/settings/linked_devices#"+[n,t,o,a,kH(e)].join(",");async function cge(n,t){let o=n.attrs.from;if(!o)return{action:"invalid_notification"};if(!le(n,"identity"))return{action:"no_identity_node"};t.logger.info({jid:o},"identity changed");let e=hA(o);if(e?.device&&e.device!==0)return t.logger.debug({jid:o,device:e.device},"ignoring identity change from companion device"),{action:"skipped_companion_device",device:e.device};if(t.meId&&(Dt(o,t.meId)||t.meLid&&Dt(o,t.meLid)))return t.logger.info({jid:o},"self primary identity changed"),{action:"skipped_self_primary"};if(t.debounceCache.get(o))return t.logger.debug({jid:o},"skipping identity assert (debounced)"),{action:"debounced"};t.debounceCache.set(o,!0);let A=!V$(n.attrs.offline);if(!(await t.validateSession(o)).exists)return t.logger.debug({jid:o},"no old session, skipping session refresh"),{action:"skipped_no_session"};if(t.logger.debug({jid:o},"old session exists, will refresh session"),A)return t.logger.debug({jid:o},"skipping session refresh during offline processing"),{action:"skipped_offline"};t.onBeforeSessionRefresh?.(o);try{return await t.assertSessions([o],!0),{action:"session_refreshed"}}catch(s){return t.logger.warn({error:s,jid:o},"failed to assert sessions after identity change"),{action:"session_refresh_failed",error:s}}}function Ige(n,t,o){let{tag:a,attrs:e}=n,i={tag:"ack",attrs:{id:e.id,to:e.from,class:a}};return t&&(i.attrs.error=t.toString()),e.participant&&(i.attrs.participant=e.participant),e.recipient&&(i.attrs.recipient=e.recipient),e.type&&(i.attrs.type=e.type),a==="message"&&o&&(i.attrs.from=o),i}function LWe(n){return n===null||n===""}function UWe(n){return n>2147483647||n<-2147483648?n&4294967295:n}function lge(n){let t=0;if(!LWe(n))for(let o=0;oo.iteration===t)}addSenderMessageKey(t){this.senderKeyStateStructure.senderMessageKeys.push({iteration:t.getIteration(),seed:t.getSeed()}),this.senderKeyStateStructure.senderMessageKeys.length>this.MAX_MESSAGE_KEYS&&this.senderKeyStateStructure.senderMessageKeys.shift()}removeSenderMessageKey(t){let o=this.senderKeyStateStructure.senderMessageKeys.findIndex(a=>a.iteration===t);if(o!==-1){let a=this.senderKeyStateStructure.senderMessageKeys[o];return this.senderKeyStateStructure.senderMessageKeys.splice(o,1),new fp(a.iteration,a.seed)}return null}getStructure(){return this.senderKeyStateStructure}};var Ic=class n{constructor(t){if(this.MAX_STATES=5,this.senderKeyStates=[],t)for(let o of t)this.senderKeyStates.push(new Qp(null,null,null,null,null,null,o))}isEmpty(){return this.senderKeyStates.length===0}getSenderKeyState(t){return t===void 0&&this.senderKeyStates.length?this.senderKeyStates[this.senderKeyStates.length-1]:this.senderKeyStates.find(o=>o.getKeyId()===t)}addSenderKeyState(t,o,a,e){this.senderKeyStates.push(new Qp(t,o,a,null,e)),this.senderKeyStates.length>this.MAX_STATES&&this.senderKeyStates.shift()}setSenderKeyState(t,o,a,e){this.senderKeyStates.length=0,this.senderKeyStates.push(new Qp(t,o,a,e))}serialize(){return this.senderKeyStates.map(t=>t.getStructure())}static deserialize(t){let o=Buffer.from(t).toString("utf-8"),a=JSON.parse(o,WB.reviver);return new n(a)}};var hge=ze(Xc(),1);import*as nM from"crypto";function Ege(){return nM.randomBytes(32)}function uge(){return nM.randomInt(2147483647)}function Cge(n){return n||(n=(0,hge.generateKeyPair)()),{public:Buffer.from(n.pubKey),private:Buffer.from(n.privKey)}}var yp=class{constructor(){this.UNSUPPORTED_VERSION=1,this.CURRENT_VERSION=3,this.WHISPER_TYPE=2,this.PREKEY_TYPE=3,this.SENDERKEY_TYPE=4,this.SENDERKEY_DISTRIBUTION_TYPE=5,this.ENCRYPTED_MESSAGE_OVERHEAD=53}};var mp=class extends yp{constructor(t,o,a,e,i){if(super(),i)try{let A=i.slice(1),r=ne.SenderKeyDistributionMessage.decode(A).toJSON();this.serialized=i,this.id=r.id,this.iteration=r.iteration,this.chainKey=typeof r.chainKey=="string"?Buffer.from(r.chainKey,"base64"):r.chainKey,this.signatureKey=typeof r.signingKey=="string"?Buffer.from(r.signingKey,"base64"):r.signingKey}catch(A){throw new Error(String(A))}else{let A=this.intsToByteHighAndLow(this.CURRENT_VERSION,this.CURRENT_VERSION);this.id=t,this.iteration=o,this.chainKey=a,this.signatureKey=e;let r=ne.SenderKeyDistributionMessage.encode(ne.SenderKeyDistributionMessage.create({id:t,iteration:o,chainKey:a,signingKey:this.signatureKey})).finish();this.serialized=Buffer.concat([Buffer.from([A]),r])}}intsToByteHighAndLow(t,o){return((t<<4|o)&255)%256}serialize(){return this.serialized}getType(){return this.SENDERKEY_DISTRIBUTION_TYPE}getIteration(){return this.iteration}getChainKey(){return this.chainKey}getSignatureKey(){return this.signatureKey}getId(){return this.id}};var RE=class{constructor(t){this.senderKeyStore=t}async process(t,o){let a=await this.senderKeyStore.loadSenderKey(t);a.addSenderKeyState(o.getId(),o.getIteration(),o.getChainKey(),o.getSignatureKey()),await this.senderKeyStore.storeSenderKey(t,a)}async create(t){let o=await this.senderKeyStore.loadSenderKey(t);if(o.isEmpty()){let e=uge(),i=Ege(),A=Cge();o.setSenderKeyState(e,0,i,A),await this.senderKeyStore.storeSenderKey(t,o)}let a=o.getSenderKeyState();if(!a)throw new Error("No session state available");return new mp(a.getKeyId(),a.getSenderChainKey().getIteration(),a.getSenderChainKey().getSeed(),a.getSigningKeyPublic())}};var gM=ze(Kl(),1);var sM=ze(Xc(),1);var kE=class extends yp{constructor(t,o,a,e,i){if(super(),this.SIGNATURE_LENGTH=64,i){let A=i[0],r=i.slice(1,i.length-this.SIGNATURE_LENGTH),s=i.slice(-1*this.SIGNATURE_LENGTH),g=ne.SenderKeyMessage.decode(r).toJSON();this.serialized=i,this.messageVersion=(A&255)>>4,this.keyId=g.id,this.iteration=g.iteration,this.ciphertext=typeof g.ciphertext=="string"?Buffer.from(g.ciphertext,"base64"):g.ciphertext,this.signature=s}else{let A=((this.CURRENT_VERSION<<4|this.CURRENT_VERSION)&255)%256,r=Buffer.from(a),s=ne.SenderKeyMessage.encode(ne.SenderKeyMessage.create({id:t,iteration:o,ciphertext:r})).finish(),g=this.getSignature(e,Buffer.concat([Buffer.from([A]),s]));this.serialized=Buffer.concat([Buffer.from([A]),s,Buffer.from(g)]),this.messageVersion=this.CURRENT_VERSION,this.keyId=t,this.iteration=o,this.ciphertext=r,this.signature=g}}getKeyId(){return this.keyId}getIteration(){return this.iteration}getCipherText(){return this.ciphertext}verifySignature(t){let o=this.serialized.slice(0,this.serialized.length-this.SIGNATURE_LENGTH),a=this.serialized.slice(-1*this.SIGNATURE_LENGTH);if(!(0,sM.verifySignature)(t,o,a))throw new Error("Invalid signature!")}getSignature(t,o){return Buffer.from((0,sM.calculateSignature)(t,o))}serialize(){return this.serialized}getType(){return 4}};var vE=class{constructor(t,o){this.senderKeyStore=t,this.senderKeyName=o}async encrypt(t){let o=await this.senderKeyStore.loadSenderKey(this.senderKeyName);if(!o)throw new Error("No SenderKeyRecord found for encryption");let a=o.getSenderKeyState();if(!a)throw new Error("No session to encrypt message");let e=a.getSenderChainKey().getIteration(),i=this.getSenderKey(a,e===0?0:e+1),A=await this.getCipherText(i.getIv(),i.getCipherKey(),t),r=new kE(a.getKeyId(),i.getIteration(),A,a.getSigningKeyPrivate());return await this.senderKeyStore.storeSenderKey(this.senderKeyName,o),r.serialize()}async decrypt(t){let o=await this.senderKeyStore.loadSenderKey(this.senderKeyName);if(!o)throw new Error("No SenderKeyRecord found for decryption");let a=new kE(null,null,null,null,t),e=o.getSenderKeyState(a.getKeyId());if(!e)throw new Error("No session found to decrypt message");a.verifySignature(e.getSigningKeyPublic());let i=this.getSenderKey(e,a.getIteration()),A=await this.getPlainText(i.getIv(),i.getCipherKey(),a.getCipherText());return await this.senderKeyStore.storeSenderKey(this.senderKeyName,o),A}getSenderKey(t,o){let a=t.getSenderChainKey();if(a.getIteration()>o){if(t.hasSenderMessageKey(o)){let e=t.removeSenderMessageKey(o);if(!e)throw new Error("No sender message key found for iteration");return e}throw new Error(`Received message with old counter: ${a.getIteration()}, ${o}`)}if(o-a.getIteration()>2e3)throw new Error("Over 2000 messages into the future!");for(;a.getIteration()0){let r=[...a];this.logger.trace(`Batch fetching ${r.length} LID mappings from database`);let s=await this.keys.get("lid-mapping",r);for(let g of r){let c=s[g];c&&(e.set(g,c),this.mappingCache.set(`pn:${g}`,c),this.mappingCache.set(`lid:${c}`,g))}}let i={};for(let{pnUser:r,lidUser:s}of o){if(e.get(r)===s){this.logger.debug({pnUser:r,lidUser:s},"LID mapping already exists, skipping");continue}i[r]=s}if(Object.keys(i).length===0)return;this.logger.trace({pairMap:i},`Storing ${Object.keys(i).length} pn mappings`);let A={};for(let[r,s]of Object.entries(i))A[r]=s,A[`${s}_reverse`]=r;await this.keys.transaction(async()=>{await this.keys.set({"lid-mapping":A})},"lid-mapping");for(let[r,s]of Object.entries(i))this.mappingCache.set(`pn:${r}`,s),this.mappingCache.set(`lid:${s}`,r)}async getLIDForPN(t){return(await this.getLIDsForPNs([t]))?.[0]?.lid||null}async getLIDsForPNs(t){if(t.length===0)return null;let o=[...new Set(t)].sort(),a=o.join(","),e=this.inflightLIDLookups.get(a);if(e)return this.logger.trace(`Coalescing getLIDsForPNs request for ${o.length} PNs`),e;let i=this._getLIDsForPNsImpl(t);this.inflightLIDLookups.set(a,i);try{return await i}finally{this.inflightLIDLookups.delete(a)}}async _getLIDsForPNsImpl(t){let o={},a={},e=[],i=(A,r,s)=>{let g=s.toString();if(!g)return this.logger.warn(`Invalid or empty LID user for PN ${A}: lidUser = "${s}"`),!1;let c=r.device!==void 0?r.device:0,I=`${g}${c?`:${c}`:""}@${r.server==="hosted"?"hosted.lid":"lid"}`;return this.logger.trace(`getLIDForPN: ${A} \u2192 ${I} (user mapping with device ${c})`),a[A]={lid:I,pn:A},!0};for(let A of t){if(!Rt(A)&&!Or(A))continue;let r=hA(A);if(!r)continue;let s=r.user,g=this.mappingCache.get(`pn:${s}`);if(g&&typeof g=="string"){if(!i(A,r,g)){this.logger.warn(`Invalid entry for ${A} (pair not resolved)`);continue}continue}e.push({pn:A,pnUser:s,decoded:r})}if(e.length){let A=[...new Set(e.map(s=>s.pnUser))],r=await this.keys.get("lid-mapping",A);for(let s of A){let g=r[s];g&&typeof g=="string"&&(this.mappingCache.set(`pn:${s}`,g),this.mappingCache.set(`lid:${g}`,s))}for(let{pn:s,pnUser:g,decoded:c}of e){let I=this.mappingCache.get(`pn:${g}`);if(I&&typeof I=="string"){if(!i(s,c,I)){this.logger.warn(`Invalid entry for ${s} (pair not resolved)`);continue}}else{this.logger.trace(`No LID mapping found for PN user ${g}; batch getting from USync`);let p=c.device||0,B=BA(s);Or(B)&&(B=`${g}@s.whatsapp.net`),o[B]?o[B]?.push(p):o[B]=[p]}}}if(Object.keys(o).length>0){let A=await this.pnToLIDFunc?.(Object.keys(o));if(A&&A.length>0){await this.storeLIDPNMappings(A);for(let r of A){let g=hA(r.pn)?.user;if(!g)continue;let c=hA(r.lid)?.user;if(c)for(let I of o[r.pn]){let p=`${c}${I?`:${I}`:""}@${I===99?"hosted.lid":"lid"}`;this.logger.trace(`getLIDForPN: USYNC success for ${r.pn} \u2192 ${p} (user mapping with device ${I})`);let B=`${g}${I?`:${I}`:""}@${I===99?"hosted":"s.whatsapp.net"}`;a[B]={lid:p,pn:B}}}}else this.logger.warn("USync fetch yielded no results for pending PNs")}return Object.values(a).length>0?Object.values(a):null}async getPNForLID(t){return(await this.getPNsForLIDs([t]))?.[0]?.pn||null}async getPNsForLIDs(t){if(t.length===0)return null;let o=[...new Set(t)].sort(),a=o.join(","),e=this.inflightPNLookups.get(a);if(e)return this.logger.trace(`Coalescing getPNsForLIDs request for ${o.length} LIDs`),e;let i=this._getPNsForLIDsImpl(t);this.inflightPNLookups.set(a,i);try{return await i}finally{this.inflightPNLookups.delete(a)}}async _getPNsForLIDsImpl(t){let o={},a=[],e=(i,A,r)=>{if(!r||typeof r!="string")return!1;let s=A.device!==void 0?A.device:0,g=`${r}:${s}@${A.domainType===Zt.HOSTED_LID?"hosted":"s.whatsapp.net"}`;return this.logger.trace(`Found reverse mapping: ${i} \u2192 ${g}`),o[i]={lid:i,pn:g},!0};for(let i of t){if(!qA(i))continue;let A=hA(i);if(!A)continue;let r=A.user,s=this.mappingCache.get(`lid:${r}`);if(s&&typeof s=="string"){e(i,A,s);continue}a.push({lid:i,lidUser:r,decoded:A})}if(a.length){let i=[...new Set(a.map(r=>`${r.lidUser}_reverse`))],A=await this.keys.get("lid-mapping",i);for(let{lid:r,lidUser:s,decoded:g}of a){let c=this.mappingCache.get(`lid:${s}`);(!c||typeof c!="string")&&(c=A[`${s}_reverse`],c&&typeof c=="string"&&(this.mappingCache.set(`lid:${s}`,c),this.mappingCache.set(`pn:${c}`,s))),c&&typeof c=="string"?e(r,g,c):this.logger.trace(`No reverse mapping found for LID user: ${s}`)}}return Object.values(o).length?Object.values(o):null}close(){this.mappingCache.clear()}};function HWe(n){try{if(!n||n.length<2||(n[0]&15)!==3)return;let o=fge.PreKeyWhisperMessage.decode(n.slice(1));return o.identityKey?.length===33?new Uint8Array(o.identityKey):void 0}catch{return}}function Qge(n,t,o){let a=new cM(n.keys,t,o),e=KWe(n,a),i=n.keys,A=new Jg({ttl:4320*60*1e3,ttlAutopurge:!0,updateAgeOnGet:!0}),r=async(g,c)=>{let I=IM(g,c),p=I.toString(),{[p]:B}=await n.keys.get("sender-key",[p]);B||await e.storeSenderKey(I,new Ic);let f=await new RE(e).create(I);return{senderName:I,skdm:f}};return{decryptGroupMessage({group:g,authorJid:c,msg:I}){let p=IM(g,c),B=new vE(e,p);return i.transaction(async()=>B.decrypt(I),g)},async processSenderKeyDistributionMessage({item:g,authorJid:c}){let I=new RE(e);if(!g.groupId)throw new Error("Group ID is required for sender key distribution message");let p=IM(g.groupId,c),B=new mp(null,null,null,null,g.axolotlSenderKeyDistributionMessage),f=p.toString(),{[f]:Q}=await n.keys.get("sender-key",[f]);return Q||await e.storeSenderKey(p,new Ic),i.transaction(async()=>{let{[f]:y}=await n.keys.get("sender-key",[f]);y||await e.storeSenderKey(p,new Ic),await I.process(p,B)},g.groupId)},async decryptMessage({jid:g,type:c,ciphertext:I}){let p=es(g),B=new og.SessionCipher(e,p);if(c==="pkmsg"){let Q=HWe(I);if(Q){let y=p.toString();await e.saveIdentity(y,Q)&&t.info({jid:g,addr:y},"identity key changed or new contact, session will be re-established")}}async function f(){let Q;switch(c){case"pkmsg":Q=await B.decryptPreKeyWhisperMessage(I);break;case"msg":Q=await B.decryptWhisperMessage(I);break}return Q}return i.transaction(async()=>await f(),g)},async encryptMessage({jid:g,data:c}){let I=es(g),p=new og.SessionCipher(e,I);return i.transaction(async()=>{let{type:B,body:f}=await p.encrypt(c);return{type:B===3?"pkmsg":"msg",ciphertext:Buffer.from(f,"binary")}},g)},async encryptGroupMessage({group:g,meId:c,data:I}){return i.transaction(async()=>{let{senderName:p,skdm:B}=await r(g,c);return{ciphertext:await new vE(e,p).encrypt(I),senderKeyDistributionMessage:B.serialize()}},g)},async getSenderKeyDistributionMessage({group:g,meId:c}){return i.transaction(async()=>{let{skdm:I}=await r(g,c);return I.serialize()},g)},async hasSenderKey({group:g,meId:c}){let I=IM(g,c).toString(),{[I]:p}=await n.keys.get("sender-key",[I]);return!!p},async getSessionInfo(g){let c=es(g).toString(),I=await e.loadSession(c);if(!I)return null;let p=I.getOpenSession?.(),B=p?.indexInfo?.baseKey,f=p?.registrationId;return!B||typeof f!="number"?null:{baseKey:new Uint8Array(B),registrationId:f}},async injectE2ESession({jid:g,session:c}){t.trace({jid:g},"injecting E2EE session");let I=new og.SessionBuilder(e,es(g));return i.transaction(async()=>{await I.initOutgoing(c)},g)},jidToSignalProtocolAddress(g){return es(g).toString()},lidMapping:a,async validateSession(g){try{let c=es(g),I=await e.loadSession(c.toString());return I?I.haveOpenSession()?{exists:!0}:{exists:!1,reason:"no open session"}:{exists:!1,reason:"no session"}}catch{return{exists:!1,reason:"validation error"}}},async deleteSession(g){if(!g.length)return;let c={};return g.forEach(I=>{let p=es(I);c[p.toString()]=null}),i.transaction(async()=>{await n.keys.set({session:c})},`delete-${g.length}-sessions`)},close(){A.clear(),a.close()},async migrateSession(g,c){if(!g||!qA(c)&&!Ci(c))return{migrated:0,skipped:0,total:0};if(!Rt(g)&&!Or(g))return{migrated:0,skipped:0,total:1};let{user:I}=hA(g);t.debug({fromJid:g},"bulk device migration - loading all user devices");let{[I]:p}=await i.get("device-list",[I]);if(!p)return{migrated:0,skipped:0,total:0};let{device:B}=hA(g),f=B?.toString()||"0";p.includes(f)||p.push(f);let y=p.filter(_=>{let R=`${I}.${_}`;return!A.has(R)}).map(_=>`${I}.${_}`),m=await i.get("session",y),T=[];for(let[_,R]of Object.entries(m))if(R){let L=_.split(".")[1];if(!L)continue;let U=parseInt(L),F=U===0?`${I}@s.whatsapp.net`:`${I}:${U}@s.whatsapp.net`;U===99&&(F=`${I}:99@hosted`),T.push(F)}return t.debug({fromJid:g,totalDevices:p.length,devicesWithSessions:T.length,devices:T},"bulk device migration complete - all user devices processed"),i.transaction(async()=>{let _=T.map(K=>{let G=C$(K,c),V=hA(K),H=hA(G);return{fromJid:K,toJid:G,pnUser:V.user,lidUser:H.user,deviceId:V.device||0,fromAddr:es(K),toAddr:es(G)}}),R=_.length,L=0,U=Array.from(new Set(_.map(K=>K.fromAddr.toString()))),F=await i.get("session",U),q={};for(let K of _){let G=K.fromAddr.toString(),V=K.toAddr.toString(),H=F[G];if(H){let N=og.SessionRecord.deserialize(H);N.haveOpenSession()&&(q[V]=N.serialize(),q[G]=null,L++)}}if(Object.keys(q).length>0){await i.set({session:q}),t.debug({migratedSessions:L},"bulk session migration complete");for(let K of _)if(q[K.toAddr.toString()]){let G=`${K.pnUser}.${K.deviceId}`;A.set(G,!0)}}let z=R-L;return{migrated:L,skipped:z,total:R}},`migrate-${T.length}-sessions-${hA(c)?.user}`)}}}var es=n=>{let t=hA(n),{user:o,device:a,server:e,domainType:i}=t;if(!o)throw new Error(`JID decoded but user is empty: "${n}" -> user: "${o}", server: "${e}", device: ${a}`);let A=i!==Zt.WHATSAPP?`${o}_${i}`:o,r=a||0;if(a===99&&t.server!=="hosted"&&t.server!=="hosted.lid")throw new Error("Unexpected non-hosted device JID with device 99. This ID seems invalid. ID:"+n);return new og.ProtocolAddress(A,r)},IM=(n,t)=>new rQ(n,es(t));function KWe({creds:n,keys:t},o){let a=async e=>{if(e.includes(".")){let[i,A]=e.split("."),[r,s]=i.split("_"),g=parseInt(s||"0");if(g===Zt.LID||g===Zt.HOSTED_LID)return e;let c=`${r}${A!=="0"?`:${A}`:""}@${g===Zt.HOSTED?"hosted":"s.whatsapp.net"}`,I=await o.getLIDForPN(c);if(I)return es(I).toString()}return e};return{loadSession:async e=>{try{let i=await a(e),{[i]:A}=await t.get("session",[i]);if(A)return og.SessionRecord.deserialize(A)}catch{return null}return null},storeSession:async(e,i)=>{let A=await a(e);await t.set({session:{[A]:i.serialize()}})},isTrustedIdentity:()=>!0,loadIdentityKey:async e=>{let i=await a(e),{[i]:A}=await t.get("identity-key",[i]);return A||void 0},saveIdentity:async(e,i)=>{let A=await a(e),{[A]:r}=await t.get("identity-key",[A]),s=r?.length===i.length&&r.every((g,c)=>g===i[c]);return r&&!s?(await t.set({session:{[A]:null},"identity-key":{[A]:i}}),!0):r?!1:(await t.set({"identity-key":{[A]:i}}),!0)},loadPreKey:async e=>{let i=e.toString(),{[i]:A}=await t.get("pre-key",[i]);if(A)return{privKey:Buffer.from(A.private),pubKey:Buffer.from(A.public)}},removePreKey:e=>t.set({"pre-key":{[e]:null}}),loadSignedPreKey:()=>{let e=n.signedPreKey;return{privKey:Buffer.from(e.keyPair.private),pubKey:Buffer.from(e.keyPair.public)}},loadSenderKey:async e=>{let i=e.toString(),{[i]:A}=await t.get("sender-key",[i]);return A?Ic.deserialize(A):new Ic},storeSenderKey:async(e,i)=>{let A=e.toString(),r=JSON.stringify(i.serialize());await t.set({"sender-key":{[A]:Buffer.from(r,"utf-8")}})},getOurRegistrationId:()=>n.registrationId,getOurIdentity:()=>{let{signedIdentityKey:e}=n;return{privKey:Buffer.from(e.private),pubKey:Buffer.from(An(e.public))}}}}var mIe=ze(yIe(),1),gQ=(0,mIe.default)({timestamp:()=>`,"time":"${new Date().toJSON()}"`});var uXe=[2,3e3,1043857760];var Jf="https://web.whatsapp.com",ose="https://call.whatsapp.com/video/",nse="https://call.whatsapp.com/voice/",UE="CB:",SIe="TAG:";var fse=Buffer.from([6,0]),Qse=Buffer.from([6,1]),aH=Buffer.from([6,5]),LFA=Buffer.from([6,6]),Vf=10080*60,wIe=1440*60,DIe=336*60*60,Dse="Noise_XX_25519_AESGCM_SHA256\0\0\0\0",CXe=3,Wg=Buffer.from([5]),OIe=Buffer.from([87,65,6,CXe]),sse=/https:\/\/(?![^:@\/\s]+:[^:@\/\s]+@)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(:\d+)?(\/[^\s]*)?/g,nH={SERIAL:0,ISSUER:"WhatsAppLongTerm1",PUBLIC_KEY:Buffer.from("142375574d0a587166aae71ebe516437c4a28b73e3695c6ce1f7f9545da8ee6b","hex")},cQ=[ne.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP,ne.HistorySync.HistorySyncType.PUSH_NAME,ne.HistorySync.HistorySyncType.RECENT,ne.HistorySync.HistorySyncType.FULL,ne.HistorySync.HistorySyncType.ON_DEMAND,ne.HistorySync.HistorySyncType.NON_BLOCKING_DATA,ne.HistorySync.HistorySyncType.INITIAL_STATUS_V3],NI={SIGNAL_STORE:300,MSG_RETRY:3600,CALL_OFFER:300,USER_DEVICES:300},bIe={version:uXe,browser:oM.macOS("Chrome"),waWebSocketUrl:"wss://web.whatsapp.com/ws/chat",connectTimeoutMs:2e4,keepAliveIntervalMs:3e4,logger:gQ.child({class:"baileys"}),emitOwnEvents:!0,defaultQueryTimeoutMs:6e4,customUploadHosts:[],retryRequestDelayMs:250,maxMsgRetryCount:5,fireInitQueries:!0,auth:void 0,markOnlineOnConnect:!0,syncFullHistory:!0,patchMessageBeforeSending:n=>n,shouldSyncHistoryMessage:({syncType:n})=>n!==ne.HistorySync.HistorySyncType.FULL,shouldIgnoreJid:()=>!1,linkPreviewImageThumbnailWidth:192,transactionOpts:{maxCommitRetries:10,delayBetweenTriesMs:3e3},generateHighQualityLinkPreview:!1,enableAutoSessionRecreation:!0,enableRecentMessageCache:!0,options:{},appStateMacVerification:{patch:!1,snapshot:!1},countryCode:"US",getMessage:async()=>{},cachedGroupMetadata:async()=>{},makeSignalRepository:Qge},VU={image:"/mms/image",video:"/mms/video",document:"/mms/document",audio:"/mms/audio",sticker:"/mms/image","thumbnail-link":"/mms/image","product-catalog-image":"/product/image","md-app-state":"","md-msg-hist":"/mms/md-app-state","biz-cover-photo":"/pps/biz-cover-photo"},Vne={audio:"Audio",document:"Document",gif:"Video",image:"Image",ppic:"",product:"Image",ptt:"Audio",sticker:"Image",video:"Video","thumbnail-document":"Document Thumbnail","thumbnail-image":"Image Thumbnail","thumbnail-video":"Video Thumbnail","thumbnail-link":"Link Thumbnail","md-msg-hist":"History","md-app-state":"App State","product-catalog-image":"","payment-bg-image":"Payment Background",ptv:"Video","biz-cover-photo":"Image"},gse=Object.keys(VU),MIe=12e4,IQ=5,_Ie=812,TIe=3e4,OK={Minute:60*1e3,Hour:3600*1e3,Day:1440*60*1e3,Week:10080*60*1e3};var NIe=ze(Jr(),1);import{createHash as BXe}from"crypto";import{createWriteStream as fXe,promises as QXe}from"fs";import{tmpdir as yXe}from"os";import{join as mXe}from"path";var RIe=n=>{let t=le(n,"product_catalog"),o=PA(t,"product").map(lQ),a=le(t,"paging");return{products:o,nextPageCursor:a?jA(a,"after"):void 0}},kIe=n=>{let t=le(n,"collections");return{collections:PA(t,"collection").map(a=>{let e=jA(a,"id"),i=jA(a,"name"),A=PA(a,"product").map(lQ);return{id:e,name:i,products:A,status:DXe(a)}})}},vIe=n=>{let t=le(n,"order"),o=PA(t,"product").map(i=>{let A=le(i,"image");return{id:jA(i,"id"),name:jA(i,"name"),imageUrl:jA(A,"url"),price:+jA(i,"price"),currency:jA(i,"currency"),quantity:+jA(i,"quantity")}}),a=le(t,"price");return{price:{total:+jA(a,"total"),currency:jA(a,"currency")},products:o}},bK=(n,t)=>{let o={},a=[];return typeof n<"u"&&a.push({tag:"id",attrs:{},content:Buffer.from(n)}),typeof t.name<"u"&&a.push({tag:"name",attrs:{},content:Buffer.from(t.name)}),typeof t.description<"u"&&a.push({tag:"description",attrs:{},content:Buffer.from(t.description)}),typeof t.retailerId<"u"&&a.push({tag:"retailer_id",attrs:{},content:Buffer.from(t.retailerId)}),t.images.length&&a.push({tag:"media",attrs:{},content:t.images.map(i=>{if(!("url"in i))throw new NIe.Boom("Expected img for product to already be uploaded",{statusCode:400});return{tag:"image",attrs:{},content:[{tag:"url",attrs:{},content:Buffer.from(i.url.toString())}]}})}),typeof t.price<"u"&&a.push({tag:"price",attrs:{},content:Buffer.from(t.price.toString())}),typeof t.currency<"u"&&a.push({tag:"currency",attrs:{},content:Buffer.from(t.currency)}),"originCountryCode"in t&&(typeof t.originCountryCode>"u"?o.compliance_category="COUNTRY_ORIGIN_EXEMPT":a.push({tag:"compliance_info",attrs:{},content:[{tag:"country_code_origin",attrs:{},content:Buffer.from(t.originCountryCode)}]})),typeof t.isHidden<"u"&&(o.is_hidden=t.isHidden.toString()),{tag:"product",attrs:o,content:a}},lQ=n=>{let t=n.attrs.is_hidden==="true",o=jA(n,"id"),a=le(n,"media"),e=le(n,"status_info");return{id:o,imageUrls:wXe(a),reviewStatus:{whatsapp:jA(e,"status")},availability:"in stock",name:jA(n,"name"),retailerId:jA(n,"retailer_id"),url:jA(n,"url"),description:jA(n,"description"),price:+jA(n,"price"),currency:jA(n,"currency"),isHidden:t}};async function MK(n,t,o=3e4){return n={...n,images:n.images?await SXe(n.images,t,o):n.images},n}var SXe=async(n,t,o=3e4)=>await Promise.all(n.map(async e=>{if("url"in e){let I=e.url.toString();if(I.includes(".whatsapp.net"))return{url:I}}let{stream:i}=await Yf(e),A=BXe("sha256"),r=mXe(yXe(),"img"+Vr()),s=fXe(r);for await(let I of i)A.update(I),s.write(I);let g=A.digest("base64"),{directPath:c}=await t(r,{mediaType:"product-catalog-image",fileEncSha256B64:g,timeoutMs:o});return await QXe.unlink(r).catch(I=>console.log("Error deleting temp file ",I)),{url:jf(c)}})),wXe=n=>{let t=le(n,"image");return{requested:jA(t,"request_image_url"),original:jA(t,"original_image_url")}},DXe=n=>{let t=le(n,"status_info");return{status:jA(t,"status"),canAppeal:jA(t,"can_appeal")==="true"}};var dQ=ze(Jr(),1);import{randomBytes as vK}from"crypto";var En=null;try{En=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Ft(n,t,o){this.low=n|0,this.high=t|0,this.unsigned=!!o}Ft.prototype.__isLong__;Object.defineProperty(Ft.prototype,"__isLong__",{value:!0});function ca(n){return(n&&n.__isLong__)===!0}function PIe(n){var t=Math.clz32(n&-n);return n?31-t:t}Ft.isLong=ca;var GIe={},FIe={};function bp(n,t){var o,a,e;return t?(n>>>=0,(e=0<=n&&n<256)&&(a=FIe[n],a)?a:(o=St(n,0,!0),e&&(FIe[n]=o),o)):(n|=0,(e=-128<=n&&n<128)&&(a=GIe[n],a)?a:(o=St(n,n<0?-1:0,!1),e&&(GIe[n]=o),o))}Ft.fromInt=bp;function un(n,t){if(isNaN(n))return t?lc:rs;if(t){if(n<0)return lc;if(n>=KIe)return jIe}else{if(n<=-UIe)return ro;if(n+1>=UIe)return YIe}return n<0?un(-n,t).neg():St(n%KE|0,n/KE|0,t)}Ft.fromNumber=un;function St(n,t,o){return new Ft(n,t,o)}Ft.fromBits=St;var RM=Math.pow;function TK(n,t,o){if(n.length===0)throw Error("empty string");if(typeof t=="number"?(o=t,t=!1):t=!!t,n==="NaN"||n==="Infinity"||n==="+Infinity"||n==="-Infinity")return t?lc:rs;if(o=o||10,o<2||360)throw Error("interior hyphen");if(a===0)return TK(n.substring(1),t,o).neg();for(var e=un(RM(o,8)),i=rs,A=0;A>>0:this.low};He.toNumber=function(){return this.unsigned?(this.high>>>0)*KE+(this.low>>>0):this.high*KE+(this.low>>>0)};He.toString=function(t){if(t=t||10,t<2||36>>0,c=g.toString(t);if(A=s,A.isZero())return c+r;for(;c.length<6;)c="0"+c;r=""+c+r}};He.getHighBits=function(){return this.high};He.getHighBitsUnsigned=function(){return this.high>>>0};He.getLowBits=function(){return this.low};He.getLowBitsUnsigned=function(){return this.low>>>0};He.getNumBitsAbs=function(){if(this.isNegative())return this.eq(ro)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,o=31;o>0&&(t&1<>21;return t?this.unsigned?!1:t===-1&&!(this.low===0&&this.high===-2097152):!0};He.isZero=function(){return this.high===0&&this.low===0};He.eqz=He.isZero;He.isNegative=function(){return!this.unsigned&&this.high<0};He.isPositive=function(){return this.unsigned||this.high>=0};He.isOdd=function(){return(this.low&1)===1};He.isEven=function(){return(this.low&1)===0};He.equals=function(t){return ca(t)||(t=Cn(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};He.eq=He.equals;He.notEquals=function(t){return!this.eq(t)};He.neq=He.notEquals;He.ne=He.notEquals;He.lessThan=function(t){return this.comp(t)<0};He.lt=He.lessThan;He.lessThanOrEqual=function(t){return this.comp(t)<=0};He.lte=He.lessThanOrEqual;He.le=He.lessThanOrEqual;He.greaterThan=function(t){return this.comp(t)>0};He.gt=He.greaterThan;He.greaterThanOrEqual=function(t){return this.comp(t)>=0};He.gte=He.greaterThanOrEqual;He.ge=He.greaterThanOrEqual;He.compare=function(t){if(ca(t)||(t=Cn(t)),this.eq(t))return 0;var o=this.isNegative(),a=t.isNegative();return o&&!a?-1:!o&&a?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};He.comp=He.compare;He.negate=function(){return!this.unsigned&&this.eq(ro)?ro:this.not().add(HE)};He.neg=He.negate;He.add=function(t){ca(t)||(t=Cn(t));var o=this.high>>>16,a=this.high&65535,e=this.low>>>16,i=this.low&65535,A=t.high>>>16,r=t.high&65535,s=t.low>>>16,g=t.low&65535,c=0,I=0,p=0,B=0;return B+=i+g,p+=B>>>16,B&=65535,p+=e+s,I+=p>>>16,p&=65535,I+=a+r,c+=I>>>16,I&=65535,c+=o+A,c&=65535,St(p<<16|B,c<<16|I,this.unsigned)};He.subtract=function(t){return ca(t)||(t=Cn(t)),this.add(t.neg())};He.sub=He.subtract;He.multiply=function(t){if(this.isZero())return this;if(ca(t)||(t=Cn(t)),En){var o=En.mul(this.low,this.high,t.low,t.high);return St(o,En.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?lc:rs;if(this.eq(ro))return t.isOdd()?ro:rs;if(t.eq(ro))return this.isOdd()?ro:rs;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(HIe)&&t.lt(HIe))return un(this.toNumber()*t.toNumber(),this.unsigned);var a=this.high>>>16,e=this.high&65535,i=this.low>>>16,A=this.low&65535,r=t.high>>>16,s=t.high&65535,g=t.low>>>16,c=t.low&65535,I=0,p=0,B=0,f=0;return f+=A*c,B+=f>>>16,f&=65535,B+=i*c,p+=B>>>16,B&=65535,B+=A*g,p+=B>>>16,B&=65535,p+=e*c,I+=p>>>16,p&=65535,p+=i*g,I+=p>>>16,p&=65535,p+=A*s,I+=p>>>16,p&=65535,I+=a*c+e*g+i*s+A*r,I&=65535,St(B<<16|f,I<<16|p,this.unsigned)};He.mul=He.multiply;He.divide=function(t){if(ca(t)||(t=Cn(t)),t.isZero())throw Error("division by zero");if(En){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var o=(this.unsigned?En.div_u:En.div_s)(this.low,this.high,t.low,t.high);return St(o,En.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?lc:rs;var a,e,i;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return lc;if(t.gt(this.shru(1)))return xIe;i=lc}else{if(this.eq(ro)){if(t.eq(HE)||t.eq(_K))return ro;if(t.eq(ro))return HE;var A=this.shr(1);return a=A.div(t).shl(1),a.eq(rs)?t.isNegative()?HE:_K:(e=this.sub(t.mul(a)),i=a.add(e.div(t)),i)}else if(t.eq(ro))return this.unsigned?lc:rs;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();i=rs}for(e=this;e.gte(t);){a=Math.max(1,Math.floor(e.toNumber()/t.toNumber()));for(var r=Math.ceil(Math.log(a)/Math.LN2),s=r<=48?1:RM(2,r-48),g=un(a),c=g.mul(t);c.isNegative()||c.gt(e);)a-=s,g=un(a,this.unsigned),c=g.mul(t);g.isZero()&&(g=HE),i=i.add(g),e=e.sub(c)}return i};He.div=He.divide;He.modulo=function(t){if(ca(t)||(t=Cn(t)),En){var o=(this.unsigned?En.rem_u:En.rem_s)(this.low,this.high,t.low,t.high);return St(o,En.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};He.mod=He.modulo;He.rem=He.modulo;He.not=function(){return St(~this.low,~this.high,this.unsigned)};He.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};He.clz=He.countLeadingZeros;He.countTrailingZeros=function(){return this.low?PIe(this.low):PIe(this.high)+32};He.ctz=He.countTrailingZeros;He.and=function(t){return ca(t)||(t=Cn(t)),St(this.low&t.low,this.high&t.high,this.unsigned)};He.or=function(t){return ca(t)||(t=Cn(t)),St(this.low|t.low,this.high|t.high,this.unsigned)};He.xor=function(t){return ca(t)||(t=Cn(t)),St(this.low^t.low,this.high^t.high,this.unsigned)};He.shiftLeft=function(t){return ca(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?St(this.low<>>32-t,this.unsigned):St(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):St(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};He.shr=He.shiftRight;He.shiftRightUnsigned=function(t){return ca(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?St(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?St(this.high,0,this.unsigned):St(this.high>>>t-32,0,this.unsigned)};He.shru=He.shiftRightUnsigned;He.shr_u=He.shiftRightUnsigned;He.rotateLeft=function(t){var o;return ca(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?St(this.high,this.low,this.unsigned):t<32?(o=32-t,St(this.low<>>o,this.high<>>o,this.unsigned)):(t-=32,o=32-t,St(this.high<>>o,this.low<>>o,this.unsigned))};He.rotl=He.rotateLeft;He.rotateRight=function(t){var o;return ca(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?St(this.high,this.low,this.unsigned):t<32?(o=32-t,St(this.high<>>t,this.low<>>t,this.unsigned)):(t-=32,o=32-t,St(this.low<>>t,this.high<>>t,this.unsigned))};He.rotr=He.rotateRight;He.toSigned=function(){return this.unsigned?St(this.low,this.high,!1):this};He.toUnsigned=function(){return this.unsigned?this:St(this.low,this.high,!0)};He.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};He.toBytesLE=function(){var t=this.high,o=this.low;return[o&255,o>>>8&255,o>>>16&255,o>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};He.toBytesBE=function(){var t=this.high,o=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,o>>>24,o>>>16&255,o>>>8&255,o&255]};Ft.fromBytes=function(t,o,a){return a?Ft.fromBytesLE(t,o):Ft.fromBytesBE(t,o)};Ft.fromBytesLE=function(t,o){return new Ft(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,o)};Ft.fromBytesBE=function(t,o){return new Ft(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],o)};typeof BigInt=="function"&&(Ft.fromBigInt=function(t,o){var a=Number(BigInt.asIntN(32,t)),e=Number(BigInt.asIntN(32,t>>BigInt(32)));return St(a,e,o)},Ft.fromValue=function(t,o){return typeof t=="bigint"?Ft.fromBigInt(t,o):Cn(t,o)},He.toBigInt=function(){var t=BigInt(this.low>>>0),o=BigInt(this.unsigned?this.high>>>0:this.high);return o<{let n=new gc;return{mutex(t){return n.runExclusive(t)}}},JIe=()=>{let n=new Map;return{async mutex(t,o){let a=n.get(t);a||(a={mutex:new gc,refCount:0},n.set(t,a)),a.refCount++;try{return await a.mutex.runExclusive(o)}finally{a.refCount--,a.refCount===0&&n.get(t)===a&&n.delete(t)}}}};function qIe(n,t,o=10){let a=[],e=!1;return{enqueue:(A,r)=>{if(a.push({type:A,node:r}),e)return;e=!0,(async()=>{let g=0;for(;a.length&&t.isWsOpen();){let{type:c,node:I}=a.shift(),p=n.get(c);if(!p){t.onUnexpectedError(new Error(`unknown offline node type: ${c}`),"processing offline node");continue}await p(I).catch(B=>t.onUnexpectedError(B,`processing offline ${c}`)),g++,g>=o&&(g=0,await t.yieldToEventLoop())}e=!1})().catch(g=>t.onUnexpectedError(g,"processing offline nodes"))}}}var YM=ze(Jr(),1);var vI=ze(Jr(),1);var kM=class{constructor(){this.name="devices"}getQueryElement(){return{tag:"devices",attrs:{version:"2"}}}getUserElement(){return null}parser(t){let o=[],a;if(t.tag==="devices"){Za(t);let e=le(t,"device-list"),i=le(t,"key-index-list");if(Array.isArray(e?.content))for(let{tag:A,attrs:r}of e.content){let s=+r.id,g=+r["key-index"];A==="device"&&o.push({id:s,keyIndex:g,isHosted:!!(r.is_hosted&&r.is_hosted==="true")})}i?.tag==="key-index-list"&&(a={timestamp:+i.attrs.ts,signedKeyIndex:i?.content,expectedTimestamp:i.attrs.expected_ts?+i.attrs.expected_ts:void 0})}return{deviceList:o,keyIndex:a}}};var gg=class{withId(t){return this.id=t,this}withLid(t){return this.lid=t,this}withPhone(t){return this.phone=t,this}withUsername(t){return this.username=t,this}withUsernameKey(t){return this.usernameKey=t,this}withType(t){return this.type=t,this}withPersonaId(t){return this.personaId=t,this}};var vM=class{constructor(){this.name="contact"}getQueryElement(){return{tag:"contact",attrs:{}}}getUserElement(t){return t.phone?{tag:"contact",attrs:{},content:t.phone}:t.username?{tag:"contact",attrs:{username:t.username,...t.usernameKey?{pin:t.usernameKey}:{},...t.lid?{lid:t.lid}:{}}}:t.type?{tag:"contact",attrs:{type:t.type}}:{tag:"contact",attrs:{}}}parser(t){return t.tag==="contact"?(Za(t),t?.attrs?.type==="in"):!1}};var PM=class{constructor(){this.name="status"}getQueryElement(){return{tag:"status",attrs:{}}}getUserElement(){return null}parser(t){if(t.tag==="status"){Za(t);let o=t?.content?.toString()??null,a=new Date(+(t?.attrs.t||0)*1e3);return o?typeof o=="string"&&o.length===0&&(o=null):t.attrs?.code&&+t.attrs.code==401?o="":o=null,{status:o,setAt:a}}}};var GM=class{constructor(){this.name="disappearing_mode"}getQueryElement(){return{tag:"disappearing_mode",attrs:{}}}getUserElement(){return null}parser(t){if(t.tag==="disappearing_mode"){Za(t);let o=+t?.attrs.duration,a=new Date(+(t?.attrs.t||0)*1e3);return{duration:o,setAt:a}}}};var FM=class{constructor(){this.name="username"}getQueryElement(){return{tag:"username",attrs:{}}}getUserElement(t){return null}parser(t){return t.tag==="username"?(Za(t),typeof t.content=="string"?t.content:null):null}};var LM=class{constructor(){this.name="bot"}getQueryElement(){return{tag:"bot",attrs:{},content:[{tag:"profile",attrs:{v:"1"}}]}}getUserElement(t){return{tag:"bot",attrs:{},content:[{tag:"profile",attrs:{persona_id:t.personaId}}]}}parser(t){let o=le(t,"bot"),a=le(o,"profile"),e=le(a,"commands"),i=le(a,"prompts"),A=[],r=[];for(let s of PA(e,"command"))A.push({name:jA(s,"name"),description:jA(s,"description")});for(let s of PA(i,"prompt"))r.push(`${jA(s,"emoji")} ${jA(s,"text")}`);return{isDefault:!!le(a,"default"),jid:t.attrs.jid,name:jA(a,"name"),attributes:jA(a,"attributes"),description:jA(a,"description"),category:jA(a,"category"),personaId:a.attrs.persona_id,commandsDescription:jA(e,"description"),commands:A,prompts:r}}};var UM=class{constructor(){this.name="lid"}getQueryElement(){return{tag:"lid",attrs:{}}}getUserElement(t){return t.lid?{tag:"lid",attrs:{jid:t.lid}}:null}parser(t){return t.tag==="lid"?t.attrs.val:null}};var cg=class{constructor(){this.protocols=[],this.users=[],this.context="interactive",this.mode="query"}withMode(t){return this.mode=t,this}withContext(t){return this.context=t,this}withUser(t){return this.users.push(t),this}parseUSyncQueryResult(t){if(t?.attrs.type!=="result")return;let o=Object.fromEntries(this.protocols.map(A=>[A.name,A.parser])),a={list:[],sideList:[]},e=le(t,"usync"),i=e?le(e,"list"):void 0;return i?.content&&Array.isArray(i.content)&&(a.list=i.content.reduce((A,r)=>{let s=r?.attrs.jid;if(s){let g=Array.isArray(r?.content)?Object.fromEntries(r.content.map(c=>{let I=c.tag,p=o[I];return p?[I,p(c)]:[I,null]}).filter(([,c])=>c!==null)):{};A.push({...g,id:s})}return A},[])),a}withDeviceProtocol(){return this.protocols.push(new kM),this}withContactProtocol(){return this.protocols.push(new vM),this}withStatusProtocol(){return this.protocols.push(new PM),this}withDisappearingModeProtocol(){return this.protocols.push(new GM),this}withBotProfileProtocol(){return this.protocols.push(new LM),this}withLIDProtocol(){return this.protocols.push(new UM),this}withUsernameProtocol(){return this.protocols.push(new FM),this}};var ei=ze(Jr(),1);import{randomBytes as RK}from"crypto";import{URL as _Xe}from"url";import{promisify as TXe}from"util";var HM=class{constructor(t={}){this.protocolVersion=5,this.sequence=0,this.events=[],this.buffer=[],Object.assign(this,t)}};import{EventEmitter as bXe}from"events";var KM=class extends bXe{constructor(t,o){super(),this.url=t,this.config=o,this.setMaxListeners(0)}};var xM=class extends KM{constructor(){super(...arguments),this.socket=null}get isOpen(){return this.socket?.readyState===Jo.OPEN}get isClosed(){return this.socket===null||this.socket?.readyState===Jo.CLOSED}get isClosing(){return this.socket===null||this.socket?.readyState===Jo.CLOSING}get isConnecting(){return this.socket?.readyState===Jo.CONNECTING}connect(){if(this.socket)return;this.socket=new Jo(this.url,{origin:Jf,headers:this.config.options?.headers,handshakeTimeout:this.config.connectTimeoutMs,timeout:this.config.connectTimeoutMs,agent:this.config.agent}),this.socket.setMaxListeners(0);let t=["close","error","upgrade","message","open","ping","pong","unexpected-response"];for(let o of t)this.socket?.on(o,(...a)=>this.emit(o,...a))}async close(){if(!this.socket)return;let t=new Promise(o=>{this.socket?.once("close",o)});this.socket.close(),await t,this.socket=null}send(t,o){return this.socket?.send(t,o),!!this.socket}};var NK=ze(Jr(),1);var MXe=(n,t,o,a)=>o({tag:"iq",attrs:{id:a(),type:"get",to:OA,xmlns:"w:mex"},content:[{tag:"query",attrs:{query_id:t},content:Buffer.from(JSON.stringify({variables:n}),"utf-8")}]}),pQ=async(n,t,o,a,e)=>{let i=await MXe(n,t,a,e),A=le(i,"result");if(A?.content){let s=JSON.parse(A.content.toString());if(s.errors&&s.errors.length>0){let c=s.errors.map(B=>B.message||"Unknown error").join(", "),I=s.errors[0],p=I.extensions?.error_code||400;throw new NK.Boom(`GraphQL server error: ${c}`,{statusCode:p,data:I})}let g=o?s?.data?.[o]:s?.data;if(typeof g<"u")return g}let r=(o||"").startsWith("xwa2_")?o.substring(5).replace(/_/g," "):o?.replace(/_/g," ");throw new NK.Boom(`Failed to ${r}, unexpected response structure.`,{statusCode:400,data:i})};var zIe=n=>{let{waWebSocketUrl:t,connectTimeoutMs:o,logger:a,keepAliveIntervalMs:e,browser:i,auth:A,printQRInTerminal:r,defaultQueryTimeoutMs:s,transactionOpts:g,qrTimeout:c,makeSignalRepository:I}=n,p=new HM,B=0,f=Aee(),Q=()=>`${f}${oe++}`;r&&a.warn({},"\u26A0\uFE0F The printQRInTerminal option has been deprecated. You will no longer receive QR codes in the terminal automatically. Please listen to the connection.update event yourself and handle the QR your way. You can remove this message by removing this opttion. This message will be removed in a future version."),i[1].toLocaleLowerCase().includes("android")&&a.warn("\u26A0\uFE0F Using the Android browser is experimental and may lead to unexpected behavior. Use at your own risk."),cQ.map(pe=>n.shouldSyncHistoryMessage({syncType:pe})).filter(pe=>pe===!1).length===cQ.length&&a.warn("\u26A0\uFE0F DANGER: DISABLING ALL SYNC BY shouldSyncHistoryMsg PREVENTS BAILEYS FROM ACCESSING INITIAL LID MAPPINGS, LEADING TO INSTABILIY AND SESSION ERRORS");let m=typeof t=="string"?new _Xe(t):t;if(n.mobile||m.protocol==="tcp:")throw new ei.Boom("Mobile API is not supported anymore",{statusCode:ar.loggedOut});m.protocol==="wss"&&A?.creds?.routingInfo&&m.searchParams.append("ED",A.creds.routingInfo.toString("base64url"));let T=br.generateKeyPair(),_=wse({keyPair:T,NOISE_HEADER:OIe,logger:a,routingInfo:A?.creds?.routingInfo}),R=new xM(m,n);R.connect();let L=TXe(R.send),U=async pe=>{if(!R.isOpen)throw new ei.Boom("Connection Closed",{statusCode:ar.connectionClosed});let Qe=_.encodeFrame(pe);await Gh(o,async(Me,oA)=>{try{await L.call(R,Qe),Me()}catch(pA){oA(pA)}})},F=pe=>{a.level==="trace"&&a.trace({xml:Jn(pe),msg:"xml send"});let Qe=B$(pe);return U(Qe)},q=async(pe,Qe=s)=>{let Me,oA;try{return await Gh(Qe,(FA,jt)=>(Me=ct=>{FA(ct)},oA=ct=>{jt(ct||new ei.Boom("Connection Closed",{statusCode:ar.connectionClosed}))},R.on(`TAG:${pe}`,Me),R.on("close",oA),R.on("error",oA),()=>jt(new ei.Boom("Query Cancelled"))))}catch(pA){if(pA instanceof ei.Boom&&pA.output?.statusCode===ar.timedOut){a?.warn?.({msgId:pe},"timed out waiting for message");return}throw pA}finally{Me&&R.off(`TAG:${pe}`,Me),oA&&(R.off("close",oA),R.off("error",oA))}},z=async(pe,Qe)=>{pe.attrs.id||(pe.attrs.id=Q());let Me=pe.attrs.id,oA=await Gh(Qe,async(pA,FA)=>{let jt=q(Me,Qe).catch(FA);F(pe).then(async()=>pA(await jt)).catch(FA)});return oA&&"tag"in oA&&Za(oA),oA},K=async()=>{let pe=await z({tag:"iq",attrs:{to:OA,type:"get",xmlns:"encrypt"},content:[{tag:"digest",attrs:{}}]});if(!le(pe,"digest"))throw await Xe(),new Error("encrypt/get digest returned no digest node")},G=async()=>{let pe=(J.signedPreKey.keyId||0)+1,Qe=await HD(J.signedIdentityKey,pe);await z({tag:"iq",attrs:{to:OA,type:"set",xmlns:"encrypt"},content:[{tag:"rotate",attrs:{},content:[Wf(Qe)]}]}),k.emit("creds.update",{signedPreKey:Qe})},V=async pe=>{if(pe.protocols.length===0)throw new ei.Boom("USyncQuery must have at least one protocol");let Me=pe.users.map(ct=>({tag:"user",attrs:{jid:ct.phone?void 0:ct.id},content:pe.protocols.map(_r=>_r.getUserElement(ct)).filter(_r=>_r!==null)})),oA={tag:"list",attrs:{},content:Me},pA={tag:"query",attrs:{},content:pe.protocols.map(ct=>ct.getQueryElement())},FA={tag:"iq",attrs:{to:OA,type:"get",xmlns:"usync"},content:[{tag:"usync",attrs:{context:pe.context,mode:pe.mode,sid:Q(),last:"true",index:"0"},content:[pA,oA]}]},jt=await z(FA);return pe.parseUSyncQueryResult(jt)},H=async(...pe)=>{let Qe=new cg,Me=!1;for(let pA of pe)if(qA(pA)){a?.warn("LIDs are not supported with onWhatsApp");continue}else{Me||(Me=!0,Qe=Qe.withContactProtocol());let FA=`+${pA.replace("+","").split("@")[0]?.split(":")[0]}`;Qe.withUser(new gg().withPhone(FA))}if(Qe.users.length===0)return[];let oA=await V(Qe);if(oA)return oA.list.filter(pA=>!!pA.contact).map(({contact:pA,id:FA})=>({jid:FA,exists:pA}))},N=async pe=>{let Qe=new cg().withLIDProtocol().withContext("background");for(let oA of pe)if(qA(oA)){a?.warn("LID user found in LID fetch call");continue}else Qe.withUser(new gg().withId(oA));if(Qe.users.length===0)return[];let Me=await V(Qe);return Me?Me.list.filter(oA=>!!oA.lid).map(({lid:oA,id:pA})=>({pn:pA,lid:oA})):[]},k=oge(a),{creds:J}=A,X=Zse(A.keys,a,g),ie=I({creds:J,keys:X},a,N),De,oe=1,Se,Be,Re=!1,Ne=[],Je=(pe,Qe)=>{a.error({err:pe},`unexpected error in '${Qe}'`)},ve=async pe=>{if(!R.isOpen)throw new ei.Boom("Connection Closed",{statusCode:ar.connectionClosed});let Qe,Me,oA=Gh(o,(pA,FA)=>{Qe=pA,Me=kK(FA),R.on("frame",Qe),R.on("close",Me),R.on("error",Me)}).finally(()=>{R.off("frame",Qe),R.off("close",Me),R.off("error",Me)});return pe&&U(pe).catch(Me),oA},tA=async()=>{let pe={clientHello:{ephemeral:T.public}};pe=ne.HandshakeMessage.fromObject(pe),a.info({browser:i,helloMsg:pe},"connected to WA");let Qe=ne.HandshakeMessage.encode(pe).finish(),Me=await ve(Qe),oA=ne.HandshakeMessage.decode(Me);a.trace({handshake:oA},"handshake recv from WA");let pA=_.processHandshake(oA,J.noiseKey),FA;J.me?(FA=use(J.me.id,n),a.info({node:FA},"logging in...")):(FA=Cse(J,n),a.info({node:FA},"not logged in, attempting registration..."));let jt=_.encrypt(ne.ClientPayload.encode(FA).finish());await U(ne.HandshakeMessage.encode({clientFinish:{static:pA,payload:jt}}).finish()),await _.finishInit(),Ze()},fe=async()=>{let pe=await z({tag:"iq",attrs:{id:Q(),xmlns:"encrypt",type:"get",to:OA},content:[{tag:"count",attrs:{}}]});return+le(pe,"count").attrs.value},Ie=null,Xe=async(pe=IQ)=>{if(Ie){a.debug("Pre-key upload already in progress, waiting for completion"),await Ie;return}let Qe=async Me=>{a.info({count:pe,retryCount:Me},"uploading pre-keys");let oA=await X.transaction(async()=>{a.debug({requestedCount:pe},"generating pre-keys with requested count");let{update:pA,node:FA}=await dse({creds:J,keys:X},pe);return k.emit("creds.update",pA),FA},J?.me?.id||"upload-pre-keys");try{await z(oA),a.info({count:pe},"uploaded pre-keys successfully")}catch(pA){if(a.error({uploadError:pA.toString(),count:pe},"Failed to upload pre-keys to server"),Me<3){let FA=Math.min(1e3*Math.pow(2,Me),1e4);return a.info(`Retrying pre-key upload in ${FA}ms`),await new Promise(jt=>setTimeout(jt,FA)),Qe(Me+1)}throw pA}};Ie=Promise.race([Qe(0),new Promise((Me,oA)=>setTimeout(()=>oA(new ei.Boom("Pre-key upload timeout",{statusCode:408})),TIe))]);try{await Ie}finally{Ie=null}},je=async()=>{let pe=J.nextPreKeyId-1;return pe<=0?{exists:!1,currentPreKeyId:0}:{exists:!!(await X.get("pre-key",[pe.toString()]))[pe.toString()],currentPreKeyId:pe}},be=async()=>{try{let pe=0,Qe=await fe();Qe===0?pe=_Ie:pe=IQ;let{exists:Me,currentPreKeyId:oA}=await je();a.info(`${Qe} pre-keys found on server`),a.info(`Current prekey ID: ${oA}, exists in storage: ${Me}`);let pA=Qe<=pe,FA=!Me&&oA>0;if(pA||FA){let ct=[];pA&&ct.push(`server count low (${Qe})`),FA&&ct.push(`current prekey ${oA} missing from storage`),a.info(`Uploading PreKeys due to: ${ct.join(", ")}`),await Xe(pe)}else a.info(`PreKey validation passed - Server: ${Qe}, Current prekey ${oA} exists`)}catch(pe){a.error({error:pe},"Failed to check/upload pre-keys during initialization")}},uA=async pe=>{await _.decodeFrame(pe,Qe=>{De=new Date;let Me=!1;if(Me=R.emit("frame",Qe),!(Qe instanceof Uint8Array)){let oA=Qe.attrs.id;a.level==="trace"&&a.trace({xml:Jn(Qe),msg:"recv xml"}),Me=R.emit(`${SIe}${oA}`,Qe)||Me;let pA=Qe.tag,FA=Qe.attrs||{},jt=Array.isArray(Qe.content)?Qe.content[0]?.tag:"";for(let ct of Object.keys(FA))Me=R.emit(`${UE}${pA},${ct}:${FA[ct]},${jt}`,Qe)||Me,Me=R.emit(`${UE}${pA},${ct}:${FA[ct]}`,Qe)||Me,Me=R.emit(`${UE}${pA},${ct}`,Qe)||Me;Me=R.emit(`${UE}${pA},,${jt}`,Qe)||Me,Me=R.emit(`${UE}${pA}`,Qe)||Me,!Me&&a.level==="debug"&&a.debug({unhandled:!0,msgId:oA,fromMe:!1,frame:Qe},"communication recv")}})},EA=async pe=>{if(Re){a.trace({trace:pe?.stack},"connection already closed");return}if(Re=!0,a.info({trace:pe?.stack},pe?"connection errored":"connection closed"),clearInterval(Se),clearTimeout(Be),R.removeAllListeners("close"),R.removeAllListeners("open"),R.removeAllListeners("message"),ie.close?.(),!R.isClosed&&!R.isClosing)try{await R.close()}catch{}for(let Qe of Ne)try{await Qe(pe)}catch(Me){a.error({err:Me},"error in socket end handler")}k.emit("connection.update",{connection:"close",lastDisconnect:{error:pe,date:new Date}}),k.removeAllListeners("connection.update"),k.destroy()},aA=async()=>{if(R.isOpen)return;if(R.isClosed||R.isClosing)throw new ei.Boom("Connection Closed",{statusCode:ar.connectionClosed});let pe,Qe;await new Promise((Me,oA)=>{pe=()=>Me(void 0),Qe=kK(oA),R.on("open",pe),R.on("close",Qe),R.on("error",Qe)}).finally(()=>{R.off("open",pe),R.off("close",Qe),R.off("error",Qe)})},Ze=()=>Se=setInterval(()=>{De||(De=new Date),Date.now()-De.getTime()>e+5e3?EA(new ei.Boom("Connection was lost",{statusCode:ar.connectionLost})):R.isOpen?z({tag:"iq",attrs:{id:Q(),to:OA,type:"get",xmlns:"w:p"},content:[{tag:"ping",attrs:{}}]}).catch(Qe=>{a.error({trace:Qe.stack},"error in sending keep alive")}):a.warn("keep alive called when WS not open")},e),bA=pe=>z({tag:"iq",attrs:{to:OA,xmlns:"passive",type:"set"},content:[{tag:pe,attrs:{}}]}),Ce=async pe=>{let Qe=A.creds.me?.id;Qe&&await F({tag:"iq",attrs:{to:OA,type:"set",id:Q(),xmlns:"md"},content:[{tag:"remove-companion-device",attrs:{jid:Qe,reason:"user_initiated"}}]}),EA(new ei.Boom(pe||"Intentional Logout",{statusCode:ar.loggedOut}))},ke=async(pe,Qe)=>{let Me=Qe??oee(RK(5));if(Qe&&Qe?.length!==8)throw new Error("Custom pairing code must be exactly 8 chars");return A.creds.pairingCode=Me,A.creds.me={id:Dr(pe,"s.whatsapp.net"),name:"~"},k.emit("creds.update",A.creds),await F({tag:"iq",attrs:{to:OA,type:"set",id:Q(),xmlns:"md"},content:[{tag:"link_code_companion_reg",attrs:{jid:A.creds.me.id,stage:"companion_hello",should_show_push_notification:"true"},content:[{tag:"link_code_pairing_wrapped_companion_ephemeral_pub",attrs:{},content:await Ue()},{tag:"companion_server_auth_key_pub",attrs:{},content:A.creds.noiseKey.public},{tag:"companion_platform_id",attrs:{},content:kH(i)},{tag:"companion_platform_display",attrs:{},content:`${i[1]} (${i[0]})`},{tag:"link_code_pairing_nonce",attrs:{},content:"0"}]}]}),A.creds.pairingCode};async function Ue(){let pe=RK(32),Qe=RK(16),Me=await KD(A.creds.pairingCode,pe),oA=x$(A.creds.pairingEphemeralKeyPair.public,Me,Qe);return Buffer.concat([pe,Qe,oA])}let MA=pe=>z({tag:"iq",attrs:{to:OA,id:Q(),xmlns:"w:stats"},content:[{tag:"add",attrs:{t:Math.round(Date.now()/1e3)+""},content:pe}]});R.on("message",uA),R.on("open",async()=>{try{await tA()}catch(pe){a.error({err:pe},"error in validating connection"),EA(pe)}}),R.on("error",kK(EA)),R.on("close",()=>void EA(new ei.Boom("Connection Terminated",{statusCode:ar.connectionClosed}))),R.on("CB:xmlstreamend",()=>void EA(new ei.Boom("Connection Terminated by Server",{statusCode:ar.connectionClosed}))),R.on("CB:iq,type:set,pair-device",async pe=>{let Qe={tag:"iq",attrs:{to:OA,type:"result",id:pe.attrs.id}};await F(Qe);let Me=le(pe,"pair-device"),oA=PA(Me,"ref"),pA=Buffer.from(J.noiseKey.public).toString("base64"),FA=Buffer.from(J.signedIdentityKey.public).toString("base64"),jt=J.advSecretKey,ct=c||6e4,_r=()=>{if(!R.isOpen)return;let gr=oA.shift();if(!gr){EA(new ei.Boom("QR refs attempts ended",{statusCode:ar.timedOut}));return}let wo=gr.content.toString("utf-8"),io=gge(wo,pA,FA,jt,i);k.emit("connection.update",{qr:io}),Be=setTimeout(_r,ct),ct=c||2e4};_r()}),R.on("CB:iq,,pair-success",async pe=>{a.debug("pair success recv");try{_A(pe);let{reply:Qe,creds:Me}=Bse(pe,J);a.info({me:Me.me,platform:Me.platform},"pairing configured successfully, expect to restart the connection..."),k.emit("creds.update",Me),k.emit("connection.update",{isNewLogin:!0,qr:void 0}),await F(Qe),wA()}catch(Qe){a.info({trace:Qe.stack},"error in pairing"),EA(Qe)}}),R.on("CB:success",async pe=>{try{_A(pe),await be(),await bA("active");try{await K()}catch(Qe){a.warn({e:Qe},"failed to run digest after login")}}catch(Qe){a.warn({err:Qe},"failed to send initial passive iq")}if(a.info("opened connection to WA"),clearTimeout(Be),k.emit("creds.update",{me:{...A.creds.me,lid:pe.attrs.lid}}),k.emit("connection.update",{connection:"open"}),wA(),pe.attrs.lid&&A.creds.me?.id){let Qe=pe.attrs.lid;process.nextTick(async()=>{try{let Me=A.creds.me.id;await ie.lidMapping.storeLIDPNMappings([{lid:Qe,pn:Me}]);let{user:oA,device:pA}=hA(Me);await A.keys.set({"device-list":{[oA]:[pA?.toString()||"0"]}}),await ie.migrateSession(Me,Qe),a.info({myPN:Me,myLID:Qe},"Own LID session created successfully")}catch(Me){a.error({error:Me,lid:Qe},"Failed to create own LID session")}})}}),R.on("CB:stream:error",pe=>{let[Qe]=Gs(pe);a.error({reasonNode:Qe,fullErrorNode:pe},"stream errored out");let{reason:Me,statusCode:oA}=ree(pe);EA(new ei.Boom(`Stream Errored (${Me})`,{statusCode:oA,data:Qe||pe}))}),R.on("CB:failure",pe=>{let Qe=+(pe.attrs.reason||500);EA(new ei.Boom("Connection Failure",{statusCode:Qe,data:pe.attrs}))}),R.on("CB:ib,,downgrade_webclient",()=>{EA(new ei.Boom("Multi-device beta not joined",{statusCode:ar.multideviceMismatch}))}),R.on("CB:ib,,offline_preview",async pe=>{a.info("offline preview received",JSON.stringify(pe)),await F({tag:"ib",attrs:{},content:[{tag:"offline_batch",attrs:{count:"100"}}]})}),R.on("CB:ib,,edge_routing",pe=>{let Qe=le(pe,"edge_routing"),Me=le(Qe,"routing_info");Me?.content&&(A.creds.routingInfo=Buffer.from(Me?.content),k.emit("creds.update",A.creds))});let Ke=!1;process.nextTick(()=>{J.me?.id&&(k.buffer(),Ke=!0),k.emit("connection.update",{connection:"connecting",receivedPendingNotifications:!1,qr:void 0})}),R.on("CB:ib,,offline",pe=>{let Me=+(le(pe,"offline")?.attrs.count||0);a.info(`handled ${Me} offline messages/notifications`),Ke&&(k.flush(),a.trace("flushed events for initial buffer")),k.emit("connection.update",{receivedPendingNotifications:!0})}),k.on("creds.update",pe=>{let Qe=pe.me?.name;J.me?.name!==Qe&&(a.debug({name:Qe},"updated pushName"),F({tag:"presence",attrs:{name:Qe}}).catch(Me=>{a.warn({trace:Me.stack},"error in sending presence update on name change")})),Object.assign(J,pe)});let _A=({attrs:pe})=>{let Qe=pe?.t;if(!Qe)return;let Me=Number(Qe);if(Number.isNaN(Me)||Me<=0)return;let oA=Date.now();B=Me*1e3-oA,a.debug({offset:B},"calculated server time offset")},ot=()=>{let pe=3*OK.Day;return((Date.now()+B+pe)%OK.Week).toString()},wA=async()=>{if(!R.isOpen)return;let pe={tag:"ib",attrs:{},content:[{tag:"unified_session",attrs:{id:ot()}}]};try{await F(pe)}catch(Qe){a.debug({error:Qe},"failed to send unified_session telemetry")}},ht=pe=>{Ne.push(pe)},fr=async()=>{let pe=await pQ({},ui.REACHOUT_TIMELOCK,Ri.xwa2_fetch_account_reachout_timelock,z,Q),Qe={isActive:!!pe?.is_active,timeEnforcementEnds:pe?.time_enforcement_ends&&pe?.time_enforcement_ends!=="0"?new Date(parseInt(pe.time_enforcement_ends,10)*1e3):void 0,enforcementType:pe?.enforcement_type??iI.DEFAULT};return k.emit("connection.update",{reachoutTimeLock:Qe}),Qe},UA=async()=>pQ({input:{type:"INDIVIDUAL_NEW_CHAT_MSG"}},ui.MESSAGE_CAPPING_INFO,Ri.xwa2_message_capping_info,z,Q);return{type:"md",ws:R,ev:k,authState:{creds:J,keys:X},signalRepository:ie,get user(){return A.creds.me},generateMessageTag:Q,query:z,waitForMessage:q,waitForSocketOpen:aA,sendRawMessage:U,sendNode:F,logout:Ce,end:EA,registerSocketEndHandler:ht,onUnexpectedError:Je,uploadPreKeys:Xe,uploadPreKeysToServerIfRequired:be,digestKeyBundle:K,rotateSignedPreKey:G,requestPairingCode:ke,updateServerTimeOffset:_A,sendUnifiedSession:wA,wamBuffer:p,waitForConnectionUpdate:eee(k),sendWAMBuffer:MA,executeUSyncQuery:V,onWhatsApp:H,fetchAccountReachoutTimelock:fr,fetchNewChatMessageCap:UA}};function kK(n){return t=>{n(new ei.Boom(`WebSocket Error (${t?.message})`,{statusCode:aee(t),data:t}))}}var NXe=(n,t)=>{let o={tag:"picture",attrs:{type:n,query:"url"}};return t?.length&&(o.content=t),[o]},VIe=n=>{let{logger:t,markOnlineOnConnect:o,fireInitQueries:a,appStateMacVerification:e,shouldIgnoreJid:i,shouldSyncHistoryMessage:A,getMessage:r}=n,s=zIe(n),{ev:g,ws:c,authState:I,generateMessageTag:p,sendNode:B,query:f,signalRepository:Q,onUnexpectedError:y,sendUnifiedSession:m,registerSocketEndHandler:T}=s,_=Q.lidMapping.getLIDForPN.bind(Q.lidMapping),R,L={privacyTokenOn1to1:!0,profilePicPrivacyToken:!0,lidTrustedTokenIssueToLid:!1},U=Ei.Connecting,F=pc(),q=pc(),z=pc(),K=pc(),G,V={initialBootstrapComplete:!1,recentSyncComplete:!1},H,N=new Set,k=n.placeholderResendCache||new sc({stdTTL:NI.MSG_RETRY,useClones:!1}),J=async W=>{let{[W]:$}=await I.keys.get("app-state-sync-key",[W]);return $},X=async(W=!1)=>{if(!R||W){let{content:$}=await f({tag:"iq",attrs:{xmlns:"privacy",to:OA,type:"get"},content:[{tag:"privacy",attrs:{}}]});R=DL($?.[0],"category")}return R},ie=async(W,$)=>{await f({tag:"iq",attrs:{xmlns:"privacy",to:OA,type:"set"},content:[{tag:"privacy",attrs:{},content:[{tag:"category",attrs:{name:W,value:$}}]}]})},De=async W=>{await ie("messages",W)},oe=async W=>{await ie("calladd",W)},Se=async W=>{await ie("last",W)},Be=async W=>{await ie("online",W)},Re=async W=>{await ie("profile",W)},Ne=async W=>{await ie("status",W)},Je=async W=>{await ie("readreceipts",W)},ve=async W=>{await ie("groupadd",W)},tA=async W=>{await f({tag:"iq",attrs:{xmlns:"disappearing_mode",to:OA,type:"set"},content:[{tag:"disappearing_mode",attrs:{duration:W.toString()}}]})},fe=async()=>{let W=await f({tag:"iq",attrs:{xmlns:"bot",to:OA,type:"get"},content:[{tag:"bot",attrs:{v:"2"}}]}),$=le(W,"bot"),re=[];for(let se of PA($,"section"))if(se.attrs.type==="all")for(let we of PA(se,"bot"))re.push({jid:we.attrs.jid,personaId:we.attrs.persona_id});return re},Ie=async(...W)=>{let $=new cg().withStatusProtocol();for(let se of W)$.withUser(new gg().withId(se));let re=await s.executeUSyncQuery($);if(re)return re.list},Xe=async(...W)=>{let $=new cg().withDisappearingModeProtocol();for(let se of W)$.withUser(new gg().withId(se));let re=await s.executeUSyncQuery($);if(re)return re.list},je=async(W,$,re)=>{let se;if(!W)throw new vI.Boom("Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update");BA(W)!==BA(I.creds.me.id)?se=BA(W):se=void 0;let{img:we}=await jb($,re);await f({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:profile:picture",...se?{target:se}:{}},content:[{tag:"picture",attrs:{type:"image"},content:we}]})},be=async W=>{let $;if(!W)throw new vI.Boom("Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update");BA(W)!==BA(I.creds.me.id)?$=BA(W):$=void 0,await f({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:profile:picture",...$?{target:$}:{}}})},uA=async W=>{await f({tag:"iq",attrs:{to:OA,type:"set",xmlns:"status"},content:[{tag:"status",attrs:{},content:Buffer.from(W,"utf-8")}]})},EA=async W=>{await UA({pushNameSetting:W},"")},aA=async()=>{let W=await f({tag:"iq",attrs:{xmlns:"blocklist",to:OA,type:"get"}}),$=le(W,"list");return PA($,"item").map(re=>re.attrs.jid)},Ze=async(W,$)=>{let re=BA(W),se,we;if(qA(re)||Ci(re)){if(se=re,$==="block"){let he=await Q.lidMapping.getPNForLID(re);if(!he)throw new vI.Boom(`Unable to resolve PN JID for LID: ${W}`,{statusCode:400});we=BA(he)}}else if(Rt(re)||Or(re)){let he=await Q.lidMapping.getLIDForPN(re);if(!he)throw new vI.Boom(`Unable to resolve LID for PN JID: ${W}`,{statusCode:400});se=he,$==="block"&&(we=BA(re))}else throw new vI.Boom(`Invalid jid: ${W}`,{statusCode:400});let Ee={action:$,jid:se};if($==="block"){if(!we)throw new vI.Boom(`pn_jid required for block: ${W}`,{statusCode:400});Ee.pn_jid=we}await f({tag:"iq",attrs:{xmlns:"blocklist",to:OA,type:"set"},content:[{tag:"item",attrs:Ee}]})},bA=async W=>{let $=await f({tag:"iq",attrs:{to:"s.whatsapp.net",xmlns:"w:biz",type:"get"},content:[{tag:"business_profile",attrs:{v:"244"},content:[{tag:"profile",attrs:{jid:W}}]}]}),re=le($,"business_profile"),se=le(re,"profile");if(se){let we=le(se,"address"),Ee=le(se,"description"),he=le(se,"website"),ye=le(se,"email"),qe=le(le(se,"categories"),"category"),IA=le(se,"business_hours"),yA=IA?PA(IA,"business_hours_config"):void 0,$A=he?.content?.toString();return{wid:se.attrs?.jid,address:we?.content?.toString(),description:Ee?.content?.toString()||"",website:$A?[$A]:[],email:ye?.content?.toString(),category:qe?.content?.toString(),business_hours:{timezone:IA?.attrs?.timezone,business_config:yA?.map(({attrs:vA})=>vA)}}}},Ce=async(W,$)=>{t.info({fromTimestamp:$},"clean dirty bits "+W),await B({tag:"iq",attrs:{to:OA,type:"set",xmlns:"urn:xmpp:whatsapp:dirty",id:p()},content:[{tag:"clean",attrs:{type:W,...$?{timestamp:$.toString()}:null}}]})},ke=W=>({onMutation($){Kse($,g,I.creds.me,W?{accountSettings:I.creds.accountSettings}:void 0,t)}}),Ue=g.createBufferedFunction(async(W,$)=>{let re=new Map,se=async ye=>{if(re.has(ye))return re.get(ye)??void 0;let qe=await J(ye);return re.set(ye,qe??null),qe},we={},Ee={};await I.keys.transaction(async()=>{let ye=new Set(W),qe={},IA=new Set;for(;ye.size;){let yA={},$A=[];for(let At of ye){let rA=(await I.keys.get("app-state-sync-version",[At]))[At];rA?(rA=gH(rA),typeof we[At]>"u"&&(we[At]=rA.version)):rA=Zb(),yA[At]=rA;let tt=IA.has(At);tt&&IA.delete(At),t.info(`resyncing ${At} from v${rA.version}${tt?" (forcing snapshot)":""}`),$A.push({tag:"collection",attrs:{name:At,version:rA.version.toString(),return_snapshot:(tt||!rA.version).toString()}})}let vA=await f({tag:"iq",attrs:{to:OA,xmlns:"w:sync:app:state",type:"set"},content:[{tag:"sync",attrs:{},content:$A}]}),YA=await Fse(vA,n?.options);for(let At in YA){let Ge=At,{patches:rA,hasMorePatches:tt,snapshot:Ai}=YA[Ge];try{if(Ai){let{state:cr,mutationMap:Do}=await Use(Ge,Ai,se,we[Ge],e.snapshot,t);yA[Ge]=cr,Object.assign(Ee,Do),t.info(`restored state of ${Ge} from snapshot to v${cr.version} with mutations`),await I.keys.set({"app-state-sync-version":{[Ge]:cr}})}if(rA.length){let{state:cr,mutationMap:Do}=await IH(Ge,rA,yA[Ge],se,n.options,we[Ge],t,e.patch);await I.keys.set({"app-state-sync-version":{[Ge]:cr}}),t.info(`synced ${Ge} to v${cr.version}`),we[Ge]=cr.version,Object.assign(Ee,Do)}tt?t.info(`${Ge} has more patches...`):ye.delete(Ge)}catch(cr){qe[Ge]=(qe[Ge]||0)+1;let Do={name:Ge,attempt:qe[Ge],version:yA[Ge].version,statusCode:cr.output?.statusCode,errorType:cr.name,error:cr.stack};$f(cr)&&qe[Ge]>=cH?(t.warn(Do,`${Ge} blocked on missing key from v${yA[Ge].version}, parking after ${qe[Ge]} attempts`),N.add(Ge),ye.delete(Ge)):$f(cr)?(t.info(Do,`${Ge} blocked on missing key from v${yA[Ge].version}, retrying with snapshot`),IA.add(Ge)):vse(cr,qe[Ge])?(t.warn(Do,`failed to sync ${Ge} from v${yA[Ge].version}, giving up`),ye.delete(Ge)):(t.info(Do,`failed to sync ${Ge} from v${yA[Ge].version}, forcing snapshot retry`),IA.add(Ge))}}}},I?.creds?.me?.id||"resync-app-state");let{onMutation:he}=ke($);for(let ye in Ee)he(Ee[ye])}),MA=async(W,$="preview",re)=>{let se=BA(W),we=Rt(se)||qA(se),Ee=I.creds.me,he=Ee&&(se===BA(Ee.id)||Ee.lid&&se===BA(Ee.lid)),ye;L.profilePicPrivacyToken&&we&&!he&&(ye=await bH({authState:I,jid:se,getLIDForPN:_})),W=BA(W);let qe=await f({tag:"iq",attrs:{target:W,to:OA,type:"get",xmlns:"w:profile:picture"},content:NXe($,ye)},re);return le(qe,"picture")?.attrs?.url},Ke=async(W,$,re)=>{let se=await f({tag:"call",attrs:{id:p(),to:"@call"},content:[{tag:"link_create",attrs:{media:W},content:$?[{tag:"event",attrs:{start_time:String($.startTime)}}]:void 0}]},re);return le(se,"link_create")?.attrs?.token},_A=async(W,$)=>{let re=I.creds.me,se=W==="available";if(se||W==="unavailable"){if(!re.name){t.warn("no name present, ignoring presence update request...");return}g.emit("connection.update",{isOnline:se}),se&&m(),await B({tag:"presence",attrs:{name:re.name.replace(/@/g,""),type:W}})}else{let{server:we}=hA($);await B({tag:"chatstate",attrs:{from:we==="lid"?re.lid:re.id,to:$},content:[{tag:W==="recording"?"composing":W,attrs:W==="recording"?{media:"audio"}:{}}]})}},ot=async W=>{let $=BA(W),se=Rt($)||qA($)?await bH({authState:I,jid:$,getLIDForPN:_}):void 0;return B({tag:"presence",attrs:{to:W,id:p(),type:"subscribe"},content:se})},wA=({tag:W,attrs:$,content:re})=>{let se,we=$.from,Ee=$.participant||$.from;if(!(i(we)&&we!==OA)){if(W==="presence")se={lastKnownPresence:$.type==="unavailable"?"unavailable":"available",lastSeen:$.last&&$.last!=="deny"?+$.last:void 0,groupOnlineCount:$.count?+$.count:void 0};else if(Array.isArray(re)){let[he]=re,ye=he.tag;ye==="paused"&&(ye="available"),he.attrs?.media==="audio"&&(ye="recording"),se={lastKnownPresence:ye}}else t.error({tag:W,attrs:$,content:re},"recv invalid presence node");se&&g.emit("presence.update",{id:we,presences:{[Ee]:se}})}},ht=async W=>{let $=W.type,re=I.creds.myAppStateKeyId;if(!re)throw new vI.Boom("App state key not present!",{statusCode:400});let se,we;if(await z.mutex(async()=>{await I.keys.transaction(async()=>{t.debug({patch:W},"applying app patch"),await Ue([$],!1);let{[$]:Ee}=await I.keys.get("app-state-sync-version",[$]);se=Ee?gH(Ee):Zb(),we=await Pse(W,re,se,J);let{patch:he,state:ye}=we,qe={tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:sync:app:state"},content:[{tag:"sync",attrs:{},content:[{tag:"collection",attrs:{name:$,version:(ye.version-1).toString(),return_snapshot:"false"},content:[{tag:"patch",attrs:{},content:ne.SyncdPatch.encode(he).finish()}]}]}]};await f(qe),await I.keys.set({"app-state-sync-version":{[$]:ye}})},I?.creds?.me?.id||"app-patch")}),n.emitOwnEvents){let{onMutation:Ee}=ke(!1),{mutationMap:he}=await IH($,[{...we.patch,version:{version:we.state.version}}],se,J,n.options,void 0,t);for(let ye in he)Ee(he[ye])}},fr=async()=>{let W=await f({tag:"iq",attrs:{to:OA,xmlns:"abt",type:"get"},content:[{tag:"props",attrs:{protocol:"1",...I?.creds?.lastPropHash?{hash:I.creds.lastPropHash}:{}}}]}),$=le(W,"props"),re={};$&&($.attrs?.hash&&(I.creds.lastPropHash=$?.attrs?.hash,g.emit("creds.update",I.creds)),re=DL($,"prop"));let se=re[10518]??re.privacy_token_sending_on_all_1_on_1_messages;se!==void 0&&(L.privacyTokenOn1to1=se==="true"||se==="1");let we=re[9666]??re.profile_scraping_privacy_token_in_photo_iq;we!==void 0&&(L.profilePicPrivacyToken=we==="true"||we==="1");let Ee=re[14303]??re.lid_trusted_token_issue_to_lid;return Ee!==void 0&&(L.lidTrustedTokenIssueToLid=Ee==="true"||Ee==="1"),t.debug({serverProps:L},"fetched props"),re},UA=(W,$)=>{let re=Hse(W,$);return ht(re)},pe=W=>UA({disableLinkPreviews:{isPreviewsDisabled:W}},""),Qe=(W,$,re)=>UA({star:{messages:$,star:re}},W),Me=(W,$)=>UA({contact:$},W),oA=W=>UA({contact:null},W),pA=(W,$)=>UA({addLabel:{...$}},W),FA=(W,$)=>UA({addChatLabel:{labelId:$}},W),jt=(W,$)=>UA({removeChatLabel:{labelId:$}},W),ct=(W,$,re)=>UA({addMessageLabel:{messageId:$,labelId:re}},W),_r=(W,$,re)=>UA({removeMessageLabel:{messageId:$,labelId:re}},W),gr=W=>UA({quickReply:W},""),wo=W=>UA({quickReply:{timestamp:W,deleted:!0}},""),io=async()=>{await Promise.all([fr(),aA(),X()])},Ae=g.createBufferedFunction(async(W,$)=>{if(g.emit("messages.upsert",{messages:[W],type:$}),W.pushName){let Ee=W.key.fromMe?I.creds.me.id:W.key.participant||W.key.remoteJid;Ee=BA(Ee),W.key.fromMe||g.emit("contacts.update",[{id:Ee,notify:W.pushName,verifiedName:W.verifiedBizName}]),W.key.fromMe&&W.pushName&&I.creds.me?.name!==W.pushName&&g.emit("creds.update",{me:{...I.creds.me,name:W.pushName}})}let re=Wb(W.message),se=re?A(re)&&cQ.includes(re.syncType):!1;if(re&&se){let Ee=re.syncType;Ee===ne.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP&&!V.initialBootstrapComplete&&(V.initialBootstrapComplete=!0,g.emit("messaging-history.status",{syncType:Ee,status:"complete",explicit:!0})),Ee===ne.HistorySync.HistorySyncType.RECENT&&re.progress===100&&!V.recentSyncComplete&&(V.recentSyncComplete=!0,clearTimeout(H),H=void 0,g.emit("messaging-history.status",{syncType:Ee,status:"complete",explicit:!0})),Ee===ne.HistorySync.HistorySyncType.RECENT&&!V.recentSyncComplete&&(clearTimeout(H),H=setTimeout(()=>{V.recentSyncComplete||(V.recentSyncComplete=!0,g.emit("messaging-history.status",{syncType:ne.HistorySync.HistorySyncType.RECENT,status:"paused",explicit:!1})),H=void 0},MIe))}re&&U===Ei.AwaitingInitialSync&&(G&&(clearTimeout(G),G=void 0),se?(U=Ei.Syncing,t.info("Transitioned to Syncing state")):(U=Ei.Online,t.info("History sync skipped, transitioning to Online state and flushing buffer"),g.flush()));let we=async()=>{if(U===Ei.Syncing){N.clear(),t.info("Doing app state sync"),await Ue(g$,!0),U=Ei.Online,t.info("App state sync complete, transitioning to Online state and flushing buffer"),g.flush();let Ee=(I.creds.accountSyncCounter||0)+1;g.emit("creds.update",{accountSyncCounter:Ee})}};await Promise.all([(async()=>{se&&await we()})(),age(W,{signalRepository:Q,shouldProcessHistoryMsg:se,placeholderResendCache:k,ev:g,creds:I.creds,keyStore:I.keys,logger:t,options:n.options,getMessage:r})]),W.message?.protocolMessage?.appStateSyncKeyShare&&U===Ei.Syncing&&(t.info("App state sync key arrived, triggering app state sync"),await we())});return c.on("CB:presence",wA),c.on("CB:chatstate",wA),c.on("CB:ib,,dirty",async W=>{let{attrs:$}=le(W,"dirty");switch($.type){case"account_sync":if($.timestamp){let{lastAccountSyncTimestamp:se}=I.creds;se&&await Ce("account_sync",se),se=+$.timestamp,g.emit("creds.update",{lastAccountSyncTimestamp:se})}break;case"groups":break;default:t.info({node:W},"received unknown sync");break}}),g.on("connection.update",({connection:W,receivedPendingNotifications:$})=>{if(W==="close"&&(N.clear(),clearTimeout(H),H=void 0),W==="open"&&(a&&io().catch(se=>y(se,"init queries")),_A(o?"available":"unavailable").catch(se=>y(se,"presence update requests"))),!$||U!==Ei.Connecting)return;if(V.initialBootstrapComplete=!1,V.recentSyncComplete=!1,clearTimeout(H),H=void 0,U=Ei.AwaitingInitialSync,t.info("Connection is now AwaitingInitialSync, buffering events"),g.buffer(),!A(ne.Message.HistorySyncNotification.create({syncType:ne.HistorySync.HistorySyncType.RECENT}))){t.info("History sync is disabled by config, not waiting for notification. Transitioning to Online."),U=Ei.Online,setTimeout(()=>g.flush(),0);return}if(I.creds.accountSyncCounter>0){t.info("Reconnection with existing sync data, skipping history sync wait. Transitioning to Online."),U=Ei.Online,setTimeout(()=>g.flush(),0);return}t.info("First connection, awaiting history sync notification with a 20s timeout."),G&&clearTimeout(G),G=setTimeout(()=>{if(U===Ei.AwaitingInitialSync){t.warn("Timeout in AwaitingInitialSync, forcing state to Online and flushing buffer"),U=Ei.Online,g.flush();let se=(I.creds.accountSyncCounter||0)+1;g.emit("creds.update",{accountSyncCounter:se})}},2e4)}),g.on("creds.update",({myAppStateKeyId:W})=>{if(!W||N.size===0)return;if(U===Ei.Syncing){N.clear();return}let $=[...N];N.clear(),t.info({collections:$},"app state sync key arrived, re-syncing blocked collections"),Ue($,!1).catch(re=>y(re,"blocked collections resync"))}),g.on("lid-mapping.update",async({lid:W,pn:$})=>{try{await Q.lidMapping.storeLIDPNMappings([{lid:W,pn:$}])}catch(re){t.warn({lid:W,pn:$,error:re},"Failed to store LID-PN mapping")}}),T(()=>{G&&(clearTimeout(G),G=void 0),!n.placeholderResendCache&&k.close&&k.close(),U=Ei.Connecting,R=void 0}),{...s,serverProps:L,createCallLink:Ke,getBotListV2:fe,messageMutex:F,receiptMutex:q,appStatePatchMutex:z,notificationMutex:K,fetchPrivacySettings:X,upsertMessage:Ae,appPatch:ht,sendPresenceUpdate:_A,presenceSubscribe:ot,profilePictureUrl:MA,fetchBlocklist:aA,fetchStatus:Ie,fetchDisappearingDuration:Xe,updateProfilePicture:je,removeProfilePicture:be,updateProfileStatus:uA,updateProfileName:EA,updateBlockStatus:Ze,updateDisableLinkPreviewsPrivacy:pe,updateCallPrivacy:oe,updateMessagesPrivacy:De,updateLastSeenPrivacy:Se,updateOnlinePrivacy:Be,updateProfilePicturePrivacy:Re,updateStatusPrivacy:Ne,updateReadReceiptsPrivacy:Je,updateGroupsAddPrivacy:ve,updateDefaultDisappearingMode:tA,getBusinessProfile:bA,resyncAppState:Ue,chatModify:UA,cleanDirtyBits:Ce,addOrEditContact:Me,removeContact:oA,placeholderResendCache:k,addLabel:pA,addChatLabel:FA,removeChatLabel:jt,addMessageLabel:ct,removeMessageLabel:_r,star:Qe,addOrEditQuickReply:gr,removeQuickReply:wo}};var WIe=n=>{let t=VIe(n),{authState:o,ev:a,query:e,upsertMessage:i}=t,A=async(g,c,I)=>e({tag:"iq",attrs:{type:c,xmlns:"w:g2",to:g},content:I}),r=async g=>{let c=await A(g,"get",[{tag:"query",attrs:{request:"interactive"}}]);return xE(c)},s=async()=>{let g=await e({tag:"iq",attrs:{to:"@g.us",xmlns:"w:g2",type:"get"},content:[{tag:"participating",attrs:{},content:[{tag:"participants",attrs:{}},{tag:"description",attrs:{}}]}]}),c={},I=le(g,"groups");if(I){let p=PA(I,"group");for(let B of p){let f=xE({tag:"result",attrs:{},content:[B]});c[f.id]=f}}return t.ev.emit("groups.update",Object.values(c)),c};return t.ws.on("CB:ib,,dirty",async g=>{let{attrs:c}=le(g,"dirty");c.type==="groups"&&(await s(),await t.cleanDirtyBits("groups"))}),{...t,groupMetadata:r,groupCreate:async(g,c)=>{let I=Vr(),p=await A("@g.us","set",[{tag:"create",attrs:{subject:g,key:I},content:c.map(B=>({tag:"participant",attrs:{jid:B}}))}]);return xE(p)},groupLeave:async g=>{await A("@g.us","set",[{tag:"leave",attrs:{},content:[{tag:"group",attrs:{id:g}}]}])},groupUpdateSubject:async(g,c)=>{await A(g,"set",[{tag:"subject",attrs:{},content:Buffer.from(c,"utf-8")}])},groupRequestParticipantsList:async g=>{let c=await A(g,"get",[{tag:"membership_approval_requests",attrs:{}}]),I=le(c,"membership_approval_requests");return PA(I,"membership_approval_request").map(B=>B.attrs)},groupRequestParticipantsUpdate:async(g,c,I)=>{let p=await A(g,"set",[{tag:"membership_requests_action",attrs:{},content:[{tag:I,attrs:{},content:c.map(y=>({tag:"participant",attrs:{jid:y}}))}]}]),B=le(p,"membership_requests_action"),f=le(B,I);return PA(f,"participant").map(y=>({status:y.attrs.error||"200",jid:y.attrs.jid}))},groupParticipantsUpdate:async(g,c,I)=>{let p=await A(g,"set",[{tag:I,attrs:{},content:c.map(Q=>({tag:"participant",attrs:{jid:Q}}))}]),B=le(p,I);return PA(B,"participant").map(Q=>({status:Q.attrs.error||"200",jid:Q.attrs.jid,content:Q}))},groupUpdateDescription:async(g,c)=>{let p=(await r(g)).descId??null;await A(g,"set",[{tag:"description",attrs:{...c?{id:Vr()}:{delete:"true"},...p?{prev:p}:{}},content:c?[{tag:"body",attrs:{},content:Buffer.from(c,"utf-8")}]:void 0}])},groupInviteCode:async g=>{let c=await A(g,"get",[{tag:"invite",attrs:{}}]);return le(c,"invite")?.attrs.code},groupRevokeInvite:async g=>{let c=await A(g,"set",[{tag:"invite",attrs:{}}]);return le(c,"invite")?.attrs.code},groupAcceptInvite:async g=>{let c=await A("@g.us","set",[{tag:"invite",attrs:{code:g}}]);return le(c,"group")?.attrs.jid},groupRevokeInviteV4:async(g,c)=>!!await A(g,"set",[{tag:"revoke",attrs:{},content:[{tag:"participant",attrs:{jid:c}}]}]),groupAcceptInviteV4:a.createBufferedFunction(async(g,c)=>{g=typeof g=="string"?{remoteJid:g}:g;let I=await A(c.groupJid,"set",[{tag:"accept",attrs:{code:c.inviteCode,expiration:c.inviteExpiration.toString(),admin:g.remoteJid}}]);return g.id&&(c=ne.Message.GroupInviteMessage.fromObject(c),c.inviteExpiration=0,c.inviteCode="",a.emit("messages.update",[{key:g,update:{message:{groupInviteMessage:c}}}])),await i({key:{remoteJid:c.groupJid,id:Vr(t.user?.id),fromMe:!1,participant:g.remoteJid},messageStubType:RA.GROUP_PARTICIPANT_ADD,messageStubParameters:[JSON.stringify(o.creds.me)],participant:g.remoteJid,messageTimestamp:vi()},"notify"),I.attrs.from}),groupGetInviteInfo:async g=>{let c=await A("@g.us","get",[{tag:"invite",attrs:{code:g}}]);return xE(c)},groupToggleEphemeral:async(g,c)=>{let I=c?{tag:"ephemeral",attrs:{expiration:c.toString()}}:{tag:"not_ephemeral",attrs:{}};await A(g,"set",[I])},groupSettingUpdate:async(g,c)=>{await A(g,"set",[{tag:c,attrs:{}}])},groupMemberAddMode:async(g,c)=>{await A(g,"set",[{tag:"member_add_mode",attrs:{},content:c}])},groupJoinApprovalMode:async(g,c)=>{await A(g,"set",[{tag:"membership_approval_mode",attrs:{},content:[{tag:"group_join",attrs:{state:c}}]}])},groupFetchAllParticipating:s}},xE=n=>{let t=le(n,"group");if(!t){let B=le(n,"error");if(B){let f=B.attrs.code?+B.attrs.code:500,Q=B.attrs.text||"group metadata query failed";throw new YM.Boom(Q,{statusCode:f,data:B})}throw new YM.Boom("Invalid group metadata response: missing node",{data:n})}if(!t.attrs.id)throw new YM.Boom("Invalid group metadata response: missing group id",{data:t});let o=le(t,"description"),a,e,i,A,r,s;o&&(a=jA(o,"body"),i=o.attrs.participant?BA(o.attrs.participant):void 0,A=o.attrs.participant_pn?BA(o.attrs.participant_pn):void 0,r=o.attrs.participant_username||void 0,s=+o.attrs.t,e=o.attrs.id);let g=t.attrs.id.includes("@")?t.attrs.id:Dr(t.attrs.id,"g.us"),c=le(t,"ephemeral")?.attrs.expiration,I=jA(t,"member_add_mode")==="all_member_add";return{id:g,notify:t.attrs.notify,addressingMode:t.attrs.addressing_mode==="lid"?LB.LID:LB.PN,subject:t.attrs.subject,subjectOwner:t.attrs.s_o,subjectOwnerPn:t.attrs.s_o_pn,subjectOwnerUsername:t.attrs.s_o_username,subjectTime:+t.attrs.s_t,size:t.attrs.size?+t.attrs.size:PA(t,"participant").length,creation:+t.attrs.creation,owner:t.attrs.creator?BA(t.attrs.creator):void 0,ownerPn:t.attrs.creator_pn?BA(t.attrs.creator_pn):void 0,ownerUsername:t.attrs.creator_username||void 0,owner_country_code:t.attrs.creator_country_code,desc:a,descId:e,descOwner:i,descOwnerPn:A,descOwnerUsername:r,descTime:s,linkedParent:le(t,"linked_parent")?.attrs.jid||void 0,restrict:!!le(t,"locked"),announce:!!le(t,"announcement"),isCommunity:!!le(t,"parent"),isCommunityAnnounce:!!le(t,"default_sub_group"),joinApprovalMode:!!le(t,"membership_approval_mode"),memberAddMode:I,participants:PA(t,"participant").map(({attrs:B})=>({id:B.jid,phoneNumber:qA(B.jid)&&Rt(B.phone_number)?B.phone_number:void 0,lid:Rt(B.jid)&&qA(B.lid)?B.lid:void 0,username:B.participant_username||B.username||void 0,admin:B.type||null})),ephemeralDuration:c?+c:void 0}};var YE=ze(Jr(),1);var RXe=n=>{let{id:t,thread_metadata:o,viewer_metadata:a}=n;return{id:t,owner:void 0,name:o.name.text,creation_time:parseInt(o.creation_time,10),description:o.description.text,invite:o.invite,subscribers:parseInt(o.subscribers_count,10),verification:o.verification,picture:{id:o.picture.id,directPath:o.picture.direct_path},mute_state:a.mute}},kXe=n=>typeof n!="object"||n===null?null:"id"in n&&typeof n.id=="string"?n:"result"in n&&typeof n.result=="object"&&n.result!==null&&"id"in n.result?n.result:null,ZIe=n=>{let t=WIe(n),{query:o,generateMessageTag:a}=t,e=(A,r,s)=>pQ(A,r,s,o,a),i=async(A,r)=>{let s={newsletter_id:A,updates:{...r,settings:null}};return e(s,ui.UPDATE_METADATA,"xwa2_newsletter_update")};return{...t,newsletterCreate:async(A,r)=>{let g=await e({input:{name:A,description:r??null}},ui.CREATE,Ri.xwa2_newsletter_create);return RXe(g)},newsletterUpdate:i,newsletterSubscribers:async A=>e({newsletter_id:A},ui.SUBSCRIBERS,Ri.xwa2_newsletter_subscribers),newsletterMetadata:async(A,r)=>{let s={fetch_creation_time:!0,fetch_full_image:!0,fetch_viewer_metadata:!0,input:{key:r,type:A.toUpperCase()}},g=await e(s,ui.METADATA,Ri.xwa2_newsletter_metadata);return kXe(g)},newsletterFollow:A=>e({newsletter_id:A},ui.FOLLOW,Ri.xwa2_newsletter_join_v2),newsletterUnfollow:A=>e({newsletter_id:A},ui.UNFOLLOW,Ri.xwa2_newsletter_leave_v2),newsletterMute:A=>e({newsletter_id:A},ui.MUTE,Ri.xwa2_newsletter_mute_v2),newsletterUnmute:A=>e({newsletter_id:A},ui.UNMUTE,Ri.xwa2_newsletter_unmute_v2),newsletterUpdateName:async(A,r)=>await i(A,{name:r}),newsletterUpdateDescription:async(A,r)=>await i(A,{description:r}),newsletterUpdatePicture:async(A,r)=>{let{img:s}=await jb(r);return await i(A,{picture:s.toString("base64")})},newsletterRemovePicture:async A=>await i(A,{picture:""}),newsletterReactMessage:async(A,r,s)=>{await o({tag:"message",attrs:{to:A,...s?{}:{edit:"7"},type:"reaction",server_id:r,id:a()},content:[{tag:"reaction",attrs:s?{code:s}:{}}]})},newsletterFetchMessages:async(A,r,s,g)=>{let c={count:r.toString()};return typeof s=="number"&&(c.since=s.toString()),g&&(c.after=g.toString()),await o({tag:"iq",attrs:{id:a(),type:"get",xmlns:"newsletter",to:A},content:[{tag:"message_updates",attrs:c}]})},subscribeNewsletterUpdates:async A=>{let r=await o({tag:"iq",attrs:{id:a(),type:"set",xmlns:"newsletter",to:A},content:[{tag:"live_updates",attrs:{},content:[]}]}),g=le(r,"live_updates")?.attrs?.duration;return g?{duration:g}:null},newsletterAdminCount:async A=>(await e({newsletter_id:A},ui.ADMIN_COUNT,Ri.xwa2_newsletter_admin_count)).admin_count,newsletterChangeOwner:async(A,r)=>{await e({newsletter_id:A,user_id:r},ui.CHANGE_OWNER,Ri.xwa2_newsletter_change_owner)},newsletterDemote:async(A,r)=>{await e({newsletter_id:A,user_id:r},ui.DEMOTE,Ri.xwa2_newsletter_demote)},newsletterDelete:async A=>{await e({newsletter_id:A},ui.DELETE,Ri.xwa2_newsletter_delete_v2)}}};var XIe=n=>{let{logger:t,linkPreviewImageThumbnailWidth:o,generateHighQualityLinkPreview:a,options:e,patchMessageBeforeSending:i,cachedGroupMetadata:A,enableRecentMessageCache:r,maxMsgRetryCount:s}=n,g=ZIe(n),{ev:c,authState:I,messageMutex:p,signalRepository:B,upsertMessage:f,query:Q,fetchPrivacySettings:y,sendNode:m,groupMetadata:T,groupToggleEphemeral:_,registerSocketEndHandler:R}=g,L=B.lidMapping.getLIDForPN.bind(B.lidMapping),U=new Set,F=n.userDevicesCache||new sc({stdTTL:NI.USER_DEVICES,useClones:!1}),q=pc(),z=r?new aM(t,s):null,K=JIe(),G,V=qU,H=async(fe=!1)=>{let Ie=await G;return(!Ie||fe||new Date().getTime()-Ie.fetchDate.getTime()>Ie.ttl*1e3)&&(G=(async()=>{let Xe=await Q({tag:"iq",attrs:{type:"set",xmlns:"w:m",to:OA},content:[{tag:"media_conn",attrs:{}}]}),je=le(Xe,"media_conn"),be={hosts:PA(je,"host").map(({attrs:uA})=>({hostname:uA.hostname,maxContentLengthBytes:+uA.maxContentLengthBytes})),auth:je.attrs.auth,ttl:+je.attrs.ttl,fetchDate:new Date};return t.debug("fetched media conn"),be.hosts[0]&&(V=be.hosts[0].hostname),be})()),G},N=async(fe,Ie,Xe,je)=>{if(!Xe||Xe.length===0)throw new YE.Boom("missing ids in receipt");let be={tag:"receipt",attrs:{id:Xe[0]}};(je==="read"||je==="read-self")&&(be.attrs.t=vi().toString()),je==="sender"&&(Rt(fe)||qA(fe))?(be.attrs.recipient=fe,be.attrs.to=Ie):(be.attrs.to=fe,Ie&&(be.attrs.participant=Ie)),je&&(be.attrs.type=je);let EA=Xe.slice(1);EA.length&&(be.content=[{tag:"list",attrs:{},content:EA.map(aA=>({tag:"item",attrs:{id:aA}}))}]),t.debug({attrs:be.attrs,messageIds:Xe},"sending receipt for messages"),await m(be)},k=async(fe,Ie)=>{let Xe=ise(fe);for(let{jid:je,participant:be,messageIds:uA}of Xe)await N(je,be,uA,Ie)},J=async fe=>{let Xe=(await y()).readreceipts==="all"?"read":"read-self";await k(fe,Xe)},X=async(fe,Ie,Xe)=>{let je=[];Ie||t.debug("not using cache for devices");let be=[],uA=fe.map(Ce=>{let ke=hA(Ce),Ue=ke?.user,MA=ke?.device;return typeof MA=="number"&&MA>=0&&Ue?(je.push({user:Ue,device:MA,jid:Ce}),null):(Ce=BA(Ce),{jid:Ce,user:Ue})}).filter(Ce=>Ce!==null),EA;if(Ie&&F.mget){let Ce=uA.map(ke=>ke?.user).filter(Boolean);EA=await F.mget(Ce)}for(let{jid:Ce,user:ke}of uA)if(Ie){let Ue=EA?.[ke]||(F.mget?void 0:await F.get(ke));if(Ue){let MA=Ue.map(Ke=>({...Ke,jid:Dr(Ke.user,Ke.server,Ke.device)}));je.push(...MA),t.trace({user:ke},"using cache for devices")}else be.push(Ce)}else be.push(Ce);if(!be.length)return je;let aA=new Set;for(let Ce of be)if(qA(Ce)||Ci(Ce)){let ke=hA(Ce)?.user;ke&&aA.add(ke)}let Ze=new cg().withContext("message").withDeviceProtocol().withLIDProtocol();for(let Ce of be)Ze.withUser(new gg().withId(Ce));let bA=await g.executeUSyncQuery(Ze);if(bA){let Ce=bA.list.filter(Ke=>!!Ke.lid);if(Ce.length>0){t.trace("Storing LID maps from device call"),await B.lidMapping.storeLIDPNMappings(Ce.map(Ke=>({lid:Ke.lid,pn:Ke.id})));try{let Ke=Ce.map(_A=>_A.lid);Ke.length&&await De(Ke,!0)}catch(Ke){t.warn({e:Ke,count:Ce.length},"failed to assert sessions for newly mapped LIDs")}}let ke=pse(bA?.list,I.creds.me.id,I.creds.me.lid,Xe),Ue={};for(let Ke of ke)Ue[Ke.user]=Ue[Ke.user]||[],Ue[Ke.user]?.push(Ke);for(let[Ke,_A]of Object.entries(Ue)){let ot=aA.has(Ke);for(let wA of _A){let ht=ot?Dr(Ke,wA.server,wA.device):Dr(wA.user,wA.server,wA.device);je.push({...wA,jid:ht}),t.debug({user:wA.user,device:wA.device,finalJid:ht,usedLid:ot},"Processed device with LID priority")}}await q.mutex(async()=>{if(F.mset)await F.mset(Object.entries(Ue).map(([Ke,_A])=>({key:Ke,value:_A})));else for(let Ke in Ue)Ue[Ke]&&await F.set(Ke,Ue[Ke])});let MA={};for(let[Ke,_A]of Object.entries(Ue))_A&&_A.length>0&&(MA[Ke]=_A.map(ot=>ot.device?.toString()||"0"));if(Object.keys(MA).length>0)try{await I.keys.set({"device-list":MA}),t.debug({userCount:Object.keys(MA).length},"stored user device lists for bulk migration")}catch(Ke){t.warn({error:Ke},"failed to store user device lists")}}return je},ie=(fe,Ie)=>Be(fe,{protocolMessage:{type:ne.Message.ProtocolMessage.Type.GROUP_MEMBER_LABEL_CHANGE,memberLabel:{label:Ie?.slice(0,30),labelTimestamp:vi()}}},{additionalNodes:[{tag:"meta",attrs:{tag_reason:"user_update",appdata:"member_tag"},content:void 0}]}),De=async(fe,Ie)=>{let Xe=!1,je=[...new Set(fe)],be=[];t.debug({jids:fe},"assertSessions call with jids");for(let uA of je)!Ie&&(await B.validateSession(uA)).exists||be.push(uA);if(be.length){let uA=[...be.filter(aA=>!!qA(aA)||!!Ci(aA)),...(await B.lidMapping.getLIDsForPNs(be.filter(aA=>!!Rt(aA)||!!Or(aA)))||[]).map(aA=>aA.lid)];t.debug({jidsRequiringFetch:be,wireJids:uA},"fetching sessions");let EA=await Q({tag:"iq",attrs:{xmlns:"encrypt",type:"get",to:OA},content:[{tag:"key",attrs:{},content:uA.map(aA=>{let Ze={jid:aA};return Ie&&(Ze.reason="identity"),{tag:"user",attrs:Ze}})}]});await lse(EA,B),Xe=!0}return Xe},oe=async fe=>{if(!I.creds.me?.id)throw new YE.Boom("Not authenticated");let Ie={protocolMessage:{peerDataOperationRequestMessage:fe,type:ne.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_MESSAGE}},Xe=BA(I.creds.me.id);return await Be(Xe,Ie,{additionalAttributes:{category:"peer",push_priority:"high_force"},additionalNodes:[{tag:"meta",attrs:{appdata:"default"}}]})},Se=async(fe,Ie,Xe,je)=>{if(!fe.length)return{nodes:[],shouldIncludeDeviceIdentity:!1};let be=await i(Ie,fe),uA=Array.isArray(be)?be:fe.map(Ue=>({recipientJid:Ue,message:be})),EA=!1,aA=I.creds.me.id,Ze=I.creds.me?.lid,bA=Ze?hA(Ze)?.user:null,Ce=uA.map(async({recipientJid:Ue,message:MA})=>{try{if(!Ue)return null;let Ke=MA;if(je){let{user:ht}=hA(Ue),{user:fr}=hA(aA),UA=bA;(ht===fr||UA&&ht===UA)&&!(Ue===aA||Ze&&Ue===Ze)&&(Ke=je,t.debug({jid:Ue,targetUser:ht},"Using DSM for own device"))}let _A=Ph(Ke),ot=Ue;return await K.mutex(ot,async()=>{let{type:ht,ciphertext:fr}=await B.encryptMessage({jid:Ue,data:_A});return ht==="pkmsg"&&(EA=!0),{tag:"to",attrs:{jid:Ue},content:[{tag:"enc",attrs:{v:"2",type:ht,...Xe||{}},content:fr}]}})}catch(Ke){return t.error({jid:Ue,err:Ke},"Failed to encrypt for recipient"),null}}),ke=(await Promise.all(Ce)).filter(Ue=>Ue!==null);if(fe.length>0&&ke.length===0)throw new YE.Boom("All encryptions failed",{statusCode:500});return{nodes:ke,shouldIncludeDeviceIdentity:EA}},Be=async(fe,Ie,{messageId:Xe,participant:je,additionalAttributes:be,additionalNodes:uA,useUserDevicesCache:EA,useCachedGroupMetadata:aA,statusJidList:Ze})=>{let bA=Xse(I.creds),Ce=I.creds.me?.lid,ke=!!je?.jid,Ue=ke,MA="status@broadcast",{user:Ke,server:_A}=hA(fe),ot=_A==="g.us",wA=fe===MA,ht=_A==="lid",fr=_A==="newsletter",UA=ot||wA,pe=fe;Xe=Xe||Vr(bA),EA=EA!==!1,aA=aA!==!1&&!wA;let Qe=[],Me=wA?MA:pe,oA=[],pA=[],FA,jt={deviceSentMessage:{destinationJid:Me,message:Ie},messageContextInfo:Ie.messageContextInfo},ct={};if(je){!ot&&!wA&&(be={...be,device_fanout:"false"});let{user:_r,device:gr}=hA(je.jid);pA.push({user:_r,device:gr,jid:je.jid})}return await I.keys.transaction(async()=>{let _r=Ne(Ie);if(_r&&(ct.mediatype=_r),fr){let Ee=i?await i(Ie,[]):Ie,he=nee(Ee);oA.push({tag:"plaintext",attrs:{},content:he});let ye={tag:"message",attrs:{to:fe,id:Xe,type:Re(Ie),...be||{}},content:oA};t.debug({msgId:Xe},`sending newsletter message to ${fe}`),await m(ye);return}if((Si(Ie)?.pinInChatMessage||Si(Ie)?.reactionMessage)&&(ct["decrypt-fail"]="hide"),UA&&!ke){let[Ee,he]=await Promise.all([(async()=>{let rA=aA&&A?await A(fe):void 0;return rA&&Array.isArray(rA?.participants)?t.trace({jid:fe,participants:rA.participants.length},"using cached group metadata"):wA||(rA=await T(fe)),rA})(),(async()=>!je&&!wA?(await I.keys.get("sender-key-memory",[fe]))[fe]||{}:{})()]),ye=Ee?Ee.participants.map(rA=>rA.id):[];Ee?.ephemeralDuration&&Ee.ephemeralDuration>0&&(be={...be,expiration:Ee.ephemeralDuration.toString()}),wA&&Ze&&ye.push(...Ze);let qe=await X(ye,!!EA,!1);pA.push(...qe),ot&&(be={...be,addressing_mode:Ee?.addressingMode||"lid"});let IA=await i(Ie);if(Array.isArray(IA))throw new YE.Boom("Per-jid patching is not supported in groups");let yA=Ph(IA);FA=IA;let vA=(be?.addressing_mode||Ee?.addressingMode||"lid")==="lid"&&Ce?Ce:bA,{ciphertext:YA,senderKeyDistributionMessage:At}=await B.encryptGroupMessage({group:Me,data:yA,meId:vA}),Ge=[];for(let rA of pA){let tt=rA.jid;(!!!he[tt]||je)&&!Ci(tt)&&!Or(tt)&&rA.device!==99&&(Ge.push(tt),he[tt]=!0)}if(Ge.length){t.debug({senderKeyJids:Ge},"sending new sender key");let rA={senderKeyDistributionMessage:{axolotlSenderKeyDistributionMessage:At,groupId:Me}};await De(Ge);let Ai=await Se(Ge,rA,ct);Ue=Ue||Ai.shouldIncludeDeviceIdentity,Qe.push(...Ai.nodes)}oA.push({tag:"enc",attrs:{v:"2",type:"skmsg",...ct},content:YA}),await I.keys.set({"sender-key-memory":{[fe]:he}})}else{let Ee=bA;ht&&Ce?(Ee=Ce,t.debug({to:fe,ownId:Ee},"Using LID identity for @lid conversation")):t.debug({to:fe,ownId:Ee},"Using PN identity for @s.whatsapp.net conversation");let{user:he}=hA(Ee);if(!je){let rA=await i(Ie,[fe]);FA=Array.isArray(rA)?rA.find(tt=>tt.recipientJid===fe)||rA[0]:rA}if(!ke){let rA=ht?"lid":"s.whatsapp.net";if(pA.push({user:Ke,device:0,jid:Dr(Ke,rA,0)}),Ke!==he){let tt=ht?"lid":"s.whatsapp.net",Ai=ht&&Ce?hA(Ce).user:hA(bA).user;pA.push({user:Ai,device:0,jid:Dr(Ai,tt,0)})}if(be?.category!=="peer"){pA.length=0;let tt=ht&&Ce?Dr(hA(Ce)?.user,"lid",void 0):Dr(hA(bA)?.user,"s.whatsapp.net",void 0),Ai=await X([tt,fe],!0,!1);pA.push(...Ai),t.debug({deviceCount:pA.length,devices:pA.map(cr=>`${cr.user}:${cr.device}@${hA(cr.jid)?.server}`)},"Device enumeration complete with unified addressing")}}let ye=[],qe=[],IA=[],{user:yA}=hA(bA),{user:$A}=Ce?hA(Ce):{user:null};for(let{user:rA,jid:tt}of pA){if(tt===bA||Ce&&tt===Ce){t.debug({jid:tt,meId:bA,meLid:Ce},"Skipping exact sender device (whatsmeow pattern)");continue}rA===yA||rA===$A?qe.push(tt):IA.push(tt),ye.push(tt)}await De(ye);let[{nodes:vA,shouldIncludeDeviceIdentity:YA},{nodes:At,shouldIncludeDeviceIdentity:Ge}]=await Promise.all([Se(qe,jt||Ie,ct),Se(IA,Ie,ct,jt)]);Qe.push(...vA),Qe.push(...At),(qe.length>0||IA.length>0)&&(ct.phash=Z$([...qe,...IA])),Ue=Ue||YA||Ge}if(ke){let Ee=qA(je.jid),he=Dt(je.jid,Ee?Ce:bA),ye=Ie;if(UA){let $A;if(Ce&&await B.hasSenderKey({group:Me,meId:Ce})?$A=Ce:await B.hasSenderKey({group:Me,meId:bA})&&($A=bA),$A)try{let vA=await B.getSenderKeyDistributionMessage({group:Me,meId:$A});ye={...Ie,senderKeyDistributionMessage:{groupId:Me,axolotlSenderKeyDistributionMessage:vA}}}catch(vA){t.warn({err:vA,jid:Me},"failed to build SKDM for retry, sending without it")}}let qe=he?Ph({deviceSentMessage:{destinationJid:Me,message:ye}}):Ph(ye),{type:IA,ciphertext:yA}=await B.encryptMessage({data:qe,jid:je.jid});oA.push({tag:"enc",attrs:{v:"2",type:IA,count:je.count.toString()},content:yA})}if(Qe.length)if(be?.category==="peer"){let Ee=Qe[0]?.content?.[0];Ee&&oA.push(Ee)}else oA.push({tag:"participants",attrs:{},content:Qe});let gr={tag:"message",attrs:{id:Xe,to:Me,type:Re(Ie),...be||{}},content:oA};if(je?qr(Me)?(gr.attrs.to=Me,gr.attrs.participant=je.jid):Dt(je.jid,bA)?(gr.attrs.to=je.jid,gr.attrs.recipient=Me):gr.attrs.to=je.jid:gr.attrs.to=Me,Ue&&(gr.content.push({tag:"device-identity",attrs:{},content:Zf(I.creds.account,!0)}),t.debug({jid:fe},"adding device identity")),!fr&&!ke&&FA?.messageContextInfo?.messageSecret&&zb(FA))try{let Ee=Ph(FA),he={id:Xe,fromMe:!0,remoteJid:Me,participant:je?.jid},ye=await $ne(Ee,FA,he);ye&&(gr.content.push(ye),t.trace({jid:fe},"added reporting token to message"))}catch(Ee){t.warn({jid:fe,trace:Ee?.stack},"failed to attach reporting token")}let wo=be?.category==="peer",io=!ot&&!ke&&!wA&&!fr&&!wo,Ae=io?await ag(Me,L):Me,$=(io?await I.keys.get("tctoken",[Ae]):{})[Ae],re=$?.token;if(re?.length&&Bp($?.timestamp)){t.debug({jid:Me,timestamp:$?.timestamp},"tctoken expired, clearing"),re=void 0;let Ee=$?.senderTimestamp!==void 0?{token:Buffer.alloc(0),senderTimestamp:$.senderTimestamp}:null;try{await I.keys.set({tctoken:{[Ae]:Ee}})}catch(he){t.debug({jid:Me,err:he?.message},"failed to persist tctoken expiry cleanup")}}re?.length&&g.serverProps.privacyTokenOn1to1&&gr.content.push({tag:"tctoken",attrs:{},content:re}),uA&&uA.length>0&&gr.content.push(...uA),t.debug({msgId:Xe},`sending message to ${Qe.length} devices`),await m(gr);let se=!!Si(Ie)?.protocolMessage,we=Me===h$||u$(Me)||Mh(Me);if(io&&!se&&!we&&rge($?.senderTimestamp)&&!U.has(Ae)){U.add(Ae);let Ee=vi(),he=B.lidMapping.getPNForLID.bind(B.lidMapping);tQ(Me,g.serverProps.lidTrustedTokenIssueToLid,L,he).then(ye=>Je([ye],Ee)).then(async ye=>{await TE({result:ye,fallbackJid:Ae,keys:I.keys,getLIDForPN:L});let IA=(await I.keys.get("tctoken",[Ae]))[Ae],yA=await _E(I.keys,[Ae]);await I.keys.set({tctoken:{[Ae]:{token:Buffer.alloc(0),...IA,senderTimestamp:Ee},...yA}})}).catch(ye=>{t.debug({jid:Me,err:ye?.message},"fire-and-forget tctoken issuance failed")}).finally(()=>{U.delete(Ae)})}z&&!je&&z.addRecentMessage(Me,Xe,Ie)},bA),Xe},Re=fe=>{let Ie=Si(fe);return Ie?Ie.reactionMessage||Ie.encReactionMessage?"reaction":Ie.pollCreationMessage||Ie.pollCreationMessageV2||Ie.pollCreationMessageV3||Ie.pollUpdateMessage?"poll":Ie.eventMessage?"event":Ne(Ie)!==""?"media":"text":"text"},Ne=fe=>fe.imageMessage?"image":fe.videoMessage?fe.videoMessage.gifPlayback?"gif":"video":fe.audioMessage?fe.audioMessage.ptt?"ptt":"audio":fe.contactMessage?"vcard":fe.documentMessage?"document":fe.contactsArrayMessage?"contact_array":fe.liveLocationMessage?"livelocation":fe.stickerMessage?"sticker":fe.listMessage?"list":fe.listResponseMessage?"list_response":fe.buttonsResponseMessage?"buttons_response":fe.orderMessage?"order":fe.productMessage?"product":fe.interactiveResponseMessage?"native_flow_response":fe.groupInviteMessage?"url":"",Je=async(fe,Ie)=>{let Xe=(Ie??vi()).toString();return await Q({tag:"iq",attrs:{to:OA,type:"set",xmlns:"privacy"},content:[{tag:"tokens",attrs:{},content:fe.map(be=>({tag:"token",attrs:{jid:BA(be),t:Xe,type:"trusted_contact"}}))}]})},ve=Yne(n,H),tA=vL(c,"messages.media-update");return R(()=>{!n.userDevicesCache&&F.close&&F.close(),G=void 0,z&&z.clear()}),{...g,userDevicesCache:F,devicesMutex:q,issuePrivacyTokens:Je,assertSessions:De,relayMessage:Be,sendReceipt:N,sendReceipts:k,readMessages:J,refreshMediaConn:H,getMediaHost:()=>V,waUploadToServer:ve,fetchPrivacySettings:y,sendPeerDataOperationMessage:oe,createParticipantNodes:Se,getUSyncDevices:X,messageRetryManager:z,updateMemberLabel:ie,updateMediaMessage:async fe=>{let Ie=ase(fe.message),Xe=Ie.mediaKey,je=I.creds.me.id,be=Jne(fe.key,Xe,je),uA;if(await Promise.all([m(be),tA(async EA=>{let aA=EA.find(Ze=>Ze.key.id===fe.key.id);if(aA){if(aA.error)uA=aA.error;else try{let Ze=zne(aA.media,Xe,aA.key.id);if(Ze.result!==ne.MediaRetryNotification.ResultType.SUCCESS){let bA=ne.MediaRetryNotification.ResultType[Ze.result];throw new YE.Boom(`Media re-upload failed by device (${bA})`,{data:Ze,statusCode:zU(Ze.result)||404})}Ie.directPath=Ze.directPath,Ie.url=jf(Ie.directPath,V),t.debug({directPath:Ze.directPath,key:aA.key},"media update successful")}catch(Ze){uA=Ze}return!0}})]),uA)throw uA;return c.emit("messages.update",[{key:fe.key,update:{message:fe.message}}]),fe},sendMessage:async(fe,Ie,Xe={})=>{let je=I.creds.me.id;if(typeof Ie=="object"&&"disappearingMessagesInChat"in Ie&&typeof Ie.disappearingMessagesInChat<"u"&&qr(fe)){let{disappearingMessagesInChat:be}=Ie;await _(fe,typeof be=="boolean"?be?Vf:0:be)}else{let be=await tse(fe,Ie,{logger:t,userJid:je,getUrlInfo:Ue=>tge(Ue,{thumbnailWidth:o,fetchOpts:{timeout:3e3,...e||{}},logger:t,uploadImage:a?ve:void 0}),getProfilePicUrl:g.profilePictureUrl,getCallLink:g.createCallLink,upload:ve,mediaCache:n.mediaCache,options:n.options,messageId:Vr(g.user?.id),...Xe}),uA="event"in Ie&&!!Ie.event,EA="delete"in Ie&&!!Ie.delete,aA="edit"in Ie&&!!Ie.edit,Ze="pin"in Ie&&!!Ie.pin,bA="poll"in Ie&&!!Ie.poll,Ce={},ke=[];return EA?qr(Ie.delete?.remoteJid)&&!Ie.delete?.fromMe?Ce.edit="8":Ce.edit="7":aA?Ce.edit="1":Ze?Ce.edit="2":bA?ke.push({tag:"meta",attrs:{polltype:"creation"}}):uA&&ke.push({tag:"meta",attrs:{event_type:"creation"}}),await Be(fe,be.message,{messageId:be.key.id,useCachedGroupMetadata:Xe.useCachedGroupMetadata,additionalAttributes:Ce,statusJidList:Xe.statusJidList,additionalNodes:ke}),n.emitOwnEvents&&process.nextTick(async()=>{await p.mutex(()=>f(be,"append"))}),be}}}};var vXe=new Set(Object.values(iI));function PXe(n){return typeof n=="string"&&vXe.has(n)}var $Ie=n=>{let{logger:t,retryRequestDelayMs:o,maxMsgRetryCount:a,getMessage:e,shouldIgnoreJid:i,enableAutoSessionRecreation:A}=n,r=XIe(n),{userDevicesCache:s,devicesMutex:g,ev:c,authState:I,ws:p,messageMutex:B,notificationMutex:f,receiptMutex:Q,signalRepository:y,query:m,upsertMessage:T,resyncAppState:_,onUnexpectedError:R,assertSessions:L,sendNode:U,relayMessage:F,sendReceipt:q,uploadPreKeys:z,sendPeerDataOperationMessage:K,messageRetryManager:G,registerSocketEndHandler:V,issuePrivacyTokens:H,fetchAccountReachoutTimelock:N,placeholderResendCache:k}=r,J=y.lidMapping.getLIDForPN.bind(y.lidMapping),X=pc(),ie=n.msgRetryCounterCache||new sc({stdTTL:NI.MSG_RETRY,useClones:!1}),De=n.callOfferCache||new sc({stdTTL:NI.CALL_OFFER,useClones:!1}),oe=new sc({stdTTL:5,useClones:!1}),Se=!1,Be=async(Ae,W,$)=>{if(!I.creds.me?.id)throw new dQ.Boom("Not authenticated");let re={historySyncOnDemandRequest:{chatJid:W.remoteJid,oldestMsgFromMe:W.fromMe,oldestMsgId:W.id,oldestMsgTimestampMs:$,onDemandMsgCount:Ae},peerDataOperationRequestType:ne.Message.PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND};return K(re)},Re=async(Ae,W)=>{if(!I.creds.me?.id)throw new dQ.Boom("Not authenticated");if(await k.get(Ae?.id)){t.debug({messageKey:Ae},"already requested resend");return}else await k.set(Ae?.id,W||!0);if(await ZB(2e3),!await k.get(Ae?.id))return t.debug({messageKey:Ae},"message received while resend requested"),"RESOLVED";let $={placeholderMessageResendRequest:[{messageKey:Ae}],peerDataOperationRequestType:ne.Message.PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND};return setTimeout(async()=>{await k.get(Ae?.id)&&(t.debug({messageKey:Ae},"PDO message without response after 8 seconds. Phone possibly offline"),await k.del(Ae?.id))},8e3),K($)},Ne=async Ae=>{let W=le(Ae,"update");if(W){let $=W.attrs?.op_name;if(!$){t.warn({node:Jn(Ae)},"mex notification missing op_name, fallback to legacy"),await tA(Ae);return}let re;try{re=JSON.parse(W.content.toString())}catch(we){t.error({err:we,opName:$},"failed to parse mex notification JSON");return}if(re.errors?.length){t.warn({errors:re.errors,opName:$},"mex notification has GQL errors");return}let se=re.data;if(!se){t.warn({opName:$},"mex notification has null data");return}switch(t.debug({opName:$},"processing mex notification"),$){case"NotificationUserReachoutTimelockUpdate":Je(se);break;case"MessageCappingInfoNotification":ve(se);break;case"NotificationNewsletterUpdate":case"NotificationLinkedProfilesUpdates":case"NotificationNewsletterAdminPromote":case"NotificationNewsletterAdminDemote":case"NotificationNewsletterUserSettingChange":case"NotificationNewsletterJoin":case"NotificationNewsletterLeave":case"NotificationNewsletterStateChange":case"NotificationNewsletterAdminMetadataUpdate":case"NotificationNewsletterOwnerUpdate":case"NotificationNewsletterAdminInviteRevoke":case"NotificationNewsletterWamoSubStatusChange":case"NotificationNewsletterBlockUser":case"NotificationNewsletterPaidPartnership":case"NotificationNewsletterMilestone":case"NewsletterResponseStateUpdate":await tA(Ae);break;default:t.debug({opName:$},"unhandled mex notification");break}return}await tA(Ae)},Je=Ae=>{let W=Ae.xwa2_notify_account_reachout_timelock;if(!W){t.warn("reachout timelock notification missing payload");return}if(!W.is_active){t.info("reachout timelock restriction lifted"),c.emit("connection.update",{reachoutTimeLock:{isActive:!1,enforcementType:iI.DEFAULT}});return}let $=W.time_enforcement_ends?new Date(parseInt(W.time_enforcement_ends,10)*1e3):new Date(Date.now()+6e4),re=PXe(W.enforcement_type)?W.enforcement_type:iI.DEFAULT;t.info({enforcementType:re,timeEnforcementEnds:$},"reachout timelock restriction set"),c.emit("connection.update",{reachoutTimeLock:{isActive:!0,timeEnforcementEnds:$,enforcementType:re}})},ve=Ae=>{let W=Ae.xwa2_notify_new_chat_messages_capping_info_update;if(!W){t.warn("message capping notification missing payload");return}t.info({payload:W},"received message capping update"),c.emit("message-capping.update",W)},tA=async Ae=>{let W=le(Ae,"mex"),$=W?.content?null:le(Ae,"update")||Gs(Ae)[0],re=W?.content?W:$;if(!re?.content){t.warn({node:Jn(Ae)},"invalid mex newsletter notification");return}let se;try{let he=re.content;if(Array.isArray(he)){t.warn({payloadNode:re},"invalid mex newsletter notification payload format");return}let ye=typeof he=="string"?Buffer.from(he,"binary"):Buffer.from(he);se=JSON.parse(ye.toString())}catch(he){t.error({err:he,node:Jn(Ae)},"failed to parse mex newsletter notification");return}let we=se?.operation??re?.attrs?.op_name,Ee=se?.updates;if(!Ee){let he=se?.data?.xwa2_notify_linked_profiles;he&&(Ee=[he])}if(!Ee||!we){t.warn({data:se},"invalid mex newsletter notification content");return}switch(t.info({operation:we,updates:Ee},"got mex newsletter notification"),we){case"NotificationNewsletterUpdate":for(let he of Ee)he.jid&&he.settings&&Object.keys(he.settings).length>0&&c.emit("newsletter-settings.update",{id:he.jid,update:he.settings});break;case"NotificationNewsletterAdminPromote":for(let he of Ee)he.jid&&he.user&&c.emit("newsletter-participants.update",{id:he.jid,author:Ae.attrs.from,user:he.user,new_role:"ADMIN",action:"promote"});break;case"NotificationLinkedProfilesUpdates":for(let he of Ee){let ye=he?.jid,qe=Array.isArray(he?.added_profiles)?he.added_profiles:[],IA=[];for(let yA of qe){let $A=typeof yA=="string"?yA:yA?.pn??yA?.jid??null;if(ye&&$A){let vA={lid:ye,pn:$A};c.emit("lid-mapping.update",vA),IA.push(vA)}}await y.lidMapping.storeLIDPNMappings(IA)}break;default:t.info({operation:we,data:se},"unhandled mex newsletter notification");break}},fe=async Ae=>{let W=Ae.attrs.from,$=Gs(Ae),re=Ae.attrs.participant;for(let se of $)switch(t.debug({from:W,child:se},"got newsletter notification"),se.tag){case"reaction":{let we={id:W,server_id:se.attrs.message_id,reaction:{code:jA(se,"reaction"),count:1}};c.emit("newsletter.reaction",we);break}case"view":{let we={id:W,server_id:se.attrs.message_id,count:parseInt(se.content?.toString()||"0",10)};c.emit("newsletter.view",we);break}case"participant":{let we={id:W,author:re,user:se.attrs.jid,action:se.attrs.action,new_role:se.attrs.role};c.emit("newsletter-participants.update",we);break}case"update":{let we=le(se,"settings");if(we){let Ee={},he=le(we,"name");he?.content&&(Ee.name=he.content.toString());let ye=le(we,"description");ye?.content&&(Ee.description=ye.content.toString()),c.emit("newsletter-settings.update",{id:W,update:Ee})}break}case"message":{let we=le(se,"plaintext");if(we?.content)try{let Ee=typeof we.content=="string"?Buffer.from(we.content,"binary"):Buffer.from(we.content),he=ne.Message.decode(Ee).toJSON(),ye=ne.WebMessageInfo.fromObject({key:{remoteJid:W,id:se.attrs.message_id||se.attrs.server_id,fromMe:!1},message:he,messageTimestamp:+se.attrs.t}).toJSON();await T(ye,"append"),t.debug("Processed plaintext newsletter message")}catch(Ee){t.error({error:Ee},"Failed to decode plaintext newsletter message")}break}default:t.warn({node:Ae,child:se},"Unknown newsletter notification child");break}},Ie=async(Ae,W)=>{let $=Ige(Ae,W,I.creds.me.id);t.debug({recv:{tag:Ae.tag,attrs:Ae.attrs},sent:$.attrs},"sent ack"),await U($)},Xe=async(Ae,W)=>{let $={tag:"call",attrs:{from:I.creds.me.id,to:W},content:[{tag:"reject",attrs:{"call-id":Ae,"call-creator":W,count:"0"},content:void 0}]};await m($)},je=async(Ae,W=!1)=>{let{fullMessage:$}=GL(Ae,I.creds.me.id,I.creds.me.lid||""),{key:re}=$,se=re.id;if(G){if(G.hasExceededMaxRetries(se)){t.debug({msgId:se},"reached retry limit with new retry manager, clearing"),G.markRetryFailed(se);return}let YA=G.incrementRetryCount(se),At=`${se}:${re?.participant}`;await ie.set(At,YA)}else{let YA=`${se}:${re?.participant}`,At=await ie.get(YA)||0;if(At>=a){t.debug({retryCount:At,msgId:se},"reached retry limit, clearing"),await ie.del(YA);return}At+=1,await ie.set(YA,At)}let we=`${se}:${re?.participant}`,Ee=await ie.get(we)||1,{account:he,signedPreKey:ye,signedIdentityKey:qe}=I.creds,IA=Ae.attrs.from,yA=!1,$A="";if(A&&G&&Ee>1)try{let YA=y.jidToSignalProtocolAddress(IA),At=await y.validateSession(IA),Ge=G.shouldRecreateSession(IA,At.exists);yA=Ge.recreate,$A=Ge.reason,yA&&(t.debug({fromJid:IA,retryCount:Ee,reason:$A},"recreating session for retry"),await I.keys.set({session:{[YA]:null}}),W=!0)}catch(YA){t.warn({error:YA,fromJid:IA},"failed to check session recreation")}if(Ee<=2)if(G)G.schedulePhoneRequest(se,async()=>{try{let YA=await Re(re);t.debug(`sendRetryRequest: requested placeholder resend (${YA}) for message ${se} (scheduled)`)}catch(YA){t.warn({error:YA,msgId:se},"failed to send scheduled phone request")}});else{let YA=await Re(re);t.debug(`sendRetryRequest: requested placeholder resend for message ${YA}`)}let vA=Zf(he,!0);await I.keys.transaction(async()=>{let YA={tag:"receipt",attrs:{id:se,type:"retry",to:Ae.attrs.from},content:[{tag:"retry",attrs:{count:Ee.toString(),id:Ae.attrs.id,t:Ae.attrs.t,v:"1",error:"0"}},{tag:"registration",attrs:{},content:Zg(I.creds.registrationId)}]};if(Ae.attrs.recipient&&(YA.attrs.recipient=Ae.attrs.recipient),Ae.attrs.participant&&(YA.attrs.participant=Ae.attrs.participant),Ee>1||W||yA){let{update:At,preKeys:Ge}=await iH(I,1),[rA]=Object.keys(Ge),tt=Ge[+rA];YA.content.push({tag:"keys",attrs:{},content:[{tag:"type",attrs:{},content:Buffer.from(Wg)},{tag:"identity",attrs:{},content:qe.public},rH(tt,+rA),Wf(ye),{tag:"device-identity",attrs:{},content:vA}]}),c.emit("creds.update",At)}await U(YA),t.info({msgAttrs:Ae.attrs,retryCount:Ee},"sent retry receipt")},I?.creds?.me?.id||"sendRetryRequest")},be=new Set,uA=Ae=>{(async()=>{let W=BA(Ae),$=await ag(W,J),se=(await I.keys.get("tctoken",[$]))?.[$]?.senderTimestamp;if(se==null||Bp(se))return;t.debug({jid:W,senderTimestamp:se},"identity changed, re-issuing tctoken");let we=y.lidMapping.getPNForLID.bind(y.lidMapping),Ee=await tQ(W,r.serverProps.lidTrustedTokenIssueToLid,J,we),he=await H([Ee],se);await TE({result:he,fallbackJid:$,keys:I.keys,getLIDForPN:J,onNewJidStored:_A})})().catch(W=>{t.debug({jid:Ae,err:W?.message},"failed to re-issue tctoken after identity change")})},EA=async Ae=>{if(Ae.attrs.from===OA){let $=Ae.attrs.id;if($&&be.has($))return;let se=+le(Ae,"count").attrs.value,we=se{let re=Ae.attrs.participant,se=Ae.attrs.participant_pn,we=Ae.attrs.participant_username,Ee=le(W,"participant")?.attrs?.jid||re,he=le(W,"participant")?.attrs?.phone_number||se;switch(W?.tag){case"create":let ye=xE(W);$.messageStubType=RA.GROUP_CREATE,$.messageStubParameters=[ye.subject],$.key={participant:ye.owner,participantAlt:ye.ownerPn},c.emit("chats.upsert",[{id:ye.id,name:ye.subject,conversationTimestamp:ye.creation}]),c.emit("groups.upsert",[{...ye,author:re,authorPn:se,authorUsername:we}]);break;case"ephemeral":case"not_ephemeral":$.message={protocolMessage:{type:ne.Message.ProtocolMessage.Type.EPHEMERAL_SETTING,ephemeralExpiration:+(W.attrs.expiration||0)}};break;case"modify":let qe=PA(W,"participant").map(Ge=>Ge.attrs.jid);$.messageStubParameters=qe||[],$.messageStubType=RA.GROUP_PARTICIPANT_CHANGE_NUMBER;break;case"promote":case"demote":case"remove":case"add":case"leave":let IA=`GROUP_PARTICIPANT_${W.tag.toUpperCase()}`;$.messageStubType=RA[IA];let yA=PA(W,"participant").map(({attrs:Ge})=>({id:Ge.jid,phoneNumber:qA(Ge.jid)&&Rt(Ge.phone_number)?Ge.phone_number:void 0,lid:Rt(Ge.jid)&&qA(Ge.lid)?Ge.lid:void 0,username:Ge.participant_username||Ge.username||void 0,admin:Ge.type||null}));yA.length===1&&(Dt(yA[0].id,re)||Dt(yA[0].id,se))&&W.tag==="remove"&&($.messageStubType=RA.GROUP_PARTICIPANT_LEAVE),$.messageStubParameters=yA.map(Ge=>JSON.stringify(Ge));break;case"subject":$.messageStubType=RA.GROUP_CHANGE_SUBJECT,$.messageStubParameters=[W.attrs.subject];break;case"description":let $A=le(W,"body")?.content?.toString();$.messageStubType=RA.GROUP_CHANGE_DESCRIPTION,$.messageStubParameters=$A?[$A]:void 0;break;case"announcement":case"not_announcement":$.messageStubType=RA.GROUP_CHANGE_ANNOUNCE,$.messageStubParameters=[W.tag==="announcement"?"on":"off"];break;case"locked":case"unlocked":$.messageStubType=RA.GROUP_CHANGE_RESTRICT,$.messageStubParameters=[W.tag==="locked"?"on":"off"];break;case"invite":$.messageStubType=RA.GROUP_CHANGE_INVITE_LINK,$.messageStubParameters=[W.attrs.code];break;case"member_add_mode":let vA=W.content;vA&&($.messageStubType=RA.GROUP_MEMBER_ADD_MODE,$.messageStubParameters=[vA.toString()]);break;case"membership_approval_mode":let YA=le(W,"group_join");YA&&($.messageStubType=RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE,$.messageStubParameters=[YA.attrs.state]);break;case"created_membership_requests":$.messageStubType=RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD,$.messageStubParameters=[JSON.stringify({lid:Ee,pn:he}),"created",W.attrs.request_method];break;case"revoked_membership_requests":let At=Dt(Ee,re);$.messageStubType=RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD,$.messageStubParameters=[JSON.stringify({lid:Ee,pn:he}),At?"revoked":"rejected"];break}},Ze=async Ae=>{let[W]=Gs(Ae),$=BA(Ae.attrs.from);if(!W){t.debug({from:$},"devices notification missing child, skipping");return}let re=W.tag,se=W.attrs.device_hash,we=PA(W,"device");if(Dt($,I.creds.me.id)||Dt($,I.creds.me.lid)){let he=we.map(ye=>ye.attrs.jid);t.info({deviceJids:he},"got my own devices")}if(!we.length){t.debug({from:$,tag:re},"no devices in notification, skipping");return}let Ee=[];for(let he of we){let ye=he.attrs.jid;if(!ye)continue;let qe=hA(ye);if(!qe){t.debug({jid:ye},"failed to decode device jid, skipping");continue}Ee.push({jid:ye,user:qe.user,server:qe.server,device:qe.device})}Ee.length&&await g.mutex(async()=>{let he=new Map;for(let ye of Ee){let qe=he.get(ye.user)||[];qe.push(ye),he.set(ye.user,qe)}for(let[ye,qe]of he){if(re==="update"){t.debug({user:ye},`${ye}'s device list updated, dropping cached devices`),await s?.del(ye);continue}re==="remove"&&await y.deleteSession(qe.map(vA=>vA.jid));let IA=await s?.get(ye)||[];if(!IA.length){t.debug({user:ye,tag:re},"device list not cached, deferring to USync refresh");continue}let yA=new Set(qe.map(vA=>vA.device)),$A;switch(re){case"add":t.info({deviceHash:se,count:qe.length},"devices added"),$A=[...IA.filter(vA=>!yA.has(vA.device)),...qe.map(vA=>({user:vA.user,server:vA.server,device:vA.device}))];break;case"remove":t.info({deviceHash:se,count:qe.length},"devices removed"),$A=IA.filter(vA=>!yA.has(vA.device));break;default:t.debug({tag:re},"Unknown device list change tag");continue}$A.length===0?await s?.del(ye):await s?.set(ye,$A)}})},bA=async Ae=>{let W={},[$]=Gs(Ae),re=Ae.attrs.type,se=BA(Ae.attrs.from);switch(re){case"newsletter":await fe(Ae);break;case"mex":await Ne(Ae);break;case"w:gp2":aA(Ae,$,W);break;case"mediaretry":let we=qne(Ae);c.emit("messages.media-update",[we]);break;case"encrypt":await EA(Ae);break;case"devices":try{await Ze(Ae)}catch(Oo){t.error({error:Oo,node:Ae},"failed to handle devices notification")}break;case"server_sync":let Ee=le(Ae,"collection");if(Ee){let Oo=Ee.attrs.name;await _([Oo],!1)}break;case"picture":let he=le(Ae,"set"),ye=le(Ae,"delete");if(c.emit("contacts.update",[{id:BA(Ae?.attrs?.from)||(he||ye)?.attrs?.hash||"",imgUrl:he?"changed":"removed"}]),qr(se)){let Oo=he||ye;W.messageStubType=RA.GROUP_CHANGE_ICON,he&&(W.messageStubParameters=[he.attrs.id]),W.participant=Oo?.attrs.author,W.key={...W.key||{},participant:he?.attrs.author}}break;case"account_sync":if($.tag==="disappearing_mode"){let Oo=+$.attrs.duration,Tp=+$.attrs.t;t.info({newDuration:Oo},"updated account disappearing mode"),c.emit("creds.update",{accountSettings:{...I.creds.accountSettings,defaultDisappearingMode:{ephemeralExpiration:Oo,ephemeralSettingTimestamp:Tp}}})}else if($.tag==="blocklist"){let Oo=PA($,"item");for(let{attrs:Tp}of Oo){let A_=[Tp.jid],t_=Tp.action==="block"?"add":"remove";c.emit("blocklist.update",{blocklist:A_,type:t_})}}break;case"link_code_companion_reg":let qe=le(Ae,"link_code_companion_reg"),IA=ht(ki(qe,"link_code_pairing_ref")),yA=ht(ki(qe,"primary_identity_pub")),$A=ht(ki(qe,"link_code_pairing_wrapped_primary_ephemeral_pub")),vA=await wA($A),YA=br.sharedKey(I.creds.pairingEphemeralKeyPair.private,vA),At=vK(32),Ge=vK(32),rA=Vn(YA,32,{salt:Ge,info:"link_code_pairing_key_bundle_encryption_key"}),tt=Buffer.concat([Buffer.from(I.creds.signedIdentityKey.public),yA,At]),Ai=vK(12),cr=Jl(tt,rA,Ai,Buffer.alloc(0)),Do=Buffer.concat([Ge,Ai,cr]),$M=br.sharedKey(I.creds.signedIdentityKey.private,yA),e_=Buffer.concat([YA,$M,At]);I.creds.advSecretKey=Buffer.from(Vn(e_,32,{info:"adv_secret"})).toString("base64"),await m({tag:"iq",attrs:{to:OA,type:"set",id:r.generateMessageTag(),xmlns:"md"},content:[{tag:"link_code_companion_reg",attrs:{jid:I.creds.me.id,stage:"companion_finish"},content:[{tag:"link_code_pairing_wrapped_key_bundle",attrs:{},content:Do},{tag:"companion_identity_public",attrs:{},content:I.creds.signedIdentityKey.public},{tag:"link_code_pairing_ref",attrs:{},content:IA}]}]}),I.creds.registered=!0,c.emit("creds.update",I.creds);break;case"privacy_token":await ot(Ae);break}if(Object.keys(W).length)return W},Ce=new Set,ke=(async()=>{try{let Ae=await rM(I.keys);for(let W of Ae)Ce.add(W);t.debug({count:Ce.size},"loaded tctoken index")}catch(Ae){t.warn({err:Ae?.message},"failed to load tctoken index")}})(),Ue;async function MA(){Ue&&(clearTimeout(Ue),Ue=void 0);let Ae=await _E(I.keys,Ce);return I.keys.set({tctoken:Ae})}function Ke(){Ue&&clearTimeout(Ue),Ue=setTimeout(()=>{Ue=void 0,MA().catch(Ae=>{t.warn({err:Ae?.message},"failed to save tctoken index")})},5e3)}function _A(Ae){Ae&&Ae!==RI&&!Ce.has(Ae)&&(Ce.add(Ae),Ke())}let ot=async Ae=>{if(!le(Ae,"tokens"))return;let $=BA(Ae.attrs.from),se=(Ae.attrs.sender_lid&&qA(BA(Ae.attrs.sender_lid))?BA(Ae.attrs.sender_lid):void 0)??await ag($,J);t.debug({from:$,storageJid:se},"processing privacy token notification"),await TE({result:Ae,fallbackJid:se,keys:I.keys,getLIDForPN:J,onNewJidStored:_A})};async function wA(Ae){let W=ht(Ae),$=W.slice(0,32),re=await KD(I.creds.pairingCode,$),se=W.slice(32,48),we=W.slice(48,80);return Y$(we,re,se)}function ht(Ae){if(Ae===void 0)throw new dQ.Boom("Invalid buffer",{statusCode:400});return Ae instanceof Buffer?Ae:Buffer.from(Ae)}let fr=async(Ae,W)=>{let $=`${Ae}:${W}`;return(await ie.get($)||0){let $=`${Ae}:${W}`,re=(await ie.get($)||0)+1;await ie.set($,re)},pe=async(Ae,W,$,re)=>{let se=Ae.remoteJid,we=Ae.participant||se,Ee=+$.attrs.count||1,he=W[0],ye=[];for(let Ge of W){let rA;if(G){let tt=G.getRecentMessage(se,Ge);tt&&(rA=tt.message,t.debug({jid:se,id:Ge},"found message in retry cache"),G.markRetrySuccess(Ge))}rA||(rA=await e({...Ae,id:Ge}),rA&&(t.debug({jid:se,id:Ge},"found message via getMessage"),G&&G.markRetrySuccess(Ge))),ye.push(rA)}let qe=!hA(we)?.device,IA=y.jidToSignalProtocolAddress(we),yA=!1,$A=Ise(re);if($A)try{await y.injectE2ESession({jid:we,session:$A}),yA=!0,t.debug({participant:we,retryCount:Ee},"injected session from retry receipt key bundle")}catch(Ge){t.warn({error:Ge,participant:we},"failed to inject session from retry receipt")}if(!yA){let Ge=oI(re,"registration",4);if(typeof Ge=="number"&&Number.isInteger(Ge)){let rA=await y.getSessionInfo(we);rA&&rA.registrationId!==0&&rA.registrationId!==Ge&&(t.info({participant:we,stored:rA.registrationId,received:Ge},"reg id mismatch on retry without bundle, deleting session"),await I.keys.set({session:{[IA]:null}}))}}let vA=2;if(he&&G){let Ge=await y.getSessionInfo(we);Ge&&(Ee===vA?G.saveBaseKey(IA,he,Ge.baseKey):Ee>vA&&(G.hasSameBaseKey(IA,he,Ge.baseKey)&&(t.warn({participant:we,retryCount:Ee},"base key collision on retry, forcing fresh session"),await I.keys.set({session:{[IA]:null}})),G.deleteBaseKey(IA,he)))}let YA=!1,At="";if(A&&G&&Ee>1&&!yA)try{let Ge=await y.validateSession(we),rA=G.shouldRecreateSession(we,Ge.exists);YA=rA.recreate,At=rA.reason,YA&&(t.debug({participant:we,retryCount:Ee,reason:At},"recreating session for outgoing retry"),await I.keys.set({session:{[IA]:null}}))}catch(Ge){t.warn({error:Ge,participant:we},"failed to check session recreation for outgoing retry")}yA||await L([we],!0),qr(se)&&await I.keys.set({"sender-key-memory":{[se]:null}}),t.debug({participant:we,sendToAll:qe,shouldRecreateSession:YA,recreateReason:At,injectedFromBundle:yA},"prepared session for retry resend");for(let[Ge,rA]of ye.entries())if(W[Ge])if(rA&&await fr(W[Ge],we)){await UA(W[Ge],we);let tt={messageId:W[Ge]};qe?tt.useUserDevicesCache=!1:tt.participant={jid:we,count:+$.attrs.count},await F(Ae.remoteJid,rA,tt)}else t.debug({jid:Ae.remoteJid,id:W[Ge]},"recv retry request, but message not available")},Qe=async Ae=>{let{attrs:W,content:$}=Ae,re=W.from.includes("lid"),se=Dt(W.participant||W.from,re?I.creds.me?.lid:I.creds.me?.id),we=!se||qr(W.from)?W.from:W.recipient,Ee=!W.recipient||(W.type==="retry"||W.type==="sender")&&se,he={remoteJid:we,id:"",fromMe:Ee,participant:W.participant},ye=[W.id];if(Array.isArray($)){let qe=PA($[0],"item");ye.push(...qe.map(IA=>IA.attrs.id))}try{await Promise.all([Q.mutex(async()=>{let qe=tee(W.type);if(typeof qe<"u"&&(qe>=ne.WebMessageInfo.Status.SERVER_ACK||!se))if(qr(we)||zg(we)){if(W.participant){let IA=qe===ne.WebMessageInfo.Status.DELIVERY_ACK?"receiptTimestamp":"readTimestamp";c.emit("message-receipt.update",ye.map(yA=>({key:{...he,id:yA},receipt:{userJid:BA(W.participant),[IA]:+W.t}})))}}else c.emit("messages.update",ye.map(IA=>({key:{...he,id:IA},update:{status:qe,messageTimestamp:zr(+(W.t??0))}})));if(W.type==="retry"){he.participant=he.participant||W.from;let IA=le(Ae,"retry");if(ye[0]&&he.participant&&await fr(ye[0],he.participant))if(he.fromMe)try{await UA(ye[0],he.participant),t.debug({attrs:W,key:he},"recv retry request"),await pe(he,ye,IA,Ae)}catch(yA){t.error({key:he,ids:ye,trace:yA instanceof Error?yA.stack:"Unknown error"},"error in sending message again")}else t.info({attrs:W,key:he},"recv retry for not fromMe message");else t.info({attrs:W,key:he},"will not send message again, as sent too many times")}})])}finally{await Ie(Ae).catch(qe=>t.error({ackErr:qe},"failed to ack receipt"))}},Me=async Ae=>{let W=Ae.attrs.from;try{await Promise.all([f.mutex(async()=>{let $=await bA(Ae);if($){let re=Dt(Ae.attrs.participant||W,I.creds.me.id),{senderAlt:se,addressingMode:we}=JD(Ae);$.key={remoteJid:W,fromMe:re,participant:Ae.attrs.participant,participantAlt:se,participantUsername:Ae.attrs.participant_username,addressingMode:we,id:Ae.attrs.id,...$.key||{}},$.participant??($.participant=Ae.attrs.participant),$.messageTimestamp=+Ae.attrs.t;let Ee=ne.WebMessageInfo.fromObject($);await T(Ee,"append")}})])}finally{await Ie(Ae).catch($=>t.error({ackErr:$},"failed to ack notification"))}},oA=async Ae=>{if(le(Ae,"enc")?.attrs.type==="msmsg"){t.debug({key:Ae.attrs.key},"ignored msmsg"),await Ie(Ae,Vl.MissingMessageSecret);return}let $=!1;try{let{fullMessage:re,category:se,author:we,decrypt:Ee}=cee(Ae,I.creds.me.id,I.creds.me.lid||"",y,t),he=re.key.participantAlt||re.key.remoteJidAlt;if(he){let ye=hA(he)?.server,qe=re.key.participant||re.key.remoteJid;ye==="lid"?await y.lidMapping.getPNForLID(he)||(await y.lidMapping.storeLIDPNMappings([{lid:he,pn:qe}]),await y.migrateSession(qe,he)):(await y.lidMapping.storeLIDPNMappings([{lid:qe,pn:he}]),await y.migrateSession(he,qe))}await B.mutex(async()=>{if(await Ee(),re.key?.remoteJid&&re.key?.id&&re.message&&G&&G.addRecentMessage(re.key.remoteJid,re.key.id,re.message),re.messageStubType===ne.WebMessageInfo.StubType.CIPHERTEXT&&re.category!=="peer"){if(re?.messageStubParameters?.[0]===see)return $=!0,Ie(Ae,Vl.ParsingError);if(re.messageStubParameters?.[0]===jD){let qe=le(Ae,"unavailable")?.attrs?.type;if(qe==="bot_unavailable_fanout"||qe==="hosted_unavailable_fanout"||qe==="view_once_unavailable_fanout")return t.debug({msgId:re.key.id,unavailableType:qe},"skipping placeholder resend for excluded unavailable type"),$=!0,Ie(Ae);let IA=vi()-zr(re.messageTimestamp);if(IA>DIe)return t.debug({msgId:re.key.id,messageAge:IA},"skipping placeholder resend for old message"),$=!0,Ie(Ae);let yA={remoteJid:re.key.remoteJid,fromMe:re.key.fromMe,id:re.key.id,participant:re.key.participant},$A={key:re.key,messageTimestamp:re.messageTimestamp,pushName:re.pushName,participant:re.participant,verifiedBizName:re.verifiedBizName};Re(yA,$A).then(vA=>{vA&&vA!=="RESOLVED"&&(t.debug({msgId:re.key.id,requestId:vA},"requested placeholder resend for unavailable message"),c.emit("messages.update",[{key:re.key,update:{messageStubParameters:[jD,vA]}}]))}).catch(vA=>{t.warn({err:vA,msgId:re.key.id},"failed to request placeholder resend for unavailable message")}),$=!0,await Ie(Ae)}else{if(zg(re.key.remoteJid)){let ye=vi()-zr(re.messageTimestamp);if(ye>wIe)return t.debug({msgId:re.key.id,messageAge:ye,remoteJid:re.key.remoteJid},"skipping retry for expired status message"),$=!0,Ie(Ae)}t.debug("[handleMessage] Attempting retry request for failed decryption"),await X.mutex(async()=>{try{if(!p.isOpen){t.debug({node:Ae},"Connection closed, skipping retry");return}let ye=le(Ae,"enc");await je(Ae,!ye),o&&await ZB(o)}catch(ye){t.error({err:ye},"Failed to send retry")}$=!0,await Ie(Ae,Vl.UnhandledError)})}}else if(G&&re.key.id&&G.cancelPendingPhoneRequest(re.key.id),aI(re.key.remoteJid))$=!0,await Ie(Ae),t.debug({key:re.key},"processed newsletter message without receipts");else{let qe,IA=re.key.participant;if(se==="peer"?qe="peer_msg":re.key.fromMe?(qe="sender",(qA(re.key.remoteJid)||qA(re.key.remoteJidAlt))&&(IA=we)):Se||(qe="inactive"),$=!0,await q(re.key.remoteJid,IA,[re.key.id],qe),Wb(re.message)){let $A=BA(re.key.remoteJid);await q($A,void 0,[re.key.id],"hist_sync")}}ige(re,I.creds.me.id,I.creds.me.lid),await T(re,Ae.attrs.offline?"append":"notify")})}catch(re){t.error({error:re,node:Jn(Ae)},"error in handling message"),$||await Ie(Ae,Vl.UnhandledError).catch(se=>t.error({ackErr:se},"failed to ack message after error"))}},pA=async Ae=>{try{let{attrs:W}=Ae,[$]=Gs(Ae);if(!$)throw new dQ.Boom("Missing call info in call node");let re=iee($),se=$.attrs["call-id"],we=$.attrs.from||$.attrs["call-creator"],Ee={chatId:W.from,from:we,callerPn:$.attrs.caller_pn,id:se,date:new Date(+W.t*1e3),offline:!!W.offline,status:re};if(re==="relaylatency"){let ye=$.attrs.latency||$.attrs.latency_ms||$.attrs["latency-ms"],qe=ye?Number(ye):void 0;Number.isFinite(qe)&&(Ee.latencyMs=qe)}re==="offer"&&(Ee.isVideo=!!le($,"video"),Ee.isGroup=$.attrs.type==="group"||!!$.attrs["group-jid"],Ee.groupJid=$.attrs["group-jid"],await De.set(Ee.id,Ee));let he=await De.get(Ee.id);he&&(Ee.isVideo=he.isVideo,Ee.isGroup=he.isGroup,Ee.callerPn=Ee.callerPn||he.callerPn),(re==="reject"||re==="accept"||re==="timeout"||re==="terminate")&&await De.del(Ee.id),c.emit("call",[Ee])}catch(W){t.error({error:W,node:Jn(Ae)},"error in handling call")}finally{await Ie(Ae).catch(W=>t.error({ackErr:W},"failed to ack call"))}},FA=async({attrs:Ae})=>{let W={remoteJid:Ae.from,fromMe:!0,id:Ae.id};if(Ae.error){let $=Ae.error===String(Vl.SenderReachoutTimelocked);if(Ae.error===PL.MessageAccountRestriction){t.warn({msgId:Ae.id,from:Ae.from},"error 463: account restricted or missing tctoken for contact");let re=Ae.from;re&&!wo.has(re)&&(wo.add(re),(async()=>{try{let se=y.lidMapping.getPNForLID.bind(y.lidMapping),we=await ag(re,J),Ee=await tQ(re,r.serverProps.lidTrustedTokenIssueToLid,J,se),he=await H([Ee],vi());await TE({result:he,fallbackJid:we,keys:I.keys,getLIDForPN:J,onNewJidStored:_A}),t.debug({from:re},"completed 463 token recovery issuance")}catch(se){t.debug({from:re,err:se?.message},"failed 463 token recovery issuance")}finally{wo.delete(re)}})())}else Ae.error===PL.SmaxInvalid?t.warn({msgId:Ae.id,from:Ae.from},"smax-invalid (479): stanza rejected by server \u2014 likely stale device session or malformed addressing"):$?(await N().catch(re=>t.warn({err:re},"failed to fetch reachout timelock")),t.warn({attrs:Ae},"received error in ack")):t.warn({attrs:Ae},"received error in ack");c.emit("messages.update",[{key:W,update:{status:bh.ERROR,messageStubParameters:$?[Ae.error,gee]:[Ae.error]}}])}},jt=async(Ae,W,$)=>{c.buffer(),await re(),c.flush();function re(){return $(Ae,!1).catch(se=>R(se,W))}},ct=qIe(new Map([["message",oA],["call",pA],["receipt",Qe],["notification",Me]]),{isWsOpen:()=>p.isOpen,onUnexpectedError:R,yieldToEventLoop:()=>new Promise(Ae=>setImmediate(Ae))}),_r=async(Ae,W,$,re)=>{let se=W.attrs.from,we=se;if(Ae==="receipt"&&se){let he=W.attrs,ye=he.from.includes("lid");we=!Dt(he.participant||he.from,ye?I.creds.me?.lid:I.creds.me?.id)||qr(he.from)?he.from:he.recipient}if(we&&we!==OA&&i(we)){await Ie(W,Ae==="message"?Vl.UnhandledError:void 0);return}!!W.attrs.offline?ct.enqueue(Ae,W):await jt(W,$,re)};p.on("CB:message",async Ae=>{await _r("message",Ae,"processing message",oA)}),p.on("CB:call",async Ae=>{await _r("call",Ae,"handling call",pA)}),p.on("CB:receipt",async Ae=>{await _r("receipt",Ae,"handling receipt",Qe)}),p.on("CB:notification",async Ae=>{await _r("notification",Ae,"handling notification",Me)}),p.on("CB:ack,class:message",Ae=>{FA(Ae).catch(W=>R(W,"handling bad ack"))}),c.on("call",async([Ae])=>{if(Ae&&(Ae.status==="timeout"||Ae.status==="offer"&&Ae.isGroup)){let W={key:{remoteJid:Ae.chatId,id:Ae.id,fromMe:!1},messageTimestamp:vi(Ae.date)};Ae.status==="timeout"?Ae.isGroup?W.messageStubType=Ae.isVideo?RA.CALL_MISSED_GROUP_VIDEO:RA.CALL_MISSED_GROUP_VOICE:W.messageStubType=Ae.isVideo?RA.CALL_MISSED_VIDEO:RA.CALL_MISSED_VOICE:W.message={call:{callKey:Buffer.from(Ae.id)}};let $=ne.WebMessageInfo.fromObject(W);await T($,Ae.offline?"append":"notify")}});let gr=0,wo=new Set;c.on("connection.update",({isOnline:Ae,connection:W})=>{if(typeof Ae<"u"&&(Se=Ae,t.trace(`sendActiveReceipts set to "${Se}"`)),W==="close"&&Ue){clearTimeout(Ue),Ue=void 0;try{Promise.resolve(MA()).catch(()=>{})}catch{}}if(Ae){let $=Date.now(),re=1440*60*1e3;$-gr>=re&&(gr=$,io())}}),V(()=>{!n.msgRetryCounterCache&&ie.close&&ie.close(),!n.callOfferCache&&De.close&&De.close(),oe.close(),Se=!1});async function io(){try{await ke;let Ae=await rM(I.keys),W=new Set(Ce);for(let he of Ae)W.add(he);if(!W.size)return;let $=[...W],re=await I.keys.get("tctoken",$),se={},we=new Set,Ee=0;for(let he of $){let ye=re[he];if(!ye){Ee++;continue}let qe=!!ye.token?.length,IA=qe&&Bp(ye.timestamp),yA=ye.senderTimestamp!==void 0,$A=yA&&Bp(ye.senderTimestamp),vA=qe&&!IA,YA=yA&&!$A;!vA&&!YA?(se[he]=null,Ee++):IA&&YA?(se[he]={token:Buffer.alloc(0),senderTimestamp:ye.senderTimestamp},we.add(he),Ee++):we.add(he)}if(Ee===0)return;await I.keys.set({tctoken:{...se,[RI]:{token:Buffer.from(JSON.stringify([...we]))}}}),Ce.clear();for(let he of we)Ce.add(he);t.debug({mutated:Ee,remaining:we.size},"pruned expired tctokens")}catch(Ae){t.warn({err:Ae?.message},"failed to prune expired tctokens")}}return{...r,sendMessageAck:Ie,sendRetryRequest:je,rejectCall:Xe,fetchMessageHistory:Be,requestPlaceholderResend:Re,messageRetryManager:G}};var ele=n=>{let t=$Ie(n),{authState:o,query:a,waUploadToServer:e}=t,i=async f=>{let Q=[],y=["address","email","description"];return Q.push(...y.filter(T=>f[T]!==void 0&&f[T]!==null).map(T=>({tag:T,attrs:{},content:f[T]}))),f.websites!==void 0&&Q.push(...f.websites.map(T=>({tag:"website",attrs:{},content:T}))),f.hours!==void 0&&Q.push({tag:"business_hours",attrs:{timezone:f.hours.timezone},content:f.hours.days.map(T=>{let _={tag:"business_hours_config",attrs:{day_of_week:T.day,mode:T.mode}};return T.mode==="specific_hours"?{..._,attrs:{..._.attrs,open_time:T.openTimeInMinutes,close_time:T.closeTimeInMinutes}}:_})}),await a({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz"},content:[{tag:"business_profile",attrs:{v:"3",mutation_type:"delta"},content:Q}]})},A=async f=>{let{fileSha256:Q,filePath:y}=await Yb(f,"biz-cover-photo"),m=Q.toString("base64"),{meta_hmac:T,fbid:_,ts:R}=await e(y,{fileEncSha256B64:m,mediaType:"biz-cover-photo"});return await a({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz"},content:[{tag:"business_profile",attrs:{v:"3",mutation_type:"delta"},content:[{tag:"cover_photo",attrs:{id:String(_),op:"update",token:T,ts:String(R)}}]}]}),_},r=async f=>await a({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz"},content:[{tag:"business_profile",attrs:{v:"3",mutation_type:"delta"},content:[{tag:"cover_photo",attrs:{op:"delete",id:f}}]}]}),s=async({jid:f,limit:Q,cursor:y})=>{f=f||o.creds.me?.id,f=BA(f);let m=[{tag:"limit",attrs:{},content:Buffer.from((Q||10).toString())},{tag:"width",attrs:{},content:Buffer.from("100")},{tag:"height",attrs:{},content:Buffer.from("100")}];y&&m.push({tag:"after",attrs:{},content:y});let T=await a({tag:"iq",attrs:{to:OA,type:"get",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog",attrs:{jid:f,allow_shop_source:"true"},content:m}]});return RIe(T)},g=async(f,Q=51)=>{f=f||o.creds.me?.id,f=BA(f);let y=await a({tag:"iq",attrs:{to:OA,type:"get",xmlns:"w:biz:catalog",smax_id:"35"},content:[{tag:"collections",attrs:{biz_jid:f},content:[{tag:"collection_limit",attrs:{},content:Buffer.from(Q.toString())},{tag:"item_limit",attrs:{},content:Buffer.from(Q.toString())},{tag:"width",attrs:{},content:Buffer.from("100")},{tag:"height",attrs:{},content:Buffer.from("100")}]}]});return kIe(y)},c=async(f,Q)=>{let y=await a({tag:"iq",attrs:{to:OA,type:"get",xmlns:"fb:thrift_iq",smax_id:"5"},content:[{tag:"order",attrs:{op:"get",id:f},content:[{tag:"image_dimensions",attrs:{},content:[{tag:"width",attrs:{},content:Buffer.from("100")},{tag:"height",attrs:{},content:Buffer.from("100")}]},{tag:"token",attrs:{},content:Buffer.from(Q)}]}]});return vIe(y)},I=async(f,Q)=>{Q=await MK(Q,e);let y=bK(f,Q),m=await a({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog_edit",attrs:{v:"1"},content:[y,{tag:"width",attrs:{},content:"100"},{tag:"height",attrs:{},content:"100"}]}]}),T=le(m,"product_catalog_edit"),_=le(T,"product");return lQ(_)},p=async f=>{f.isHidden=!!f.isHidden,f=await MK(f,e);let Q=bK(void 0,f),y=await a({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog_add",attrs:{v:"1"},content:[Q,{tag:"width",attrs:{},content:"100"},{tag:"height",attrs:{},content:"100"}]}]}),m=le(y,"product_catalog_add"),T=le(m,"product");return lQ(T)},B=async f=>{let Q=await a({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog_delete",attrs:{v:"1"},content:f.map(m=>({tag:"product",attrs:{},content:[{tag:"id",attrs:{},content:Buffer.from(m)}]}))}]});return{deleted:+(le(Q,"product_catalog_delete")?.attrs.deleted_count||0)}};return{...t,logger:n.logger,getOrderDetails:c,getCatalog:s,getCollections:g,productCreate:p,productDelete:B,productUpdate:I,updateBussinesProfile:i,updateCoverPhoto:A,removeCoverPhoto:r}};var Ale=n=>{let t=ele(n),{authState:o,ev:a,query:e,upsertMessage:i}=t,A=async(I,p,B)=>e({tag:"iq",attrs:{type:p,xmlns:"w:g2",to:I},content:B}),r=async I=>{let p=await A(I,"get",[{tag:"query",attrs:{request:"interactive"}}]);return PK(p)},s=async()=>{let I=await e({tag:"iq",attrs:{to:"@g.us",xmlns:"w:g2",type:"get"},content:[{tag:"participating",attrs:{},content:[{tag:"participants",attrs:{}},{tag:"description",attrs:{}}]}]}),p={},B=le(I,"communities");if(B){let f=PA(B,"community");for(let Q of f){let y=PK({tag:"result",attrs:{},content:[Q]});p[y.id]=y}}return t.ev.emit("groups.update",Object.values(p)),p};async function g(I){gQ.info({node:I},"parseGroupResult");let p=le(I,"group");if(p)try{gQ.info({groupNode:p},"groupNode");let B=await t.groupMetadata(`${p.attrs.id}@g.us`);return B||c.empty()}catch(B){return console.error("Error parsing group metadata:",B),c.empty()}return c.empty()}let c={empty:()=>null,of:I=>I!==null?{value:I}:null};return t.ws.on("CB:ib,,dirty",async I=>{let{attrs:p}=le(I,"dirty");p.type==="communities"&&(await s(),await t.cleanDirtyBits("groups"))}),{...t,communityMetadata:r,communityCreate:async(I,p)=>{let B=kL().substring(0,12),f=await A("@g.us","set",[{tag:"create",attrs:{subject:I},content:[{tag:"description",attrs:{id:B},content:[{tag:"body",attrs:{},content:Buffer.from(p||"","utf-8")}]},{tag:"parent",attrs:{default_membership_approval_mode:"request_required"}},{tag:"allow_non_admin_sub_group_creation",attrs:{}},{tag:"create_general_chat",attrs:{}}]}]);return await g(f)},communityCreateGroup:async(I,p,B)=>{let f=Vr(),Q=await A("@g.us","set",[{tag:"create",attrs:{subject:I,key:f},content:[...p.map(y=>({tag:"participant",attrs:{jid:y}})),{tag:"linked_parent",attrs:{jid:B}}]}]);return await g(Q)},communityLeave:async I=>{await A("@g.us","set",[{tag:"leave",attrs:{},content:[{tag:"community",attrs:{id:I}}]}])},communityUpdateSubject:async(I,p)=>{await A(I,"set",[{tag:"subject",attrs:{},content:Buffer.from(p,"utf-8")}])},communityLinkGroup:async(I,p)=>{await A(p,"set",[{tag:"links",attrs:{},content:[{tag:"link",attrs:{link_type:"sub_group"},content:[{tag:"group",attrs:{jid:I}}]}]}])},communityUnlinkGroup:async(I,p)=>{await A(p,"set",[{tag:"unlink",attrs:{unlink_type:"sub_group"},content:[{tag:"group",attrs:{jid:I}}]}])},communityFetchLinkedGroups:async I=>{let p=I,B=!1,f=await t.groupMetadata(I);f.linkedParent?p=f.linkedParent:B=!0;let Q=await A(p,"get",[{tag:"sub_groups",attrs:{}}]),y=[],m=le(Q,"sub_groups");if(m){let T=PA(m,"group");for(let _ of T)y.push({id:_.attrs.id?Dr(_.attrs.id,"g.us"):void 0,subject:_.attrs.subject||"",creation:_.attrs.creation?Number(_.attrs.creation):void 0,owner:_.attrs.creator?BA(_.attrs.creator):void 0,size:_.attrs.size?Number(_.attrs.size):void 0})}return{communityJid:p,isCommunity:B,linkedGroups:y}},communityRequestParticipantsList:async I=>{let p=await A(I,"get",[{tag:"membership_approval_requests",attrs:{}}]),B=le(p,"membership_approval_requests");return PA(B,"membership_approval_request").map(Q=>Q.attrs)},communityRequestParticipantsUpdate:async(I,p,B)=>{let f=await A(I,"set",[{tag:"membership_requests_action",attrs:{},content:[{tag:B,attrs:{},content:p.map(T=>({tag:"participant",attrs:{jid:T}}))}]}]),Q=le(f,"membership_requests_action"),y=le(Q,B);return PA(y,"participant").map(T=>({status:T.attrs.error||"200",jid:T.attrs.jid}))},communityParticipantsUpdate:async(I,p,B)=>{let f=await A(I,"set",[{tag:B,attrs:B==="remove"?{linked_groups:"true"}:{},content:p.map(m=>({tag:"participant",attrs:{jid:m}}))}]),Q=le(f,B);return PA(Q,"participant").map(m=>({status:m.attrs.error||"200",jid:m.attrs.jid,content:m}))},communityUpdateDescription:async(I,p)=>{let f=(await r(I)).descId??null;await A(I,"set",[{tag:"description",attrs:{...p?{id:kL()}:{delete:"true"},...f?{prev:f}:{}},content:p?[{tag:"body",attrs:{},content:Buffer.from(p,"utf-8")}]:void 0}])},communityInviteCode:async I=>{let p=await A(I,"get",[{tag:"invite",attrs:{}}]);return le(p,"invite")?.attrs.code},communityRevokeInvite:async I=>{let p=await A(I,"set",[{tag:"invite",attrs:{}}]);return le(p,"invite")?.attrs.code},communityAcceptInvite:async I=>{let p=await A("@g.us","set",[{tag:"invite",attrs:{code:I}}]);return le(p,"community")?.attrs.jid},communityRevokeInviteV4:async(I,p)=>!!await A(I,"set",[{tag:"revoke",attrs:{},content:[{tag:"participant",attrs:{jid:p}}]}]),communityAcceptInviteV4:a.createBufferedFunction(async(I,p)=>{I=typeof I=="string"?{remoteJid:I}:I;let B=await A(p.groupJid,"set",[{tag:"accept",attrs:{code:p.inviteCode,expiration:p.inviteExpiration.toString(),admin:I.remoteJid}}]);return I.id&&(p=ne.Message.GroupInviteMessage.fromObject(p),p.inviteExpiration=0,p.inviteCode="",a.emit("messages.update",[{key:I,update:{message:{groupInviteMessage:p}}}])),await i({key:{remoteJid:p.groupJid,id:Vr(t.user?.id),fromMe:!1,participant:I.remoteJid},messageStubType:RA.GROUP_PARTICIPANT_ADD,messageStubParameters:[JSON.stringify(o.creds.me)],participant:I.remoteJid,messageTimestamp:vi()},"notify"),B.attrs.from}),communityGetInviteInfo:async I=>{let p=await A("@g.us","get",[{tag:"invite",attrs:{code:I}}]);return PK(p)},communityToggleEphemeral:async(I,p)=>{let B=p?{tag:"ephemeral",attrs:{expiration:p.toString()}}:{tag:"not_ephemeral",attrs:{}};await A(I,"set",[B])},communitySettingUpdate:async(I,p)=>{await A(I,"set",[{tag:p,attrs:{}}])},communityMemberAddMode:async(I,p)=>{await A(I,"set",[{tag:"member_add_mode",attrs:{},content:p}])},communityJoinApprovalMode:async(I,p)=>{await A(I,"set",[{tag:"membership_approval_mode",attrs:{},content:[{tag:"community_join",attrs:{state:p}}]}])},communityFetchAllParticipating:s}},PK=n=>{let t=le(n,"community"),o=le(t,"description"),a,e;o&&(a=jA(o,"body"),e=o.attrs.id);let i=t.attrs.id?.includes("@")?t.attrs.id:Dr(t.attrs.id||"","g.us"),A=le(t,"ephemeral")?.attrs.expiration,r=jA(t,"member_add_mode")==="all_member_add";return{id:i,subject:t.attrs.subject||"",subjectOwner:t.attrs.s_o,subjectTime:Number(t.attrs.s_t||0),size:PA(t,"participant").length,creation:Number(t.attrs.creation||0),owner:t.attrs.creator?BA(t.attrs.creator):void 0,desc:a,descId:e,linkedParent:le(t,"linked_parent")?.attrs.jid||void 0,restrict:!!le(t,"locked"),announce:!!le(t,"announcement"),isCommunity:!!le(t,"parent"),isCommunityAnnounce:!!le(t,"default_sub_community"),joinApprovalMode:!!le(t,"membership_approval_mode"),memberAddMode:r,participants:PA(t,"participant").map(({attrs:g})=>({id:g.jid,admin:g.type||null})),ephemeralDuration:A?+A:void 0,addressingMode:jA(t,"addressing_mode")}};var GXe=n=>{let t={...bIe,...n};return Ale(t)},tle=GXe;var rle=tle;var FXe=Object.freeze({key:"whatsapp",label:"WhatsApp",get connectionLabel(){return w(" Web \u5173\u8054\u8BBE\u5907")},reactions:Object.freeze({processing:"\u{1F440}",success:"\u2705",error:"\u274C"})}),jM=class extends Es{constructor(t){super({...t,descriptor:FXe})}};function LXe(n){return n==="lid"||n==="hosted.lid"}function UXe(n){return n==="s.whatsapp.net"||n==="c.us"||n==="hosted"}function GK(n){if(typeof n!="string"||!n)return!1;let t=hA(n.trim());return!!(t&&LXe(t.server))}function HXe(n){if(typeof n!="string"||!n)return!1;let t=hA(n.trim());return!!(t&&UXe(t.server)&&/^\d+$/.test(t.user))}function KXe(n,t){if(!n||!t||typeof t!="object")return;let o=[[t.remoteJid,t.remoteJidAlt],[t.participant,t.participantAlt],[t.remoteJidAlt,t.remoteJid],[t.participantAlt,t.participant]];for(let[a,e]of o)if(GK(a)&&HXe(e)){let i=hA(a);i?.user&&n.set(i.user,e)}}async function ile(n,t,o){let a=hA(o);if(!a?.user)return null;let e=t?.get(a.user);if(e)return e;let i=n?.signalRepository?.lidMapping;if(!i||typeof i.getPNForLID!="function")return null;try{let A=await i.getPNForLID(o);if(typeof A=="string"&&A)return t?.set(a.user,A),A}catch{}return null}async function xXe(n,t){let o=n?.signalRepository?.lidMapping;if(!o||typeof o.getLIDForPN!="function")return null;try{let a=await o.getLIDForPN(t);return typeof a=="string"&&a?a:null}catch{return null}}async function ale(n,t,{accountJid:o,socket:a,lidPnCache:e}={}){if(!n)return null;t?.key&&KXe(e,t.key);let i=new Set;typeof n.senderAlternateId=="string"&&n.senderAlternateId&&i.add(n.senderAlternateId);for(let s of[n.senderId,n.senderAlternateId]){if(!GK(s))continue;let g=await ile(a,e,s);g&&i.add(g)}let A=n.addressed===!0;if(n.kind==="group"&&A!==!0){let g=t?.message,c=null;for(let B=0;B<5&&g&&typeof g=="object"&&(c=g.extendedTextMessage?.contextInfo??g.imageMessage?.contextInfo??g.videoMessage?.contextInfo??g.documentMessage?.contextInfo??null,!c);B+=1){let f=["ephemeralMessage","viewOnceMessage","documentWithCaptionMessage","viewOnceMessageV2","viewOnceMessageV2Extension","editedMessage","associatedChildMessage","groupStatusMessage","groupStatusMessageV2"].find(Q=>g[Q]?.message);if(!f)break;g=g[f].message}let I=Array.isArray(c?.mentionedJid)?c.mentionedJid:[],p=await xXe(a,o);for(let B of I)if(!(typeof B!="string"||!B)){try{if(Dt(B,o)===!0){A=!0;break}}catch{}if(p)try{if(Dt(B,p)===!0){A=!0;break}}catch{}if(GK(B)){let f=await ile(a,e,B);if(f)try{if(Dt(f,o)===!0){A=!0;break}}catch{}}}}i.delete(n.senderId);let r=[...i];return{...n,addressed:A,...r.length>0?{senderAliasIds:r}:{},...r[0]&&!n.senderAlternateId?{senderAlternateId:r[0]}:{}}}import{chmod as ole,mkdir as YXe,readdir as jXe}from"node:fs/promises";var JXe=Object.freeze({level:"silent",trace(){},debug(){},info(){},warn(){},error(){},fatal(){},child(){return this}}),qXe=6e4;function nle(){return Object.assign(new Error("WhatsApp connection was cancelled"),{name:"AbortError"})}function zXe(n){return n?.output?.statusCode??n?.data?.statusCode??n?.statusCode??null}function VXe(n){let t=n;if(typeof t=="string"){if(!/^\d+$/.test(t))return null;t=Number(t)}else typeof t=="bigint"?t=Number(t):t&&typeof t=="object"&&(t=Number(t.valueOf()));return Number.isFinite(t)&&t>=0?t*1e3:null}async function FK(n){await YXe(n,{recursive:!0,mode:448}),await ole(n,448);let t=await jXe(n,{withFileTypes:!0}).catch(()=>[]);await Promise.all(t.filter(o=>o.isFile()).map(o=>ole(`${n}/${o.name}`,384).catch(()=>{})))}function WXe(n,t){let o=n.user??t.creds.me,a=BA(o?.id);if(!/^\d{5,32}@(s\.whatsapp\.net|lid)$/.test(a??""))throw new Error("WhatsApp did not return a valid linked account");return{accountJid:a,name:typeof o?.name=="string"&&o.name.trim()?o.name.trim().slice(0,100):w("WhatsApp\u673A\u5668\u4EBA")}}async function JM({authDir:n,onQr:t,onMessage:o,onDisconnect:a,signal:e,logger:i=console,makeSocket:A=rle,loadAuthState:r=Age}={}){if(!n||typeof t!="function")throw new TypeError("WhatsApp Web session requires an auth directory and QR callback");await FK(n);let s=Date.now(),{state:g,saveCreds:c}=await r(n),I=g.keys.set.bind(g.keys);g.keys.set=async z=>{await I(z),await FK(n)};let p=!1,B=!1,f,Q,y=Promise.resolve(),m=null,T=0,_=null,R=new Promise((z,K)=>{f=z,Q=K}),L=z=>{B||(B=!0,Q(z))},U=async()=>{p||(p=!0,T+=1,L(nle()),await _?.catch(()=>{}),await y.catch(()=>{}),await m?.end(void 0).catch(()=>{}))},F=async()=>{p||(p=!0,T+=1,L(nle()),await _?.catch(()=>{}),await y.catch(()=>{}),await m?.logout("Removed from DeepSeek Harness").catch(()=>{}))},q=()=>{let z=++T,K=!1,G=A({auth:g,browser:oM.macOS("DeepSeek Harness"),logger:JXe,markOnlineOnConnect:!1,syncFullHistory:!1,shouldSyncHistoryMessage:()=>!1,getMessage:async()=>{},generateHighQualityLinkPreview:!1});m=G;let V=()=>{!K||!g.creds.me||B||y.then(()=>{p||B||z!==T||!K||!g.creds.me||(B=!0,f(WXe(G,g)))}).catch(H=>L(H))};G.ev.on("creds.update",()=>{p||z!==T||(y=y.then(async()=>{await c(),await FK(n)}),y.catch(()=>i.error?.("[dsh-im:whatsapp] failed to persist linked-device state")),V())}),G.ev.on("connection.update",H=>{if(!(p||z!==T)&&(typeof H.qr=="string"&&H.qr&&t(H.qr),H.connection==="open"&&(K=!0,V()),H.connection==="close")){let N=zXe(H.lastDisconnect?.error);if(N===ar.restartRequired){_??=y.then(async()=>{p||z!==T||(await G.end(void 0).catch(()=>{}),!(p||z!==T)&&q())}).catch(X=>L(X)).finally(()=>{_=null});return}let k=N===ar.loggedOut,J=Object.assign(new Error(k?"WhatsApp linked device was removed from the phone":"WhatsApp Web connection closed"),{code:k?"logged-out":"connection-closed"});B?a?.({error:J,loggedOut:k}):L(J)}}),G.ev.on("messages.upsert",({messages:H,type:N})=>{if(!(p||z!==T||N!=="notify"&&N!=="append"||typeof o!="function"))for(let k of Array.isArray(H)?H:[]){if(N==="append"){let J=VXe(k?.messageTimestamp);if(J===null||J{i.error?.("[dsh-im:whatsapp] failed to process an inbound WhatsApp message")})}})};return q(),e&&(e.aborted?await U():e.addEventListener("abort",()=>void U(),{once:!0})),Object.freeze({get socket(){return m},ready:R,close:U,logout:F})}var UK=new Set(["image/jpeg","image/png","image/webp","image/gif"]),XXe=5*1024*1024,LK=15e3,HK=12e4,$Xe=["ephemeralMessage","viewOnceMessage","documentWithCaptionMessage","viewOnceMessageV2","viewOnceMessageV2Extension","editedMessage","associatedChildMessage","groupStatusMessage","groupStatusMessageV2"],e7e=new Set(["viewOnceMessage","viewOnceMessageV2","viewOnceMessageV2Extension"]),A7e=new Set(["s.whatsapp.net","c.us","lid","hosted","hosted.lid"]);function gle(n){if(typeof n!="string")return null;let t=n.trim();if(/^\+?\d+$/.test(t))return`${t.replace(/^\+/,"")}@s.whatsapp.net`;let o=hA(t);return!o||!/^\d+$/.test(o.user)||!A7e.has(o.server)?null:t}function YK(n,t){let o=gle(n),a=gle(t);if(!o||!a)return!1;try{return Dt(o,a)===!0}catch{return!1}}function t7e(n){let t=n;for(let o=0;o<5&&t&&typeof t=="object";o+=1){let a=$Xe.find(e=>t[e]?.message);if(!a)return!1;if(e7e.has(a))return!0;t=t[a].message}return!1}function r7e(n){return n?.extendedTextMessage?.contextInfo??n?.imageMessage?.contextInfo??n?.videoMessage?.contextInfo??n?.documentMessage?.contextInfo??null}function Ile(n){return n?.conversation??n?.extendedTextMessage?.text??n?.imageMessage?.caption??n?.videoMessage?.caption??n?.documentMessage?.caption??""}function hQ(n,t,o){if(!t||typeof t!="object")return null;let a=typeof t.fileName=="string"&&t.fileName?t.fileName:typeof o=="string"&&o?o:void 0;return{kind:n,...a?{name:a}:{}}}function i7e(n){let t=[];if(n?.imageMessage&&t.push(hQ("image",n.imageMessage)),n?.documentMessage){let o=typeof n.documentMessage.mimetype=="string"?n.documentMessage.mimetype.toLowerCase():"";t.push(hQ(o.startsWith("image/")?"image":"file",n.documentMessage))}if(n?.audioMessage&&t.push(hQ("audio",n.audioMessage)),n?.videoMessage&&t.push(hQ("video",n.videoMessage)),n?.stickerMessage){let o=typeof n.stickerMessage.mimetype=="string"?n.stickerMessage.mimetype.toLowerCase():"";t.push(hQ(o.startsWith("video/")||n.stickerMessage.isAnimated===!0?"video":"image",n.stickerMessage))}return t.filter(Boolean)}function a7e(n){if(!n?.quotedMessage||typeof n.quotedMessage!="object")return;let t=Si(n.quotedMessage),o=typeof n.stanzaId=="string"&&n.stanzaId?n.stanzaId:void 0,a=typeof n.participant=="string"&&n.participant?n.participant:void 0;return{...o?{messageId:o}:{},...a?{authorId:a}:{},content:Ile(t),attachments:i7e(t)}}function lle(n){if(Number.isSafeInteger(n)&&n>=0)return n;let t;try{t=Number(n?.toString?.())}catch{return}return Number.isSafeInteger(t)&&t>=0?t:void 0}async function o7e(n,t,{signal:o,maxBytes:a=XXe}={}){o?.throwIfAborted();let e=AbortSignal.timeout(LK),i=o?AbortSignal.any([o,e]):e,A=Promise.resolve().then(()=>t(n,"stream",{options:{signal:i}})),r=await new Promise((I,p)=>{let B=!1,f=(y,m)=>B?!1:(B=!0,i.removeEventListener("abort",Q),y(m),!0),Q=()=>f(p,i.reason);i.addEventListener("abort",Q,{once:!0}),A.then(y=>{f(I,y)||y?.destroy?.()},y=>f(p,y)),i.aborted&&Q()}).catch(I=>{throw o?.aborted?o.reason??I:e.aborted?new ft("image-download-failed",`WhatsApp image download timed out after ${LK} ms`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002")):I}),s=[],g=0,c=()=>r?.destroy?.(i.reason);i.addEventListener("abort",c,{once:!0});try{for await(let I of r){i.throwIfAborted();let p=Buffer.from(I);if(g+=p.length,g>a)throw r.destroy?.(),new ft("image-too-large",`WhatsApp image exceeded ${a} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));s.push(p)}}catch(I){throw o?.aborted?o.reason??I:e.aborted?new ft("image-download-failed",`WhatsApp image stream timed out after ${LK} ms`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002")):I}finally{i.removeEventListener("abort",c)}return Buffer.concat(s,g)}function n7e(n,t,o,{viewOnce:a=!1}={}){let e,i;if(!a&&t?.imageMessage&&t.imageMessage.viewOnce!==!0)e=t.imageMessage;else if(t?.documentMessage){let r=typeof t.documentMessage.mimetype=="string"?t.documentMessage.mimetype.toLowerCase():"";if(!UK.has(r))return null;e=t.documentMessage,i=typeof e.fileName=="string"?e.fileName:void 0}if(!e)return null;let A=typeof e.mimetype=="string"?e.mimetype.toLowerCase():"";return UK.has(A)?{name:i,mediaType:A,size:lle(e.fileLength),load:r=>o7e(n,o,r)}:null}function s7e(n,t,o){let a=t?.documentMessage;if(!a)return null;let e=typeof a.mimetype=="string"&&a.mimetype?a.mimetype.toLowerCase():void 0;return UK.has(e)?null:{name:typeof a.fileName=="string"&&a.fileName?a.fileName:"whatsapp-file",...e?{mediaType:e}:{},size:lle(a.fileLength),async load({signal:i}={}){i?.throwIfAborted();let A=await o(n,"stream",{options:{signal:i}});return i?.throwIfAborted(),{stream:A}}}}function g7e({socket:n,logger:t=console,download:o=AH}={}){if(typeof o!="function")throw new TypeError("WhatsApp media downloader is required");return typeof n?.updateMediaMessage!="function"?o:(a,e,i)=>o(a,e,i,{logger:t,reuploadRequest:A=>n.updateMediaMessage(A)})}function c7e(n,t,{download:o=AH}={}){let a=typeof n?.key?.remoteJid=="string"?n.key.remoteJid:"",e=typeof n?.key?.remoteJidAlt=="string"?n.key.remoteJidAlt:"",i=typeof n?.key?.id=="string"?n.key.id:"";if(!a||!i||a==="status@broadcast"||a.endsWith("@newsletter"))return null;let A=a.endsWith("@g.us"),r=n.key.fromMe===!0,s=r&&!A&&[a,e].some(_=>_&&Dt(_,t));if(r&&!s&&!A)return null;let g=r?t:A?n.key.participant:a,c=A&&!r?n.key.participantAlt:e;if(typeof g!="string"||!g)return null;let I=t7e(n.message),p=Si(n.message),B=r7e(p),f=Array.isArray(B?.mentionedJid)&&B.mentionedJid.some(_=>Dt(_,t)),Q=typeof B?.participant=="string"&&Dt(B.participant,t),y=n7e(n,p,o,{viewOnce:I}),m=s7e(n,p,o),T=a7e(B);return{messageId:`${a}:${i}`,providerMessageId:i,senderId:g,contextSource:()=>({senderName:n.pushName}),senderAlternateId:typeof c=="string"?c:"",senderIsBot:!1,kind:A?"group":"direct",conversationId:a,content:Ile(p),plainText:typeof p?.conversation=="string"||typeof p?.extendedTextMessage?.text=="string",images:y?[y]:[],files:m?[m]:[],...T?{replyTo:T}:{},addressed:!A||r||f||Q,selfChat:s,replyTarget:{jid:a,quoted:n,selfChat:s},reactionTarget:{jid:a,key:n.key}}}var KK=class{#e=new Map;has(t){return this.#t(),this.#e.has(t)}remember(t){this.#A(t)}reserve(t){this.#A(t)}#A(t){if(!(typeof t!="string"||!t))for(this.#t(),this.#e.set(t,Date.now()+5*6e4);this.#e.size>256;)this.#e.delete(this.#e.keys().next().value)}#t(){let t=Date.now();for(let[o,a]of this.#e)a>t||this.#e.delete(o)}};function ple(n){return n?.reason??new DOMException("The operation was aborted.","AbortError")}function cle(n,t){return t?(t.throwIfAborted(),new Promise((o,a)=>{let e=!1,i=(r,s)=>{e||(e=!0,t.removeEventListener("abort",A),r(s))},A=()=>i(a,ple(t));t.addEventListener("abort",A,{once:!0}),Promise.resolve(n).then(r=>i(o,r),r=>i(a,r)),t.aborted&&A()})):n}function I7e(n){if(n?.code==="artifact-delivery-uncertain")return n;let t=new Error("WhatsApp could not confirm artifact delivery.");return t.code="artifact-delivery-uncertain",t.cause=n,t}function l7e(n){if(n?.code?.startsWith?.("artifact-"))return n;let t=n?.output?.statusCode??n?.data?.statusCode??n?.statusCode,o;if(t===401||t===403?o="artifact-permission-required":t===413?o="artifact-too-large":t===429?o="artifact-rate-limited":[400,404,405,406,410,415,422].includes(t)&&(o="artifact-provider-rejected"),!o)return I7e(n);let a=new Error("WhatsApp rejected artifact delivery.");return a.code=o,a.cause=n,a}var xK=class{#e;#A;#t;#r;#I=new Map;constructor(t,o,{signal:a,mediaUploadTimeoutMs:e=HK}={}){this.#e=t,this.#A=o,this.#t=a,this.#r=e}async sendText(t,o){await this.#i(t.jid);let a=[];for(let[e,i]of us(o,4e3).entries()){let A=sle(10).toString("hex").toUpperCase(),r={...e===0&&t.quoted?{quoted:t.quoted}:{},messageId:A};typeof this.#A.reserve=="function"?this.#A.reserve(A):this.#A.remember(A);let s=await this.#e.sendMessage(t.jid,{text:i},r);this.#A.remember(s?.key?.id),typeof s?.key?.id=="string"&&s.key.id&&a.push(s.key.id)}return{providerMessageIds:a}}async sendFile(t,o){return this.#c(t,o,{document:o.bytes,mimetype:o.mediaType??"application/octet-stream",fileName:o.fileName},"file")}async sendImage(t,o){return this.#c(t,o,{image:o.bytes,mimetype:o.mediaType??"image/jpeg"},"image")}async addReaction(t,o,{signal:a}={}){if(typeof o!="string"||!o.trim())throw new TypeError("A WhatsApp reaction emoji is required");let e=o.trim();return await this.#o(t,e,a),e}removeReaction(t,o,{signal:a}={}){return this.#o(t,"",a)}async#o(t,o,a){if(typeof t?.jid!="string"||!t.jid||!t.key?.id)throw new TypeError("A WhatsApp reaction target is required");let e=a??this.#t;e?.throwIfAborted();let i=sle(10).toString("hex").toUpperCase();typeof this.#A.reserve=="function"?this.#A.reserve(i):this.#A.remember(i);let A=this.#e.sendMessage(t.jid,{react:{text:o,key:t.key}},{messageId:i}),r=await cle(A,e);return this.#A.remember(r?.key?.id),r}async#c(t,o,a,e){this.#t?.throwIfAborted(),await this.#i(t.jid),this.#t?.throwIfAborted();let i=typeof o.deliveryKey=="string"&&o.deliveryKey?o.deliveryKey:o.artifactId,A=e==="image"?`${i}:image`:i,r=typeof A=="string"&&A?ZXe("sha256").update(A).digest("hex").slice(0,20).toUpperCase():void 0,s={...t.quoted?{quoted:t.quoted}:{},...r?{messageId:r}:{},mediaUploadTimeoutMs:this.#r};this.#A.remember(r);let g;try{let c=this.#e.sendMessage(t.jid,a,s);wn(o,c);let I=AbortSignal.timeout(this.#r),p=this.#t?AbortSignal.any([this.#t,I]):I;g=await cle(c,p)}catch(c){throw this.#t?.aborted?ple(this.#t):l7e(c)}return this.#t?.throwIfAborted(),this.#A.remember(g?.key?.id),g}async sendTyping(t){!t.selfChat&&t.quoted?.key&&await this.#e.readMessages([t.quoted.key]).catch(()=>{}),await this.#e.sendPresenceUpdate("composing",t.jid),await this.#i(t.jid,!1);let o=setInterval(()=>{this.#e.sendPresenceUpdate("composing",t.jid).catch(()=>{this.#i(t.jid)})},2e4);o.unref?.(),this.#I.set(t.jid,o)}async close(){let t=[...this.#I.keys()];await Promise.allSettled(t.map(o=>this.#i(o)))}async#i(t,o=!0){let a=this.#I.get(t);a&&clearInterval(a),this.#I.delete(t),o&&await this.#e.sendPresenceUpdate("paused",t).catch(()=>{})}};function p7e(){return{startedAt:null,ready:!1,connectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...co()}}var EQ=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g;#l=p7e();#n=null;#h=null;#d=null;#C=null;#u=null;#B=new Map;constructor({config:t,authDir:o,harness:a,state:e,contextEnhancement:i,accessPolicy:A,groupSessionScope:r,logger:s=console,replyTimeoutMs:g=6e5,connectTimeoutMs:c=3e4,mediaUploadTimeoutMs:I=HK,createSession:p=JM}){if(!t||!o||!a||!e||typeof p!="function")throw new TypeError("WhatsappRuntime requires config, auth directory, Harness, state, and session factory");if(this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g,this.#s=c,!Number.isSafeInteger(I)||I<=0)throw new TypeError("mediaUploadTimeoutMs must be a positive safe integer");this.#p=Math.min(I,HK),this.#g=p}get status(){return structuredClone(this.#l)}async start(){return this.#l.ready&&this.#h?this.status:this.#u?this.#u:(this.#u=this.#f().finally(()=>{this.#u=null}),this.#u)}async#f(){await this.stop(),this.#l.startedAt=new Date().toISOString(),this.#l.connectionState="connecting",this.#l.lastError=null,await this.#t.ensureRunning(),this.#l.harnessReachable=!0;let t=new AbortController;this.#n=t;let o=new KK,a,e=new Promise((i,A)=>{a=A});e.catch(()=>{});try{let i=await this.#g({authDir:this.#A,signal:t.signal,logger:this.#i,onQr:()=>a(Object.assign(new Error("WhatsApp linked-device session must be scanned again"),{code:"relink-required"})),onMessage:async(c,I)=>{let p=c7e(c,this.#e.accountJid,{download:g7e({socket:I?.socket,logger:this.#i})}),B=await ale(p,c,{accountJid:this.#e.accountJid,socket:I?.socket??this.#h?.socket,lidPnCache:this.#B});!B||o.has(B.providerMessageId)||!this.#C||(this.#l.lastCheckedAt=Date.now(),await this.#C.accept(B))},onDisconnect:({error:c})=>{t.signal.aborted||(this.#l.ready=!1,this.#l.connectionState="failed",this.#l.lastError=c?.message??"WhatsApp Web connection closed")}});this.#h=i;let A,r=await Promise.race([i.ready,e,new Promise((c,I)=>{A=setTimeout(()=>I(new Error("WhatsApp Web did not connect in time")),this.#s)})]).finally(()=>clearTimeout(A));if(!Dt(r.accountJid,this.#e.accountJid))throw new Error("WhatsApp linked account does not match the saved bot");let s=new xK(i.socket,o,{signal:t.signal,mediaUploadTimeoutMs:this.#p});this.#d=s,this.#C=new jM({bot:s,harness:this.#t,state:this.#r,contextEnhancement:this.#I,accessPolicy:this.#o?{botId:this.#o.botId,getSettings:(...c)=>this.#o.getSettings(...c),...typeof this.#o.isPrivileged=="function"?{isPrivileged:(...c)=>this.#o.isPrivileged(...c)}:{},equals:YK}:void 0,groupSessionScope:this.#c,status:this.#l,logger:this.#i,replyTimeoutMs:this.#a,signal:t.signal});let g=Date.now();return this.#l.ready=!0,this.#l.connectionState="connected",this.#l.lastCheckedAt=g,this.#l.lastConnectedAt=g,this.status}catch(i){throw this.#l.ready=!1,this.#l.connectionState="failed",this.#l.lastError=i?.message??String(i),await this.stop(),i}}async logout(){return await this.#h?.logout().catch(()=>{}),this.stop()}async sendConnectionTest(t){if(!this.#l.ready||!this.#d){let o=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw o.code="test-target-unavailable",o}if(typeof t!="string"||!t.trim())throw new TypeError("WhatsApp connection test text is required");return await this.#d.sendText({jid:this.#e.accountJid,selfChat:!0},t),{sent:!0}}async sendProactiveText(t,o,{signal:a}={}){let e=typeof t?.route?.jid=="string"?t.route.jid.trim():"",i=t?.kind==="user"&&/^[^@\s]+@(s\.whatsapp\.net|lid)$/.test(e),A=t?.kind==="group"&&/^[^@\s]+@g\.us$/.test(e);if(!i&&!A){let r=new TypeError("Invalid WhatsApp proactive delivery target");throw r.code="invalid-target",r}if(!this.#l.ready||!this.#d){let r=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return a?.throwIfAborted(),this.#d.sendText({jid:e},o)}async stop(){let t=this.#h,o=this.#d,a=this.#C;return this.#n?.abort(),this.#n=null,this.#h=null,this.#d=null,this.#C=null,await o?.close().catch(()=>{}),await t?.close().catch(()=>{}),await Promise.race([a?.waitForIdle()??Promise.resolve(),new Promise(e=>setTimeout(e,2e3))]),this.#l.ready=!1,this.#l.connectionState="idle",this.status}};var u7e=/^[a-f0-9-]{36}$/;function C7e(n){let t=dc(n.dshHome??process.env.DSH_HOME??jE(E7e(),".dsh")),o=dc(n.dataDir??jE(t,"integrations","dsh-whatsapp")),a=dc(n.authDir??jE(o,"auth")),e=i=>{if(!u7e.test(i??""))throw new TypeError("Invalid WhatsApp auth directory");return dc(a,i)};return{config:dc(n.configPath??jE(o,"config.json")),bots:dc(n.botsDir??jE(o,"bots")),workspaces:dc(n.workspacesPath??jE(o,"workspaces.json")),authPath:e}}async function jK(n,t={},o={}){let a=si(n,t),e=typeof n.logger=="function"?n.logger("dsh-im:whatsapp"):n.logger??console,i=()=>xi(n),A=o.ConfigStore??oD,r=o.StateStore??gD,s=o.HarnessClient??sD,g=o.Controller??TB,c=o.Runtime??EQ,I=o.createSession??JM,p=o.createConnectionSupervisor??od,B=C7e(t),f=await new A(B.config).load(),Q=dc(t.workspace??process.cwd()),y=o.WorkspaceStore??ni,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(k=>k.botId)),await Promise.all(T.map(k=>m.ensure(k.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("whatsapp",k)})));let _=typeof f.remove=="function"?Yi(f,{workspaces:m}):f,R=new Map,L=k=>dc(B.bots,k,"state.json"),U=async k=>{let J=R.get(k);return J||(J=await new r(L(k)).load(),R.set(k,J)),J},F=zi(n,o.commandExecutor),{controlExecutor:q,sessionMaintenanceExecutor:z,fileIngressExecutor:K}=Vi(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),G=new s({...a,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...F?{commandExecutor:F}:{},...q?{controlExecutor:q}:{},...z?{sessionMaintenanceExecutor:z}:{},...K?{fileIngressExecutor:K}:{}}),V=new g({configStore:_,authPath:B.authPath,createSession:I,logger:e,createRuntime:async({botId:k,config:J,authDir:X})=>{let ie=await U(k);await m.ensure(k,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("whatsapp",J)});let De=ji(G,{botId:k,workspaces:m,state:ie,agentPresetCatalog:i});return new c({config:J,authDir:X,harness:De.harness,state:De.state,contextEnhancement:{botId:k,getSettings:()=>m.contextEnhancementFor(k)},accessPolicy:Wi(m,k,{channel:"whatsapp",config:J,equals:YK}),groupSessionScope:{getScope:()=>m.groupSessionScopeFor(k)},replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??3e4,createSession:I,logger:{error:(...oe)=>e.error?.(`[${k}]`,...oe),warn:(...oe)=>e.warn?.(`[${k}]`,...oe),info:(...oe)=>e.info?.(`[${k}]`,...oe),debug:(...oe)=>e.debug?.(`[${k}]`,...oe)}})},deleteAuth:k=>d7e(B.authPath(k),{recursive:!0,force:!0}),deleteState:async({botId:k})=>{let J=R.get(k);if(R.delete(k),J&&typeof J.remove=="function")await J.remove();else try{await h7e(L(k))}catch(X){if(X?.code!=="ENOENT")throw X}}}),H=Ji(V,{workspaces:m,stateFor:U,agentPresetCatalog:i}),N=p({channel:"whatsapp",controller:H,harness:G,logger:e,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:H,deliveryAdapter:qi({channel:"whatsapp",workspaces:m,coreController:V,stateFor:U}),ready:N.ready,async close(){await N.close(),await H.close(),G.stopManagedProcess()}}}import B7e from"qrcode";var dle="/whatsapp",Br=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setAccessPolicy:Xi,setGroupSessionScope:ea,setWorkspace:La,setAgentPreset:Ua,setContextEnhancement:Fa}),hle=Object.freeze(Object.values(Br)),f7e=new Set(["qrValue","accountJid","authDirectory"]);function zK(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function qM(n,t){return zK(n)&&Object.keys(n).every(o=>t.includes(o))}function JK(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function Q7e(n,t){return zK(t)?[Br.status,Br.beginProvisioning].includes(n)?qM(t,[])?null:`${n} does not accept fields.`:[Br.pollProvisioning,Br.cancelProvisioning].includes(n)?qM(t,["attemptId"])&&JK(t.attemptId)?null:`${n} requires an attemptId.`:n===Br.reconnectBot?qM(t,["botId","sendTest"])&&JK(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"bot.reconnect requires a botId and optional sendTest flag.":n===Br.deleteBot?qM(t,["botId","confirm"])&&JK(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Br.setAccessPolicy?$i(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===Br.setGroupSessionScope?Aa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u7FA4\u4F1A\u8BDD\u7B56\u7565\u3002":n===Br.setWorkspace?ta(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Br.setAgentPreset?ia(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Br.setContextEnhancement?Zi(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":"Unknown WhatsApp endpoint.":"Payload must be an object."}function JE(n){if(Array.isArray(n))return n.map(JE);if(!zK(n))return n;let t={};for(let[o,a]of Object.entries(n))f7e.has(o)||(t[o]=JE(a));return t}async function y7e(n){return B7e.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function qK(n,t){return!n||typeof n.qrValue!="string"?JE(n):JE({...n,qrCodeDataUrl:await t(n.qrValue)})}async function PI(n,t){let o=structuredClone(n);return o?.provisioning&&(o.provisioning=await qK(o.provisioning,t)),JE(o)}function Ele(n,{encodeQr:t=y7e}={}){for(let e of["status","startProvisioning","registrationStatus","cancelProvisioning","reconnectBot","deleteBot"])if(typeof n?.[e]!="function")throw new TypeError(`A complete WhatsApp controller is required (${e})`);let o=new Map,a=e=>{let i=o.get(e);return i||(o.size>=16&&o.delete(o.keys().next().value),i=Promise.resolve().then(()=>t(e)),o.set(e,i)),i};return async(e,i,A)=>{if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!hle.includes(e))return{ok:!1,error:{code:"bad-request",message:"Unknown WhatsApp endpoint."}};let r=Q7e(e,i);if(r)return{ok:!1,error:{code:"bad-request",message:r}};try{let s;if(e===Br.status)s=await PI(await n.status(),a);else if(e===Br.beginProvisioning)s=await qK(await n.startProvisioning(),a);else if(e===Br.pollProvisioning){let g=await n.registrationStatus(i.attemptId);if(!g)return{ok:!1,error:{code:"bad-request",message:"The provisioning attempt no longer exists."}};s=await qK(g,a)}else if(e===Br.cancelProvisioning)s=JE(await n.cancelProvisioning(i.attemptId));else if(e===Br.reconnectBot){let g=await n.reconnectBot(i.botId);if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(s=await PI(g,a),i.sendTest===!0){let c=null;if(!(g?.bots?.some(p=>p?.botId===i.botId&&p.connected===!0)===!0))c=new Error("WhatsApp bot is not connected"),c.code="test-target-unavailable";else try{if(typeof n.sendConnectionTest!="function"){let p=new Error("Connection test is unavailable");throw p.code="test-target-unavailable",p}await n.sendConnectionTest(i.botId)}catch(p){c=p}s={...s,testMessage:lr(c)}}}else if(e===Br.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await PI(await n.updateWorkspace(i.botId,i.workspace),a)}else if(e===Br.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(i.botId,i.config,g=>PI(g,a))}else if(e===Br.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await PI(await n.updateAgentPreset(i.botId,i.agentPreset),a)}else if(e===Br.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(i.botId,i.policy,g=>PI(g,a))}else if(e===Br.setGroupSessionScope){if(typeof n.updateGroupSessionScope!="function")throw new Error("Group session scope update is unavailable");s=await n.updateGroupSessionScope(i.botId,i.groupSessionScope,g=>PI(g,a))}else s=await PI(await n.deleteBot(i.botId),a);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:s}}catch(s){let g=ra(s);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:g??{code:"whatsapp-operation-failed",message:"WhatsApp \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}}}function zM(n,t,o,a){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(dle,Ele(t,o),{authority:mr(a)})}async function ule(n,t={}){if(t?.controller)return zM(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await jK(n,t,t.internals??{}),a=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=zM(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await a?.(),await o.close()},"dsh-im: close WhatsApp Web connections"),e}var m7e="/dsh-im-delivery",S7e="DSH-IM \u4E3B\u52A8\u6295\u9012\u6D4B\u8BD5\u6210\u529F\u3002",Oa=Object.freeze({send:"message.send",listTargets:"target.list",listSuggestions:"target.suggestion.list",createTarget:"target.create",updateTarget:"target.update",deleteTarget:"target.delete",testTarget:"target.test"}),w7e=new Set(Object.values(Oa)),D7e=new Set(["bad-request","unknown-bot","unknown-target","target-conflict","invalid-target","bot-not-connected","target-rejected","delivery-failed","cancelled"]);function CQ(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function GI(n,t){return CQ(n)&&Object.keys(n).length===t.length&&Object.keys(n).every(o=>t.includes(o))}function Mp(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function uQ(n){return typeof n=="string"&&/^[A-Za-z0-9._:@-]{1,128}$/.test(n)}function Cle(n,{targetId:t}){let o=t?["targetId","name","kind","route"]:["name","kind","route"];return!CQ(n)||Object.keys(n).some(a=>!o.includes(a))||t&&!uQ(n.targetId)||n.name!==void 0&&(typeof n.name!="string"||!n.name.trim()||n.name.trim().length>80)?!1:typeof n.kind=="string"&&/^[a-z][a-z0-9-]{0,31}$/.test(n.kind)&&CQ(n.route)}function O7e(n){return GI(n,["kind","route"])&&typeof n.kind=="string"&&/^[a-z][a-z0-9-]{0,31}$/.test(n.kind)&&CQ(n.route)}function b7e(n,t){return!w7e.has(n)||!CQ(t)?!1:n===Oa.send?GI(t,["botId","targetId","text"])&&Mp(t.botId)&&uQ(t.targetId)&&typeof t.text=="string"&&!!t.text.trim():n===Oa.listTargets||n===Oa.listSuggestions?GI(t,["botId"])&&Mp(t.botId):n===Oa.createTarget?GI(t,["botId","target"])&&Mp(t.botId)&&Cle(t.target,{targetId:!0}):n===Oa.updateTarget?GI(t,["botId","targetId","target"])&&Mp(t.botId)&&uQ(t.targetId)&&Cle(t.target,{targetId:!1}):n===Oa.testTarget?GI(t,["botId","targetId"])&&Mp(t.botId)&&uQ(t.targetId)||GI(t,["botId","target"])&&Mp(t.botId)&&O7e(t.target):GI(t,["botId","targetId"])&&Mp(t.botId)&&uQ(t.targetId)}function M7e(n){let t=D7e.has(n?.code)?n.code:"delivery-failed";return{code:t,message:t,details:{}}}function VK(n){for(let t of["send","listTargets","listSuggestions","createTarget","updateTarget","deleteTarget"])if(typeof n?.[t]!="function")throw new TypeError(`A complete delivery service is required (${t})`);return async(t,o,a)=>{if(!b7e(t,o))return{ok:!1,error:{code:"bad-request",message:"Invalid delivery request.",details:{}}};if(a?.aborted)return{ok:!1,error:{code:"cancelled",message:"cancelled",details:{}}};try{let e;return t===Oa.send?e=await n.send(o.botId,o.targetId,o.text,{signal:a}):t===Oa.listTargets?e=await n.listTargets(o.botId):t===Oa.listSuggestions?e=await n.listSuggestions(o.botId):t===Oa.createTarget?e=await n.createTarget(o.botId,o.target):t===Oa.updateTarget?e=await n.updateTarget(o.botId,o.targetId,o.target):t===Oa.deleteTarget?e=await n.deleteTarget(o.botId,o.targetId):e=await n.send(o.botId,Object.hasOwn(o,"target")?o.target:o.targetId,S7e,{signal:a}),{ok:!0,value:e}}catch(e){return{ok:!1,error:M7e(e)}}}}function Ble(n,t,{authority:o}={}){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(m7e,VK(t),{authority:mr(o)})}var fle="/api/dsh-im/delivery/messages",Qle=1024*1024,_7e=Object.freeze({"bad-request":400,"unknown-bot":404,"unknown-target":404,"target-conflict":409,"invalid-target":422,"bot-not-connected":503,"target-rejected":422,"delivery-failed":502,cancelled:408}),zE=class extends Error{constructor(t,o){super(o),this.status=t,this.code=o}};function qE(n,t,o,a={}){if(n.destroyed||n.writableEnded)return;let e=JSON.stringify(o);n.writeHead(t,{"cache-control":"no-store","content-type":"application/json; charset=utf-8","content-length":String(Buffer.byteLength(e)),...a}),n.end(e)}function T7e(n){return typeof n=="string"&&n.split(";",1)[0].trim().toLowerCase()==="application/json"}async function N7e(n){let t=Number(n.headers["content-length"]);if(Number.isFinite(t)&&t>Qle)throw new zE(413,"payload-too-large");let o=[],a=0;for await(let e of n){let i=Buffer.isBuffer(e)?e:Buffer.from(e);if(a+=i.length,a>Qle)throw new zE(413,"payload-too-large");o.push(i)}try{return JSON.parse(Buffer.concat(o,a).toString("utf8"))}catch{throw new zE(400,"bad-request")}}function R7e(n){let t=VK(n);return async(o,a)=>{if(o.method!=="POST"){qE(a,405,{error:{code:"method-not-allowed",message:"method-not-allowed",details:{}}},{allow:"POST"});return}if(!T7e(o.headers["content-type"])){qE(a,415,{error:{code:"unsupported-media-type",message:"unsupported-media-type",details:{}}});return}let e=new AbortController,i=()=>e.abort(),A=()=>{a.writableEnded||i()};o.once("aborted",i),a.once("close",A);try{let r=await N7e(o),s=await t(Oa.send,r,e.signal);if(s.ok){qE(a,200,s.value);return}qE(a,_7e[s.error.code]??500,{error:s.error})}catch(r){if(r instanceof zE){qE(a,r.status,{error:{code:r.code,message:r.code,details:{}}});return}qE(a,500,{error:{code:"delivery-failed",message:"delivery-failed",details:{}}})}finally{o.off("aborted",i),a.off("close",A)}}}function yle(n,t){if(!n?.webServer||typeof n.webServer.register!="function"||typeof n.effect!="function")throw new TypeError("DSH Host WebServer is required");let o={kind:"exact",path:fle,handler:R7e(t)};return n.effect(()=>n.webServer.register(o),`dsh-im: ${fle}`)}var k7e=/^[A-Za-z0-9_-]{1,128}$/,v7e=/^[A-Za-z0-9._:@-]{1,128}$/,P7e=/^[a-z][a-z0-9-]{0,31}$/,G7e="__test__",F7e=Object.freeze(["ownsBot","listTargets","listSuggestions","createTarget","updateTarget","deleteTarget","sendText"]),L7e=new Set(["bad-request","unknown-bot","unknown-target","target-conflict","invalid-target","bot-not-connected","target-rejected","delivery-failed","cancelled"]);function Bn(n,t=n,o){let a=new Error(t,o);return a.code=n,a}function VE(n){if(typeof n!="string"||!k7e.test(n))throw Bn("bad-request","Invalid bot id");return n}function VM(n){if(typeof n!="string"||!v7e.test(n))throw Bn("bad-request","Invalid target id");return n}function WK(n,{includesTargetId:t}={}){if(!n||typeof n!="object"||Array.isArray(n))throw Bn("bad-request","Invalid target");if(t)VM(n.targetId);else if(Object.hasOwn(n,"targetId"))throw Bn("bad-request","A target id cannot be changed");return n}function U7e(n){WK(n);let t=Object.keys(n);if(t.length!==2||!t.includes("kind")||!t.includes("route"))throw Bn("bad-request","Invalid draft target");return n}function mle(n){if(n?.aborted)throw Bn("cancelled","Request cancelled")}function _p(n,t="delivery-failed"){return n?.code==="workspace-bot-not-found"?Bn("unknown-bot","Unknown bot",{cause:n}):L7e.has(n?.code)?n:Bn(t,t,{cause:n})}function H7e(n){if(!n||typeof n!="object"||typeof n.channel!="string"||!P7e.test(n.channel))throw new TypeError("A delivery adapter with a valid channel is required");for(let t of F7e)if(typeof n[t]!="function")throw new TypeError(`A complete delivery adapter is required (${t})`);return n}var ZK=class{#e=new Map;registerAdapter(t){let o=H7e(t),a=Object.freeze({adapter:o});return this.#e.set(o.channel,a),()=>this.#e.get(o.channel)!==a?!1:(this.#e.delete(o.channel),!0)}async listTargets(t){let o=VE(t),a=await this.#A(o);try{let e=await a.listTargets(o);if(!Array.isArray(e))throw new TypeError("Adapter returned invalid targets");return{botId:o,channel:a.channel,targets:e}}catch(e){throw _p(e)}}async listSuggestions(t){let o=VE(t),a=await this.#A(o);try{let e=await a.listSuggestions(o);if(!Array.isArray(e))throw new TypeError("Adapter returned invalid suggestions");return{botId:o,channel:a.channel,suggestions:e.map(i=>Ad(a.channel,i,{targetIdRequired:!1}))}}catch(e){throw _p(e)}}async createTarget(t,o){let a=VE(t);WK(o,{includesTargetId:!0});let e=await this.#A(a);try{return await e.createTarget(a,o)}catch(i){throw _p(i)}}async updateTarget(t,o,a){let e=VE(t),i=VM(o);WK(a);let A=await this.#A(e);try{return await A.updateTarget(e,i,a)}catch(r){throw _p(r)}}async deleteTarget(t,o){let a=VE(t),e=VM(o),i=await this.#A(a);try{return await i.deleteTarget(a,e),{deleted:!0}}catch(A){throw _p(A)}}async send(t,o,a,{signal:e}={}){let i=VE(t),A=typeof o=="string"?VM(o):null,r=A===null?U7e(o):null;if(typeof a!="string"||!a.trim())throw Bn("bad-request","Message text is required");mle(e);let s=await this.#A(i);try{let g;if(r)g={targetId:G7e,...r};else{let c=await s.listTargets(i);if(!Array.isArray(c))throw new TypeError("Adapter returned invalid targets");if(g=c.find(I=>I?.targetId===A),!g)throw Bn("unknown-target","Unknown target")}return mle(e),await s.sendText(i,g,a,{signal:e}),{sent:!0}}catch(g){throw e?.aborted||g?.name==="AbortError"||g?.code==="ABORT_ERR"?Bn("cancelled","Request cancelled",{cause:g}):_p(g)}}async#A(t){for(let{adapter:o}of this.#e.values()){let a;try{a=await o.ownsBot(t)}catch(e){throw _p(e)}if(a)return o}throw Bn("unknown-bot","Unknown bot")}};function Sle(){return new ZK}var BQ=ze(gO(),1);import{createHash as K7e}from"node:crypto";import{readFile as Ole,realpath as is,stat as x7e}from"node:fs/promises";import{homedir as Y7e}from"node:os";import{basename as j7e,dirname as $K,isAbsolute as tx,join as hc,relative as J7e,resolve as ZM,sep as q7e}from"node:path";import{fileURLToPath as z7e}from"node:url";var FI="dsh-im-ops",fQ="https://registry.npmjs.org/",V7e=15*6e4,W7e=1e4,wle=16*1024;function as(n,t={}){return Object.assign(new Error(n),{code:n,...t})}function WM(n,t){return typeof n?.get=="function"?n.get(t):n?.[t]}function ex(n,t){let o=J7e(n,t);return o!==".."&&!o.startsWith(`..${q7e}`)&&!tx(o)}async function Z7e(n){try{return await Ole(n,"utf8")}catch(t){if(t.code==="ENOENT")return"";throw t}}async function Ax(n){let t=await Ole(hc(n,"package.json"),"utf8");return{directory:await is(n),manifest:JSON.parse(t),contents:t}}async function XK(n,t){let o=$K(await is(n));for(;;){try{let e=await Ax(o);return e.manifest?.name===t?e:null}catch(e){if(e.code!=="ENOENT")throw e}let a=$K(o);if(a===o)return null;o=a}}function X7e(n){return typeof n=="string"&&n.length>0&&Buffer.byteLength(n)<=255&&!n.startsWith("-")&&![".","..","node_modules"].includes(n)&&!/[\\/\x00-\x1f\x7f<>:"|?*]/u.test(n)}function $7e(n){if(n[0]==="web")return"web";let t;for(let o=0;o0&&(BQ.default.validRange(n)!==null||/^[A-Za-z][A-Za-z0-9._-]*$/u.test(n))}async function t$e(n){if(n.manifest?.name!==FI||BQ.default.valid(n.manifest.version)===null)return!1;let t=[n.manifest.main,n.manifest.exports?.["./client"],n.manifest.dsh?.bundle?.patch];for(let o of t){if(typeof o!="string"||!o||tx(o)||o.includes("\0"))return!1;let a=ZM(n.directory,o);if(!ex(n.directory,a)||!ex(n.directory,await is(a))||!(await x7e(a)).isFile())return!1}return!0}function r$e(n){if(n==null||n==="")return!0;if(typeof n!="string")return!1;try{return new URL(n).href===fQ}catch{return!1}}async function Dle(n,{signal:t,timeoutMs:o,errorCode:a,capture:e=!1}){if(t?.aborted)throw as("install-interrupted");let i=new AbortController,A,r,s=B=>{A??=B,i.abort(),r?.cancel?.()},g=()=>s("install-interrupted");t?.addEventListener("abort",g,{once:!0});let c=setTimeout(()=>s("install-timeout"),o),I="",p="";try{r=n(i.signal),r.stdout?.on("data",f=>{e&&(I=(I+f.toString()).slice(-wle))}),r.stderr?.on("data",f=>{p=(p+f.toString()).slice(-wle)}),r.stdout?.on("error",()=>s(a)),r.stderr?.on("error",()=>s(a));let B=await r.done;if(A)throw as(A);if(B.exitCode!==0||B.signal)throw as(a,{exitCode:B.exitCode,diagnosticCode:p.match(/\bERR_PNPM_[A-Z0-9_]+\b/u)?.[0]});return{exitCode:0,signal:null,...e?{stdout:I}:{}}}catch(B){throw A?as(A):B.code===a?B:as(a)}finally{clearTimeout(c),t?.removeEventListener("abort",g)}}function ble(n={}){let t=n.ctx,o=n.env??process.env,a=n.argv??process.argv,e=n.execArgv??process.execArgv,i=n.execPath??process.execPath,A=n.cwd??process.cwd(),r=n.platform??process.platform,s=n.osHome??Y7e(),g=n.electron??process.versions.electron,c=n.moduleUrl??import.meta.url,I=XK(z7e(c),FI).catch(()=>null),p;async function B(){let T=WM(t,"desktopProfiles"),_=WM(t,"desktopPnpm"),R=WM(t,"desktopPnpmBootstrap"),L=!!(g||T||_||R),U=T?.current,F=L?U?.name:$7e(a.slice(2)),q=L&&R?.homeDir?ZM(R.homeDir):e$e(o,s),z={environmentKind:L?"desktop":"cli",homeDir:q,profileName:F};if(!X7e(F))return{...z,blockedReason:"unknown-profile"};let K=await is(hc(q,"profiles",F)),G=await is(q),V={...z,homeDir:G,profileDir:K};if(L)try{if(typeof _?.runPlugin!="function"||typeof _?.run!="function"||!R||!U?.dir||R.activeProfileName!==F||await is(U.dir)!==K||await is(R.activeProfileDir)!==K||await is(R.appExecutable)!==await is(i))return{...V,blockedReason:"executor-unavailable"};let N=await XK(R.dshBootstrapPath,"dsh-plugin-desktop");return!N||j7e(R.dshBootstrapPath)!=="desktop-cli.js"||$K(await is(R.dshBootstrapPath))!==hc(N.directory,"lib")?{...V,blockedReason:"executor-unavailable"}:{...V,desktop:_,executable:i,cliEntry:R.dshBootstrapPath}}catch{return{...V,blockedReason:"executor-unavailable"}}let H=WM(t,"subprocess");if(typeof H?.spawn!="function"||typeof a[1]!="string"||!tx(a[1])||r==="win32")return{...V,blockedReason:"executor-unavailable"};try{let N=await XK(a[1],"@deepseek-ai/dsh");if(!N)return{...V,blockedReason:"executor-unavailable"};let k=await is(a[1]),J=typeof N.manifest.bin=="string"?N.manifest.bin:N.manifest.bin?.dsh,X=typeof J=="string"?ZM(N.directory,J):"";return k!==X&&k!==hc(N.directory,"src","bin.ts")?{...V,blockedReason:"executor-unavailable"}:{...V,subprocess:H,executable:i,cliEntry:k}}catch{return{...V,blockedReason:"executor-unavailable"}}}function f(T,_,R,L=!1){let U=T.subprocess.spawn({argv:L?["pnpm",..._]:[i,...e,T.cliEntry,..._],cwd:L?T.profileDir:A,env:{DSH_HOME:T.homeDir,CI:"true"},stdio:{stdin:"ignore",stdout:"pipe",stderr:"pipe"},graceMs:3e3,signal:R});return{stdout:U.stdout,stderr:U.stderr,cancel:()=>U.terminate(),done:(async()=>{try{return await U.done}finally{await U.waitForExit()}})()}}async function Q(T,_){let R=["config","get","@xmanrui:registry","--json"],U=(await Dle(q=>T.desktop?T.desktop.run(R,q):f(T,R,q,!0),{signal:_,timeoutMs:n.configTimeoutMs??W7e,errorCode:"registry-check-failed",capture:!0})).stdout.trim(),F;try{F=U===""||U==="undefined"?void 0:JSON.parse(U)}catch{throw as("registry-check-failed")}if(!r$e(F))throw as("registry-conflict")}async function y({preflight:T=!1}={}){let _,R={installedVersion:null,packageValid:!1,eligible:!1,installationKey:null};try{_=await B();for(let G of["homeDir","profileDir","profileName","environmentKind","executable","cliEntry"])R[G]=_[G]??null;if(!_.profileDir)return{...R,blockedReason:_.blockedReason??"unknown-profile"};let L=await Ax(_.profileDir),U=await Ax(hc(_.profileDir,"node_modules",FI));R.sourceInstall=!A$e(L.manifest.dependencies?.[FI])||!ex(hc(_.profileDir,"node_modules"),U.directory),R.installedVersion=typeof U.manifest.version=="string"?U.manifest.version:null,R.packageValid=await t$e(U);let F=await I,q=`${_.homeDir}\0${_.profileDir}\0${_.profileName}`,z=F?.directory===U.directory&&F?.manifest.version===U.manifest.version;p===void 0&&z&&R.packageValid&&(p=q);let K=await Promise.all(["pnpm-lock.yaml","pnpm-workspace.yaml","package-lock.json"].map(G=>Z7e(hc(_.profileDir,G))));return R.installationKey=K7e("sha256").update(JSON.stringify([q,L.contents,U.directory,U.contents,_.cliEntry,_.executable,...K])).digest("hex"),p!==void 0&&p!==q||!z&&p===void 0?R.blockedReason="installation-changed":R.packageValid?R.sourceInstall?R.blockedReason="source-install":_.blockedReason?R.blockedReason=_.blockedReason:z?T&&await Q(_):R.blockedReason="pending-restart":R.blockedReason="invalid-installation",R.eligible=!R.blockedReason,{...R,blockedReason:R.blockedReason??null}}catch(L){return{...R,blockedReason:["registry-conflict","registry-check-failed","install-timeout","install-interrupted"].includes(L.code)?L.code:_?.profileDir?"invalid-installation":"unknown-profile"}}}async function m(T,{signal:_,expectedInstallationKey:R}={}){if(BQ.default.valid(T)!==T||BQ.default.prerelease(T))throw as("invalid-version");let L=await y();if(R!==void 0&&L.installationKey!==R)throw as("installation-changed");if(!L.eligible)throw as(L.blockedReason);let U=await B();await Q(U,_);let F=await y();if(!F.eligible||F.installationKey!==L.installationKey)throw as("installation-changed");let q=["add","-w","--save-exact",`${FI}@${T}`,`--registry=${fQ}`];return Dle(z=>U.desktop?U.desktop.runPlugin(q,U.profileDir,z):f(U,["plugin","--profile",U.profileName,...q],z),{signal:_,timeoutMs:n.installTimeoutMs??V7e,errorCode:"install-failed"})}return Object.freeze({inspect:y,install:m})}var LI=ze(gO(),1);import{createHash as i$e,randomUUID as ix}from"node:crypto";import{mkdir as a$e,open as o$e,readFile as Rle,rename as n$e,stat as kle,unlink as vle,writeFile as s$e}from"node:fs/promises";import{isAbsolute as Mle,join as yQ}from"node:path";var mQ=new Set(["installing","verifying"]),g$e=new Set([...mQ,"restart-required","completed","failed","interrupted"]),_le=256*1024,c$e=["package.json","pnpm-lock.yaml","pnpm-workspace.yaml"],XM=Symbol("no update lock");function _t(n){return Object.assign(new Error(n),{code:n})}async function Tle(n=globalThis.fetch,t=1e4){let o;try{if(o=await n(`${fQ}${encodeURIComponent(FI)}/latest`,{headers:{accept:"application/json"},redirect:"error",signal:AbortSignal.timeout(t)}),!o.ok)throw _t("check-failed");if(Number(o.headers.get("content-length"))>_le)throw _t("invalid-release");let a=[],e=0;for await(let c of o.body){if(e+=c.byteLength,e>_le)throw _t("invalid-release");a.push(Buffer.from(c))}let i=JSON.parse(Buffer.concat(a).toString("utf8")),A=i.version;if(i.name!==FI||typeof A!="string"||LI.default.valid(A)!==A||LI.default.prerelease(A))throw _t("invalid-release");let r=i.engines?.node;if(r!==void 0&&(typeof r!="string"||!LI.default.validRange(r)))throw _t("invalid-release");let s=new URL(i.dist?.tarball),g=i.dist?.integrity;if(s.origin!==new URL(fQ).origin||s.username||s.password||s.search||s.hash||s.pathname!==`/dsh-im-ops/-/dsh-im-${A}.tgz`||typeof g!="string"||!/^sha512-[A-Za-z0-9+/]{86}==$/.test(g))throw _t("invalid-release");return{version:A,nodeRange:r??"*",integrity:g,tarball:s.href}}catch(a){throw a?.code==="invalid-release"||a instanceof SyntaxError||a instanceof TypeError&&o?.ok?_t("invalid-release"):_t("check-failed")}}function Nle(n){if(!Mle(n.homeDir??"")||!Mle(n.profileDir??""))return null;let t=i$e("sha256").update(n.profileDir).digest("hex").slice(0,24),o=yQ(n.homeDir,"updates","dsh-im",t);return{directory:o,state:yQ(o,"state.json"),lock:yQ(o,"install.lock"),backup:yQ(o,"before.json")}}async function rx(n,t=null){try{if((await kle(n)).size>10*1024*1024)throw _t("state-unavailable");return JSON.parse(await Rle(n,"utf8"))}catch(o){if(o.code==="ENOENT")return t;throw _t("state-unavailable")}}async function QQ(n,t){let o=`${n}.${ix()}.tmp`;try{await s$e(o,`${JSON.stringify(t,null,2)} -`,{mode:384,flag:"wx"}),await n$e(o,n)}catch{throw _t("state-unavailable")}finally{await vle(o).catch(a=>{if(a.code!=="ENOENT")throw _t("state-unavailable")})}}function I$e(n){if(!Number.isSafeInteger(n)||n<=0)return!1;try{return process.kill(n,0),!0}catch(t){return t.code!=="ESRCH"}}function l$e(n){if(!n)return null;let{id:t,state:o,targetVersion:a,message:e}=n;return{id:t,state:o,targetVersion:a,message:e}}function Ple({runtime:n,runningVersion:t=HQ.version,nodeVersion:o=process.versions.node,fetchImpl:a=globalThis.fetch,now:e=Date.now,checkTimeoutMs:i=1e4,confirmationTtlMs:A=10*6e4,installTimeoutMs:r=15*6e4}={}){let s={},g=null,c=null,I=-1/0,p=null,B=null,f=null,Q=null,y=!1;function m(){if(y)throw _t("disposed")}async function T(V){let H=Nle(V);if(!H)return null;if(Q?.statePath===H.state)return Q.job;let N=await rx(H.state),k=await rx(H.lock,XM);if(!N)return k!==XM?{id:"locked",state:"interrupted",message:"recovery-required",targetVersion:null}:null;if(!g$e.has(N.state)||typeof N.id!="string"||!LI.default.valid(N.targetVersion))throw _t("state-unavailable");if(mQ.has(N.state)&&N.id!==p?.id&&(k===XM||k?.id!==N.id||!I$e(k?.pid))&&(N={...N,state:"interrupted",message:"recovery-required"}),N.id!==p?.id&&!mQ.has(N.state)){if(k!==XM)return{...N,state:"interrupted",message:"recovery-required"};if(["failed","interrupted"].includes(N.state)&&V.packageValid===!0&&V.installedVersion===t&&!V.blockedReason)return N.targetVersion===t?{...N,state:"completed",message:"recovered"}:{...N,recoverable:!0}}return N.state==="restart-required"||N.state==="completed"?V.installedVersion!==N.targetVersion||V.packageValid!==!0?{...N,state:"interrupted",message:"installation-changed"}:{...N,state:t===N.targetVersion?"completed":"restart-required"}:N}function _(V,H){let N=V.blockedReason??g?.blockedReason??null;H?.state==="interrupted"&&!H.recoverable||H?.state==="failed"&&V.installedVersion!==t?N="recovery-required":(H?.state==="restart-required"||V.installedVersion&&V.installedVersion!==t)&&(N="pending-restart");let k=mQ.has(H?.state),J=!!(V.eligible&&!N&&!k&&g?.checkId&&e(){try{let V=await n.inspect({preflight:!0}),H=await Tle(a,i);return m(),g={release:H,checkId:ix(),checkedAt:e(),expiresAt:e()+A,installationKey:V.installationKey,profileDir:V.profileDir,blockedReason:V.blockedReason??(LI.default.satisfies(o,H.nodeRange)?null:"incompatible-node")},_(V,await T(V))}catch(V){throw g&&(g={...g,checkId:null,expiresAt:0}),V}finally{c=null}})(),c))}async function U(V,H){(await rx(V.lock))?.id===H&&await vle(V.lock)}async function F(V,H,N){let k={};for(let J of c$e)try{let X=yQ(V.profileDir,J);if((await kle(X)).size>3*1024*1024)throw _t("state-unavailable");k[J]=await Rle(X,"utf8")}catch(X){if(X.code!=="ENOENT")throw _t("state-unavailable")}await QQ(H.backup,{jobId:N.id,previousVersion:N.previousVersion,files:k})}function q(V){p={...p,state:"interrupted",message:"state-unavailable"},Q={statePath:V.state,job:p}}async function z(V,H,N){let k=AbortSignal.timeout(r);try{if(await n.install(H.targetVersion,{signal:AbortSignal.any([f.signal,k]),expectedInstallationKey:N.installationKey}),y)throw _t("interrupted");p={...p,state:"verifying",updatedAt:e()},await QQ(V.state,p);let J=await n.inspect();if(J.homeDir!==N.homeDir||J.profileDir!==N.profileDir||J.profileName!==N.profileName||J.blockedReason==="installation-changed")throw _t("installation-changed");if(J.installedVersion!==H.targetVersion||J.packageValid!==!0||J.blockedReason&&J.blockedReason!=="pending-restart")throw _t("verify-failed");p={...p,state:"restart-required",message:null,updatedAt:e()},await QQ(V.state,p)}catch(J){let X=k.aborted||J.code==="install-timeout",ie=y||f.signal.aborted||!X&&["interrupted","install-interrupted"].includes(J.code);p={...p,state:ie?"interrupted":"failed",message:ie?"interrupted":X?"install-timeout":["verify-failed","state-unavailable","installation-changed","registry-conflict"].includes(J.code)?J.code:"install-failed",updatedAt:e()};try{await QQ(V.state,p)}catch{q(V);return}}await U(V,H.id)}function K({checkId:V,requestId:H}){return Ig(s,"install",async()=>{m();let N=await n.inspect({preflight:!0}),k=await T(N);if(k?.requestId===H)return _(N,k);if(mQ.has(k?.state)||k?.state==="restart-required")throw _t("update-busy");let J=g;if(!J||!V||J.checkId!==V||e()>=J.expiresAt)throw _t("check-expired");if(N.profileDir!==J.profileDir||N.installationKey!==J.installationKey)throw _t("installation-changed");if(!_(N,k).canInstall)throw _t(N.blockedReason??"update-busy");let X=Nle(N);if(!X)throw _t("state-unavailable");let ie={id:ix(),requestId:H,state:"installing",message:null,targetVersion:J.release.version,previousVersion:N.installedVersion,startedAt:e(),updatedAt:e()},De=!1;try{await a$e(X.directory,{recursive:!0,mode:448});let oe=await o$e(X.lock,"wx",384);De=!0;try{await oe.writeFile(JSON.stringify({id:ie.id,pid:process.pid,startedAt:e()}))}finally{await oe.close()}let Se=await Tle(a,i);if(JSON.stringify(Se)!==JSON.stringify(J.release))throw _t("check-expired");if(N=await n.inspect({preflight:!0}),N.profileDir!==J.profileDir||N.installationKey!==J.installationKey)throw _t("installation-changed");if(!N.eligible||N.blockedReason)throw _t(N.blockedReason??"update-busy");m(),await F(N,X,ie),await QQ(X.state,ie),m()}catch(oe){throw De&&await U(X,ie.id),oe.code==="EEXIST"?_t("update-busy"):oe.code?.startsWith("E")?_t("state-unavailable"):oe}return p=ie,f=new AbortController,B=z(X,ie,N).catch(()=>{q(X)}),_(N,ie)})}async function G(){y=!0,f?.abort(),B&&await B}return Object.freeze({status:R,check:L,install:K,close:G})}var p$e="/dsh-im",d$e=Object.freeze(["update.status","update.check","update.install"]);function h$e(n,t){if(t===null||typeof t!="object"||Array.isArray(t))return!1;let o=Object.keys(t);return n!=="update.install"?o.length===0:o.length===2&&o.every(a=>a==="checkId"||a==="requestId")&&["checkId","requestId"].every(a=>typeof t[a]=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(t[a]))}var E$e=new Set(["check-failed","invalid-release","check-expired","installation-changed","update-busy","install-failed","verify-failed","state-unavailable","interrupted","disposed","source-install","unknown-profile","unsupported-runtime","registry-conflict","incompatible-node","pending-restart","recovery-required","executor-unavailable","invalid-installation","registry-check-failed","install-timeout","install-interrupted","invalid-version"]);function u$e(n){return async(t,o,a)=>{if(!d$e.includes(t)||!h$e(t,o))return{ok:!1,error:{code:"bad-request",message:"Invalid update request."}};if(a?.aborted)return{ok:!1,error:{code:"cancelled",message:"Request cancelled."}};try{return{ok:!0,value:t==="update.install"?await n.install(o):t==="update.check"?await n.check():await n.status()}}catch(e){let i=E$e.has(e?.code)?e.code:"update-failed";return{ok:!1,error:{code:i,message:i}}}}}function Gle(n,t={}){let o=t.runtime??ble({ctx:n,moduleUrl:import.meta.url}),a=t.service??Ple({runtime:o}),e=n.connection.rpc.handle(p$e,u$e(a),{authority:"loopback"});return n.effect(()=>()=>a.close(),"dsh-im: close update installer"),e}var Fle="dsh-im-host",C$e=["connection","credentials","typertGateway"];function B$e(n,t,o){let a=n[t]??{},e=n.rpcAuthority===void 0?a:{...a,rpcAuthority:n.rpcAuthority};return t==="office"?e:{...e,deliveryService:o}}function f$e(n={}){let t=n.installUpdateRpc??Gle,o=n.installDeliveryRpc??Ble,a=n.installDeliveryHttp??yle,e=n.createDeliveryService??Sle,i=n.applyFeishu??bZ,A=n.applyWeixin??mX,r=n.applyDingtalk??R3,s=n.applyWecom??j9,g=n.applyQq??zZ,c=n.applySlack??l9,I=n.applyTelegram??b9,p=n.applyDiscord??oj,B=n.applyOffice??lj,f=n.applyWhatsapp??ule,Q=[["feishu",i],["weixin",A],["dingtalk",r],["wecom",s],["qq",g],["slack",c],["telegram",I],["discord",p],["whatsapp",f],["office",B]];return Object.freeze({name:Fle,inject:C$e,async apply(m,T={}){let _=e();typeof m?.provide=="function"&&m.provide("dshIm",Object.freeze({send:(L,U,F,q)=>_.send(L,U,F,q),listTargets:async L=>(await _.listTargets(L)).targets}));let R=async L=>{await y(L,T,_)};if(typeof m?.inject=="function"){let L=typeof m?.typertGateway?.stream=="function";await m.inject(L?["sessionController","workspaceController"]:["apiProxy"],R),m.inject(["webServer"],U=>{a(U,_)});return}await R(m),m?.webServer?.register&&typeof m?.effect=="function"&&a(m,_)}});async function y(m,T,_){Yx(T.language??process.env.DSH_IM_LANGUAGE),typeof m?.inject=="function"?m.inject(["tools","systemPrompt"],U=>{tT(U)}):tT(m);let R=typeof m?.logger=="function"?m.logger(Fle):m?.logger??console;if(m?.connection?.rpc){try{t(m)}catch(U){R.error?.("[dsh-im] failed to activate update management; continuing with channels",U)}try{o(m,_,{authority:T.rpcAuthority})}catch(U){R.error?.("[dsh-im] failed to activate delivery management; continuing with channels",U)}}let L=[];for(let[U,F]of Q)try{await F(m,B$e(T,U,_))}catch(q){L.push(q),R.error?.(`[dsh-im] failed to activate ${U}; continuing with the remaining channels`,q)}if(L.length===Q.length)throw new AggregateError(L,"dsh-im failed to activate every channel")}}async function NKA(n,t={}){return f$e().apply(n,t)}export{NKA as apply,f$e as createImHostPlugin,C$e as inject,Fle as name}; +${n.stack}`:a}function _xe(n){n<1028||(Vg[n]=YB,YB=n)}function KB(n,t){return n=n>>>0,_h().subarray(n/1,n/1+t)}var jl=null;function eA(){return(jl===null||jl.buffer.detached===!0||jl.buffer.detached===void 0&&jl.buffer!==ae.memory.buffer)&&(jl=new DataView(ae.memory.buffer)),jl}function vr(n,t){return n=n>>>0,Rxe(n,t)}var xB=null;function _h(){return(xB===null||xB.byteLength===0)&&(xB=new Uint8Array(ae.memory.buffer)),xB}function Fe(n){return Vg[n]}function kr(n,t){try{return n.apply(this,t)}catch(o){ae.__wbindgen_export3(iA(o))}}var Vg=new Array(1024).fill(void 0);Vg.push(void 0,null,!0,!1);var YB=Vg.length;function qn(n){return n==null}function Txe(n,t,o,a){let e={a:n,b:t,cnt:1,dtor:o},i=(...A)=>{e.cnt++;let r=e.a;e.a=0;try{return a(r,e.b,...A)}finally{e.a=r,i._wbg_cb_unref()}};return i._wbg_cb_unref=()=>{--e.cnt===0&&(e.dtor(e.a,e.b),e.a=0,P$.unregister(e))},P$.register(i,e,e),i}function Pt(n,t){let o=t(n.length*1,1)>>>0;return _h().set(n,o/1),KA=n.length,o}function G$(n,t){let o=t(n.length*4,4)>>>0,a=eA();for(let e=0;e>>0;return _h().subarray(s,s+r.length).set(r),KA=r.length,s}let a=n.length,e=t(a,1)>>>0,i=_h(),A=0;for(;A127)break;i[e+A]=r}if(A!==a){A!==0&&(n=n.slice(A)),e=o(e,a,a=A+n.length*3,1)>>>0;let r=_h().subarray(e+A,e+a),s=jB.encodeInto(n,r);A+=s.written,e=o(e,a,A,1)>>>0}return KA=A,e}function mA(n){let t=Fe(n);return _xe(n),t}var RD=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});RD.decode();var Nxe=2146435072,_L=0;function Rxe(n,t){return _L+=t,_L>=Nxe&&(RD=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),RD.decode(),_L=t),RD.decode(_h().subarray(n,n+t))}var jB=new TextEncoder;"encodeInto"in jB||(jB.encodeInto=function(n,t){let o=jB.encode(n);return t.set(o),{read:n.length,written:o.length}});var KA=0,kxe,ae;function vxe(n,t){return ae=n.exports,kxe=t,jl=null,xB=null,ae}function L$(n){if(ae!==void 0)return ae;n!==void 0&&(Object.getPrototypeOf(n)===Object.prototype?{module:n}=n:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=Oxe();n instanceof WebAssembly.Module||(n=new WebAssembly.Module(n));let o=new WebAssembly.Instance(n,t);return vxe(o,n)}var Pxe=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function U$(n){let t=atob(n),o=new Uint8Array(t.length);for(let a=0;an.length===33?n:Buffer.concat([Wg,n]),br={generateKeyPair:()=>{let{pubKey:n,privKey:t}=gI.generateKeyPair();return{private:Buffer.from(t),public:Buffer.from(n.slice(1))}},sharedKey:(n,t)=>{let o=gI.calculateAgreement(An(t),n);return Buffer.from(o)},sign:(n,t)=>gI.calculateSignature(n,t),verify:(n,t,o)=>{try{return gI.verifySignature(An(n),t,o),!0}catch{return!1}}},HD=(n,t)=>{let o=br.generateKeyPair(),a=An(o.public),e=br.sign(n.private,a);return{keyPair:o,signature:e,keyId:t}},K$=16;function Jl(n,t,o,a){let e=NL("aes-256-gcm",t,o);return e.setAAD(a),Buffer.concat([e.update(n),e.final(),e.getAuthTag()])}function ql(n,t,o,a){let e=RL("aes-256-gcm",t,o),i=n.slice(0,n.length-K$),A=n.slice(n.length-K$);return e.setAAD(a),e.setAuthTag(A),Buffer.concat([e.update(i),e.final()])}function x$(n,t,o){let a=NL("aes-256-ctr",t,o);return Buffer.concat([a.update(n),a.final()])}function Y$(n,t,o){let a=RL("aes-256-ctr",t,o);return Buffer.concat([a.update(n),a.final()])}function j$(n,t){return Yxe(n.subarray(16),t,n.subarray(0,16))}function Yxe(n,t,o){let a=RL("aes-256-cbc",t,o);return Buffer.concat([a.update(n),a.final()])}function J$(n,t){let o=xxe(16),a=NL("aes-256-cbc",t,o);return Buffer.concat([o,a.update(n),a.final()])}function Wn(n,t,o="sha256"){return Kxe(o,t).update(n).digest()}function kh(n){return Hxe("sha256").update(n).digest()}async function KD(n,t){let a=new TextEncoder().encode(n),e=new Uint8Array(t instanceof Uint8Array?t:new Uint8Array(t)),i=await H$.importKey("raw",a,{name:"PBKDF2"},!1,["deriveBits"]),A=await H$.deriveBits({name:"PBKDF2",salt:e,iterations:2<<16,hash:"SHA-256"},i,256);return Buffer.from(A)}var WB={replacer:(n,t)=>Buffer.isBuffer(t)||t instanceof Uint8Array||t?.type==="Buffer"?{type:"Buffer",data:Buffer.from(t?.data||t).toString("base64")}:t,reviver:(n,t)=>{if(typeof t=="object"&&t!==null&&t.type==="Buffer"&&typeof t.data=="string")return Buffer.from(t.data,"base64");if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let o=Object.keys(t);if(o.length>0&&o.every(a=>!isNaN(parseInt(a,10)))){let a=Object.values(t);if(a.every(e=>typeof e=="number"))return Buffer.from(a)}}return t}},vh=(n,t="me")=>(n?.fromMe?t:n?.participantAlt||n?.remoteJidAlt||n?.participant||n?.remoteJid)||"",V$=n=>n==null||n==="",Jxe=n=>{let o=(VB(1)[0]&15)+1;return Buffer.concat([n,Buffer.alloc(o,o)])},W$=n=>{let t=new Uint8Array(n);if(t.length===0)throw new Error("unpadPkcs7 given empty bytes");var o=t[t.length-1];if(o>t.length)throw new Error(`unpad given ${t.length} bytes, but pad is ${o}`);return new Uint8Array(t.buffer,t.byteOffset,t.length-o)},Z$=n=>(n.sort(),"2:"+kh(Buffer.from(n.join(""))).toString("base64").slice(0,6)),Ph=n=>Jxe(ne.Message.encode(n).finish()),X$=()=>Uint16Array.from(VB(2))[0]&16383,Zg=(n,t=4)=>{let o=n,a=new Uint8Array(t);for(let e=t-1;e>=0;e--)a[e]=255&o,o>>>=8;return a},zr=n=>typeof n=="object"&&n?"toNumber"in n?n.toNumber():n.low:n||0,vi=(n=new Date)=>Math.floor(n.getTime()/1e3);var ZB=n=>$$(n).delay,$$=n=>{let t=new Error().stack,o,a;return{delay:new Promise((A,r)=>{o=setTimeout(A,n),a=r}),cancel:()=>{clearTimeout(o),a(new xD.Boom("Cancelled",{statusCode:500,data:{stack:t}}))}}};async function Gh(n,t){if(!n)return new Promise(t);let o=new Error().stack,{delay:a,cancel:e}=$$(n);return new Promise((A,r)=>{a.then(()=>r(new xD.Boom("Timed Out",{statusCode:ar.timedOut,data:{stack:o}}))).catch(s=>r(s)),t(A,r)}).finally(e)}var Vr=n=>{let t=Buffer.alloc(44);if(t.writeBigUInt64BE(BigInt(Math.floor(Date.now()/1e3))),n){let e=pA(n);e?.user&&(t.write(e.user,8),t.write("@c.us",8+e.user.length))}return VB(16).copy(t,28),"3EB0"+jxe("sha256").update(t).digest().toString("hex").toUpperCase().substring(0,18)},kL=()=>"3EB0"+VB(18).toString("hex").toUpperCase();function vL(n,t){return async(o,a)=>{let e,i;await Gh(a,(A,r)=>{i=({connection:s,lastDisconnect:g})=>{s==="close"&&r(g?.error||new xD.Boom("Connection Closed",{statusCode:ar.connectionClosed}))},n.on("connection.update",i),e=async s=>{await o(s)&&A()},n.on(t,e)}).finally(()=>{n.off(t,e),n.off("connection.update",i)})}}var eee=n=>vL(n,"connection.update");var Aee=()=>{let n=VB(4);return`${n.readUInt16BE()}.${n.readUInt16BE(2)}-`},qxe={sender:ne.WebMessageInfo.Status.SERVER_ACK,played:ne.WebMessageInfo.Status.PLAYED,read:ne.WebMessageInfo.Status.READ,"read-self":ne.WebMessageInfo.Status.READ},tee=n=>{let t=qxe[n];return typeof n>"u"?ne.WebMessageInfo.Status.DELIVERY_ACK:t},zxe={conflict:ar.connectionReplaced},ree=n=>{let[t]=Gs(n),o=t?.tag||"unknown",a=+(n.attrs.code||zxe[o]||ar.badSession);return a===ar.restartRequired&&(o="restart required"),{reason:o,statusCode:a}},iee=({tag:n,attrs:t})=>{let o;switch(n){case"offer":case"offer_notice":o="offer";break;case"terminate":t.reason==="timeout"?o="timeout":o="terminate";break;case"preaccept":o="preaccept";break;case"transport":o="transport";break;case"relaylatency":o="relaylatency";break;case"reject":o="reject";break;case"accept":o="accept";break;default:o="ringing";break}return o},q$="Unexpected server response: ",aee=n=>{let t=500;if(n?.message?.includes(q$)){let o=+n?.message.slice(q$.length);!Number.isNaN(o)&&o>=400&&(t=o)}else(n?.code?.startsWith("E")||n?.message?.includes("timed out"))&&(t=408);return t};function YD(n){for(let t in n)typeof n[t]>"u"&&delete n[t];return n}var z$="123456789ABCDEFGHJKLMNPQRSTVWXYZ";function oee(n){let t=0,o=0,a=[];for(let e of n)for(t=t<<8|e&255,o+=8;o>=5;)a.push(z$.charAt(t>>>o-5&31)),o-=5;return o>0&&a.push(z$.charAt(t<<5-o&31)),a.join("")}function nee(n){return ne.Message.encode(n).finish()}var zl=ze(Jr(),1);var Vxe=async(n,t)=>qA(n)||Ci(n)?n:await t.lidMapping.getLIDForPN(n)||n,Wxe=async(n,t,o,a,e)=>{let{senderAlt:i}=JD(n);if(i&&qA(i)&&Rt(t)&&a===t)try{await o.lidMapping.storeLIDPNMappings([{lid:i,pn:t}]),await o.migrateSession(t,i),e.debug({sender:t,senderAlt:i},"Stored LID mapping from envelope")}catch(A){e.warn({sender:t,senderAlt:i,error:A},"Failed to store LID mapping")}},jD="Message absent from node",see="Key used already or never filled",gee="Your account has been restricted",Zxe={maxRetries:3,baseDelayMs:100,sessionRecordErrors:["No session record","SessionError: No session record"]},Vl={SenderReachoutTimelocked:463,ParsingError:487,UnrecognizedStanza:488,UnrecognizedStanzaClass:489,UnrecognizedStanzaType:490,InvalidProtobuf:491,InvalidHostedCompanionStanza:493,MissingMessageSecret:495,SignalErrorOldCounter:496,MessageDeletedOnPeer:499,UnhandledError:500,UnsupportedAdminRevoke:550,UnsupportedLIDGroup:551,DBOperationFailed:552},PL={MessageAccountRestriction:"463",SmaxInvalid:"479"},JD=n=>{let t,o,a=n.attrs.participant||n.attrs.from,e=n.attrs.addressing_mode||(a?.endsWith("lid")?"lid":"pn");return e==="lid"?(t=n.attrs.participant_pn||n.attrs.sender_pn||n.attrs.peer_recipient_pn,o=n.attrs.recipient_pn):(t=n.attrs.participant_lid||n.attrs.sender_lid||n.attrs.peer_recipient_lid,o=n.attrs.recipient_lid),{addressingMode:e,senderAlt:t,recipientAlt:o}};function GL(n,t,o){let a,e,i,A=!1,r=n.attrs.id,s=n.attrs.from,g=n.attrs.participant,c=n.attrs.recipient;if(!r)throw new zl.Boom("Invalid message stanza: missing id attribute",{data:n});if(!s)throw new zl.Boom("Invalid message stanza: missing from attribute",{data:n});let I=JD(n),p=m=>ft(m,t),B=m=>ft(m,o);if(Rt(s)||qA(s)||Ci(s)||Or(s)){if(c&&!Mh(c)){if(!p(s)&&!B(s))throw new zl.Boom("receipient present, but msg not from me",{data:n});(p(s)||B(s))&&(A=!0),e=c}else(p(s)||B(s))&&(A=!0),e=s;a="chat",i=s}else if(qr(s)){if(!g)throw new zl.Boom("No participant in group message");(p(g)||B(g))&&(A=!0),a="group",i=g,e=s}else if(HB(s)){if(!g)throw new zl.Boom("No participant in group message");let m=p(g);zg(s)?a=m?"direct_peer_status":"other_status":a=m?"peer_broadcast":"other_broadcast",A=m,e=s,i=g}else if(aI(s))a="newsletter",e=s,i=s,(p(s)||B(s))&&(A=!0);else throw new zl.Boom("Unknown message type",{data:n});let f=n?.attrs?.notify,Q={remoteJid:e,remoteJidAlt:qr(e)?void 0:I.senderAlt,remoteJidUsername:qr(e)?void 0:n.attrs.peer_recipient_username||n.attrs.recipient_username,fromMe:A,id:r,participant:g,participantAlt:qr(e)?I.senderAlt:void 0,participantUsername:n.attrs.participant?n.attrs.participant_username:void 0,addressingMode:I.addressingMode,...a==="newsletter"&&n.attrs.server_id?{server_id:n.attrs.server_id}:{}},y={key:Q,category:n.attrs.category,messageTimestamp:+n.attrs.t,pushName:f,broadcast:HB(s)};return Q.fromMe&&(y.status=ne.WebMessageInfo.Status.SERVER_ACK),{fullMessage:y,author:i,sender:a==="chat"?i:e}}var cee=(n,t,o,a,e)=>{let{fullMessage:i,author:A,sender:r}=GL(n,t,o);return{fullMessage:i,category:n.attrs.category,author:A,async decrypt(){let s=0;if(Array.isArray(n.content))for(let{tag:g,attrs:c,content:I}of n.content){if(g==="verified_name"&&I instanceof Uint8Array){let f=ne.VerifiedNameCertificate.decode(I),Q=ne.VerifiedNameCertificate.Details.decode(f.details);i.verifiedBizName=Q.verifiedName}if(g==="unavailable"&&c.type==="view_once"&&(i.key.isViewOnce=!0),c.count&&g==="enc"&&(i.retryCount=Number(c.count)),g!=="enc"&&g!=="plaintext"||!(I instanceof Uint8Array))continue;s+=1;let p,B=await Vxe(A,a);g!=="plaintext"&&await Wxe(n,A,a,B,e);try{let f=g==="plaintext"?"plaintext":c.type;switch(f){case"skmsg":p=await a.decryptGroupMessage({group:r,authorJid:A,msg:I});break;case"pkmsg":case"msg":p=await a.decryptMessage({jid:B,type:f,ciphertext:I});break;case"plaintext":p=I;break;default:throw new Error(`Unknown e2e type: ${f}`)}let Q=ne.Message.decode(f!=="plaintext"?W$(p):p);if(Q=Q.deviceSentMessage?.message||Q,Q.senderKeyDistributionMessage)try{await a.processSenderKeyDistributionMessage({authorJid:A,item:Q.senderKeyDistributionMessage})}catch(y){e.error({key:i.key,err:y},"failed to process sender key distribution message")}i.message?Object.assign(i.message,Q):i.message=Q}catch(f){let Q={key:i.key,err:f,messageType:g==="plaintext"?"plaintext":c.type,sender:r,author:A,isSessionRecordError:Xxe(f)};e.error(Q,"failed to decrypt message"),i.messageStubType=ne.WebMessageInfo.StubType.CIPHERTEXT,i.messageStubParameters=[f.message.toString()]}}!s&&!i.key?.isViewOnce&&(i.messageStubType=ne.WebMessageInfo.StubType.CIPHERTEXT,i.messageStubParameters=[jD])}}};function Xxe(n){let t=n?.message||n?.toString()||"";return Zxe.sessionRecordErrors.some(o=>t.includes(o))}var nc=ze(Jr(),1);import{randomBytes as ZU}from"crypto";import{promises as XU}from"fs";var Xn=ze(Jr(),1);import{exec as Xze}from"child_process";import*as So from"crypto";import{once as SE}from"events";import{createReadStream as xb,createWriteStream as xU,promises as DE}from"fs";import{tmpdir as Pne}from"os";import{join as Hb}from"path";import{Readable as xf,Transform as $ze}from"stream";import{URL as YU}from"url";var jU=()=>Pne(),Gne=async()=>{let[n,t]=await Promise.all([import("jimp").catch(()=>{}),Promise.resolve().then(()=>(Qre(),fre)).catch(()=>{})]);if(t)return{sharp:t};if(n)return{jimp:n};throw new Xn.Boom("No image processing library available")},eVe=n=>`WhatsApp ${Vne[n]} Keys`,Yb=async(n,t,o)=>{let{stream:a}=await Yf(n);o?.debug("got stream for raw upload");let e=So.createHash("sha256"),i=Hb(Pne(),t+Vr()),A=xU(i),r=0;try{for await(let g of a)r+=g.length,e.update(g),A.write(g)||await SE(A,"drain");A.end(),await SE(A,"finish"),a.destroy();let s=e.digest();return o?.debug("hashed data for raw upload"),{filePath:i,fileSha256:s,fileLength:r}}catch(s){A.destroy(),a.destroy();try{await DE.unlink(i)}catch{}throw s}};async function Fne(n,t){if(!n)throw new Xn.Boom("Cannot derive from empty media key");typeof n=="string"&&(n=Buffer.from(n.replace("data:;base64,",""),"base64"));let o=Vn(n,112,{info:eVe(t)});return{iv:o.slice(0,16),cipherKey:o.slice(16,48),macKey:o.slice(48,80)}}var AVe=async(n,t,o,a)=>new Promise((e,i)=>{let A=`ffmpeg -ss ${o} -i ${n} -y -vf scale=${a.width}:-1 -vframes 1 -f image2 ${t}`;Xze(A,r=>{r?i(r):e()})}),JU=async(n,t=32)=>{n instanceof xf&&(n=await Kb(n));let o=await Gne();if("sharp"in o&&typeof o.sharp?.default=="function"){let a=o.sharp.default(n),e=await a.metadata();return{buffer:await a.resize(t).jpeg({quality:50}).toBuffer(),original:{width:e.width,height:e.height}}}else if("jimp"in o&&typeof o.jimp?.Jimp=="object"){let a=await o.jimp.Jimp.read(n),e={width:a.width,height:a.height};return{buffer:await a.resize({w:t,mode:o.jimp.ResizeStrategy.BILINEAR}).getBuffer("image/jpeg",{quality:50}),original:e}}else throw new Xn.Boom("No image processing library available")},tVe=n=>encodeURIComponent(n.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=+$/,"")),jb=async(n,t)=>{let o,{width:a=640,height:e=640}=t||{};if(Buffer.isBuffer(n))o=n;else{let{stream:r}=await Yf(n);o=await Kb(r)}let i=await Gne(),A;if("sharp"in i&&typeof i.sharp?.default=="function")A=i.sharp.default(o).resize(a,e).jpeg({quality:50}).toBuffer();else if("jimp"in i&&typeof i.jimp?.Jimp=="function"){let r=await i.jimp.Jimp.read(o),s=Math.min(r.width,r.height);A=r.crop({x:0,y:0,w:s,h:s}).resize({w:a,h:e,mode:i.jimp.ResizeStrategy.BILINEAR}).getBuffer("image/jpeg",{quality:50})}else throw new Xn.Boom("No image processing library available");return{img:await A}};async function Lne(n){let t=await Promise.resolve().then(()=>(kne(),Rne)),o,a={duration:!0};return Buffer.isBuffer(n)?o=await t.parseBuffer(n,void 0,a):typeof n=="string"?o=await t.parseFile(n,a):o=await t.parseStream(n,void 0,a),o.format.duration}async function Une(n,t){try{let{default:o}=await import("audio-decode"),a;if(Buffer.isBuffer(n))a=n;else if(typeof n=="string"){let p=xb(n);a=await Kb(p)}else a=await Kb(n);let i=(await o(a)).getChannelData(0),A=64,r=Math.floor(i.length/A),s=[];for(let p=0;pp*g);return new Uint8Array(c.map(p=>Math.floor(100*p)))}catch(o){t?.debug("Failed to generate waveform: "+o)}}var vne=n=>{let t=new xf({read:()=>{}});return t.push(n),t.push(null),t},Kb=async n=>{let t=[];for await(let o of n)t.push(o);return n.destroy(),Buffer.concat(t)},Yf=async(n,t)=>{if(Buffer.isBuffer(n))return{stream:vne(n),type:"buffer"};if("stream"in n)return{stream:n.stream,type:"readable"};let o=n.url.toString();if(o.startsWith("data:")){let a=Buffer.from(o.split(",")[1],"base64");return{stream:vne(a),type:"buffer"}}return o.startsWith("http://")||o.startsWith("https://")?{stream:await Jb(n.url,t),type:"remote"}:{stream:xb(n.url),type:"file"}};async function Hne(n,t,o){let a,e;if(t==="image"){let{buffer:i,original:A}=await JU(n);a=i.toString("base64"),A.width&&A.height&&(e={width:A.width,height:A.height})}else if(t==="video"){let i=Hb(jU(),Vr()+".jpg");try{await AVe(n,i,"00:00:00",{width:32,height:32}),a=(await DE.readFile(i)).toString("base64"),await DE.unlink(i)}catch(A){o.logger?.debug("could not generate video thumb: "+A)}}return{thumbnail:a,originalImageDimensions:e}}var Jb=async(n,t={})=>{let o=await fetch(n.toString(),{dispatcher:t.dispatcher,method:"GET",headers:t.headers});if(!o.ok)throw new Xn.Boom(`Failed to fetch stream from ${n}`,{statusCode:o.status,data:{url:n}});return o.body instanceof xf?o.body:xf.fromWeb(o.body)},Kne=async(n,t,{logger:o,saveOriginalFileIfRequired:a,opts:e}={})=>{let{stream:i,type:A}=await Yf(n,e);o?.debug("fetched media stream");let r=So.randomBytes(32),{cipherKey:s,iv:g,macKey:c}=await Fne(r,t),I=Hb(jU(),t+Vr()+"-enc"),p=xU(I),B,f;a&&(f=Hb(jU(),t+Vr()+"-original"),B=xU(f));let Q=0,y=So.createCipheriv("aes-256-cbc",s,g),m=So.createHmac("sha256",c).update(g),T=So.createHash("sha256"),_=So.createHash("sha256"),R=async L=>{_.update(L),m.update(L),p.write(L)||await SE(p,"drain")};try{for await(let K of i){if(Q+=K.length,A==="remote"&&e?.maxContentLength&&Q+K.length>e.maxContentLength)throw new Xn.Boom(`content length exceeded when encrypting "${A}"`,{data:{media:n,type:A}});B&&(B.write(K)||await SE(B,"drain")),T.update(K),await R(y.update(K))}await R(y.final());let L=m.digest().slice(0,10);_.update(L);let U=T.digest(),F=_.digest();p.write(L);let q=SE(p,"finish"),z=B?SE(B,"finish"):Promise.resolve();return p.end(),B?.end?.(),i.destroy(),await q,await z,o?.debug("encrypted data successfully"),{mediaKey:r,originalFilePath:f,encFilePath:I,mac:L,fileEncSha256:F,fileSha256:U,fileLength:Q}}catch(L){p.destroy(),B?.destroy?.(),y.destroy(),m.destroy(),T.destroy(),_.destroy(),i.destroy();try{await DE.unlink(I),f&&await DE.unlink(f)}catch(U){o?.error({err:U},"failed deleting tmp files")}throw L}},qU="mmg.whatsapp.net",wE=16,KU=n=>Math.floor(n/wE)*wE,jf=(n,t=qU)=>`https://${t}${n}`,rVe=n=>{if(n)try{return new YU(n).host}catch{return}},OE=async({mediaKey:n,directPath:t,url:o},a,e={})=>{let i=e.host??rVe(o),A=t?jf(t,i):o;if(!A)throw new Xn.Boom("No valid media URL or directPath present in message",{statusCode:400});let r=await Fne(n,a);return iVe(A,r,e)},iVe=async(n,{cipherKey:t,iv:o},{startByte:a,endByte:e,options:i}={})=>{let A=0,r=0,s=!1;if(a){let m=KU(a||0);m&&(r=m-wE,A=m,s=!0)}let g=e?KU(e||0)+wE:void 0,c=i?.headers?i.headers:void 0,I={...c?Array.isArray(c)?Object.fromEntries(c):c:{},Origin:Jf};(r||g)&&(I.Range=`bytes=${r}-`,g&&(I.Range+=g));let p=await Jb(n,{...i||{},headers:I}),B=Buffer.from([]),f,Q=(m,T)=>{if(a||e){let _=A>=a?void 0:Math.max(a-A,0),R=A+m.lengththis.push(U)),_()}catch(U){_(U)}},final(m){try{Q(f.final(),T=>this.push(T)),m()}catch(T){m(T)}}});return p.pipe(y,{end:!0})};var aVe=()=>typeof process<"u"&&process.versions?.node!==null&&typeof process.versions.bun>"u"&&typeof globalThis.Deno>"u",xne=async({url:n,filePath:t,headers:o,timeoutMs:a,agent:e},i=0)=>{if(i>5)throw new Error("Too many redirects");let A=new YU(n),r=A.protocol==="https:"?await import("https"):await import("http"),g=(await DE.stat(t)).size;return new Promise((c,I)=>{let p=r.request({hostname:A.hostname,port:A.port||(A.protocol==="https:"?443:80),path:A.pathname+A.search,method:"POST",headers:{...o,"Content-Length":g},agent:e,timeout:a},f=>{if(f.statusCode&&f.statusCode>=300&&f.statusCode<400&&f.headers.location){f.resume();let y=new YU(f.headers.location,n).toString();c(xne({url:y,filePath:t,headers:o,timeoutMs:a,agent:e},i+1));return}let Q="";f.on("data",y=>Q+=y),f.on("end",()=>{try{c(JSON.parse(Q))}catch{c(void 0)}})});p.on("error",I),p.on("timeout",()=>{p.destroy(),I(new Error("Upload timeout"))});let B=xb(t);B.pipe(p),B.on("error",f=>{p.destroy(),I(f)})})},oVe=async({url:n,filePath:t,headers:o,timeoutMs:a,agent:e})=>{let i=xb(t),A=xf.toWeb(i),r=typeof e?.dispatch=="function"?e:void 0,s=await fetch(n,{...r?{dispatcher:r}:{},method:"POST",body:A,headers:o,duplex:"half",signal:a?AbortSignal.timeout(a):void 0});try{return await s.json()}catch{return}},nVe=async(n,t)=>aVe()?(t?.debug("Using Node.js https module for upload (avoids undici buffering bug)"),xne(n)):(t?.debug("Using web-standard Fetch API for upload"),oVe(n)),Yne=({customUploadHosts:n,fetchAgent:t,logger:o,options:a},e)=>async(i,{mediaType:A,fileEncSha256B64:r,timeoutMs:s})=>{let g=await e(!1),c,I=[...n,...g.hosts];r=tVe(r);let B={...(()=>{let f=a?.headers;return f?Array.isArray(f)?Object.fromEntries(f):f:{}})(),"Content-Type":"application/octet-stream",Origin:Jf};for(let{hostname:f}of I){o.debug(`uploading to "${f}"`);let Q=encodeURIComponent(g.auth),y=`https://${f}${VU[A]}/${r}?auth=${Q}&token=${r}`,m;try{if(m=await nVe({url:y,filePath:i,headers:B,timeoutMs:s,agent:t},o),m?.url||m?.direct_path){c={mediaUrl:m.url,directPath:m.direct_path,meta_hmac:m.meta_hmac,fbid:m.fbid,ts:m.ts};break}else throw g=await e(!0),new Error(`upload failed, reason: ${JSON.stringify(m)}`)}catch(T){let _=f===I[g.hosts.length-1]?.hostname;o.warn({trace:T?.stack,uploadResult:m},`Error in uploading to ${f} ${_?"":", retrying..."}`)}}if(!c)throw new Xn.Boom("Media upload failed on all hosts",{statusCode:500});return c},jne=n=>Vn(n,32,{info:"WhatsApp Media Retry Notification"}),Jne=(n,t,o)=>{let a={stanzaId:n.id},e=ne.ServerErrorReceipt.encode(a).finish(),i=So.randomBytes(12),A=jne(t),r=Jl(e,A,i,Buffer.from(n.id));return{tag:"receipt",attrs:{id:n.id,to:BA(o),type:"server-error"},content:[{tag:"encrypt",attrs:{},content:[{tag:"enc_p",attrs:{},content:r},{tag:"enc_iv",attrs:{},content:i}]},{tag:"rmr",attrs:{jid:n.remoteJid,from_me:(!!n.fromMe).toString(),participant:n.participant||void 0}}]}},qne=n=>{let t=le(n,"rmr"),o={key:{id:n.attrs.id,remoteJid:t.attrs.jid,fromMe:t.attrs.from_me==="true",participant:t.attrs.participant}},a=le(n,"error");if(a){let e=+a.attrs.code;o.error=new Xn.Boom(`Failed to re-upload media (${e})`,{data:a.attrs,statusCode:zU(e)})}else{let e=le(n,"encrypt"),i=ki(e,"enc_p"),A=ki(e,"enc_iv");i&&A?o.media={ciphertext:i,iv:A}:o.error=new Xn.Boom("Failed to re-upload media (missing ciphertext)",{statusCode:404})}return o},zne=({ciphertext:n,iv:t},o,a)=>{let e=jne(o),i=ql(n,e,t,Buffer.from(a));return ne.MediaRetryNotification.decode(i)},zU=n=>sVe[n],sVe={[ne.MediaRetryNotification.ResultType.SUCCESS]:200,[ne.MediaRetryNotification.ResultType.DECRYPTION_ERROR]:412,[ne.MediaRetryNotification.ResultType.NOT_FOUND]:404,[ne.MediaRetryNotification.ResultType.GENERAL_ERROR]:418};import{createHmac as gVe}from"crypto";var cVe=[{f:1},{f:3,s:[{f:2},{f:3},{f:8},{f:11},{f:17,s:[{f:21},{f:22}]},{f:25}]},{f:4,s:[{f:1},{f:16},{f:17,s:[{f:21},{f:22}]}]},{f:5,s:[{f:3},{f:4},{f:5},{f:16},{f:17,s:[{f:21},{f:22}]}]},{f:6,s:[{f:1},{f:17,s:[{f:21},{f:22}]},{f:30}]},{f:7,s:[{f:2},{f:7},{f:10},{f:17,s:[{f:21},{f:22}]},{f:20}]},{f:8,s:[{f:2},{f:7},{f:9},{f:17,s:[{f:21},{f:22}]},{f:21}]},{f:9,s:[{f:2},{f:6},{f:7},{f:13},{f:17,s:[{f:21},{f:22}]},{f:20}]},{f:12,s:[{f:1},{f:2},{f:14,m:!0},{f:15}]},{f:18,s:[{f:6},{f:16},{f:17,s:[{f:21},{f:22}]}]},{f:26,s:[{f:4},{f:5},{f:8},{f:13},{f:17,s:[{f:21},{f:22}]}]},{f:28,s:[{f:1},{f:2},{f:4},{f:5},{f:6},{f:7,s:[{f:21},{f:22}]}]},{f:37,s:[{f:1,m:!0}]},{f:49,s:[{f:2},{f:3,s:[{f:1},{f:2}]},{f:5,s:[{f:21},{f:22}]},{f:8,s:[{f:1},{f:2}]}]},{f:53,s:[{f:1,m:!0}]},{f:55,s:[{f:1,m:!0}]},{f:58,s:[{f:1,m:!0}]},{f:59,s:[{f:1,m:!0}]},{f:60,s:[{f:2},{f:3,s:[{f:1},{f:2}]},{f:5,s:[{f:21},{f:22}]},{f:8,s:[{f:1},{f:2}]}]},{f:64,s:[{f:2},{f:3,s:[{f:1},{f:2}]},{f:5,s:[{f:21},{f:22}]},{f:8,s:[{f:1},{f:2}]}]},{f:66,s:[{f:2},{f:6},{f:7},{f:13},{f:17,s:[{f:21},{f:22}]},{f:20}]},{f:74,s:[{f:1,m:!0}]},{f:87,s:[{f:1,m:!0}]},{f:88,s:[{f:1},{f:2,s:[{f:1}]},{f:3,s:[{f:21},{f:22}]}]},{f:92,s:[{f:1,m:!0}]},{f:93,s:[{f:1,m:!0}]},{f:94,s:[{f:1,m:!0}]}],Zne=n=>{let t=new Map;for(let o of n)t.set(o.f,{m:o.m,children:o.s?Zne(o.s):void 0});return t},IVe=Zne(cVe),lVe=new Map,pVe="Report Token",qb={VARINT:0,FIXED64:1,BYTES:2,FIXED32:5},zb=n=>!n.reactionMessage&&!n.encReactionMessage&&!n.encEventResponseMessage&&!n.pollUpdateMessage,dVe=(n,t,o,a,e)=>{let i=Buffer.concat([Buffer.from(t,"utf8"),Buffer.from(o,"utf8"),Buffer.from(a,"utf8"),Buffer.from(n,"utf8")]);return Vn(e,32,{info:i.toString("latin1")})},Xne=(n,t)=>{let o=[],a=0;for(;a>3,A=e.value&7,r=a;a+=e.bytes;let s=t.get(i),g=I=>I>n.length?!1:(o.push({num:i,bytes:n.subarray(r,I)}),a=I,!0),c=I=>I>n.length?!1:(a=I,!0);if(A===qb.VARINT){let I=WU(n,a);if(!I.ok)return null;let p=a+I.bytes;if(!s){if(!c(p))return null;continue}if(!g(p))return null;continue}if(A===qb.FIXED64){let I=a+8;if(!s){if(!c(I))return null;continue}if(!g(I))return null;continue}if(A===qb.FIXED32){let I=a+4;if(!s){if(!c(I))return null;continue}if(!g(I))return null;continue}if(A===qb.BYTES){let I=WU(n,a);if(!I.ok)return null;let p=a+I.bytes,B=p+I.value;if(B>n.length)return null;if(!s){a=B;continue}if(s.m||s.children){let f=Xne(n.subarray(p,B),s.children??lVe);if(f===null)return null;if(f.length>0){let Q=Wne(e.value),y=Wne(f.length);o.push({num:i,bytes:Buffer.concat([Q,y,f])})}a=B;continue}o.push({num:i,bytes:n.subarray(r,B)}),a=B;continue}return null}return o.length===0?Buffer.alloc(0):(o.sort((e,i)=>e.num-i.num),Buffer.concat(o.map(e=>e.bytes)))},WU=(n,t)=>{let o=0,a=0,e=0;for(;t+a35)return{value:0,bytes:0,ok:!1}}return{value:0,bytes:0,ok:!1}},Wne=n=>{let t=[],o=n>>>0;for(;o>127;)t.push(o&127|128),o>>>=7;return t.push(o),Buffer.from(t)},$ne=async(n,t,o)=>{let a=t.messageContextInfo?.messageSecret;if(!a||!o.id)return null;let e=o.fromMe?o.remoteJid:o.participant||o.remoteJid,i=o.fromMe&&o.participant||o.remoteJid,A=dVe(pVe,o.id,e,i,a),r=Xne(n,IVe);if(!r||r.length===0)return null;let s=gVe("sha256",A).update(r).digest().subarray(0,16);return{tag:"reporting",attrs:{},content:[{tag:"reporting_token",attrs:{v:"2"},content:s}]}};var hVe={image:"image/jpeg",video:"video/mp4",document:"application/pdf",audio:"audio/ogg; codecs=opus",sticker:"image/webp","product-catalog-image":"image/jpeg"},ese={image:ne.Message.ImageMessage,video:ne.Message.VideoMessage,audio:ne.Message.AudioMessage,sticker:ne.Message.StickerMessage,document:ne.Message.DocumentMessage},EVe=n=>n.match(sse)?.[0],uVe=async(n,t,o)=>{let a=EVe(n);if(t&&a)try{return await t(a)}catch(e){o?.warn({trace:e.stack},"url generation failed")}},Ase=async n=>{let t;if(typeof n=="number")t=n>0?n:4294967295+Number(n)+1;else{let o=n.trim().replace("#","");return o.length<=6&&(o="FF"+o.padStart(6,"0")),t=parseInt(o,16),t}},qf=async(n,t)=>{let o=t.logger,a;for(let U of gse)U in n&&(a=U);if(!a)throw new nc.Boom("Invalid media type",{statusCode:400});let e={...n,media:n[a]};delete e[a];let i=typeof e.media=="object"&&"url"in e.media&&!!e.media.url&&!!t.mediaCache&&a+":"+e.media.url.toString();if(a==="document"&&!e.fileName&&(e.fileName="file"),e.mimetype||(e.mimetype=hVe[a]),i){let U=await t.mediaCache.get(i);if(U){o?.debug({cacheableKey:i},"got media cache hit");let F=ne.Message.decode(U),q=`${a}Message`;return Object.assign(F[q],{...e,media:void 0}),F}}if(!!t.jid&&aI(t.jid)){o?.info({key:i},"Preparing raw media for newsletter");let{filePath:U,fileSha256:F,fileLength:q}=await Yb(e.media,t.mediaTypeOverride||a,o),z=F.toString("base64"),{mediaUrl:K,directPath:G}=await t.upload(U,{fileEncSha256B64:z,mediaType:a,timeoutMs:t.mediaUploadTimeoutMs});await XU.unlink(U);let V=ne.Message.fromObject({[`${a}Message`]:ese[a].fromObject({url:K,directPath:G,fileSha256:F,fileLength:q,...e,media:void 0})});return e.ptv&&(V.ptvMessage=V.videoMessage,delete V.videoMessage),V.stickerMessage&&(V.stickerMessage.stickerSentTs=Date.now()),i&&(o?.debug({cacheableKey:i},"set cache"),await t.mediaCache.set(i,ne.Message.encode(V).finish())),V}let r=a==="audio"&&typeof e.seconds>"u",s=(a==="image"||a==="video")&&typeof e.jpegThumbnail>"u",g=a==="audio"&&e.ptt===!0&&typeof e.waveform>"u",c=t.backgroundColor&&a==="audio"&&e.ptt===!0,I=r||s,{mediaKey:p,encFilePath:B,originalFilePath:f,fileEncSha256:Q,fileSha256:y,fileLength:m}=await Kne(e.media,t.mediaTypeOverride||a,{logger:o,saveOriginalFileIfRequired:I,opts:t.options}),T=Q.toString("base64"),[{mediaUrl:_,directPath:R}]=await Promise.all([(async()=>{let U=await t.upload(B,{fileEncSha256B64:T,mediaType:a,timeoutMs:t.mediaUploadTimeoutMs});return o?.debug({mediaType:a,cacheableKey:i},"uploaded media"),U})(),(async()=>{try{if(s){let{thumbnail:U,originalImageDimensions:F}=await Hne(f,a,t);e.jpegThumbnail=U,!e.width&&F&&(e.width=F.width,e.height=F.height,o?.debug("set dimensions")),o?.debug("generated thumbnail")}r&&(e.seconds=await Lne(f),o?.debug("computed audio duration")),g&&(e.waveform=await Une(f,o),o?.debug("processed waveform")),c&&(e.backgroundArgb=await Ase(t.backgroundColor),o?.debug("computed backgroundColor audio status"))}catch(U){o?.warn({trace:U.stack},"failed to obtain extra info")}})()]).finally(async()=>{try{await XU.unlink(B),f&&await XU.unlink(f),o?.debug("removed tmp files")}catch{o?.warn("failed to remove tmp file")}}),L=ne.Message.fromObject({[`${a}Message`]:ese[a].fromObject({url:_,directPath:R,mediaKey:p,fileEncSha256:Q,fileSha256:y,fileLength:m,mediaKeyTimestamp:vi(),...e,media:void 0})});return e.ptv&&(L.ptvMessage=L.videoMessage,delete L.videoMessage),i&&(o?.debug({cacheableKey:i},"set cache"),await t.mediaCache.set(i,ne.Message.encode(L).finish())),L},CVe=n=>{n=n||0;let t={ephemeralMessage:{message:{protocolMessage:{type:ne.Message.ProtocolMessage.Type.EPHEMERAL_SETTING,ephemeralExpiration:n}}}};return ne.Message.fromObject(t)},BVe=(n,t)=>{let o=n.message;if(!o)throw new nc.Boom("no content in message",{statusCode:400});o=Si(o),o=ne.Message.decode(ne.Message.encode(o).finish());let a=Object.keys(o)[0],e=o?.[a]?.contextInfo?.forwardingScore||0;e+=n.key.fromMe&&!t?0:1,a==="conversation"&&(o.extendedTextMessage={text:o[a]},delete o.conversation,a="extendedTextMessage");let i=o?.[a];return e>0?i.contextInfo={forwardingScore:e,isForwarded:!0}:i.contextInfo={},o},mi=(n,t)=>typeof n=="object"&&n!==null&&t in n&&n[t]!==null&&n[t]!==void 0;function Ep(n,t){return typeof n=="object"&&n!==null&&t in n&&n[t]!==null}var fVe=async(n,t)=>{var o,a;let e={};if(mi(n,"text")){let i={text:n.text},A=n.linkPreview;if(typeof A>"u"&&(A=await uVe(n.text,t.getUrlInfo,t.logger)),A){i.matchedText=A["matched-text"],i.jpegThumbnail=A.jpegThumbnail,i.description=A.description,i.title=A.title,i.previewType=0;let r=A.highQualityThumbnail;r&&(i.thumbnailDirectPath=r.directPath,i.mediaKey=r.mediaKey,i.mediaKeyTimestamp=r.mediaKeyTimestamp,i.thumbnailWidth=r.width,i.thumbnailHeight=r.height,i.thumbnailSha256=r.fileSha256,i.thumbnailEncSha256=r.fileEncSha256)}t.backgroundColor&&(i.backgroundArgb=await Ase(t.backgroundColor)),t.font&&(i.font=t.font),e.extendedTextMessage=i}else if(mi(n,"contacts")){let i=n.contacts.contacts.length;if(!i)throw new nc.Boom("require atleast 1 contact",{statusCode:400});i===1?e.contactMessage=ne.Message.ContactMessage.create(n.contacts.contacts[0]):e.contactsArrayMessage=ne.Message.ContactsArrayMessage.create(n.contacts)}else if(mi(n,"location"))e.locationMessage=ne.Message.LocationMessage.create(n.location);else if(mi(n,"react"))n.react.senderTimestampMs||(n.react.senderTimestampMs=Date.now()),e.reactionMessage=ne.Message.ReactionMessage.create(n.react);else if(mi(n,"delete"))e.protocolMessage={key:n.delete,type:ne.Message.ProtocolMessage.Type.REVOKE};else if(mi(n,"forward"))e=BVe(n.forward,n.force);else if(mi(n,"disappearingMessagesInChat")){let i=typeof n.disappearingMessagesInChat=="boolean"?n.disappearingMessagesInChat?Vf:0:n.disappearingMessagesInChat;e=CVe(i)}else if(mi(n,"groupInvite")){if(e.groupInviteMessage={},e.groupInviteMessage.inviteCode=n.groupInvite.inviteCode,e.groupInviteMessage.inviteExpiration=n.groupInvite.inviteExpiration,e.groupInviteMessage.caption=n.groupInvite.text,e.groupInviteMessage.groupJid=n.groupInvite.jid,e.groupInviteMessage.groupName=n.groupInvite.subject,t.getProfilePicUrl){let i=await t.getProfilePicUrl(n.groupInvite.jid,"preview");if(i){let A=await fetch(i,{method:"GET",dispatcher:t?.options?.dispatcher});if(A.ok){let r=Buffer.from(await A.arrayBuffer());e.groupInviteMessage.jpegThumbnail=r}}}}else if(mi(n,"pin"))e.pinInChatMessage={},e.messageContextInfo={},e.pinInChatMessage.key=n.pin,e.pinInChatMessage.type=n.type,e.pinInChatMessage.senderTimestampMs=Date.now(),e.messageContextInfo.messageAddOnDurationInSecs=n.type===1?n.time||86400:0;else if(mi(n,"buttonReply"))switch(n.type){case"template":e.templateButtonReplyMessage={selectedDisplayText:n.buttonReply.displayText,selectedId:n.buttonReply.id,selectedIndex:n.buttonReply.index};break;case"plain":e.buttonsResponseMessage={selectedButtonId:n.buttonReply.id,selectedDisplayText:n.buttonReply.displayText,type:ne.Message.ButtonsResponseMessage.Type.DISPLAY_TEXT};break}else if(Ep(n,"ptv")&&n.ptv){let{videoMessage:i}=await qf({video:n.video},t);e.ptvMessage=i}else if(mi(n,"product")){let{imageMessage:i}=await qf({image:n.product.productImage},t);e.productMessage=ne.Message.ProductMessage.create({...n,product:{...n.product,productImage:i}})}else if(mi(n,"listReply"))e.listResponseMessage={...n.listReply};else if(mi(n,"event")){e.eventMessage={};let i=Math.floor(n.event.startDate.getTime()/1e3);if(n.event.call&&t.getCallLink){let A=await t.getCallLink(n.event.call,{startTime:i});e.eventMessage.joinLink=(n.event.call==="audio"?nse:ose)+A}e.messageContextInfo={messageSecret:n.event.messageSecret||ZU(32)},e.eventMessage.name=n.event.name,e.eventMessage.description=n.event.description,e.eventMessage.startTime=i,e.eventMessage.endTime=n.event.endDate?n.event.endDate.getTime()/1e3:void 0,e.eventMessage.isCanceled=n.event.isCancelled??!1,e.eventMessage.extraGuestsAllowed=n.event.extraGuestsAllowed,e.eventMessage.isScheduleCall=n.event.isScheduleCall??!1,e.eventMessage.location=n.event.location}else if(mi(n,"poll")){if((o=n.poll).selectableCount||(o.selectableCount=0),(a=n.poll).toAnnouncementGroup||(a.toAnnouncementGroup=!1),!Array.isArray(n.poll.values))throw new nc.Boom("Invalid poll values",{statusCode:400});if(n.poll.selectableCount<0||n.poll.selectableCount>n.poll.values.length)throw new nc.Boom(`poll.selectableCount in poll should be >= 0 and <= ${n.poll.values.length}`,{statusCode:400});e.messageContextInfo={messageSecret:n.poll.messageSecret||ZU(32)};let i={name:n.poll.name,selectableOptionsCount:n.poll.selectableCount,options:n.poll.values.map(A=>({optionName:A}))};n.poll.toAnnouncementGroup?e.pollCreationMessageV2=i:n.poll.selectableCount===1?e.pollCreationMessageV3=i:e.pollCreationMessage=i}else mi(n,"album")?e.albumMessage={expectedImageCount:n.album.expectedImageCount,expectedVideoCount:n.album.expectedVideoCount}:mi(n,"sharePhoneNumber")?e.protocolMessage={type:ne.Message.ProtocolMessage.Type.SHARE_PHONE_NUMBER}:mi(n,"requestPhoneNumber")?e.requestPhoneNumberMessage={}:mi(n,"limitSharing")?e.protocolMessage={type:ne.Message.ProtocolMessage.Type.LIMIT_SHARING,limitSharing:{sharingLimited:n.limitSharing===!0,trigger:1,limitSharingSettingTimestamp:Date.now(),initiatedByMe:!0}}:e=await qf(n,t);if(Ep(n,"viewOnce")&&n.viewOnce&&(e={viewOnceMessage:{message:e}}),Ep(n,"mentions")&&n.mentions?.length||Ep(n,"mentionAll")&&n.mentionAll){let i=Object.keys(e)[0],A=e[i];A&&"contextInfo"in A?(A.contextInfo=A.contextInfo||{},n.mentions?.length&&(A.contextInfo.mentionedJid=n.mentions),n.mentionAll&&(A.contextInfo.nonJidMentions=1)):A&&(A.contextInfo={mentionedJid:n.mentions,nonJidMentions:n.mentionAll?1:0})}if(Ep(n,"edit")&&(e={protocolMessage:{key:n.edit,editedMessage:e,timestampMs:Date.now(),type:ne.Message.ProtocolMessage.Type.MESSAGE_EDIT}}),Ep(n,"contextInfo")&&n.contextInfo){let i=Object.keys(e)[0],A=e[i];"contextInfo"in A&&A.contextInfo?A.contextInfo={...A.contextInfo,...n.contextInfo}:A&&(A.contextInfo=n.contextInfo)}return Ep(n,"albumParentKey")&&n.albumParentKey&&(e.messageContextInfo={...e.messageContextInfo,messageAssociation:{associationType:ne.MessageAssociation.AssociationType.MEDIA_ALBUM,parentMessageKey:n.albumParentKey}}),zb(e)&&(e.messageContextInfo=e.messageContextInfo||{},e.messageContextInfo.messageSecret||(e.messageContextInfo.messageSecret=ZU(32))),ne.Message.create(e)},QVe=(n,t,o)=>{o.timestamp||(o.timestamp=new Date);let a=Si(t),e=zf(a),i=vi(o.timestamp),{quoted:A,userJid:r}=o;if(A&&!aI(n)){let g=A.key.fromMe?r:A.participant||A.key.participant||A.key.remoteJid,c=Si(A.message),I=zf(c);c=ne.Message.create({[I]:c[I]});let p=c[I];typeof p=="object"&&p&&"contextInfo"in p&&delete p.contextInfo;let B="contextInfo"in a[e]&&a[e]?.contextInfo||{};B.participant=BA(g),B.stanzaId=A.key.id,B.quotedMessage=c,n!==A.key.remoteJid&&(B.remoteJid=A.key.remoteJid),B&&a[e]&&(a[e].contextInfo=B)}o?.ephemeralExpiration&&e!=="protocolMessage"&&e!=="ephemeralMessage"&&!aI(n)&&(a[e].contextInfo={...a[e].contextInfo||{},expiration:o.ephemeralExpiration||Vf}),t=ne.Message.create(t);let s={key:{remoteJid:n,fromMe:!0,id:o?.messageId||Vr()},message:t,messageTimestamp:i,messageStubParameters:[],participant:qr(n)||zg(n)?r:void 0,status:bh.PENDING};return ne.WebMessageInfo.fromObject(s)},tse=async(n,t,o)=>(o.logger=o?.logger?.child({msgId:o.messageId}),QVe(n,await fVe(t,{...o,jid:n}),o)),zf=n=>{if(n)return Object.keys(n).find(a=>(a==="conversation"||a.includes("Message"))&&a!=="senderKeyDistributionMessage")},Si=n=>{if(!n)return;for(let o=0;o<5;o++){let a=t(n);if(!a)break;n=a.message}return n;function t(o){return o?.ephemeralMessage||o?.viewOnceMessage||o?.documentWithCaptionMessage||o?.viewOnceMessageV2||o?.viewOnceMessageV2Extension||o?.editedMessage||o?.associatedChildMessage||o?.groupStatusMessage||o?.groupStatusMessageV2}},rse=n=>{let t=o=>o.imageMessage?{imageMessage:o.imageMessage}:o.documentMessage?{documentMessage:o.documentMessage}:o.videoMessage?{videoMessage:o.videoMessage}:o.locationMessage?{locationMessage:o.locationMessage}:{conversation:"contentText"in o?o.contentText:"hydratedContentText"in o?o.hydratedContentText:""};return n=Si(n),n?.buttonsMessage?t(n.buttonsMessage):n?.templateMessage?.hydratedFourRowTemplate?t(n?.templateMessage?.hydratedFourRowTemplate):n?.templateMessage?.hydratedTemplate?t(n?.templateMessage?.hydratedTemplate):n?.templateMessage?.fourRowTemplate?t(n?.templateMessage?.fourRowTemplate):n};var $U=(n,t)=>{n.userReceipt=n.userReceipt||[];let o=n.userReceipt.find(a=>a.userJid===t.userJid);o?Object.assign(o,t):n.userReceipt.push(t)},eH=(n,t)=>{let o=vh(t.key),a=(n.reactions||[]).filter(e=>vh(e.key)!==o);t.text=t.text||"",a.push(t),n.reactions=a};var ise=n=>{let t={};for(let{remoteJid:o,id:a,participant:e,fromMe:i}of n)if(!i){let A=`${o}:${e||""}`;t[A]||(t[A]={jid:o,participant:e,messageIds:[]}),t[A].messageIds.push(a)}return Object.values(t)},yVe=[410,404],AH=async(n,t,o,a)=>{return await i().catch(async A=>{if(a&&typeof A?.status=="number"&&yVe.includes(A.status))return a.logger.info({key:n.key},"sending reupload media request..."),n=await a.reuploadRequest(n),await i();throw A});async function i(){let A=rse(n.message);if(!A)throw new nc.Boom("No message present",{statusCode:400,data:n});let r=zf(A),s=r?.replace("Message",""),g=A[r];if(!g||typeof g!="object"||!("url"in g)&&!("thumbnailDirectPath"in g))throw new nc.Boom(`"${r}" message is not a media message`);let c;"thumbnailDirectPath"in g&&!("url"in g)?(c={directPath:g.thumbnailDirectPath,mediaKey:g.mediaKey},s="thumbnail-link"):c=g;let I=await OE(c,s,o);if(t==="buffer"){let p=[];for await(let B of I)p.push(B);return Buffer.concat(p)}return I}},ase=n=>{n=rse(n);let t=n?.documentMessage||n?.imageMessage||n?.videoMessage||n?.audioMessage||n?.stickerMessage;if(!t)throw new nc.Boom("given message is not a media message",{statusCode:400,data:n});return t};var Vb=ze(Jr(),1);import{createHash as DVe}from"crypto";function mVe(n,t){let o=[];for(let a=0;a({identifier:{name:n,deviceId:0},identifierKey:An(t)}),SVe=async({get:n},t,o)=>{let a=[];for(let e=t;e{let o=n.nextPreKeyId-n.firstUnuploadedPreKeyId,a=t-o,e=n.nextPreKeyId+a-1,i={};if(a>0)for(let A=n.nextPreKeyId;A<=e;A++)i[A]=br.generateKeyPair();return{newPreKeys:i,lastPreKeyId:e,preKeysRange:[n.firstUnuploadedPreKeyId,t]}},Wf=n=>({tag:"skey",attrs:{},content:[{tag:"id",attrs:{},content:Zg(n.keyId,3)},{tag:"value",attrs:{},content:n.keyPair.public},{tag:"signature",attrs:{},content:n.signature}]}),rH=(n,t)=>({tag:"key",attrs:{},content:[{tag:"id",attrs:{},content:Zg(t,3)},{tag:"value",attrs:{},content:n.public}]}),tH=n=>typeof n=="number"&&Number.isInteger(n),Ise=n=>{let t=le(n,"keys");if(!t)return null;let o=ki(t,"type");if(!o||o.length!==1||o[0]!==Wg[0])return null;let a=ki(t,"identity"),e=le(t,"skey");if(!a||a.length!==32||!e)return null;let i=oI(n,"registration",4);if(!tH(i))return null;let A=ki(e,"value"),r=ki(e,"signature"),s=oI(e,"id",3);if(!A||A.length!==32||!r||!tH(s))return null;let g=le(t,"key"),c;if(g){let I=ki(g,"value"),p=oI(g,"id",3);if(!I||I.length!==32||!tH(p))return null;c={keyId:p,publicKey:An(I)}}return{registrationId:i,identityKey:An(a),signedPreKey:{keyId:s,publicKey:An(A),signature:r},preKey:c}},lse=async(n,t)=>{let o=A=>A?{keyId:oI(A,"id",3),publicKey:An(ki(A,"value")),signature:ki(A,"signature")}:void 0,a=PA(le(n,"list"),"user");for(let A of a)Za(A);let i=mVe(a,100);for(let A of i)for(let r of A){let s=le(r,"skey"),g=le(r,"key"),c=ki(r,"identity"),I=r.attrs.jid,p=oI(r,"registration",4);await t.injectE2ESession({jid:I,session:{registrationId:p,identityKey:An(c),signedPreKey:o(s),preKey:o(g)}})}},pse=(n,t,o,a)=>{let{user:e,device:i}=pA(t),A=[];for(let r of n){let{devices:s,id:g}=r,c=pA(g),{user:I,server:p}=c,{domainType:B}=c,f=s?.deviceList;if(Array.isArray(f))for(let{id:Q,keyIndex:y,isHosted:m}of f)(!a||Q!==0)&&(e!==I&&o!==I||i!==Q)&&(Q===0||y)&&(m&&(B=B===Zt.LID?Zt.HOSTED_LID:Zt.HOSTED),A.push({user:I,device:Q,domainType:B,server:E$(p,B)}))}return A},iH=async({creds:n,keys:t},o)=>{let{newPreKeys:a,lastPreKeyId:e,preKeysRange:i}=wVe(n,o),A={nextPreKeyId:Math.max(e+1,n.nextPreKeyId),firstUnuploadedPreKeyId:Math.max(n.firstUnuploadedPreKeyId,e+1)};await t.set({"pre-key":a});let r=await SVe(t,i[0],i[0]+i[1]);return{update:A,preKeys:r}},dse=async(n,t)=>{let{creds:o}=n,{update:a,preKeys:e}=await iH(n,t),i={tag:"iq",attrs:{xmlns:"encrypt",type:"set",to:OA},content:[{tag:"registration",attrs:{},content:Zg(o.registrationId)},{tag:"type",attrs:{},content:Wg},{tag:"identity",attrs:{},content:o.signedIdentityKey.public},{tag:"list",attrs:{},content:Object.keys(e).map(A=>rH(e[+A],+A))},Wf(o.signedPreKey)]};return{update:a,node:i}};var OVe=n=>({appVersion:{primary:n.version[0],secondary:n.version[1],tertiary:n.version[2]},platform:n.browser[1].toLocaleLowerCase().includes("android")?ne.ClientPayload.UserAgent.Platform.ANDROID:ne.ClientPayload.UserAgent.Platform.WEB,releaseChannel:ne.ClientPayload.UserAgent.ReleaseChannel.RELEASE,osVersion:"0.1",device:"Desktop",osBuildNumber:"0.1",localeLanguageIso6391:"en",mnc:"000",mcc:"000",localeCountryIso31661Alpha2:n.countryCode}),hse={"Mac OS":ne.ClientPayload.WebInfo.WebSubPlatform.DARWIN,Windows:ne.ClientPayload.WebInfo.WebSubPlatform.WIN32},bVe=n=>{let t=ne.ClientPayload.WebInfo.WebSubPlatform.WEB_BROWSER;return n.syncFullHistory&&hse[n.browser[0]]&&n.browser[1]==="Desktop"&&(t=hse[n.browser[0]]),{webSubPlatform:t}},Ese=n=>{let t={connectType:ne.ClientPayload.ConnectType.WIFI_UNKNOWN,connectReason:ne.ClientPayload.ConnectReason.USER_ACTIVATED,userAgent:OVe(n)};return n.browser[1].toLocaleLowerCase().includes("android")||(t.webInfo=bVe(n)),n.pushName&&(t.pushName=n.pushName),t},use=(n,t)=>{let{user:o,device:a}=pA(n),e={...Ese(t),passive:!0,pull:!0,username:+o,device:a,lidDbMigrated:!1};return ne.ClientPayload.fromObject(e)},MVe=n=>{let t=n.toUpperCase();return t==="ANDROID"?ne.DeviceProps.PlatformType.ANDROID_PHONE:ne.DeviceProps.PlatformType[t]||ne.DeviceProps.PlatformType.CHROME},Cse=({registrationId:n,signedPreKey:t,signedIdentityKey:o},a)=>{let e=DVe("md5").update(a.version.join(".")).digest(),i={os:a.browser[0],platformType:MVe(a.browser[1]),requireFullSync:a.syncFullHistory,historySyncConfig:{storageQuotaMb:10240,inlineInitialPayloadInE2EeMsg:!0,recentSyncDaysLimit:void 0,supportCallLogHistory:!1,supportBotUserAgentChatHistory:!0,supportCagReactionsAndPolls:!0,supportBizHostedMsg:!0,supportRecentSyncChunkMessageCountTuning:!0,supportHostedGroupMsg:!0,supportFbidBotChatHistory:!0,supportAddOnHistorySyncMigration:void 0,supportMessageAssociation:!0,supportGroupHistory:!1,onDemandReady:void 0,supportGuestChat:void 0},version:{primary:10,secondary:15,tertiary:7}},A=ne.DeviceProps.encode(i).finish(),r={...Ese(a),passive:!1,pull:!1,devicePairingData:{buildHash:e,deviceProps:A,eRegid:Zg(n),eKeytype:Wg,eIdent:o.public,eSkeyId:Zg(t.keyId,3),eSkeyVal:t.keyPair.public,eSkeySig:t.signature}};return ne.ClientPayload.fromObject(r)},Bse=(n,{advSecretKey:t,signedIdentityKey:o,signalIdentities:a})=>{let e=n.attrs.id,i=le(n,"pair-success"),A=le(i,"device-identity"),r=le(i,"platform"),s=le(i,"device"),g=le(i,"biz");if(!A||!s)throw new Vb.Boom("Missing device-identity or device in pair success node",{data:n});let c=g?.attrs.name,I=s.attrs.jid,p=s.attrs.lid,{details:B,hmac:f,accountType:Q}=ne.ADVSignedDeviceIdentityHMAC.decode(A.content),y=Buffer.from([]);Q!==void 0&&Q===ne.ADVEncryptionType.HOSTED&&(y=aH);let m=Wn(Buffer.concat([y,B]),Buffer.from(t,"base64"));if(Buffer.compare(f,m)!==0)throw new Vb.Boom("Invalid account signature");let T=ne.ADVSignedDeviceIdentity.decode(B),{accountSignatureKey:_,accountSignature:R,details:L}=T,U=ne.ADVDeviceIdentity.decode(L),F=U.deviceType===ne.ADVEncryptionType.HOSTED?aH:fse,q=Buffer.concat([F,L,o.public]);if(!br.verify(_,q,R))throw new Vb.Boom("Failed to verify account signature");let z=Buffer.concat([Qse,L,o.public,_]);T.deviceSignature=br.sign(o.private,z);let K=cse(p,_),G=Zf(T,!1),V={tag:"iq",attrs:{to:OA,type:"result",id:e},content:[{tag:"pair-device-sign",attrs:{},content:[{tag:"device-identity",attrs:{"key-index":U.keyIndex.toString()},content:G}]}]};return{creds:{account:T,me:{id:I,name:c,lid:p},signalIdentities:[...a||[],K],platform:r?.attrs.name},reply:V}},Zf=(n,t)=>(n={...n},(!t||!n.accountSignatureKey?.length)&&(n.accountSignatureKey=null),ne.ADVSignedDeviceIdentity.encode(n).finish());var bE=ze(Jr(),1);var Sse=12,yse=Buffer.alloc(0),mse=n=>{let t=new ArrayBuffer(Sse);return new DataView(t).setUint32(8,n),new Uint8Array(t)},oH=class{constructor(t,o){this.encKey=t,this.decKey=o,this.readCounter=0,this.writeCounter=0,this.iv=new Uint8Array(Sse)}encrypt(t){let o=this.writeCounter++;return this.iv[8]=o>>>24&255,this.iv[9]=o>>>16&255,this.iv[10]=o>>>8&255,this.iv[11]=o&255,Jl(t,this.encKey,this.iv,yse)}decrypt(t){let o=this.readCounter++;return this.iv[8]=o>>>24&255,this.iv[9]=o>>>16&255,this.iv[10]=o>>>8&255,this.iv[11]=o&255,ql(t,this.decKey,this.iv,yse)}},wse=({keyPair:{private:n,public:t},NOISE_HEADER:o,logger:a,routingInfo:e})=>{a=a.child({class:"ns"});let i=Buffer.from(Dse),A=i.byteLength===32?i:kh(i),r=A,s=A,g=A,c=0,I=!1,p=Buffer.alloc(0),B=null,f=!1,Q=null,y;e?(y=Buffer.alloc(7+e.byteLength+o.length),y.write("ED",0,"utf8"),y.writeUint8(0,2),y.writeUint8(1,3),y.writeUint8(e.byteLength>>16,4),y.writeUint16BE(e.byteLength&65535,5),y.set(e,7),y.set(o,7+e.byteLength)):y=Buffer.from(o);let m=q=>{B||(A=kh(Buffer.concat([A,q])))},T=q=>{if(B)return B.encrypt(q);let z=Jl(q,s,mse(c++),A);return m(z),z},_=q=>{if(B)return B.decrypt(q);let z=ql(q,g,mse(c++),A);return m(q),z},R=q=>{let z=Vn(Buffer.from(q),64,{salt:r,info:""});return[z.subarray(0,32),z.subarray(32)]},L=q=>{let[z,K]=R(q);r=z,s=K,g=K,c=0},U=async()=>{f=!0;let[q,z]=R(new Uint8Array(0));B=new oH(q,z),f=!1,a.trace("Noise handler transitioned to Transport state"),Q&&(a.trace({length:p.length},"Flushing buffered frames after transport ready"),await F(Q),Q=null)},F=async q=>{let z;for(;;){if(p.length<3||(z=p[0]<<16|p[1]<<8|p[2],p.length{m(q.ephemeral),L(br.sharedKey(n,q.ephemeral));let K=_(q.static);L(br.sharedKey(n,K));let G=_(q.payload),{intermediate:V,leaf:H}=ne.CertChain.decode(G);if(!H?.details||!H?.signature)throw new bE.Boom("invalid noise leaf certificate",{statusCode:400});if(!V?.details||!V?.signature)throw new bE.Boom("invalid noise intermediate certificate",{statusCode:400});let N=ne.CertChain.NoiseCertificate.Details.decode(V.details),{issuerSerial:k}=N,J=br.verify(N.key,H.details,H.signature),X=br.verify(nH.PUBLIC_KEY,V.details,V.signature);if(!J)throw new bE.Boom("noise certificate signature invalid",{statusCode:400});if(!X)throw new bE.Boom("noise intermediate certificate signature invalid",{statusCode:400});if(k!==nH.SERIAL)throw new bE.Boom("certification match failed",{statusCode:400});let ie=T(z.public);return L(br.sharedKey(z.private,q.ephemeral)),ie},encodeFrame:q=>{B&&(q=B.encrypt(q));let z=q.byteLength,K=I?0:y.length,G=Buffer.allocUnsafe(K+3+z);return I||(G.set(y),I=!0),G[K]=z>>>16&255,G[K+1]=z>>>8&255,G[K+2]=z&255,G.set(q,K+3),G},decodeFrame:async(q,z)=>{if(f){p=Buffer.concat([p,q]),Q=z;return}p.length===0?p=Buffer.from(q):p=Buffer.concat([p,q]),await F(z)}}};import{pipeline as _Ve}from"stream/promises";import{promisify as TVe}from"util";import{createInflate as NVe,inflate as RVe}from"zlib";var kVe=TVe(RVe),vVe=n=>{for(let t of n){let o=t.message;if(!o?.key?.fromMe||!o.userReceipt?.length)continue;let a=o.userReceipt[0]?.userJid;if(a&&(Rt(a)||Or(a)))return a}},PVe=async(n,t)=>{let o=await OE(n,"md-msg-hist",{options:t}),a=NVe(),e=[];a.on("data",r=>e.push(r)),await _Ve(o,a);let i=Buffer.concat(e);return ne.HistorySync.decode(i)},GVe=(n,t)=>{let o=[],a=[],e=[],i=[];t?.trace({progress:n.progress},"processing history of type "+n.syncType?.toString());for(let A of n.phoneNumberToLidMappings||[])A.lidJid&&A.pnJid&&i.push({lid:A.lidJid,pn:A.pnJid});switch(n.syncType){case ne.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP:case ne.HistorySync.HistorySyncType.RECENT:case ne.HistorySync.HistorySyncType.FULL:case ne.HistorySync.HistorySyncType.ON_DEMAND:for(let A of n.conversations){a.push({id:A.id,name:A.displayName||A.name||A.username||void 0,username:A.username||void 0,lid:A.lidJid||A.accountLid||void 0,phoneNumber:A.pnJid||void 0});let r=A.id,s=qA(r)||Ci(r),g=Rt(r)||Or(r);if(s&&A.pnJid)i.push({lid:r,pn:A.pnJid});else if(g&&A.lidJid)i.push({lid:A.lidJid,pn:r});else if(s&&!A.pnJid){let I=vVe(A.messages||[]);I&&i.push({lid:r,pn:I})}let c=A.messages||[];delete A.messages;for(let I of c){let p=I.message;o.push(p),A.messages?.length||(A.messages=[{message:p}]),!p.key.fromMe&&!A.lastMessageRecvTimestamp&&(A.lastMessageRecvTimestamp=zr(p.messageTimestamp)),(p.messageStubType===RA.BIZ_PRIVACY_MODE_TO_BSP||p.messageStubType===RA.BIZ_PRIVACY_MODE_TO_FB)&&p.messageStubParameters?.[0]&&a.push({id:p.key.participant||p.key.remoteJid,verifiedName:p.messageStubParameters?.[0]})}e.push(A)}break;case ne.HistorySync.HistorySyncType.PUSH_NAME:for(let A of n.pushnames)a.push({id:A.id,notify:A.pushname});break}return{chats:e,contacts:a,messages:o,lidPnMappings:i,pastParticipants:n.pastParticipants,syncType:n.syncType,progress:n.progress}},Ose=async(n,t,o)=>{let a;return n.initialHistBootstrapInlinePayload?a=ne.HistorySync.decode(await kVe(n.initialHistBootstrapInlinePayload)):a=await PVe(n,t),GVe(a,o)},Wb=n=>(n?Si(n):void 0)?.protocolMessage?.historySyncNotification;var pn=ze(Jr(),1);var ig;(function(n){n.Chat="label_jid",n.Message="label_message"})(ig||(ig={}));var bse=new Th;var Mse=(n,t,o)=>{let a=[];if(!t)return o?.warn({hasFullName:!!n.fullName,hasLidJid:!!n.lidJid,hasPnJid:!!n.pnJid},"contactAction sync: missing id in index"),a;let e=n.lidJid,i=Rt(t),A=i?t:n.pnJid||void 0;return a.push({event:"contacts.upsert",data:[{id:t,name:n.fullName||n.firstName||n.username||void 0,username:n.username||void 0,lid:e||void 0,phoneNumber:A}]}),e&&qA(e)&&i&&a.push({event:"lid-mapping.update",data:{lid:e,pn:t}}),a},_se=(n,t)=>{for(let o of t)o.event==="contacts.upsert"?n.emit("contacts.upsert",o.data):n.emit("lid-mapping.update",o.data)};var Xf=n=>{let t=F$(n);return{indexKey:t.indexKey,valueEncryptionKey:t.valueEncryptionKey,valueMacKey:t.valueMacKey,snapshotMacKey:t.snapshotMacKey,patchMacKey:t.patchMacKey}},Tse=(n,t,o,a)=>{let e=n===ne.SyncdMutation.SyncdOperation.SET?1:2,i=typeof o=="string"?Buffer.from(o,"base64"):o,A=new Uint8Array(1+i.length);A[0]=e,A.set(i,1);let r=new Uint8Array(8);r[7]=A.length;let s=new Uint8Array(A.length+t.length+r.length);return s.set(A,0),s.set(t,A.length),s.set(r,A.length+t.length),Wn(s,a,"sha512").subarray(0,32)},Nse=n=>{let t=Buffer.alloc(8);return t.writeUint32BE(n,4),t},Rse=({indexValueMap:n,hash:t})=>{n={...n};let o=[],a=[];return{mix:({indexMac:e,valueMac:i,operation:A})=>{let r=Buffer.from(e).toString("base64"),s=n[r];if(A===ne.SyncdMutation.SyncdOperation.REMOVE){if(!s)return;delete n[r]}else o.push(i),n[r]={valueMac:i};s&&a.push(s.valueMac)},finish:()=>{let e=bse.subtractThenAdd(t,a,o);return{hash:Buffer.from(e),indexValueMap:n}}}},sH=(n,t,o,a)=>{let e=Buffer.concat([n,Nse(t),Buffer.from(o,"utf-8")]);return Wn(e,a,"sha256")},kse=(n,t,o,a,e)=>{let i=Buffer.concat([n,...t,Nse(o),Buffer.from(a,"utf-8")]);return Wn(i,e)},Zb=()=>({version:0,hash:Buffer.alloc(128),indexValueMap:{}}),gH=n=>((typeof n.version!="number"||isNaN(n.version))&&(n.version=0),n),cH=2,$f=n=>n?.data?.isMissingKey===!0,vse=(n,t)=>t>=cH||n?.name==="TypeError",Pse=async({type:n,index:t,syncAction:o,apiVersion:a,operation:e},i,A,r)=>{let s=i?await r(i):void 0;if(!s)throw new pn.Boom(`myAppStateKey ("${i}") not present`,{data:{isMissingKey:!0}});let g=Buffer.from(i,"base64");A={...A,indexValueMap:{...A.indexValueMap}};let c=Buffer.from(JSON.stringify(t)),I=ne.SyncActionData.fromObject({index:c,value:o,padding:new Uint8Array(0),version:a}),p=ne.SyncActionData.encode(I).finish(),B=Xf(s.keyData),f=J$(p,B.valueEncryptionKey),Q=Tse(e,f,g,B.valueMacKey),y=Wn(c,B.indexKey),m=Rse(A);m.mix({indexMac:y,valueMac:Q,operation:e}),Object.assign(A,m.finish()),A.version+=1;let T=sH(A.hash,A.version,n,B.snapshotMacKey),_={patchMac:kse(T,[Q],A.version,n,B.patchMacKey),snapshotMac:T,keyId:{id:g},mutations:[{operation:e,record:{index:{blob:y},value:{blob:Buffer.concat([f,Q])},keyId:{id:g}}}]},R=y.toString("base64");return A.indexValueMap[R]={valueMac:Q},{patch:_,state:A}},Gse=async(n,t,o,a,e)=>{let i=Rse(t),A=new Map;for(let s of n){let g="operation"in s?s.operation:ne.SyncdMutation.SyncdOperation.SET,c="record"in s&&s.record?s.record:s,I;try{I=await r(c.keyId.id)}catch(T){if($f(T))throw T;continue}let p=c.value.blob,B=p.subarray(0,-32),f=p.subarray(-32);if(e){let T=Tse(g,B,c.keyId.id,I.valueMacKey);if(Buffer.compare(T,f)!==0)continue}let Q;try{Q=j$(B,I.valueEncryptionKey)}catch{continue}let y=ne.SyncActionData.decode(Q);if(e){let T=Wn(y.index,I.indexKey);if(Buffer.compare(T,c.index.blob)!==0)throw new pn.Boom("HMAC index verification failed")}let m=Buffer.from(y.index).toString();a({syncAction:y,index:JSON.parse(m)}),i.mix({indexMac:c.index.blob,valueMac:f,operation:g})}return i.finish();async function r(s){let g=Buffer.from(s).toString("base64"),c=A.get(g);if(c)return c;let I=await o(g);if(!I)throw new pn.Boom(`failed to find key "${g}" to decode mutation`,{data:{isMissingKey:!0,msgMutations:n}});let p=Xf(I.keyData);return A.set(g,p),p}},FVe=async(n,t,o,a,e,i)=>{if(i){let r=Buffer.from(n.keyId.id).toString("base64"),s=await a(r);if(!s)throw new pn.Boom(`failed to find key "${r}" to decode patch`,{data:{isMissingKey:!0,msg:n}});let g=Xf(s.keyData),c=n.mutations.map(p=>p.record.value.blob.slice(-32)),I=kse(n.snapshotMac,c,zr(n.version.version),t,g.patchMacKey);if(Buffer.compare(I,n.patchMac)!==0)throw new pn.Boom("Invalid patch mac")}return await Gse(n.mutations,o,a,e,i)},Fse=async(n,t)=>{let o=le(n,"sync"),a=PA(o,"collection"),e={};return await Promise.all(a.map(async i=>{let A=le(i,"patches"),r=PA(A||i,"patch"),s=le(i,"snapshot"),g=[],c=i.attrs.name,I=i.attrs.has_more_patches==="true",p;if(s&&s.content){Buffer.isBuffer(s)||(s.content=Buffer.from(Object.values(s.content)));let B=ne.ExternalBlobReference.decode(s.content),f=await Lse(B,t);p=ne.SyncdSnapshot.decode(f)}for(let{content:B}of r)if(B){Buffer.isBuffer(B)||(B=Buffer.from(Object.values(B)));let f=ne.SyncdPatch.decode(B);f.version||(f.version={version:+i.attrs.version+1}),g.push(f)}e[c]={patches:g,hasMorePatches:I,snapshot:p}})),e},Lse=async(n,t)=>{let o=await OE(n,"md-app-state",{options:t}),a=[];for await(let e of o)a.push(e);return Buffer.concat(a)},LVe=async(n,t)=>{let o=await Lse(n,t);return ne.SyncdMutations.decode(o)},Use=async(n,t,o,a,e=!0,i)=>{let A=Zb();A.version=zr(t.version.version);let r={},s=typeof a>"u"||A.version>a,{hash:g,indexValueMap:c}=await Gse(t.records,A,o,s?I=>{let p=I.syncAction.index?.toString();r[p]=I}:()=>{},e);if(A.hash=g,A.indexValueMap=c,e){let I=Buffer.from(t.keyId.id).toString("base64"),p=await o(I);if(!p)throw new pn.Boom(`failed to find key "${I}" to decode mutation`,{data:{isMissingKey:!0}});let B=Xf(p.keyData),f=sH(A.hash,A.version,n,B.snapshotMacKey);Buffer.compare(t.mac,f)!==0&&i?.warn({name:n,version:A.version},"LTHash verification failed on snapshot, continuing with partial state")}return{state:A,mutationMap:r}},IH=async(n,t,o,a,e,i,A,r=!0)=>{let s={...o,indexValueMap:{...o.indexValueMap}},g={};for(let c of t){let{version:I,keyId:p,snapshotMac:B}=c;if(c.externalMutations){A?.trace({name:n,version:I},"downloading external patch");let m=await LVe(c.externalMutations,e);A?.debug({name:n,version:I,mutations:m.mutations.length},"downloaded external patch"),c.mutations?.push(...m.mutations)}let f=zr(I.version);s.version=f;let Q=typeof i>"u"||f>i,y;try{y=await FVe(c,n,s,a,Q?m=>{let T=m.syncAction.index?.toString();g[T]=m}:()=>{},r)}catch(m){if($f(m))throw m;A?.warn({name:n,version:f,error:m.message},"failed to decode patch, skipping");continue}if(s.hash=y.hash,s.indexValueMap=y.indexValueMap,r){let m=Buffer.from(p.id).toString("base64"),T=await a(m);if(!T)throw new pn.Boom(`failed to find key "${m}" to decode mutation`,{data:{isMissingKey:!0}});let _=Xf(T.keyData),R=sH(s.hash,s.version,n,_.snapshotMacKey);if(Buffer.compare(B,R)!==0){A?.warn({name:n,version:s.version},"LTHash verification failed, skipping remaining patches");break}}c.mutations=[]}return{state:s,mutationMap:g}},Hse=(n,t)=>{let o=ne.SyncdMutation.SyncdOperation,a=i=>{let A;return Array.isArray(i)?A={lastMessageTimestamp:i[i.length-1]?.messageTimestamp,messages:i?.length?i.map(s=>{if(!s.key?.id||!s.key?.remoteJid)throw new pn.Boom("Incomplete key",{statusCode:400,data:s});if(qr(s.key.remoteJid)&&!s.key.fromMe&&!s.key.participant)throw new pn.Boom("Expected not from me message to have participant",{statusCode:400,data:s});if(!s.messageTimestamp||!zr(s.messageTimestamp))throw new pn.Boom("Missing timestamp in last message list",{statusCode:400,data:s});return s.key.participant&&(s.key.participant=BA(s.key.participant)),s}):void 0}:A=i,A},e;if("mute"in n)e={syncAction:{muteAction:{muted:!!n.mute,muteEndTimestamp:n.mute||void 0}},index:["mute",t],type:"regular_high",apiVersion:2,operation:o.SET};else if("archive"in n)e={syncAction:{archiveChatAction:{archived:!!n.archive,messageRange:a(n.lastMessages)}},index:["archive",t],type:"regular_low",apiVersion:3,operation:o.SET};else if("markRead"in n)e={syncAction:{markChatAsReadAction:{read:n.markRead,messageRange:a(n.lastMessages)}},index:["markChatAsRead",t],type:"regular_low",apiVersion:3,operation:o.SET};else if("deleteForMe"in n){let{timestamp:i,key:A,deleteMedia:r}=n.deleteForMe;e={syncAction:{deleteMessageForMeAction:{deleteMedia:r,messageTimestamp:i}},index:["deleteMessageForMe",t,A.id,A.fromMe?"1":"0","0"],type:"regular_high",apiVersion:3,operation:o.SET}}else if("clear"in n)e={syncAction:{clearChatAction:{messageRange:a(n.lastMessages)}},index:["clearChat",t,"1","0"],type:"regular_high",apiVersion:6,operation:o.SET};else if("pin"in n)e={syncAction:{pinAction:{pinned:!!n.pin}},index:["pin_v1",t],type:"regular_low",apiVersion:5,operation:o.SET};else if("contact"in n)e={syncAction:{contactAction:n.contact||{}},index:["contact",t],type:"critical_unblock_low",apiVersion:2,operation:n.contact?o.SET:o.REMOVE};else if("disableLinkPreviews"in n)e={syncAction:{privacySettingDisableLinkPreviewsAction:n.disableLinkPreviews||{}},index:["setting_disableLinkPreviews"],type:"regular",apiVersion:8,operation:o.SET};else if("star"in n){let i=n.star.messages[0];e={syncAction:{starAction:{starred:!!n.star.star}},index:["star",t,i.id,i.fromMe?"1":"0","0"],type:"regular_low",apiVersion:2,operation:o.SET}}else if("delete"in n)e={syncAction:{deleteChatAction:{messageRange:a(n.lastMessages)}},index:["deleteChat",t,"1"],type:"regular_high",apiVersion:6,operation:o.SET};else if("pushNameSetting"in n)e={syncAction:{pushNameSetting:{name:n.pushNameSetting}},index:["setting_pushName"],type:"critical_block",apiVersion:1,operation:o.SET};else if("quickReply"in n)e={syncAction:{quickReplyAction:{count:0,deleted:n.quickReply.deleted||!1,keywords:[],message:n.quickReply.message||"",shortcut:n.quickReply.shortcut||""}},index:["quick_reply",n.quickReply.timestamp||String(Math.floor(Date.now()/1e3))],type:"regular",apiVersion:2,operation:o.SET};else if("addLabel"in n)e={syncAction:{labelEditAction:{name:n.addLabel.name,color:n.addLabel.color,predefinedId:n.addLabel.predefinedId,deleted:n.addLabel.deleted}},index:["label_edit",n.addLabel.id],type:"regular",apiVersion:3,operation:o.SET};else if("addChatLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!0}},index:[ig.Chat,n.addChatLabel.labelId,t],type:"regular",apiVersion:3,operation:o.SET};else if("removeChatLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!1}},index:[ig.Chat,n.removeChatLabel.labelId,t],type:"regular",apiVersion:3,operation:o.SET};else if("addMessageLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!0}},index:[ig.Message,n.addMessageLabel.labelId,t,n.addMessageLabel.messageId,"0","0"],type:"regular",apiVersion:3,operation:o.SET};else if("removeMessageLabel"in n)e={syncAction:{labelAssociationAction:{labeled:!1}},index:[ig.Message,n.removeMessageLabel.labelId,t,n.removeMessageLabel.messageId,"0","0"],type:"regular",apiVersion:3,operation:o.SET};else throw new pn.Boom("not supported");return e.syncAction.timestamp=Date.now(),e},Kse=(n,t,o,a,e)=>{let i=!!a,A=a?.accountSettings;e?.trace({syncAction:n,initialSync:!!a},"processing sync action");let{syncAction:{value:r},index:[s,g,c,I]}=n;if(r?.muteAction)t.emit("chats.update",[{id:g,muteEndTime:r.muteAction?.muted?zr(r.muteAction.muteEndTimestamp):null,conditional:p(g,void 0)}]);else if(r?.archiveChatAction||s==="archive"||s==="unarchive"){let f=r?.archiveChatAction,Q=f?f.archived:s==="archive",y=A?.unarchiveChats?f?.messageRange:void 0;t.emit("chats.update",[{id:g,archived:Q,conditional:p(g,y)}])}else if(r?.markChatAsReadAction){let f=r.markChatAsReadAction,Q=i&&f.read;t.emit("chats.update",[{id:g,unreadCount:Q?null:f?.read?0:-1,conditional:p(g,f?.messageRange)}])}else if(r?.deleteMessageForMeAction||s==="deleteMessageForMe")t.emit("messages.delete",{keys:[{remoteJid:g,id:c,fromMe:I==="1"}]});else if(r?.contactAction){let f=Mse(r.contactAction,g,e);_se(t,f)}else if(r?.pushNameSetting){let f=r?.pushNameSetting?.name;f&&o?.name!==f&&t.emit("creds.update",{me:{...o,name:f}})}else if(r?.pinAction)t.emit("chats.update",[{id:g,pinned:r.pinAction?.pinned?zr(r.timestamp):null,conditional:p(g,void 0)}]);else if(r?.unarchiveChatsSetting){let f=!!r.unarchiveChatsSetting.unarchiveChats;t.emit("creds.update",{accountSettings:{unarchiveChats:f}}),e?.info(`archive setting updated => '${r.unarchiveChatsSetting.unarchiveChats}'`),A&&(A.unarchiveChats=f)}else if(r?.starAction||s==="star"){let f=r?.starAction?.starred;typeof f!="boolean"&&(f=n.index[n.index.length-1]==="1"),t.emit("messages.update",[{key:{remoteJid:g,id:c,fromMe:I==="1"},update:{starred:f}}])}else if(r?.deleteChatAction||s==="deleteChat")i||t.emit("chats.delete",[g]);else if(r?.labelEditAction){let{name:f,color:Q,deleted:y,predefinedId:m}=r.labelEditAction;t.emit("labels.edit",{id:g,name:f,color:Q,deleted:y,predefinedId:m?String(m):void 0})}else r?.labelAssociationAction?t.emit("labels.association",{type:r.labelAssociationAction.labeled?"add":"remove",association:s===ig.Chat?{type:ig.Chat,chatId:n.index[2],labelId:n.index[1]}:{type:ig.Message,chatId:n.index[2],messageId:n.index[3],labelId:n.index[1]}}):r?.localeSetting?.locale?t.emit("settings.update",{setting:"locale",value:r.localeSetting.locale}):r?.timeFormatAction?t.emit("settings.update",{setting:"timeFormat",value:r.timeFormatAction}):r?.pnForLidChatAction?r.pnForLidChatAction.pnJid&&t.emit("lid-mapping.update",{lid:g,pn:r.pnForLidChatAction.pnJid}):r?.privacySettingRelayAllCalls?t.emit("settings.update",{setting:"privacySettingRelayAllCalls",value:r.privacySettingRelayAllCalls}):r?.statusPrivacy?t.emit("settings.update",{setting:"statusPrivacy",value:r.statusPrivacy}):r?.lockChatAction?t.emit("chats.lock",{id:g,locked:!!r.lockChatAction.locked}):r?.privacySettingDisableLinkPreviewsAction?t.emit("settings.update",{setting:"disableLinkPreviews",value:r.privacySettingDisableLinkPreviewsAction}):r?.notificationActivitySettingAction?.notificationActivitySetting?t.emit("settings.update",{setting:"notificationActivitySetting",value:r.notificationActivitySettingAction.notificationActivitySetting}):r?.lidContactAction?t.emit("contacts.upsert",[{id:g,name:r.lidContactAction.fullName||r.lidContactAction.firstName||r.lidContactAction.username||void 0,username:r.lidContactAction.username||void 0,lid:g,phoneNumber:void 0}]):r?.privacySettingChannelsPersonalisedRecommendationAction?t.emit("settings.update",{setting:"channelsPersonalisedRecommendation",value:r.privacySettingChannelsPersonalisedRecommendationAction}):e?.debug({syncAction:n,id:g},"unprocessable update");function p(f,Q){return i?y=>{let m=y.historySets.chats[f]||y.chatUpserts[f];if(m)return Q?B(m,Q):!0}:void 0}function B(f,Q){let y=Number(Q?.lastMessageTimestamp||Q?.lastSystemMessageTimestamp||0),m=Number(f?.lastMessageRecvTimestamp||0);return y>=m}};var UVe=class{_eventListeners;_maxListeners;_logger;_throwOnEmitError=!1;_throwOnEmptyListeners=!1;_errorEvent="error";constructor(n){this._eventListeners=new Map,this._maxListeners=100,this._logger=n?.logger,n?.throwOnEmitError!==void 0&&(this._throwOnEmitError=n.throwOnEmitError),n?.throwOnEmptyListeners!==void 0&&(this._throwOnEmptyListeners=n.throwOnEmptyListeners)}get logger(){return this._logger}set logger(n){this._logger=n}get throwOnEmitError(){return this._throwOnEmitError}set throwOnEmitError(n){this._throwOnEmitError=n}get throwOnEmptyListeners(){return this._throwOnEmptyListeners}set throwOnEmptyListeners(n){this._throwOnEmptyListeners=n}once(n,t){let o=(...a)=>{this.off(n,o),t(...a)};return this.on(n,o),this}listenerCount(n){if(n===void 0)return this.getAllListeners().length;let t=this._eventListeners.get(n);return t?t.length:0}eventNames(){return[...this._eventListeners.keys()]}rawListeners(n){return n===void 0?this.getAllListeners():this._eventListeners.get(n)??[]}prependListener(n,t){let o=this._eventListeners.get(n)??[];return o.unshift(t),this._eventListeners.set(n,o),this}prependOnceListener(n,t){let o=(...a)=>{this.off(n,o),t(...a)};return this.prependListener(n,o),this}maxListeners(){return this._maxListeners}addListener(n,t){return this.on(n,t),this}on(n,t){this._eventListeners.has(n)||this._eventListeners.set(n,[]);let o=this._eventListeners.get(n);return o&&(o.length>=this._maxListeners&&console.warn(`MaxListenersExceededWarning: Possible event memory leak detected. ${o.length+1} ${n} listeners added. Use setMaxListeners() to increase limit.`),o.push(t)),this}removeListener(n,t){return this.off(n,t),this}off(n,t){let o=this._eventListeners.get(n)??[],a=o.indexOf(t);return a!==-1&&o.splice(a,1),o.length===0&&this._eventListeners.delete(n),this}emit(n,...t){let o=!1,a=this._eventListeners.get(n);if(a&&a.length>0)for(let e of a)e(...t),o=!0;if(n===this._errorEvent){let e=t[0]instanceof Error?t[0]:new Error(`${t[0]}`);if(this._throwOnEmitError&&!o)throw e;if(this.listeners(this._errorEvent).length===0&&this._throwOnEmptyListeners===!0)throw e}return this.sendLog(n,t),o}listeners(n){return this._eventListeners.get(n)??[]}removeAllListeners(n){return n!==void 0?this._eventListeners.delete(n):this._eventListeners.clear(),this}setMaxListeners(n){this._maxListeners=n;for(let t of this._eventListeners.values())t.length>n&&t.splice(n)}getAllListeners(){let n=[];for(let t of this._eventListeners.values())n=[...n,...t];return n}sendLog(n,t){if(!this._logger)return;let o;switch(typeof t=="string"?o=t:Array.isArray(t)&&t.length>0&&t[0]instanceof Error?o=t[0].message:t instanceof Error?o=t.message:Array.isArray(t)&&t.length>0&&typeof t[0]?.message=="string"?o=t[0].message:o=JSON.stringify(t),n){case"error":{this._logger.error?.(o,{event:n,data:t});break}case"warn":{this._logger.warn?.(o,{event:n,data:t});break}case"trace":{this._logger.trace?.(o,{event:n,data:t});break}case"debug":{this._logger.debug?.(o,{event:n,data:t});break}case"fatal":{this._logger.fatal?.(o,{event:n,data:t});break}default:{this._logger.info?.(o,{event:n,data:t});break}}}},_I=class extends UVe{_hooks;_throwOnHookError=!1;_enforceBeforeAfter=!1;_deprecatedHooks;_allowDeprecated=!0;constructor(n){super({logger:n?.logger,throwOnEmitError:n?.throwOnEmitError,throwOnEmptyListeners:n?.throwOnEmptyListeners}),this._hooks=new Map,this._deprecatedHooks=n?.deprecatedHooks?new Map(n.deprecatedHooks):new Map,n?.throwOnHookError!==void 0?this._throwOnHookError=n.throwOnHookError:n?.throwHookErrors!==void 0&&(this._throwOnHookError=n.throwHookErrors),n?.enforceBeforeAfter!==void 0&&(this._enforceBeforeAfter=n.enforceBeforeAfter),n?.allowDeprecated!==void 0&&(this._allowDeprecated=n.allowDeprecated)}get hooks(){return this._hooks}get throwHookErrors(){return this._throwOnHookError}set throwHookErrors(n){this._throwOnHookError=n}get throwOnHookError(){return this._throwOnHookError}set throwOnHookError(n){this._throwOnHookError=n}get enforceBeforeAfter(){return this._enforceBeforeAfter}set enforceBeforeAfter(n){this._enforceBeforeAfter=n}get deprecatedHooks(){return this._deprecatedHooks}set deprecatedHooks(n){this._deprecatedHooks=n}get allowDeprecated(){return this._allowDeprecated}set allowDeprecated(n){this._allowDeprecated=n}validateHookName(n){if(this._enforceBeforeAfter){let t=n.trim().toLocaleLowerCase();if(!t.startsWith("before")&&!t.startsWith("after"))throw new Error(`Hook event "${n}" must start with "before" or "after" when enforceBeforeAfter is enabled`)}}checkDeprecatedHook(n){if(this._deprecatedHooks.has(n)){let t=this._deprecatedHooks.get(n),o=`Hook "${n}" is deprecated${t?`: ${t}`:""}`;return this.emit("warn",{hook:n,message:o}),this._allowDeprecated}return!0}onHook(n,t){this.onHookEntry({event:n,handler:t})}onHookEntry(n){if(this.validateHookName(n.event),!this.checkDeprecatedHook(n.event))return;let t=this._hooks.get(n.event);t?t.push(n.handler):this._hooks.set(n.event,[n.handler])}addHook(n,t){this.onHookEntry({event:n,handler:t})}onHooks(n){for(let t of n)this.onHook(t.event,t.handler)}prependHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);o?o.unshift(t):this._hooks.set(n,[t])}prependOnceHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=async(...a)=>(this.removeHook(n,o),t(...a));this.prependHook(n,o)}onceHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=async(...a)=>(this.removeHook(n,o),t(...a));this.onHook(n,o)}removeHook(n,t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);if(o){let a=o.indexOf(t);a!==-1&&o.splice(a,1)}}removeHooks(n){for(let t of n)this.removeHook(t.event,t.handler)}async hook(n,...t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);if(o)for(let a of o)try{await a(...t)}catch(e){let i=`${n}: ${e.message}`;if(this.emit("error",new Error(i)),this._throwOnHookError)throw new Error(i)}}hookSync(n,...t){if(this.validateHookName(n),!this.checkDeprecatedHook(n))return;let o=this._hooks.get(n);if(o){for(let a of o)if(a.constructor.name!=="AsyncFunction")try{a(...t)}catch(e){let i=`${n}: ${e.message}`;if(this.emit("error",new Error(i)),this._throwOnHookError)throw new Error(i)}}}async beforeHook(n,...t){await this.hook(`before:${n}`,...t)}async afterHook(n,...t){await this.hook(`after:${n}`,...t)}async callHook(n,...t){await this.hook(n,...t)}getHooks(n){if(this.validateHookName(n),!!this.checkDeprecatedHook(n))return this._hooks.get(n)}clearHooks(){this._hooks.clear()}};var HVe=class{_enabled=!0;_maxSize=4e3;_store=new Map;_keys=[];constructor(n){n?.enabled!==void 0&&(this._enabled=n.enabled),n?.maxSize!==void 0&&(this._maxSize=n.maxSize)}get enabled(){return this._enabled}set enabled(n){this._enabled=n}get maxSize(){return this._maxSize}set maxSize(n){this._maxSize=n}get store(){return this._store}get size(){return this._store.size}get(n){return this._store.get(n)}set(n,t){if(this._enabled){if(this._store.has(n)){this._store.set(n,t);return}if(this._store.size>=this._maxSize){let o=this._keys.shift();o&&this._store.delete(o)}this._keys.push(n),this._store.set(n,t)}}has(n){return this._store.has(n)}clear(){this._store.clear(),this._keys=[]}},KVe=class{get name(){return"crc32"}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let i=n;t=new Uint8Array(i.buffer,i.byteOffset,i.byteLength)}let o=3988292384,a=4294967295;for(let i=0;i>>1^o&-(a&1)}return a=(a^4294967295)>>>0,a.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}},Xb=class{_algorithm="SHA-256";constructor(n){n?.algorithm&&(this._algorithm=n?.algorithm)}get name(){return this._algorithm}async toHash(n){let t=await crypto.subtle.digest(this._algorithm,n);return Array.from(new Uint8Array(t)).map(e=>e.toString(16).padStart(2,"0")).join("")}},xVe=class{get name(){return"djb2"}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let e=n;t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let o=5381;for(let e=0;e>>0;return o.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}},YVe=class{get name(){return"fnv1"}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let A=n;t=new Uint8Array(A.buffer,A.byteOffset,A.byteLength)}let o=2166136261,a=16777619,e=o;for(let A=0;A>>0;return e.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}},jVe=class{_seed;constructor(n=0){this._seed=n>>>0}get name(){return"murmur"}get seed(){return this._seed}toHashSync(n){let t;if(n instanceof Uint8Array)t=n;else if(n instanceof ArrayBuffer)t=new Uint8Array(n);else if(n instanceof DataView)t=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);else{let c=n;t=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}let o=3432918353,a=461845907,e=t.length,i=Math.floor(e/4),A=this._seed;for(let c=0;c>>16,A=this._imul(A,2246822507),A^=A>>>13,A=this._imul(A,3266489909),A^=A>>>16,A=A>>>0,A.toString(16).padStart(8,"0")}async toHash(n){return this.toHashSync(n)}_imul(n,t){if(Math.imul)return Math.imul(n,t);let o=n>>>16&65535,a=n&65535,e=t>>>16&65535,i=t&65535;return a*i+(o*i+a*e<<16>>>0)|0}_rotl32(n,t){return n<>>32-t}},JVe=class{_providers=new Map;_getFuzzy=!0;constructor(n){n?.providers&&this.loadProviders(n?.providers),n?.getFuzzy!==void 0&&(this._getFuzzy=!!n?.getFuzzy)}loadProviders(n){for(let t of n)this._providers.set(t.name,t)}get providers(){return this._providers}set providers(n){this._providers=n}get names(){return Array.from(this._providers.keys())}get(n,t){let o=t?.fuzzy??this._getFuzzy;n=n.trim();let a=this._providers.get(n);return a===void 0&&o===!0&&(n=n.toLowerCase(),a=this._providers.get(n)),a===void 0&&o===!0&&(n=n.replaceAll("-",""),a=this._providers.get(n)),a}add(n){this._providers.set(n.name,n)}remove(n){return this._providers.delete(n)}},lH=class extends _I{_parse=JSON.parse;_stringify=JSON.stringify;_providers=new JVe;_defaultAlgorithm="SHA-256";_defaultAlgorithmSync="djb2";_cache;constructor(n){super(n),n?.parse&&(this._parse=n.parse),n?.stringify&&(this._stringify=n.stringify),n?.defaultAlgorithm&&(this._defaultAlgorithm=n.defaultAlgorithm),n?.defaultAlgorithmSync&&(this._defaultAlgorithmSync=n.defaultAlgorithmSync),this._cache=new HVe(n?.cache),this.loadProviders(n?.providers,{includeBase:n?.includeBase??!0})}get parse(){return this._parse}set parse(n){this._parse=n}get stringify(){return this._stringify}set stringify(n){this._stringify=n}get providers(){return this._providers}set providers(n){this._providers=n}get names(){return this._providers.names}get defaultAlgorithm(){return this._defaultAlgorithm}set defaultAlgorithm(n){this._defaultAlgorithm=n}get defaultAlgorithmSync(){return this._defaultAlgorithmSync}set defaultAlgorithmSync(n){this._defaultAlgorithmSync=n}get cache(){return this._cache}async toHash(n,t){let o={data:n,algorithm:t?.algorithm??this._defaultAlgorithm,maxLength:t?.maxLength};await this.beforeHook("toHash",o);let a=this._stringify(o.data),e=`${o.algorithm}:${a}`;if(this._cache.enabled){let c=this._cache.get(e);if(c!==void 0){let I=c;t?.maxLength&&I.length>t.maxLength&&(I=I.substring(0,t.maxLength));let p={hash:I,data:o.data,algorithm:o.algorithm};return await this.afterHook("toHash",p),p.hash}}let A=new TextEncoder().encode(a),r=this._providers.get(o.algorithm);r||(this.emit("warn",`Invalid algorithm '${o.algorithm}' not found. Falling back to default algorithm '${this._defaultAlgorithm}'.`),r=new Xb({algorithm:this._defaultAlgorithm}));let s=await r.toHash(A);this._cache.enabled&&this._cache.set(e,s),t?.maxLength&&s.length>t?.maxLength&&(s=s.substring(0,t.maxLength));let g={hash:s,data:o.data,algorithm:o.algorithm};return await this.afterHook("toHash",g),g.hash}async toNumber(n,t={}){let{min:o=0,max:a=100,algorithm:e=this._defaultAlgorithm,hashLength:i=16}=t;if(o>a)throw new Error("min cannot be greater than max");let A=await this.toHash(n,{algorithm:e,maxLength:i}),r=Number.parseInt(A,16),s=a-o+1;return o+r%s}toHashSync(n,t){let o={data:n,algorithm:t?.algorithm??this._defaultAlgorithmSync,maxLength:t?.maxLength};this.hookSync("before:toHashSync",o);let a=o.algorithm,e=this._stringify(o.data),i=`${a}:${e}`;if(this._cache.enabled){let I=this._cache.get(i);if(I!==void 0){let p=I;t?.maxLength&&p.length>t.maxLength&&(p=p.substring(0,t.maxLength));let B={hash:p,data:o.data,algorithm:a};return this.hookSync("after:toHashSync",B),B.hash}}let r=new TextEncoder().encode(e),s=this._providers.get(a);if(!s&&(this.emit("warn",`Invalid algorithm '${a}' not found. Falling back to default algorithm '${this._defaultAlgorithmSync}'.`),s=this._providers.get(this._defaultAlgorithmSync),!s))throw new Error(`Hash provider '${this._defaultAlgorithmSync}' (default) not found`);if(!s.toHashSync)throw new Error(`Hash provider '${a}' does not support synchronous hashing. Use toHash() instead or choose a different algorithm (djb2, fnv1, murmur, crc32).`);let g=s.toHashSync(r);this._cache.enabled&&this._cache.set(i,g),t?.maxLength&&g.length>t?.maxLength&&(g=g.substring(0,t.maxLength));let c={hash:g,data:o.data,algorithm:o.algorithm};return this.hookSync("after:toHashSync",c),c.hash}toNumberSync(n,t={}){let{min:o=0,max:a=100,algorithm:e=this._defaultAlgorithmSync,hashLength:i=16}=t;if(o>a)throw new Error("min cannot be greater than max");let A=this.toHashSync(n,{algorithm:e,maxLength:i}),r=Number.parseInt(A,16),s=a-o+1;return o+r%s}loadProviders(n,t={includeBase:!0}){if(n)for(let o of n)this._providers.add(o);t.includeBase&&(this.providers.add(new Xb({algorithm:"SHA-256"})),this.providers.add(new Xb({algorithm:"SHA-384"})),this.providers.add(new Xb({algorithm:"SHA-512"})),this.providers.add(new KVe),this.providers.add(new xVe),this.providers.add(new YVe),this.providers.add(new jVe))}};var hH=n=>{let t;if(n!==void 0){if(typeof n=="number")t=n;else{if(typeof n!="string")return;if(n=n.trim(),Number.isNaN(Number(n))){let o=/^([\d.]+)\s*(ms|s|m|h|hr|d)$/i.exec(n);if(!o)throw new Error(`Unsupported time format: "${n}". Use 'ms', 's', 'm', 'h', 'hr', or 'd'.`);let[,a,e]=o,i=Number.parseFloat(a);switch(e.toLowerCase()){case"ms":t=i;break;case"s":t=i*1e3;break;case"m":t=i*1e3*60;break;case"h":t=i*1e3*60*60;break;case"hr":t=i*1e3*60*60;break;case"d":t=i*1e3*60*60*24;break;default:t=Number(n)}}else t=Number(n)}return t}},up=(n,t)=>{t??=new Date;let o=hH(n);return o===void 0?t.getTime():t.getTime()+o};var eQ=(function(n){return n.SHA256="SHA-256",n.SHA384="SHA-384",n.SHA512="SHA-512",n.DJB2="djb2",n.FNV1="fnv1",n.MURMER="murmer",n.CRC32="crc32",n})({});function pH(n,t={algorithm:"djb2",serialize:JSON.stringify}){let o=t?.algorithm??"djb2",a=(t?.serialize??JSON.stringify)(n);return new lH().toHashSync(a,{algorithm:o})}function xse(n,t={min:0,max:10,algorithm:"djb2",serialize:JSON.stringify}){let o=t?.min??0,a=t?.max??10,e=t?.algorithm??"djb2",i=t?.serialize??JSON.stringify,A=t?.hashLength??16;if(o>=a)throw new Error(`Invalid range: min (${o}) must be less than max (${a})`);let r=i(n);return new lH().toNumberSync(r,{algorithm:e,min:o,max:a,hashLength:A})}function EH(n,t){let{ttl:o,keyPrefix:a,cache:e,serialize:i}=t;return(...A)=>{let r=qVe(n,A,{keyPrefix:a,serialize:i});t.createKey&&(r=t.createKey(n,A,t));let s=e.get(r);if(s===void 0)try{s=n(...A),e.set(r,s,o)}catch(g){e.emit("error",g),t.cacheErrors&&e.set(r,g,o)}return s}}function uH(n,t,o){let a=typeof n=="function"?n(o):n,e;try{e=o.cache.get(a)}catch(i){if(o.cache.emit("error",i),o.throwErrors===!0||o.throwErrors==="store")throw i}if(e===void 0)try{try{e=t()}catch(i){throw new $b(i,"function")}try{o.cache.set(a,e,o.ttl)}catch(i){throw new $b(i,"store")}}catch(i){let A=i instanceof $b?i.context:void 0,r=i instanceof $b?i.error:i;if(o.cache.emit("error",r),o.cacheErrors&&A==="function")try{o.cache.set(a,r,o.ttl)}catch(s){o.cache.emit("error",s)}if(o.throwErrors===!0||o.throwErrors===A)throw r}return e}function qVe(n,t,o){let{keyPrefix:a,serialize:e}=o||{};return a?`${a}::${n.name}::${pH(t,{serialize:e})}`:`${n.name}::${pH(t,{serialize:e})}`}var $b=class{error;context;constructor(n,t){this.error=n,this.context=t}};var TI=class{_counters={hits:0,misses:0,gets:0,sets:0,deletes:0,clears:0,count:0};_vsize=0;_ksize=0;_enabled=!1;_lastUpdated;_lastReset;_subscriptions=[];_trackedKeys=new Map;_trackKeys=!1;_maxTrackedKeys;constructor(n){n?.enabled&&(this._enabled=n.enabled),n?.trackKeys&&(this._trackKeys=n.trackKeys),n?.maxTrackedKeys!==void 0&&(this._maxTrackedKeys=n.maxTrackedKeys),n?.emitter&&n?.eventMap&&this.subscribe(n.emitter,n.eventMap)}get enabled(){return this._enabled}set enabled(n){this._enabled=n}get trackKeys(){return this._trackKeys}set trackKeys(n){this._trackKeys=n}get maxTrackedKeys(){return this._maxTrackedKeys}set maxTrackedKeys(n){this._maxTrackedKeys=n}get trackedKeys(){return this._trackedKeys}get hits(){return this._counters.hits}get misses(){return this._counters.misses}get gets(){return this._counters.gets}get sets(){return this._counters.sets}get deletes(){return this._counters.deletes}get clears(){return this._counters.clears}get vsize(){return this._vsize}get ksize(){return this._ksize}get count(){return this._counters.count}get hitRate(){let n=this._counters.hits+this._counters.misses;return n===0?0:this._counters.hits/n}get missRate(){let n=this._counters.hits+this._counters.misses;return n===0?0:this._counters.misses/n}get lastUpdated(){return this._lastUpdated}get lastReset(){return this._lastReset}increment(n,t=1){this._enabled&&(this._counters[n]+=t,this.touch())}decrement(n,t=1){this._enabled&&(this._counters[n]-=t,this.touch())}incrementHits(n=1){this.increment("hits",n)}incrementMisses(n=1){this.increment("misses",n)}incrementGets(n=1){this.increment("gets",n)}incrementSets(n=1){this.increment("sets",n)}incrementDeletes(n=1){this.increment("deletes",n)}incrementClears(n=1){this.increment("clears",n)}incrementVSize(n){this._enabled&&(this._vsize+=this.roughSizeOfObject(n),this.touch())}decreaseVSize(n){this._enabled&&(this._vsize=Math.max(0,this._vsize-this.roughSizeOfObject(n)),this.touch())}incrementKSize(n){this._enabled&&(this._ksize+=this.roughSizeOfString(n),this.touch())}decreaseKSize(n){this._enabled&&(this._ksize=Math.max(0,this._ksize-this.roughSizeOfString(n)),this.touch())}incrementCount(n=1){this.increment("count",n)}decreaseCount(n=1){this._enabled&&(this._counters.count=Math.max(0,this._counters.count-n),this.touch())}setCount(n){this._enabled&&(this._counters.count=n,this.touch())}roughSizeOfString(n){return n.length*2}roughSizeOfObject(n){let t=[],o=[n],a=0;for(;o.length>0;){let e=o.pop();if(typeof e=="boolean")a+=4;else if(typeof e=="string")a+=e.length*2;else if(typeof e=="number")a+=8;else{if(e==null){a+=4;continue}if(t.includes(e))continue;t.push(e);for(let i in e)a+=i.length*2,o.push(e[i])}}return a}enable(){this._enabled=!0}disable(){this._enabled=!1}clear(){this.reset()}reset(){this._counters={hits:0,misses:0,gets:0,sets:0,deletes:0,clears:0,count:0},this._vsize=0,this._ksize=0,this._trackedKeys.clear(),this._lastReset=Date.now(),this._lastUpdated=void 0}resetStoreValues(){this._vsize=0,this._ksize=0,this._counters.count=0}toJSON(){return{enabled:this._enabled,hits:this._counters.hits,misses:this._counters.misses,gets:this._counters.gets,sets:this._counters.sets,deletes:this._counters.deletes,clears:this._counters.clears,vsize:this._vsize,ksize:this._ksize,count:this._counters.count,hitRate:this.hitRate,missRate:this.missRate,trackedKeys:this._trackedKeys.size,lastUpdated:this._lastUpdated,lastReset:this._lastReset}}snapshot(){return this.toJSON()}recordKey(n,t,o=1){if(!this._enabled||!this._trackKeys)return;let a=this._trackedKeys.get(n);a||(a={hits:0,misses:0,gets:0,sets:0,deletes:0},this._trackedKeys.set(n,a),this.pruneTrackedKeys(n)),a[t]+=o,this.touch()}mostUsedKeys(n=100,t){return this.sortedKeyEntries(t,"desc").slice(0,n)}leastUsedKeys(n=100,t){return this.sortedKeyEntries(t,"asc").slice(0,n)}keyStats(n){let t=this._trackedKeys.get(n);return t?this.toKeyEntry(n,t):void 0}clearKeys(){this._trackedKeys.clear()}totalOf(n){return n.hits+n.misses+n.gets+n.sets+n.deletes}toKeyEntry(n,t){let o=t.hits+t.misses;return{key:n,count:this.totalOf(t),hits:t.hits,misses:t.misses,gets:t.gets,sets:t.sets,deletes:t.deletes,hitRate:o===0?0:t.hits/o}}sortedKeyEntries(n,t){let o=[];for(let[e,i]of this._trackedKeys)o.push(this.toKeyEntry(e,i));let a=t==="asc"?1:-1;return o.sort((e,i)=>{let A=n?e[n]:e.count,r=n?i[n]:i.count;return A!==r?(A-r)*a:e.keythis.totalOf(a[1])-this.totalOf(e[1]));for(let[a]of o){if(this._trackedKeys.size<=t)break;a!==n&&this._trackedKeys.delete(a)}}subscribe(n,t){for(let[o,a]of Object.entries(t)){let e=(...i)=>{this.applyEvent(a,i)};n.on(o,e),this._subscriptions.push({emitter:n,event:o,listener:e})}}unsubscribe(n){let t=[];for(let o of this._subscriptions){if(n&&o.emitter!==n){t.push(o);continue}(o.emitter.off??o.emitter.removeListener)?.call(o.emitter,o.event,o.listener)}this._subscriptions=t}applyEvent(n,t){if(this._enabled){if(typeof n=="function"){n(this,...t);return}if(Array.isArray(n)){for(let o of n)this.increment(o);return}this.increment(n)}}touch(){this._lastUpdated=Date.now()}};var zVe=class{value;prev=void 0;next=void 0;constructor(n){this.value=n}},CH=class{head=void 0;tail=void 0;nodesMap=new Map;addToFront(n){let t=new zVe(n);this.head?(t.next=this.head,this.head.prev=t,this.head=t):this.head=this.tail=t,this.nodesMap.set(n,t)}moveToFront(n){let t=this.nodesMap.get(n);if(!t||this.head===t)return;t.prev&&(t.prev.next=t.next);t.next&&(t.next.prev=t.prev);t===this.tail&&(this.tail=t.prev),t.prev=void 0,t.next=this.head;this.head&&(this.head.prev=t),this.head=t,this.tail??=t}getOldest(){return this.tail?this.tail.value:void 0}removeOldest(){if(!this.tail)return;let n=this.tail.value;return this.tail.prev?(this.tail=this.tail.prev,this.tail.next=void 0):this.head=this.tail=void 0,this.nodesMap.delete(n),n}remove(n){let t=this.nodesMap.get(n);return t?(t.prev?t.prev.next=t.next:(this.head=t.next,this.head&&(this.head.prev=void 0)),t.next?t.next.prev=t.prev:(this.tail=t.prev,this.tail&&(this.tail.next=void 0)),this.nodesMap.delete(n),!0):!1}get size(){return this.nodesMap.size}};var Yse=16777216,BH=class extends _I{_lru=new CH;_storeHashSize=16;_storeHashAlgorithm=eQ.DJB2;_store=Array.from({length:this._storeHashSize},()=>new Map);_ttl;_maxTtl;_useClone=!0;_lruSize=0;_checkInterval=0;_interval=0;_stats=new TI({enabled:!1});constructor(n){super(),n?.ttl&&this.setTtl(n.ttl),n?.maxTtl!==void 0&&this.setMaxTtl(n.maxTtl),n?.useClone!==void 0&&(this._useClone=n.useClone),n?.stats&&(this._stats.enabled=n.stats),n?.storeHashSize&&n.storeHashSize>0&&(this._storeHashSize=n.storeHashSize),n?.lruSize&&(n.lruSize>16777216?this.emit("error",new Error(`LRU size cannot be larger than ${Yse} due to Map limitations.`)):this._lruSize=n.lruSize),n?.checkInterval&&(this._checkInterval=n.checkInterval),n?.storeHashAlgorithm&&(this._storeHashAlgorithm=n.storeHashAlgorithm),this._store=Array.from({length:this._storeHashSize},()=>new Map),this.startIntervalCheck()}get ttl(){return this._ttl}set ttl(n){this.setTtl(n)}get maxTtl(){return this._maxTtl}set maxTtl(n){this.setMaxTtl(n)}get useClone(){return this._useClone}set useClone(n){this._useClone=n}get lruSize(){return this._lruSize}set lruSize(n){if(n>16777216){this.emit("error",new Error(`LRU size cannot be larger than ${Yse} due to Map limitations.`));return}if(this._lruSize=n,this._lruSize===0){this._lru=new CH;return}this.lruResize()}get checkInterval(){return this._checkInterval}set checkInterval(n){this._checkInterval=n}get size(){let n=0;for(let t of this._store)n+=t.size;return n}get stats(){return this._stats}get storeHashSize(){return this._storeHashSize}set storeHashSize(n){n!==this._storeHashSize&&(this._storeHashSize=n,this._store=Array.from({length:this._storeHashSize},()=>new Map),this._stats.enabled&&this._stats.resetStoreValues())}get storeHashAlgorithm(){return this._storeHashAlgorithm}set storeHashAlgorithm(n){this._storeHashAlgorithm=n}get keys(){let n=[];for(let t of this._store)for(let o of t.keys()){let a=t.get(o);if(a&&this.hasExpired(a)){this.recordExpiration(a),t.delete(o),this.lruRemove(o);continue}n.push(o)}return n.values()}get items(){let n=[];for(let t of this._store)for(let o of t.values()){if(this.hasExpired(o)){this.recordExpiration(o),t.delete(o.key),this.lruRemove(o.key);continue}n.push(o)}return n.values()}get store(){return this._store}get(n){this.hookSync("BEFORE_GET",n);let t=this.getStore(n),o=t.get(n);if(!o){this.recordRead(!1),this.hookSync("AFTER_GET",{key:n,result:void 0});return}if(o.expires&&Date.now()>o.expires){this.recordExpiration(o),t.delete(n),this.lruRemove(n),this.recordRead(!1),this.hookSync("AFTER_GET",{key:n,result:void 0});return}this.lruMoveToFront(n);let a;return this._useClone?a=this.clone(o.value):a=o.value,this.recordRead(!0),this.hookSync("AFTER_GET",{key:n,result:a}),a}getMany(n){this.hookSync("BEFORE_GET_MANY",n);let t=[];for(let o of n)t.push(this.get(o));return this.hookSync("AFTER_GET_MANY",{keys:n,result:t}),t}getRaw(n){let t=this.getStore(n),o=t.get(n);if(!o){this.recordRead(!1);return}if(o.expires&&Date.now()>o.expires){this.recordExpiration(o),t.delete(n),this.lruRemove(n),this.recordRead(!1);return}return this.lruMoveToFront(n),this.recordRead(!0),o}getManyRaw(n){let t=[];for(let o of n)t.push(this.getRaw(o));return t}set(n,t,o){let a={key:n,value:t,ttl:o};this.hookSync("BEFORE_SET",a);let e=this.getStore(a.key),i,A=a.ttl;if(A!==void 0||this._ttl!==void 0)if(typeof A=="object"){if(A.expire&&(i=typeof A.expire=="number"?A.expire:A.expire.getTime()),A.ttl){let s=up(A.ttl);s!==void 0&&(i=s)}}else{let s=up(A??this._ttl);s!==void 0&&(i=s)}if(this._maxTtl!==void 0){let s=up(this._maxTtl);(i===void 0||i>s)&&(i=s)}if(this._lruSize>0){if(e.has(a.key))this.lruMoveToFront(a.key);else if(this.lruAddToFront(a.key),this._lru.size>this._lruSize){let s=this._lru.getOldest();s&&(this._lru.removeOldest(),this.delete(s))}}if(this._stats.enabled){let s=e.get(a.key);s?this._stats.decreaseVSize(s.value):(this._stats.incrementKSize(a.key),this._stats.incrementCount()),this._stats.incrementVSize(a.value),this._stats.incrementSets()}let r={key:a.key,value:a.value,expires:i};e.set(a.key,r),this.hookSync("AFTER_SET",a)}setMany(n){this.hookSync("BEFORE_SET_MANY",n);for(let t of n)this.set(t.key,t.value,t.ttl);this.hookSync("AFTER_SET_MANY",n)}has(n){return!!this.get(n)}hasMany(n){let t=[];for(let o of n){let a=this.get(o);t.push(!!a)}return t}take(n){let t=this.get(n);if(t)return this.delete(n),t}takeMany(n){let t=[];for(let o of n)t.push(this.take(o));return t}delete(n){this.hookSync("BEFORE_DELETE",n);let t=this.getStore(n);if(this._stats.enabled){let o=t.get(n);o&&(this._stats.decreaseKSize(n),this._stats.decreaseVSize(o.value),this._stats.decreaseCount(),this._stats.incrementDeletes())}t.delete(n),this.lruRemove(n),this.hookSync("AFTER_DELETE",n)}deleteMany(n){this.hookSync("BEFORE_DELETE_MANY",n);for(let t of n)this.delete(t);this.hookSync("AFTER_DELETE_MANY",n)}clear(){this.hookSync("BEFORE_CLEAR"),this._store=Array.from({length:this._storeHashSize},()=>new Map),this._lru=new CH,this._stats.enabled&&(this._stats.resetStoreValues(),this._stats.incrementClears()),this.hookSync("AFTER_CLEAR")}getStore(n){let t=this.getKeyStoreHash(n);return this._store[t]||=new Map,this._store[t]}getKeyStoreHash(n){return this._store.length===1?0:typeof this._storeHashAlgorithm=="function"?this._storeHashAlgorithm(n,this._storeHashSize):xse(n,{min:0,max:this._storeHashSize-1,algorithm:this._storeHashAlgorithm})}clone(n){return this.isPrimitive(n)?n:structuredClone(n)}lruAddToFront(n){this._lruSize!==0&&this._lru.addToFront(n)}lruMoveToFront(n){this._lruSize!==0&&this._lru.moveToFront(n)}lruRemove(n){this._lruSize!==0&&this._lru.remove(n)}lruResize(){for(;this._lru.size>this._lruSize;){let n=this._lru.getOldest();n&&(this._lru.removeOldest(),this.delete(n))}}checkExpiration(){for(let n of this._store)for(let t of n.values())t.expires&&Date.now()>t.expires&&(this.recordExpiration(t),n.delete(t.key),this.lruRemove(t.key))}startIntervalCheck(){if(this._checkInterval>0){this._interval&&clearInterval(this._interval),this._interval=setInterval(()=>{this.checkExpiration()},this._checkInterval).unref()}}stopIntervalCheck(){this._interval&&clearInterval(this._interval),this._interval=0,this._checkInterval=0}wrap(n,t){return EH(n,{ttl:t?.ttl??this._ttl,keyPrefix:t?.keyPrefix,createKey:t?.createKey,cache:this})}getOrSet(n,t,o){return uH(n,t,{cache:this,ttl:o?.ttl??this._ttl,cacheErrors:o?.cacheErrors,throwErrors:o?.throwErrors})}recordRead(n){this._stats.enabled&&(n?this._stats.incrementHits():this._stats.incrementMisses(),this._stats.incrementGets())}recordExpiration(n){this._stats.enabled&&(this._stats.decreaseKSize(n.key),this._stats.decreaseVSize(n.value),this._stats.decreaseCount())}isPrimitive(n){return n==null||typeof n=="string"||typeof n=="number"||typeof n=="boolean"}setTtl(n){typeof n=="string"||n===void 0?this._ttl=n:n>0?this._ttl=n:this._ttl=void 0}setMaxTtl(n){typeof n=="string"||n===void 0?this._maxTtl=n:n>0?this._maxTtl=n:this._maxTtl=void 0}hasExpired(n){return!!(n.expires&&Date.now()>n.expires)}};var AWe=class extends _I{options={stdTTL:0,checkperiod:600,useClones:!0,deleteOnExpire:!0,maxKeys:-1};store=new Map;_stats=new TI({enabled:!0});_cacheable=new BH;intervalId=0;constructor(n){super(),n&&(this.options={...this.options,...n}),this.startInterval()}set(n,t,o=0){if(typeof n!="string"&&typeof n!="number")throw this.createError("The key argument has to be of type `string` or `number`. Found: `__key`",n);if(o&&typeof o!="number"&&typeof o!="string")throw this.createError("The ttl argument has to be a number or a string for shorthand ttl.",this.formatKey(n));let a=this.formatKey(n),e=0;this.options.stdTTL&&(e=this.getExpirationTimestamp(this.options.stdTTL)),o&&(e=this.getExpirationTimestamp(o));let i=0;if(e&&e>0&&(i=e),this.options.maxKeys){let{maxKeys:A}=this.options;if(A>-1&&this.store.size>=A)throw this.createError("Cache max keys amount exceeded",this.formatKey(n))}return this.store.set(a,{key:a,value:t,ttl:i}),this.emit("set",a,t,e),this._stats.incrementKSize(a),this._stats.incrementVSize(t),this._stats.setCount(this.store.size),!0}mset(n){if(!Array.isArray(n))throw this.createError("The keys argument has to be an array.");for(let t of n)this.set(t.key,t.value,t.ttl);return!0}get(n){let t=this.store.get(this.formatKey(n));if(t){if(t.ttl>0){if(t.ttl0){let n=this.options.checkperiod*1e3;this.intervalId=setInterval(()=>{this.checkData()},n).unref();return}this.intervalId=0}stopInterval(){this.intervalId!==0&&(clearInterval(this.intervalId),this.intervalId=0)}formatKey(n){return n.toString()}getExpirationTimestamp(n){if(typeof n=="string")return up(n);let t=Date.now(),o=n*1e3;return t+o}checkData(){for(let[n,t]of this.store.entries())t.ttl>0&&t.ttl{let i={resolve:a,reject:e,weight:t,priority:o},A=Jse(this._queue,r=>o<=r.priority);A===-1&&t<=this._value?this._dispatchItem(i):this._queue.splice(A+1,0,i)})}runExclusive(t){return rWe(this,arguments,void 0,function*(o,a=1,e=0){let[i,A]=yield this.acquire(a,e);try{return yield o(i)}finally{A()}})}waitForUnlock(t=1,o=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return this._couldLockImmediately(t,o)?Promise.resolve():new Promise(a=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),iWe(this._weightedWaiters[t-1],{resolve:a,priority:o})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatchQueue()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatchQueue()}cancel(){this._queue.forEach(t=>t.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(t){let o=this._value;this._value-=t.weight,t.resolve([o,this._newReleaser(t.weight)])}_newReleaser(t){let o=!1;return()=>{o||(o=!0,this.release(t))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let t=this._value;t>0;t--){let o=this._weightedWaiters[t-1];o&&(o.forEach(a=>a.resolve()),this._weightedWaiters[t-1]=[])}else{let t=this._queue[0].priority;for(let o=this._value;o>0;o--){let a=this._weightedWaiters[o-1];if(!a)continue;let e=a.findIndex(i=>i.priority<=t);(e===-1?a:a.splice(0,e)).forEach((i=>i.resolve()))}}}_couldLockImmediately(t,o){return(this._queue.length===0||this._queue[0].priorityt.priority<=a.priority);n.splice(o+1,0,t)}function Jse(n,t){for(let o=n.length-1;o>=0;o--)if(t(n[o]))return o;return-1}var aWe=function(n,t,o,a){function e(i){return i instanceof o?i:new o(function(A){A(i)})}return new(o||(o=Promise))(function(i,A){function r(c){try{g(a.next(c))}catch(I){A(I)}}function s(c){try{g(a.throw(c))}catch(I){A(I)}}function g(c){c.done?i(c.value):e(c.value).then(r,s)}g((a=a.apply(n,t||[])).next())})},gc=class{constructor(t){this._semaphore=new fH(1,t)}acquire(){return aWe(this,arguments,void 0,function*(t=0){let[,o]=yield this._semaphore.acquire(1,t);return o})}runExclusive(t,o=0){return this._semaphore.runExclusive(()=>t(),1,o)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(t=0){return this._semaphore.waitForUnlock(1,t)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}};import{randomBytes as cWe}from"crypto";var yH=ze(zse(),1);var mH=class n extends Error{name="TimeoutError";constructor(t,o){super(t,o),Error.captureStackTrace?.(this,n)}},Vse=n=>n.reason??new DOMException("This operation was aborted.","AbortError");function SH(n,t){let{milliseconds:o,fallback:a,message:e,customTimers:i={setTimeout,clearTimeout},signal:A}=t,r,s,c=new Promise((I,p)=>{if(typeof o!="number"||Math.sign(o)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${o}\``);if(A?.aborted){p(Vse(A));return}if(A&&(s=()=>{p(Vse(A))},A.addEventListener("abort",s,{once:!0})),n.then(I,p),o===Number.POSITIVE_INFINITY)return;let B=new mH;r=i.setTimeout.call(void 0,()=>{if(a){try{I(a())}catch(f){p(f)}return}typeof n.cancel=="function"&&n.cancel(),e===!1?I():e instanceof Error?p(e):(B.message=e??`Promise timed out after ${o} milliseconds`,p(B))},o)}).finally(()=>{c.clear(),s&&A&&A.removeEventListener("abort",s)});return c.clear=()=>{i.clearTimeout.call(void 0,r),r=void 0},c}function wH(n,t,o){let a=0,e=n.length;for(;e>0;){let i=Math.trunc(e/2),A=a+i;o(n[A],t)<=0?(a=++A,e-=i+1):e=i}return a}var sWe=100,ME=class{#e=[];#A=0;enqueue(t,o){let{priority:a=0,id:e}=o??{},{size:i}=this,A={priority:a,id:e,run:t};if(i===0){this.#e.length=0,this.#A=0,this.#e.push(A);return}if(this.#e.at(-1).priority>=a){this.#e.push(A);return}this.#t();let r=wH(this.#e,A,(s,g)=>g.priority-s.priority);this.#e.splice(r,0,A)}setPriority(t,o){let a=this.#e.findIndex((i,A)=>A>=this.#A&&i.id===t);if(a===-1)throw new ReferenceError(`No promise function with the id "${t}" exists in the queue.`);let[e]=this.#e.splice(a,1);this.enqueue(e.run,{priority:o,id:t})}remove(t){let o=this.#e.findIndex((a,e)=>esWe&&this.#A>this.#e.length/2&&this.#t(),t?.run}filter(t){let o=[];for(let a=this.#A;a=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);if(t.strict&&t.interval===0)throw new TypeError("The `strict` option requires a non-zero `interval`");if(t.strict&&t.intervalCap===Number.POSITIVE_INFINITY)throw new TypeError("The `strict` option requires a finite `intervalCap`");if(this.#e=t.carryoverIntervalCount??t.carryoverConcurrencyCount??!1,this.#A=t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,this.#r=t.intervalCap,this.#c=t.interval,this.#p=t.strict,this.#n=new t.queueClass,this.#h=t.queueClass,this.concurrency=t.concurrency,t.timeout!==void 0&&!(Number.isFinite(t.timeout)&&t.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${t.timeout}\` (${typeof t.timeout})`);this.timeout=t.timeout,this.#u=t.autoStart===!1,this.#J()}#w(t){for(;this.#l=this.#c)this.#l++;else break}(this.#l>100&&this.#l>this.#g.length/2||this.#l===this.#g.length)&&(this.#g=this.#g.slice(this.#l),this.#l=0)}#Q(t){this.#p?this.#g.push(t):this.#t++}#y(){this.#p?this.#g.length>this.#l&&this.#g.pop():this.#t>0&&this.#t--}#b(){return this.#g.length-this.#l}get#E(){return this.#A?!0:this.#p?this.#b()=this.#r){let a=this.#g[this.#l],e=this.#c-(t-a);return this.#T(e),!0}return!1}if(this.#a===void 0){let o=this.#i-t;if(o<0)this.#t=this.#e?this.#d:0;else return this.#T(o),!0}return!1}#T(t){this.#s===void 0&&(this.#s=setTimeout(()=>{this.#D()},t))}#N(){this.#a&&(clearInterval(this.#a),this.#a=void 0)}#P(){this.#s&&(clearTimeout(this.#s),this.#s=void 0)}#_(){if(this.#n.size===0){if(this.#N(),this.emit("empty"),this.#d===0){if(this.#P(),this.#p&&this.#l>0){let o=Date.now();this.#w(o)}this.emit("idle")}return!1}let t=!1;if(!this.#u){let o=Date.now(),a=!this.#S(o);if(this.#E&&this.#k){let e=this.#n.dequeue();this.#A||(this.#Q(o),this.#U()),a&&this.#G(),this.emit("active"),e(),t=!0}}return t}#G(){this.#A||this.#a!==void 0||this.#p||(this.#a=setInterval(()=>{this.#R()},this.#c),this.#i=Date.now()+this.#c)}#R(){this.#p||(this.#a!==void 0&&(this.#t===0&&this.#d===0?this.#N():this.#i=Date.now()+this.#c),this.#t=this.#e?this.#d:0),this.#x(),this.#U()}#x(){for(;this.#_(););}get concurrency(){return this.#C}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#C=t,this.#x()}setPriority(t,o){if(typeof o!="number"||!Number.isFinite(o))throw new TypeError(`Expected \`priority\` to be a finite number, got \`${o}\` (${typeof o})`);this.#n.setPriority(t,o)}async add(t,o={}){if(o={timeout:this.timeout,...o,id:o.id??(this.#B++).toString()},o.timeout!==void 0&&!(Number.isFinite(o.timeout)&&o.timeout>0))throw new TypeError(`Expected \`timeout\` to be a positive finite number, got \`${o.timeout}\` (${typeof o.timeout})`);return new Promise((a,e)=>{let i=Symbol(`task-${o.id}`),A=()=>{},r=async()=>{A(),this.#d++,this.#f.set(i,{id:o.id,priority:o.priority??0,startTime:Date.now(),timeout:o.timeout});let g;try{try{o.signal?.throwIfAborted()}catch(p){throw this.#F(),this.#f.delete(i),p}let c=t({signal:o.signal});if(o.timeout!==void 0&&(c=SH(Promise.resolve(c),{milliseconds:o.timeout,message:`Task timed out after ${o.timeout}ms (queue has ${this.#d} running, ${this.#n.size} waiting)`})),o.signal){let{signal:p}=o;c=Promise.race([c,new Promise((B,f)=>{g=()=>{f(p.reason)},p.addEventListener("abort",g,{once:!0})})])}let I=await c;a(I),this.emit("completed",I)}catch(c){e(c),this.emit("error",c)}finally{g&&o.signal?.removeEventListener("abort",g),this.#f.delete(i),queueMicrotask(()=>{this.#M()})}};this.#n.enqueue(r,o);let s=()=>{if(this.#n instanceof ME){this.#n.remove(r);return}this.#n.remove?.(o.id)};if(o.signal){let{signal:g}=o,c=()=>{A(),s(),e(g.reason),this.#_(),this.emit("next")};if(A=()=>{g.removeEventListener("abort",c),this.#m.delete(A)},g.aborted){c();return}g.addEventListener("abort",c,{once:!0}),this.#m.add(A)}this.emit("add"),this.#_()})}async addAll(t,o){return Promise.all(t.map(async a=>this.add(a,o)))}start(){return this.#u?(this.#u=!1,this.#x(),this):this}pause(){this.#u=!0}clear(){for(let t of this.#m)t();this.#n=new this.#h,this.#N(),this.#L(),this.emit("empty"),this.#d===0&&(this.#P(),this.emit("idle")),this.emit("next")}async onEmpty(){this.#n.size!==0&&await this.#K("empty")}async onSizeLessThan(t){this.#n.sizethis.#n.size{let a=e=>{this.off("error",a),o(e)};this.on("error",a)})}async#K(t,o){let a=Array.isArray(t)?t:[t];return new Promise(e=>{let i=()=>{if(!(o&&!o())){for(let A of a)this.off(A,i);e()}};for(let A of a)this.on(A,i)})}get size(){return this.#n.size}sizeBy(t){return this.#n.filter(t).length}get pending(){return this.#d}get isPaused(){return this.#u}#J(){this.#A||(this.on("add",()=>{this.#n.size>0&&this.#U()}),this.on("next",()=>{this.#U()}))}#U(){this.#A||this.#o||(this.#o=!0,queueMicrotask(()=>{this.#o=!1,this.#L()}))}#F(){this.#A||(this.#y(),this.#U())}#L(){let t=this.#I;if(this.#A||this.#n.size===0){t&&(this.#I=!1,this.emit("rateLimitCleared"));return}let o;if(this.#p){let e=Date.now();this.#w(e),o=this.#b()}else o=this.#t;let a=o>=this.#r;a!==t&&(this.#I=a,this.emit(a?"rateLimit":"rateLimitCleared"))}get isRateLimited(){return this.#I}get isSaturated(){return this.#d===this.#C&&this.#n.size>0||this.isRateLimited&&this.#n.size>0}get runningTasks(){return[...this.#f.values()].map(t=>({...t,timeoutRemaining:t.timeout?Math.max(0,t.startTime+t.timeout-Date.now()):void 0}))}};var AM=class{constructor(t,o){this.store=t,this.logger=o,this.queues=new Map}getQueue(t){return this.queues.has(t)||this.queues.set(t,new Cp({concurrency:1})),this.queues.get(t)}async processOperations(t,o,a,e,i){let A=t[o];if(A)return this.getQueue(o).add(async()=>{a[o]=a[o]||{},e[o]=e[o]||{};let r=[],s={};for(let g in A)A[g]===null?r.push(g):s[g]=A[g];Object.keys(s).length>0&&(Object.assign(a[o],s),Object.assign(e[o],s)),r.length>0&&await this.processDeletions(o,r,a,e,i)})}async processDeletions(t,o,a,e,i){if(i)for(let A of o)a[t]?.[A]?(a[t][A]=null,e[t][A]=null):this.logger.warn(`Skipping deletion of non-existent ${t} in transaction: ${A}`);else{let A=await this.store.get(t,o);for(let r of o)A[r]?(a[t][r]=null,e[t][r]=null):this.logger.warn(`Skipping deletion of non-existent ${t}: ${r}`)}}async validateDeletions(t,o){let a=t[o];if(a)return this.getQueue(o).add(async()=>{let e=Object.keys(a).filter(A=>a[A]===null);if(e.length===0)return;let i=await this.store.get(o,e);for(let A of e)i[A]||(this.logger.warn(`Skipping deletion of non-existent ${o}: ${A}`),delete t[o][A])})}};var Zse=(n,t,{maxCommitRetries:o,delayBetweenTriesMs:a})=>{let e=new gWe,i=new Map,A=new Map,r=new Map,s=new AM(n,t);function g(Q){return i.has(Q)||i.set(Q,new Cp({concurrency:1})),i.get(Q)}function c(Q){return A.has(Q)||(A.set(Q,new gc),r.set(Q,0)),A.get(Q)}function I(Q){let y=r.get(Q)??0;r.set(Q,y+1)}function p(Q){let y=(r.get(Q)??1)-1;if(r.set(Q,y),y<=0){let m=A.get(Q);m&&!m.isLocked()&&(A.delete(Q),r.delete(Q))}}function B(){return!!e.getStore()}async function f(Q){if(Object.keys(Q).length===0){t.trace("no mutations in transaction");return}t.trace("committing transaction");for(let y=0;y{let m=e.getStore();if(!m)return n.get(Q,y);let T=m.cache[Q]||{},_=y.filter(L=>!(L in T));if(_.length>0){m.dbQueries++,t.trace({type:Q,count:_.length},"fetching missing keys in transaction");let L=await c(Q).runExclusive(()=>n.get(Q,_));m.cache[Q]=m.cache[Q]||{},Object.assign(m.cache[Q],L)}let R={};for(let L of y){let U=m.cache[Q]?.[L];U!=null&&(R[L]=U)}return R},set:async Q=>{let y=e.getStore();if(!y){let m=Object.keys(Q);for(let T of m){let _=T;_==="pre-key"&&await s.validateDeletions(Q,_)}await Promise.all(m.map(T=>g(T).add(async()=>{let _={[T]:Q[T]};await n.set(_)})));return}t.trace({types:Object.keys(Q)},"caching in transaction");for(let m in Q){let T=m;y.cache[T]=y.cache[T]||{},y.mutations[T]=y.mutations[T]||{},T==="pre-key"?await s.processOperations(Q,T,y.cache,y.mutations,!0):(Object.assign(y.cache[T],Q[T]),Object.assign(y.mutations[T],Q[T]))}},isInTransaction:B,transaction:async(Q,y)=>{if(e.getStore())return t.trace("reusing existing transaction context"),Q();let T=c(y);I(y);try{return await T.runExclusive(async()=>{let _={cache:{},mutations:{},dbQueries:0};t.trace("entering transaction");try{let R=await e.run(_,Q);return await f(_.mutations),t.trace({dbQueries:_.dbQueries},"transaction completed"),R}catch(R){throw t.error({error:R},"transaction failed, rolling back"),R}})}finally{p(y)}}}},Xse=n=>{let t=n.me?.id;if(!t)throw new Wse.Boom("Cannot proceed: socket is not authenticated yet (creds.me.id is missing)",{statusCode:401});return t},$se=()=>{let n=br.generateKeyPair();return{noiseKey:br.generateKeyPair(),pairingEphemeralKeyPair:br.generateKeyPair(),signedIdentityKey:n,signedPreKey:HD(n,1),registrationId:X$(),advSecretKey:cWe(32).toString("base64"),processedHistoryMessages:[],nextPreKeyId:1,firstUnuploadedPreKeyId:1,accountSyncCounter:0,accountSettings:{unarchiveChats:!1},registered:!1,pairingCode:void 0,lastPropHash:void 0,routingInfo:void 0,additionalData:void 0}};import{mkdir as IWe,readFile as lWe,stat as pWe,unlink as dWe,writeFile as hWe}from"fs/promises";import{join as DH}from"path";var ege=new Map,OH=n=>{let t=ege.get(n);return t||(t=new gc,ege.set(n,t)),t},Age=async n=>{let t=async(r,s)=>{let g=DH(n,i(s));return OH(g).acquire().then(async I=>{try{await hWe(g,JSON.stringify(r,WB.replacer))}finally{I()}})},o=async r=>{try{let s=DH(n,i(r));return await OH(s).acquire().then(async c=>{try{let I=await lWe(s,{encoding:"utf-8"});return JSON.parse(I,WB.reviver)}finally{c()}})}catch{return null}},a=async r=>{try{let s=DH(n,i(r));return OH(s).acquire().then(async c=>{try{await dWe(s)}catch{}finally{c()}})}catch{}},e=await pWe(n).catch(()=>{});if(e){if(!e.isDirectory())throw new Error(`found something that is not a directory at ${n}, either delete it or specify a different location`)}else await IWe(n,{recursive:!0});let i=r=>r?.replace(/\//g,"__")?.replace(/:/g,"-"),A=await o("creds.json")||$se();return{state:{creds:A,keys:{get:async(r,s)=>{let g={};return await Promise.all(s.map(async c=>{let I=await o(`${r}-${c}.json`);r==="app-state-sync-key"&&I&&(I=ne.Message.AppStateSyncKeyData.fromObject(I)),g[c]=I})),g},set:async r=>{let s=[];for(let g in r)for(let c in r[g]){let I=r[g][c],p=`${g}-${c}.json`;s.push(I?t(I,p):a(p))}await Promise.all(s)}}},saveCreds:async()=>t(A,"creds.json")}};var EWe=192,uWe=async(n,{thumbnailWidth:t,fetchOpts:o})=>{let a=await Jb(n,o);return await JU(a,t)},tge=async(n,t={thumbnailWidth:EWe,fetchOpts:{timeout:3e3}})=>{try{let o=0,a=5,{getLinkPreview:e}=await import("link-preview-js"),i=n;!n.startsWith("https://")&&!n.startsWith("http://")&&(i="https://"+i);let A=await e(i,{...t.fetchOpts,followRedirects:"follow",handleRedirects:(r,s)=>{let g=new URL(r),c=new URL(s);return o>=a?!1:c.hostname===g.hostname||c.hostname==="www."+g.hostname||"www."+c.hostname===g.hostname?(o+=1,!0):!1},headers:t.fetchOpts?.headers});if(A&&"title"in A&&A.title){let[r]=A.images,s={"canonical-url":A.url,"matched-text":n,title:A.title,description:A.description,originalThumbnailUrl:r};if(t.uploadImage){let{imageMessage:g}=await qf({image:{url:r}},{upload:t.uploadImage,mediaTypeOverride:"thumbnail-link",options:t.fetchOpts});s.jpegThumbnail=g?.jpegThumbnail?Buffer.from(g.jpegThumbnail):void 0,s.highQualityThumbnail=g||void 0}else try{s.jpegThumbnail=r?(await uWe(r,t)).buffer:void 0}catch(g){t.logger?.debug({err:g.stack,url:i},"error in generating thumbnail")}return s}}catch(o){if(!o.message.includes("receive a valid"))throw o}};import OWe from"events";var MH=ze(Jr(),1);var CWe=/^1313555\d{4}$|^131655500\d{2}$/;function BWe(n){if(!n)return!1;let t=n.split("@")[0]??"";return t==="0"||CWe.test(t)||Mh(n)?!1:!!(Rt(n)||qA(n)||Or(n)||Ci(n)||n.endsWith("@c.us"))}var tM=604800,fWe=4,RI="__index";async function rM(n){let o=(await n.get("tctoken",[RI]))[RI];if(!o?.token?.length)return[];try{let a=JSON.parse(Buffer.from(o.token).toString());return Array.isArray(a)?a.filter(e=>typeof e=="string"&&e.length>0&&e!==RI):[]}catch{return[]}}async function _E(n,t){let o=await rM(n),a=new Set(o);for(let e of t)e&&e!==RI&&a.add(e);return{[RI]:{token:Buffer.from(JSON.stringify([...a]))}}}function Bp(n){if(n==null)return!0;let t=typeof n=="string"?parseInt(n):n;if(isNaN(t))return!0;let o=Math.floor(Date.now()/1e3),i=(Math.floor(o/tM)-(fWe-1))*tM;return ta}async function ag(n,t){return qA(n)?n:await t(n)??n}async function tQ(n,t,o,a){return t?qA(n)?n:await o(n)??n:qA(n)&&a?await a(n)??n:n}async function bH({authState:n,jid:t,baseContent:o=[],getLIDForPN:a}){try{let e=await ag(t,a),A=(await n.keys.get("tctoken",[e]))?.[e],r=A?.token,s=A?.timestamp;if(!r?.length||s===void 0||Bp(s)){if(r){let g=A?.senderTimestamp!==void 0?{token:Buffer.alloc(0),senderTimestamp:A.senderTimestamp}:null;await n.keys.set({tctoken:{[e]:g}})}return o.length>0?o:void 0}return o.push({tag:"tctoken",attrs:{t:String(s)},content:r}),o}catch{return o.length>0?o:void 0}}async function TE({result:n,fallbackJid:t,keys:o,getLIDForPN:a,onNewJidStored:e}){let i=le(n,"tokens");if(!i)return;let A=PA(i,"token");for(let r of A){if(r.attrs.type!=="trusted_contact"||!(r.content instanceof Uint8Array))continue;let s=BA(t||r.attrs.jid);if(!BWe(s))continue;let g=await ag(s,a),I=(await o.get("tctoken",[g]))[g],p=I?.timestamp?Number(I.timestamp):0,B=r.attrs.t?Number(r.attrs.t):0;B&&(p>0&&p>B||(await o.set({tctoken:{[g]:{...I,token:Buffer.from(r.content),timestamp:r.attrs.t}}}),e?.(g)))}}var QWe=new Set([RA.CALL_MISSED_GROUP_VIDEO,RA.CALL_MISSED_GROUP_VOICE,RA.CALL_MISSED_VIDEO,RA.CALL_MISSED_VOICE]),yWe=new Set([RA.GROUP_PARTICIPANT_ADD]);async function mWe(n,t,o,a){let e=t.lidMapping.getLIDForPN.bind(t.lidMapping),i=[];for(let g of n){let c=g.tcTokenTimestamp?zr(g.tcTokenTimestamp):0;if(g.tcToken?.length&&c>0){let I=BA(g.id),p=await ag(I,e);i.push({storageJid:p,token:Buffer.from(g.tcToken),ts:c,senderTs:g.tcTokenSenderTimestamp?zr(g.tcTokenSenderTimestamp):void 0})}}if(!i.length)return;let A=i.map(g=>g.storageJid),r=await o.get("tctoken",A),s={};for(let g of i){let c=r[g.storageJid],I=c?.timestamp?Number(c.timestamp):0;I>0&&I>=g.ts||(s[g.storageJid]={...c,token:g.token,timestamp:String(g.ts),...g.senderTs!==void 0?{senderTimestamp:g.senderTs}:{}})}if(Object.keys(s).length){a?.debug({count:Object.keys(s).length},"storing tctokens from history sync");try{let g=await _E(o,Object.keys(s));await o.set({tctoken:{...s,...g}})}catch(g){a?.warn({err:g},"failed to store tctokens from history sync")}}}var ige=(n,t,o)=>{Or(n.key.remoteJid)||Ci(n.key.remoteJid)?n.key.remoteJid=Dr(pA(n.key?.remoteJid)?.user,Or(n.key.remoteJid)?"s.whatsapp.net":"lid"):n.key.remoteJid=BA(n.key.remoteJid),Or(n.key.participant)||Ci(n.key.participant)?n.key.participant=Dr(pA(n.key.participant)?.user,Or(n.key.participant)?"s.whatsapp.net":"lid"):n.key.participant=BA(n.key.participant);let a=Si(n.message);a?.reactionMessage&&e(a.reactionMessage.key),a?.pollUpdateMessage&&e(a.pollUpdateMessage.pollCreationMessageKey);function e(i){n.key.fromMe||(i.fromMe=i.fromMe?!1:ft(i.participant||i.remoteJid,t)||ft(i.participant||i.remoteJid,o),i.remoteJid=n.key.remoteJid,i.participant=i.participant||n.key.participant)}},_H=n=>{let t=Si(n.message),o=!!zf(t);return(!!t||QWe.has(n.messageStubType)||yWe.has(n.messageStubType))&&o&&!t?.protocolMessage&&!t?.reactionMessage&&!t?.pollUpdateMessage},TH=n=>!n.key.fromMe&&!n.messageStubType,SWe=({remoteJid:n,participant:t,fromMe:o})=>{if(!n)throw new MH.Boom("Cannot derive chat id: message key is missing remoteJid",{data:{remoteJid:n,participant:t,fromMe:o}});if(HB(n)&&!zg(n)&&!o){if(!t)throw new MH.Boom("Cannot derive chat id: broadcast message key is missing participant",{data:{remoteJid:n,fromMe:o}});return t}return n};function wWe({encPayload:n,encIv:t},{eventCreatorJid:o,eventMsgId:a,eventEncKey:e,responderJid:i}){let A=Buffer.concat([I(a),I(o),I(i),I("Event Response"),new Uint8Array([1])]),r=Wn(e,new Uint8Array(32),"sha256"),s=Wn(A,r,"sha256"),g=I(`${a}\0${i}`),c=ql(n,s,t,g);return ne.Message.EventResponseMessage.decode(c);function I(p){return Buffer.from(p)}}var DWe=async(n,{shouldProcessHistoryMsg:t,placeholderResendCache:o,ev:a,creds:e,signalRepository:i,keyStore:A,logger:r,options:s,getMessage:g})=>{let c=e.me.id,{accountSettings:I}=e,p={id:BA(SWe(n.key))},B=_H(n);B&&(p.messages=[{message:n}],p.conversationTimestamp=zr(n.messageTimestamp),TH(n)&&(p.unreadCount=(p.unreadCount||0)+1));let f=Si(n.message);(B||f?.reactionMessage?.key?.fromMe)&&I?.unarchiveChats&&(p.archived=!1,p.readOnly=!1);let Q=f?.protocolMessage;if(Q){let y=new Set([ne.Message.ProtocolMessage.Type.HISTORY_SYNC_NOTIFICATION,ne.Message.ProtocolMessage.Type.APP_STATE_SYNC_KEY_SHARE,ne.Message.ProtocolMessage.Type.LID_MIGRATION_MAPPING_SYNC,ne.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE]);if(Q.type!==null&&Q.type!==void 0&&y.has(Q.type)&&!n.key.fromMe){r?.warn({msgId:n.key.id,type:Q.type,from:n.key.participant||n.key.remoteJid},"dropping spoofed self-only protocolMessage from non-self origin");return}switch(Q.type){case ne.Message.ProtocolMessage.Type.HISTORY_SYNC_NOTIFICATION:let m=Q.historySyncNotification,T=t,_=!e.processedHistoryMessages?.length;if(r?.info({histNotification:m,process:T,id:n.key.id,isLatest:_},"got history notification"),T){m.syncType!==ne.HistorySync.HistorySyncType.ON_DEMAND&&a.emit("creds.update",{processedHistoryMessages:[...e.processedHistoryMessages||[],{key:n.key,messageTimestamp:n.messageTimestamp}]});let G=await Ose(m,s,r);G.lidPnMappings?.length&&(r?.debug({count:G.lidPnMappings.length},"processing LID-PN mappings from history sync"),await i.lidMapping.storeLIDPNMappings(G.lidPnMappings).catch(V=>r?.warn({err:V},"failed to store LID-PN mappings from history sync"))),await mWe(G.chats,i,A,r),a.emit("messaging-history.set",{...G,isLatest:m.syncType!==ne.HistorySync.HistorySyncType.ON_DEMAND?_:void 0,chunkOrder:m.chunkOrder,peerDataRequestSessionId:m.peerDataRequestSessionId})}break;case ne.Message.ProtocolMessage.Type.APP_STATE_SYNC_KEY_SHARE:let R=Q.appStateSyncKeyShare.keys;if(R?.length){let G="";await A.transaction(async()=>{let V=[];for(let{keyData:H,keyId:N}of R){let k=Buffer.from(N.keyId).toString("base64");V.push(k),await A.set({"app-state-sync-key":{[k]:H}}),G=k}r?.info({newAppStateSyncKeyId:G,newKeys:V},"injecting new app state sync keys")},c),a.emit("creds.update",{myAppStateKeyId:G})}else r?.info({protocolMsg:Q},"recv app state sync with 0 keys");break;case ne.Message.ProtocolMessage.Type.REVOKE:a.emit("messages.update",[{key:{...n.key,id:Q.key.id},update:{message:null,messageStubType:RA.REVOKE,key:n.key}}]);break;case ne.Message.ProtocolMessage.Type.EPHEMERAL_SETTING:Object.assign(p,{ephemeralSettingTimestamp:zr(n.messageTimestamp),ephemeralExpiration:Q.ephemeralExpiration||null});break;case ne.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_RESPONSE_MESSAGE:let L=Q.peerDataOperationRequestResponseMessage;if(L){let G=L.peerDataOperationResult||[];for(let V of G){let H=V?.placeholderMessageResendResponse;if(H?.webMessageInfoBytes)try{let N=ne.WebMessageInfo.decode(H.webMessageInfoBytes),k=N.key?.id,J=k?await o?.get(k):void 0;k&&await o?.del(k);let X;J&&typeof J=="object"?(J.message=N.message,N.messageTimestamp&&(J.messageTimestamp=N.messageTimestamp),X=J):X=N,r?.debug({msgId:k,requestId:L.stanzaId},"received placeholder resend"),a.emit("messages.upsert",{messages:[X],type:"notify",requestId:L.stanzaId})}catch(N){r?.warn({err:N,stanzaId:L.stanzaId},"failed to decode placeholder resend response")}}}break;case ne.Message.ProtocolMessage.Type.MESSAGE_EDIT:a.emit("messages.update",[{key:{...n.key,id:Q.key?.id},update:{message:{editedMessage:{message:Q.editedMessage}},messageTimestamp:Q.timestampMs?Math.floor(zr(Q.timestampMs)/1e3):n.messageTimestamp}}]);break;case ne.Message.ProtocolMessage.Type.GROUP_MEMBER_LABEL_CHANGE:let U=Q.memberLabel;U?.label&&a.emit("group.member-tag.update",{groupId:p.id,label:U.label,participant:n.key.participant,participantAlt:n.key.participantAlt,messageTimestamp:Number(n.messageTimestamp)});break;case ne.Message.ProtocolMessage.Type.LID_MIGRATION_MAPPING_SYNC:let F=Q.lidMigrationMappingSyncMessage?.encodedMappingPayload,{pnToLidMappings:q,chatDbMigrationTimestamp:z}=ne.LIDMigrationMappingSyncPayload.decode(F);r?.debug({pnToLidMappings:q,chatDbMigrationTimestamp:z},"got lid mappings and chat db migration timestamp");let K=[];for(let{pn:G,latestLid:V,assignedLid:H}of q){let N=V||H;K.push({lid:`${N}@lid`,pn:`${G}@s.whatsapp.net`})}if(await i.lidMapping.storeLIDPNMappings(K),K.length)for(let{pn:G,lid:V}of K)await i.migrateSession(G,V)}}else if(f?.reactionMessage){let y={...f.reactionMessage,key:n.key};a.emit("messages.reaction",[{reaction:y,key:f.reactionMessage?.key}])}else if(f?.encEventResponseMessage){let y=f.encEventResponseMessage,m=y.eventCreationMessageKey,T=await g(m);if(T)try{let _=BA(c),R=m.participant||m.remoteJid,L=qA(R)?await i.lidMapping.getPNForLID(R):R,U=vh({remoteJid:BA(L),fromMe:_===L},_),F=vh(n.key,_),q=T?.messageContextInfo?.messageSecret;if(!q)r?.warn({creationMsgKey:m},"event response: missing messageSecret for decryption");else{let z=wWe(y,{eventEncKey:q,eventCreatorJid:U,eventMsgId:m.id,responderJid:F}),K={eventResponseMessageKey:n.key,senderTimestampMs:z.timestampMs,response:z};a.emit("messages.update",[{key:m,update:{eventResponses:[K]}}])}}catch(_){r?.warn({err:_,creationMsgKey:m},"failed to decrypt event response")}else r?.warn({creationMsgKey:m},"event creation message not found, cannot decrypt response")}else if(n.messageStubType){let y=n.key?.remoteJid,m,T=U=>a.emit("group-participants.update",{id:y,author:n.key.participant,authorPn:n.key.participantAlt,authorUsername:n.key.participantUsername,participants:m,action:U}),_=U=>{a.emit("groups.update",[{id:y,...U,author:n.key.participant??void 0,authorPn:n.key.participantAlt,authorUsername:n.key.participantUsername}])},R=(U,F,q)=>{a.emit("group.join-request",{id:y,author:n.key.participant,authorPn:n.key.participantAlt,authorUsername:n.key.participantUsername,participant:U.lid,participantPn:U.pn,action:F,method:q})},L=()=>m.find(U=>ft(c,U.phoneNumber));switch(n.messageStubType){case RA.GROUP_PARTICIPANT_CHANGE_NUMBER:m=n.messageStubParameters.map(J=>JSON.parse(J))||[],T("modify");break;case RA.GROUP_PARTICIPANT_LEAVE:case RA.GROUP_PARTICIPANT_REMOVE:m=n.messageStubParameters.map(J=>JSON.parse(J))||[],T("remove"),L()&&(p.readOnly=!0);break;case RA.GROUP_PARTICIPANT_ADD:case RA.GROUP_PARTICIPANT_INVITE:case RA.GROUP_PARTICIPANT_ADD_REQUEST_JOIN:m=n.messageStubParameters.map(J=>JSON.parse(J))||[],L()&&(p.readOnly=!1),T("add");break;case RA.GROUP_PARTICIPANT_DEMOTE:m=n.messageStubParameters.map(J=>JSON.parse(J))||[],T("demote");break;case RA.GROUP_PARTICIPANT_PROMOTE:m=n.messageStubParameters.map(J=>JSON.parse(J))||[],T("promote");break;case RA.GROUP_CHANGE_ANNOUNCE:let U=n.messageStubParameters?.[0];_({announce:U==="true"||U==="on"});break;case RA.GROUP_CHANGE_RESTRICT:let F=n.messageStubParameters?.[0];_({restrict:F==="true"||F==="on"});break;case RA.GROUP_CHANGE_SUBJECT:let q=n.messageStubParameters?.[0];p.name=q,_({subject:q});break;case RA.GROUP_CHANGE_DESCRIPTION:let z=n.messageStubParameters?.[0];p.description=z,_({desc:z});break;case RA.GROUP_CHANGE_INVITE_LINK:let K=n.messageStubParameters?.[0];_({inviteCode:K});break;case RA.GROUP_MEMBER_ADD_MODE:let G=n.messageStubParameters?.[0];_({memberAddMode:G==="all_member_add"});break;case RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE:let V=n.messageStubParameters?.[0];_({joinApprovalMode:V==="on"});break;case RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD:let H=JSON.parse(n.messageStubParameters?.[0]),N=n.messageStubParameters?.[1],k=n.messageStubParameters?.[2];R(H,N,k);break}}Object.keys(p).length>1&&a.emit("chats.update",[p])},age=DWe;var bWe=["messaging-history.set","chats.upsert","chats.update","chats.delete","contacts.upsert","contacts.update","messages.upsert","messages.update","messages.delete","messages.reaction","message-receipt.update","groups.update"],MWe=new Set(bWe),oge=n=>{let t=new OWe,o=new Set,a=NH(),e=!1,i=null,A=null,r=0,s=1e4,g=3e4;t.on("event",p=>{for(let B in p)t.emit(B,p[B])});function c(){e||(n.debug("Event buffer activated"),e=!0,r=0,i&&clearTimeout(i),i=setTimeout(()=>{e&&(n.warn("Buffer timeout reached, auto-flushing"),I())},g)),r++}function I(){if(!e)return!1;n.debug({bufferCount:r},"Flushing event buffer"),e=!1,r=0,i&&(clearTimeout(i),i=null),A&&(clearTimeout(A),A=null),o.size>s&&(n.debug({cacheSize:o.size},"Clearing history cache"),o.clear());let p=NH(),B=Object.values(a.chatUpdates),f=0;for(let y of B)y.conditional&&(f+=1,p.chatUpdates[y.id]=y,delete a.chatUpdates[y.id]);let Q=TWe(a);return Object.keys(Q).length&&t.emit("event",Q),a=p,n.trace({conditionalChatUpdatesLeft:f},"released buffered events"),!0}return{process(p){let B=async f=>{await p(f)};return t.on("event",B),()=>{t.off("event",B)}},emit(p,B){if(p==="messages.upsert"){let{type:f}=B,Q=Object.values(a.messageUpserts);if(Q.length>0){let y=Q[0].type;y!==f&&(n.debug({bufferedType:y,newType:f},"messages.upsert type mismatch, emitting buffered messages"),t.emit("event",{"messages.upsert":{messages:Q.map(m=>m.message),type:y}}),a.messageUpserts={})}}return e&&MWe.has(p)?(_We(a,o,p,B,n),!0):t.emit("event",{[p]:B})},isBuffering(){return e},buffer:c,flush:I,createBufferedFunction(p){return async(...B)=>{c();try{let f=await p(...B);return r===1&&setTimeout(()=>{e&&r===1&&I()},100),f}catch(f){throw f}finally{r=Math.max(0,r-1),r===0&&(A||(A=setTimeout(I,100)))}}},on:(...p)=>t.on(...p),off:(...p)=>t.off(...p),removeAllListeners:(...p)=>t.removeAllListeners(...p),destroy(){i&&(clearTimeout(i),i=null),A&&(clearTimeout(A),A=null),o.clear(),a=NH(),e=!1,r=0,t.removeAllListeners(),n.debug("Event buffer destroyed")}}},NH=()=>({historySets:{chats:{},messages:{},contacts:{},isLatest:!1,empty:!0},chatUpserts:{},chatUpdates:{},chatDeletes:new Set,contactUpserts:{},contactUpdates:{},messageUpserts:{},messageUpdates:{},messageReactions:{},messageDeletes:{},messageReceipts:{},groupUpdates:{}});function _We(n,t,o,a,e){switch(o){case"messaging-history.set":for(let Q of a.chats){let y=Q.id||"",m=n.historySets.chats[y];m&&(m.endOfHistoryTransferType=Q.endOfHistoryTransferType),!m&&!t.has(y)&&(n.historySets.chats[y]=Q,t.add(y),i(Q))}for(let Q of a.contacts){let y=n.historySets.contacts[Q.id];if(y)Object.assign(y,YD(Q));else{let m=`c:${Q.id}`,T=Q.notify||Q.name||Q.verifiedName;(!t.has(m)||T)&&(n.historySets.contacts[Q.id]=Q,t.add(m))}}for(let Q of a.messages){let y=NE(Q.key);!n.historySets.messages[y]&&!t.has(y)&&(n.historySets.messages[y]=Q,t.add(y))}if(n.historySets.empty=!1,n.historySets.syncType=a.syncType,a.pastParticipants?.length){let Q=new Map,y=T=>`${T.userJid||""}:${T.leaveTs||""}:${T.leaveReason||""}`,m=T=>{let _=T.groupJid??JSON.stringify(T),R=Q.get(_);if(!R){Q.set(_,{...T,pastParticipants:[...T.pastParticipants||[]]});return}let L=new Set((R.pastParticipants||[]).map(y));for(let U of T.pastParticipants||[]){let F=y(U);L.has(F)||(R.pastParticipants.push(U),L.add(F))}};for(let T of n.historySets.pastParticipants||[])m(T);for(let T of a.pastParticipants)m(T);n.historySets.pastParticipants=[...Q.values()]}n.historySets.progress=a.progress,n.historySets.chunkOrder=a.chunkOrder,n.historySets.peerDataRequestSessionId=a.peerDataRequestSessionId,n.historySets.isLatest=a.isLatest||n.historySets.isLatest;break;case"chats.upsert":for(let Q of a){let y=Q.id||"",m=n.chatUpserts[y];y&&!m&&(m=n.historySets.chats[y],m&&e.debug({chatId:y},"absorbed chat upsert in chat set")),m?m=iM(m,Q):(m=Q,n.chatUpserts[y]=m),i(m),n.chatDeletes.has(y)&&n.chatDeletes.delete(y)}break;case"chats.update":for(let Q of a){let y=Q.id,m=Q.conditional?Q.conditional(n):!0;if(m){delete Q.conditional;let T=n.historySets.chats[y]||n.chatUpserts[y];if(T)iM(T,Q);else{let _=n.chatUpdates[y]||{};n.chatUpdates[y]=iM(_,Q)}}else m===void 0&&(n.chatUpdates[y]=Q);n.chatDeletes.has(y)&&n.chatDeletes.delete(y)}break;case"chats.delete":for(let Q of a)n.chatDeletes.has(Q)||n.chatDeletes.add(Q),n.chatUpdates[Q]&&delete n.chatUpdates[Q],n.chatUpserts[Q]&&delete n.chatUpserts[Q],n.historySets.chats[Q]&&delete n.historySets.chats[Q];break;case"contacts.upsert":for(let Q of a){let y=n.contactUpserts[Q.id];y||(y=n.historySets.contacts[Q.id],y&&e.debug({contactId:Q.id},"absorbed contact upsert in contact set")),y?y=Object.assign(y,YD(Q)):(y=Q,n.contactUpserts[Q.id]=y),n.contactUpdates[Q.id]&&(y=Object.assign(n.contactUpdates[Q.id],YD(Q)),delete n.contactUpdates[Q.id])}break;case"contacts.update":let r=a;for(let Q of r){let y=Q.id,m=n.historySets.contacts[y]||n.contactUpserts[y];if(m)Object.assign(m,Q);else{let T=n.contactUpdates[y]||{};n.contactUpdates[y]=Object.assign(T,Q)}}break;case"messages.upsert":let{messages:s,type:g}=a;for(let Q of s){let y=NE(Q.key),m=n.messageUpserts[y]?.message;m||(m=n.historySets.messages[y],m&&e.debug({messageId:y},"absorbed message upsert in message set")),m&&(Q.messageTimestamp=m.messageTimestamp),n.messageUpdates[y]&&(e.debug("absorbed prior message update in message upsert"),Object.assign(Q,n.messageUpdates[y].update),delete n.messageUpdates[y]),n.historySets.messages[y]?n.historySets.messages[y]=Q:n.messageUpserts[y]={message:Q,type:g==="notify"||n.messageUpserts[y]?.type==="notify"?"notify":g}}break;case"messages.update":let c=a;for(let{key:Q,update:y}of c){let m=NE(Q),T=n.historySets.messages[m]||n.messageUpserts[m]?.message;if(T)Object.assign(T,y),y.status===bh.READ&&!Q.fromMe&&A(T);else{let _=n.messageUpdates[m]||{key:Q,update:{}};Object.assign(_.update,y),n.messageUpdates[m]=_}}break;case"messages.delete":let I=a;if("keys"in I){let{keys:Q}=I;for(let y of Q){let m=NE(y);n.messageDeletes[m]||(n.messageDeletes[m]=y),n.messageUpserts[m]&&delete n.messageUpserts[m],n.messageUpdates[m]&&delete n.messageUpdates[m]}}break;case"messages.reaction":let p=a;for(let{key:Q,reaction:y}of p){let m=NE(Q),T=n.messageUpserts[m];T?eH(T.message,y):(n.messageReactions[m]=n.messageReactions[m]||{key:Q,reactions:[]},eH(n.messageReactions[m],y))}break;case"message-receipt.update":let B=a;for(let{key:Q,receipt:y}of B){let m=NE(Q),T=n.messageUpserts[m];T?$U(T.message,y):(n.messageReceipts[m]=n.messageReceipts[m]||{key:Q,userReceipt:[]},$U(n.messageReceipts[m],y))}break;case"groups.update":let f=a;for(let Q of f){let y=Q.id,m=n.groupUpdates[y]||{};n.groupUpdates[y]||(n.groupUpdates[y]=Object.assign(m,Q))}break;default:throw new Error(`"${o}" cannot be buffered`)}function i(r){let s=r.id||"",g=n.chatUpdates[s];if(g){let c=g.conditional?g.conditional(n):!0;c?(delete g.conditional,e.debug({chatId:s},"absorbed chat update in existing chat"),Object.assign(r,iM(g,r)),delete n.chatUpdates[s]):c===!1&&(e.debug({chatId:s},"chat update condition fail, removing"),delete n.chatUpdates[s])}}function A(r){let s=r.key.remoteJid,g=n.chatUpdates[s]||n.chatUpserts[s];_H(r)&&TH(r)&&typeof g?.unreadCount=="number"&&g.unreadCount>0&&(e.debug({chatId:g.id},"decrementing chat counter"),g.unreadCount-=1,g.unreadCount===0&&delete g.unreadCount)}}function TWe(n){let t={};n.historySets.empty||(t["messaging-history.set"]={chats:Object.values(n.historySets.chats),messages:Object.values(n.historySets.messages),contacts:Object.values(n.historySets.contacts),pastParticipants:n.historySets.pastParticipants,syncType:n.historySets.syncType,progress:n.historySets.progress,isLatest:n.historySets.isLatest,chunkOrder:n.historySets.chunkOrder,peerDataRequestSessionId:n.historySets.peerDataRequestSessionId});let o=Object.values(n.chatUpserts);o.length&&(t["chats.upsert"]=o);let a=Object.values(n.chatUpdates);a.length&&(t["chats.update"]=a);let e=Array.from(n.chatDeletes);e.length&&(t["chats.delete"]=e);let i=Object.values(n.messageUpserts);if(i.length){let B=i[0].type;t["messages.upsert"]={messages:i.map(f=>f.message),type:B}}let A=Object.values(n.messageUpdates);A.length&&(t["messages.update"]=A);let r=Object.values(n.messageDeletes);r.length&&(t["messages.delete"]={keys:r});let s=Object.values(n.messageReactions).flatMap(({key:B,reactions:f})=>f.flatMap(Q=>({key:B,reaction:Q})));s.length&&(t["messages.reaction"]=s);let g=Object.values(n.messageReceipts).flatMap(({key:B,userReceipt:f})=>f.flatMap(Q=>({key:B,receipt:Q})));g.length&&(t["message-receipt.update"]=g);let c=Object.values(n.contactUpserts);c.length&&(t["contacts.upsert"]=c);let I=Object.values(n.contactUpdates);I.length&&(t["contacts.update"]=I);let p=Object.values(n.groupUpdates);return p.length&&(t["groups.update"]=p),t}function iM(n,t){return t.unreadCount===null&&n.unreadCount<0&&(n.unreadCount=void 0,t.unreadCount=void 0),typeof n.unreadCount=="number"&&typeof t.unreadCount=="number"&&(t={...t},t.unreadCount>=0&&(t.unreadCount=Math.max(t.unreadCount,0)+Math.max(n.unreadCount,0))),Object.assign(n,t)}var NE=n=>`${n.remoteJid},${n.id},${n.fromMe?"1":"0"}`;var NWe=512,RH="\0",nge=3600*1e3,RWe=3e3,cc;(function(n){n[n.UnknownError=0]="UnknownError",n[n.SignalErrorNoSession=1]="SignalErrorNoSession",n[n.SignalErrorInvalidKey=2]="SignalErrorInvalidKey",n[n.SignalErrorInvalidKeyId=3]="SignalErrorInvalidKeyId",n[n.SignalErrorInvalidMessage=4]="SignalErrorInvalidMessage",n[n.SignalErrorInvalidSignature=5]="SignalErrorInvalidSignature",n[n.SignalErrorFutureMessage=6]="SignalErrorFutureMessage",n[n.SignalErrorBadMac=7]="SignalErrorBadMac",n[n.SignalErrorInvalidSession=8]="SignalErrorInvalidSession",n[n.SignalErrorInvalidMsgKey=9]="SignalErrorInvalidMsgKey",n[n.BadBroadcastEphemeralSetting=10]="BadBroadcastEphemeralSetting",n[n.UnknownCompanionNoPrekey=11]="UnknownCompanionNoPrekey",n[n.AdvFailure=12]="AdvFailure",n[n.StatusRevokeDelay=13]="StatusRevokeDelay"})(cc||(cc={}));var sge=new Set([cc.SignalErrorInvalidMessage,cc.SignalErrorBadMac]),aM=class{constructor(t,o){this.logger=t,this.recentMessagesMap=new Jg({max:NWe,ttl:300*1e3,ttlAutopurge:!0,dispose:(a,e)=>{let i=e.lastIndexOf(RH);if(i>-1){let A=e.slice(i+RH.length);this.messageKeyIndex.delete(A)}}}),this.messageKeyIndex=new Map,this.sessionRecreateHistory=new Jg({ttl:nge*2,ttlAutopurge:!0}),this.retryCounters=new Jg({ttl:900*1e3,ttlAutopurge:!0,updateAgeOnGet:!0}),this.baseKeys=new Jg({max:1024,ttl:900*1e3,ttlAutopurge:!0}),this.pendingPhoneRequests={},this.maxMsgRetryCount=5,this.statistics={totalRetries:0,successfulRetries:0,failedRetries:0,mediaRetries:0,sessionRecreations:0,phoneRequests:0},this.maxMsgRetryCount=o}addRecentMessage(t,o,a){let e={to:t,id:o},i=this.keyToString(e);this.recentMessagesMap.set(i,{message:a,timestamp:Date.now()}),this.messageKeyIndex.set(o,i),this.logger.debug(`Added message to retry cache: ${t}/${o}`)}getRecentMessage(t,o){let a={to:t,id:o},e=this.keyToString(a);return this.recentMessagesMap.get(e)}shouldRecreateSession(t,o,a){if(!o)return this.sessionRecreateHistory.set(t,Date.now()),this.statistics.sessionRecreations++,{reason:"we don't have a Signal session with them",recreate:!0};if(a!==void 0&&sge.has(a))return this.sessionRecreateHistory.set(t,Date.now()),this.statistics.sessionRecreations++,this.logger.warn({jid:t,errorCode:cc[a]},"MAC error detected, forcing immediate session recreation"),{reason:`MAC error (code ${a}: ${cc[a]}), immediate session recreation`,recreate:!0};let e=Date.now(),i=this.sessionRecreateHistory.get(t);return!i||e-i>nge?(this.sessionRecreateHistory.set(t,e),this.statistics.sessionRecreations++,{reason:"retry count > 1 and over an hour since last recreation",recreate:!0}):{reason:"",recreate:!1}}parseRetryErrorCode(t){if(t===void 0||t==="")return;let o=parseInt(t,10);if(!Number.isNaN(o))return o>=cc.UnknownError&&o<=cc.StatusRevokeDelay?o:cc.UnknownError}isMacError(t){return t!==void 0&&sge.has(t)}incrementRetryCount(t){return this.retryCounters.set(t,(this.retryCounters.get(t)||0)+1),this.statistics.totalRetries++,this.retryCounters.get(t)}getRetryCount(t){return this.retryCounters.get(t)||0}hasExceededMaxRetries(t){return this.getRetryCount(t)>=this.maxMsgRetryCount}markRetrySuccess(t){this.statistics.successfulRetries++,this.retryCounters.delete(t),this.cancelPendingPhoneRequest(t),this.removeRecentMessage(t)}markRetryFailed(t){this.statistics.failedRetries++,this.retryCounters.delete(t),this.cancelPendingPhoneRequest(t),this.removeRecentMessage(t)}schedulePhoneRequest(t,o,a=RWe){this.cancelPendingPhoneRequest(t),this.pendingPhoneRequests[t]=setTimeout(()=>{delete this.pendingPhoneRequests[t],this.statistics.phoneRequests++,o()},a),this.logger.debug(`Scheduled phone request for message ${t} with ${a}ms delay`)}cancelPendingPhoneRequest(t){let o=this.pendingPhoneRequests[t];o&&(clearTimeout(o),delete this.pendingPhoneRequests[t],this.logger.debug(`Cancelled pending phone request for message ${t}`))}clear(){this.recentMessagesMap.clear(),this.messageKeyIndex.clear(),this.sessionRecreateHistory.clear(),this.retryCounters.clear(),this.baseKeys.clear();for(let t of Object.keys(this.pendingPhoneRequests))this.cancelPendingPhoneRequest(t);this.statistics={totalRetries:0,successfulRetries:0,failedRetries:0,mediaRetries:0,sessionRecreations:0,phoneRequests:0}}saveBaseKey(t,o,a){this.baseKeys.set(`${t}:${o}`,a)}hasSameBaseKey(t,o,a){let e=this.baseKeys.get(`${t}:${o}`);if(!e||e.length!==a.length)return!1;for(let i=0;i["Ubuntu",n,"22.04.4"],macOS:n=>["Mac OS",n,"14.4.1"],baileys:n=>["Baileys",n,"6.5.0"],windows:n=>["Windows",n,"10.0.22631"],android:n=>[n,"Android",""],appropriate:n=>[PWe[kWe()]||"Ubuntu",n,vWe()]};var $n;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.CHROME=1]="CHROME",n[n.EDGE=2]="EDGE",n[n.FIREFOX=3]="FIREFOX",n[n.IE=4]="IE",n[n.OPERA=5]="OPERA",n[n.SAFARI=6]="SAFARI",n[n.ELECTRON=7]="ELECTRON",n[n.UWP=8]="UWP",n[n.OTHER_WEB_CLIENT=9]="OTHER_WEB_CLIENT"})($n||($n={}));var GWe={Chrome:$n.CHROME,Edge:$n.EDGE,Firefox:$n.FIREFOX,IE:$n.IE,Opera:$n.OPERA,Safari:$n.SAFARI},FWe=([n,t])=>t==="Desktop"?n==="Windows"?$n.UWP:$n.ELECTRON:GWe[t]||$n.OTHER_WEB_CLIENT,kH=n=>FWe(n).toString(),gge=(n,t,o,a,e)=>"https://wa.me/settings/linked_devices#"+[n,t,o,a,kH(e)].join(",");async function cge(n,t){let o=n.attrs.from;if(!o)return{action:"invalid_notification"};if(!le(n,"identity"))return{action:"no_identity_node"};t.logger.info({jid:o},"identity changed");let e=pA(o);if(e?.device&&e.device!==0)return t.logger.debug({jid:o,device:e.device},"ignoring identity change from companion device"),{action:"skipped_companion_device",device:e.device};if(t.meId&&(ft(o,t.meId)||t.meLid&&ft(o,t.meLid)))return t.logger.info({jid:o},"self primary identity changed"),{action:"skipped_self_primary"};if(t.debounceCache.get(o))return t.logger.debug({jid:o},"skipping identity assert (debounced)"),{action:"debounced"};t.debounceCache.set(o,!0);let A=!V$(n.attrs.offline);if(!(await t.validateSession(o)).exists)return t.logger.debug({jid:o},"no old session, skipping session refresh"),{action:"skipped_no_session"};if(t.logger.debug({jid:o},"old session exists, will refresh session"),A)return t.logger.debug({jid:o},"skipping session refresh during offline processing"),{action:"skipped_offline"};t.onBeforeSessionRefresh?.(o);try{return await t.assertSessions([o],!0),{action:"session_refreshed"}}catch(s){return t.logger.warn({error:s,jid:o},"failed to assert sessions after identity change"),{action:"session_refresh_failed",error:s}}}function Ige(n,t,o){let{tag:a,attrs:e}=n,i={tag:"ack",attrs:{id:e.id,to:e.from,class:a}};return t&&(i.attrs.error=t.toString()),e.participant&&(i.attrs.participant=e.participant),e.recipient&&(i.attrs.recipient=e.recipient),e.type&&(i.attrs.type=e.type),a==="message"&&o&&(i.attrs.from=o),i}function LWe(n){return n===null||n===""}function UWe(n){return n>2147483647||n<-2147483648?n&4294967295:n}function lge(n){let t=0;if(!LWe(n))for(let o=0;oo.iteration===t)}addSenderMessageKey(t){this.senderKeyStateStructure.senderMessageKeys.push({iteration:t.getIteration(),seed:t.getSeed()}),this.senderKeyStateStructure.senderMessageKeys.length>this.MAX_MESSAGE_KEYS&&this.senderKeyStateStructure.senderMessageKeys.shift()}removeSenderMessageKey(t){let o=this.senderKeyStateStructure.senderMessageKeys.findIndex(a=>a.iteration===t);if(o!==-1){let a=this.senderKeyStateStructure.senderMessageKeys[o];return this.senderKeyStateStructure.senderMessageKeys.splice(o,1),new fp(a.iteration,a.seed)}return null}getStructure(){return this.senderKeyStateStructure}};var Ic=class n{constructor(t){if(this.MAX_STATES=5,this.senderKeyStates=[],t)for(let o of t)this.senderKeyStates.push(new Qp(null,null,null,null,null,null,o))}isEmpty(){return this.senderKeyStates.length===0}getSenderKeyState(t){return t===void 0&&this.senderKeyStates.length?this.senderKeyStates[this.senderKeyStates.length-1]:this.senderKeyStates.find(o=>o.getKeyId()===t)}addSenderKeyState(t,o,a,e){this.senderKeyStates.push(new Qp(t,o,a,null,e)),this.senderKeyStates.length>this.MAX_STATES&&this.senderKeyStates.shift()}setSenderKeyState(t,o,a,e){this.senderKeyStates.length=0,this.senderKeyStates.push(new Qp(t,o,a,e))}serialize(){return this.senderKeyStates.map(t=>t.getStructure())}static deserialize(t){let o=Buffer.from(t).toString("utf-8"),a=JSON.parse(o,WB.reviver);return new n(a)}};var hge=ze(Xc(),1);import*as nM from"crypto";function Ege(){return nM.randomBytes(32)}function uge(){return nM.randomInt(2147483647)}function Cge(n){return n||(n=(0,hge.generateKeyPair)()),{public:Buffer.from(n.pubKey),private:Buffer.from(n.privKey)}}var yp=class{constructor(){this.UNSUPPORTED_VERSION=1,this.CURRENT_VERSION=3,this.WHISPER_TYPE=2,this.PREKEY_TYPE=3,this.SENDERKEY_TYPE=4,this.SENDERKEY_DISTRIBUTION_TYPE=5,this.ENCRYPTED_MESSAGE_OVERHEAD=53}};var mp=class extends yp{constructor(t,o,a,e,i){if(super(),i)try{let A=i.slice(1),r=ne.SenderKeyDistributionMessage.decode(A).toJSON();this.serialized=i,this.id=r.id,this.iteration=r.iteration,this.chainKey=typeof r.chainKey=="string"?Buffer.from(r.chainKey,"base64"):r.chainKey,this.signatureKey=typeof r.signingKey=="string"?Buffer.from(r.signingKey,"base64"):r.signingKey}catch(A){throw new Error(String(A))}else{let A=this.intsToByteHighAndLow(this.CURRENT_VERSION,this.CURRENT_VERSION);this.id=t,this.iteration=o,this.chainKey=a,this.signatureKey=e;let r=ne.SenderKeyDistributionMessage.encode(ne.SenderKeyDistributionMessage.create({id:t,iteration:o,chainKey:a,signingKey:this.signatureKey})).finish();this.serialized=Buffer.concat([Buffer.from([A]),r])}}intsToByteHighAndLow(t,o){return((t<<4|o)&255)%256}serialize(){return this.serialized}getType(){return this.SENDERKEY_DISTRIBUTION_TYPE}getIteration(){return this.iteration}getChainKey(){return this.chainKey}getSignatureKey(){return this.signatureKey}getId(){return this.id}};var RE=class{constructor(t){this.senderKeyStore=t}async process(t,o){let a=await this.senderKeyStore.loadSenderKey(t);a.addSenderKeyState(o.getId(),o.getIteration(),o.getChainKey(),o.getSignatureKey()),await this.senderKeyStore.storeSenderKey(t,a)}async create(t){let o=await this.senderKeyStore.loadSenderKey(t);if(o.isEmpty()){let e=uge(),i=Ege(),A=Cge();o.setSenderKeyState(e,0,i,A),await this.senderKeyStore.storeSenderKey(t,o)}let a=o.getSenderKeyState();if(!a)throw new Error("No session state available");return new mp(a.getKeyId(),a.getSenderChainKey().getIteration(),a.getSenderChainKey().getSeed(),a.getSigningKeyPublic())}};var gM=ze(Kl(),1);var sM=ze(Xc(),1);var kE=class extends yp{constructor(t,o,a,e,i){if(super(),this.SIGNATURE_LENGTH=64,i){let A=i[0],r=i.slice(1,i.length-this.SIGNATURE_LENGTH),s=i.slice(-1*this.SIGNATURE_LENGTH),g=ne.SenderKeyMessage.decode(r).toJSON();this.serialized=i,this.messageVersion=(A&255)>>4,this.keyId=g.id,this.iteration=g.iteration,this.ciphertext=typeof g.ciphertext=="string"?Buffer.from(g.ciphertext,"base64"):g.ciphertext,this.signature=s}else{let A=((this.CURRENT_VERSION<<4|this.CURRENT_VERSION)&255)%256,r=Buffer.from(a),s=ne.SenderKeyMessage.encode(ne.SenderKeyMessage.create({id:t,iteration:o,ciphertext:r})).finish(),g=this.getSignature(e,Buffer.concat([Buffer.from([A]),s]));this.serialized=Buffer.concat([Buffer.from([A]),s,Buffer.from(g)]),this.messageVersion=this.CURRENT_VERSION,this.keyId=t,this.iteration=o,this.ciphertext=r,this.signature=g}}getKeyId(){return this.keyId}getIteration(){return this.iteration}getCipherText(){return this.ciphertext}verifySignature(t){let o=this.serialized.slice(0,this.serialized.length-this.SIGNATURE_LENGTH),a=this.serialized.slice(-1*this.SIGNATURE_LENGTH);if(!(0,sM.verifySignature)(t,o,a))throw new Error("Invalid signature!")}getSignature(t,o){return Buffer.from((0,sM.calculateSignature)(t,o))}serialize(){return this.serialized}getType(){return 4}};var vE=class{constructor(t,o){this.senderKeyStore=t,this.senderKeyName=o}async encrypt(t){let o=await this.senderKeyStore.loadSenderKey(this.senderKeyName);if(!o)throw new Error("No SenderKeyRecord found for encryption");let a=o.getSenderKeyState();if(!a)throw new Error("No session to encrypt message");let e=a.getSenderChainKey().getIteration(),i=this.getSenderKey(a,e===0?0:e+1),A=await this.getCipherText(i.getIv(),i.getCipherKey(),t),r=new kE(a.getKeyId(),i.getIteration(),A,a.getSigningKeyPrivate());return await this.senderKeyStore.storeSenderKey(this.senderKeyName,o),r.serialize()}async decrypt(t){let o=await this.senderKeyStore.loadSenderKey(this.senderKeyName);if(!o)throw new Error("No SenderKeyRecord found for decryption");let a=new kE(null,null,null,null,t),e=o.getSenderKeyState(a.getKeyId());if(!e)throw new Error("No session found to decrypt message");a.verifySignature(e.getSigningKeyPublic());let i=this.getSenderKey(e,a.getIteration()),A=await this.getPlainText(i.getIv(),i.getCipherKey(),a.getCipherText());return await this.senderKeyStore.storeSenderKey(this.senderKeyName,o),A}getSenderKey(t,o){let a=t.getSenderChainKey();if(a.getIteration()>o){if(t.hasSenderMessageKey(o)){let e=t.removeSenderMessageKey(o);if(!e)throw new Error("No sender message key found for iteration");return e}throw new Error(`Received message with old counter: ${a.getIteration()}, ${o}`)}if(o-a.getIteration()>2e3)throw new Error("Over 2000 messages into the future!");for(;a.getIteration()0){let r=[...a];this.logger.trace(`Batch fetching ${r.length} LID mappings from database`);let s=await this.keys.get("lid-mapping",r);for(let g of r){let c=s[g];c&&(e.set(g,c),this.mappingCache.set(`pn:${g}`,c),this.mappingCache.set(`lid:${c}`,g))}}let i={};for(let{pnUser:r,lidUser:s}of o){if(e.get(r)===s){this.logger.debug({pnUser:r,lidUser:s},"LID mapping already exists, skipping");continue}i[r]=s}if(Object.keys(i).length===0)return;this.logger.trace({pairMap:i},`Storing ${Object.keys(i).length} pn mappings`);let A={};for(let[r,s]of Object.entries(i))A[r]=s,A[`${s}_reverse`]=r;await this.keys.transaction(async()=>{await this.keys.set({"lid-mapping":A})},"lid-mapping");for(let[r,s]of Object.entries(i))this.mappingCache.set(`pn:${r}`,s),this.mappingCache.set(`lid:${s}`,r)}async getLIDForPN(t){return(await this.getLIDsForPNs([t]))?.[0]?.lid||null}async getLIDsForPNs(t){if(t.length===0)return null;let o=[...new Set(t)].sort(),a=o.join(","),e=this.inflightLIDLookups.get(a);if(e)return this.logger.trace(`Coalescing getLIDsForPNs request for ${o.length} PNs`),e;let i=this._getLIDsForPNsImpl(t);this.inflightLIDLookups.set(a,i);try{return await i}finally{this.inflightLIDLookups.delete(a)}}async _getLIDsForPNsImpl(t){let o={},a={},e=[],i=(A,r,s)=>{let g=s.toString();if(!g)return this.logger.warn(`Invalid or empty LID user for PN ${A}: lidUser = "${s}"`),!1;let c=r.device!==void 0?r.device:0,I=`${g}${c?`:${c}`:""}@${r.server==="hosted"?"hosted.lid":"lid"}`;return this.logger.trace(`getLIDForPN: ${A} \u2192 ${I} (user mapping with device ${c})`),a[A]={lid:I,pn:A},!0};for(let A of t){if(!Rt(A)&&!Or(A))continue;let r=pA(A);if(!r)continue;let s=r.user,g=this.mappingCache.get(`pn:${s}`);if(g&&typeof g=="string"){if(!i(A,r,g)){this.logger.warn(`Invalid entry for ${A} (pair not resolved)`);continue}continue}e.push({pn:A,pnUser:s,decoded:r})}if(e.length){let A=[...new Set(e.map(s=>s.pnUser))],r=await this.keys.get("lid-mapping",A);for(let s of A){let g=r[s];g&&typeof g=="string"&&(this.mappingCache.set(`pn:${s}`,g),this.mappingCache.set(`lid:${g}`,s))}for(let{pn:s,pnUser:g,decoded:c}of e){let I=this.mappingCache.get(`pn:${g}`);if(I&&typeof I=="string"){if(!i(s,c,I)){this.logger.warn(`Invalid entry for ${s} (pair not resolved)`);continue}}else{this.logger.trace(`No LID mapping found for PN user ${g}; batch getting from USync`);let p=c.device||0,B=BA(s);Or(B)&&(B=`${g}@s.whatsapp.net`),o[B]?o[B]?.push(p):o[B]=[p]}}}if(Object.keys(o).length>0){let A=await this.pnToLIDFunc?.(Object.keys(o));if(A&&A.length>0){await this.storeLIDPNMappings(A);for(let r of A){let g=pA(r.pn)?.user;if(!g)continue;let c=pA(r.lid)?.user;if(c)for(let I of o[r.pn]){let p=`${c}${I?`:${I}`:""}@${I===99?"hosted.lid":"lid"}`;this.logger.trace(`getLIDForPN: USYNC success for ${r.pn} \u2192 ${p} (user mapping with device ${I})`);let B=`${g}${I?`:${I}`:""}@${I===99?"hosted":"s.whatsapp.net"}`;a[B]={lid:p,pn:B}}}}else this.logger.warn("USync fetch yielded no results for pending PNs")}return Object.values(a).length>0?Object.values(a):null}async getPNForLID(t){return(await this.getPNsForLIDs([t]))?.[0]?.pn||null}async getPNsForLIDs(t){if(t.length===0)return null;let o=[...new Set(t)].sort(),a=o.join(","),e=this.inflightPNLookups.get(a);if(e)return this.logger.trace(`Coalescing getPNsForLIDs request for ${o.length} LIDs`),e;let i=this._getPNsForLIDsImpl(t);this.inflightPNLookups.set(a,i);try{return await i}finally{this.inflightPNLookups.delete(a)}}async _getPNsForLIDsImpl(t){let o={},a=[],e=(i,A,r)=>{if(!r||typeof r!="string")return!1;let s=A.device!==void 0?A.device:0,g=`${r}:${s}@${A.domainType===Zt.HOSTED_LID?"hosted":"s.whatsapp.net"}`;return this.logger.trace(`Found reverse mapping: ${i} \u2192 ${g}`),o[i]={lid:i,pn:g},!0};for(let i of t){if(!qA(i))continue;let A=pA(i);if(!A)continue;let r=A.user,s=this.mappingCache.get(`lid:${r}`);if(s&&typeof s=="string"){e(i,A,s);continue}a.push({lid:i,lidUser:r,decoded:A})}if(a.length){let i=[...new Set(a.map(r=>`${r.lidUser}_reverse`))],A=await this.keys.get("lid-mapping",i);for(let{lid:r,lidUser:s,decoded:g}of a){let c=this.mappingCache.get(`lid:${s}`);(!c||typeof c!="string")&&(c=A[`${s}_reverse`],c&&typeof c=="string"&&(this.mappingCache.set(`lid:${s}`,c),this.mappingCache.set(`pn:${c}`,s))),c&&typeof c=="string"?e(r,g,c):this.logger.trace(`No reverse mapping found for LID user: ${s}`)}}return Object.values(o).length?Object.values(o):null}close(){this.mappingCache.clear()}};function HWe(n){try{if(!n||n.length<2||(n[0]&15)!==3)return;let o=fge.PreKeyWhisperMessage.decode(n.slice(1));return o.identityKey?.length===33?new Uint8Array(o.identityKey):void 0}catch{return}}function Qge(n,t,o){let a=new cM(n.keys,t,o),e=KWe(n,a),i=n.keys,A=new Jg({ttl:4320*60*1e3,ttlAutopurge:!0,updateAgeOnGet:!0}),r=async(g,c)=>{let I=IM(g,c),p=I.toString(),{[p]:B}=await n.keys.get("sender-key",[p]);B||await e.storeSenderKey(I,new Ic);let f=await new RE(e).create(I);return{senderName:I,skdm:f}};return{decryptGroupMessage({group:g,authorJid:c,msg:I}){let p=IM(g,c),B=new vE(e,p);return i.transaction(async()=>B.decrypt(I),g)},async processSenderKeyDistributionMessage({item:g,authorJid:c}){let I=new RE(e);if(!g.groupId)throw new Error("Group ID is required for sender key distribution message");let p=IM(g.groupId,c),B=new mp(null,null,null,null,g.axolotlSenderKeyDistributionMessage),f=p.toString(),{[f]:Q}=await n.keys.get("sender-key",[f]);return Q||await e.storeSenderKey(p,new Ic),i.transaction(async()=>{let{[f]:y}=await n.keys.get("sender-key",[f]);y||await e.storeSenderKey(p,new Ic),await I.process(p,B)},g.groupId)},async decryptMessage({jid:g,type:c,ciphertext:I}){let p=es(g),B=new og.SessionCipher(e,p);if(c==="pkmsg"){let Q=HWe(I);if(Q){let y=p.toString();await e.saveIdentity(y,Q)&&t.info({jid:g,addr:y},"identity key changed or new contact, session will be re-established")}}async function f(){let Q;switch(c){case"pkmsg":Q=await B.decryptPreKeyWhisperMessage(I);break;case"msg":Q=await B.decryptWhisperMessage(I);break}return Q}return i.transaction(async()=>await f(),g)},async encryptMessage({jid:g,data:c}){let I=es(g),p=new og.SessionCipher(e,I);return i.transaction(async()=>{let{type:B,body:f}=await p.encrypt(c);return{type:B===3?"pkmsg":"msg",ciphertext:Buffer.from(f,"binary")}},g)},async encryptGroupMessage({group:g,meId:c,data:I}){return i.transaction(async()=>{let{senderName:p,skdm:B}=await r(g,c);return{ciphertext:await new vE(e,p).encrypt(I),senderKeyDistributionMessage:B.serialize()}},g)},async getSenderKeyDistributionMessage({group:g,meId:c}){return i.transaction(async()=>{let{skdm:I}=await r(g,c);return I.serialize()},g)},async hasSenderKey({group:g,meId:c}){let I=IM(g,c).toString(),{[I]:p}=await n.keys.get("sender-key",[I]);return!!p},async getSessionInfo(g){let c=es(g).toString(),I=await e.loadSession(c);if(!I)return null;let p=I.getOpenSession?.(),B=p?.indexInfo?.baseKey,f=p?.registrationId;return!B||typeof f!="number"?null:{baseKey:new Uint8Array(B),registrationId:f}},async injectE2ESession({jid:g,session:c}){t.trace({jid:g},"injecting E2EE session");let I=new og.SessionBuilder(e,es(g));return i.transaction(async()=>{await I.initOutgoing(c)},g)},jidToSignalProtocolAddress(g){return es(g).toString()},lidMapping:a,async validateSession(g){try{let c=es(g),I=await e.loadSession(c.toString());return I?I.haveOpenSession()?{exists:!0}:{exists:!1,reason:"no open session"}:{exists:!1,reason:"no session"}}catch{return{exists:!1,reason:"validation error"}}},async deleteSession(g){if(!g.length)return;let c={};return g.forEach(I=>{let p=es(I);c[p.toString()]=null}),i.transaction(async()=>{await n.keys.set({session:c})},`delete-${g.length}-sessions`)},close(){A.clear(),a.close()},async migrateSession(g,c){if(!g||!qA(c)&&!Ci(c))return{migrated:0,skipped:0,total:0};if(!Rt(g)&&!Or(g))return{migrated:0,skipped:0,total:1};let{user:I}=pA(g);t.debug({fromJid:g},"bulk device migration - loading all user devices");let{[I]:p}=await i.get("device-list",[I]);if(!p)return{migrated:0,skipped:0,total:0};let{device:B}=pA(g),f=B?.toString()||"0";p.includes(f)||p.push(f);let y=p.filter(_=>{let R=`${I}.${_}`;return!A.has(R)}).map(_=>`${I}.${_}`),m=await i.get("session",y),T=[];for(let[_,R]of Object.entries(m))if(R){let L=_.split(".")[1];if(!L)continue;let U=parseInt(L),F=U===0?`${I}@s.whatsapp.net`:`${I}:${U}@s.whatsapp.net`;U===99&&(F=`${I}:99@hosted`),T.push(F)}return t.debug({fromJid:g,totalDevices:p.length,devicesWithSessions:T.length,devices:T},"bulk device migration complete - all user devices processed"),i.transaction(async()=>{let _=T.map(K=>{let G=C$(K,c),V=pA(K),H=pA(G);return{fromJid:K,toJid:G,pnUser:V.user,lidUser:H.user,deviceId:V.device||0,fromAddr:es(K),toAddr:es(G)}}),R=_.length,L=0,U=Array.from(new Set(_.map(K=>K.fromAddr.toString()))),F=await i.get("session",U),q={};for(let K of _){let G=K.fromAddr.toString(),V=K.toAddr.toString(),H=F[G];if(H){let N=og.SessionRecord.deserialize(H);N.haveOpenSession()&&(q[V]=N.serialize(),q[G]=null,L++)}}if(Object.keys(q).length>0){await i.set({session:q}),t.debug({migratedSessions:L},"bulk session migration complete");for(let K of _)if(q[K.toAddr.toString()]){let G=`${K.pnUser}.${K.deviceId}`;A.set(G,!0)}}let z=R-L;return{migrated:L,skipped:z,total:R}},`migrate-${T.length}-sessions-${pA(c)?.user}`)}}}var es=n=>{let t=pA(n),{user:o,device:a,server:e,domainType:i}=t;if(!o)throw new Error(`JID decoded but user is empty: "${n}" -> user: "${o}", server: "${e}", device: ${a}`);let A=i!==Zt.WHATSAPP?`${o}_${i}`:o,r=a||0;if(a===99&&t.server!=="hosted"&&t.server!=="hosted.lid")throw new Error("Unexpected non-hosted device JID with device 99. This ID seems invalid. ID:"+n);return new og.ProtocolAddress(A,r)},IM=(n,t)=>new rQ(n,es(t));function KWe({creds:n,keys:t},o){let a=async e=>{if(e.includes(".")){let[i,A]=e.split("."),[r,s]=i.split("_"),g=parseInt(s||"0");if(g===Zt.LID||g===Zt.HOSTED_LID)return e;let c=`${r}${A!=="0"?`:${A}`:""}@${g===Zt.HOSTED?"hosted":"s.whatsapp.net"}`,I=await o.getLIDForPN(c);if(I)return es(I).toString()}return e};return{loadSession:async e=>{try{let i=await a(e),{[i]:A}=await t.get("session",[i]);if(A)return og.SessionRecord.deserialize(A)}catch{return null}return null},storeSession:async(e,i)=>{let A=await a(e);await t.set({session:{[A]:i.serialize()}})},isTrustedIdentity:()=>!0,loadIdentityKey:async e=>{let i=await a(e),{[i]:A}=await t.get("identity-key",[i]);return A||void 0},saveIdentity:async(e,i)=>{let A=await a(e),{[A]:r}=await t.get("identity-key",[A]),s=r?.length===i.length&&r.every((g,c)=>g===i[c]);return r&&!s?(await t.set({session:{[A]:null},"identity-key":{[A]:i}}),!0):r?!1:(await t.set({"identity-key":{[A]:i}}),!0)},loadPreKey:async e=>{let i=e.toString(),{[i]:A}=await t.get("pre-key",[i]);if(A)return{privKey:Buffer.from(A.private),pubKey:Buffer.from(A.public)}},removePreKey:e=>t.set({"pre-key":{[e]:null}}),loadSignedPreKey:()=>{let e=n.signedPreKey;return{privKey:Buffer.from(e.keyPair.private),pubKey:Buffer.from(e.keyPair.public)}},loadSenderKey:async e=>{let i=e.toString(),{[i]:A}=await t.get("sender-key",[i]);return A?Ic.deserialize(A):new Ic},storeSenderKey:async(e,i)=>{let A=e.toString(),r=JSON.stringify(i.serialize());await t.set({"sender-key":{[A]:Buffer.from(r,"utf-8")}})},getOurRegistrationId:()=>n.registrationId,getOurIdentity:()=>{let{signedIdentityKey:e}=n;return{privKey:Buffer.from(e.private),pubKey:Buffer.from(An(e.public))}}}}var mIe=ze(yIe(),1),gQ=(0,mIe.default)({timestamp:()=>`,"time":"${new Date().toJSON()}"`});var uXe=[2,3e3,1043857760];var Jf="https://web.whatsapp.com",ose="https://call.whatsapp.com/video/",nse="https://call.whatsapp.com/voice/",UE="CB:",SIe="TAG:";var fse=Buffer.from([6,0]),Qse=Buffer.from([6,1]),aH=Buffer.from([6,5]),KFA=Buffer.from([6,6]),Vf=10080*60,wIe=1440*60,DIe=336*60*60,Dse="Noise_XX_25519_AESGCM_SHA256\0\0\0\0",CXe=3,Wg=Buffer.from([5]),OIe=Buffer.from([87,65,6,CXe]),sse=/https:\/\/(?![^:@\/\s]+:[^:@\/\s]+@)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(:\d+)?(\/[^\s]*)?/g,nH={SERIAL:0,ISSUER:"WhatsAppLongTerm1",PUBLIC_KEY:Buffer.from("142375574d0a587166aae71ebe516437c4a28b73e3695c6ce1f7f9545da8ee6b","hex")},cQ=[ne.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP,ne.HistorySync.HistorySyncType.PUSH_NAME,ne.HistorySync.HistorySyncType.RECENT,ne.HistorySync.HistorySyncType.FULL,ne.HistorySync.HistorySyncType.ON_DEMAND,ne.HistorySync.HistorySyncType.NON_BLOCKING_DATA,ne.HistorySync.HistorySyncType.INITIAL_STATUS_V3],NI={SIGNAL_STORE:300,MSG_RETRY:3600,CALL_OFFER:300,USER_DEVICES:300},bIe={version:uXe,browser:oM.macOS("Chrome"),waWebSocketUrl:"wss://web.whatsapp.com/ws/chat",connectTimeoutMs:2e4,keepAliveIntervalMs:3e4,logger:gQ.child({class:"baileys"}),emitOwnEvents:!0,defaultQueryTimeoutMs:6e4,customUploadHosts:[],retryRequestDelayMs:250,maxMsgRetryCount:5,fireInitQueries:!0,auth:void 0,markOnlineOnConnect:!0,syncFullHistory:!0,patchMessageBeforeSending:n=>n,shouldSyncHistoryMessage:({syncType:n})=>n!==ne.HistorySync.HistorySyncType.FULL,shouldIgnoreJid:()=>!1,linkPreviewImageThumbnailWidth:192,transactionOpts:{maxCommitRetries:10,delayBetweenTriesMs:3e3},generateHighQualityLinkPreview:!1,enableAutoSessionRecreation:!0,enableRecentMessageCache:!0,options:{},appStateMacVerification:{patch:!1,snapshot:!1},countryCode:"US",getMessage:async()=>{},cachedGroupMetadata:async()=>{},makeSignalRepository:Qge},VU={image:"/mms/image",video:"/mms/video",document:"/mms/document",audio:"/mms/audio",sticker:"/mms/image","thumbnail-link":"/mms/image","product-catalog-image":"/product/image","md-app-state":"","md-msg-hist":"/mms/md-app-state","biz-cover-photo":"/pps/biz-cover-photo"},Vne={audio:"Audio",document:"Document",gif:"Video",image:"Image",ppic:"",product:"Image",ptt:"Audio",sticker:"Image",video:"Video","thumbnail-document":"Document Thumbnail","thumbnail-image":"Image Thumbnail","thumbnail-video":"Video Thumbnail","thumbnail-link":"Link Thumbnail","md-msg-hist":"History","md-app-state":"App State","product-catalog-image":"","payment-bg-image":"Payment Background",ptv:"Video","biz-cover-photo":"Image"},gse=Object.keys(VU),MIe=12e4,IQ=5,_Ie=812,TIe=3e4,OK={Minute:60*1e3,Hour:3600*1e3,Day:1440*60*1e3,Week:10080*60*1e3};var NIe=ze(Jr(),1);import{createHash as BXe}from"crypto";import{createWriteStream as fXe,promises as QXe}from"fs";import{tmpdir as yXe}from"os";import{join as mXe}from"path";var RIe=n=>{let t=le(n,"product_catalog"),o=PA(t,"product").map(lQ),a=le(t,"paging");return{products:o,nextPageCursor:a?jA(a,"after"):void 0}},kIe=n=>{let t=le(n,"collections");return{collections:PA(t,"collection").map(a=>{let e=jA(a,"id"),i=jA(a,"name"),A=PA(a,"product").map(lQ);return{id:e,name:i,products:A,status:DXe(a)}})}},vIe=n=>{let t=le(n,"order"),o=PA(t,"product").map(i=>{let A=le(i,"image");return{id:jA(i,"id"),name:jA(i,"name"),imageUrl:jA(A,"url"),price:+jA(i,"price"),currency:jA(i,"currency"),quantity:+jA(i,"quantity")}}),a=le(t,"price");return{price:{total:+jA(a,"total"),currency:jA(a,"currency")},products:o}},bK=(n,t)=>{let o={},a=[];return typeof n<"u"&&a.push({tag:"id",attrs:{},content:Buffer.from(n)}),typeof t.name<"u"&&a.push({tag:"name",attrs:{},content:Buffer.from(t.name)}),typeof t.description<"u"&&a.push({tag:"description",attrs:{},content:Buffer.from(t.description)}),typeof t.retailerId<"u"&&a.push({tag:"retailer_id",attrs:{},content:Buffer.from(t.retailerId)}),t.images.length&&a.push({tag:"media",attrs:{},content:t.images.map(i=>{if(!("url"in i))throw new NIe.Boom("Expected img for product to already be uploaded",{statusCode:400});return{tag:"image",attrs:{},content:[{tag:"url",attrs:{},content:Buffer.from(i.url.toString())}]}})}),typeof t.price<"u"&&a.push({tag:"price",attrs:{},content:Buffer.from(t.price.toString())}),typeof t.currency<"u"&&a.push({tag:"currency",attrs:{},content:Buffer.from(t.currency)}),"originCountryCode"in t&&(typeof t.originCountryCode>"u"?o.compliance_category="COUNTRY_ORIGIN_EXEMPT":a.push({tag:"compliance_info",attrs:{},content:[{tag:"country_code_origin",attrs:{},content:Buffer.from(t.originCountryCode)}]})),typeof t.isHidden<"u"&&(o.is_hidden=t.isHidden.toString()),{tag:"product",attrs:o,content:a}},lQ=n=>{let t=n.attrs.is_hidden==="true",o=jA(n,"id"),a=le(n,"media"),e=le(n,"status_info");return{id:o,imageUrls:wXe(a),reviewStatus:{whatsapp:jA(e,"status")},availability:"in stock",name:jA(n,"name"),retailerId:jA(n,"retailer_id"),url:jA(n,"url"),description:jA(n,"description"),price:+jA(n,"price"),currency:jA(n,"currency"),isHidden:t}};async function MK(n,t,o=3e4){return n={...n,images:n.images?await SXe(n.images,t,o):n.images},n}var SXe=async(n,t,o=3e4)=>await Promise.all(n.map(async e=>{if("url"in e){let I=e.url.toString();if(I.includes(".whatsapp.net"))return{url:I}}let{stream:i}=await Yf(e),A=BXe("sha256"),r=mXe(yXe(),"img"+Vr()),s=fXe(r);for await(let I of i)A.update(I),s.write(I);let g=A.digest("base64"),{directPath:c}=await t(r,{mediaType:"product-catalog-image",fileEncSha256B64:g,timeoutMs:o});return await QXe.unlink(r).catch(I=>console.log("Error deleting temp file ",I)),{url:jf(c)}})),wXe=n=>{let t=le(n,"image");return{requested:jA(t,"request_image_url"),original:jA(t,"original_image_url")}},DXe=n=>{let t=le(n,"status_info");return{status:jA(t,"status"),canAppeal:jA(t,"can_appeal")==="true"}};var dQ=ze(Jr(),1);import{randomBytes as vK}from"crypto";var En=null;try{En=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Ft(n,t,o){this.low=n|0,this.high=t|0,this.unsigned=!!o}Ft.prototype.__isLong__;Object.defineProperty(Ft.prototype,"__isLong__",{value:!0});function ca(n){return(n&&n.__isLong__)===!0}function PIe(n){var t=Math.clz32(n&-n);return n?31-t:t}Ft.isLong=ca;var GIe={},FIe={};function bp(n,t){var o,a,e;return t?(n>>>=0,(e=0<=n&&n<256)&&(a=FIe[n],a)?a:(o=wt(n,0,!0),e&&(FIe[n]=o),o)):(n|=0,(e=-128<=n&&n<128)&&(a=GIe[n],a)?a:(o=wt(n,n<0?-1:0,!1),e&&(GIe[n]=o),o))}Ft.fromInt=bp;function un(n,t){if(isNaN(n))return t?lc:rs;if(t){if(n<0)return lc;if(n>=KIe)return jIe}else{if(n<=-UIe)return ro;if(n+1>=UIe)return YIe}return n<0?un(-n,t).neg():wt(n%KE|0,n/KE|0,t)}Ft.fromNumber=un;function wt(n,t,o){return new Ft(n,t,o)}Ft.fromBits=wt;var RM=Math.pow;function TK(n,t,o){if(n.length===0)throw Error("empty string");if(typeof t=="number"?(o=t,t=!1):t=!!t,n==="NaN"||n==="Infinity"||n==="+Infinity"||n==="-Infinity")return t?lc:rs;if(o=o||10,o<2||360)throw Error("interior hyphen");if(a===0)return TK(n.substring(1),t,o).neg();for(var e=un(RM(o,8)),i=rs,A=0;A>>0:this.low};He.toNumber=function(){return this.unsigned?(this.high>>>0)*KE+(this.low>>>0):this.high*KE+(this.low>>>0)};He.toString=function(t){if(t=t||10,t<2||36>>0,c=g.toString(t);if(A=s,A.isZero())return c+r;for(;c.length<6;)c="0"+c;r=""+c+r}};He.getHighBits=function(){return this.high};He.getHighBitsUnsigned=function(){return this.high>>>0};He.getLowBits=function(){return this.low};He.getLowBitsUnsigned=function(){return this.low>>>0};He.getNumBitsAbs=function(){if(this.isNegative())return this.eq(ro)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,o=31;o>0&&(t&1<>21;return t?this.unsigned?!1:t===-1&&!(this.low===0&&this.high===-2097152):!0};He.isZero=function(){return this.high===0&&this.low===0};He.eqz=He.isZero;He.isNegative=function(){return!this.unsigned&&this.high<0};He.isPositive=function(){return this.unsigned||this.high>=0};He.isOdd=function(){return(this.low&1)===1};He.isEven=function(){return(this.low&1)===0};He.equals=function(t){return ca(t)||(t=Cn(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};He.eq=He.equals;He.notEquals=function(t){return!this.eq(t)};He.neq=He.notEquals;He.ne=He.notEquals;He.lessThan=function(t){return this.comp(t)<0};He.lt=He.lessThan;He.lessThanOrEqual=function(t){return this.comp(t)<=0};He.lte=He.lessThanOrEqual;He.le=He.lessThanOrEqual;He.greaterThan=function(t){return this.comp(t)>0};He.gt=He.greaterThan;He.greaterThanOrEqual=function(t){return this.comp(t)>=0};He.gte=He.greaterThanOrEqual;He.ge=He.greaterThanOrEqual;He.compare=function(t){if(ca(t)||(t=Cn(t)),this.eq(t))return 0;var o=this.isNegative(),a=t.isNegative();return o&&!a?-1:!o&&a?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};He.comp=He.compare;He.negate=function(){return!this.unsigned&&this.eq(ro)?ro:this.not().add(HE)};He.neg=He.negate;He.add=function(t){ca(t)||(t=Cn(t));var o=this.high>>>16,a=this.high&65535,e=this.low>>>16,i=this.low&65535,A=t.high>>>16,r=t.high&65535,s=t.low>>>16,g=t.low&65535,c=0,I=0,p=0,B=0;return B+=i+g,p+=B>>>16,B&=65535,p+=e+s,I+=p>>>16,p&=65535,I+=a+r,c+=I>>>16,I&=65535,c+=o+A,c&=65535,wt(p<<16|B,c<<16|I,this.unsigned)};He.subtract=function(t){return ca(t)||(t=Cn(t)),this.add(t.neg())};He.sub=He.subtract;He.multiply=function(t){if(this.isZero())return this;if(ca(t)||(t=Cn(t)),En){var o=En.mul(this.low,this.high,t.low,t.high);return wt(o,En.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?lc:rs;if(this.eq(ro))return t.isOdd()?ro:rs;if(t.eq(ro))return this.isOdd()?ro:rs;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(HIe)&&t.lt(HIe))return un(this.toNumber()*t.toNumber(),this.unsigned);var a=this.high>>>16,e=this.high&65535,i=this.low>>>16,A=this.low&65535,r=t.high>>>16,s=t.high&65535,g=t.low>>>16,c=t.low&65535,I=0,p=0,B=0,f=0;return f+=A*c,B+=f>>>16,f&=65535,B+=i*c,p+=B>>>16,B&=65535,B+=A*g,p+=B>>>16,B&=65535,p+=e*c,I+=p>>>16,p&=65535,p+=i*g,I+=p>>>16,p&=65535,p+=A*s,I+=p>>>16,p&=65535,I+=a*c+e*g+i*s+A*r,I&=65535,wt(B<<16|f,I<<16|p,this.unsigned)};He.mul=He.multiply;He.divide=function(t){if(ca(t)||(t=Cn(t)),t.isZero())throw Error("division by zero");if(En){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var o=(this.unsigned?En.div_u:En.div_s)(this.low,this.high,t.low,t.high);return wt(o,En.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?lc:rs;var a,e,i;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return lc;if(t.gt(this.shru(1)))return xIe;i=lc}else{if(this.eq(ro)){if(t.eq(HE)||t.eq(_K))return ro;if(t.eq(ro))return HE;var A=this.shr(1);return a=A.div(t).shl(1),a.eq(rs)?t.isNegative()?HE:_K:(e=this.sub(t.mul(a)),i=a.add(e.div(t)),i)}else if(t.eq(ro))return this.unsigned?lc:rs;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();i=rs}for(e=this;e.gte(t);){a=Math.max(1,Math.floor(e.toNumber()/t.toNumber()));for(var r=Math.ceil(Math.log(a)/Math.LN2),s=r<=48?1:RM(2,r-48),g=un(a),c=g.mul(t);c.isNegative()||c.gt(e);)a-=s,g=un(a,this.unsigned),c=g.mul(t);g.isZero()&&(g=HE),i=i.add(g),e=e.sub(c)}return i};He.div=He.divide;He.modulo=function(t){if(ca(t)||(t=Cn(t)),En){var o=(this.unsigned?En.rem_u:En.rem_s)(this.low,this.high,t.low,t.high);return wt(o,En.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};He.mod=He.modulo;He.rem=He.modulo;He.not=function(){return wt(~this.low,~this.high,this.unsigned)};He.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};He.clz=He.countLeadingZeros;He.countTrailingZeros=function(){return this.low?PIe(this.low):PIe(this.high)+32};He.ctz=He.countTrailingZeros;He.and=function(t){return ca(t)||(t=Cn(t)),wt(this.low&t.low,this.high&t.high,this.unsigned)};He.or=function(t){return ca(t)||(t=Cn(t)),wt(this.low|t.low,this.high|t.high,this.unsigned)};He.xor=function(t){return ca(t)||(t=Cn(t)),wt(this.low^t.low,this.high^t.high,this.unsigned)};He.shiftLeft=function(t){return ca(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?wt(this.low<>>32-t,this.unsigned):wt(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):wt(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};He.shr=He.shiftRight;He.shiftRightUnsigned=function(t){return ca(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?wt(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?wt(this.high,0,this.unsigned):wt(this.high>>>t-32,0,this.unsigned)};He.shru=He.shiftRightUnsigned;He.shr_u=He.shiftRightUnsigned;He.rotateLeft=function(t){var o;return ca(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?wt(this.high,this.low,this.unsigned):t<32?(o=32-t,wt(this.low<>>o,this.high<>>o,this.unsigned)):(t-=32,o=32-t,wt(this.high<>>o,this.low<>>o,this.unsigned))};He.rotl=He.rotateLeft;He.rotateRight=function(t){var o;return ca(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?wt(this.high,this.low,this.unsigned):t<32?(o=32-t,wt(this.high<>>t,this.low<>>t,this.unsigned)):(t-=32,o=32-t,wt(this.low<>>t,this.high<>>t,this.unsigned))};He.rotr=He.rotateRight;He.toSigned=function(){return this.unsigned?wt(this.low,this.high,!1):this};He.toUnsigned=function(){return this.unsigned?this:wt(this.low,this.high,!0)};He.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};He.toBytesLE=function(){var t=this.high,o=this.low;return[o&255,o>>>8&255,o>>>16&255,o>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};He.toBytesBE=function(){var t=this.high,o=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,o>>>24,o>>>16&255,o>>>8&255,o&255]};Ft.fromBytes=function(t,o,a){return a?Ft.fromBytesLE(t,o):Ft.fromBytesBE(t,o)};Ft.fromBytesLE=function(t,o){return new Ft(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,o)};Ft.fromBytesBE=function(t,o){return new Ft(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],o)};typeof BigInt=="function"&&(Ft.fromBigInt=function(t,o){var a=Number(BigInt.asIntN(32,t)),e=Number(BigInt.asIntN(32,t>>BigInt(32)));return wt(a,e,o)},Ft.fromValue=function(t,o){return typeof t=="bigint"?Ft.fromBigInt(t,o):Cn(t,o)},He.toBigInt=function(){var t=BigInt(this.low>>>0),o=BigInt(this.unsigned?this.high>>>0:this.high);return o<{let n=new gc;return{mutex(t){return n.runExclusive(t)}}},JIe=()=>{let n=new Map;return{async mutex(t,o){let a=n.get(t);a||(a={mutex:new gc,refCount:0},n.set(t,a)),a.refCount++;try{return await a.mutex.runExclusive(o)}finally{a.refCount--,a.refCount===0&&n.get(t)===a&&n.delete(t)}}}};function qIe(n,t,o=10){let a=[],e=!1;return{enqueue:(A,r)=>{if(a.push({type:A,node:r}),e)return;e=!0,(async()=>{let g=0;for(;a.length&&t.isWsOpen();){let{type:c,node:I}=a.shift(),p=n.get(c);if(!p){t.onUnexpectedError(new Error(`unknown offline node type: ${c}`),"processing offline node");continue}await p(I).catch(B=>t.onUnexpectedError(B,`processing offline ${c}`)),g++,g>=o&&(g=0,await t.yieldToEventLoop())}e=!1})().catch(g=>t.onUnexpectedError(g,"processing offline nodes"))}}}var YM=ze(Jr(),1);var vI=ze(Jr(),1);var kM=class{constructor(){this.name="devices"}getQueryElement(){return{tag:"devices",attrs:{version:"2"}}}getUserElement(){return null}parser(t){let o=[],a;if(t.tag==="devices"){Za(t);let e=le(t,"device-list"),i=le(t,"key-index-list");if(Array.isArray(e?.content))for(let{tag:A,attrs:r}of e.content){let s=+r.id,g=+r["key-index"];A==="device"&&o.push({id:s,keyIndex:g,isHosted:!!(r.is_hosted&&r.is_hosted==="true")})}i?.tag==="key-index-list"&&(a={timestamp:+i.attrs.ts,signedKeyIndex:i?.content,expectedTimestamp:i.attrs.expected_ts?+i.attrs.expected_ts:void 0})}return{deviceList:o,keyIndex:a}}};var gg=class{withId(t){return this.id=t,this}withLid(t){return this.lid=t,this}withPhone(t){return this.phone=t,this}withUsername(t){return this.username=t,this}withUsernameKey(t){return this.usernameKey=t,this}withType(t){return this.type=t,this}withPersonaId(t){return this.personaId=t,this}};var vM=class{constructor(){this.name="contact"}getQueryElement(){return{tag:"contact",attrs:{}}}getUserElement(t){return t.phone?{tag:"contact",attrs:{},content:t.phone}:t.username?{tag:"contact",attrs:{username:t.username,...t.usernameKey?{pin:t.usernameKey}:{},...t.lid?{lid:t.lid}:{}}}:t.type?{tag:"contact",attrs:{type:t.type}}:{tag:"contact",attrs:{}}}parser(t){return t.tag==="contact"?(Za(t),t?.attrs?.type==="in"):!1}};var PM=class{constructor(){this.name="status"}getQueryElement(){return{tag:"status",attrs:{}}}getUserElement(){return null}parser(t){if(t.tag==="status"){Za(t);let o=t?.content?.toString()??null,a=new Date(+(t?.attrs.t||0)*1e3);return o?typeof o=="string"&&o.length===0&&(o=null):t.attrs?.code&&+t.attrs.code==401?o="":o=null,{status:o,setAt:a}}}};var GM=class{constructor(){this.name="disappearing_mode"}getQueryElement(){return{tag:"disappearing_mode",attrs:{}}}getUserElement(){return null}parser(t){if(t.tag==="disappearing_mode"){Za(t);let o=+t?.attrs.duration,a=new Date(+(t?.attrs.t||0)*1e3);return{duration:o,setAt:a}}}};var FM=class{constructor(){this.name="username"}getQueryElement(){return{tag:"username",attrs:{}}}getUserElement(t){return null}parser(t){return t.tag==="username"?(Za(t),typeof t.content=="string"?t.content:null):null}};var LM=class{constructor(){this.name="bot"}getQueryElement(){return{tag:"bot",attrs:{},content:[{tag:"profile",attrs:{v:"1"}}]}}getUserElement(t){return{tag:"bot",attrs:{},content:[{tag:"profile",attrs:{persona_id:t.personaId}}]}}parser(t){let o=le(t,"bot"),a=le(o,"profile"),e=le(a,"commands"),i=le(a,"prompts"),A=[],r=[];for(let s of PA(e,"command"))A.push({name:jA(s,"name"),description:jA(s,"description")});for(let s of PA(i,"prompt"))r.push(`${jA(s,"emoji")} ${jA(s,"text")}`);return{isDefault:!!le(a,"default"),jid:t.attrs.jid,name:jA(a,"name"),attributes:jA(a,"attributes"),description:jA(a,"description"),category:jA(a,"category"),personaId:a.attrs.persona_id,commandsDescription:jA(e,"description"),commands:A,prompts:r}}};var UM=class{constructor(){this.name="lid"}getQueryElement(){return{tag:"lid",attrs:{}}}getUserElement(t){return t.lid?{tag:"lid",attrs:{jid:t.lid}}:null}parser(t){return t.tag==="lid"?t.attrs.val:null}};var cg=class{constructor(){this.protocols=[],this.users=[],this.context="interactive",this.mode="query"}withMode(t){return this.mode=t,this}withContext(t){return this.context=t,this}withUser(t){return this.users.push(t),this}parseUSyncQueryResult(t){if(t?.attrs.type!=="result")return;let o=Object.fromEntries(this.protocols.map(A=>[A.name,A.parser])),a={list:[],sideList:[]},e=le(t,"usync"),i=e?le(e,"list"):void 0;return i?.content&&Array.isArray(i.content)&&(a.list=i.content.reduce((A,r)=>{let s=r?.attrs.jid;if(s){let g=Array.isArray(r?.content)?Object.fromEntries(r.content.map(c=>{let I=c.tag,p=o[I];return p?[I,p(c)]:[I,null]}).filter(([,c])=>c!==null)):{};A.push({...g,id:s})}return A},[])),a}withDeviceProtocol(){return this.protocols.push(new kM),this}withContactProtocol(){return this.protocols.push(new vM),this}withStatusProtocol(){return this.protocols.push(new PM),this}withDisappearingModeProtocol(){return this.protocols.push(new GM),this}withBotProfileProtocol(){return this.protocols.push(new LM),this}withLIDProtocol(){return this.protocols.push(new UM),this}withUsernameProtocol(){return this.protocols.push(new FM),this}};var ei=ze(Jr(),1);import{randomBytes as RK}from"crypto";import{URL as _Xe}from"url";import{promisify as TXe}from"util";var HM=class{constructor(t={}){this.protocolVersion=5,this.sequence=0,this.events=[],this.buffer=[],Object.assign(this,t)}};import{EventEmitter as bXe}from"events";var KM=class extends bXe{constructor(t,o){super(),this.url=t,this.config=o,this.setMaxListeners(0)}};var xM=class extends KM{constructor(){super(...arguments),this.socket=null}get isOpen(){return this.socket?.readyState===Jo.OPEN}get isClosed(){return this.socket===null||this.socket?.readyState===Jo.CLOSED}get isClosing(){return this.socket===null||this.socket?.readyState===Jo.CLOSING}get isConnecting(){return this.socket?.readyState===Jo.CONNECTING}connect(){if(this.socket)return;this.socket=new Jo(this.url,{origin:Jf,headers:this.config.options?.headers,handshakeTimeout:this.config.connectTimeoutMs,timeout:this.config.connectTimeoutMs,agent:this.config.agent}),this.socket.setMaxListeners(0);let t=["close","error","upgrade","message","open","ping","pong","unexpected-response"];for(let o of t)this.socket?.on(o,(...a)=>this.emit(o,...a))}async close(){if(!this.socket)return;let t=new Promise(o=>{this.socket?.once("close",o)});this.socket.close(),await t,this.socket=null}send(t,o){return this.socket?.send(t,o),!!this.socket}};var NK=ze(Jr(),1);var MXe=(n,t,o,a)=>o({tag:"iq",attrs:{id:a(),type:"get",to:OA,xmlns:"w:mex"},content:[{tag:"query",attrs:{query_id:t},content:Buffer.from(JSON.stringify({variables:n}),"utf-8")}]}),pQ=async(n,t,o,a,e)=>{let i=await MXe(n,t,a,e),A=le(i,"result");if(A?.content){let s=JSON.parse(A.content.toString());if(s.errors&&s.errors.length>0){let c=s.errors.map(B=>B.message||"Unknown error").join(", "),I=s.errors[0],p=I.extensions?.error_code||400;throw new NK.Boom(`GraphQL server error: ${c}`,{statusCode:p,data:I})}let g=o?s?.data?.[o]:s?.data;if(typeof g<"u")return g}let r=(o||"").startsWith("xwa2_")?o.substring(5).replace(/_/g," "):o?.replace(/_/g," ");throw new NK.Boom(`Failed to ${r}, unexpected response structure.`,{statusCode:400,data:i})};var zIe=n=>{let{waWebSocketUrl:t,connectTimeoutMs:o,logger:a,keepAliveIntervalMs:e,browser:i,auth:A,printQRInTerminal:r,defaultQueryTimeoutMs:s,transactionOpts:g,qrTimeout:c,makeSignalRepository:I}=n,p=new HM,B=0,f=Aee(),Q=()=>`${f}${oe++}`;r&&a.warn({},"\u26A0\uFE0F The printQRInTerminal option has been deprecated. You will no longer receive QR codes in the terminal automatically. Please listen to the connection.update event yourself and handle the QR your way. You can remove this message by removing this opttion. This message will be removed in a future version."),i[1].toLocaleLowerCase().includes("android")&&a.warn("\u26A0\uFE0F Using the Android browser is experimental and may lead to unexpected behavior. Use at your own risk."),cQ.map(pe=>n.shouldSyncHistoryMessage({syncType:pe})).filter(pe=>pe===!1).length===cQ.length&&a.warn("\u26A0\uFE0F DANGER: DISABLING ALL SYNC BY shouldSyncHistoryMsg PREVENTS BAILEYS FROM ACCESSING INITIAL LID MAPPINGS, LEADING TO INSTABILIY AND SESSION ERRORS");let m=typeof t=="string"?new _Xe(t):t;if(n.mobile||m.protocol==="tcp:")throw new ei.Boom("Mobile API is not supported anymore",{statusCode:ar.loggedOut});m.protocol==="wss"&&A?.creds?.routingInfo&&m.searchParams.append("ED",A.creds.routingInfo.toString("base64url"));let T=br.generateKeyPair(),_=wse({keyPair:T,NOISE_HEADER:OIe,logger:a,routingInfo:A?.creds?.routingInfo}),R=new xM(m,n);R.connect();let L=TXe(R.send),U=async pe=>{if(!R.isOpen)throw new ei.Boom("Connection Closed",{statusCode:ar.connectionClosed});let Qe=_.encodeFrame(pe);await Gh(o,async(Me,oA)=>{try{await L.call(R,Qe),Me()}catch(dA){oA(dA)}})},F=pe=>{a.level==="trace"&&a.trace({xml:Jn(pe),msg:"xml send"});let Qe=B$(pe);return U(Qe)},q=async(pe,Qe=s)=>{let Me,oA;try{return await Gh(Qe,(FA,jt)=>(Me=ct=>{FA(ct)},oA=ct=>{jt(ct||new ei.Boom("Connection Closed",{statusCode:ar.connectionClosed}))},R.on(`TAG:${pe}`,Me),R.on("close",oA),R.on("error",oA),()=>jt(new ei.Boom("Query Cancelled"))))}catch(dA){if(dA instanceof ei.Boom&&dA.output?.statusCode===ar.timedOut){a?.warn?.({msgId:pe},"timed out waiting for message");return}throw dA}finally{Me&&R.off(`TAG:${pe}`,Me),oA&&(R.off("close",oA),R.off("error",oA))}},z=async(pe,Qe)=>{pe.attrs.id||(pe.attrs.id=Q());let Me=pe.attrs.id,oA=await Gh(Qe,async(dA,FA)=>{let jt=q(Me,Qe).catch(FA);F(pe).then(async()=>dA(await jt)).catch(FA)});return oA&&"tag"in oA&&Za(oA),oA},K=async()=>{let pe=await z({tag:"iq",attrs:{to:OA,type:"get",xmlns:"encrypt"},content:[{tag:"digest",attrs:{}}]});if(!le(pe,"digest"))throw await Xe(),new Error("encrypt/get digest returned no digest node")},G=async()=>{let pe=(J.signedPreKey.keyId||0)+1,Qe=await HD(J.signedIdentityKey,pe);await z({tag:"iq",attrs:{to:OA,type:"set",xmlns:"encrypt"},content:[{tag:"rotate",attrs:{},content:[Wf(Qe)]}]}),k.emit("creds.update",{signedPreKey:Qe})},V=async pe=>{if(pe.protocols.length===0)throw new ei.Boom("USyncQuery must have at least one protocol");let Me=pe.users.map(ct=>({tag:"user",attrs:{jid:ct.phone?void 0:ct.id},content:pe.protocols.map(_r=>_r.getUserElement(ct)).filter(_r=>_r!==null)})),oA={tag:"list",attrs:{},content:Me},dA={tag:"query",attrs:{},content:pe.protocols.map(ct=>ct.getQueryElement())},FA={tag:"iq",attrs:{to:OA,type:"get",xmlns:"usync"},content:[{tag:"usync",attrs:{context:pe.context,mode:pe.mode,sid:Q(),last:"true",index:"0"},content:[dA,oA]}]},jt=await z(FA);return pe.parseUSyncQueryResult(jt)},H=async(...pe)=>{let Qe=new cg,Me=!1;for(let dA of pe)if(qA(dA)){a?.warn("LIDs are not supported with onWhatsApp");continue}else{Me||(Me=!0,Qe=Qe.withContactProtocol());let FA=`+${dA.replace("+","").split("@")[0]?.split(":")[0]}`;Qe.withUser(new gg().withPhone(FA))}if(Qe.users.length===0)return[];let oA=await V(Qe);if(oA)return oA.list.filter(dA=>!!dA.contact).map(({contact:dA,id:FA})=>({jid:FA,exists:dA}))},N=async pe=>{let Qe=new cg().withLIDProtocol().withContext("background");for(let oA of pe)if(qA(oA)){a?.warn("LID user found in LID fetch call");continue}else Qe.withUser(new gg().withId(oA));if(Qe.users.length===0)return[];let Me=await V(Qe);return Me?Me.list.filter(oA=>!!oA.lid).map(({lid:oA,id:dA})=>({pn:dA,lid:oA})):[]},k=oge(a),{creds:J}=A,X=Zse(A.keys,a,g),ie=I({creds:J,keys:X},a,N),De,oe=1,Se,Be,Re=!1,Ne=[],Je=(pe,Qe)=>{a.error({err:pe},`unexpected error in '${Qe}'`)},ve=async pe=>{if(!R.isOpen)throw new ei.Boom("Connection Closed",{statusCode:ar.connectionClosed});let Qe,Me,oA=Gh(o,(dA,FA)=>{Qe=dA,Me=kK(FA),R.on("frame",Qe),R.on("close",Me),R.on("error",Me)}).finally(()=>{R.off("frame",Qe),R.off("close",Me),R.off("error",Me)});return pe&&U(pe).catch(Me),oA},tA=async()=>{let pe={clientHello:{ephemeral:T.public}};pe=ne.HandshakeMessage.fromObject(pe),a.info({browser:i,helloMsg:pe},"connected to WA");let Qe=ne.HandshakeMessage.encode(pe).finish(),Me=await ve(Qe),oA=ne.HandshakeMessage.decode(Me);a.trace({handshake:oA},"handshake recv from WA");let dA=_.processHandshake(oA,J.noiseKey),FA;J.me?(FA=use(J.me.id,n),a.info({node:FA},"logging in...")):(FA=Cse(J,n),a.info({node:FA},"not logged in, attempting registration..."));let jt=_.encrypt(ne.ClientPayload.encode(FA).finish());await U(ne.HandshakeMessage.encode({clientFinish:{static:dA,payload:jt}}).finish()),await _.finishInit(),Ze()},fe=async()=>{let pe=await z({tag:"iq",attrs:{id:Q(),xmlns:"encrypt",type:"get",to:OA},content:[{tag:"count",attrs:{}}]});return+le(pe,"count").attrs.value},Ie=null,Xe=async(pe=IQ)=>{if(Ie){a.debug("Pre-key upload already in progress, waiting for completion"),await Ie;return}let Qe=async Me=>{a.info({count:pe,retryCount:Me},"uploading pre-keys");let oA=await X.transaction(async()=>{a.debug({requestedCount:pe},"generating pre-keys with requested count");let{update:dA,node:FA}=await dse({creds:J,keys:X},pe);return k.emit("creds.update",dA),FA},J?.me?.id||"upload-pre-keys");try{await z(oA),a.info({count:pe},"uploaded pre-keys successfully")}catch(dA){if(a.error({uploadError:dA.toString(),count:pe},"Failed to upload pre-keys to server"),Me<3){let FA=Math.min(1e3*Math.pow(2,Me),1e4);return a.info(`Retrying pre-key upload in ${FA}ms`),await new Promise(jt=>setTimeout(jt,FA)),Qe(Me+1)}throw dA}};Ie=Promise.race([Qe(0),new Promise((Me,oA)=>setTimeout(()=>oA(new ei.Boom("Pre-key upload timeout",{statusCode:408})),TIe))]);try{await Ie}finally{Ie=null}},je=async()=>{let pe=J.nextPreKeyId-1;return pe<=0?{exists:!1,currentPreKeyId:0}:{exists:!!(await X.get("pre-key",[pe.toString()]))[pe.toString()],currentPreKeyId:pe}},be=async()=>{try{let pe=0,Qe=await fe();Qe===0?pe=_Ie:pe=IQ;let{exists:Me,currentPreKeyId:oA}=await je();a.info(`${Qe} pre-keys found on server`),a.info(`Current prekey ID: ${oA}, exists in storage: ${Me}`);let dA=Qe<=pe,FA=!Me&&oA>0;if(dA||FA){let ct=[];dA&&ct.push(`server count low (${Qe})`),FA&&ct.push(`current prekey ${oA} missing from storage`),a.info(`Uploading PreKeys due to: ${ct.join(", ")}`),await Xe(pe)}else a.info(`PreKey validation passed - Server: ${Qe}, Current prekey ${oA} exists`)}catch(pe){a.error({error:pe},"Failed to check/upload pre-keys during initialization")}},uA=async pe=>{await _.decodeFrame(pe,Qe=>{De=new Date;let Me=!1;if(Me=R.emit("frame",Qe),!(Qe instanceof Uint8Array)){let oA=Qe.attrs.id;a.level==="trace"&&a.trace({xml:Jn(Qe),msg:"recv xml"}),Me=R.emit(`${SIe}${oA}`,Qe)||Me;let dA=Qe.tag,FA=Qe.attrs||{},jt=Array.isArray(Qe.content)?Qe.content[0]?.tag:"";for(let ct of Object.keys(FA))Me=R.emit(`${UE}${dA},${ct}:${FA[ct]},${jt}`,Qe)||Me,Me=R.emit(`${UE}${dA},${ct}:${FA[ct]}`,Qe)||Me,Me=R.emit(`${UE}${dA},${ct}`,Qe)||Me;Me=R.emit(`${UE}${dA},,${jt}`,Qe)||Me,Me=R.emit(`${UE}${dA}`,Qe)||Me,!Me&&a.level==="debug"&&a.debug({unhandled:!0,msgId:oA,fromMe:!1,frame:Qe},"communication recv")}})},EA=async pe=>{if(Re){a.trace({trace:pe?.stack},"connection already closed");return}if(Re=!0,a.info({trace:pe?.stack},pe?"connection errored":"connection closed"),clearInterval(Se),clearTimeout(Be),R.removeAllListeners("close"),R.removeAllListeners("open"),R.removeAllListeners("message"),ie.close?.(),!R.isClosed&&!R.isClosing)try{await R.close()}catch{}for(let Qe of Ne)try{await Qe(pe)}catch(Me){a.error({err:Me},"error in socket end handler")}k.emit("connection.update",{connection:"close",lastDisconnect:{error:pe,date:new Date}}),k.removeAllListeners("connection.update"),k.destroy()},aA=async()=>{if(R.isOpen)return;if(R.isClosed||R.isClosing)throw new ei.Boom("Connection Closed",{statusCode:ar.connectionClosed});let pe,Qe;await new Promise((Me,oA)=>{pe=()=>Me(void 0),Qe=kK(oA),R.on("open",pe),R.on("close",Qe),R.on("error",Qe)}).finally(()=>{R.off("open",pe),R.off("close",Qe),R.off("error",Qe)})},Ze=()=>Se=setInterval(()=>{De||(De=new Date),Date.now()-De.getTime()>e+5e3?EA(new ei.Boom("Connection was lost",{statusCode:ar.connectionLost})):R.isOpen?z({tag:"iq",attrs:{id:Q(),to:OA,type:"get",xmlns:"w:p"},content:[{tag:"ping",attrs:{}}]}).catch(Qe=>{a.error({trace:Qe.stack},"error in sending keep alive")}):a.warn("keep alive called when WS not open")},e),bA=pe=>z({tag:"iq",attrs:{to:OA,xmlns:"passive",type:"set"},content:[{tag:pe,attrs:{}}]}),Ce=async pe=>{let Qe=A.creds.me?.id;Qe&&await F({tag:"iq",attrs:{to:OA,type:"set",id:Q(),xmlns:"md"},content:[{tag:"remove-companion-device",attrs:{jid:Qe,reason:"user_initiated"}}]}),EA(new ei.Boom(pe||"Intentional Logout",{statusCode:ar.loggedOut}))},ke=async(pe,Qe)=>{let Me=Qe??oee(RK(5));if(Qe&&Qe?.length!==8)throw new Error("Custom pairing code must be exactly 8 chars");return A.creds.pairingCode=Me,A.creds.me={id:Dr(pe,"s.whatsapp.net"),name:"~"},k.emit("creds.update",A.creds),await F({tag:"iq",attrs:{to:OA,type:"set",id:Q(),xmlns:"md"},content:[{tag:"link_code_companion_reg",attrs:{jid:A.creds.me.id,stage:"companion_hello",should_show_push_notification:"true"},content:[{tag:"link_code_pairing_wrapped_companion_ephemeral_pub",attrs:{},content:await Ue()},{tag:"companion_server_auth_key_pub",attrs:{},content:A.creds.noiseKey.public},{tag:"companion_platform_id",attrs:{},content:kH(i)},{tag:"companion_platform_display",attrs:{},content:`${i[1]} (${i[0]})`},{tag:"link_code_pairing_nonce",attrs:{},content:"0"}]}]}),A.creds.pairingCode};async function Ue(){let pe=RK(32),Qe=RK(16),Me=await KD(A.creds.pairingCode,pe),oA=x$(A.creds.pairingEphemeralKeyPair.public,Me,Qe);return Buffer.concat([pe,Qe,oA])}let MA=pe=>z({tag:"iq",attrs:{to:OA,id:Q(),xmlns:"w:stats"},content:[{tag:"add",attrs:{t:Math.round(Date.now()/1e3)+""},content:pe}]});R.on("message",uA),R.on("open",async()=>{try{await tA()}catch(pe){a.error({err:pe},"error in validating connection"),EA(pe)}}),R.on("error",kK(EA)),R.on("close",()=>void EA(new ei.Boom("Connection Terminated",{statusCode:ar.connectionClosed}))),R.on("CB:xmlstreamend",()=>void EA(new ei.Boom("Connection Terminated by Server",{statusCode:ar.connectionClosed}))),R.on("CB:iq,type:set,pair-device",async pe=>{let Qe={tag:"iq",attrs:{to:OA,type:"result",id:pe.attrs.id}};await F(Qe);let Me=le(pe,"pair-device"),oA=PA(Me,"ref"),dA=Buffer.from(J.noiseKey.public).toString("base64"),FA=Buffer.from(J.signedIdentityKey.public).toString("base64"),jt=J.advSecretKey,ct=c||6e4,_r=()=>{if(!R.isOpen)return;let gr=oA.shift();if(!gr){EA(new ei.Boom("QR refs attempts ended",{statusCode:ar.timedOut}));return}let wo=gr.content.toString("utf-8"),io=gge(wo,dA,FA,jt,i);k.emit("connection.update",{qr:io}),Be=setTimeout(_r,ct),ct=c||2e4};_r()}),R.on("CB:iq,,pair-success",async pe=>{a.debug("pair success recv");try{_A(pe);let{reply:Qe,creds:Me}=Bse(pe,J);a.info({me:Me.me,platform:Me.platform},"pairing configured successfully, expect to restart the connection..."),k.emit("creds.update",Me),k.emit("connection.update",{isNewLogin:!0,qr:void 0}),await F(Qe),wA()}catch(Qe){a.info({trace:Qe.stack},"error in pairing"),EA(Qe)}}),R.on("CB:success",async pe=>{try{_A(pe),await be(),await bA("active");try{await K()}catch(Qe){a.warn({e:Qe},"failed to run digest after login")}}catch(Qe){a.warn({err:Qe},"failed to send initial passive iq")}if(a.info("opened connection to WA"),clearTimeout(Be),k.emit("creds.update",{me:{...A.creds.me,lid:pe.attrs.lid}}),k.emit("connection.update",{connection:"open"}),wA(),pe.attrs.lid&&A.creds.me?.id){let Qe=pe.attrs.lid;process.nextTick(async()=>{try{let Me=A.creds.me.id;await ie.lidMapping.storeLIDPNMappings([{lid:Qe,pn:Me}]);let{user:oA,device:dA}=pA(Me);await A.keys.set({"device-list":{[oA]:[dA?.toString()||"0"]}}),await ie.migrateSession(Me,Qe),a.info({myPN:Me,myLID:Qe},"Own LID session created successfully")}catch(Me){a.error({error:Me,lid:Qe},"Failed to create own LID session")}})}}),R.on("CB:stream:error",pe=>{let[Qe]=Gs(pe);a.error({reasonNode:Qe,fullErrorNode:pe},"stream errored out");let{reason:Me,statusCode:oA}=ree(pe);EA(new ei.Boom(`Stream Errored (${Me})`,{statusCode:oA,data:Qe||pe}))}),R.on("CB:failure",pe=>{let Qe=+(pe.attrs.reason||500);EA(new ei.Boom("Connection Failure",{statusCode:Qe,data:pe.attrs}))}),R.on("CB:ib,,downgrade_webclient",()=>{EA(new ei.Boom("Multi-device beta not joined",{statusCode:ar.multideviceMismatch}))}),R.on("CB:ib,,offline_preview",async pe=>{a.info("offline preview received",JSON.stringify(pe)),await F({tag:"ib",attrs:{},content:[{tag:"offline_batch",attrs:{count:"100"}}]})}),R.on("CB:ib,,edge_routing",pe=>{let Qe=le(pe,"edge_routing"),Me=le(Qe,"routing_info");Me?.content&&(A.creds.routingInfo=Buffer.from(Me?.content),k.emit("creds.update",A.creds))});let Ke=!1;process.nextTick(()=>{J.me?.id&&(k.buffer(),Ke=!0),k.emit("connection.update",{connection:"connecting",receivedPendingNotifications:!1,qr:void 0})}),R.on("CB:ib,,offline",pe=>{let Me=+(le(pe,"offline")?.attrs.count||0);a.info(`handled ${Me} offline messages/notifications`),Ke&&(k.flush(),a.trace("flushed events for initial buffer")),k.emit("connection.update",{receivedPendingNotifications:!0})}),k.on("creds.update",pe=>{let Qe=pe.me?.name;J.me?.name!==Qe&&(a.debug({name:Qe},"updated pushName"),F({tag:"presence",attrs:{name:Qe}}).catch(Me=>{a.warn({trace:Me.stack},"error in sending presence update on name change")})),Object.assign(J,pe)});let _A=({attrs:pe})=>{let Qe=pe?.t;if(!Qe)return;let Me=Number(Qe);if(Number.isNaN(Me)||Me<=0)return;let oA=Date.now();B=Me*1e3-oA,a.debug({offset:B},"calculated server time offset")},ot=()=>{let pe=3*OK.Day;return((Date.now()+B+pe)%OK.Week).toString()},wA=async()=>{if(!R.isOpen)return;let pe={tag:"ib",attrs:{},content:[{tag:"unified_session",attrs:{id:ot()}}]};try{await F(pe)}catch(Qe){a.debug({error:Qe},"failed to send unified_session telemetry")}},ht=pe=>{Ne.push(pe)},fr=async()=>{let pe=await pQ({},ui.REACHOUT_TIMELOCK,Ri.xwa2_fetch_account_reachout_timelock,z,Q),Qe={isActive:!!pe?.is_active,timeEnforcementEnds:pe?.time_enforcement_ends&&pe?.time_enforcement_ends!=="0"?new Date(parseInt(pe.time_enforcement_ends,10)*1e3):void 0,enforcementType:pe?.enforcement_type??iI.DEFAULT};return k.emit("connection.update",{reachoutTimeLock:Qe}),Qe},UA=async()=>pQ({input:{type:"INDIVIDUAL_NEW_CHAT_MSG"}},ui.MESSAGE_CAPPING_INFO,Ri.xwa2_message_capping_info,z,Q);return{type:"md",ws:R,ev:k,authState:{creds:J,keys:X},signalRepository:ie,get user(){return A.creds.me},generateMessageTag:Q,query:z,waitForMessage:q,waitForSocketOpen:aA,sendRawMessage:U,sendNode:F,logout:Ce,end:EA,registerSocketEndHandler:ht,onUnexpectedError:Je,uploadPreKeys:Xe,uploadPreKeysToServerIfRequired:be,digestKeyBundle:K,rotateSignedPreKey:G,requestPairingCode:ke,updateServerTimeOffset:_A,sendUnifiedSession:wA,wamBuffer:p,waitForConnectionUpdate:eee(k),sendWAMBuffer:MA,executeUSyncQuery:V,onWhatsApp:H,fetchAccountReachoutTimelock:fr,fetchNewChatMessageCap:UA}};function kK(n){return t=>{n(new ei.Boom(`WebSocket Error (${t?.message})`,{statusCode:aee(t),data:t}))}}var NXe=(n,t)=>{let o={tag:"picture",attrs:{type:n,query:"url"}};return t?.length&&(o.content=t),[o]},VIe=n=>{let{logger:t,markOnlineOnConnect:o,fireInitQueries:a,appStateMacVerification:e,shouldIgnoreJid:i,shouldSyncHistoryMessage:A,getMessage:r}=n,s=zIe(n),{ev:g,ws:c,authState:I,generateMessageTag:p,sendNode:B,query:f,signalRepository:Q,onUnexpectedError:y,sendUnifiedSession:m,registerSocketEndHandler:T}=s,_=Q.lidMapping.getLIDForPN.bind(Q.lidMapping),R,L={privacyTokenOn1to1:!0,profilePicPrivacyToken:!0,lidTrustedTokenIssueToLid:!1},U=Ei.Connecting,F=pc(),q=pc(),z=pc(),K=pc(),G,V={initialBootstrapComplete:!1,recentSyncComplete:!1},H,N=new Set,k=n.placeholderResendCache||new sc({stdTTL:NI.MSG_RETRY,useClones:!1}),J=async W=>{let{[W]:$}=await I.keys.get("app-state-sync-key",[W]);return $},X=async(W=!1)=>{if(!R||W){let{content:$}=await f({tag:"iq",attrs:{xmlns:"privacy",to:OA,type:"get"},content:[{tag:"privacy",attrs:{}}]});R=DL($?.[0],"category")}return R},ie=async(W,$)=>{await f({tag:"iq",attrs:{xmlns:"privacy",to:OA,type:"set"},content:[{tag:"privacy",attrs:{},content:[{tag:"category",attrs:{name:W,value:$}}]}]})},De=async W=>{await ie("messages",W)},oe=async W=>{await ie("calladd",W)},Se=async W=>{await ie("last",W)},Be=async W=>{await ie("online",W)},Re=async W=>{await ie("profile",W)},Ne=async W=>{await ie("status",W)},Je=async W=>{await ie("readreceipts",W)},ve=async W=>{await ie("groupadd",W)},tA=async W=>{await f({tag:"iq",attrs:{xmlns:"disappearing_mode",to:OA,type:"set"},content:[{tag:"disappearing_mode",attrs:{duration:W.toString()}}]})},fe=async()=>{let W=await f({tag:"iq",attrs:{xmlns:"bot",to:OA,type:"get"},content:[{tag:"bot",attrs:{v:"2"}}]}),$=le(W,"bot"),re=[];for(let se of PA($,"section"))if(se.attrs.type==="all")for(let we of PA(se,"bot"))re.push({jid:we.attrs.jid,personaId:we.attrs.persona_id});return re},Ie=async(...W)=>{let $=new cg().withStatusProtocol();for(let se of W)$.withUser(new gg().withId(se));let re=await s.executeUSyncQuery($);if(re)return re.list},Xe=async(...W)=>{let $=new cg().withDisappearingModeProtocol();for(let se of W)$.withUser(new gg().withId(se));let re=await s.executeUSyncQuery($);if(re)return re.list},je=async(W,$,re)=>{let se;if(!W)throw new vI.Boom("Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update");BA(W)!==BA(I.creds.me.id)?se=BA(W):se=void 0;let{img:we}=await jb($,re);await f({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:profile:picture",...se?{target:se}:{}},content:[{tag:"picture",attrs:{type:"image"},content:we}]})},be=async W=>{let $;if(!W)throw new vI.Boom("Illegal no-jid profile update. Please specify either your ID or the ID of the chat you wish to update");BA(W)!==BA(I.creds.me.id)?$=BA(W):$=void 0,await f({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:profile:picture",...$?{target:$}:{}}})},uA=async W=>{await f({tag:"iq",attrs:{to:OA,type:"set",xmlns:"status"},content:[{tag:"status",attrs:{},content:Buffer.from(W,"utf-8")}]})},EA=async W=>{await UA({pushNameSetting:W},"")},aA=async()=>{let W=await f({tag:"iq",attrs:{xmlns:"blocklist",to:OA,type:"get"}}),$=le(W,"list");return PA($,"item").map(re=>re.attrs.jid)},Ze=async(W,$)=>{let re=BA(W),se,we;if(qA(re)||Ci(re)){if(se=re,$==="block"){let he=await Q.lidMapping.getPNForLID(re);if(!he)throw new vI.Boom(`Unable to resolve PN JID for LID: ${W}`,{statusCode:400});we=BA(he)}}else if(Rt(re)||Or(re)){let he=await Q.lidMapping.getLIDForPN(re);if(!he)throw new vI.Boom(`Unable to resolve LID for PN JID: ${W}`,{statusCode:400});se=he,$==="block"&&(we=BA(re))}else throw new vI.Boom(`Invalid jid: ${W}`,{statusCode:400});let Ee={action:$,jid:se};if($==="block"){if(!we)throw new vI.Boom(`pn_jid required for block: ${W}`,{statusCode:400});Ee.pn_jid=we}await f({tag:"iq",attrs:{xmlns:"blocklist",to:OA,type:"set"},content:[{tag:"item",attrs:Ee}]})},bA=async W=>{let $=await f({tag:"iq",attrs:{to:"s.whatsapp.net",xmlns:"w:biz",type:"get"},content:[{tag:"business_profile",attrs:{v:"244"},content:[{tag:"profile",attrs:{jid:W}}]}]}),re=le($,"business_profile"),se=le(re,"profile");if(se){let we=le(se,"address"),Ee=le(se,"description"),he=le(se,"website"),ye=le(se,"email"),qe=le(le(se,"categories"),"category"),IA=le(se,"business_hours"),yA=IA?PA(IA,"business_hours_config"):void 0,$A=he?.content?.toString();return{wid:se.attrs?.jid,address:we?.content?.toString(),description:Ee?.content?.toString()||"",website:$A?[$A]:[],email:ye?.content?.toString(),category:qe?.content?.toString(),business_hours:{timezone:IA?.attrs?.timezone,business_config:yA?.map(({attrs:vA})=>vA)}}}},Ce=async(W,$)=>{t.info({fromTimestamp:$},"clean dirty bits "+W),await B({tag:"iq",attrs:{to:OA,type:"set",xmlns:"urn:xmpp:whatsapp:dirty",id:p()},content:[{tag:"clean",attrs:{type:W,...$?{timestamp:$.toString()}:null}}]})},ke=W=>({onMutation($){Kse($,g,I.creds.me,W?{accountSettings:I.creds.accountSettings}:void 0,t)}}),Ue=g.createBufferedFunction(async(W,$)=>{let re=new Map,se=async ye=>{if(re.has(ye))return re.get(ye)??void 0;let qe=await J(ye);return re.set(ye,qe??null),qe},we={},Ee={};await I.keys.transaction(async()=>{let ye=new Set(W),qe={},IA=new Set;for(;ye.size;){let yA={},$A=[];for(let At of ye){let rA=(await I.keys.get("app-state-sync-version",[At]))[At];rA?(rA=gH(rA),typeof we[At]>"u"&&(we[At]=rA.version)):rA=Zb(),yA[At]=rA;let tt=IA.has(At);tt&&IA.delete(At),t.info(`resyncing ${At} from v${rA.version}${tt?" (forcing snapshot)":""}`),$A.push({tag:"collection",attrs:{name:At,version:rA.version.toString(),return_snapshot:(tt||!rA.version).toString()}})}let vA=await f({tag:"iq",attrs:{to:OA,xmlns:"w:sync:app:state",type:"set"},content:[{tag:"sync",attrs:{},content:$A}]}),YA=await Fse(vA,n?.options);for(let At in YA){let Ge=At,{patches:rA,hasMorePatches:tt,snapshot:Ai}=YA[Ge];try{if(Ai){let{state:cr,mutationMap:Do}=await Use(Ge,Ai,se,we[Ge],e.snapshot,t);yA[Ge]=cr,Object.assign(Ee,Do),t.info(`restored state of ${Ge} from snapshot to v${cr.version} with mutations`),await I.keys.set({"app-state-sync-version":{[Ge]:cr}})}if(rA.length){let{state:cr,mutationMap:Do}=await IH(Ge,rA,yA[Ge],se,n.options,we[Ge],t,e.patch);await I.keys.set({"app-state-sync-version":{[Ge]:cr}}),t.info(`synced ${Ge} to v${cr.version}`),we[Ge]=cr.version,Object.assign(Ee,Do)}tt?t.info(`${Ge} has more patches...`):ye.delete(Ge)}catch(cr){qe[Ge]=(qe[Ge]||0)+1;let Do={name:Ge,attempt:qe[Ge],version:yA[Ge].version,statusCode:cr.output?.statusCode,errorType:cr.name,error:cr.stack};$f(cr)&&qe[Ge]>=cH?(t.warn(Do,`${Ge} blocked on missing key from v${yA[Ge].version}, parking after ${qe[Ge]} attempts`),N.add(Ge),ye.delete(Ge)):$f(cr)?(t.info(Do,`${Ge} blocked on missing key from v${yA[Ge].version}, retrying with snapshot`),IA.add(Ge)):vse(cr,qe[Ge])?(t.warn(Do,`failed to sync ${Ge} from v${yA[Ge].version}, giving up`),ye.delete(Ge)):(t.info(Do,`failed to sync ${Ge} from v${yA[Ge].version}, forcing snapshot retry`),IA.add(Ge))}}}},I?.creds?.me?.id||"resync-app-state");let{onMutation:he}=ke($);for(let ye in Ee)he(Ee[ye])}),MA=async(W,$="preview",re)=>{let se=BA(W),we=Rt(se)||qA(se),Ee=I.creds.me,he=Ee&&(se===BA(Ee.id)||Ee.lid&&se===BA(Ee.lid)),ye;L.profilePicPrivacyToken&&we&&!he&&(ye=await bH({authState:I,jid:se,getLIDForPN:_})),W=BA(W);let qe=await f({tag:"iq",attrs:{target:W,to:OA,type:"get",xmlns:"w:profile:picture"},content:NXe($,ye)},re);return le(qe,"picture")?.attrs?.url},Ke=async(W,$,re)=>{let se=await f({tag:"call",attrs:{id:p(),to:"@call"},content:[{tag:"link_create",attrs:{media:W},content:$?[{tag:"event",attrs:{start_time:String($.startTime)}}]:void 0}]},re);return le(se,"link_create")?.attrs?.token},_A=async(W,$)=>{let re=I.creds.me,se=W==="available";if(se||W==="unavailable"){if(!re.name){t.warn("no name present, ignoring presence update request...");return}g.emit("connection.update",{isOnline:se}),se&&m(),await B({tag:"presence",attrs:{name:re.name.replace(/@/g,""),type:W}})}else{let{server:we}=pA($);await B({tag:"chatstate",attrs:{from:we==="lid"?re.lid:re.id,to:$},content:[{tag:W==="recording"?"composing":W,attrs:W==="recording"?{media:"audio"}:{}}]})}},ot=async W=>{let $=BA(W),se=Rt($)||qA($)?await bH({authState:I,jid:$,getLIDForPN:_}):void 0;return B({tag:"presence",attrs:{to:W,id:p(),type:"subscribe"},content:se})},wA=({tag:W,attrs:$,content:re})=>{let se,we=$.from,Ee=$.participant||$.from;if(!(i(we)&&we!==OA)){if(W==="presence")se={lastKnownPresence:$.type==="unavailable"?"unavailable":"available",lastSeen:$.last&&$.last!=="deny"?+$.last:void 0,groupOnlineCount:$.count?+$.count:void 0};else if(Array.isArray(re)){let[he]=re,ye=he.tag;ye==="paused"&&(ye="available"),he.attrs?.media==="audio"&&(ye="recording"),se={lastKnownPresence:ye}}else t.error({tag:W,attrs:$,content:re},"recv invalid presence node");se&&g.emit("presence.update",{id:we,presences:{[Ee]:se}})}},ht=async W=>{let $=W.type,re=I.creds.myAppStateKeyId;if(!re)throw new vI.Boom("App state key not present!",{statusCode:400});let se,we;if(await z.mutex(async()=>{await I.keys.transaction(async()=>{t.debug({patch:W},"applying app patch"),await Ue([$],!1);let{[$]:Ee}=await I.keys.get("app-state-sync-version",[$]);se=Ee?gH(Ee):Zb(),we=await Pse(W,re,se,J);let{patch:he,state:ye}=we,qe={tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:sync:app:state"},content:[{tag:"sync",attrs:{},content:[{tag:"collection",attrs:{name:$,version:(ye.version-1).toString(),return_snapshot:"false"},content:[{tag:"patch",attrs:{},content:ne.SyncdPatch.encode(he).finish()}]}]}]};await f(qe),await I.keys.set({"app-state-sync-version":{[$]:ye}})},I?.creds?.me?.id||"app-patch")}),n.emitOwnEvents){let{onMutation:Ee}=ke(!1),{mutationMap:he}=await IH($,[{...we.patch,version:{version:we.state.version}}],se,J,n.options,void 0,t);for(let ye in he)Ee(he[ye])}},fr=async()=>{let W=await f({tag:"iq",attrs:{to:OA,xmlns:"abt",type:"get"},content:[{tag:"props",attrs:{protocol:"1",...I?.creds?.lastPropHash?{hash:I.creds.lastPropHash}:{}}}]}),$=le(W,"props"),re={};$&&($.attrs?.hash&&(I.creds.lastPropHash=$?.attrs?.hash,g.emit("creds.update",I.creds)),re=DL($,"prop"));let se=re[10518]??re.privacy_token_sending_on_all_1_on_1_messages;se!==void 0&&(L.privacyTokenOn1to1=se==="true"||se==="1");let we=re[9666]??re.profile_scraping_privacy_token_in_photo_iq;we!==void 0&&(L.profilePicPrivacyToken=we==="true"||we==="1");let Ee=re[14303]??re.lid_trusted_token_issue_to_lid;return Ee!==void 0&&(L.lidTrustedTokenIssueToLid=Ee==="true"||Ee==="1"),t.debug({serverProps:L},"fetched props"),re},UA=(W,$)=>{let re=Hse(W,$);return ht(re)},pe=W=>UA({disableLinkPreviews:{isPreviewsDisabled:W}},""),Qe=(W,$,re)=>UA({star:{messages:$,star:re}},W),Me=(W,$)=>UA({contact:$},W),oA=W=>UA({contact:null},W),dA=(W,$)=>UA({addLabel:{...$}},W),FA=(W,$)=>UA({addChatLabel:{labelId:$}},W),jt=(W,$)=>UA({removeChatLabel:{labelId:$}},W),ct=(W,$,re)=>UA({addMessageLabel:{messageId:$,labelId:re}},W),_r=(W,$,re)=>UA({removeMessageLabel:{messageId:$,labelId:re}},W),gr=W=>UA({quickReply:W},""),wo=W=>UA({quickReply:{timestamp:W,deleted:!0}},""),io=async()=>{await Promise.all([fr(),aA(),X()])},Ae=g.createBufferedFunction(async(W,$)=>{if(g.emit("messages.upsert",{messages:[W],type:$}),W.pushName){let Ee=W.key.fromMe?I.creds.me.id:W.key.participant||W.key.remoteJid;Ee=BA(Ee),W.key.fromMe||g.emit("contacts.update",[{id:Ee,notify:W.pushName,verifiedName:W.verifiedBizName}]),W.key.fromMe&&W.pushName&&I.creds.me?.name!==W.pushName&&g.emit("creds.update",{me:{...I.creds.me,name:W.pushName}})}let re=Wb(W.message),se=re?A(re)&&cQ.includes(re.syncType):!1;if(re&&se){let Ee=re.syncType;Ee===ne.HistorySync.HistorySyncType.INITIAL_BOOTSTRAP&&!V.initialBootstrapComplete&&(V.initialBootstrapComplete=!0,g.emit("messaging-history.status",{syncType:Ee,status:"complete",explicit:!0})),Ee===ne.HistorySync.HistorySyncType.RECENT&&re.progress===100&&!V.recentSyncComplete&&(V.recentSyncComplete=!0,clearTimeout(H),H=void 0,g.emit("messaging-history.status",{syncType:Ee,status:"complete",explicit:!0})),Ee===ne.HistorySync.HistorySyncType.RECENT&&!V.recentSyncComplete&&(clearTimeout(H),H=setTimeout(()=>{V.recentSyncComplete||(V.recentSyncComplete=!0,g.emit("messaging-history.status",{syncType:ne.HistorySync.HistorySyncType.RECENT,status:"paused",explicit:!1})),H=void 0},MIe))}re&&U===Ei.AwaitingInitialSync&&(G&&(clearTimeout(G),G=void 0),se?(U=Ei.Syncing,t.info("Transitioned to Syncing state")):(U=Ei.Online,t.info("History sync skipped, transitioning to Online state and flushing buffer"),g.flush()));let we=async()=>{if(U===Ei.Syncing){N.clear(),t.info("Doing app state sync"),await Ue(g$,!0),U=Ei.Online,t.info("App state sync complete, transitioning to Online state and flushing buffer"),g.flush();let Ee=(I.creds.accountSyncCounter||0)+1;g.emit("creds.update",{accountSyncCounter:Ee})}};await Promise.all([(async()=>{se&&await we()})(),age(W,{signalRepository:Q,shouldProcessHistoryMsg:se,placeholderResendCache:k,ev:g,creds:I.creds,keyStore:I.keys,logger:t,options:n.options,getMessage:r})]),W.message?.protocolMessage?.appStateSyncKeyShare&&U===Ei.Syncing&&(t.info("App state sync key arrived, triggering app state sync"),await we())});return c.on("CB:presence",wA),c.on("CB:chatstate",wA),c.on("CB:ib,,dirty",async W=>{let{attrs:$}=le(W,"dirty");switch($.type){case"account_sync":if($.timestamp){let{lastAccountSyncTimestamp:se}=I.creds;se&&await Ce("account_sync",se),se=+$.timestamp,g.emit("creds.update",{lastAccountSyncTimestamp:se})}break;case"groups":break;default:t.info({node:W},"received unknown sync");break}}),g.on("connection.update",({connection:W,receivedPendingNotifications:$})=>{if(W==="close"&&(N.clear(),clearTimeout(H),H=void 0),W==="open"&&(a&&io().catch(se=>y(se,"init queries")),_A(o?"available":"unavailable").catch(se=>y(se,"presence update requests"))),!$||U!==Ei.Connecting)return;if(V.initialBootstrapComplete=!1,V.recentSyncComplete=!1,clearTimeout(H),H=void 0,U=Ei.AwaitingInitialSync,t.info("Connection is now AwaitingInitialSync, buffering events"),g.buffer(),!A(ne.Message.HistorySyncNotification.create({syncType:ne.HistorySync.HistorySyncType.RECENT}))){t.info("History sync is disabled by config, not waiting for notification. Transitioning to Online."),U=Ei.Online,setTimeout(()=>g.flush(),0);return}if(I.creds.accountSyncCounter>0){t.info("Reconnection with existing sync data, skipping history sync wait. Transitioning to Online."),U=Ei.Online,setTimeout(()=>g.flush(),0);return}t.info("First connection, awaiting history sync notification with a 20s timeout."),G&&clearTimeout(G),G=setTimeout(()=>{if(U===Ei.AwaitingInitialSync){t.warn("Timeout in AwaitingInitialSync, forcing state to Online and flushing buffer"),U=Ei.Online,g.flush();let se=(I.creds.accountSyncCounter||0)+1;g.emit("creds.update",{accountSyncCounter:se})}},2e4)}),g.on("creds.update",({myAppStateKeyId:W})=>{if(!W||N.size===0)return;if(U===Ei.Syncing){N.clear();return}let $=[...N];N.clear(),t.info({collections:$},"app state sync key arrived, re-syncing blocked collections"),Ue($,!1).catch(re=>y(re,"blocked collections resync"))}),g.on("lid-mapping.update",async({lid:W,pn:$})=>{try{await Q.lidMapping.storeLIDPNMappings([{lid:W,pn:$}])}catch(re){t.warn({lid:W,pn:$,error:re},"Failed to store LID-PN mapping")}}),T(()=>{G&&(clearTimeout(G),G=void 0),!n.placeholderResendCache&&k.close&&k.close(),U=Ei.Connecting,R=void 0}),{...s,serverProps:L,createCallLink:Ke,getBotListV2:fe,messageMutex:F,receiptMutex:q,appStatePatchMutex:z,notificationMutex:K,fetchPrivacySettings:X,upsertMessage:Ae,appPatch:ht,sendPresenceUpdate:_A,presenceSubscribe:ot,profilePictureUrl:MA,fetchBlocklist:aA,fetchStatus:Ie,fetchDisappearingDuration:Xe,updateProfilePicture:je,removeProfilePicture:be,updateProfileStatus:uA,updateProfileName:EA,updateBlockStatus:Ze,updateDisableLinkPreviewsPrivacy:pe,updateCallPrivacy:oe,updateMessagesPrivacy:De,updateLastSeenPrivacy:Se,updateOnlinePrivacy:Be,updateProfilePicturePrivacy:Re,updateStatusPrivacy:Ne,updateReadReceiptsPrivacy:Je,updateGroupsAddPrivacy:ve,updateDefaultDisappearingMode:tA,getBusinessProfile:bA,resyncAppState:Ue,chatModify:UA,cleanDirtyBits:Ce,addOrEditContact:Me,removeContact:oA,placeholderResendCache:k,addLabel:dA,addChatLabel:FA,removeChatLabel:jt,addMessageLabel:ct,removeMessageLabel:_r,star:Qe,addOrEditQuickReply:gr,removeQuickReply:wo}};var WIe=n=>{let t=VIe(n),{authState:o,ev:a,query:e,upsertMessage:i}=t,A=async(g,c,I)=>e({tag:"iq",attrs:{type:c,xmlns:"w:g2",to:g},content:I}),r=async g=>{let c=await A(g,"get",[{tag:"query",attrs:{request:"interactive"}}]);return xE(c)},s=async()=>{let g=await e({tag:"iq",attrs:{to:"@g.us",xmlns:"w:g2",type:"get"},content:[{tag:"participating",attrs:{},content:[{tag:"participants",attrs:{}},{tag:"description",attrs:{}}]}]}),c={},I=le(g,"groups");if(I){let p=PA(I,"group");for(let B of p){let f=xE({tag:"result",attrs:{},content:[B]});c[f.id]=f}}return t.ev.emit("groups.update",Object.values(c)),c};return t.ws.on("CB:ib,,dirty",async g=>{let{attrs:c}=le(g,"dirty");c.type==="groups"&&(await s(),await t.cleanDirtyBits("groups"))}),{...t,groupMetadata:r,groupCreate:async(g,c)=>{let I=Vr(),p=await A("@g.us","set",[{tag:"create",attrs:{subject:g,key:I},content:c.map(B=>({tag:"participant",attrs:{jid:B}}))}]);return xE(p)},groupLeave:async g=>{await A("@g.us","set",[{tag:"leave",attrs:{},content:[{tag:"group",attrs:{id:g}}]}])},groupUpdateSubject:async(g,c)=>{await A(g,"set",[{tag:"subject",attrs:{},content:Buffer.from(c,"utf-8")}])},groupRequestParticipantsList:async g=>{let c=await A(g,"get",[{tag:"membership_approval_requests",attrs:{}}]),I=le(c,"membership_approval_requests");return PA(I,"membership_approval_request").map(B=>B.attrs)},groupRequestParticipantsUpdate:async(g,c,I)=>{let p=await A(g,"set",[{tag:"membership_requests_action",attrs:{},content:[{tag:I,attrs:{},content:c.map(y=>({tag:"participant",attrs:{jid:y}}))}]}]),B=le(p,"membership_requests_action"),f=le(B,I);return PA(f,"participant").map(y=>({status:y.attrs.error||"200",jid:y.attrs.jid}))},groupParticipantsUpdate:async(g,c,I)=>{let p=await A(g,"set",[{tag:I,attrs:{},content:c.map(Q=>({tag:"participant",attrs:{jid:Q}}))}]),B=le(p,I);return PA(B,"participant").map(Q=>({status:Q.attrs.error||"200",jid:Q.attrs.jid,content:Q}))},groupUpdateDescription:async(g,c)=>{let p=(await r(g)).descId??null;await A(g,"set",[{tag:"description",attrs:{...c?{id:Vr()}:{delete:"true"},...p?{prev:p}:{}},content:c?[{tag:"body",attrs:{},content:Buffer.from(c,"utf-8")}]:void 0}])},groupInviteCode:async g=>{let c=await A(g,"get",[{tag:"invite",attrs:{}}]);return le(c,"invite")?.attrs.code},groupRevokeInvite:async g=>{let c=await A(g,"set",[{tag:"invite",attrs:{}}]);return le(c,"invite")?.attrs.code},groupAcceptInvite:async g=>{let c=await A("@g.us","set",[{tag:"invite",attrs:{code:g}}]);return le(c,"group")?.attrs.jid},groupRevokeInviteV4:async(g,c)=>!!await A(g,"set",[{tag:"revoke",attrs:{},content:[{tag:"participant",attrs:{jid:c}}]}]),groupAcceptInviteV4:a.createBufferedFunction(async(g,c)=>{g=typeof g=="string"?{remoteJid:g}:g;let I=await A(c.groupJid,"set",[{tag:"accept",attrs:{code:c.inviteCode,expiration:c.inviteExpiration.toString(),admin:g.remoteJid}}]);return g.id&&(c=ne.Message.GroupInviteMessage.fromObject(c),c.inviteExpiration=0,c.inviteCode="",a.emit("messages.update",[{key:g,update:{message:{groupInviteMessage:c}}}])),await i({key:{remoteJid:c.groupJid,id:Vr(t.user?.id),fromMe:!1,participant:g.remoteJid},messageStubType:RA.GROUP_PARTICIPANT_ADD,messageStubParameters:[JSON.stringify(o.creds.me)],participant:g.remoteJid,messageTimestamp:vi()},"notify"),I.attrs.from}),groupGetInviteInfo:async g=>{let c=await A("@g.us","get",[{tag:"invite",attrs:{code:g}}]);return xE(c)},groupToggleEphemeral:async(g,c)=>{let I=c?{tag:"ephemeral",attrs:{expiration:c.toString()}}:{tag:"not_ephemeral",attrs:{}};await A(g,"set",[I])},groupSettingUpdate:async(g,c)=>{await A(g,"set",[{tag:c,attrs:{}}])},groupMemberAddMode:async(g,c)=>{await A(g,"set",[{tag:"member_add_mode",attrs:{},content:c}])},groupJoinApprovalMode:async(g,c)=>{await A(g,"set",[{tag:"membership_approval_mode",attrs:{},content:[{tag:"group_join",attrs:{state:c}}]}])},groupFetchAllParticipating:s}},xE=n=>{let t=le(n,"group");if(!t){let B=le(n,"error");if(B){let f=B.attrs.code?+B.attrs.code:500,Q=B.attrs.text||"group metadata query failed";throw new YM.Boom(Q,{statusCode:f,data:B})}throw new YM.Boom("Invalid group metadata response: missing node",{data:n})}if(!t.attrs.id)throw new YM.Boom("Invalid group metadata response: missing group id",{data:t});let o=le(t,"description"),a,e,i,A,r,s;o&&(a=jA(o,"body"),i=o.attrs.participant?BA(o.attrs.participant):void 0,A=o.attrs.participant_pn?BA(o.attrs.participant_pn):void 0,r=o.attrs.participant_username||void 0,s=+o.attrs.t,e=o.attrs.id);let g=t.attrs.id.includes("@")?t.attrs.id:Dr(t.attrs.id,"g.us"),c=le(t,"ephemeral")?.attrs.expiration,I=jA(t,"member_add_mode")==="all_member_add";return{id:g,notify:t.attrs.notify,addressingMode:t.attrs.addressing_mode==="lid"?LB.LID:LB.PN,subject:t.attrs.subject,subjectOwner:t.attrs.s_o,subjectOwnerPn:t.attrs.s_o_pn,subjectOwnerUsername:t.attrs.s_o_username,subjectTime:+t.attrs.s_t,size:t.attrs.size?+t.attrs.size:PA(t,"participant").length,creation:+t.attrs.creation,owner:t.attrs.creator?BA(t.attrs.creator):void 0,ownerPn:t.attrs.creator_pn?BA(t.attrs.creator_pn):void 0,ownerUsername:t.attrs.creator_username||void 0,owner_country_code:t.attrs.creator_country_code,desc:a,descId:e,descOwner:i,descOwnerPn:A,descOwnerUsername:r,descTime:s,linkedParent:le(t,"linked_parent")?.attrs.jid||void 0,restrict:!!le(t,"locked"),announce:!!le(t,"announcement"),isCommunity:!!le(t,"parent"),isCommunityAnnounce:!!le(t,"default_sub_group"),joinApprovalMode:!!le(t,"membership_approval_mode"),memberAddMode:I,participants:PA(t,"participant").map(({attrs:B})=>({id:B.jid,phoneNumber:qA(B.jid)&&Rt(B.phone_number)?B.phone_number:void 0,lid:Rt(B.jid)&&qA(B.lid)?B.lid:void 0,username:B.participant_username||B.username||void 0,admin:B.type||null})),ephemeralDuration:c?+c:void 0}};var YE=ze(Jr(),1);var RXe=n=>{let{id:t,thread_metadata:o,viewer_metadata:a}=n;return{id:t,owner:void 0,name:o.name.text,creation_time:parseInt(o.creation_time,10),description:o.description.text,invite:o.invite,subscribers:parseInt(o.subscribers_count,10),verification:o.verification,picture:{id:o.picture.id,directPath:o.picture.direct_path},mute_state:a.mute}},kXe=n=>typeof n!="object"||n===null?null:"id"in n&&typeof n.id=="string"?n:"result"in n&&typeof n.result=="object"&&n.result!==null&&"id"in n.result?n.result:null,ZIe=n=>{let t=WIe(n),{query:o,generateMessageTag:a}=t,e=(A,r,s)=>pQ(A,r,s,o,a),i=async(A,r)=>{let s={newsletter_id:A,updates:{...r,settings:null}};return e(s,ui.UPDATE_METADATA,"xwa2_newsletter_update")};return{...t,newsletterCreate:async(A,r)=>{let g=await e({input:{name:A,description:r??null}},ui.CREATE,Ri.xwa2_newsletter_create);return RXe(g)},newsletterUpdate:i,newsletterSubscribers:async A=>e({newsletter_id:A},ui.SUBSCRIBERS,Ri.xwa2_newsletter_subscribers),newsletterMetadata:async(A,r)=>{let s={fetch_creation_time:!0,fetch_full_image:!0,fetch_viewer_metadata:!0,input:{key:r,type:A.toUpperCase()}},g=await e(s,ui.METADATA,Ri.xwa2_newsletter_metadata);return kXe(g)},newsletterFollow:A=>e({newsletter_id:A},ui.FOLLOW,Ri.xwa2_newsletter_join_v2),newsletterUnfollow:A=>e({newsletter_id:A},ui.UNFOLLOW,Ri.xwa2_newsletter_leave_v2),newsletterMute:A=>e({newsletter_id:A},ui.MUTE,Ri.xwa2_newsletter_mute_v2),newsletterUnmute:A=>e({newsletter_id:A},ui.UNMUTE,Ri.xwa2_newsletter_unmute_v2),newsletterUpdateName:async(A,r)=>await i(A,{name:r}),newsletterUpdateDescription:async(A,r)=>await i(A,{description:r}),newsletterUpdatePicture:async(A,r)=>{let{img:s}=await jb(r);return await i(A,{picture:s.toString("base64")})},newsletterRemovePicture:async A=>await i(A,{picture:""}),newsletterReactMessage:async(A,r,s)=>{await o({tag:"message",attrs:{to:A,...s?{}:{edit:"7"},type:"reaction",server_id:r,id:a()},content:[{tag:"reaction",attrs:s?{code:s}:{}}]})},newsletterFetchMessages:async(A,r,s,g)=>{let c={count:r.toString()};return typeof s=="number"&&(c.since=s.toString()),g&&(c.after=g.toString()),await o({tag:"iq",attrs:{id:a(),type:"get",xmlns:"newsletter",to:A},content:[{tag:"message_updates",attrs:c}]})},subscribeNewsletterUpdates:async A=>{let r=await o({tag:"iq",attrs:{id:a(),type:"set",xmlns:"newsletter",to:A},content:[{tag:"live_updates",attrs:{},content:[]}]}),g=le(r,"live_updates")?.attrs?.duration;return g?{duration:g}:null},newsletterAdminCount:async A=>(await e({newsletter_id:A},ui.ADMIN_COUNT,Ri.xwa2_newsletter_admin_count)).admin_count,newsletterChangeOwner:async(A,r)=>{await e({newsletter_id:A,user_id:r},ui.CHANGE_OWNER,Ri.xwa2_newsletter_change_owner)},newsletterDemote:async(A,r)=>{await e({newsletter_id:A,user_id:r},ui.DEMOTE,Ri.xwa2_newsletter_demote)},newsletterDelete:async A=>{await e({newsletter_id:A},ui.DELETE,Ri.xwa2_newsletter_delete_v2)}}};var XIe=n=>{let{logger:t,linkPreviewImageThumbnailWidth:o,generateHighQualityLinkPreview:a,options:e,patchMessageBeforeSending:i,cachedGroupMetadata:A,enableRecentMessageCache:r,maxMsgRetryCount:s}=n,g=ZIe(n),{ev:c,authState:I,messageMutex:p,signalRepository:B,upsertMessage:f,query:Q,fetchPrivacySettings:y,sendNode:m,groupMetadata:T,groupToggleEphemeral:_,registerSocketEndHandler:R}=g,L=B.lidMapping.getLIDForPN.bind(B.lidMapping),U=new Set,F=n.userDevicesCache||new sc({stdTTL:NI.USER_DEVICES,useClones:!1}),q=pc(),z=r?new aM(t,s):null,K=JIe(),G,V=qU,H=async(fe=!1)=>{let Ie=await G;return(!Ie||fe||new Date().getTime()-Ie.fetchDate.getTime()>Ie.ttl*1e3)&&(G=(async()=>{let Xe=await Q({tag:"iq",attrs:{type:"set",xmlns:"w:m",to:OA},content:[{tag:"media_conn",attrs:{}}]}),je=le(Xe,"media_conn"),be={hosts:PA(je,"host").map(({attrs:uA})=>({hostname:uA.hostname,maxContentLengthBytes:+uA.maxContentLengthBytes})),auth:je.attrs.auth,ttl:+je.attrs.ttl,fetchDate:new Date};return t.debug("fetched media conn"),be.hosts[0]&&(V=be.hosts[0].hostname),be})()),G},N=async(fe,Ie,Xe,je)=>{if(!Xe||Xe.length===0)throw new YE.Boom("missing ids in receipt");let be={tag:"receipt",attrs:{id:Xe[0]}};(je==="read"||je==="read-self")&&(be.attrs.t=vi().toString()),je==="sender"&&(Rt(fe)||qA(fe))?(be.attrs.recipient=fe,be.attrs.to=Ie):(be.attrs.to=fe,Ie&&(be.attrs.participant=Ie)),je&&(be.attrs.type=je);let EA=Xe.slice(1);EA.length&&(be.content=[{tag:"list",attrs:{},content:EA.map(aA=>({tag:"item",attrs:{id:aA}}))}]),t.debug({attrs:be.attrs,messageIds:Xe},"sending receipt for messages"),await m(be)},k=async(fe,Ie)=>{let Xe=ise(fe);for(let{jid:je,participant:be,messageIds:uA}of Xe)await N(je,be,uA,Ie)},J=async fe=>{let Xe=(await y()).readreceipts==="all"?"read":"read-self";await k(fe,Xe)},X=async(fe,Ie,Xe)=>{let je=[];Ie||t.debug("not using cache for devices");let be=[],uA=fe.map(Ce=>{let ke=pA(Ce),Ue=ke?.user,MA=ke?.device;return typeof MA=="number"&&MA>=0&&Ue?(je.push({user:Ue,device:MA,jid:Ce}),null):(Ce=BA(Ce),{jid:Ce,user:Ue})}).filter(Ce=>Ce!==null),EA;if(Ie&&F.mget){let Ce=uA.map(ke=>ke?.user).filter(Boolean);EA=await F.mget(Ce)}for(let{jid:Ce,user:ke}of uA)if(Ie){let Ue=EA?.[ke]||(F.mget?void 0:await F.get(ke));if(Ue){let MA=Ue.map(Ke=>({...Ke,jid:Dr(Ke.user,Ke.server,Ke.device)}));je.push(...MA),t.trace({user:ke},"using cache for devices")}else be.push(Ce)}else be.push(Ce);if(!be.length)return je;let aA=new Set;for(let Ce of be)if(qA(Ce)||Ci(Ce)){let ke=pA(Ce)?.user;ke&&aA.add(ke)}let Ze=new cg().withContext("message").withDeviceProtocol().withLIDProtocol();for(let Ce of be)Ze.withUser(new gg().withId(Ce));let bA=await g.executeUSyncQuery(Ze);if(bA){let Ce=bA.list.filter(Ke=>!!Ke.lid);if(Ce.length>0){t.trace("Storing LID maps from device call"),await B.lidMapping.storeLIDPNMappings(Ce.map(Ke=>({lid:Ke.lid,pn:Ke.id})));try{let Ke=Ce.map(_A=>_A.lid);Ke.length&&await De(Ke,!0)}catch(Ke){t.warn({e:Ke,count:Ce.length},"failed to assert sessions for newly mapped LIDs")}}let ke=pse(bA?.list,I.creds.me.id,I.creds.me.lid,Xe),Ue={};for(let Ke of ke)Ue[Ke.user]=Ue[Ke.user]||[],Ue[Ke.user]?.push(Ke);for(let[Ke,_A]of Object.entries(Ue)){let ot=aA.has(Ke);for(let wA of _A){let ht=ot?Dr(Ke,wA.server,wA.device):Dr(wA.user,wA.server,wA.device);je.push({...wA,jid:ht}),t.debug({user:wA.user,device:wA.device,finalJid:ht,usedLid:ot},"Processed device with LID priority")}}await q.mutex(async()=>{if(F.mset)await F.mset(Object.entries(Ue).map(([Ke,_A])=>({key:Ke,value:_A})));else for(let Ke in Ue)Ue[Ke]&&await F.set(Ke,Ue[Ke])});let MA={};for(let[Ke,_A]of Object.entries(Ue))_A&&_A.length>0&&(MA[Ke]=_A.map(ot=>ot.device?.toString()||"0"));if(Object.keys(MA).length>0)try{await I.keys.set({"device-list":MA}),t.debug({userCount:Object.keys(MA).length},"stored user device lists for bulk migration")}catch(Ke){t.warn({error:Ke},"failed to store user device lists")}}return je},ie=(fe,Ie)=>Be(fe,{protocolMessage:{type:ne.Message.ProtocolMessage.Type.GROUP_MEMBER_LABEL_CHANGE,memberLabel:{label:Ie?.slice(0,30),labelTimestamp:vi()}}},{additionalNodes:[{tag:"meta",attrs:{tag_reason:"user_update",appdata:"member_tag"},content:void 0}]}),De=async(fe,Ie)=>{let Xe=!1,je=[...new Set(fe)],be=[];t.debug({jids:fe},"assertSessions call with jids");for(let uA of je)!Ie&&(await B.validateSession(uA)).exists||be.push(uA);if(be.length){let uA=[...be.filter(aA=>!!qA(aA)||!!Ci(aA)),...(await B.lidMapping.getLIDsForPNs(be.filter(aA=>!!Rt(aA)||!!Or(aA)))||[]).map(aA=>aA.lid)];t.debug({jidsRequiringFetch:be,wireJids:uA},"fetching sessions");let EA=await Q({tag:"iq",attrs:{xmlns:"encrypt",type:"get",to:OA},content:[{tag:"key",attrs:{},content:uA.map(aA=>{let Ze={jid:aA};return Ie&&(Ze.reason="identity"),{tag:"user",attrs:Ze}})}]});await lse(EA,B),Xe=!0}return Xe},oe=async fe=>{if(!I.creds.me?.id)throw new YE.Boom("Not authenticated");let Ie={protocolMessage:{peerDataOperationRequestMessage:fe,type:ne.Message.ProtocolMessage.Type.PEER_DATA_OPERATION_REQUEST_MESSAGE}},Xe=BA(I.creds.me.id);return await Be(Xe,Ie,{additionalAttributes:{category:"peer",push_priority:"high_force"},additionalNodes:[{tag:"meta",attrs:{appdata:"default"}}]})},Se=async(fe,Ie,Xe,je)=>{if(!fe.length)return{nodes:[],shouldIncludeDeviceIdentity:!1};let be=await i(Ie,fe),uA=Array.isArray(be)?be:fe.map(Ue=>({recipientJid:Ue,message:be})),EA=!1,aA=I.creds.me.id,Ze=I.creds.me?.lid,bA=Ze?pA(Ze)?.user:null,Ce=uA.map(async({recipientJid:Ue,message:MA})=>{try{if(!Ue)return null;let Ke=MA;if(je){let{user:ht}=pA(Ue),{user:fr}=pA(aA),UA=bA;(ht===fr||UA&&ht===UA)&&!(Ue===aA||Ze&&Ue===Ze)&&(Ke=je,t.debug({jid:Ue,targetUser:ht},"Using DSM for own device"))}let _A=Ph(Ke),ot=Ue;return await K.mutex(ot,async()=>{let{type:ht,ciphertext:fr}=await B.encryptMessage({jid:Ue,data:_A});return ht==="pkmsg"&&(EA=!0),{tag:"to",attrs:{jid:Ue},content:[{tag:"enc",attrs:{v:"2",type:ht,...Xe||{}},content:fr}]}})}catch(Ke){return t.error({jid:Ue,err:Ke},"Failed to encrypt for recipient"),null}}),ke=(await Promise.all(Ce)).filter(Ue=>Ue!==null);if(fe.length>0&&ke.length===0)throw new YE.Boom("All encryptions failed",{statusCode:500});return{nodes:ke,shouldIncludeDeviceIdentity:EA}},Be=async(fe,Ie,{messageId:Xe,participant:je,additionalAttributes:be,additionalNodes:uA,useUserDevicesCache:EA,useCachedGroupMetadata:aA,statusJidList:Ze})=>{let bA=Xse(I.creds),Ce=I.creds.me?.lid,ke=!!je?.jid,Ue=ke,MA="status@broadcast",{user:Ke,server:_A}=pA(fe),ot=_A==="g.us",wA=fe===MA,ht=_A==="lid",fr=_A==="newsletter",UA=ot||wA,pe=fe;Xe=Xe||Vr(bA),EA=EA!==!1,aA=aA!==!1&&!wA;let Qe=[],Me=wA?MA:pe,oA=[],dA=[],FA,jt={deviceSentMessage:{destinationJid:Me,message:Ie},messageContextInfo:Ie.messageContextInfo},ct={};if(je){!ot&&!wA&&(be={...be,device_fanout:"false"});let{user:_r,device:gr}=pA(je.jid);dA.push({user:_r,device:gr,jid:je.jid})}return await I.keys.transaction(async()=>{let _r=Ne(Ie);if(_r&&(ct.mediatype=_r),fr){let Ee=i?await i(Ie,[]):Ie,he=nee(Ee);oA.push({tag:"plaintext",attrs:{},content:he});let ye={tag:"message",attrs:{to:fe,id:Xe,type:Re(Ie),...be||{}},content:oA};t.debug({msgId:Xe},`sending newsletter message to ${fe}`),await m(ye);return}if((Si(Ie)?.pinInChatMessage||Si(Ie)?.reactionMessage)&&(ct["decrypt-fail"]="hide"),UA&&!ke){let[Ee,he]=await Promise.all([(async()=>{let rA=aA&&A?await A(fe):void 0;return rA&&Array.isArray(rA?.participants)?t.trace({jid:fe,participants:rA.participants.length},"using cached group metadata"):wA||(rA=await T(fe)),rA})(),(async()=>!je&&!wA?(await I.keys.get("sender-key-memory",[fe]))[fe]||{}:{})()]),ye=Ee?Ee.participants.map(rA=>rA.id):[];Ee?.ephemeralDuration&&Ee.ephemeralDuration>0&&(be={...be,expiration:Ee.ephemeralDuration.toString()}),wA&&Ze&&ye.push(...Ze);let qe=await X(ye,!!EA,!1);dA.push(...qe),ot&&(be={...be,addressing_mode:Ee?.addressingMode||"lid"});let IA=await i(Ie);if(Array.isArray(IA))throw new YE.Boom("Per-jid patching is not supported in groups");let yA=Ph(IA);FA=IA;let vA=(be?.addressing_mode||Ee?.addressingMode||"lid")==="lid"&&Ce?Ce:bA,{ciphertext:YA,senderKeyDistributionMessage:At}=await B.encryptGroupMessage({group:Me,data:yA,meId:vA}),Ge=[];for(let rA of dA){let tt=rA.jid;(!!!he[tt]||je)&&!Ci(tt)&&!Or(tt)&&rA.device!==99&&(Ge.push(tt),he[tt]=!0)}if(Ge.length){t.debug({senderKeyJids:Ge},"sending new sender key");let rA={senderKeyDistributionMessage:{axolotlSenderKeyDistributionMessage:At,groupId:Me}};await De(Ge);let Ai=await Se(Ge,rA,ct);Ue=Ue||Ai.shouldIncludeDeviceIdentity,Qe.push(...Ai.nodes)}oA.push({tag:"enc",attrs:{v:"2",type:"skmsg",...ct},content:YA}),await I.keys.set({"sender-key-memory":{[fe]:he}})}else{let Ee=bA;ht&&Ce?(Ee=Ce,t.debug({to:fe,ownId:Ee},"Using LID identity for @lid conversation")):t.debug({to:fe,ownId:Ee},"Using PN identity for @s.whatsapp.net conversation");let{user:he}=pA(Ee);if(!je){let rA=await i(Ie,[fe]);FA=Array.isArray(rA)?rA.find(tt=>tt.recipientJid===fe)||rA[0]:rA}if(!ke){let rA=ht?"lid":"s.whatsapp.net";if(dA.push({user:Ke,device:0,jid:Dr(Ke,rA,0)}),Ke!==he){let tt=ht?"lid":"s.whatsapp.net",Ai=ht&&Ce?pA(Ce).user:pA(bA).user;dA.push({user:Ai,device:0,jid:Dr(Ai,tt,0)})}if(be?.category!=="peer"){dA.length=0;let tt=ht&&Ce?Dr(pA(Ce)?.user,"lid",void 0):Dr(pA(bA)?.user,"s.whatsapp.net",void 0),Ai=await X([tt,fe],!0,!1);dA.push(...Ai),t.debug({deviceCount:dA.length,devices:dA.map(cr=>`${cr.user}:${cr.device}@${pA(cr.jid)?.server}`)},"Device enumeration complete with unified addressing")}}let ye=[],qe=[],IA=[],{user:yA}=pA(bA),{user:$A}=Ce?pA(Ce):{user:null};for(let{user:rA,jid:tt}of dA){if(tt===bA||Ce&&tt===Ce){t.debug({jid:tt,meId:bA,meLid:Ce},"Skipping exact sender device (whatsmeow pattern)");continue}rA===yA||rA===$A?qe.push(tt):IA.push(tt),ye.push(tt)}await De(ye);let[{nodes:vA,shouldIncludeDeviceIdentity:YA},{nodes:At,shouldIncludeDeviceIdentity:Ge}]=await Promise.all([Se(qe,jt||Ie,ct),Se(IA,Ie,ct,jt)]);Qe.push(...vA),Qe.push(...At),(qe.length>0||IA.length>0)&&(ct.phash=Z$([...qe,...IA])),Ue=Ue||YA||Ge}if(ke){let Ee=qA(je.jid),he=ft(je.jid,Ee?Ce:bA),ye=Ie;if(UA){let $A;if(Ce&&await B.hasSenderKey({group:Me,meId:Ce})?$A=Ce:await B.hasSenderKey({group:Me,meId:bA})&&($A=bA),$A)try{let vA=await B.getSenderKeyDistributionMessage({group:Me,meId:$A});ye={...Ie,senderKeyDistributionMessage:{groupId:Me,axolotlSenderKeyDistributionMessage:vA}}}catch(vA){t.warn({err:vA,jid:Me},"failed to build SKDM for retry, sending without it")}}let qe=he?Ph({deviceSentMessage:{destinationJid:Me,message:ye}}):Ph(ye),{type:IA,ciphertext:yA}=await B.encryptMessage({data:qe,jid:je.jid});oA.push({tag:"enc",attrs:{v:"2",type:IA,count:je.count.toString()},content:yA})}if(Qe.length)if(be?.category==="peer"){let Ee=Qe[0]?.content?.[0];Ee&&oA.push(Ee)}else oA.push({tag:"participants",attrs:{},content:Qe});let gr={tag:"message",attrs:{id:Xe,to:Me,type:Re(Ie),...be||{}},content:oA};if(je?qr(Me)?(gr.attrs.to=Me,gr.attrs.participant=je.jid):ft(je.jid,bA)?(gr.attrs.to=je.jid,gr.attrs.recipient=Me):gr.attrs.to=je.jid:gr.attrs.to=Me,Ue&&(gr.content.push({tag:"device-identity",attrs:{},content:Zf(I.creds.account,!0)}),t.debug({jid:fe},"adding device identity")),!fr&&!ke&&FA?.messageContextInfo?.messageSecret&&zb(FA))try{let Ee=Ph(FA),he={id:Xe,fromMe:!0,remoteJid:Me,participant:je?.jid},ye=await $ne(Ee,FA,he);ye&&(gr.content.push(ye),t.trace({jid:fe},"added reporting token to message"))}catch(Ee){t.warn({jid:fe,trace:Ee?.stack},"failed to attach reporting token")}let wo=be?.category==="peer",io=!ot&&!ke&&!wA&&!fr&&!wo,Ae=io?await ag(Me,L):Me,$=(io?await I.keys.get("tctoken",[Ae]):{})[Ae],re=$?.token;if(re?.length&&Bp($?.timestamp)){t.debug({jid:Me,timestamp:$?.timestamp},"tctoken expired, clearing"),re=void 0;let Ee=$?.senderTimestamp!==void 0?{token:Buffer.alloc(0),senderTimestamp:$.senderTimestamp}:null;try{await I.keys.set({tctoken:{[Ae]:Ee}})}catch(he){t.debug({jid:Me,err:he?.message},"failed to persist tctoken expiry cleanup")}}re?.length&&g.serverProps.privacyTokenOn1to1&&gr.content.push({tag:"tctoken",attrs:{},content:re}),uA&&uA.length>0&&gr.content.push(...uA),t.debug({msgId:Xe},`sending message to ${Qe.length} devices`),await m(gr);let se=!!Si(Ie)?.protocolMessage,we=Me===h$||u$(Me)||Mh(Me);if(io&&!se&&!we&&rge($?.senderTimestamp)&&!U.has(Ae)){U.add(Ae);let Ee=vi(),he=B.lidMapping.getPNForLID.bind(B.lidMapping);tQ(Me,g.serverProps.lidTrustedTokenIssueToLid,L,he).then(ye=>Je([ye],Ee)).then(async ye=>{await TE({result:ye,fallbackJid:Ae,keys:I.keys,getLIDForPN:L});let IA=(await I.keys.get("tctoken",[Ae]))[Ae],yA=await _E(I.keys,[Ae]);await I.keys.set({tctoken:{[Ae]:{token:Buffer.alloc(0),...IA,senderTimestamp:Ee},...yA}})}).catch(ye=>{t.debug({jid:Me,err:ye?.message},"fire-and-forget tctoken issuance failed")}).finally(()=>{U.delete(Ae)})}z&&!je&&z.addRecentMessage(Me,Xe,Ie)},bA),Xe},Re=fe=>{let Ie=Si(fe);return Ie?Ie.reactionMessage||Ie.encReactionMessage?"reaction":Ie.pollCreationMessage||Ie.pollCreationMessageV2||Ie.pollCreationMessageV3||Ie.pollUpdateMessage?"poll":Ie.eventMessage?"event":Ne(Ie)!==""?"media":"text":"text"},Ne=fe=>fe.imageMessage?"image":fe.videoMessage?fe.videoMessage.gifPlayback?"gif":"video":fe.audioMessage?fe.audioMessage.ptt?"ptt":"audio":fe.contactMessage?"vcard":fe.documentMessage?"document":fe.contactsArrayMessage?"contact_array":fe.liveLocationMessage?"livelocation":fe.stickerMessage?"sticker":fe.listMessage?"list":fe.listResponseMessage?"list_response":fe.buttonsResponseMessage?"buttons_response":fe.orderMessage?"order":fe.productMessage?"product":fe.interactiveResponseMessage?"native_flow_response":fe.groupInviteMessage?"url":"",Je=async(fe,Ie)=>{let Xe=(Ie??vi()).toString();return await Q({tag:"iq",attrs:{to:OA,type:"set",xmlns:"privacy"},content:[{tag:"tokens",attrs:{},content:fe.map(be=>({tag:"token",attrs:{jid:BA(be),t:Xe,type:"trusted_contact"}}))}]})},ve=Yne(n,H),tA=vL(c,"messages.media-update");return R(()=>{!n.userDevicesCache&&F.close&&F.close(),G=void 0,z&&z.clear()}),{...g,userDevicesCache:F,devicesMutex:q,issuePrivacyTokens:Je,assertSessions:De,relayMessage:Be,sendReceipt:N,sendReceipts:k,readMessages:J,refreshMediaConn:H,getMediaHost:()=>V,waUploadToServer:ve,fetchPrivacySettings:y,sendPeerDataOperationMessage:oe,createParticipantNodes:Se,getUSyncDevices:X,messageRetryManager:z,updateMemberLabel:ie,updateMediaMessage:async fe=>{let Ie=ase(fe.message),Xe=Ie.mediaKey,je=I.creds.me.id,be=Jne(fe.key,Xe,je),uA;if(await Promise.all([m(be),tA(async EA=>{let aA=EA.find(Ze=>Ze.key.id===fe.key.id);if(aA){if(aA.error)uA=aA.error;else try{let Ze=zne(aA.media,Xe,aA.key.id);if(Ze.result!==ne.MediaRetryNotification.ResultType.SUCCESS){let bA=ne.MediaRetryNotification.ResultType[Ze.result];throw new YE.Boom(`Media re-upload failed by device (${bA})`,{data:Ze,statusCode:zU(Ze.result)||404})}Ie.directPath=Ze.directPath,Ie.url=jf(Ie.directPath,V),t.debug({directPath:Ze.directPath,key:aA.key},"media update successful")}catch(Ze){uA=Ze}return!0}})]),uA)throw uA;return c.emit("messages.update",[{key:fe.key,update:{message:fe.message}}]),fe},sendMessage:async(fe,Ie,Xe={})=>{let je=I.creds.me.id;if(typeof Ie=="object"&&"disappearingMessagesInChat"in Ie&&typeof Ie.disappearingMessagesInChat<"u"&&qr(fe)){let{disappearingMessagesInChat:be}=Ie;await _(fe,typeof be=="boolean"?be?Vf:0:be)}else{let be=await tse(fe,Ie,{logger:t,userJid:je,getUrlInfo:Ue=>tge(Ue,{thumbnailWidth:o,fetchOpts:{timeout:3e3,...e||{}},logger:t,uploadImage:a?ve:void 0}),getProfilePicUrl:g.profilePictureUrl,getCallLink:g.createCallLink,upload:ve,mediaCache:n.mediaCache,options:n.options,messageId:Vr(g.user?.id),...Xe}),uA="event"in Ie&&!!Ie.event,EA="delete"in Ie&&!!Ie.delete,aA="edit"in Ie&&!!Ie.edit,Ze="pin"in Ie&&!!Ie.pin,bA="poll"in Ie&&!!Ie.poll,Ce={},ke=[];return EA?qr(Ie.delete?.remoteJid)&&!Ie.delete?.fromMe?Ce.edit="8":Ce.edit="7":aA?Ce.edit="1":Ze?Ce.edit="2":bA?ke.push({tag:"meta",attrs:{polltype:"creation"}}):uA&&ke.push({tag:"meta",attrs:{event_type:"creation"}}),await Be(fe,be.message,{messageId:be.key.id,useCachedGroupMetadata:Xe.useCachedGroupMetadata,additionalAttributes:Ce,statusJidList:Xe.statusJidList,additionalNodes:ke}),n.emitOwnEvents&&process.nextTick(async()=>{await p.mutex(()=>f(be,"append"))}),be}}}};var vXe=new Set(Object.values(iI));function PXe(n){return typeof n=="string"&&vXe.has(n)}var $Ie=n=>{let{logger:t,retryRequestDelayMs:o,maxMsgRetryCount:a,getMessage:e,shouldIgnoreJid:i,enableAutoSessionRecreation:A}=n,r=XIe(n),{userDevicesCache:s,devicesMutex:g,ev:c,authState:I,ws:p,messageMutex:B,notificationMutex:f,receiptMutex:Q,signalRepository:y,query:m,upsertMessage:T,resyncAppState:_,onUnexpectedError:R,assertSessions:L,sendNode:U,relayMessage:F,sendReceipt:q,uploadPreKeys:z,sendPeerDataOperationMessage:K,messageRetryManager:G,registerSocketEndHandler:V,issuePrivacyTokens:H,fetchAccountReachoutTimelock:N,placeholderResendCache:k}=r,J=y.lidMapping.getLIDForPN.bind(y.lidMapping),X=pc(),ie=n.msgRetryCounterCache||new sc({stdTTL:NI.MSG_RETRY,useClones:!1}),De=n.callOfferCache||new sc({stdTTL:NI.CALL_OFFER,useClones:!1}),oe=new sc({stdTTL:5,useClones:!1}),Se=!1,Be=async(Ae,W,$)=>{if(!I.creds.me?.id)throw new dQ.Boom("Not authenticated");let re={historySyncOnDemandRequest:{chatJid:W.remoteJid,oldestMsgFromMe:W.fromMe,oldestMsgId:W.id,oldestMsgTimestampMs:$,onDemandMsgCount:Ae},peerDataOperationRequestType:ne.Message.PeerDataOperationRequestType.HISTORY_SYNC_ON_DEMAND};return K(re)},Re=async(Ae,W)=>{if(!I.creds.me?.id)throw new dQ.Boom("Not authenticated");if(await k.get(Ae?.id)){t.debug({messageKey:Ae},"already requested resend");return}else await k.set(Ae?.id,W||!0);if(await ZB(2e3),!await k.get(Ae?.id))return t.debug({messageKey:Ae},"message received while resend requested"),"RESOLVED";let $={placeholderMessageResendRequest:[{messageKey:Ae}],peerDataOperationRequestType:ne.Message.PeerDataOperationRequestType.PLACEHOLDER_MESSAGE_RESEND};return setTimeout(async()=>{await k.get(Ae?.id)&&(t.debug({messageKey:Ae},"PDO message without response after 8 seconds. Phone possibly offline"),await k.del(Ae?.id))},8e3),K($)},Ne=async Ae=>{let W=le(Ae,"update");if(W){let $=W.attrs?.op_name;if(!$){t.warn({node:Jn(Ae)},"mex notification missing op_name, fallback to legacy"),await tA(Ae);return}let re;try{re=JSON.parse(W.content.toString())}catch(we){t.error({err:we,opName:$},"failed to parse mex notification JSON");return}if(re.errors?.length){t.warn({errors:re.errors,opName:$},"mex notification has GQL errors");return}let se=re.data;if(!se){t.warn({opName:$},"mex notification has null data");return}switch(t.debug({opName:$},"processing mex notification"),$){case"NotificationUserReachoutTimelockUpdate":Je(se);break;case"MessageCappingInfoNotification":ve(se);break;case"NotificationNewsletterUpdate":case"NotificationLinkedProfilesUpdates":case"NotificationNewsletterAdminPromote":case"NotificationNewsletterAdminDemote":case"NotificationNewsletterUserSettingChange":case"NotificationNewsletterJoin":case"NotificationNewsletterLeave":case"NotificationNewsletterStateChange":case"NotificationNewsletterAdminMetadataUpdate":case"NotificationNewsletterOwnerUpdate":case"NotificationNewsletterAdminInviteRevoke":case"NotificationNewsletterWamoSubStatusChange":case"NotificationNewsletterBlockUser":case"NotificationNewsletterPaidPartnership":case"NotificationNewsletterMilestone":case"NewsletterResponseStateUpdate":await tA(Ae);break;default:t.debug({opName:$},"unhandled mex notification");break}return}await tA(Ae)},Je=Ae=>{let W=Ae.xwa2_notify_account_reachout_timelock;if(!W){t.warn("reachout timelock notification missing payload");return}if(!W.is_active){t.info("reachout timelock restriction lifted"),c.emit("connection.update",{reachoutTimeLock:{isActive:!1,enforcementType:iI.DEFAULT}});return}let $=W.time_enforcement_ends?new Date(parseInt(W.time_enforcement_ends,10)*1e3):new Date(Date.now()+6e4),re=PXe(W.enforcement_type)?W.enforcement_type:iI.DEFAULT;t.info({enforcementType:re,timeEnforcementEnds:$},"reachout timelock restriction set"),c.emit("connection.update",{reachoutTimeLock:{isActive:!0,timeEnforcementEnds:$,enforcementType:re}})},ve=Ae=>{let W=Ae.xwa2_notify_new_chat_messages_capping_info_update;if(!W){t.warn("message capping notification missing payload");return}t.info({payload:W},"received message capping update"),c.emit("message-capping.update",W)},tA=async Ae=>{let W=le(Ae,"mex"),$=W?.content?null:le(Ae,"update")||Gs(Ae)[0],re=W?.content?W:$;if(!re?.content){t.warn({node:Jn(Ae)},"invalid mex newsletter notification");return}let se;try{let he=re.content;if(Array.isArray(he)){t.warn({payloadNode:re},"invalid mex newsletter notification payload format");return}let ye=typeof he=="string"?Buffer.from(he,"binary"):Buffer.from(he);se=JSON.parse(ye.toString())}catch(he){t.error({err:he,node:Jn(Ae)},"failed to parse mex newsletter notification");return}let we=se?.operation??re?.attrs?.op_name,Ee=se?.updates;if(!Ee){let he=se?.data?.xwa2_notify_linked_profiles;he&&(Ee=[he])}if(!Ee||!we){t.warn({data:se},"invalid mex newsletter notification content");return}switch(t.info({operation:we,updates:Ee},"got mex newsletter notification"),we){case"NotificationNewsletterUpdate":for(let he of Ee)he.jid&&he.settings&&Object.keys(he.settings).length>0&&c.emit("newsletter-settings.update",{id:he.jid,update:he.settings});break;case"NotificationNewsletterAdminPromote":for(let he of Ee)he.jid&&he.user&&c.emit("newsletter-participants.update",{id:he.jid,author:Ae.attrs.from,user:he.user,new_role:"ADMIN",action:"promote"});break;case"NotificationLinkedProfilesUpdates":for(let he of Ee){let ye=he?.jid,qe=Array.isArray(he?.added_profiles)?he.added_profiles:[],IA=[];for(let yA of qe){let $A=typeof yA=="string"?yA:yA?.pn??yA?.jid??null;if(ye&&$A){let vA={lid:ye,pn:$A};c.emit("lid-mapping.update",vA),IA.push(vA)}}await y.lidMapping.storeLIDPNMappings(IA)}break;default:t.info({operation:we,data:se},"unhandled mex newsletter notification");break}},fe=async Ae=>{let W=Ae.attrs.from,$=Gs(Ae),re=Ae.attrs.participant;for(let se of $)switch(t.debug({from:W,child:se},"got newsletter notification"),se.tag){case"reaction":{let we={id:W,server_id:se.attrs.message_id,reaction:{code:jA(se,"reaction"),count:1}};c.emit("newsletter.reaction",we);break}case"view":{let we={id:W,server_id:se.attrs.message_id,count:parseInt(se.content?.toString()||"0",10)};c.emit("newsletter.view",we);break}case"participant":{let we={id:W,author:re,user:se.attrs.jid,action:se.attrs.action,new_role:se.attrs.role};c.emit("newsletter-participants.update",we);break}case"update":{let we=le(se,"settings");if(we){let Ee={},he=le(we,"name");he?.content&&(Ee.name=he.content.toString());let ye=le(we,"description");ye?.content&&(Ee.description=ye.content.toString()),c.emit("newsletter-settings.update",{id:W,update:Ee})}break}case"message":{let we=le(se,"plaintext");if(we?.content)try{let Ee=typeof we.content=="string"?Buffer.from(we.content,"binary"):Buffer.from(we.content),he=ne.Message.decode(Ee).toJSON(),ye=ne.WebMessageInfo.fromObject({key:{remoteJid:W,id:se.attrs.message_id||se.attrs.server_id,fromMe:!1},message:he,messageTimestamp:+se.attrs.t}).toJSON();await T(ye,"append"),t.debug("Processed plaintext newsletter message")}catch(Ee){t.error({error:Ee},"Failed to decode plaintext newsletter message")}break}default:t.warn({node:Ae,child:se},"Unknown newsletter notification child");break}},Ie=async(Ae,W)=>{let $=Ige(Ae,W,I.creds.me.id);t.debug({recv:{tag:Ae.tag,attrs:Ae.attrs},sent:$.attrs},"sent ack"),await U($)},Xe=async(Ae,W)=>{let $={tag:"call",attrs:{from:I.creds.me.id,to:W},content:[{tag:"reject",attrs:{"call-id":Ae,"call-creator":W,count:"0"},content:void 0}]};await m($)},je=async(Ae,W=!1)=>{let{fullMessage:$}=GL(Ae,I.creds.me.id,I.creds.me.lid||""),{key:re}=$,se=re.id;if(G){if(G.hasExceededMaxRetries(se)){t.debug({msgId:se},"reached retry limit with new retry manager, clearing"),G.markRetryFailed(se);return}let YA=G.incrementRetryCount(se),At=`${se}:${re?.participant}`;await ie.set(At,YA)}else{let YA=`${se}:${re?.participant}`,At=await ie.get(YA)||0;if(At>=a){t.debug({retryCount:At,msgId:se},"reached retry limit, clearing"),await ie.del(YA);return}At+=1,await ie.set(YA,At)}let we=`${se}:${re?.participant}`,Ee=await ie.get(we)||1,{account:he,signedPreKey:ye,signedIdentityKey:qe}=I.creds,IA=Ae.attrs.from,yA=!1,$A="";if(A&&G&&Ee>1)try{let YA=y.jidToSignalProtocolAddress(IA),At=await y.validateSession(IA),Ge=G.shouldRecreateSession(IA,At.exists);yA=Ge.recreate,$A=Ge.reason,yA&&(t.debug({fromJid:IA,retryCount:Ee,reason:$A},"recreating session for retry"),await I.keys.set({session:{[YA]:null}}),W=!0)}catch(YA){t.warn({error:YA,fromJid:IA},"failed to check session recreation")}if(Ee<=2)if(G)G.schedulePhoneRequest(se,async()=>{try{let YA=await Re(re);t.debug(`sendRetryRequest: requested placeholder resend (${YA}) for message ${se} (scheduled)`)}catch(YA){t.warn({error:YA,msgId:se},"failed to send scheduled phone request")}});else{let YA=await Re(re);t.debug(`sendRetryRequest: requested placeholder resend for message ${YA}`)}let vA=Zf(he,!0);await I.keys.transaction(async()=>{let YA={tag:"receipt",attrs:{id:se,type:"retry",to:Ae.attrs.from},content:[{tag:"retry",attrs:{count:Ee.toString(),id:Ae.attrs.id,t:Ae.attrs.t,v:"1",error:"0"}},{tag:"registration",attrs:{},content:Zg(I.creds.registrationId)}]};if(Ae.attrs.recipient&&(YA.attrs.recipient=Ae.attrs.recipient),Ae.attrs.participant&&(YA.attrs.participant=Ae.attrs.participant),Ee>1||W||yA){let{update:At,preKeys:Ge}=await iH(I,1),[rA]=Object.keys(Ge),tt=Ge[+rA];YA.content.push({tag:"keys",attrs:{},content:[{tag:"type",attrs:{},content:Buffer.from(Wg)},{tag:"identity",attrs:{},content:qe.public},rH(tt,+rA),Wf(ye),{tag:"device-identity",attrs:{},content:vA}]}),c.emit("creds.update",At)}await U(YA),t.info({msgAttrs:Ae.attrs,retryCount:Ee},"sent retry receipt")},I?.creds?.me?.id||"sendRetryRequest")},be=new Set,uA=Ae=>{(async()=>{let W=BA(Ae),$=await ag(W,J),se=(await I.keys.get("tctoken",[$]))?.[$]?.senderTimestamp;if(se==null||Bp(se))return;t.debug({jid:W,senderTimestamp:se},"identity changed, re-issuing tctoken");let we=y.lidMapping.getPNForLID.bind(y.lidMapping),Ee=await tQ(W,r.serverProps.lidTrustedTokenIssueToLid,J,we),he=await H([Ee],se);await TE({result:he,fallbackJid:$,keys:I.keys,getLIDForPN:J,onNewJidStored:_A})})().catch(W=>{t.debug({jid:Ae,err:W?.message},"failed to re-issue tctoken after identity change")})},EA=async Ae=>{if(Ae.attrs.from===OA){let $=Ae.attrs.id;if($&&be.has($))return;let se=+le(Ae,"count").attrs.value,we=se{let re=Ae.attrs.participant,se=Ae.attrs.participant_pn,we=Ae.attrs.participant_username,Ee=le(W,"participant")?.attrs?.jid||re,he=le(W,"participant")?.attrs?.phone_number||se;switch(W?.tag){case"create":let ye=xE(W);$.messageStubType=RA.GROUP_CREATE,$.messageStubParameters=[ye.subject],$.key={participant:ye.owner,participantAlt:ye.ownerPn},c.emit("chats.upsert",[{id:ye.id,name:ye.subject,conversationTimestamp:ye.creation}]),c.emit("groups.upsert",[{...ye,author:re,authorPn:se,authorUsername:we}]);break;case"ephemeral":case"not_ephemeral":$.message={protocolMessage:{type:ne.Message.ProtocolMessage.Type.EPHEMERAL_SETTING,ephemeralExpiration:+(W.attrs.expiration||0)}};break;case"modify":let qe=PA(W,"participant").map(Ge=>Ge.attrs.jid);$.messageStubParameters=qe||[],$.messageStubType=RA.GROUP_PARTICIPANT_CHANGE_NUMBER;break;case"promote":case"demote":case"remove":case"add":case"leave":let IA=`GROUP_PARTICIPANT_${W.tag.toUpperCase()}`;$.messageStubType=RA[IA];let yA=PA(W,"participant").map(({attrs:Ge})=>({id:Ge.jid,phoneNumber:qA(Ge.jid)&&Rt(Ge.phone_number)?Ge.phone_number:void 0,lid:Rt(Ge.jid)&&qA(Ge.lid)?Ge.lid:void 0,username:Ge.participant_username||Ge.username||void 0,admin:Ge.type||null}));yA.length===1&&(ft(yA[0].id,re)||ft(yA[0].id,se))&&W.tag==="remove"&&($.messageStubType=RA.GROUP_PARTICIPANT_LEAVE),$.messageStubParameters=yA.map(Ge=>JSON.stringify(Ge));break;case"subject":$.messageStubType=RA.GROUP_CHANGE_SUBJECT,$.messageStubParameters=[W.attrs.subject];break;case"description":let $A=le(W,"body")?.content?.toString();$.messageStubType=RA.GROUP_CHANGE_DESCRIPTION,$.messageStubParameters=$A?[$A]:void 0;break;case"announcement":case"not_announcement":$.messageStubType=RA.GROUP_CHANGE_ANNOUNCE,$.messageStubParameters=[W.tag==="announcement"?"on":"off"];break;case"locked":case"unlocked":$.messageStubType=RA.GROUP_CHANGE_RESTRICT,$.messageStubParameters=[W.tag==="locked"?"on":"off"];break;case"invite":$.messageStubType=RA.GROUP_CHANGE_INVITE_LINK,$.messageStubParameters=[W.attrs.code];break;case"member_add_mode":let vA=W.content;vA&&($.messageStubType=RA.GROUP_MEMBER_ADD_MODE,$.messageStubParameters=[vA.toString()]);break;case"membership_approval_mode":let YA=le(W,"group_join");YA&&($.messageStubType=RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_MODE,$.messageStubParameters=[YA.attrs.state]);break;case"created_membership_requests":$.messageStubType=RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD,$.messageStubParameters=[JSON.stringify({lid:Ee,pn:he}),"created",W.attrs.request_method];break;case"revoked_membership_requests":let At=ft(Ee,re);$.messageStubType=RA.GROUP_MEMBERSHIP_JOIN_APPROVAL_REQUEST_NON_ADMIN_ADD,$.messageStubParameters=[JSON.stringify({lid:Ee,pn:he}),At?"revoked":"rejected"];break}},Ze=async Ae=>{let[W]=Gs(Ae),$=BA(Ae.attrs.from);if(!W){t.debug({from:$},"devices notification missing child, skipping");return}let re=W.tag,se=W.attrs.device_hash,we=PA(W,"device");if(ft($,I.creds.me.id)||ft($,I.creds.me.lid)){let he=we.map(ye=>ye.attrs.jid);t.info({deviceJids:he},"got my own devices")}if(!we.length){t.debug({from:$,tag:re},"no devices in notification, skipping");return}let Ee=[];for(let he of we){let ye=he.attrs.jid;if(!ye)continue;let qe=pA(ye);if(!qe){t.debug({jid:ye},"failed to decode device jid, skipping");continue}Ee.push({jid:ye,user:qe.user,server:qe.server,device:qe.device})}Ee.length&&await g.mutex(async()=>{let he=new Map;for(let ye of Ee){let qe=he.get(ye.user)||[];qe.push(ye),he.set(ye.user,qe)}for(let[ye,qe]of he){if(re==="update"){t.debug({user:ye},`${ye}'s device list updated, dropping cached devices`),await s?.del(ye);continue}re==="remove"&&await y.deleteSession(qe.map(vA=>vA.jid));let IA=await s?.get(ye)||[];if(!IA.length){t.debug({user:ye,tag:re},"device list not cached, deferring to USync refresh");continue}let yA=new Set(qe.map(vA=>vA.device)),$A;switch(re){case"add":t.info({deviceHash:se,count:qe.length},"devices added"),$A=[...IA.filter(vA=>!yA.has(vA.device)),...qe.map(vA=>({user:vA.user,server:vA.server,device:vA.device}))];break;case"remove":t.info({deviceHash:se,count:qe.length},"devices removed"),$A=IA.filter(vA=>!yA.has(vA.device));break;default:t.debug({tag:re},"Unknown device list change tag");continue}$A.length===0?await s?.del(ye):await s?.set(ye,$A)}})},bA=async Ae=>{let W={},[$]=Gs(Ae),re=Ae.attrs.type,se=BA(Ae.attrs.from);switch(re){case"newsletter":await fe(Ae);break;case"mex":await Ne(Ae);break;case"w:gp2":aA(Ae,$,W);break;case"mediaretry":let we=qne(Ae);c.emit("messages.media-update",[we]);break;case"encrypt":await EA(Ae);break;case"devices":try{await Ze(Ae)}catch(Oo){t.error({error:Oo,node:Ae},"failed to handle devices notification")}break;case"server_sync":let Ee=le(Ae,"collection");if(Ee){let Oo=Ee.attrs.name;await _([Oo],!1)}break;case"picture":let he=le(Ae,"set"),ye=le(Ae,"delete");if(c.emit("contacts.update",[{id:BA(Ae?.attrs?.from)||(he||ye)?.attrs?.hash||"",imgUrl:he?"changed":"removed"}]),qr(se)){let Oo=he||ye;W.messageStubType=RA.GROUP_CHANGE_ICON,he&&(W.messageStubParameters=[he.attrs.id]),W.participant=Oo?.attrs.author,W.key={...W.key||{},participant:he?.attrs.author}}break;case"account_sync":if($.tag==="disappearing_mode"){let Oo=+$.attrs.duration,Tp=+$.attrs.t;t.info({newDuration:Oo},"updated account disappearing mode"),c.emit("creds.update",{accountSettings:{...I.creds.accountSettings,defaultDisappearingMode:{ephemeralExpiration:Oo,ephemeralSettingTimestamp:Tp}}})}else if($.tag==="blocklist"){let Oo=PA($,"item");for(let{attrs:Tp}of Oo){let A_=[Tp.jid],t_=Tp.action==="block"?"add":"remove";c.emit("blocklist.update",{blocklist:A_,type:t_})}}break;case"link_code_companion_reg":let qe=le(Ae,"link_code_companion_reg"),IA=ht(ki(qe,"link_code_pairing_ref")),yA=ht(ki(qe,"primary_identity_pub")),$A=ht(ki(qe,"link_code_pairing_wrapped_primary_ephemeral_pub")),vA=await wA($A),YA=br.sharedKey(I.creds.pairingEphemeralKeyPair.private,vA),At=vK(32),Ge=vK(32),rA=Vn(YA,32,{salt:Ge,info:"link_code_pairing_key_bundle_encryption_key"}),tt=Buffer.concat([Buffer.from(I.creds.signedIdentityKey.public),yA,At]),Ai=vK(12),cr=Jl(tt,rA,Ai,Buffer.alloc(0)),Do=Buffer.concat([Ge,Ai,cr]),$M=br.sharedKey(I.creds.signedIdentityKey.private,yA),e_=Buffer.concat([YA,$M,At]);I.creds.advSecretKey=Buffer.from(Vn(e_,32,{info:"adv_secret"})).toString("base64"),await m({tag:"iq",attrs:{to:OA,type:"set",id:r.generateMessageTag(),xmlns:"md"},content:[{tag:"link_code_companion_reg",attrs:{jid:I.creds.me.id,stage:"companion_finish"},content:[{tag:"link_code_pairing_wrapped_key_bundle",attrs:{},content:Do},{tag:"companion_identity_public",attrs:{},content:I.creds.signedIdentityKey.public},{tag:"link_code_pairing_ref",attrs:{},content:IA}]}]}),I.creds.registered=!0,c.emit("creds.update",I.creds);break;case"privacy_token":await ot(Ae);break}if(Object.keys(W).length)return W},Ce=new Set,ke=(async()=>{try{let Ae=await rM(I.keys);for(let W of Ae)Ce.add(W);t.debug({count:Ce.size},"loaded tctoken index")}catch(Ae){t.warn({err:Ae?.message},"failed to load tctoken index")}})(),Ue;async function MA(){Ue&&(clearTimeout(Ue),Ue=void 0);let Ae=await _E(I.keys,Ce);return I.keys.set({tctoken:Ae})}function Ke(){Ue&&clearTimeout(Ue),Ue=setTimeout(()=>{Ue=void 0,MA().catch(Ae=>{t.warn({err:Ae?.message},"failed to save tctoken index")})},5e3)}function _A(Ae){Ae&&Ae!==RI&&!Ce.has(Ae)&&(Ce.add(Ae),Ke())}let ot=async Ae=>{if(!le(Ae,"tokens"))return;let $=BA(Ae.attrs.from),se=(Ae.attrs.sender_lid&&qA(BA(Ae.attrs.sender_lid))?BA(Ae.attrs.sender_lid):void 0)??await ag($,J);t.debug({from:$,storageJid:se},"processing privacy token notification"),await TE({result:Ae,fallbackJid:se,keys:I.keys,getLIDForPN:J,onNewJidStored:_A})};async function wA(Ae){let W=ht(Ae),$=W.slice(0,32),re=await KD(I.creds.pairingCode,$),se=W.slice(32,48),we=W.slice(48,80);return Y$(we,re,se)}function ht(Ae){if(Ae===void 0)throw new dQ.Boom("Invalid buffer",{statusCode:400});return Ae instanceof Buffer?Ae:Buffer.from(Ae)}let fr=async(Ae,W)=>{let $=`${Ae}:${W}`;return(await ie.get($)||0){let $=`${Ae}:${W}`,re=(await ie.get($)||0)+1;await ie.set($,re)},pe=async(Ae,W,$,re)=>{let se=Ae.remoteJid,we=Ae.participant||se,Ee=+$.attrs.count||1,he=W[0],ye=[];for(let Ge of W){let rA;if(G){let tt=G.getRecentMessage(se,Ge);tt&&(rA=tt.message,t.debug({jid:se,id:Ge},"found message in retry cache"),G.markRetrySuccess(Ge))}rA||(rA=await e({...Ae,id:Ge}),rA&&(t.debug({jid:se,id:Ge},"found message via getMessage"),G&&G.markRetrySuccess(Ge))),ye.push(rA)}let qe=!pA(we)?.device,IA=y.jidToSignalProtocolAddress(we),yA=!1,$A=Ise(re);if($A)try{await y.injectE2ESession({jid:we,session:$A}),yA=!0,t.debug({participant:we,retryCount:Ee},"injected session from retry receipt key bundle")}catch(Ge){t.warn({error:Ge,participant:we},"failed to inject session from retry receipt")}if(!yA){let Ge=oI(re,"registration",4);if(typeof Ge=="number"&&Number.isInteger(Ge)){let rA=await y.getSessionInfo(we);rA&&rA.registrationId!==0&&rA.registrationId!==Ge&&(t.info({participant:we,stored:rA.registrationId,received:Ge},"reg id mismatch on retry without bundle, deleting session"),await I.keys.set({session:{[IA]:null}}))}}let vA=2;if(he&&G){let Ge=await y.getSessionInfo(we);Ge&&(Ee===vA?G.saveBaseKey(IA,he,Ge.baseKey):Ee>vA&&(G.hasSameBaseKey(IA,he,Ge.baseKey)&&(t.warn({participant:we,retryCount:Ee},"base key collision on retry, forcing fresh session"),await I.keys.set({session:{[IA]:null}})),G.deleteBaseKey(IA,he)))}let YA=!1,At="";if(A&&G&&Ee>1&&!yA)try{let Ge=await y.validateSession(we),rA=G.shouldRecreateSession(we,Ge.exists);YA=rA.recreate,At=rA.reason,YA&&(t.debug({participant:we,retryCount:Ee,reason:At},"recreating session for outgoing retry"),await I.keys.set({session:{[IA]:null}}))}catch(Ge){t.warn({error:Ge,participant:we},"failed to check session recreation for outgoing retry")}yA||await L([we],!0),qr(se)&&await I.keys.set({"sender-key-memory":{[se]:null}}),t.debug({participant:we,sendToAll:qe,shouldRecreateSession:YA,recreateReason:At,injectedFromBundle:yA},"prepared session for retry resend");for(let[Ge,rA]of ye.entries())if(W[Ge])if(rA&&await fr(W[Ge],we)){await UA(W[Ge],we);let tt={messageId:W[Ge]};qe?tt.useUserDevicesCache=!1:tt.participant={jid:we,count:+$.attrs.count},await F(Ae.remoteJid,rA,tt)}else t.debug({jid:Ae.remoteJid,id:W[Ge]},"recv retry request, but message not available")},Qe=async Ae=>{let{attrs:W,content:$}=Ae,re=W.from.includes("lid"),se=ft(W.participant||W.from,re?I.creds.me?.lid:I.creds.me?.id),we=!se||qr(W.from)?W.from:W.recipient,Ee=!W.recipient||(W.type==="retry"||W.type==="sender")&&se,he={remoteJid:we,id:"",fromMe:Ee,participant:W.participant},ye=[W.id];if(Array.isArray($)){let qe=PA($[0],"item");ye.push(...qe.map(IA=>IA.attrs.id))}try{await Promise.all([Q.mutex(async()=>{let qe=tee(W.type);if(typeof qe<"u"&&(qe>=ne.WebMessageInfo.Status.SERVER_ACK||!se))if(qr(we)||zg(we)){if(W.participant){let IA=qe===ne.WebMessageInfo.Status.DELIVERY_ACK?"receiptTimestamp":"readTimestamp";c.emit("message-receipt.update",ye.map(yA=>({key:{...he,id:yA},receipt:{userJid:BA(W.participant),[IA]:+W.t}})))}}else c.emit("messages.update",ye.map(IA=>({key:{...he,id:IA},update:{status:qe,messageTimestamp:zr(+(W.t??0))}})));if(W.type==="retry"){he.participant=he.participant||W.from;let IA=le(Ae,"retry");if(ye[0]&&he.participant&&await fr(ye[0],he.participant))if(he.fromMe)try{await UA(ye[0],he.participant),t.debug({attrs:W,key:he},"recv retry request"),await pe(he,ye,IA,Ae)}catch(yA){t.error({key:he,ids:ye,trace:yA instanceof Error?yA.stack:"Unknown error"},"error in sending message again")}else t.info({attrs:W,key:he},"recv retry for not fromMe message");else t.info({attrs:W,key:he},"will not send message again, as sent too many times")}})])}finally{await Ie(Ae).catch(qe=>t.error({ackErr:qe},"failed to ack receipt"))}},Me=async Ae=>{let W=Ae.attrs.from;try{await Promise.all([f.mutex(async()=>{let $=await bA(Ae);if($){let re=ft(Ae.attrs.participant||W,I.creds.me.id),{senderAlt:se,addressingMode:we}=JD(Ae);$.key={remoteJid:W,fromMe:re,participant:Ae.attrs.participant,participantAlt:se,participantUsername:Ae.attrs.participant_username,addressingMode:we,id:Ae.attrs.id,...$.key||{}},$.participant??($.participant=Ae.attrs.participant),$.messageTimestamp=+Ae.attrs.t;let Ee=ne.WebMessageInfo.fromObject($);await T(Ee,"append")}})])}finally{await Ie(Ae).catch($=>t.error({ackErr:$},"failed to ack notification"))}},oA=async Ae=>{if(le(Ae,"enc")?.attrs.type==="msmsg"){t.debug({key:Ae.attrs.key},"ignored msmsg"),await Ie(Ae,Vl.MissingMessageSecret);return}let $=!1;try{let{fullMessage:re,category:se,author:we,decrypt:Ee}=cee(Ae,I.creds.me.id,I.creds.me.lid||"",y,t),he=re.key.participantAlt||re.key.remoteJidAlt;if(he){let ye=pA(he)?.server,qe=re.key.participant||re.key.remoteJid;ye==="lid"?await y.lidMapping.getPNForLID(he)||(await y.lidMapping.storeLIDPNMappings([{lid:he,pn:qe}]),await y.migrateSession(qe,he)):(await y.lidMapping.storeLIDPNMappings([{lid:qe,pn:he}]),await y.migrateSession(he,qe))}await B.mutex(async()=>{if(await Ee(),re.key?.remoteJid&&re.key?.id&&re.message&&G&&G.addRecentMessage(re.key.remoteJid,re.key.id,re.message),re.messageStubType===ne.WebMessageInfo.StubType.CIPHERTEXT&&re.category!=="peer"){if(re?.messageStubParameters?.[0]===see)return $=!0,Ie(Ae,Vl.ParsingError);if(re.messageStubParameters?.[0]===jD){let qe=le(Ae,"unavailable")?.attrs?.type;if(qe==="bot_unavailable_fanout"||qe==="hosted_unavailable_fanout"||qe==="view_once_unavailable_fanout")return t.debug({msgId:re.key.id,unavailableType:qe},"skipping placeholder resend for excluded unavailable type"),$=!0,Ie(Ae);let IA=vi()-zr(re.messageTimestamp);if(IA>DIe)return t.debug({msgId:re.key.id,messageAge:IA},"skipping placeholder resend for old message"),$=!0,Ie(Ae);let yA={remoteJid:re.key.remoteJid,fromMe:re.key.fromMe,id:re.key.id,participant:re.key.participant},$A={key:re.key,messageTimestamp:re.messageTimestamp,pushName:re.pushName,participant:re.participant,verifiedBizName:re.verifiedBizName};Re(yA,$A).then(vA=>{vA&&vA!=="RESOLVED"&&(t.debug({msgId:re.key.id,requestId:vA},"requested placeholder resend for unavailable message"),c.emit("messages.update",[{key:re.key,update:{messageStubParameters:[jD,vA]}}]))}).catch(vA=>{t.warn({err:vA,msgId:re.key.id},"failed to request placeholder resend for unavailable message")}),$=!0,await Ie(Ae)}else{if(zg(re.key.remoteJid)){let ye=vi()-zr(re.messageTimestamp);if(ye>wIe)return t.debug({msgId:re.key.id,messageAge:ye,remoteJid:re.key.remoteJid},"skipping retry for expired status message"),$=!0,Ie(Ae)}t.debug("[handleMessage] Attempting retry request for failed decryption"),await X.mutex(async()=>{try{if(!p.isOpen){t.debug({node:Ae},"Connection closed, skipping retry");return}let ye=le(Ae,"enc");await je(Ae,!ye),o&&await ZB(o)}catch(ye){t.error({err:ye},"Failed to send retry")}$=!0,await Ie(Ae,Vl.UnhandledError)})}}else if(G&&re.key.id&&G.cancelPendingPhoneRequest(re.key.id),aI(re.key.remoteJid))$=!0,await Ie(Ae),t.debug({key:re.key},"processed newsletter message without receipts");else{let qe,IA=re.key.participant;if(se==="peer"?qe="peer_msg":re.key.fromMe?(qe="sender",(qA(re.key.remoteJid)||qA(re.key.remoteJidAlt))&&(IA=we)):Se||(qe="inactive"),$=!0,await q(re.key.remoteJid,IA,[re.key.id],qe),Wb(re.message)){let $A=BA(re.key.remoteJid);await q($A,void 0,[re.key.id],"hist_sync")}}ige(re,I.creds.me.id,I.creds.me.lid),await T(re,Ae.attrs.offline?"append":"notify")})}catch(re){t.error({error:re,node:Jn(Ae)},"error in handling message"),$||await Ie(Ae,Vl.UnhandledError).catch(se=>t.error({ackErr:se},"failed to ack message after error"))}},dA=async Ae=>{try{let{attrs:W}=Ae,[$]=Gs(Ae);if(!$)throw new dQ.Boom("Missing call info in call node");let re=iee($),se=$.attrs["call-id"],we=$.attrs.from||$.attrs["call-creator"],Ee={chatId:W.from,from:we,callerPn:$.attrs.caller_pn,id:se,date:new Date(+W.t*1e3),offline:!!W.offline,status:re};if(re==="relaylatency"){let ye=$.attrs.latency||$.attrs.latency_ms||$.attrs["latency-ms"],qe=ye?Number(ye):void 0;Number.isFinite(qe)&&(Ee.latencyMs=qe)}re==="offer"&&(Ee.isVideo=!!le($,"video"),Ee.isGroup=$.attrs.type==="group"||!!$.attrs["group-jid"],Ee.groupJid=$.attrs["group-jid"],await De.set(Ee.id,Ee));let he=await De.get(Ee.id);he&&(Ee.isVideo=he.isVideo,Ee.isGroup=he.isGroup,Ee.callerPn=Ee.callerPn||he.callerPn),(re==="reject"||re==="accept"||re==="timeout"||re==="terminate")&&await De.del(Ee.id),c.emit("call",[Ee])}catch(W){t.error({error:W,node:Jn(Ae)},"error in handling call")}finally{await Ie(Ae).catch(W=>t.error({ackErr:W},"failed to ack call"))}},FA=async({attrs:Ae})=>{let W={remoteJid:Ae.from,fromMe:!0,id:Ae.id};if(Ae.error){let $=Ae.error===String(Vl.SenderReachoutTimelocked);if(Ae.error===PL.MessageAccountRestriction){t.warn({msgId:Ae.id,from:Ae.from},"error 463: account restricted or missing tctoken for contact");let re=Ae.from;re&&!wo.has(re)&&(wo.add(re),(async()=>{try{let se=y.lidMapping.getPNForLID.bind(y.lidMapping),we=await ag(re,J),Ee=await tQ(re,r.serverProps.lidTrustedTokenIssueToLid,J,se),he=await H([Ee],vi());await TE({result:he,fallbackJid:we,keys:I.keys,getLIDForPN:J,onNewJidStored:_A}),t.debug({from:re},"completed 463 token recovery issuance")}catch(se){t.debug({from:re,err:se?.message},"failed 463 token recovery issuance")}finally{wo.delete(re)}})())}else Ae.error===PL.SmaxInvalid?t.warn({msgId:Ae.id,from:Ae.from},"smax-invalid (479): stanza rejected by server \u2014 likely stale device session or malformed addressing"):$?(await N().catch(re=>t.warn({err:re},"failed to fetch reachout timelock")),t.warn({attrs:Ae},"received error in ack")):t.warn({attrs:Ae},"received error in ack");c.emit("messages.update",[{key:W,update:{status:bh.ERROR,messageStubParameters:$?[Ae.error,gee]:[Ae.error]}}])}},jt=async(Ae,W,$)=>{c.buffer(),await re(),c.flush();function re(){return $(Ae,!1).catch(se=>R(se,W))}},ct=qIe(new Map([["message",oA],["call",dA],["receipt",Qe],["notification",Me]]),{isWsOpen:()=>p.isOpen,onUnexpectedError:R,yieldToEventLoop:()=>new Promise(Ae=>setImmediate(Ae))}),_r=async(Ae,W,$,re)=>{let se=W.attrs.from,we=se;if(Ae==="receipt"&&se){let he=W.attrs,ye=he.from.includes("lid");we=!ft(he.participant||he.from,ye?I.creds.me?.lid:I.creds.me?.id)||qr(he.from)?he.from:he.recipient}if(we&&we!==OA&&i(we)){await Ie(W,Ae==="message"?Vl.UnhandledError:void 0);return}!!W.attrs.offline?ct.enqueue(Ae,W):await jt(W,$,re)};p.on("CB:message",async Ae=>{await _r("message",Ae,"processing message",oA)}),p.on("CB:call",async Ae=>{await _r("call",Ae,"handling call",dA)}),p.on("CB:receipt",async Ae=>{await _r("receipt",Ae,"handling receipt",Qe)}),p.on("CB:notification",async Ae=>{await _r("notification",Ae,"handling notification",Me)}),p.on("CB:ack,class:message",Ae=>{FA(Ae).catch(W=>R(W,"handling bad ack"))}),c.on("call",async([Ae])=>{if(Ae&&(Ae.status==="timeout"||Ae.status==="offer"&&Ae.isGroup)){let W={key:{remoteJid:Ae.chatId,id:Ae.id,fromMe:!1},messageTimestamp:vi(Ae.date)};Ae.status==="timeout"?Ae.isGroup?W.messageStubType=Ae.isVideo?RA.CALL_MISSED_GROUP_VIDEO:RA.CALL_MISSED_GROUP_VOICE:W.messageStubType=Ae.isVideo?RA.CALL_MISSED_VIDEO:RA.CALL_MISSED_VOICE:W.message={call:{callKey:Buffer.from(Ae.id)}};let $=ne.WebMessageInfo.fromObject(W);await T($,Ae.offline?"append":"notify")}});let gr=0,wo=new Set;c.on("connection.update",({isOnline:Ae,connection:W})=>{if(typeof Ae<"u"&&(Se=Ae,t.trace(`sendActiveReceipts set to "${Se}"`)),W==="close"&&Ue){clearTimeout(Ue),Ue=void 0;try{Promise.resolve(MA()).catch(()=>{})}catch{}}if(Ae){let $=Date.now(),re=1440*60*1e3;$-gr>=re&&(gr=$,io())}}),V(()=>{!n.msgRetryCounterCache&&ie.close&&ie.close(),!n.callOfferCache&&De.close&&De.close(),oe.close(),Se=!1});async function io(){try{await ke;let Ae=await rM(I.keys),W=new Set(Ce);for(let he of Ae)W.add(he);if(!W.size)return;let $=[...W],re=await I.keys.get("tctoken",$),se={},we=new Set,Ee=0;for(let he of $){let ye=re[he];if(!ye){Ee++;continue}let qe=!!ye.token?.length,IA=qe&&Bp(ye.timestamp),yA=ye.senderTimestamp!==void 0,$A=yA&&Bp(ye.senderTimestamp),vA=qe&&!IA,YA=yA&&!$A;!vA&&!YA?(se[he]=null,Ee++):IA&&YA?(se[he]={token:Buffer.alloc(0),senderTimestamp:ye.senderTimestamp},we.add(he),Ee++):we.add(he)}if(Ee===0)return;await I.keys.set({tctoken:{...se,[RI]:{token:Buffer.from(JSON.stringify([...we]))}}}),Ce.clear();for(let he of we)Ce.add(he);t.debug({mutated:Ee,remaining:we.size},"pruned expired tctokens")}catch(Ae){t.warn({err:Ae?.message},"failed to prune expired tctokens")}}return{...r,sendMessageAck:Ie,sendRetryRequest:je,rejectCall:Xe,fetchMessageHistory:Be,requestPlaceholderResend:Re,messageRetryManager:G}};var ele=n=>{let t=$Ie(n),{authState:o,query:a,waUploadToServer:e}=t,i=async f=>{let Q=[],y=["address","email","description"];return Q.push(...y.filter(T=>f[T]!==void 0&&f[T]!==null).map(T=>({tag:T,attrs:{},content:f[T]}))),f.websites!==void 0&&Q.push(...f.websites.map(T=>({tag:"website",attrs:{},content:T}))),f.hours!==void 0&&Q.push({tag:"business_hours",attrs:{timezone:f.hours.timezone},content:f.hours.days.map(T=>{let _={tag:"business_hours_config",attrs:{day_of_week:T.day,mode:T.mode}};return T.mode==="specific_hours"?{..._,attrs:{..._.attrs,open_time:T.openTimeInMinutes,close_time:T.closeTimeInMinutes}}:_})}),await a({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz"},content:[{tag:"business_profile",attrs:{v:"3",mutation_type:"delta"},content:Q}]})},A=async f=>{let{fileSha256:Q,filePath:y}=await Yb(f,"biz-cover-photo"),m=Q.toString("base64"),{meta_hmac:T,fbid:_,ts:R}=await e(y,{fileEncSha256B64:m,mediaType:"biz-cover-photo"});return await a({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz"},content:[{tag:"business_profile",attrs:{v:"3",mutation_type:"delta"},content:[{tag:"cover_photo",attrs:{id:String(_),op:"update",token:T,ts:String(R)}}]}]}),_},r=async f=>await a({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz"},content:[{tag:"business_profile",attrs:{v:"3",mutation_type:"delta"},content:[{tag:"cover_photo",attrs:{op:"delete",id:f}}]}]}),s=async({jid:f,limit:Q,cursor:y})=>{f=f||o.creds.me?.id,f=BA(f);let m=[{tag:"limit",attrs:{},content:Buffer.from((Q||10).toString())},{tag:"width",attrs:{},content:Buffer.from("100")},{tag:"height",attrs:{},content:Buffer.from("100")}];y&&m.push({tag:"after",attrs:{},content:y});let T=await a({tag:"iq",attrs:{to:OA,type:"get",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog",attrs:{jid:f,allow_shop_source:"true"},content:m}]});return RIe(T)},g=async(f,Q=51)=>{f=f||o.creds.me?.id,f=BA(f);let y=await a({tag:"iq",attrs:{to:OA,type:"get",xmlns:"w:biz:catalog",smax_id:"35"},content:[{tag:"collections",attrs:{biz_jid:f},content:[{tag:"collection_limit",attrs:{},content:Buffer.from(Q.toString())},{tag:"item_limit",attrs:{},content:Buffer.from(Q.toString())},{tag:"width",attrs:{},content:Buffer.from("100")},{tag:"height",attrs:{},content:Buffer.from("100")}]}]});return kIe(y)},c=async(f,Q)=>{let y=await a({tag:"iq",attrs:{to:OA,type:"get",xmlns:"fb:thrift_iq",smax_id:"5"},content:[{tag:"order",attrs:{op:"get",id:f},content:[{tag:"image_dimensions",attrs:{},content:[{tag:"width",attrs:{},content:Buffer.from("100")},{tag:"height",attrs:{},content:Buffer.from("100")}]},{tag:"token",attrs:{},content:Buffer.from(Q)}]}]});return vIe(y)},I=async(f,Q)=>{Q=await MK(Q,e);let y=bK(f,Q),m=await a({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog_edit",attrs:{v:"1"},content:[y,{tag:"width",attrs:{},content:"100"},{tag:"height",attrs:{},content:"100"}]}]}),T=le(m,"product_catalog_edit"),_=le(T,"product");return lQ(_)},p=async f=>{f.isHidden=!!f.isHidden,f=await MK(f,e);let Q=bK(void 0,f),y=await a({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog_add",attrs:{v:"1"},content:[Q,{tag:"width",attrs:{},content:"100"},{tag:"height",attrs:{},content:"100"}]}]}),m=le(y,"product_catalog_add"),T=le(m,"product");return lQ(T)},B=async f=>{let Q=await a({tag:"iq",attrs:{to:OA,type:"set",xmlns:"w:biz:catalog"},content:[{tag:"product_catalog_delete",attrs:{v:"1"},content:f.map(m=>({tag:"product",attrs:{},content:[{tag:"id",attrs:{},content:Buffer.from(m)}]}))}]});return{deleted:+(le(Q,"product_catalog_delete")?.attrs.deleted_count||0)}};return{...t,logger:n.logger,getOrderDetails:c,getCatalog:s,getCollections:g,productCreate:p,productDelete:B,productUpdate:I,updateBussinesProfile:i,updateCoverPhoto:A,removeCoverPhoto:r}};var Ale=n=>{let t=ele(n),{authState:o,ev:a,query:e,upsertMessage:i}=t,A=async(I,p,B)=>e({tag:"iq",attrs:{type:p,xmlns:"w:g2",to:I},content:B}),r=async I=>{let p=await A(I,"get",[{tag:"query",attrs:{request:"interactive"}}]);return PK(p)},s=async()=>{let I=await e({tag:"iq",attrs:{to:"@g.us",xmlns:"w:g2",type:"get"},content:[{tag:"participating",attrs:{},content:[{tag:"participants",attrs:{}},{tag:"description",attrs:{}}]}]}),p={},B=le(I,"communities");if(B){let f=PA(B,"community");for(let Q of f){let y=PK({tag:"result",attrs:{},content:[Q]});p[y.id]=y}}return t.ev.emit("groups.update",Object.values(p)),p};async function g(I){gQ.info({node:I},"parseGroupResult");let p=le(I,"group");if(p)try{gQ.info({groupNode:p},"groupNode");let B=await t.groupMetadata(`${p.attrs.id}@g.us`);return B||c.empty()}catch(B){return console.error("Error parsing group metadata:",B),c.empty()}return c.empty()}let c={empty:()=>null,of:I=>I!==null?{value:I}:null};return t.ws.on("CB:ib,,dirty",async I=>{let{attrs:p}=le(I,"dirty");p.type==="communities"&&(await s(),await t.cleanDirtyBits("groups"))}),{...t,communityMetadata:r,communityCreate:async(I,p)=>{let B=kL().substring(0,12),f=await A("@g.us","set",[{tag:"create",attrs:{subject:I},content:[{tag:"description",attrs:{id:B},content:[{tag:"body",attrs:{},content:Buffer.from(p||"","utf-8")}]},{tag:"parent",attrs:{default_membership_approval_mode:"request_required"}},{tag:"allow_non_admin_sub_group_creation",attrs:{}},{tag:"create_general_chat",attrs:{}}]}]);return await g(f)},communityCreateGroup:async(I,p,B)=>{let f=Vr(),Q=await A("@g.us","set",[{tag:"create",attrs:{subject:I,key:f},content:[...p.map(y=>({tag:"participant",attrs:{jid:y}})),{tag:"linked_parent",attrs:{jid:B}}]}]);return await g(Q)},communityLeave:async I=>{await A("@g.us","set",[{tag:"leave",attrs:{},content:[{tag:"community",attrs:{id:I}}]}])},communityUpdateSubject:async(I,p)=>{await A(I,"set",[{tag:"subject",attrs:{},content:Buffer.from(p,"utf-8")}])},communityLinkGroup:async(I,p)=>{await A(p,"set",[{tag:"links",attrs:{},content:[{tag:"link",attrs:{link_type:"sub_group"},content:[{tag:"group",attrs:{jid:I}}]}]}])},communityUnlinkGroup:async(I,p)=>{await A(p,"set",[{tag:"unlink",attrs:{unlink_type:"sub_group"},content:[{tag:"group",attrs:{jid:I}}]}])},communityFetchLinkedGroups:async I=>{let p=I,B=!1,f=await t.groupMetadata(I);f.linkedParent?p=f.linkedParent:B=!0;let Q=await A(p,"get",[{tag:"sub_groups",attrs:{}}]),y=[],m=le(Q,"sub_groups");if(m){let T=PA(m,"group");for(let _ of T)y.push({id:_.attrs.id?Dr(_.attrs.id,"g.us"):void 0,subject:_.attrs.subject||"",creation:_.attrs.creation?Number(_.attrs.creation):void 0,owner:_.attrs.creator?BA(_.attrs.creator):void 0,size:_.attrs.size?Number(_.attrs.size):void 0})}return{communityJid:p,isCommunity:B,linkedGroups:y}},communityRequestParticipantsList:async I=>{let p=await A(I,"get",[{tag:"membership_approval_requests",attrs:{}}]),B=le(p,"membership_approval_requests");return PA(B,"membership_approval_request").map(Q=>Q.attrs)},communityRequestParticipantsUpdate:async(I,p,B)=>{let f=await A(I,"set",[{tag:"membership_requests_action",attrs:{},content:[{tag:B,attrs:{},content:p.map(T=>({tag:"participant",attrs:{jid:T}}))}]}]),Q=le(f,"membership_requests_action"),y=le(Q,B);return PA(y,"participant").map(T=>({status:T.attrs.error||"200",jid:T.attrs.jid}))},communityParticipantsUpdate:async(I,p,B)=>{let f=await A(I,"set",[{tag:B,attrs:B==="remove"?{linked_groups:"true"}:{},content:p.map(m=>({tag:"participant",attrs:{jid:m}}))}]),Q=le(f,B);return PA(Q,"participant").map(m=>({status:m.attrs.error||"200",jid:m.attrs.jid,content:m}))},communityUpdateDescription:async(I,p)=>{let f=(await r(I)).descId??null;await A(I,"set",[{tag:"description",attrs:{...p?{id:kL()}:{delete:"true"},...f?{prev:f}:{}},content:p?[{tag:"body",attrs:{},content:Buffer.from(p,"utf-8")}]:void 0}])},communityInviteCode:async I=>{let p=await A(I,"get",[{tag:"invite",attrs:{}}]);return le(p,"invite")?.attrs.code},communityRevokeInvite:async I=>{let p=await A(I,"set",[{tag:"invite",attrs:{}}]);return le(p,"invite")?.attrs.code},communityAcceptInvite:async I=>{let p=await A("@g.us","set",[{tag:"invite",attrs:{code:I}}]);return le(p,"community")?.attrs.jid},communityRevokeInviteV4:async(I,p)=>!!await A(I,"set",[{tag:"revoke",attrs:{},content:[{tag:"participant",attrs:{jid:p}}]}]),communityAcceptInviteV4:a.createBufferedFunction(async(I,p)=>{I=typeof I=="string"?{remoteJid:I}:I;let B=await A(p.groupJid,"set",[{tag:"accept",attrs:{code:p.inviteCode,expiration:p.inviteExpiration.toString(),admin:I.remoteJid}}]);return I.id&&(p=ne.Message.GroupInviteMessage.fromObject(p),p.inviteExpiration=0,p.inviteCode="",a.emit("messages.update",[{key:I,update:{message:{groupInviteMessage:p}}}])),await i({key:{remoteJid:p.groupJid,id:Vr(t.user?.id),fromMe:!1,participant:I.remoteJid},messageStubType:RA.GROUP_PARTICIPANT_ADD,messageStubParameters:[JSON.stringify(o.creds.me)],participant:I.remoteJid,messageTimestamp:vi()},"notify"),B.attrs.from}),communityGetInviteInfo:async I=>{let p=await A("@g.us","get",[{tag:"invite",attrs:{code:I}}]);return PK(p)},communityToggleEphemeral:async(I,p)=>{let B=p?{tag:"ephemeral",attrs:{expiration:p.toString()}}:{tag:"not_ephemeral",attrs:{}};await A(I,"set",[B])},communitySettingUpdate:async(I,p)=>{await A(I,"set",[{tag:p,attrs:{}}])},communityMemberAddMode:async(I,p)=>{await A(I,"set",[{tag:"member_add_mode",attrs:{},content:p}])},communityJoinApprovalMode:async(I,p)=>{await A(I,"set",[{tag:"membership_approval_mode",attrs:{},content:[{tag:"community_join",attrs:{state:p}}]}])},communityFetchAllParticipating:s}},PK=n=>{let t=le(n,"community"),o=le(t,"description"),a,e;o&&(a=jA(o,"body"),e=o.attrs.id);let i=t.attrs.id?.includes("@")?t.attrs.id:Dr(t.attrs.id||"","g.us"),A=le(t,"ephemeral")?.attrs.expiration,r=jA(t,"member_add_mode")==="all_member_add";return{id:i,subject:t.attrs.subject||"",subjectOwner:t.attrs.s_o,subjectTime:Number(t.attrs.s_t||0),size:PA(t,"participant").length,creation:Number(t.attrs.creation||0),owner:t.attrs.creator?BA(t.attrs.creator):void 0,desc:a,descId:e,linkedParent:le(t,"linked_parent")?.attrs.jid||void 0,restrict:!!le(t,"locked"),announce:!!le(t,"announcement"),isCommunity:!!le(t,"parent"),isCommunityAnnounce:!!le(t,"default_sub_community"),joinApprovalMode:!!le(t,"membership_approval_mode"),memberAddMode:r,participants:PA(t,"participant").map(({attrs:g})=>({id:g.jid,admin:g.type||null})),ephemeralDuration:A?+A:void 0,addressingMode:jA(t,"addressing_mode")}};var GXe=n=>{let t={...bIe,...n};return Ale(t)},tle=GXe;var rle=tle;var FXe=Object.freeze({key:"whatsapp",label:"WhatsApp",get connectionLabel(){return w(" Web \u5173\u8054\u8BBE\u5907")},reactions:Object.freeze({processing:"\u{1F440}",success:"\u2705",error:"\u274C"})}),jM=class extends Es{constructor(t){super({...t,descriptor:FXe})}};function LXe(n){return n==="lid"||n==="hosted.lid"}function UXe(n){return n==="s.whatsapp.net"||n==="c.us"||n==="hosted"}function GK(n){if(typeof n!="string"||!n)return!1;let t=pA(n.trim());return!!(t&&LXe(t.server))}function HXe(n){if(typeof n!="string"||!n)return!1;let t=pA(n.trim());return!!(t&&UXe(t.server)&&/^\d+$/.test(t.user))}function KXe(n,t){if(!n||!t||typeof t!="object")return;let o=[[t.remoteJid,t.remoteJidAlt],[t.participant,t.participantAlt],[t.remoteJidAlt,t.remoteJid],[t.participantAlt,t.participant]];for(let[a,e]of o)if(GK(a)&&HXe(e)){let i=pA(a);i?.user&&n.set(i.user,e)}}async function ile(n,t,o){let a=pA(o);if(!a?.user)return null;let e=t?.get(a.user);if(e)return e;let i=n?.signalRepository?.lidMapping;if(!i||typeof i.getPNForLID!="function")return null;try{let A=await i.getPNForLID(o);if(typeof A=="string"&&A)return t?.set(a.user,A),A}catch{}return null}async function xXe(n,t){let o=n?.signalRepository?.lidMapping;if(!o||typeof o.getLIDForPN!="function")return null;try{let a=await o.getLIDForPN(t);return typeof a=="string"&&a?a:null}catch{return null}}function YXe(n,t=[],o=null){let a=new Set,e=i=>{if(typeof i!="string"||!i)return;let A=pA(i.trim());A?.user&&/^\d+$/.test(A.user)&&a.add(A.user)};e(n),e(o);for(let i of t){if(typeof i!="string"||!i)continue;let A=!1;try{A=ft(i,n)===!0}catch{A=!1}if(!A&&o)try{A=ft(i,o)===!0}catch{A=!1}A&&e(i)}return[...a]}function jXe(n,t){if(typeof n!="string"||!n||!Array.isArray(t)||t.length===0)return typeof n=="string"?n:"";let o=n;for(let a of t){if(!/^\d{5,32}$/.test(a))continue;let e=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");o=o.replace(new RegExp(`@${e}\\b[\\u200e\\u200f\\s]*`,"gu"),""),o=o.replace(new RegExp(`^${e}\\b[\\u200e\\u200f\\s]*`,"u"),"")}return o.replace(/[ \t]{2,}/g," ").trim()}function JXe(n){let t=n;for(let o=0;o<5&&t&&typeof t=="object";o+=1){let a=t.extendedTextMessage?.contextInfo??t.imageMessage?.contextInfo??t.videoMessage?.contextInfo??t.documentMessage?.contextInfo??null;if(a)return a;let e=["ephemeralMessage","viewOnceMessage","documentWithCaptionMessage","viewOnceMessageV2","viewOnceMessageV2Extension","editedMessage","associatedChildMessage","groupStatusMessage","groupStatusMessageV2"].find(i=>t[i]?.message);if(!e)return null;t=t[e].message}return null}async function ale(n,t,{accountJid:o,socket:a,lidPnCache:e}={}){if(!n)return null;t?.key&&KXe(e,t.key);let i=new Set;typeof n.senderAlternateId=="string"&&n.senderAlternateId&&i.add(n.senderAlternateId);for(let B of[n.senderId,n.senderAlternateId]){if(!GK(B))continue;let f=await ile(a,e,B);f&&i.add(f)}let A=JXe(t?.message),r=Array.isArray(A?.mentionedJid)?A.mentionedJid:[],s=await xXe(a,o),g=n.addressed===!0;if(n.kind==="group"&&g!==!0){for(let B of r)if(!(typeof B!="string"||!B)){try{if(ft(B,o)===!0){g=!0;break}}catch{}if(s)try{if(ft(B,s)===!0){g=!0;break}}catch{}if(GK(B)){let f=await ile(a,e,B);if(f)try{if(ft(f,o)===!0){g=!0;break}}catch{}}}}let c=YXe(o,r,s),I=jXe(n.content,c);i.delete(n.senderId);let p=[...i];return{...n,content:I,addressed:g,...p.length>0?{senderAliasIds:p}:{},...p[0]&&!n.senderAlternateId?{senderAlternateId:p[0]}:{}}}import{chmod as ole,mkdir as qXe,readdir as zXe}from"node:fs/promises";var VXe=Object.freeze({level:"silent",trace(){},debug(){},info(){},warn(){},error(){},fatal(){},child(){return this}}),WXe=6e4;function nle(){return Object.assign(new Error("WhatsApp connection was cancelled"),{name:"AbortError"})}function ZXe(n){return n?.output?.statusCode??n?.data?.statusCode??n?.statusCode??null}function XXe(n){let t=n;if(typeof t=="string"){if(!/^\d+$/.test(t))return null;t=Number(t)}else typeof t=="bigint"?t=Number(t):t&&typeof t=="object"&&(t=Number(t.valueOf()));return Number.isFinite(t)&&t>=0?t*1e3:null}async function FK(n){await qXe(n,{recursive:!0,mode:448}),await ole(n,448);let t=await zXe(n,{withFileTypes:!0}).catch(()=>[]);await Promise.all(t.filter(o=>o.isFile()).map(o=>ole(`${n}/${o.name}`,384).catch(()=>{})))}function $Xe(n,t){let o=n.user??t.creds.me,a=BA(o?.id);if(!/^\d{5,32}@(s\.whatsapp\.net|lid)$/.test(a??""))throw new Error("WhatsApp did not return a valid linked account");return{accountJid:a,name:typeof o?.name=="string"&&o.name.trim()?o.name.trim().slice(0,100):w("WhatsApp\u673A\u5668\u4EBA")}}async function JM({authDir:n,onQr:t,onMessage:o,onDisconnect:a,signal:e,logger:i=console,makeSocket:A=rle,loadAuthState:r=Age}={}){if(!n||typeof t!="function")throw new TypeError("WhatsApp Web session requires an auth directory and QR callback");await FK(n);let s=Date.now(),{state:g,saveCreds:c}=await r(n),I=g.keys.set.bind(g.keys);g.keys.set=async z=>{await I(z),await FK(n)};let p=!1,B=!1,f,Q,y=Promise.resolve(),m=null,T=0,_=null,R=new Promise((z,K)=>{f=z,Q=K}),L=z=>{B||(B=!0,Q(z))},U=async()=>{p||(p=!0,T+=1,L(nle()),await _?.catch(()=>{}),await y.catch(()=>{}),await m?.end(void 0).catch(()=>{}))},F=async()=>{p||(p=!0,T+=1,L(nle()),await _?.catch(()=>{}),await y.catch(()=>{}),await m?.logout("Removed from DeepSeek Harness").catch(()=>{}))},q=()=>{let z=++T,K=!1,G=A({auth:g,browser:oM.macOS("DeepSeek Harness"),logger:VXe,markOnlineOnConnect:!1,syncFullHistory:!1,shouldSyncHistoryMessage:()=>!1,getMessage:async()=>{},generateHighQualityLinkPreview:!1});m=G;let V=()=>{!K||!g.creds.me||B||y.then(()=>{p||B||z!==T||!K||!g.creds.me||(B=!0,f($Xe(G,g)))}).catch(H=>L(H))};G.ev.on("creds.update",()=>{p||z!==T||(y=y.then(async()=>{await c(),await FK(n)}),y.catch(()=>i.error?.("[dsh-im:whatsapp] failed to persist linked-device state")),V())}),G.ev.on("connection.update",H=>{if(!(p||z!==T)&&(typeof H.qr=="string"&&H.qr&&t(H.qr),H.connection==="open"&&(K=!0,V()),H.connection==="close")){let N=ZXe(H.lastDisconnect?.error);if(N===ar.restartRequired){_??=y.then(async()=>{p||z!==T||(await G.end(void 0).catch(()=>{}),!(p||z!==T)&&q())}).catch(X=>L(X)).finally(()=>{_=null});return}let k=N===ar.loggedOut,J=Object.assign(new Error(k?"WhatsApp linked device was removed from the phone":"WhatsApp Web connection closed"),{code:k?"logged-out":"connection-closed"});B?a?.({error:J,loggedOut:k}):L(J)}}),G.ev.on("messages.upsert",({messages:H,type:N})=>{if(!(p||z!==T||N!=="notify"&&N!=="append"||typeof o!="function"))for(let k of Array.isArray(H)?H:[]){if(N==="append"){let J=XXe(k?.messageTimestamp);if(J===null||J{i.error?.("[dsh-im:whatsapp] failed to process an inbound WhatsApp message")})}})};return q(),e&&(e.aborted?await U():e.addEventListener("abort",()=>void U(),{once:!0})),Object.freeze({get socket(){return m},ready:R,close:U,logout:F})}var UK=new Set(["image/jpeg","image/png","image/webp","image/gif"]),A7e=5*1024*1024,LK=15e3,HK=12e4,t7e=["ephemeralMessage","viewOnceMessage","documentWithCaptionMessage","viewOnceMessageV2","viewOnceMessageV2Extension","editedMessage","associatedChildMessage","groupStatusMessage","groupStatusMessageV2"],r7e=new Set(["viewOnceMessage","viewOnceMessageV2","viewOnceMessageV2Extension"]),i7e=new Set(["s.whatsapp.net","c.us","lid","hosted","hosted.lid"]);function gle(n){if(typeof n!="string")return null;let t=n.trim();if(/^\+?\d+$/.test(t))return`${t.replace(/^\+/,"")}@s.whatsapp.net`;let o=pA(t);return!o||!/^\d+$/.test(o.user)||!i7e.has(o.server)?null:t}function YK(n,t){let o=gle(n),a=gle(t);if(!o||!a)return!1;try{return ft(o,a)===!0}catch{return!1}}function a7e(n){let t=n;for(let o=0;o<5&&t&&typeof t=="object";o+=1){let a=t7e.find(e=>t[e]?.message);if(!a)return!1;if(r7e.has(a))return!0;t=t[a].message}return!1}function o7e(n){return n?.extendedTextMessage?.contextInfo??n?.imageMessage?.contextInfo??n?.videoMessage?.contextInfo??n?.documentMessage?.contextInfo??null}function Ile(n){return n?.conversation??n?.extendedTextMessage?.text??n?.imageMessage?.caption??n?.videoMessage?.caption??n?.documentMessage?.caption??""}function hQ(n,t,o){if(!t||typeof t!="object")return null;let a=typeof t.fileName=="string"&&t.fileName?t.fileName:typeof o=="string"&&o?o:void 0;return{kind:n,...a?{name:a}:{}}}function n7e(n){let t=[];if(n?.imageMessage&&t.push(hQ("image",n.imageMessage)),n?.documentMessage){let o=typeof n.documentMessage.mimetype=="string"?n.documentMessage.mimetype.toLowerCase():"";t.push(hQ(o.startsWith("image/")?"image":"file",n.documentMessage))}if(n?.audioMessage&&t.push(hQ("audio",n.audioMessage)),n?.videoMessage&&t.push(hQ("video",n.videoMessage)),n?.stickerMessage){let o=typeof n.stickerMessage.mimetype=="string"?n.stickerMessage.mimetype.toLowerCase():"";t.push(hQ(o.startsWith("video/")||n.stickerMessage.isAnimated===!0?"video":"image",n.stickerMessage))}return t.filter(Boolean)}function s7e(n){if(!n?.quotedMessage||typeof n.quotedMessage!="object")return;let t=Si(n.quotedMessage),o=typeof n.stanzaId=="string"&&n.stanzaId?n.stanzaId:void 0,a=typeof n.participant=="string"&&n.participant?n.participant:void 0;return{...o?{messageId:o}:{},...a?{authorId:a}:{},content:Ile(t),attachments:n7e(t)}}function lle(n){if(Number.isSafeInteger(n)&&n>=0)return n;let t;try{t=Number(n?.toString?.())}catch{return}return Number.isSafeInteger(t)&&t>=0?t:void 0}async function g7e(n,t,{signal:o,maxBytes:a=A7e}={}){o?.throwIfAborted();let e=AbortSignal.timeout(LK),i=o?AbortSignal.any([o,e]):e,A=Promise.resolve().then(()=>t(n,"stream",{options:{signal:i}})),r=await new Promise((I,p)=>{let B=!1,f=(y,m)=>B?!1:(B=!0,i.removeEventListener("abort",Q),y(m),!0),Q=()=>f(p,i.reason);i.addEventListener("abort",Q,{once:!0}),A.then(y=>{f(I,y)||y?.destroy?.()},y=>f(p,y)),i.aborted&&Q()}).catch(I=>{throw o?.aborted?o.reason??I:e.aborted?new Qt("image-download-failed",`WhatsApp image download timed out after ${LK} ms`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002")):I}),s=[],g=0,c=()=>r?.destroy?.(i.reason);i.addEventListener("abort",c,{once:!0});try{for await(let I of r){i.throwIfAborted();let p=Buffer.from(I);if(g+=p.length,g>a)throw r.destroy?.(),new Qt("image-too-large",`WhatsApp image exceeded ${a} bytes`,w("\u56FE\u7247\u8D85\u8FC7 5 MB\uFF0C\u8BF7\u538B\u7F29\u540E\u91CD\u8BD5\u3002"));s.push(p)}}catch(I){throw o?.aborted?o.reason??I:e.aborted?new Qt("image-download-failed",`WhatsApp image stream timed out after ${LK} ms`,w("\u56FE\u7247\u4E0B\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001\u540E\u518D\u8BD5\u3002")):I}finally{i.removeEventListener("abort",c)}return Buffer.concat(s,g)}function c7e(n,t,o,{viewOnce:a=!1}={}){let e,i;if(!a&&t?.imageMessage&&t.imageMessage.viewOnce!==!0)e=t.imageMessage;else if(t?.documentMessage){let r=typeof t.documentMessage.mimetype=="string"?t.documentMessage.mimetype.toLowerCase():"";if(!UK.has(r))return null;e=t.documentMessage,i=typeof e.fileName=="string"?e.fileName:void 0}if(!e)return null;let A=typeof e.mimetype=="string"?e.mimetype.toLowerCase():"";return UK.has(A)?{name:i,mediaType:A,size:lle(e.fileLength),load:r=>g7e(n,o,r)}:null}function I7e(n,t,o){let a=t?.documentMessage;if(!a)return null;let e=typeof a.mimetype=="string"&&a.mimetype?a.mimetype.toLowerCase():void 0;return UK.has(e)?null:{name:typeof a.fileName=="string"&&a.fileName?a.fileName:"whatsapp-file",...e?{mediaType:e}:{},size:lle(a.fileLength),async load({signal:i}={}){i?.throwIfAborted();let A=await o(n,"stream",{options:{signal:i}});return i?.throwIfAborted(),{stream:A}}}}function l7e({socket:n,logger:t=console,download:o=AH}={}){if(typeof o!="function")throw new TypeError("WhatsApp media downloader is required");return typeof n?.updateMediaMessage!="function"?o:(a,e,i)=>o(a,e,i,{logger:t,reuploadRequest:A=>n.updateMediaMessage(A)})}function p7e(n,t,{download:o=AH}={}){let a=typeof n?.key?.remoteJid=="string"?n.key.remoteJid:"",e=typeof n?.key?.remoteJidAlt=="string"?n.key.remoteJidAlt:"",i=typeof n?.key?.id=="string"?n.key.id:"";if(!a||!i||a==="status@broadcast"||a.endsWith("@newsletter"))return null;let A=a.endsWith("@g.us"),r=n.key.fromMe===!0,s=r&&!A&&[a,e].some(_=>_&&ft(_,t));if(r&&!s&&!A)return null;let g=r?t:A?n.key.participant:a,c=A&&!r?n.key.participantAlt:e;if(typeof g!="string"||!g)return null;let I=a7e(n.message),p=Si(n.message),B=o7e(p),f=Array.isArray(B?.mentionedJid)&&B.mentionedJid.some(_=>ft(_,t)),Q=typeof B?.participant=="string"&&ft(B.participant,t),y=c7e(n,p,o,{viewOnce:I}),m=I7e(n,p,o),T=s7e(B);return{messageId:`${a}:${i}`,providerMessageId:i,senderId:g,contextSource:()=>({senderName:n.pushName}),senderAlternateId:typeof c=="string"?c:"",senderIsBot:!1,kind:A?"group":"direct",conversationId:a,content:Ile(p),plainText:typeof p?.conversation=="string"||typeof p?.extendedTextMessage?.text=="string",images:y?[y]:[],files:m?[m]:[],...T?{replyTo:T}:{},addressed:!A||r||f||Q,selfChat:s,replyTarget:{jid:a,quoted:n,selfChat:s},reactionTarget:{jid:a,key:n.key}}}var KK=class{#e=new Map;has(t){return this.#t(),this.#e.has(t)}remember(t){this.#A(t)}reserve(t){this.#A(t)}#A(t){if(!(typeof t!="string"||!t))for(this.#t(),this.#e.set(t,Date.now()+5*6e4);this.#e.size>256;)this.#e.delete(this.#e.keys().next().value)}#t(){let t=Date.now();for(let[o,a]of this.#e)a>t||this.#e.delete(o)}};function ple(n){return n?.reason??new DOMException("The operation was aborted.","AbortError")}function cle(n,t){return t?(t.throwIfAborted(),new Promise((o,a)=>{let e=!1,i=(r,s)=>{e||(e=!0,t.removeEventListener("abort",A),r(s))},A=()=>i(a,ple(t));t.addEventListener("abort",A,{once:!0}),Promise.resolve(n).then(r=>i(o,r),r=>i(a,r)),t.aborted&&A()})):n}function d7e(n){if(n?.code==="artifact-delivery-uncertain")return n;let t=new Error("WhatsApp could not confirm artifact delivery.");return t.code="artifact-delivery-uncertain",t.cause=n,t}function h7e(n){if(n?.code?.startsWith?.("artifact-"))return n;let t=n?.output?.statusCode??n?.data?.statusCode??n?.statusCode,o;if(t===401||t===403?o="artifact-permission-required":t===413?o="artifact-too-large":t===429?o="artifact-rate-limited":[400,404,405,406,410,415,422].includes(t)&&(o="artifact-provider-rejected"),!o)return d7e(n);let a=new Error("WhatsApp rejected artifact delivery.");return a.code=o,a.cause=n,a}var xK=class{#e;#A;#t;#r;#I=new Map;constructor(t,o,{signal:a,mediaUploadTimeoutMs:e=HK}={}){this.#e=t,this.#A=o,this.#t=a,this.#r=e}async sendText(t,o){await this.#i(t.jid);let a=[];for(let[e,i]of us(o,4e3).entries()){let A=sle(10).toString("hex").toUpperCase(),r={...e===0&&t.quoted?{quoted:t.quoted}:{},messageId:A};typeof this.#A.reserve=="function"?this.#A.reserve(A):this.#A.remember(A);let s=await this.#e.sendMessage(t.jid,{text:i},r);this.#A.remember(s?.key?.id),typeof s?.key?.id=="string"&&s.key.id&&a.push(s.key.id)}return{providerMessageIds:a}}async sendFile(t,o){return this.#c(t,o,{document:o.bytes,mimetype:o.mediaType??"application/octet-stream",fileName:o.fileName},"file")}async sendImage(t,o){return this.#c(t,o,{image:o.bytes,mimetype:o.mediaType??"image/jpeg"},"image")}async addReaction(t,o,{signal:a}={}){if(typeof o!="string"||!o.trim())throw new TypeError("A WhatsApp reaction emoji is required");let e=o.trim();return await this.#o(t,e,a),e}removeReaction(t,o,{signal:a}={}){return this.#o(t,"",a)}async#o(t,o,a){if(typeof t?.jid!="string"||!t.jid||!t.key?.id)throw new TypeError("A WhatsApp reaction target is required");let e=a??this.#t;e?.throwIfAborted();let i=sle(10).toString("hex").toUpperCase();typeof this.#A.reserve=="function"?this.#A.reserve(i):this.#A.remember(i);let A=this.#e.sendMessage(t.jid,{react:{text:o,key:t.key}},{messageId:i}),r=await cle(A,e);return this.#A.remember(r?.key?.id),r}async#c(t,o,a,e){this.#t?.throwIfAborted(),await this.#i(t.jid),this.#t?.throwIfAborted();let i=typeof o.deliveryKey=="string"&&o.deliveryKey?o.deliveryKey:o.artifactId,A=e==="image"?`${i}:image`:i,r=typeof A=="string"&&A?e7e("sha256").update(A).digest("hex").slice(0,20).toUpperCase():void 0,s={...t.quoted?{quoted:t.quoted}:{},...r?{messageId:r}:{},mediaUploadTimeoutMs:this.#r};this.#A.remember(r);let g;try{let c=this.#e.sendMessage(t.jid,a,s);wn(o,c);let I=AbortSignal.timeout(this.#r),p=this.#t?AbortSignal.any([this.#t,I]):I;g=await cle(c,p)}catch(c){throw this.#t?.aborted?ple(this.#t):h7e(c)}return this.#t?.throwIfAborted(),this.#A.remember(g?.key?.id),g}async sendTyping(t){!t.selfChat&&t.quoted?.key&&await this.#e.readMessages([t.quoted.key]).catch(()=>{}),await this.#e.sendPresenceUpdate("composing",t.jid),await this.#i(t.jid,!1);let o=setInterval(()=>{this.#e.sendPresenceUpdate("composing",t.jid).catch(()=>{this.#i(t.jid)})},2e4);o.unref?.(),this.#I.set(t.jid,o)}async close(){let t=[...this.#I.keys()];await Promise.allSettled(t.map(o=>this.#i(o)))}async#i(t,o=!0){let a=this.#I.get(t);a&&clearInterval(a),this.#I.delete(t),o&&await this.#e.sendPresenceUpdate("paused",t).catch(()=>{})}};function E7e(){return{startedAt:null,ready:!1,connectionState:"idle",harnessReachable:!1,lastCheckedAt:null,lastConnectedAt:null,lastError:null,...co()}}var EQ=class{#e;#A;#t;#r;#I;#o;#c;#i;#a;#s;#p;#g;#l=E7e();#n=null;#h=null;#d=null;#C=null;#u=null;#B=new Map;constructor({config:t,authDir:o,harness:a,state:e,contextEnhancement:i,accessPolicy:A,groupSessionScope:r,logger:s=console,replyTimeoutMs:g=6e5,connectTimeoutMs:c=3e4,mediaUploadTimeoutMs:I=HK,createSession:p=JM}){if(!t||!o||!a||!e||typeof p!="function")throw new TypeError("WhatsappRuntime requires config, auth directory, Harness, state, and session factory");if(this.#e=t,this.#A=o,this.#t=a,this.#r=e,this.#I=i,this.#o=A,this.#c=r,this.#i=s,this.#a=g,this.#s=c,!Number.isSafeInteger(I)||I<=0)throw new TypeError("mediaUploadTimeoutMs must be a positive safe integer");this.#p=Math.min(I,HK),this.#g=p}get status(){return structuredClone(this.#l)}async start(){return this.#l.ready&&this.#h?this.status:this.#u?this.#u:(this.#u=this.#f().finally(()=>{this.#u=null}),this.#u)}async#f(){await this.stop(),this.#l.startedAt=new Date().toISOString(),this.#l.connectionState="connecting",this.#l.lastError=null,await this.#t.ensureRunning(),this.#l.harnessReachable=!0;let t=new AbortController;this.#n=t;let o=new KK,a,e=new Promise((i,A)=>{a=A});e.catch(()=>{});try{let i=await this.#g({authDir:this.#A,signal:t.signal,logger:this.#i,onQr:()=>a(Object.assign(new Error("WhatsApp linked-device session must be scanned again"),{code:"relink-required"})),onMessage:async(c,I)=>{let p=p7e(c,this.#e.accountJid,{download:l7e({socket:I?.socket,logger:this.#i})}),B=await ale(p,c,{accountJid:this.#e.accountJid,socket:I?.socket??this.#h?.socket,lidPnCache:this.#B});!B||o.has(B.providerMessageId)||!this.#C||(this.#l.lastCheckedAt=Date.now(),await this.#C.accept(B))},onDisconnect:({error:c})=>{t.signal.aborted||(this.#l.ready=!1,this.#l.connectionState="failed",this.#l.lastError=c?.message??"WhatsApp Web connection closed")}});this.#h=i;let A,r=await Promise.race([i.ready,e,new Promise((c,I)=>{A=setTimeout(()=>I(new Error("WhatsApp Web did not connect in time")),this.#s)})]).finally(()=>clearTimeout(A));if(!ft(r.accountJid,this.#e.accountJid))throw new Error("WhatsApp linked account does not match the saved bot");let s=new xK(i.socket,o,{signal:t.signal,mediaUploadTimeoutMs:this.#p});this.#d=s,this.#C=new jM({bot:s,harness:this.#t,state:this.#r,contextEnhancement:this.#I,accessPolicy:this.#o?{botId:this.#o.botId,getSettings:(...c)=>this.#o.getSettings(...c),...typeof this.#o.isPrivileged=="function"?{isPrivileged:(...c)=>this.#o.isPrivileged(...c)}:{},equals:YK}:void 0,groupSessionScope:this.#c,status:this.#l,logger:this.#i,replyTimeoutMs:this.#a,signal:t.signal});let g=Date.now();return this.#l.ready=!0,this.#l.connectionState="connected",this.#l.lastCheckedAt=g,this.#l.lastConnectedAt=g,this.status}catch(i){throw this.#l.ready=!1,this.#l.connectionState="failed",this.#l.lastError=i?.message??String(i),await this.stop(),i}}async logout(){return await this.#h?.logout().catch(()=>{}),this.stop()}async sendConnectionTest(t){if(!this.#l.ready||!this.#d){let o=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw o.code="test-target-unavailable",o}if(typeof t!="string"||!t.trim())throw new TypeError("WhatsApp connection test text is required");return await this.#d.sendText({jid:this.#e.accountJid,selfChat:!0},t),{sent:!0}}async sendProactiveText(t,o,{signal:a}={}){let e=typeof t?.route?.jid=="string"?t.route.jid.trim():"",i=t?.kind==="user"&&/^[^@\s]+@(s\.whatsapp\.net|lid)$/.test(e),A=t?.kind==="group"&&/^[^@\s]+@g\.us$/.test(e);if(!i&&!A){let r=new TypeError("Invalid WhatsApp proactive delivery target");throw r.code="invalid-target",r}if(!this.#l.ready||!this.#d){let r=new Error(w("WhatsApp\u673A\u5668\u4EBA\u5C1A\u672A\u8FDE\u63A5"));throw r.code="bot-not-connected",r}return a?.throwIfAborted(),this.#d.sendText({jid:e},o)}async stop(){let t=this.#h,o=this.#d,a=this.#C;return this.#n?.abort(),this.#n=null,this.#h=null,this.#d=null,this.#C=null,await o?.close().catch(()=>{}),await t?.close().catch(()=>{}),await Promise.race([a?.waitForIdle()??Promise.resolve(),new Promise(e=>setTimeout(e,2e3))]),this.#l.ready=!1,this.#l.connectionState="idle",this.status}};var f7e=/^[a-f0-9-]{36}$/;function Q7e(n){let t=dc(n.dshHome??process.env.DSH_HOME??jE(B7e(),".dsh")),o=dc(n.dataDir??jE(t,"integrations","dsh-whatsapp")),a=dc(n.authDir??jE(o,"auth")),e=i=>{if(!f7e.test(i??""))throw new TypeError("Invalid WhatsApp auth directory");return dc(a,i)};return{config:dc(n.configPath??jE(o,"config.json")),bots:dc(n.botsDir??jE(o,"bots")),workspaces:dc(n.workspacesPath??jE(o,"workspaces.json")),authPath:e}}async function jK(n,t={},o={}){let a=si(n,t),e=typeof n.logger=="function"?n.logger("dsh-im:whatsapp"):n.logger??console,i=()=>xi(n),A=o.ConfigStore??oD,r=o.StateStore??gD,s=o.HarnessClient??sD,g=o.Controller??TB,c=o.Runtime??EQ,I=o.createSession??JM,p=o.createConnectionSupervisor??od,B=Q7e(t),f=await new A(B.config).load(),Q=dc(t.workspace??process.cwd()),y=o.WorkspaceStore??ni,m=o.workspaces??await new y(B.workspaces,{defaultWorkspace:Q}).load(),T=f.list();await m.reconcile(T.map(k=>k.botId)),await Promise.all(T.map(k=>m.ensure(k.botId,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("whatsapp",k)})));let _=typeof f.remove=="function"?Yi(f,{workspaces:m}):f,R=new Map,L=k=>dc(B.bots,k,"state.json"),U=async k=>{let J=R.get(k);return J||(J=await new r(L(k)).load(),R.set(k,J)),J},F=zi(n,o.commandExecutor),{controlExecutor:q,sessionMaintenanceExecutor:z,fileIngressExecutor:K}=Vi(n,{controlExecutor:o.controlExecutor,sessionMaintenanceExecutor:o.sessionMaintenanceExecutor,fileIngressExecutor:o.fileIngressExecutor}),G=new s({...a,workspace:Q,autostart:!1,dshBin:t.dshBin??"dsh",...F?{commandExecutor:F}:{},...q?{controlExecutor:q}:{},...z?{sessionMaintenanceExecutor:z}:{},...K?{fileIngressExecutor:K}:{}}),V=new g({configStore:_,authPath:B.authPath,createSession:I,logger:e,createRuntime:async({botId:k,config:J,authDir:X})=>{let ie=await U(k);await m.ensure(k,{defaultAgentPreset:t.agentPreset,initialAccessPolicy:pr("whatsapp",J)});let De=ji(G,{botId:k,workspaces:m,state:ie,agentPresetCatalog:i});return new c({config:J,authDir:X,harness:De.harness,state:De.state,contextEnhancement:{botId:k,getSettings:()=>m.contextEnhancementFor(k)},accessPolicy:Wi(m,k,{channel:"whatsapp",config:J,equals:YK}),groupSessionScope:{getScope:()=>m.groupSessionScopeFor(k)},replyTimeoutMs:t.replyTimeoutMs??6e5,connectTimeoutMs:t.connectTimeoutMs??3e4,createSession:I,logger:{error:(...oe)=>e.error?.(`[${k}]`,...oe),warn:(...oe)=>e.warn?.(`[${k}]`,...oe),info:(...oe)=>e.info?.(`[${k}]`,...oe),debug:(...oe)=>e.debug?.(`[${k}]`,...oe)}})},deleteAuth:k=>u7e(B.authPath(k),{recursive:!0,force:!0}),deleteState:async({botId:k})=>{let J=R.get(k);if(R.delete(k),J&&typeof J.remove=="function")await J.remove();else try{await C7e(L(k))}catch(X){if(X?.code!=="ENOENT")throw X}}}),H=Ji(V,{workspaces:m,stateFor:U,agentPresetCatalog:i}),N=p({channel:"whatsapp",controller:H,harness:G,logger:e,retryDelaysMs:t.retryDelaysMs,healthyIntervalMs:t.healthyIntervalMs}).start();return{controller:H,deliveryAdapter:qi({channel:"whatsapp",workspaces:m,coreController:V,stateFor:U}),ready:N.ready,async close(){await N.close(),await H.close(),G.stopManagedProcess()}}}import y7e from"qrcode";var dle="/whatsapp",Br=Object.freeze({status:"connection.status",beginProvisioning:"provision.begin",pollProvisioning:"provision.poll",cancelProvisioning:"provision.cancel",reconnectBot:"bot.reconnect",deleteBot:"bot.delete",setAccessPolicy:Xi,setGroupSessionScope:ea,setWorkspace:La,setAgentPreset:Ua,setContextEnhancement:Fa}),hle=Object.freeze(Object.values(Br)),m7e=new Set(["qrValue","accountJid","authDirectory"]);function zK(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function qM(n,t){return zK(n)&&Object.keys(n).every(o=>t.includes(o))}function JK(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function S7e(n,t){return zK(t)?[Br.status,Br.beginProvisioning].includes(n)?qM(t,[])?null:`${n} does not accept fields.`:[Br.pollProvisioning,Br.cancelProvisioning].includes(n)?qM(t,["attemptId"])&&JK(t.attemptId)?null:`${n} requires an attemptId.`:n===Br.reconnectBot?qM(t,["botId","sendTest"])&&JK(t.botId)&&(t.sendTest===void 0||typeof t.sendTest=="boolean")?null:"bot.reconnect requires a botId and optional sendTest flag.":n===Br.deleteBot?qM(t,["botId","confirm"])&&JK(t.botId)&&t.confirm===!0?null:"bot.delete requires a botId and confirm=true.":n===Br.setAccessPolicy?$i(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u8BBF\u95EE\u8BBE\u7F6E\u3002":n===Br.setGroupSessionScope?Aa(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u7FA4\u4F1A\u8BDD\u7B56\u7565\u3002":n===Br.setWorkspace?ta(t)?null:"\u8BF7\u8F93\u5165\u5DE5\u4F5C\u533A\u7EDD\u5BF9\u8DEF\u5F84\u3002":n===Br.setAgentPreset?ia(t)?null:"\u8BF7\u9009\u62E9 Agent Preset\u3002":n===Br.setContextEnhancement?Zi(t)?null:"\u8BF7\u63D0\u4EA4\u6709\u6548\u7684\u4E0A\u4E0B\u6587\u589E\u5F3A\u8BBE\u7F6E\u3002":"Unknown WhatsApp endpoint.":"Payload must be an object."}function JE(n){if(Array.isArray(n))return n.map(JE);if(!zK(n))return n;let t={};for(let[o,a]of Object.entries(n))m7e.has(o)||(t[o]=JE(a));return t}async function w7e(n){return y7e.toDataURL(n,{type:"image/png",errorCorrectionLevel:"M",margin:2,width:320})}async function qK(n,t){return!n||typeof n.qrValue!="string"?JE(n):JE({...n,qrCodeDataUrl:await t(n.qrValue)})}async function PI(n,t){let o=structuredClone(n);return o?.provisioning&&(o.provisioning=await qK(o.provisioning,t)),JE(o)}function Ele(n,{encodeQr:t=w7e}={}){for(let e of["status","startProvisioning","registrationStatus","cancelProvisioning","reconnectBot","deleteBot"])if(typeof n?.[e]!="function")throw new TypeError(`A complete WhatsApp controller is required (${e})`);let o=new Map,a=e=>{let i=o.get(e);return i||(o.size>=16&&o.delete(o.keys().next().value),i=Promise.resolve().then(()=>t(e)),o.set(e,i)),i};return async(e,i,A)=>{if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(!hle.includes(e))return{ok:!1,error:{code:"bad-request",message:"Unknown WhatsApp endpoint."}};let r=S7e(e,i);if(r)return{ok:!1,error:{code:"bad-request",message:r}};try{let s;if(e===Br.status)s=await PI(await n.status(),a);else if(e===Br.beginProvisioning)s=await qK(await n.startProvisioning(),a);else if(e===Br.pollProvisioning){let g=await n.registrationStatus(i.attemptId);if(!g)return{ok:!1,error:{code:"bad-request",message:"The provisioning attempt no longer exists."}};s=await qK(g,a)}else if(e===Br.cancelProvisioning)s=JE(await n.cancelProvisioning(i.attemptId));else if(e===Br.reconnectBot){let g=await n.reconnectBot(i.botId);if(A?.aborted)return{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}};if(s=await PI(g,a),i.sendTest===!0){let c=null;if(!(g?.bots?.some(p=>p?.botId===i.botId&&p.connected===!0)===!0))c=new Error("WhatsApp bot is not connected"),c.code="test-target-unavailable";else try{if(typeof n.sendConnectionTest!="function"){let p=new Error("Connection test is unavailable");throw p.code="test-target-unavailable",p}await n.sendConnectionTest(i.botId)}catch(p){c=p}s={...s,testMessage:lr(c)}}}else if(e===Br.setWorkspace){if(typeof n.updateWorkspace!="function")throw new Error("Workspace update is unavailable");s=await PI(await n.updateWorkspace(i.botId,i.workspace),a)}else if(e===Br.setContextEnhancement){if(typeof n.updateContextEnhancement!="function")throw new Error("Context enhancement update is unavailable");s=await n.updateContextEnhancement(i.botId,i.config,g=>PI(g,a))}else if(e===Br.setAgentPreset){if(typeof n.updateAgentPreset!="function")throw new Error("Agent preset update is unavailable");s=await PI(await n.updateAgentPreset(i.botId,i.agentPreset),a)}else if(e===Br.setAccessPolicy){if(typeof n.updateAccessPolicy!="function")throw new Error("Access policy update is unavailable");s=await n.updateAccessPolicy(i.botId,i.policy,g=>PI(g,a))}else if(e===Br.setGroupSessionScope){if(typeof n.updateGroupSessionScope!="function")throw new Error("Group session scope update is unavailable");s=await n.updateGroupSessionScope(i.botId,i.groupSessionScope,g=>PI(g,a))}else s=await PI(await n.deleteBot(i.botId),a);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!0,value:s}}catch(s){let g=ra(s);return A?.aborted?{ok:!1,error:{code:"cancelled",message:"The request was cancelled."}}:{ok:!1,error:g??{code:"whatsapp-operation-failed",message:"WhatsApp \u64CD\u4F5C\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"}}}}}function zM(n,t,o,a){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(dle,Ele(t,o),{authority:mr(a)})}async function ule(n,t={}){if(t?.controller)return zM(n,t.controller,t.rpcOptions,t.rpcAuthority);let o=await jK(n,t,t.internals??{}),a=t.deliveryService&&o.deliveryAdapter?t.deliveryService.registerAdapter(o.deliveryAdapter):void 0,e=zM(n,o.controller,t.rpcOptions,t.rpcAuthority);return n.effect(()=>async()=>{await a?.(),await o.close()},"dsh-im: close WhatsApp Web connections"),e}var D7e="/dsh-im-delivery",O7e="DSH-IM \u4E3B\u52A8\u6295\u9012\u6D4B\u8BD5\u6210\u529F\u3002",Oa=Object.freeze({send:"message.send",listTargets:"target.list",listSuggestions:"target.suggestion.list",createTarget:"target.create",updateTarget:"target.update",deleteTarget:"target.delete",testTarget:"target.test"}),b7e=new Set(Object.values(Oa)),M7e=new Set(["bad-request","unknown-bot","unknown-target","target-conflict","invalid-target","bot-not-connected","target-rejected","delivery-failed","cancelled"]);function CQ(n){return n!==null&&typeof n=="object"&&!Array.isArray(n)}function GI(n,t){return CQ(n)&&Object.keys(n).length===t.length&&Object.keys(n).every(o=>t.includes(o))}function Mp(n){return typeof n=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(n)}function uQ(n){return typeof n=="string"&&/^[A-Za-z0-9._:@-]{1,128}$/.test(n)}function Cle(n,{targetId:t}){let o=t?["targetId","name","kind","route"]:["name","kind","route"];return!CQ(n)||Object.keys(n).some(a=>!o.includes(a))||t&&!uQ(n.targetId)||n.name!==void 0&&(typeof n.name!="string"||!n.name.trim()||n.name.trim().length>80)?!1:typeof n.kind=="string"&&/^[a-z][a-z0-9-]{0,31}$/.test(n.kind)&&CQ(n.route)}function _7e(n){return GI(n,["kind","route"])&&typeof n.kind=="string"&&/^[a-z][a-z0-9-]{0,31}$/.test(n.kind)&&CQ(n.route)}function T7e(n,t){return!b7e.has(n)||!CQ(t)?!1:n===Oa.send?GI(t,["botId","targetId","text"])&&Mp(t.botId)&&uQ(t.targetId)&&typeof t.text=="string"&&!!t.text.trim():n===Oa.listTargets||n===Oa.listSuggestions?GI(t,["botId"])&&Mp(t.botId):n===Oa.createTarget?GI(t,["botId","target"])&&Mp(t.botId)&&Cle(t.target,{targetId:!0}):n===Oa.updateTarget?GI(t,["botId","targetId","target"])&&Mp(t.botId)&&uQ(t.targetId)&&Cle(t.target,{targetId:!1}):n===Oa.testTarget?GI(t,["botId","targetId"])&&Mp(t.botId)&&uQ(t.targetId)||GI(t,["botId","target"])&&Mp(t.botId)&&_7e(t.target):GI(t,["botId","targetId"])&&Mp(t.botId)&&uQ(t.targetId)}function N7e(n){let t=M7e.has(n?.code)?n.code:"delivery-failed";return{code:t,message:t,details:{}}}function VK(n){for(let t of["send","listTargets","listSuggestions","createTarget","updateTarget","deleteTarget"])if(typeof n?.[t]!="function")throw new TypeError(`A complete delivery service is required (${t})`);return async(t,o,a)=>{if(!T7e(t,o))return{ok:!1,error:{code:"bad-request",message:"Invalid delivery request.",details:{}}};if(a?.aborted)return{ok:!1,error:{code:"cancelled",message:"cancelled",details:{}}};try{let e;return t===Oa.send?e=await n.send(o.botId,o.targetId,o.text,{signal:a}):t===Oa.listTargets?e=await n.listTargets(o.botId):t===Oa.listSuggestions?e=await n.listSuggestions(o.botId):t===Oa.createTarget?e=await n.createTarget(o.botId,o.target):t===Oa.updateTarget?e=await n.updateTarget(o.botId,o.targetId,o.target):t===Oa.deleteTarget?e=await n.deleteTarget(o.botId,o.targetId):e=await n.send(o.botId,Object.hasOwn(o,"target")?o.target:o.targetId,O7e,{signal:a}),{ok:!0,value:e}}catch(e){return{ok:!1,error:N7e(e)}}}}function Ble(n,t,{authority:o}={}){if(!n?.connection?.rpc||typeof n.connection.rpc.handle!="function")throw new TypeError("DSH Host Connection RPC is required");return n.connection.rpc.handle(D7e,VK(t),{authority:mr(o)})}var fle="/api/dsh-im/delivery/messages",Qle=1024*1024,R7e=Object.freeze({"bad-request":400,"unknown-bot":404,"unknown-target":404,"target-conflict":409,"invalid-target":422,"bot-not-connected":503,"target-rejected":422,"delivery-failed":502,cancelled:408}),zE=class extends Error{constructor(t,o){super(o),this.status=t,this.code=o}};function qE(n,t,o,a={}){if(n.destroyed||n.writableEnded)return;let e=JSON.stringify(o);n.writeHead(t,{"cache-control":"no-store","content-type":"application/json; charset=utf-8","content-length":String(Buffer.byteLength(e)),...a}),n.end(e)}function k7e(n){return typeof n=="string"&&n.split(";",1)[0].trim().toLowerCase()==="application/json"}async function v7e(n){let t=Number(n.headers["content-length"]);if(Number.isFinite(t)&&t>Qle)throw new zE(413,"payload-too-large");let o=[],a=0;for await(let e of n){let i=Buffer.isBuffer(e)?e:Buffer.from(e);if(a+=i.length,a>Qle)throw new zE(413,"payload-too-large");o.push(i)}try{return JSON.parse(Buffer.concat(o,a).toString("utf8"))}catch{throw new zE(400,"bad-request")}}function P7e(n){let t=VK(n);return async(o,a)=>{if(o.method!=="POST"){qE(a,405,{error:{code:"method-not-allowed",message:"method-not-allowed",details:{}}},{allow:"POST"});return}if(!k7e(o.headers["content-type"])){qE(a,415,{error:{code:"unsupported-media-type",message:"unsupported-media-type",details:{}}});return}let e=new AbortController,i=()=>e.abort(),A=()=>{a.writableEnded||i()};o.once("aborted",i),a.once("close",A);try{let r=await v7e(o),s=await t(Oa.send,r,e.signal);if(s.ok){qE(a,200,s.value);return}qE(a,R7e[s.error.code]??500,{error:s.error})}catch(r){if(r instanceof zE){qE(a,r.status,{error:{code:r.code,message:r.code,details:{}}});return}qE(a,500,{error:{code:"delivery-failed",message:"delivery-failed",details:{}}})}finally{o.off("aborted",i),a.off("close",A)}}}function yle(n,t){if(!n?.webServer||typeof n.webServer.register!="function"||typeof n.effect!="function")throw new TypeError("DSH Host WebServer is required");let o={kind:"exact",path:fle,handler:P7e(t)};return n.effect(()=>n.webServer.register(o),`dsh-im: ${fle}`)}var G7e=/^[A-Za-z0-9_-]{1,128}$/,F7e=/^[A-Za-z0-9._:@-]{1,128}$/,L7e=/^[a-z][a-z0-9-]{0,31}$/,U7e="__test__",H7e=Object.freeze(["ownsBot","listTargets","listSuggestions","createTarget","updateTarget","deleteTarget","sendText"]),K7e=new Set(["bad-request","unknown-bot","unknown-target","target-conflict","invalid-target","bot-not-connected","target-rejected","delivery-failed","cancelled"]);function Bn(n,t=n,o){let a=new Error(t,o);return a.code=n,a}function VE(n){if(typeof n!="string"||!G7e.test(n))throw Bn("bad-request","Invalid bot id");return n}function VM(n){if(typeof n!="string"||!F7e.test(n))throw Bn("bad-request","Invalid target id");return n}function WK(n,{includesTargetId:t}={}){if(!n||typeof n!="object"||Array.isArray(n))throw Bn("bad-request","Invalid target");if(t)VM(n.targetId);else if(Object.hasOwn(n,"targetId"))throw Bn("bad-request","A target id cannot be changed");return n}function x7e(n){WK(n);let t=Object.keys(n);if(t.length!==2||!t.includes("kind")||!t.includes("route"))throw Bn("bad-request","Invalid draft target");return n}function mle(n){if(n?.aborted)throw Bn("cancelled","Request cancelled")}function _p(n,t="delivery-failed"){return n?.code==="workspace-bot-not-found"?Bn("unknown-bot","Unknown bot",{cause:n}):K7e.has(n?.code)?n:Bn(t,t,{cause:n})}function Y7e(n){if(!n||typeof n!="object"||typeof n.channel!="string"||!L7e.test(n.channel))throw new TypeError("A delivery adapter with a valid channel is required");for(let t of H7e)if(typeof n[t]!="function")throw new TypeError(`A complete delivery adapter is required (${t})`);return n}var ZK=class{#e=new Map;registerAdapter(t){let o=Y7e(t),a=Object.freeze({adapter:o});return this.#e.set(o.channel,a),()=>this.#e.get(o.channel)!==a?!1:(this.#e.delete(o.channel),!0)}async listTargets(t){let o=VE(t),a=await this.#A(o);try{let e=await a.listTargets(o);if(!Array.isArray(e))throw new TypeError("Adapter returned invalid targets");return{botId:o,channel:a.channel,targets:e}}catch(e){throw _p(e)}}async listSuggestions(t){let o=VE(t),a=await this.#A(o);try{let e=await a.listSuggestions(o);if(!Array.isArray(e))throw new TypeError("Adapter returned invalid suggestions");return{botId:o,channel:a.channel,suggestions:e.map(i=>Ad(a.channel,i,{targetIdRequired:!1}))}}catch(e){throw _p(e)}}async createTarget(t,o){let a=VE(t);WK(o,{includesTargetId:!0});let e=await this.#A(a);try{return await e.createTarget(a,o)}catch(i){throw _p(i)}}async updateTarget(t,o,a){let e=VE(t),i=VM(o);WK(a);let A=await this.#A(e);try{return await A.updateTarget(e,i,a)}catch(r){throw _p(r)}}async deleteTarget(t,o){let a=VE(t),e=VM(o),i=await this.#A(a);try{return await i.deleteTarget(a,e),{deleted:!0}}catch(A){throw _p(A)}}async send(t,o,a,{signal:e}={}){let i=VE(t),A=typeof o=="string"?VM(o):null,r=A===null?x7e(o):null;if(typeof a!="string"||!a.trim())throw Bn("bad-request","Message text is required");mle(e);let s=await this.#A(i);try{let g;if(r)g={targetId:U7e,...r};else{let c=await s.listTargets(i);if(!Array.isArray(c))throw new TypeError("Adapter returned invalid targets");if(g=c.find(I=>I?.targetId===A),!g)throw Bn("unknown-target","Unknown target")}return mle(e),await s.sendText(i,g,a,{signal:e}),{sent:!0}}catch(g){throw e?.aborted||g?.name==="AbortError"||g?.code==="ABORT_ERR"?Bn("cancelled","Request cancelled",{cause:g}):_p(g)}}async#A(t){for(let{adapter:o}of this.#e.values()){let a;try{a=await o.ownsBot(t)}catch(e){throw _p(e)}if(a)return o}throw Bn("unknown-bot","Unknown bot")}};function Sle(){return new ZK}var BQ=ze(gO(),1);import{createHash as j7e}from"node:crypto";import{readFile as Ole,realpath as is,stat as J7e}from"node:fs/promises";import{homedir as q7e}from"node:os";import{basename as z7e,dirname as $K,isAbsolute as tx,join as hc,relative as V7e,resolve as ZM,sep as W7e}from"node:path";import{fileURLToPath as Z7e}from"node:url";var FI="dsh-im-ops",fQ="https://registry.npmjs.org/",X7e=15*6e4,$7e=1e4,wle=16*1024;function as(n,t={}){return Object.assign(new Error(n),{code:n,...t})}function WM(n,t){return typeof n?.get=="function"?n.get(t):n?.[t]}function ex(n,t){let o=V7e(n,t);return o!==".."&&!o.startsWith(`..${W7e}`)&&!tx(o)}async function e$e(n){try{return await Ole(n,"utf8")}catch(t){if(t.code==="ENOENT")return"";throw t}}async function Ax(n){let t=await Ole(hc(n,"package.json"),"utf8");return{directory:await is(n),manifest:JSON.parse(t),contents:t}}async function XK(n,t){let o=$K(await is(n));for(;;){try{let e=await Ax(o);return e.manifest?.name===t?e:null}catch(e){if(e.code!=="ENOENT")throw e}let a=$K(o);if(a===o)return null;o=a}}function A$e(n){return typeof n=="string"&&n.length>0&&Buffer.byteLength(n)<=255&&!n.startsWith("-")&&![".","..","node_modules"].includes(n)&&!/[\\/\x00-\x1f\x7f<>:"|?*]/u.test(n)}function t$e(n){if(n[0]==="web")return"web";let t;for(let o=0;o0&&(BQ.default.validRange(n)!==null||/^[A-Za-z][A-Za-z0-9._-]*$/u.test(n))}async function a$e(n){if(n.manifest?.name!==FI||BQ.default.valid(n.manifest.version)===null)return!1;let t=[n.manifest.main,n.manifest.exports?.["./client"],n.manifest.dsh?.bundle?.patch];for(let o of t){if(typeof o!="string"||!o||tx(o)||o.includes("\0"))return!1;let a=ZM(n.directory,o);if(!ex(n.directory,a)||!ex(n.directory,await is(a))||!(await J7e(a)).isFile())return!1}return!0}function o$e(n){if(n==null||n==="")return!0;if(typeof n!="string")return!1;try{return new URL(n).href===fQ}catch{return!1}}async function Dle(n,{signal:t,timeoutMs:o,errorCode:a,capture:e=!1}){if(t?.aborted)throw as("install-interrupted");let i=new AbortController,A,r,s=B=>{A??=B,i.abort(),r?.cancel?.()},g=()=>s("install-interrupted");t?.addEventListener("abort",g,{once:!0});let c=setTimeout(()=>s("install-timeout"),o),I="",p="";try{r=n(i.signal),r.stdout?.on("data",f=>{e&&(I=(I+f.toString()).slice(-wle))}),r.stderr?.on("data",f=>{p=(p+f.toString()).slice(-wle)}),r.stdout?.on("error",()=>s(a)),r.stderr?.on("error",()=>s(a));let B=await r.done;if(A)throw as(A);if(B.exitCode!==0||B.signal)throw as(a,{exitCode:B.exitCode,diagnosticCode:p.match(/\bERR_PNPM_[A-Z0-9_]+\b/u)?.[0]});return{exitCode:0,signal:null,...e?{stdout:I}:{}}}catch(B){throw A?as(A):B.code===a?B:as(a)}finally{clearTimeout(c),t?.removeEventListener("abort",g)}}function ble(n={}){let t=n.ctx,o=n.env??process.env,a=n.argv??process.argv,e=n.execArgv??process.execArgv,i=n.execPath??process.execPath,A=n.cwd??process.cwd(),r=n.platform??process.platform,s=n.osHome??q7e(),g=n.electron??process.versions.electron,c=n.moduleUrl??import.meta.url,I=XK(Z7e(c),FI).catch(()=>null),p;async function B(){let T=WM(t,"desktopProfiles"),_=WM(t,"desktopPnpm"),R=WM(t,"desktopPnpmBootstrap"),L=!!(g||T||_||R),U=T?.current,F=L?U?.name:t$e(a.slice(2)),q=L&&R?.homeDir?ZM(R.homeDir):r$e(o,s),z={environmentKind:L?"desktop":"cli",homeDir:q,profileName:F};if(!A$e(F))return{...z,blockedReason:"unknown-profile"};let K=await is(hc(q,"profiles",F)),G=await is(q),V={...z,homeDir:G,profileDir:K};if(L)try{if(typeof _?.runPlugin!="function"||typeof _?.run!="function"||!R||!U?.dir||R.activeProfileName!==F||await is(U.dir)!==K||await is(R.activeProfileDir)!==K||await is(R.appExecutable)!==await is(i))return{...V,blockedReason:"executor-unavailable"};let N=await XK(R.dshBootstrapPath,"dsh-plugin-desktop");return!N||z7e(R.dshBootstrapPath)!=="desktop-cli.js"||$K(await is(R.dshBootstrapPath))!==hc(N.directory,"lib")?{...V,blockedReason:"executor-unavailable"}:{...V,desktop:_,executable:i,cliEntry:R.dshBootstrapPath}}catch{return{...V,blockedReason:"executor-unavailable"}}let H=WM(t,"subprocess");if(typeof H?.spawn!="function"||typeof a[1]!="string"||!tx(a[1])||r==="win32")return{...V,blockedReason:"executor-unavailable"};try{let N=await XK(a[1],"@deepseek-ai/dsh");if(!N)return{...V,blockedReason:"executor-unavailable"};let k=await is(a[1]),J=typeof N.manifest.bin=="string"?N.manifest.bin:N.manifest.bin?.dsh,X=typeof J=="string"?ZM(N.directory,J):"";return k!==X&&k!==hc(N.directory,"src","bin.ts")?{...V,blockedReason:"executor-unavailable"}:{...V,subprocess:H,executable:i,cliEntry:k}}catch{return{...V,blockedReason:"executor-unavailable"}}}function f(T,_,R,L=!1){let U=T.subprocess.spawn({argv:L?["pnpm",..._]:[i,...e,T.cliEntry,..._],cwd:L?T.profileDir:A,env:{DSH_HOME:T.homeDir,CI:"true"},stdio:{stdin:"ignore",stdout:"pipe",stderr:"pipe"},graceMs:3e3,signal:R});return{stdout:U.stdout,stderr:U.stderr,cancel:()=>U.terminate(),done:(async()=>{try{return await U.done}finally{await U.waitForExit()}})()}}async function Q(T,_){let R=["config","get","@xmanrui:registry","--json"],U=(await Dle(q=>T.desktop?T.desktop.run(R,q):f(T,R,q,!0),{signal:_,timeoutMs:n.configTimeoutMs??$7e,errorCode:"registry-check-failed",capture:!0})).stdout.trim(),F;try{F=U===""||U==="undefined"?void 0:JSON.parse(U)}catch{throw as("registry-check-failed")}if(!o$e(F))throw as("registry-conflict")}async function y({preflight:T=!1}={}){let _,R={installedVersion:null,packageValid:!1,eligible:!1,installationKey:null};try{_=await B();for(let G of["homeDir","profileDir","profileName","environmentKind","executable","cliEntry"])R[G]=_[G]??null;if(!_.profileDir)return{...R,blockedReason:_.blockedReason??"unknown-profile"};let L=await Ax(_.profileDir),U=await Ax(hc(_.profileDir,"node_modules",FI));R.sourceInstall=!i$e(L.manifest.dependencies?.[FI])||!ex(hc(_.profileDir,"node_modules"),U.directory),R.installedVersion=typeof U.manifest.version=="string"?U.manifest.version:null,R.packageValid=await a$e(U);let F=await I,q=`${_.homeDir}\0${_.profileDir}\0${_.profileName}`,z=F?.directory===U.directory&&F?.manifest.version===U.manifest.version;p===void 0&&z&&R.packageValid&&(p=q);let K=await Promise.all(["pnpm-lock.yaml","pnpm-workspace.yaml","package-lock.json"].map(G=>e$e(hc(_.profileDir,G))));return R.installationKey=j7e("sha256").update(JSON.stringify([q,L.contents,U.directory,U.contents,_.cliEntry,_.executable,...K])).digest("hex"),p!==void 0&&p!==q||!z&&p===void 0?R.blockedReason="installation-changed":R.packageValid?R.sourceInstall?R.blockedReason="source-install":_.blockedReason?R.blockedReason=_.blockedReason:z?T&&await Q(_):R.blockedReason="pending-restart":R.blockedReason="invalid-installation",R.eligible=!R.blockedReason,{...R,blockedReason:R.blockedReason??null}}catch(L){return{...R,blockedReason:["registry-conflict","registry-check-failed","install-timeout","install-interrupted"].includes(L.code)?L.code:_?.profileDir?"invalid-installation":"unknown-profile"}}}async function m(T,{signal:_,expectedInstallationKey:R}={}){if(BQ.default.valid(T)!==T||BQ.default.prerelease(T))throw as("invalid-version");let L=await y();if(R!==void 0&&L.installationKey!==R)throw as("installation-changed");if(!L.eligible)throw as(L.blockedReason);let U=await B();await Q(U,_);let F=await y();if(!F.eligible||F.installationKey!==L.installationKey)throw as("installation-changed");let q=["add","-w","--save-exact",`${FI}@${T}`,`--registry=${fQ}`];return Dle(z=>U.desktop?U.desktop.runPlugin(q,U.profileDir,z):f(U,["plugin","--profile",U.profileName,...q],z),{signal:_,timeoutMs:n.installTimeoutMs??X7e,errorCode:"install-failed"})}return Object.freeze({inspect:y,install:m})}var LI=ze(gO(),1);import{createHash as n$e,randomUUID as ix}from"node:crypto";import{mkdir as s$e,open as g$e,readFile as Rle,rename as c$e,stat as kle,unlink as vle,writeFile as I$e}from"node:fs/promises";import{isAbsolute as Mle,join as yQ}from"node:path";var mQ=new Set(["installing","verifying"]),l$e=new Set([...mQ,"restart-required","completed","failed","interrupted"]),_le=256*1024,p$e=["package.json","pnpm-lock.yaml","pnpm-workspace.yaml"],XM=Symbol("no update lock");function _t(n){return Object.assign(new Error(n),{code:n})}async function Tle(n=globalThis.fetch,t=1e4){let o;try{if(o=await n(`${fQ}${encodeURIComponent(FI)}/latest`,{headers:{accept:"application/json"},redirect:"error",signal:AbortSignal.timeout(t)}),!o.ok)throw _t("check-failed");if(Number(o.headers.get("content-length"))>_le)throw _t("invalid-release");let a=[],e=0;for await(let c of o.body){if(e+=c.byteLength,e>_le)throw _t("invalid-release");a.push(Buffer.from(c))}let i=JSON.parse(Buffer.concat(a).toString("utf8")),A=i.version;if(i.name!==FI||typeof A!="string"||LI.default.valid(A)!==A||LI.default.prerelease(A))throw _t("invalid-release");let r=i.engines?.node;if(r!==void 0&&(typeof r!="string"||!LI.default.validRange(r)))throw _t("invalid-release");let s=new URL(i.dist?.tarball),g=i.dist?.integrity;if(s.origin!==new URL(fQ).origin||s.username||s.password||s.search||s.hash||s.pathname!==`/dsh-im-ops/-/dsh-im-${A}.tgz`||typeof g!="string"||!/^sha512-[A-Za-z0-9+/]{86}==$/.test(g))throw _t("invalid-release");return{version:A,nodeRange:r??"*",integrity:g,tarball:s.href}}catch(a){throw a?.code==="invalid-release"||a instanceof SyntaxError||a instanceof TypeError&&o?.ok?_t("invalid-release"):_t("check-failed")}}function Nle(n){if(!Mle(n.homeDir??"")||!Mle(n.profileDir??""))return null;let t=n$e("sha256").update(n.profileDir).digest("hex").slice(0,24),o=yQ(n.homeDir,"updates","dsh-im",t);return{directory:o,state:yQ(o,"state.json"),lock:yQ(o,"install.lock"),backup:yQ(o,"before.json")}}async function rx(n,t=null){try{if((await kle(n)).size>10*1024*1024)throw _t("state-unavailable");return JSON.parse(await Rle(n,"utf8"))}catch(o){if(o.code==="ENOENT")return t;throw _t("state-unavailable")}}async function QQ(n,t){let o=`${n}.${ix()}.tmp`;try{await I$e(o,`${JSON.stringify(t,null,2)} +`,{mode:384,flag:"wx"}),await c$e(o,n)}catch{throw _t("state-unavailable")}finally{await vle(o).catch(a=>{if(a.code!=="ENOENT")throw _t("state-unavailable")})}}function d$e(n){if(!Number.isSafeInteger(n)||n<=0)return!1;try{return process.kill(n,0),!0}catch(t){return t.code!=="ESRCH"}}function h$e(n){if(!n)return null;let{id:t,state:o,targetVersion:a,message:e}=n;return{id:t,state:o,targetVersion:a,message:e}}function Ple({runtime:n,runningVersion:t=HQ.version,nodeVersion:o=process.versions.node,fetchImpl:a=globalThis.fetch,now:e=Date.now,checkTimeoutMs:i=1e4,confirmationTtlMs:A=10*6e4,installTimeoutMs:r=15*6e4}={}){let s={},g=null,c=null,I=-1/0,p=null,B=null,f=null,Q=null,y=!1;function m(){if(y)throw _t("disposed")}async function T(V){let H=Nle(V);if(!H)return null;if(Q?.statePath===H.state)return Q.job;let N=await rx(H.state),k=await rx(H.lock,XM);if(!N)return k!==XM?{id:"locked",state:"interrupted",message:"recovery-required",targetVersion:null}:null;if(!l$e.has(N.state)||typeof N.id!="string"||!LI.default.valid(N.targetVersion))throw _t("state-unavailable");if(mQ.has(N.state)&&N.id!==p?.id&&(k===XM||k?.id!==N.id||!d$e(k?.pid))&&(N={...N,state:"interrupted",message:"recovery-required"}),N.id!==p?.id&&!mQ.has(N.state)){if(k!==XM)return{...N,state:"interrupted",message:"recovery-required"};if(["failed","interrupted"].includes(N.state)&&V.packageValid===!0&&V.installedVersion===t&&!V.blockedReason)return N.targetVersion===t?{...N,state:"completed",message:"recovered"}:{...N,recoverable:!0}}return N.state==="restart-required"||N.state==="completed"?V.installedVersion!==N.targetVersion||V.packageValid!==!0?{...N,state:"interrupted",message:"installation-changed"}:{...N,state:t===N.targetVersion?"completed":"restart-required"}:N}function _(V,H){let N=V.blockedReason??g?.blockedReason??null;H?.state==="interrupted"&&!H.recoverable||H?.state==="failed"&&V.installedVersion!==t?N="recovery-required":(H?.state==="restart-required"||V.installedVersion&&V.installedVersion!==t)&&(N="pending-restart");let k=mQ.has(H?.state),J=!!(V.eligible&&!N&&!k&&g?.checkId&&e(){try{let V=await n.inspect({preflight:!0}),H=await Tle(a,i);return m(),g={release:H,checkId:ix(),checkedAt:e(),expiresAt:e()+A,installationKey:V.installationKey,profileDir:V.profileDir,blockedReason:V.blockedReason??(LI.default.satisfies(o,H.nodeRange)?null:"incompatible-node")},_(V,await T(V))}catch(V){throw g&&(g={...g,checkId:null,expiresAt:0}),V}finally{c=null}})(),c))}async function U(V,H){(await rx(V.lock))?.id===H&&await vle(V.lock)}async function F(V,H,N){let k={};for(let J of p$e)try{let X=yQ(V.profileDir,J);if((await kle(X)).size>3*1024*1024)throw _t("state-unavailable");k[J]=await Rle(X,"utf8")}catch(X){if(X.code!=="ENOENT")throw _t("state-unavailable")}await QQ(H.backup,{jobId:N.id,previousVersion:N.previousVersion,files:k})}function q(V){p={...p,state:"interrupted",message:"state-unavailable"},Q={statePath:V.state,job:p}}async function z(V,H,N){let k=AbortSignal.timeout(r);try{if(await n.install(H.targetVersion,{signal:AbortSignal.any([f.signal,k]),expectedInstallationKey:N.installationKey}),y)throw _t("interrupted");p={...p,state:"verifying",updatedAt:e()},await QQ(V.state,p);let J=await n.inspect();if(J.homeDir!==N.homeDir||J.profileDir!==N.profileDir||J.profileName!==N.profileName||J.blockedReason==="installation-changed")throw _t("installation-changed");if(J.installedVersion!==H.targetVersion||J.packageValid!==!0||J.blockedReason&&J.blockedReason!=="pending-restart")throw _t("verify-failed");p={...p,state:"restart-required",message:null,updatedAt:e()},await QQ(V.state,p)}catch(J){let X=k.aborted||J.code==="install-timeout",ie=y||f.signal.aborted||!X&&["interrupted","install-interrupted"].includes(J.code);p={...p,state:ie?"interrupted":"failed",message:ie?"interrupted":X?"install-timeout":["verify-failed","state-unavailable","installation-changed","registry-conflict"].includes(J.code)?J.code:"install-failed",updatedAt:e()};try{await QQ(V.state,p)}catch{q(V);return}}await U(V,H.id)}function K({checkId:V,requestId:H}){return Ig(s,"install",async()=>{m();let N=await n.inspect({preflight:!0}),k=await T(N);if(k?.requestId===H)return _(N,k);if(mQ.has(k?.state)||k?.state==="restart-required")throw _t("update-busy");let J=g;if(!J||!V||J.checkId!==V||e()>=J.expiresAt)throw _t("check-expired");if(N.profileDir!==J.profileDir||N.installationKey!==J.installationKey)throw _t("installation-changed");if(!_(N,k).canInstall)throw _t(N.blockedReason??"update-busy");let X=Nle(N);if(!X)throw _t("state-unavailable");let ie={id:ix(),requestId:H,state:"installing",message:null,targetVersion:J.release.version,previousVersion:N.installedVersion,startedAt:e(),updatedAt:e()},De=!1;try{await s$e(X.directory,{recursive:!0,mode:448});let oe=await g$e(X.lock,"wx",384);De=!0;try{await oe.writeFile(JSON.stringify({id:ie.id,pid:process.pid,startedAt:e()}))}finally{await oe.close()}let Se=await Tle(a,i);if(JSON.stringify(Se)!==JSON.stringify(J.release))throw _t("check-expired");if(N=await n.inspect({preflight:!0}),N.profileDir!==J.profileDir||N.installationKey!==J.installationKey)throw _t("installation-changed");if(!N.eligible||N.blockedReason)throw _t(N.blockedReason??"update-busy");m(),await F(N,X,ie),await QQ(X.state,ie),m()}catch(oe){throw De&&await U(X,ie.id),oe.code==="EEXIST"?_t("update-busy"):oe.code?.startsWith("E")?_t("state-unavailable"):oe}return p=ie,f=new AbortController,B=z(X,ie,N).catch(()=>{q(X)}),_(N,ie)})}async function G(){y=!0,f?.abort(),B&&await B}return Object.freeze({status:R,check:L,install:K,close:G})}var E$e="/dsh-im",u$e=Object.freeze(["update.status","update.check","update.install"]);function C$e(n,t){if(t===null||typeof t!="object"||Array.isArray(t))return!1;let o=Object.keys(t);return n!=="update.install"?o.length===0:o.length===2&&o.every(a=>a==="checkId"||a==="requestId")&&["checkId","requestId"].every(a=>typeof t[a]=="string"&&/^[A-Za-z0-9_-]{1,128}$/.test(t[a]))}var B$e=new Set(["check-failed","invalid-release","check-expired","installation-changed","update-busy","install-failed","verify-failed","state-unavailable","interrupted","disposed","source-install","unknown-profile","unsupported-runtime","registry-conflict","incompatible-node","pending-restart","recovery-required","executor-unavailable","invalid-installation","registry-check-failed","install-timeout","install-interrupted","invalid-version"]);function f$e(n){return async(t,o,a)=>{if(!u$e.includes(t)||!C$e(t,o))return{ok:!1,error:{code:"bad-request",message:"Invalid update request."}};if(a?.aborted)return{ok:!1,error:{code:"cancelled",message:"Request cancelled."}};try{return{ok:!0,value:t==="update.install"?await n.install(o):t==="update.check"?await n.check():await n.status()}}catch(e){let i=B$e.has(e?.code)?e.code:"update-failed";return{ok:!1,error:{code:i,message:i}}}}}function Gle(n,t={}){let o=t.runtime??ble({ctx:n,moduleUrl:import.meta.url}),a=t.service??Ple({runtime:o}),e=n.connection.rpc.handle(E$e,f$e(a),{authority:"loopback"});return n.effect(()=>()=>a.close(),"dsh-im: close update installer"),e}var Fle="dsh-im-host",Q$e=["connection","credentials","typertGateway"];function y$e(n,t,o){let a=n[t]??{},e=n.rpcAuthority===void 0?a:{...a,rpcAuthority:n.rpcAuthority};return t==="office"?e:{...e,deliveryService:o}}function m$e(n={}){let t=n.installUpdateRpc??Gle,o=n.installDeliveryRpc??Ble,a=n.installDeliveryHttp??yle,e=n.createDeliveryService??Sle,i=n.applyFeishu??bZ,A=n.applyWeixin??mX,r=n.applyDingtalk??R3,s=n.applyWecom??j9,g=n.applyQq??zZ,c=n.applySlack??l9,I=n.applyTelegram??b9,p=n.applyDiscord??oj,B=n.applyOffice??lj,f=n.applyWhatsapp??ule,Q=[["feishu",i],["weixin",A],["dingtalk",r],["wecom",s],["qq",g],["slack",c],["telegram",I],["discord",p],["whatsapp",f],["office",B]];return Object.freeze({name:Fle,inject:Q$e,async apply(m,T={}){let _=e();typeof m?.provide=="function"&&m.provide("dshIm",Object.freeze({send:(L,U,F,q)=>_.send(L,U,F,q),listTargets:async L=>(await _.listTargets(L)).targets}));let R=async L=>{await y(L,T,_)};if(typeof m?.inject=="function"){let L=typeof m?.typertGateway?.stream=="function";await m.inject(L?["sessionController","workspaceController"]:["apiProxy"],R),m.inject(["webServer"],U=>{a(U,_)});return}await R(m),m?.webServer?.register&&typeof m?.effect=="function"&&a(m,_)}});async function y(m,T,_){Yx(T.language??process.env.DSH_IM_LANGUAGE),typeof m?.inject=="function"?m.inject(["tools","systemPrompt"],U=>{tT(U)}):tT(m);let R=typeof m?.logger=="function"?m.logger(Fle):m?.logger??console;if(m?.connection?.rpc){try{t(m)}catch(U){R.error?.("[dsh-im] failed to activate update management; continuing with channels",U)}try{o(m,_,{authority:T.rpcAuthority})}catch(U){R.error?.("[dsh-im] failed to activate delivery management; continuing with channels",U)}}let L=[];for(let[U,F]of Q)try{await F(m,y$e(T,U,_))}catch(q){L.push(q),R.error?.(`[dsh-im] failed to activate ${U}; continuing with the remaining channels`,q)}if(L.length===Q.length)throw new AggregateError(L,"dsh-im failed to activate every channel")}}async function vKA(n,t={}){return m$e().apply(n,t)}export{vKA as apply,m$e as createImHostPlugin,Q$e as inject,Fle as name}; /*! Bundled license information: mime-db/index.js: diff --git a/package.json b/package.json index b6181e5..74b7e95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dsh-im-ops", - "version": "4.9.1-ops.2", + "version": "4.9.1-ops.3", "description": "Ops fork of dsh-im (all channels kept). Based on @xmanrui/dsh-im@4.9.1 — access/session policies owned here.", "keywords": [ "deepseek-harness", diff --git a/src/channels/whatsapp/whatsapp-identity.mjs b/src/channels/whatsapp/whatsapp-identity.mjs index 6e0361b..c006ccf 100644 --- a/src/channels/whatsapp/whatsapp-identity.mjs +++ b/src/channels/whatsapp/whatsapp-identity.mjs @@ -76,6 +76,83 @@ async function lookupLidForPn(socket, pn) { } } +/** + * Collect local-part tokens for the linked bot account (PN and LID). + * Used only to strip trigger @mentions from inbound text — not context injection. + * @param {string} accountJid + * @param {string[]} mentionedJids + * @param {string|null} accountLid + * @returns {string[]} + */ +export function whatsappBotMentionTokens(accountJid, mentionedJids = [], accountLid = null) { + const tokens = new Set(); + const add = (jid) => { + if (typeof jid !== 'string' || !jid) return; + const decoded = jidDecode(jid.trim()); + if (decoded?.user && /^\d+$/.test(decoded.user)) tokens.add(decoded.user); + }; + add(accountJid); + add(accountLid); + for (const jid of mentionedJids) { + if (typeof jid !== 'string' || !jid) continue; + let matchesBot = false; + try { + matchesBot = areJidsSameUser(jid, accountJid) === true; + } catch { + matchesBot = false; + } + if (!matchesBot && accountLid) { + try { + matchesBot = areJidsSameUser(jid, accountLid) === true; + } catch { + matchesBot = false; + } + } + if (matchesBot) add(jid); + } + return [...tokens]; +} + +/** + * Remove WhatsApp @bot trigger tokens from plain text (e.g. `@1627…` / leading LID). + * Does not add sender identity — that belongs to optional context enhancement. + * @param {string} text + * @param {string[]} tokens + * @returns {string} + */ +export function stripWhatsappBotMentionText(text, tokens) { + if (typeof text !== 'string' || !text || !Array.isArray(tokens) || tokens.length === 0) { + return typeof text === 'string' ? text : ''; + } + let result = text; + for (const token of tokens) { + if (!/^\d{5,32}$/.test(token)) continue; + const escaped = token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + result = result.replace(new RegExp(`@${escaped}\\b[\\u200e\\u200f\\s]*`, 'gu'), ''); + result = result.replace(new RegExp(`^${escaped}\\b[\\u200e\\u200f\\s]*`, 'u'), ''); + } + return result.replace(/[ \t]{2,}/g, ' ').trim(); +} + +function inboundMentionContext(rawMessage) { + let current = rawMessage; + for (let depth = 0; depth < 5 && current && typeof current === 'object'; depth += 1) { + const context = current.extendedTextMessage?.contextInfo + ?? current.imageMessage?.contextInfo + ?? current.videoMessage?.contextInfo + ?? current.documentMessage?.contextInfo + ?? null; + if (context) return context; + const wrapper = ['ephemeralMessage', 'viewOnceMessage', 'documentWithCaptionMessage', + 'viewOnceMessageV2', 'viewOnceMessageV2Extension', 'editedMessage', + 'associatedChildMessage', 'groupStatusMessage', 'groupStatusMessageV2'] + .find((key) => current[key]?.message); + if (!wrapper) return null; + current = current[wrapper].message; + } + return null; +} + /** * Expand inbound WhatsApp identities with PN/LID aliases and re-evaluate * group @mention against the linked account. @@ -104,27 +181,12 @@ export async function enrichWhatsappInboundIdentities(message, raw, { if (pn) aliasIds.add(pn); } + const context = inboundMentionContext(raw?.message); + const mentioned = Array.isArray(context?.mentionedJid) ? context.mentionedJid : []; + const accountLid = await lookupLidForPn(socket, accountJid); + let addressed = message.addressed === true; if (message.kind === 'group' && addressed !== true) { - const content = raw?.message; - let current = content; - let context = null; - for (let depth = 0; depth < 5 && current && typeof current === 'object'; depth += 1) { - context = current.extendedTextMessage?.contextInfo - ?? current.imageMessage?.contextInfo - ?? current.videoMessage?.contextInfo - ?? current.documentMessage?.contextInfo - ?? null; - if (context) break; - const wrapper = ['ephemeralMessage', 'viewOnceMessage', 'documentWithCaptionMessage', - 'viewOnceMessageV2', 'viewOnceMessageV2Extension', 'editedMessage', - 'associatedChildMessage', 'groupStatusMessage', 'groupStatusMessageV2'] - .find((key) => current[key]?.message); - if (!wrapper) break; - current = current[wrapper].message; - } - const mentioned = Array.isArray(context?.mentionedJid) ? context.mentionedJid : []; - const accountLid = await lookupLidForPn(socket, accountJid); for (const jid of mentioned) { if (typeof jid !== 'string' || !jid) continue; try { @@ -161,10 +223,14 @@ export async function enrichWhatsappInboundIdentities(message, raw, { } } + const botTokens = whatsappBotMentionTokens(accountJid, mentioned, accountLid); + const content = stripWhatsappBotMentionText(message.content, botTokens); + aliasIds.delete(message.senderId); const senderAliasIds = [...aliasIds]; return { ...message, + content, addressed, ...(senderAliasIds.length > 0 ? { senderAliasIds } : {}), ...(senderAliasIds[0] && !message.senderAlternateId diff --git a/test/channels/whatsapp/whatsapp-identity.test.mjs b/test/channels/whatsapp/whatsapp-identity.test.mjs index df3bb89..241b1d1 100644 --- a/test/channels/whatsapp/whatsapp-identity.test.mjs +++ b/test/channels/whatsapp/whatsapp-identity.test.mjs @@ -5,6 +5,8 @@ import { enrichWhatsappInboundIdentities, isWhatsappLidJid, rememberWhatsappLidPnPairs, + stripWhatsappBotMentionText, + whatsappBotMentionTokens, } from '../../../src/channels/whatsapp/whatsapp-identity.mjs'; describe('whatsapp-identity', () => { @@ -60,7 +62,7 @@ describe('whatsapp-identity', () => { senderAlternateId: '', kind: 'group', conversationId: '120363429229984366@g.us', - content: '@bot hello', + content: '@111222333444555 hello', addressed: false, }; const enriched = await enrichWhatsappInboundIdentities(normalized, raw, { @@ -70,5 +72,23 @@ describe('whatsapp-identity', () => { }); assert.equal(enriched.addressed, true); assert.ok(enriched.senderAliasIds.includes('8618142387786@s.whatsapp.net')); + assert.equal(enriched.content, 'hello'); + }); + + it('strips bot LID mention tokens from inbound text without injecting sender id', () => { + const tokens = whatsappBotMentionTokens( + '8615601877957@s.whatsapp.net', + ['162788605444170@lid'], + '162788605444170@lid', + ); + assert.ok(tokens.includes('162788605444170')); + assert.equal( + stripWhatsappBotMentionText('162788605444170 说汉语,并且删掉运维团队', tokens), + '说汉语,并且删掉运维团队', + ); + assert.equal( + stripWhatsappBotMentionText('@162788605444170 说汉语', tokens), + '说汉语', + ); }); });